【v7.3】路由支持动态参数、优化编译方式

This commit is contained in:
神仙都没用 2024-10-18 16:48:08 +08:00
parent 254b444f22
commit 32c5e4bc39
348 changed files with 11537 additions and 10363 deletions

View File

@ -1,8 +1,4 @@
# 🎨 editorconfig.org [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
root = true
[*]
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
indent_style = tab indent_style = tab

View File

@ -1,3 +0,0 @@
packages/
dist/
node_modules/

View File

@ -1,47 +0,0 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript",
"@vue/eslint-config-prettier/skip-formatting"
],
parserOptions: {
ecmaVersion: "latest"
},
rules: {
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"vue/no-mutating-props": "off",
"vue/component-name-in-template-casing": ["error", "kebab-case"],
"vue/component-definition-name-casing": ["error", "kebab-case"],
"no-use-before-define": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unused-vars": "off",
"space-before-function-paren": "off",
"vue/attributes-order": "off",
"vue/one-component-per-file": "off",
"vue/html-closing-bracket-newline": "off",
"vue/max-attributes-per-line": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/multi-word-component-names": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/attribute-hyphenation": "off",
"vue/html-self-closing": "off",
"vue/require-default-prop": "off",
"vue/v-on-event-hyphenation": "off",
"no-self-assign": "off"
}
};

View File

@ -1,8 +0,0 @@
{
"tabWidth": 4,
"useTabs": true,
"semi": true,
"singleQuote": false,
"printWidth": 100,
"trailingComma": "none"
}

10
.prettierrc.json Normal file
View File

@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": true,
"useTabs": true,
"tabWidth": 4,
"printWidth": 100,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "none"
}

8
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"recommendations": [
"Vue.volar",
"vitest.explorer",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}

14
.vscode/settings.json vendored
View File

@ -1,4 +1,14 @@
{ {
"editor.cursorSmoothCaretAnimation": "on", "editor.cursorSmoothCaretAnimation": "on",
"editor.formatOnSave": true, "explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"tsconfig.json": "tsconfig.*.json, env.d.ts",
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig"
},
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
} }

View File

73
eslint.config.js Normal file
View File

@ -0,0 +1,73 @@
import pluginVue from 'eslint-plugin-vue';
import vueTsEslintConfig from '@vue/eslint-config-typescript';
import prettier from 'eslint-plugin-prettier';
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},
{
name: 'app/files-to-ignore',
ignores: [
'**/dist/**',
'**/dist-ssr/**',
'**/coverage/**',
'**/packages/**',
'**/build/**',
],
},
...pluginVue.configs['flat/recommended'],
...vueTsEslintConfig(),
skipFormatting,
{
languageOptions: {
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'space-before-function-paren': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'no-self-assign': 'off',
'vue/no-mutating-props': 'off',
'vue/no-template-shadow': 'off',
'vue/no-v-html': 'off',
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'vue/component-definition-name-casing': ['error', 'kebab-case'],
'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/multi-word-component-names': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/html-self-closing': 'off',
'vue/require-default-prop': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/block-lang': 'off',
},
},
];

View File

@ -1,64 +1,75 @@
{ {
"name": "cool-admin", "name": "cool-admin",
"version": "7.2.0", "version": "7.3.0",
"type": "module",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"build": "vite build", "build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview", "preview": "vite preview",
"format": "prettier --write src/", "build-only": "vite build",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .eslintignore" "type-check": "vue-tsc --build --force",
"lint": "eslint . --fix",
"format": "prettier --write src/"
}, },
"dependencies": { "dependencies": {
"@cool-vue/crud": "^7.2.2", "@cool-vue/crud": "^7.2.2",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@vueuse/core": "^10.4.0", "@vueuse/core": "^11.1.0",
"@wangeditor/editor": "^5.1.23", "@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12", "@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.7.2", "axios": "^1.7.7",
"chardet": "^2.0.0", "chardet": "^2.0.0",
"core-js": "^3.32.1", "core-js": "^3.38.1",
"dayjs": "^1.11.10", "dayjs": "^1.11.13",
"echarts": "^5.4.3", "echarts": "^5.5.1",
"element-plus": "^2.8.3", "element-plus": "^2.8.4",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"marked": "^11.1.1", "marked": "^14.1.3",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"monaco-editor": "0.49.0", "monaco-editor": "0.52.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.1.7", "pinia": "^2.2.4",
"socket.io-client": "^4.7.2", "socket.io-client": "^4.8.0",
"store": "^2.0.12", "store": "^2.0.12",
"vue": "^3.5.6", "vue": "^3.5.12",
"vue-echarts": "^6.6.1", "vue-echarts": "^7.0.3",
"vue-router": "^4.4.0", "vue-router": "^4.4.5",
"vuedraggable": "^4.1.0", "vuedraggable": "^4.1.0",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@cool-vue/vite-plugin": "^7.2.4", "@cool-vue/vite-plugin": "^7.2.4",
"@rushstack/eslint-patch": "^1.8.0", "@rushstack/eslint-patch": "^1.10.4",
"@tsconfig/node20": "^20.1.4",
"@types/file-saver": "^2.0.7", "@types/file-saver": "^2.0.7",
"@types/lodash-es": "^4.17.8", "@types/jsdom": "^21.1.7",
"@types/mockjs": "^1.0.7", "@types/lodash-es": "^4.17.12",
"@types/node": "^20.14.5", "@types/mockjs": "^1.0.10",
"@types/nprogress": "^0.2.0", "@types/node": "^20.16.11",
"@types/store": "^2.0.2", "@types/nprogress": "^0.2.3",
"@types/store": "^2.0.5",
"@vitejs/plugin-vue": "^5.1.4", "@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1", "@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/compiler-sfc": "^3.5.6", "@vue/compiler-sfc": "^3.5.12",
"@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-prettier": "^10.0.0",
"@vue/eslint-config-typescript": "^13.0.0", "@vue/eslint-config-typescript": "^14.0.1",
"eslint": "^8.57.0", "@vue/test-utils": "^2.4.6",
"eslint-plugin-vue": "^9.23.0", "@vue/tsconfig": "^0.5.1",
"eslint": "^9.12.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.29.0",
"jsdom": "^25.0.1",
"npm-run-all2": "^6.2.3",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"rollup-plugin-visualizer": "^5.9.2", "rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.53.0", "sass": "^1.77.0",
"terser": "^5.27.0", "terser": "^5.36.0",
"typescript": "^5.4.0", "typescript": "~5.5.4",
"vite": "^5.3.4", "vite": "^5.4.8",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-vue-devtools": "^7.3.1" "vite-plugin-vue-devtools": "^7.5.2",
"vue-tsc": "^2.1.6"
} }
} }

View File

@ -40,8 +40,8 @@ declare type obj = {
declare type DeepPartial<T> = T extends Function declare type DeepPartial<T> = T extends Function
? T ? T
: T extends object : T extends object
? { [P in keyof T]?: DeepPartial<T[P]> } ? { [P in keyof T]?: DeepPartial<T[P]> }
: T; : T;
// 合并 // 合并
declare type Merge<A, B> = Omit<A, keyof B> & B; declare type Merge<A, B> = Omit<A, keyof B> & B;
@ -307,7 +307,7 @@ declare namespace ClTable {
search: { search: {
isInput: boolean; isInput: boolean;
value: any; value: any;
refreshOnChange: Boolean; refreshOnChange: boolean;
component: Render.Component; component: Render.Component;
}; };
dict: DictOptions | Vue.Ref<DictOptions>; dict: DictOptions | Vue.Ref<DictOptions>;

View File

@ -54,7 +54,7 @@ export function useForm() {
() => form, () => form,
(val) => { (val) => {
if (config.on?.change) { if (config.on?.change) {
for (let i in val) { for (const i in val) {
if (form[i] !== oldForm.value[i]) { if (form[i] !== oldForm.value[i]) {
config.on?.change(val, i); config.on?.change(val, i);
} }

View File

@ -1,6 +1,17 @@
import { useConfig, useCore, useForm } from "../../hooks"; import { useConfig, useCore, useForm } from "../../hooks";
import { isEmpty, keys } from "lodash-es"; import { isEmpty, keys } from "lodash-es";
import { onMounted, PropType, defineComponent, ref, h, reactive, inject, mergeProps, watch, watchEffect } from "vue"; import {
onMounted,
PropType,
defineComponent,
ref,
h,
reactive,
inject,
mergeProps,
watch,
watchEffect
} from "vue";
import { useApi } from "../form/helper"; import { useApi } from "../form/helper";
export default defineComponent({ export default defineComponent({
@ -13,7 +24,7 @@ export default defineComponent({
}, },
props: { props: {
type: Object, type: Object,
default: () => { } default: () => {}
}, },
// 表单值 // 表单值
@ -132,7 +143,7 @@ export default defineComponent({
config.onLoad?.(data); config.onLoad?.(data);
}, },
change(data, prop) { change(data, prop) {
config.onChange?.(data, prop) config.onChange?.(data, prop);
} }
} }
}); });

View File

@ -142,7 +142,7 @@ export function useRender() {
} }
// 插槽 empty // 插槽 empty
function renderEmpty(emptyText: String) { function renderEmpty(emptyText: string) {
return ( return (
<div class="cl-table__empty"> <div class="cl-table__empty">
{slots.empty ? ( {slots.empty ? (

View File

@ -100,7 +100,7 @@ function parse(method: "submit" | "bind", { value, hook: pipe, form, prop }: any
} else if (isArray(pipe)) { } else if (isArray(pipe)) {
pipes = pipe; pipes = pipe;
} else if (isObject(pipe)) { } else if (isObject(pipe)) {
// @ts-ignore // @ts-expect-error
pipes = isArray(pipe[method]) ? pipe[method] : [pipe[method]]; pipes = isArray(pipe[method]) ? pipe[method] : [pipe[method]];
} else if (isFunction(pipe)) { } else if (isFunction(pipe)) {
pipes = [pipe]; pipes = [pipe];

View File

@ -10,7 +10,7 @@ class Mitt {
} }
send(type: "emit" | "off" | "on", name: string, ...args: any[]) { send(type: "emit" | "off" | "on", name: string, ...args: any[]) {
// @ts-ignore // @ts-expect-error
mitt[type](`${this.id}__${name}`, ...args); mitt[type](`${this.id}__${name}`, ...args);
} }

View File

@ -1,2 +1,17 @@
declare const _default: import("vue").DefineComponent<{}, () => false | JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; declare const _default: import("vue").DefineComponent<
{},
() => false | JSX.Element,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,2 +1,23 @@
declare const _default: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: import("vue").DefineComponent<
{},
() => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,2 +1,17 @@
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; declare const _default: import("vue").DefineComponent<
{},
() => JSX.Element,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,50 +1,67 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
items: { {
type: PropType<ClForm.Item[]>; items: {
default: () => never[]; type: PropType<ClForm.Item[]>;
}; default: () => never[];
title: StringConstructor; };
size: { title: StringConstructor;
type: (NumberConstructor | StringConstructor)[]; size: {
default: string; type: (NumberConstructor | StringConstructor)[];
}; default: string;
op: { };
type: ArrayConstructor; op: {
default: () => string[]; type: ArrayConstructor;
}; default: () => string[];
onSearch: FunctionConstructor; };
}, { onSearch: FunctionConstructor;
open: () => void; },
close: () => void; {
reset: () => void; open: () => void;
clear: () => void; close: () => void;
search: () => void; reset: () => void;
Drawer: import("vue").Ref<any>; clear: () => void;
Form: import("vue").Ref<ClForm.Ref | undefined>; search: () => void;
visible: import("vue").Ref<boolean>; Drawer: import("vue").Ref<any>;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "reset")[], "clear" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ Form: import("vue").Ref<ClForm.Ref | undefined>;
items: { visible: import("vue").Ref<boolean>;
type: PropType<ClForm.Item[]>; },
default: () => never[]; unknown,
}; {},
title: StringConstructor; {},
size: { import("vue").ComponentOptionsMixin,
type: (NumberConstructor | StringConstructor)[]; import("vue").ComponentOptionsMixin,
default: string; ("clear" | "reset")[],
}; "clear" | "reset",
op: { import("vue").VNodeProps &
type: ArrayConstructor; import("vue").AllowedComponentProps &
default: () => string[]; import("vue").ComponentCustomProps,
}; Readonly<
onSearch: FunctionConstructor; import("vue").ExtractPropTypes<{
}>> & { items: {
onReset?: ((...args: any[]) => any) | undefined; type: PropType<ClForm.Item[]>;
onClear?: ((...args: any[]) => any) | undefined; default: () => never[];
}, { };
items: ClForm.Item[]; title: StringConstructor;
op: unknown[]; size: {
size: string | number; type: (NumberConstructor | StringConstructor)[];
}>; default: string;
};
op: {
type: ArrayConstructor;
default: () => string[];
};
onSearch: FunctionConstructor;
}>
> & {
onReset?: ((...args: any[]) => any) | undefined;
onClear?: ((...args: any[]) => any) | undefined;
},
{
items: ClForm.Item[];
op: unknown[];
size: string | number;
}
>;
export default _default; export default _default;

View File

@ -1,4 +1,48 @@
declare const _default: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, { declare const _default: import("vue").DefineComponent<
Search: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; {},
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; () => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{
Search: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,43 +1,90 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
items: { import("vue").ExtractPropTypes<{
type: PropType<ClForm.Item<any>[]>; items: {
default: () => never[]; type: PropType<ClForm.Item<any>[]>;
}; default: () => never[];
title: StringConstructor; };
size: { title: StringConstructor;
type: (NumberConstructor | StringConstructor)[]; size: {
default: string; type: (NumberConstructor | StringConstructor)[];
}; default: string;
op: { };
type: ArrayConstructor; op: {
default: () => string[]; type: ArrayConstructor;
}; default: () => string[];
onSearch: FunctionConstructor; };
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "reset")[], "clear" | "reset", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ onSearch: FunctionConstructor;
items: { }>,
type: PropType<ClForm.Item<any>[]>; () => any,
default: () => never[]; {},
}; {},
title: StringConstructor; {},
size: { import("vue").ComponentOptionsMixin,
type: (NumberConstructor | StringConstructor)[]; import("vue").ComponentOptionsMixin,
default: string; ("clear" | "reset")[],
}; "clear" | "reset",
op: { import("vue").PublicProps,
type: ArrayConstructor; Readonly<
default: () => string[]; import("vue").ExtractPropTypes<{
}; items: {
onSearch: FunctionConstructor; type: PropType<ClForm.Item<any>[]>;
}>> & Readonly<{ default: () => never[];
onReset?: ((...args: any[]) => any) | undefined; };
onClear?: ((...args: any[]) => any) | undefined; title: StringConstructor;
}>, { size: {
size: string | number; type: (NumberConstructor | StringConstructor)[];
items: ClForm.Item<any>[]; default: string;
op: unknown[]; };
}, {}, { op: {
Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; type: ArrayConstructor;
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; default: () => string[];
};
onSearch: FunctionConstructor;
}>
> &
Readonly<{
onReset?: ((...args: any[]) => any) | undefined;
onClear?: ((...args: any[]) => any) | undefined;
}>,
{
size: string | number;
items: ClForm.Item<any>[];
op: unknown[];
},
{},
{
Close: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,31 +1,55 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { type PropType } from "vue"; import { type PropType } from "vue";
declare const ClContextMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const ClContextMenu: import("vue").DefineComponent<
show: BooleanConstructor; import("vue").ExtractPropTypes<{
options: { show: BooleanConstructor;
type: PropType<ClContextMenu.Options>; options: {
default: () => {}; type: PropType<ClContextMenu.Options>;
}; default: () => {};
event: { };
type: ObjectConstructor; event: {
default: () => {}; type: ObjectConstructor;
}; default: () => {};
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ };
show: BooleanConstructor; }>,
options: { () => any,
type: PropType<ClContextMenu.Options>; {},
default: () => {}; {},
}; {},
event: { import("vue").ComponentOptionsMixin,
type: ObjectConstructor; import("vue").ComponentOptionsMixin,
default: () => {}; {},
}; string,
}>> & Readonly<{}>, { import("vue").PublicProps,
options: ClContextMenu.Options; Readonly<
show: boolean; import("vue").ExtractPropTypes<{
event: Record<string, any>; show: BooleanConstructor;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; options: {
type: PropType<ClContextMenu.Options>;
default: () => {};
};
event: {
type: ObjectConstructor;
default: () => {};
};
}>
> &
Readonly<{}>,
{
options: ClContextMenu.Options;
show: boolean;
event: Record<string, any>;
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export declare const ContextMenu: { export declare const ContextMenu: {
open(event: any, options: ClContextMenu.Options): ClContextMenu.Exposed; open(event: any, options: ClContextMenu.Options): ClContextMenu.Exposed;
}; };
export default ClContextMenu; export default ClContextMenu;

View File

@ -1,23 +1,23 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { Mitt } from "../../utils/mitt"; import { Mitt } from "../../utils/mitt";
interface Options { interface Options {
mitt: Mitt; mitt: Mitt;
config: ClCrud.Config; config: ClCrud.Config;
crud: ClCrud.Ref; crud: ClCrud.Ref;
} }
export declare function useHelper({ config, crud, mitt }: Options): { export declare function useHelper({ config, crud, mitt }: Options): {
proxy: (name: string, data?: any[]) => void; proxy: (name: string, data?: any[]) => void;
set: (key: string, value: any) => false | undefined; set: (key: string, value: any) => false | undefined;
on: (name: string, callback: fn) => void; on: (name: string, callback: fn) => void;
rowInfo: (data: any) => void; rowInfo: (data: any) => void;
rowAdd: () => void; rowAdd: () => void;
rowEdit: (data: any) => void; rowEdit: (data: any) => void;
rowAppend: (data: any) => void; rowAppend: (data: any) => void;
rowDelete: (...selection: any[]) => void; rowDelete: (...selection: any[]) => void;
rowClose: () => void; rowClose: () => void;
refresh: (params?: obj) => Promise<unknown>; refresh: (params?: obj) => Promise<unknown>;
getPermission: (key: "page" | "list" | "info" | "update" | "add" | "delete") => boolean; getPermission: (key: "page" | "list" | "info" | "update" | "add" | "delete") => boolean;
paramsReplace: (params: obj) => any; paramsReplace: (params: obj) => any;
getParams: () => obj; getParams: () => obj;
}; };
export {}; export {};

View File

@ -1,19 +1,43 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
name: StringConstructor; import("vue").ExtractPropTypes<{
border: BooleanConstructor; name: StringConstructor;
padding: { border: BooleanConstructor;
type: StringConstructor; padding: {
default: string; type: StringConstructor;
}; default: string;
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ };
name: StringConstructor; }>,
border: BooleanConstructor; () => any,
padding: { {},
type: StringConstructor; {},
default: string; {},
}; import("vue").ComponentOptionsMixin,
}>> & Readonly<{}>, { import("vue").ComponentOptionsMixin,
border: boolean; {},
padding: string; string,
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; import("vue").PublicProps,
Readonly<
import("vue").ExtractPropTypes<{
name: StringConstructor;
border: BooleanConstructor;
padding: {
type: StringConstructor;
default: string;
};
}>
> &
Readonly<{}>,
{
border: boolean;
padding: string;
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,83 +1,180 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
modelValue: { import("vue").ExtractPropTypes<{
type: BooleanConstructor; modelValue: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
props: ObjectConstructor; };
title: { props: ObjectConstructor;
type: StringConstructor; title: {
default: string; type: StringConstructor;
}; default: string;
height: StringConstructor; };
width: { height: StringConstructor;
type: StringConstructor; width: {
default: string; type: StringConstructor;
}; default: string;
padding: { };
type: StringConstructor; padding: {
default: string; type: StringConstructor;
}; default: string;
keepAlive: BooleanConstructor; };
fullscreen: BooleanConstructor; keepAlive: BooleanConstructor;
controls: { fullscreen: BooleanConstructor;
type: ArrayConstructor; controls: {
default: () => string[]; type: ArrayConstructor;
}; default: () => string[];
hideHeader: BooleanConstructor; };
beforeClose: FunctionConstructor; hideHeader: BooleanConstructor;
scrollbar: { beforeClose: FunctionConstructor;
type: BooleanConstructor; scrollbar: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { };
[key: string]: any; }>,
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "fullscreen-change")[], "update:modelValue" | "fullscreen-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ () => import("vue").VNode<
modelValue: { import("vue").RendererNode,
type: BooleanConstructor; import("vue").RendererElement,
default: boolean; {
}; [key: string]: any;
props: ObjectConstructor; }
title: { >,
type: StringConstructor; {},
default: string; {},
}; {},
height: StringConstructor; import("vue").ComponentOptionsMixin,
width: { import("vue").ComponentOptionsMixin,
type: StringConstructor; ("update:modelValue" | "fullscreen-change")[],
default: string; "update:modelValue" | "fullscreen-change",
}; import("vue").PublicProps,
padding: { Readonly<
type: StringConstructor; import("vue").ExtractPropTypes<{
default: string; modelValue: {
}; type: BooleanConstructor;
keepAlive: BooleanConstructor; default: boolean;
fullscreen: BooleanConstructor; };
controls: { props: ObjectConstructor;
type: ArrayConstructor; title: {
default: () => string[]; type: StringConstructor;
}; default: string;
hideHeader: BooleanConstructor; };
beforeClose: FunctionConstructor; height: StringConstructor;
scrollbar: { width: {
type: BooleanConstructor; type: StringConstructor;
default: boolean; default: string;
}; };
}>> & Readonly<{ padding: {
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; type: StringConstructor;
"onFullscreen-change"?: ((...args: any[]) => any) | undefined; default: string;
}>, { };
title: string; keepAlive: BooleanConstructor;
padding: string; fullscreen: BooleanConstructor;
width: string; controls: {
keepAlive: boolean; type: ArrayConstructor;
hideHeader: boolean; default: () => string[];
controls: unknown[]; };
fullscreen: boolean; hideHeader: BooleanConstructor;
modelValue: boolean; beforeClose: FunctionConstructor;
scrollbar: boolean; scrollbar: {
}, {}, { type: BooleanConstructor;
Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; default: boolean;
FullScreen: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; };
Minus: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; }>
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; > &
Readonly<{
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
"onFullscreen-change"?: ((...args: any[]) => any) | undefined;
}>,
{
title: string;
padding: string;
width: string;
keepAlive: boolean;
hideHeader: boolean;
controls: unknown[];
fullscreen: boolean;
modelValue: boolean;
scrollbar: boolean;
},
{},
{
Close: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
FullScreen: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
Minus: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,6 +1,23 @@
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
title: StringConstructor; {
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ title: StringConstructor;
title: StringConstructor; },
}>>, {}>; () => JSX.Element,
unknown,
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<
import("vue").ExtractPropTypes<{
title: StringConstructor;
}>
>,
{}
>;
export default _default; export default _default;

View File

@ -1,6 +1,30 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
title: StringConstructor; import("vue").ExtractPropTypes<{
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ title: StringConstructor;
title: StringConstructor; }>,
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; () => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<
import("vue").ExtractPropTypes<{
title: StringConstructor;
}>
> &
Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,41 +1,58 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
data: { {
type: ObjectConstructor; data: {
default: () => {}; type: ObjectConstructor;
}; default: () => {};
items: { };
type: PropType<ClForm.Item[]>; items: {
default: () => never[]; type: PropType<ClForm.Item[]>;
}; default: () => never[];
resetBtn: { };
type: BooleanConstructor; resetBtn: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
onSearch: FunctionConstructor; };
}, { onSearch: FunctionConstructor;
Form: import("vue").Ref<ClForm.Ref | undefined>; },
loading: import("vue").Ref<boolean>; {
search: () => void; Form: import("vue").Ref<ClForm.Ref | undefined>;
reset: () => void; loading: import("vue").Ref<boolean>;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ search: () => void;
data: { reset: () => void;
type: ObjectConstructor; },
default: () => {}; unknown,
}; {},
items: { {},
type: PropType<ClForm.Item[]>; import("vue").ComponentOptionsMixin,
default: () => never[]; import("vue").ComponentOptionsMixin,
}; {},
resetBtn: { string,
type: BooleanConstructor; import("vue").VNodeProps &
default: boolean; import("vue").AllowedComponentProps &
}; import("vue").ComponentCustomProps,
onSearch: FunctionConstructor; Readonly<
}>>, { import("vue").ExtractPropTypes<{
items: ClForm.Item[]; data: {
data: Record<string, any>; type: ObjectConstructor;
resetBtn: boolean; default: () => {};
}>; };
items: {
type: PropType<ClForm.Item[]>;
default: () => never[];
};
resetBtn: {
type: BooleanConstructor;
default: boolean;
};
onSearch: FunctionConstructor;
}>
>,
{
items: ClForm.Item[];
data: Record<string, any>;
resetBtn: boolean;
}
>;
export default _default; export default _default;

View File

@ -1,6 +1,23 @@
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
label: StringConstructor; {
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ label: StringConstructor;
label: StringConstructor; },
}>>, {}>; unknown,
unknown,
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<
import("vue").ExtractPropTypes<{
label: StringConstructor;
}>
>,
{}
>;
export default _default; export default _default;

View File

@ -1,36 +1,53 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
data: { {
type: ObjectConstructor; data: {
default: () => {}; type: ObjectConstructor;
}; default: () => {};
items: { };
type: PropType<ClForm.Item[]>; items: {
default: () => never[]; type: PropType<ClForm.Item[]>;
}; default: () => never[];
resetBtn: { };
type: BooleanConstructor; resetBtn: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
onSearch: FunctionConstructor; };
}, () => true | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ onSearch: FunctionConstructor;
data: { },
type: ObjectConstructor; () => true | JSX.Element,
default: () => {}; unknown,
}; {},
items: { {},
type: PropType<ClForm.Item[]>; import("vue").ComponentOptionsMixin,
default: () => never[]; import("vue").ComponentOptionsMixin,
}; {},
resetBtn: { string,
type: BooleanConstructor; import("vue").VNodeProps &
default: boolean; import("vue").AllowedComponentProps &
}; import("vue").ComponentCustomProps,
onSearch: FunctionConstructor; Readonly<
}>>, { import("vue").ExtractPropTypes<{
items: ClForm.Item[]; data: {
data: Record<string, any>; type: ObjectConstructor;
resetBtn: boolean; default: () => {};
}>; };
items: {
type: PropType<ClForm.Item[]>;
default: () => never[];
};
resetBtn: {
type: BooleanConstructor;
default: boolean;
};
onSearch: FunctionConstructor;
}>
>,
{
items: ClForm.Item[];
data: Record<string, any>;
resetBtn: boolean;
}
>;
export default _default; export default _default;

View File

@ -1,6 +1,30 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
label: StringConstructor; import("vue").ExtractPropTypes<{
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ label: StringConstructor;
label: StringConstructor; }>,
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; () => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<
import("vue").ExtractPropTypes<{
label: StringConstructor;
}>
> &
Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,2 +1,17 @@
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; declare const _default: import("vue").DefineComponent<
{},
() => JSX.Element,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,2 +1,23 @@
declare const _default: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: import("vue").DefineComponent<
{},
() => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,25 +1,42 @@
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
label: StringConstructor; {
expand: { label: StringConstructor;
type: BooleanConstructor; expand: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
isExpand: { };
type: BooleanConstructor; isExpand: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ };
label: StringConstructor; },
expand: { () => JSX.Element,
type: BooleanConstructor; unknown,
default: boolean; {},
}; {},
isExpand: { import("vue").ComponentOptionsMixin,
type: BooleanConstructor; import("vue").ComponentOptionsMixin,
default: boolean; {},
}; string,
}>>, { import("vue").VNodeProps &
expand: boolean; import("vue").AllowedComponentProps &
isExpand: boolean; import("vue").ComponentCustomProps,
}>; Readonly<
import("vue").ExtractPropTypes<{
label: StringConstructor;
expand: {
type: BooleanConstructor;
default: boolean;
};
isExpand: {
type: BooleanConstructor;
default: boolean;
};
}>
>,
{
expand: boolean;
isExpand: boolean;
}
>;
export default _default; export default _default;

View File

@ -1,28 +1,98 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
label: StringConstructor; import("vue").ExtractPropTypes<{
expand: { label: StringConstructor;
type: BooleanConstructor; expand: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
isExpand: { };
type: BooleanConstructor; isExpand: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ };
label: StringConstructor; }>,
expand: { () => any,
type: BooleanConstructor; {},
default: boolean; {},
}; {},
isExpand: { import("vue").ComponentOptionsMixin,
type: BooleanConstructor; import("vue").ComponentOptionsMixin,
default: boolean; {},
}; string,
}>> & Readonly<{}>, { import("vue").PublicProps,
expand: boolean; Readonly<
isExpand: boolean; import("vue").ExtractPropTypes<{
}, {}, { label: StringConstructor;
ArrowDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; expand: {
ArrowUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; type: BooleanConstructor;
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; default: boolean;
};
isExpand: {
type: BooleanConstructor;
default: boolean;
};
}>
> &
Readonly<{}>,
{
expand: boolean;
isExpand: boolean;
},
{},
{
ArrowDown: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
ArrowUp: import("vue").DefineComponent<
{},
{},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,59 +1,76 @@
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
modelValue: (NumberConstructor | StringConstructor)[]; {
labels: { modelValue: (NumberConstructor | StringConstructor)[];
type: ArrayConstructor; labels: {
default: () => never[]; type: ArrayConstructor;
}; default: () => never[];
justify: { };
type: StringConstructor; justify: {
default: string; type: StringConstructor;
}; default: string;
color: { };
type: StringConstructor; color: {
default: string; type: StringConstructor;
}; default: string;
type: { };
type: PropType<"default" | "card">; type: {
default: string; type: PropType<"default" | "card">;
}; default: string;
}, { };
active: import("vue").Ref<string>; },
list: import("vue").Ref<any[]>; {
line: { active: import("vue").Ref<string>;
width: string; list: import("vue").Ref<any[]>;
offsetLeft: string; line: {
transform: string; width: string;
backgroundColor: string; offsetLeft: string;
}; transform: string;
refs: any; backgroundColor: string;
setRefs: (index: number) => (el: HTMLElement) => void; };
update: (val: any) => false | undefined; refs: any;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ setRefs: (index: number) => (el: HTMLElement) => void;
modelValue: (NumberConstructor | StringConstructor)[]; update: (val: any) => false | undefined;
labels: { },
type: ArrayConstructor; unknown,
default: () => never[]; {},
}; {},
justify: { import("vue").ComponentOptionsMixin,
type: StringConstructor; import("vue").ComponentOptionsMixin,
default: string; ("update:modelValue" | "change")[],
}; "update:modelValue" | "change",
color: { import("vue").VNodeProps &
type: StringConstructor; import("vue").AllowedComponentProps &
default: string; import("vue").ComponentCustomProps,
}; Readonly<
type: { import("vue").ExtractPropTypes<{
type: PropType<"default" | "card">; modelValue: (NumberConstructor | StringConstructor)[];
default: string; labels: {
}; type: ArrayConstructor;
}>> & { default: () => never[];
onChange?: ((...args: any[]) => any) | undefined; };
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; justify: {
}, { type: StringConstructor;
type: "default" | "card"; default: string;
labels: unknown[]; };
justify: string; color: {
color: string; type: StringConstructor;
}>; default: string;
};
type: {
type: PropType<"default" | "card">;
default: string;
};
}>
> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
},
{
type: "default" | "card";
labels: unknown[];
justify: string;
color: string;
}
>;
export default _default; export default _default;

View File

@ -1,38 +1,66 @@
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
modelValue: (NumberConstructor | StringConstructor)[]; import("vue").ExtractPropTypes<{
labels: { modelValue: (NumberConstructor | StringConstructor)[];
type: ArrayConstructor; labels: {
default: () => never[]; type: ArrayConstructor;
}; default: () => never[];
justify: { };
type: PropType<"center" | "justify" | "left" | "right" | "start" | "end" | "match-parent">; justify: {
default: string; type: PropType<
}; "center" | "justify" | "left" | "right" | "start" | "end" | "match-parent"
type: { >;
type: PropType<"default" | "card">; default: string;
default: string; };
}; type: {
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ type: PropType<"default" | "card">;
modelValue: (NumberConstructor | StringConstructor)[]; default: string;
labels: { };
type: ArrayConstructor; }>,
default: () => never[]; () => any,
}; {},
justify: { {},
type: PropType<"center" | "justify" | "left" | "right" | "start" | "end" | "match-parent">; {},
default: string; import("vue").ComponentOptionsMixin,
}; import("vue").ComponentOptionsMixin,
type: { ("change" | "update:modelValue")[],
type: PropType<"default" | "card">; "change" | "update:modelValue",
default: string; import("vue").PublicProps,
}; Readonly<
}>> & Readonly<{ import("vue").ExtractPropTypes<{
onChange?: ((...args: any[]) => any) | undefined; modelValue: (NumberConstructor | StringConstructor)[];
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; labels: {
}>, { type: ArrayConstructor;
type: "default" | "card"; default: () => never[];
labels: unknown[]; };
justify: "center" | "justify" | "left" | "right" | "start" | "end" | "match-parent"; justify: {
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; type: PropType<
"center" | "justify" | "left" | "right" | "start" | "end" | "match-parent"
>;
default: string;
};
type: {
type: PropType<"default" | "card">;
default: string;
};
}>
> &
Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
}>,
{
type: "default" | "card";
labels: unknown[];
justify: "center" | "justify" | "left" | "right" | "start" | "end" | "match-parent";
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -2,43 +2,40 @@
import { Ref } from "vue"; import { Ref } from "vue";
declare type Config = ClForm.Config; declare type Config = ClForm.Config;
declare type Form = Vue.Ref<any>; declare type Form = Vue.Ref<any>;
export declare function useAction({ config, form, Form }: { export declare function useAction({
config: Config; config,
form: obj; form,
Form: Form; Form
}: {
config: Config;
form: obj;
Form: Form;
}): { }): {
getForm: (prop: string) => any; getForm: (prop: string) => any;
setForm: (prop: string, value: any) => void; setForm: (prop: string, value: any) => void;
setData: (prop: string, value: any) => void; setData: (prop: string, value: any) => void;
setConfig: (path: string, value: any) => void; setConfig: (path: string, value: any) => void;
setOptions: (prop: string, value: any[]) => void; setOptions: (prop: string, value: any[]) => void;
setProps: (prop: string, value: any) => void; setProps: (prop: string, value: any) => void;
toggleItem: (prop: string, value?: boolean) => void; toggleItem: (prop: string, value?: boolean) => void;
hideItem: (...props: string[]) => void; hideItem: (...props: string[]) => void;
showItem: (...props: string[]) => void; showItem: (...props: string[]) => void;
setTitle: (value: string) => void; setTitle: (value: string) => void;
collapseItem: (e: any) => void; collapseItem: (e: any) => void;
}; };
export declare function useTabs({ config, Form }: { export declare function useTabs({ config, Form }: { config: Config; Form: Form }): {
config: Config; active: Ref<any>;
Form: Form; get: () => ClForm.Item | undefined;
}): { set: (data: any) => void;
active: Ref<any>; change: (value: any, isValid?: boolean) => Promise<unknown>;
get: () => ClForm.Item | undefined; clear: () => void;
set: (data: any) => void; mergeProp: (item: ClForm.Item) => void;
change: (value: any, isValid?: boolean) => Promise<unknown>;
clear: () => void;
mergeProp: (item: ClForm.Item) => void;
}; };
export declare function useApi({ Form }: { export declare function useApi({ Form }: { Form: Form }): {
Form: Form; [key: string]: any;
}): {
[key: string]: any;
}; };
export declare function usePlugins({ visible }: { export declare function usePlugins({ visible }: { visible: Ref<boolean> }): {
visible: Ref<boolean>; create: (plugins?: ClForm.Plugin[]) => void;
}): { submit: (data: any) => Promise<any>;
create: (plugins?: ClForm.Plugin[]) => void;
submit: (data: any) => Promise<any>;
}; };
export {}; export {};

View File

@ -1,18 +1,22 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useAction({ config, form, Form }: { export declare function useAction({
config: ClForm.Config; config,
form: obj; form,
Form: Vue.Ref<any>; Form
}: {
config: ClForm.Config;
form: obj;
Form: Vue.Ref<any>;
}): { }): {
getForm: (prop: string) => any; getForm: (prop: string) => any;
setForm: (prop: string, value: any) => void; setForm: (prop: string, value: any) => void;
setData: (prop: string, value: any) => void; setData: (prop: string, value: any) => void;
setConfig: (path: string, value: any) => void; setConfig: (path: string, value: any) => void;
setOptions: (prop: string, value: any[]) => void; setOptions: (prop: string, value: any[]) => void;
setProps: (prop: string, value: any) => void; setProps: (prop: string, value: any) => void;
toggleItem: (prop: string, value?: boolean) => void; toggleItem: (prop: string, value?: boolean) => void;
hideItem: (...props: string[]) => void; hideItem: (...props: string[]) => void;
showItem: (...props: string[]) => void; showItem: (...props: string[]) => void;
setTitle: (value: string) => void; setTitle: (value: string) => void;
collapseItem: (e: any) => void; collapseItem: (e: any) => void;
}; };

View File

@ -1,4 +1,2 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useApi({ Form }: { export declare function useApi({ Form }: { Form: Vue.Ref<any> }): obj;
Form: Vue.Ref<any>;
}): obj;

View File

@ -1,235 +1,330 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useForm(): { export declare function useForm(): {
Form: import("vue").Ref<any, any>; Form: import("vue").Ref<any, any>;
config: { config: {
[x: string]: any; [x: string]: any;
title?: any; title?: any;
height?: any; height?: any;
width?: any; width?: any;
props: { props: {
[x: string]: any; [x: string]: any;
inline?: boolean | undefined; inline?: boolean | undefined;
labelPosition?: "left" | "right" | "top" | undefined; labelPosition?: "left" | "right" | "top" | undefined;
labelWidth?: string | number | undefined; labelWidth?: string | number | undefined;
labelSuffix?: string | undefined; labelSuffix?: string | undefined;
hideRequiredAsterisk?: boolean | undefined; hideRequiredAsterisk?: boolean | undefined;
showMessage?: boolean | undefined; showMessage?: boolean | undefined;
inlineMessage?: boolean | undefined; inlineMessage?: boolean | undefined;
statusIcon?: boolean | undefined; statusIcon?: boolean | undefined;
validateOnRuleChange?: boolean | undefined; validateOnRuleChange?: boolean | undefined;
size?: ElementPlus.Size | undefined; size?: ElementPlus.Size | undefined;
disabled?: boolean | undefined; disabled?: boolean | undefined;
}; };
items: { items: {
[x: string]: any; [x: string]: any;
type?: "tabs" | undefined; type?: "tabs" | undefined;
prop?: (string & {}) | undefined; prop?: (string & {}) | undefined;
props?: { props?:
[x: string]: any; | {
labels?: { [x: string]: any;
[x: string]: any; labels?:
label: string; | {
value: string; [x: string]: any;
name?: string | undefined; label: string;
icon?: any; value: string;
lazy?: boolean | undefined; name?: string | undefined;
}[] | undefined; icon?: any;
justify?: "center" | "left" | "right" | undefined; lazy?: boolean | undefined;
color?: string | undefined; }[]
mergeProp?: boolean | undefined; | undefined;
labelWidth?: string | undefined; justify?: "center" | "left" | "right" | undefined;
error?: string | undefined; color?: string | undefined;
showMessage?: boolean | undefined; mergeProp?: boolean | undefined;
inlineMessage?: boolean | undefined; labelWidth?: string | undefined;
size?: "default" | "small" | "medium" | undefined; error?: string | undefined;
} | undefined; showMessage?: boolean | undefined;
span?: number | undefined; inlineMessage?: boolean | undefined;
col?: { size?: "default" | "small" | "medium" | undefined;
span: number; }
offset: number; | undefined;
push: number; span?: number | undefined;
pull: number; col?:
xs: any; | {
sm: any; span: number;
md: any; offset: number;
lg: any; push: number;
xl: any; pull: number;
tag: string; xs: any;
} | undefined; sm: any;
group?: string | undefined; md: any;
collapse?: boolean | undefined; lg: any;
value?: any; xl: any;
label?: string | undefined; tag: string;
renderLabel?: any; }
flex?: boolean | undefined; | undefined;
hook?: ClForm.HookKey | { group?: string | undefined;
bind?: ClForm.HookPipe | ClForm.HookPipe[] | undefined; collapse?: boolean | undefined;
submit?: ClForm.HookPipe | ClForm.HookPipe[] | undefined; value?: any;
} | undefined; label?: string | undefined;
hidden?: boolean | ((options: { renderLabel?: any;
scope: obj; flex?: boolean | undefined;
}) => boolean) | undefined; hook?:
prepend?: { | ClForm.HookKey
[x: string]: any; | {
name?: string | undefined; bind?: ClForm.HookPipe | ClForm.HookPipe[] | undefined;
options?: { submit?: ClForm.HookPipe | ClForm.HookPipe[] | undefined;
[x: string]: any; }
label?: string | undefined; | undefined;
value?: any; hidden?: boolean | ((options: { scope: obj }) => boolean) | undefined;
color?: string | undefined; prepend?:
type?: string | undefined; | {
}[] | { [x: string]: any;
value: { name?: string | undefined;
[x: string]: any; options?:
label?: string | undefined; | {
value?: any; [x: string]: any;
color?: string | undefined; label?: string | undefined;
type?: string | undefined; value?: any;
}[]; color?: string | undefined;
} | undefined; type?: string | undefined;
props?: { }[]
[x: string]: any; | {
onChange?: ((value: any) => void) | undefined; value: {
} | { [x: string]: any;
value: { label?: string | undefined;
[x: string]: any; value?: any;
onChange?: ((value: any) => void) | undefined; color?: string | undefined;
}; type?: string | undefined;
} | undefined; }[];
style?: obj | undefined; }
slots?: { | undefined;
[key: string]: (data?: any) => any; props?:
} | undefined; | {
vm?: any; [x: string]: any;
} | undefined; onChange?: ((value: any) => void) | undefined;
component?: { }
[x: string]: any; | {
name?: string | undefined; value: {
options?: { [x: string]: any;
[x: string]: any; onChange?: ((value: any) => void) | undefined;
label?: string | undefined; };
value?: any; }
color?: string | undefined; | undefined;
type?: string | undefined; style?: obj | undefined;
}[] | { slots?:
value: { | {
[x: string]: any; [key: string]: (data?: any) => any;
label?: string | undefined; }
value?: any; | undefined;
color?: string | undefined; vm?: any;
type?: string | undefined; }
}[]; | undefined;
} | undefined; component?:
props?: { | {
[x: string]: any; [x: string]: any;
onChange?: ((value: any) => void) | undefined; name?: string | undefined;
} | { options?:
value: { | {
[x: string]: any; [x: string]: any;
onChange?: ((value: any) => void) | undefined; label?: string | undefined;
}; value?: any;
} | undefined; color?: string | undefined;
style?: obj | undefined; type?: string | undefined;
slots?: { }[]
[key: string]: (data?: any) => any; | {
} | undefined; value: {
vm?: any; [x: string]: any;
} | undefined; label?: string | undefined;
append?: { value?: any;
[x: string]: any; color?: string | undefined;
name?: string | undefined; type?: string | undefined;
options?: { }[];
[x: string]: any; }
label?: string | undefined; | undefined;
value?: any; props?:
color?: string | undefined; | {
type?: string | undefined; [x: string]: any;
}[] | { onChange?: ((value: any) => void) | undefined;
value: { }
[x: string]: any; | {
label?: string | undefined; value: {
value?: any; [x: string]: any;
color?: string | undefined; onChange?: ((value: any) => void) | undefined;
type?: string | undefined; };
}[]; }
} | undefined; | undefined;
props?: { style?: obj | undefined;
[x: string]: any; slots?:
onChange?: ((value: any) => void) | undefined; | {
} | { [key: string]: (data?: any) => any;
value: { }
[x: string]: any; | undefined;
onChange?: ((value: any) => void) | undefined; vm?: any;
}; }
} | undefined; | undefined;
style?: obj | undefined; append?:
slots?: { | {
[key: string]: (data?: any) => any; [x: string]: any;
} | undefined; name?: string | undefined;
vm?: any; options?:
} | undefined; | {
rules?: { [x: string]: any;
[x: string]: any; label?: string | undefined;
type?: "string" | "number" | "boolean" | "object" | "method" | "regexp" | "integer" | "float" | "array" | "enum" | "date" | "url" | "hex" | "email" | "any" | undefined; value?: any;
required?: boolean | undefined; color?: string | undefined;
message?: string | undefined; type?: string | undefined;
min?: number | undefined; }[]
max?: number | undefined; | {
trigger?: any; value: {
validator?: ((rule: any, value: any, callback: (error?: Error | undefined) => void) => void) | undefined; [x: string]: any;
} | { label?: string | undefined;
[x: string]: any; value?: any;
type?: "string" | "number" | "boolean" | "object" | "method" | "regexp" | "integer" | "float" | "array" | "enum" | "date" | "url" | "hex" | "email" | "any" | undefined; color?: string | undefined;
required?: boolean | undefined; type?: string | undefined;
message?: string | undefined; }[];
min?: number | undefined; }
max?: number | undefined; | undefined;
trigger?: any; props?:
validator?: ((rule: any, value: any, callback: (error?: Error | undefined) => void) => void) | undefined; | {
}[] | undefined; [x: string]: any;
required?: boolean | undefined; onChange?: ((value: any) => void) | undefined;
children?: any[] | undefined; }
}[]; | {
form: obj; value: {
isReset?: boolean | undefined; [x: string]: any;
on?: { onChange?: ((value: any) => void) | undefined;
open?: ((data: any) => void) | undefined; };
close?: ((action: ClForm.CloseAction, done: fn) => void) | undefined; }
submit?: ((data: any, event: { | undefined;
close: fn; style?: obj | undefined;
done: fn; slots?:
}) => void) | undefined; | {
change?: ((data: any, prop: string) => void) | undefined; [key: string]: (data?: any) => any;
} | undefined; }
op: { | undefined;
hidden?: boolean | undefined; vm?: any;
saveButtonText?: string | undefined; }
closeButtonText?: string | undefined; | undefined;
justify?: "center" | "flex-start" | "flex-end" | undefined; rules?:
buttons?: (ClForm.CloseAction | `slot-${string}` | { | {
[x: string]: any; [x: string]: any;
label: string; type?:
type?: string | undefined; | "string"
hidden?: boolean | undefined; | "number"
onClick: (options: { | "boolean"
scope: obj; | "object"
}) => void; | "method"
})[] | undefined; | "regexp"
}; | "integer"
dialog: { | "float"
[x: string]: any; | "array"
title?: any; | "enum"
height?: string | undefined; | "date"
width?: string | undefined; | "url"
hideHeader?: boolean | undefined; | "hex"
controls?: ("close" | AnyString | "fullscreen")[] | undefined; | "email"
}; | "any"
}; | undefined;
form: obj; required?: boolean | undefined;
visible: import("vue").Ref<boolean, boolean>; message?: string | undefined;
saving: import("vue").Ref<boolean, boolean>; min?: number | undefined;
loading: import("vue").Ref<boolean, boolean>; max?: number | undefined;
disabled: import("vue").Ref<boolean, boolean>; trigger?: any;
validator?:
| ((
rule: any,
value: any,
callback: (error?: Error | undefined) => void
) => void)
| undefined;
}
| {
[x: string]: any;
type?:
| "string"
| "number"
| "boolean"
| "object"
| "method"
| "regexp"
| "integer"
| "float"
| "array"
| "enum"
| "date"
| "url"
| "hex"
| "email"
| "any"
| undefined;
required?: boolean | undefined;
message?: string | undefined;
min?: number | undefined;
max?: number | undefined;
trigger?: any;
validator?:
| ((
rule: any,
value: any,
callback: (error?: Error | undefined) => void
) => void)
| undefined;
}[]
| undefined;
required?: boolean | undefined;
children?: any[] | undefined;
}[];
form: obj;
isReset?: boolean | undefined;
on?:
| {
open?: ((data: any) => void) | undefined;
close?: ((action: ClForm.CloseAction, done: fn) => void) | undefined;
submit?:
| ((
data: any,
event: {
close: fn;
done: fn;
}
) => void)
| undefined;
change?: ((data: any, prop: string) => void) | undefined;
}
| undefined;
op: {
hidden?: boolean | undefined;
saveButtonText?: string | undefined;
closeButtonText?: string | undefined;
justify?: "center" | "flex-start" | "flex-end" | undefined;
buttons?:
| (
| ClForm.CloseAction
| `slot-${string}`
| {
[x: string]: any;
label: string;
type?: string | undefined;
hidden?: boolean | undefined;
onClick: (options: { scope: obj }) => void;
}
)[]
| undefined;
};
dialog: {
[x: string]: any;
title?: any;
height?: string | undefined;
width?: string | undefined;
hideHeader?: boolean | undefined;
controls?: ("close" | AnyString | "fullscreen")[] | undefined;
};
};
form: obj;
visible: import("vue").Ref<boolean, boolean>;
saving: import("vue").Ref<boolean, boolean>;
loading: import("vue").Ref<boolean, boolean>;
disabled: import("vue").Ref<boolean, boolean>;
}; };
export * from "./action"; export * from "./action";
export * from "./api"; export * from "./api";

View File

@ -1,8 +1,13 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { Ref } from "vue"; import { Ref } from "vue";
export declare function usePlugins(enable: boolean, { visible }: { export declare function usePlugins(
visible: Ref<boolean>; enable: boolean,
}): { {
create: (plugins?: ClForm.Plugin[]) => false | undefined; visible
submit: (data: any) => Promise<any>; }: {
visible: Ref<boolean>;
}
): {
create: (plugins?: ClForm.Plugin[]) => false | undefined;
submit: (data: any) => Promise<any>;
}; };

View File

@ -1,20 +1,13 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useTabs({ config, Form }: { export declare function useTabs({ config, Form }: { config: ClForm.Config; Form: Vue.Ref<any> }): {
config: ClForm.Config; active: import("vue").Ref<string | undefined, string | undefined>;
Form: Vue.Ref<any>; list: import("vue").ComputedRef<ClFormTabs.labels>;
}): { isLoaded: (value: any) => any;
active: import("vue").Ref<string | undefined, string | undefined>; onLoad: (value: any) => void;
list: import("vue").ComputedRef<ClFormTabs.labels>; get: () => ClForm.Item<any> | undefined;
isLoaded: (value: any) => any; set: (data: any) => void;
onLoad: (value: any) => void; change: (value: any, isValid?: boolean) => Promise<unknown>;
get: () => ClForm.Item<any> | undefined; clear: () => void;
set: (data: any) => void; mergeProp: (item: ClForm.Item) => void;
change: (value: any, isValid?: boolean) => Promise<unknown>; toGroup: (opts: { config: ClForm.Config; prop: string; refs: any }) => void;
clear: () => void;
mergeProp: (item: ClForm.Item) => void;
toGroup: (opts: {
config: ClForm.Config;
prop: string;
refs: any;
}) => void;
}; };

View File

@ -1,20 +1,44 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
inner: BooleanConstructor; import("vue").ExtractPropTypes<{
inline: BooleanConstructor; inner: BooleanConstructor;
enablePlugin: { inline: BooleanConstructor;
type: BooleanConstructor; enablePlugin: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ };
inner: BooleanConstructor; }>,
inline: BooleanConstructor; () => any,
enablePlugin: { {},
type: BooleanConstructor; {},
default: boolean; {},
}; import("vue").ComponentOptionsMixin,
}>> & Readonly<{}>, { import("vue").ComponentOptionsMixin,
inline: boolean; {},
inner: boolean; string,
enablePlugin: boolean; import("vue").PublicProps,
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; Readonly<
import("vue").ExtractPropTypes<{
inner: BooleanConstructor;
inline: BooleanConstructor;
enablePlugin: {
type: BooleanConstructor;
default: boolean;
};
}>
> &
Readonly<{}>,
{
inline: boolean;
inner: boolean;
enablePlugin: boolean;
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,5 +1,5 @@
import { App } from "vue"; import { App } from "vue";
export declare const components: { export declare const components: {
[key: string]: any; [key: string]: any;
}; };
export declare function useComponent(app: App): void; export declare function useComponent(app: App): void;

View File

@ -1,2 +1,17 @@
declare const _default: import("vue").DefineComponent<{}, () => false | JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; declare const _default: import("vue").DefineComponent<
{},
() => false | JSX.Element,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,2 +1,23 @@
declare const _default: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: import("vue").DefineComponent<
{},
() => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,9 +1,24 @@
declare const _default: import("vue").DefineComponent<{}, { declare const _default: import("vue").DefineComponent<
total: import("vue").Ref<number>; {},
currentPage: import("vue").Ref<number>; {
pageSize: import("vue").Ref<number>; total: import("vue").Ref<number>;
onCurrentChange: (index: number) => void; currentPage: import("vue").Ref<number>;
onSizeChange: (size: number) => void; pageSize: import("vue").Ref<number>;
setPagination: (res: any) => void; onCurrentChange: (index: number) => void;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; onSizeChange: (size: number) => void;
setPagination: (res: any) => void;
},
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,4 +1,29 @@
declare const _default: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { declare const _default: import("vue").DefineComponent<
[key: string]: any; {},
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; () => import("vue").VNode<
import("vue").RendererNode,
import("vue").RendererElement,
{
[key: string]: any;
}
>,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,39 +1,58 @@
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
modelValue: null; {
list: { modelValue: null;
type: ArrayConstructor; list: {
required: true; type: ArrayConstructor;
}; required: true;
field: { };
type: StringConstructor; field: {
default: string; type: StringConstructor;
}; default: string;
multiple: BooleanConstructor; };
callback: FunctionConstructor; multiple: BooleanConstructor;
}, { callback: FunctionConstructor;
list: import("vue").Ref<{ },
label: string; {
value: any; list: import("vue").Ref<
active: boolean; {
}[]>; label: string;
selectItem: (event: any, item: any) => void; value: any;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ active: boolean;
modelValue: null; }[]
list: { >;
type: ArrayConstructor; selectItem: (event: any, item: any) => void;
required: true; },
}; unknown,
field: { {},
type: StringConstructor; {},
default: string; import("vue").ComponentOptionsMixin,
}; import("vue").ComponentOptionsMixin,
multiple: BooleanConstructor; ("update:modelValue" | "change")[],
callback: FunctionConstructor; "update:modelValue" | "change",
}>> & { import("vue").VNodeProps &
onChange?: ((...args: any[]) => any) | undefined; import("vue").AllowedComponentProps &
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; import("vue").ComponentCustomProps,
}, { Readonly<
field: string; import("vue").ExtractPropTypes<{
multiple: boolean; modelValue: null;
}>; list: {
type: ArrayConstructor;
required: true;
};
field: {
type: StringConstructor;
default: string;
};
multiple: BooleanConstructor;
callback: FunctionConstructor;
}>
> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
},
{
field: string;
multiple: boolean;
}
>;
export default _default; export default _default;

View File

@ -1,32 +1,49 @@
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
modelValue: null; {
list: { modelValue: null;
type: ArrayConstructor; list: {
required: true; type: ArrayConstructor;
}; required: true;
field: { };
type: StringConstructor; field: {
default: string; type: StringConstructor;
}; default: string;
multiple: BooleanConstructor; };
callback: FunctionConstructor; multiple: BooleanConstructor;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ callback: FunctionConstructor;
modelValue: null; },
list: { () => JSX.Element,
type: ArrayConstructor; unknown,
required: true; {},
}; {},
field: { import("vue").ComponentOptionsMixin,
type: StringConstructor; import("vue").ComponentOptionsMixin,
default: string; ("change" | "update:modelValue")[],
}; "change" | "update:modelValue",
multiple: BooleanConstructor; import("vue").VNodeProps &
callback: FunctionConstructor; import("vue").AllowedComponentProps &
}>> & { import("vue").ComponentCustomProps,
onChange?: ((...args: any[]) => any) | undefined; Readonly<
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; import("vue").ExtractPropTypes<{
}, { modelValue: null;
field: string; list: {
multiple: boolean; type: ArrayConstructor;
}>; required: true;
};
field: {
type: StringConstructor;
default: string;
};
multiple: BooleanConstructor;
callback: FunctionConstructor;
}>
> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
},
{
field: string;
multiple: boolean;
}
>;
export default _default; export default _default;

View File

@ -1,2 +1,17 @@
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; declare const _default: import("vue").DefineComponent<
{},
() => JSX.Element,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,2 +1,23 @@
declare const _default: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: import("vue").DefineComponent<
{},
() => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,2 +1,17 @@
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; declare const _default: import("vue").DefineComponent<
{},
() => JSX.Element,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").VNodeProps &
import("vue").AllowedComponentProps &
import("vue").ComponentCustomProps,
Readonly<import("vue").ExtractPropTypes<{}>>,
{}
>;
export default _default; export default _default;

View File

@ -1,2 +1,23 @@
declare const _default: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: import("vue").DefineComponent<
{},
() => any,
{},
{},
{},
import("vue").ComponentOptionsMixin,
import("vue").ComponentOptionsMixin,
{},
string,
import("vue").PublicProps,
Readonly<{}> & Readonly<{}>,
{},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,61 +1,82 @@
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<{ declare const _default: import("vue").DefineComponent<
modelValue: StringConstructor; {
field: { modelValue: StringConstructor;
type: StringConstructor; field: {
default: string; type: StringConstructor;
}; default: string;
fieldList: { };
type: PropType<{ fieldList: {
label: string; type: PropType<
value: string; {
}[]>; label: string;
default: () => never[]; value: string;
}; }[]
onSearch: FunctionConstructor; >;
placeholder: StringConstructor; default: () => never[];
width: { };
type: StringConstructor; onSearch: FunctionConstructor;
default: string; placeholder: StringConstructor;
}; width: {
}, { type: StringConstructor;
value: import("vue").Ref<string>; default: string;
placeholder: import("vue").ComputedRef<string>; };
selectField: import("vue").Ref<string>; },
search: (this: any, ...args: any[]) => any; {
onKeydown: ({ keyCode }: any) => void; value: import("vue").Ref<string>;
onInput: (val: string) => void; placeholder: import("vue").ComputedRef<string>;
onChange: () => void; selectField: import("vue").Ref<string>;
onFieldChange: () => void; search: (this: any, ...args: any[]) => any;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "field-change")[], "update:modelValue" | "change" | "field-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ onKeydown: ({ keyCode }: any) => void;
modelValue: StringConstructor; onInput: (val: string) => void;
field: { onChange: () => void;
type: StringConstructor; onFieldChange: () => void;
default: string; },
}; unknown,
fieldList: { {},
type: PropType<{ {},
label: string; import("vue").ComponentOptionsMixin,
value: string; import("vue").ComponentOptionsMixin,
}[]>; ("update:modelValue" | "change" | "field-change")[],
default: () => never[]; "update:modelValue" | "change" | "field-change",
}; import("vue").VNodeProps &
onSearch: FunctionConstructor; import("vue").AllowedComponentProps &
placeholder: StringConstructor; import("vue").ComponentCustomProps,
width: { Readonly<
type: StringConstructor; import("vue").ExtractPropTypes<{
default: string; modelValue: StringConstructor;
}; field: {
}>> & { type: StringConstructor;
onChange?: ((...args: any[]) => any) | undefined; default: string;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; };
"onField-change"?: ((...args: any[]) => any) | undefined; fieldList: {
}, { type: PropType<
width: string; {
field: string; label: string;
fieldList: { value: string;
label: string; }[]
value: string; >;
}[]; default: () => never[];
}>; };
onSearch: FunctionConstructor;
placeholder: StringConstructor;
width: {
type: StringConstructor;
default: string;
};
}>
> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
"onField-change"?: ((...args: any[]) => any) | undefined;
},
{
width: string;
field: string;
fieldList: {
label: string;
value: string;
}[];
}
>;
export default _default; export default _default;

View File

@ -1,55 +1,83 @@
import { type PropType } from "vue"; import { type PropType } from "vue";
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
modelValue: StringConstructor; import("vue").ExtractPropTypes<{
field: { modelValue: StringConstructor;
type: StringConstructor; field: {
default: string; type: StringConstructor;
}; default: string;
fieldList: { };
type: PropType<{ fieldList: {
label: string; type: PropType<
value: string; {
}[]>; label: string;
default: () => never[]; value: string;
}; }[]
onSearch: FunctionConstructor; >;
placeholder: StringConstructor; default: () => never[];
width: { };
type: (NumberConstructor | StringConstructor)[]; onSearch: FunctionConstructor;
default: number; placeholder: StringConstructor;
}; width: {
refreshOnInput: BooleanConstructor; type: (NumberConstructor | StringConstructor)[];
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "field-change")[], "change" | "update:modelValue" | "field-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ default: number;
modelValue: StringConstructor; };
field: { refreshOnInput: BooleanConstructor;
type: StringConstructor; }>,
default: string; () => any,
}; {},
fieldList: { {},
type: PropType<{ {},
label: string; import("vue").ComponentOptionsMixin,
value: string; import("vue").ComponentOptionsMixin,
}[]>; ("change" | "update:modelValue" | "field-change")[],
default: () => never[]; "change" | "update:modelValue" | "field-change",
}; import("vue").PublicProps,
onSearch: FunctionConstructor; Readonly<
placeholder: StringConstructor; import("vue").ExtractPropTypes<{
width: { modelValue: StringConstructor;
type: (NumberConstructor | StringConstructor)[]; field: {
default: number; type: StringConstructor;
}; default: string;
refreshOnInput: BooleanConstructor; };
}>> & Readonly<{ fieldList: {
onChange?: ((...args: any[]) => any) | undefined; type: PropType<
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; {
"onField-change"?: ((...args: any[]) => any) | undefined; label: string;
}>, { value: string;
width: string | number; }[]
refreshOnInput: boolean; >;
field: string; default: () => never[];
fieldList: { };
label: string; onSearch: FunctionConstructor;
value: string; placeholder: StringConstructor;
}[]; width: {
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; type: (NumberConstructor | StringConstructor)[];
default: number;
};
refreshOnInput: BooleanConstructor;
}>
> &
Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
"onField-change"?: ((...args: any[]) => any) | undefined;
}>,
{
width: string | number;
refreshOnInput: boolean;
field: string;
fieldList: {
label: string;
value: string;
}[];
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,58 +1,82 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { PropType } from "vue"; import { PropType } from "vue";
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
inline: { import("vue").ExtractPropTypes<{
type: BooleanConstructor; inline: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
props: { };
type: ObjectConstructor; props: {
default: () => void; type: ObjectConstructor;
}; default: () => void;
data: { };
type: ObjectConstructor; data: {
default: () => {}; type: ObjectConstructor;
}; default: () => {};
items: { };
type: PropType<ClForm.Item<any>[]>; items: {
default: () => never[]; type: PropType<ClForm.Item<any>[]>;
}; default: () => never[];
resetBtn: { };
type: BooleanConstructor; resetBtn: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
onLoad: FunctionConstructor; };
onSearch: FunctionConstructor; onLoad: FunctionConstructor;
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reset"[], "reset", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ onSearch: FunctionConstructor;
inline: { }>,
type: BooleanConstructor; () => any,
default: boolean; {},
}; {},
props: { {},
type: ObjectConstructor; import("vue").ComponentOptionsMixin,
default: () => void; import("vue").ComponentOptionsMixin,
}; "reset"[],
data: { "reset",
type: ObjectConstructor; import("vue").PublicProps,
default: () => {}; Readonly<
}; import("vue").ExtractPropTypes<{
items: { inline: {
type: PropType<ClForm.Item<any>[]>; type: BooleanConstructor;
default: () => never[]; default: boolean;
}; };
resetBtn: { props: {
type: BooleanConstructor; type: ObjectConstructor;
default: boolean; default: () => void;
}; };
onLoad: FunctionConstructor; data: {
onSearch: FunctionConstructor; type: ObjectConstructor;
}>> & Readonly<{ default: () => {};
onReset?: ((...args: any[]) => any) | undefined; };
}>, { items: {
items: ClForm.Item<any>[]; type: PropType<ClForm.Item<any>[]>;
props: Record<string, any>; default: () => never[];
inline: boolean; };
data: Record<string, any>; resetBtn: {
resetBtn: boolean; type: BooleanConstructor;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; default: boolean;
};
onLoad: FunctionConstructor;
onSearch: FunctionConstructor;
}>
> &
Readonly<{
onReset?: ((...args: any[]) => any) | undefined;
}>,
{
items: ClForm.Item<any>[];
props: Record<string, any>;
inline: boolean;
data: Record<string, any>;
resetBtn: boolean;
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -3,72 +3,76 @@ declare type Emit = (name: "selection-change" | "sort-change", ...args: any[]) =
declare type Table = Vue.Ref<any>; declare type Table = Vue.Ref<any>;
declare type Config = ClTable.Config; declare type Config = ClTable.Config;
declare interface Sort { declare interface Sort {
defaultSort: { defaultSort: {
prop?: string; prop?: string;
order?: string; order?: string;
}; };
changeSort(prop: string, order: string): void; changeSort(prop: string, order: string): void;
} }
export declare function useSort({ config, emit, Table }: { export declare function useSort({
config: Config; config,
emit: Emit; emit,
Table: Table; Table
}: {
config: Config;
emit: Emit;
Table: Table;
}): { }): {
defaultSort: { defaultSort:
prop: string; | {
order: "descending" | "ascending"; prop: string;
} | { order: "descending" | "ascending";
prop?: undefined; }
order?: undefined; | {
}; prop?: undefined;
onSortChange: ({ prop, order }: { order?: undefined;
prop: string | undefined; };
order: string; onSortChange: ({ prop, order }: { prop: string | undefined; order: string }) => void;
}) => void; changeSort: (prop: string, order: string) => void;
changeSort: (prop: string, order: string) => void;
}; };
export declare function useRow({ Table, config, Sort }: { export declare function useRow({
Table: Table; Table,
config: Config; config,
Sort: Sort; Sort
}: {
Table: Table;
config: Config;
Sort: Sort;
}): { }): {
onRowContextMenu: (row: any, column: any, event: any) => void; onRowContextMenu: (row: any, column: any, event: any) => void;
}; };
export declare function useHeight({ config, Table }: { export declare function useHeight({ config, Table }: { Table: Table; config: Config }): {
Table: Table; isAuto: import("vue").ComputedRef<boolean>;
config: Config; maxHeight: import("vue").Ref<number>;
}): { calcMaxHeight: (this: any, ...args: any[]) => any;
isAuto: import("vue").ComputedRef<boolean>;
maxHeight: import("vue").Ref<number>;
calcMaxHeight: (this: any, ...args: any[]) => any;
}; };
export declare function useSelection({ emit }: { export declare function useSelection({ emit }: { emit: Emit }): {
emit: Emit; selection: obj[];
}): { onSelectionChange: (selection: any[]) => void;
selection: obj[];
onSelectionChange: (selection: any[]) => void;
}; };
export declare function useData({ config, Table }: { export declare function useData({ config, Table }: { config: Config; Table: Table }): {
config: Config; data: import("vue").Ref<any[]>;
Table: Table; setData: (list: any[]) => void;
}): {
data: import("vue").Ref<any[]>;
setData: (list: any[]) => void;
}; };
export declare function useOp({ config }: { export declare function useOp({ config }: { config: Config }): {
config: Config; visible: import("vue").Ref<boolean>;
}): { reBuild: (cb?: fn) => Promise<void>;
visible: import("vue").Ref<boolean>; showColumn: (prop: string | string[], status?: boolean) => void;
reBuild: (cb?: fn) => Promise<void>; hideColumn: (prop: string | string[]) => void;
showColumn: (prop: string | string[], status?: boolean) => void; setColumns: (list: ClTable.Column[]) => void;
hideColumn: (prop: string | string[]) => void;
setColumns: (list: ClTable.Column[]) => void;
}; };
export declare function useRender(): { export declare function useRender(): {
renderColumn: (columns: ClTable.Column[]) => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { renderColumn: (columns: ClTable.Column[]) => (
[key: string]: any; | import("vue").VNode<
}> | null)[]; import("vue").RendererNode,
renderEmpty: (emptyText: String) => JSX.Element; import("vue").RendererElement,
renderAppend: () => JSX.Element; {
[key: string]: any;
}
>
| null
)[];
renderEmpty: (emptyText: string) => JSX.Element;
renderAppend: () => JSX.Element;
}; };
export {}; export {};

View File

@ -1,8 +1,11 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useData({ config, Table }: { export declare function useData({
config: ClTable.Config; config,
Table: Vue.Ref<any>; Table
}: {
config: ClTable.Config;
Table: Vue.Ref<any>;
}): { }): {
data: import("vue").Ref<obj[], obj[]>; data: import("vue").Ref<obj[], obj[]>;
setData: (list: obj[]) => void; setData: (list: obj[]) => void;
}; };

View File

@ -1,8 +1,11 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useHeight({ config, Table }: { export declare function useHeight({
Table: Vue.Ref<any>; config,
config: ClTable.Config; Table
}: {
Table: Vue.Ref<any>;
config: ClTable.Config;
}): { }): {
maxHeight: import("vue").Ref<number, number>; maxHeight: import("vue").Ref<number, number>;
calcMaxHeight: import("lodash-es").DebouncedFunc<() => Promise<void>>; calcMaxHeight: import("lodash-es").DebouncedFunc<() => Promise<void>>;
}; };

View File

@ -1,171 +1,204 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useTable(props: any): { export declare function useTable(props: any): {
Table: import("vue").Ref<any, any>; Table: import("vue").Ref<any, any>;
config: { config: {
columns: { columns: {
[x: string]: any; [x: string]: any;
type: ClTable.ColumnType; type: ClTable.ColumnType;
hidden: boolean | { hidden:
value: boolean; | boolean
}; | {
component: { value: boolean;
[x: string]: any; };
name?: string | undefined; component: {
options?: { [x: string]: any;
[x: string]: any; name?: string | undefined;
label?: string | undefined; options?:
value?: any; | {
color?: string | undefined; [x: string]: any;
type?: string | undefined; label?: string | undefined;
}[] | { value?: any;
value: { color?: string | undefined;
[x: string]: any; type?: string | undefined;
label?: string | undefined; }[]
value?: any; | {
color?: string | undefined; value: {
type?: string | undefined; [x: string]: any;
}[]; label?: string | undefined;
} | undefined; value?: any;
props?: { color?: string | undefined;
[x: string]: any; type?: string | undefined;
onChange?: ((value: any) => void) | undefined; }[];
} | { }
value: { | undefined;
[x: string]: any; props?:
onChange?: ((value: any) => void) | undefined; | {
}; [x: string]: any;
} | undefined; onChange?: ((value: any) => void) | undefined;
style?: obj | undefined; }
slots?: { | {
[key: string]: (data?: any) => any; value: {
} | undefined; [x: string]: any;
vm?: any; onChange?: ((value: any) => void) | undefined;
}; };
search: { }
isInput: boolean; | undefined;
value: any; style?: obj | undefined;
refreshOnChange: { slots?:
valueOf: () => boolean; | {
}; [key: string]: (data?: any) => any;
component: { }
[x: string]: any; | undefined;
name?: string | undefined; vm?: any;
options?: { };
[x: string]: any; search: {
label?: string | undefined; isInput: boolean;
value?: any; value: any;
color?: string | undefined; refreshOnChange: {
type?: string | undefined; valueOf: () => boolean;
}[] | { };
value: { component: {
[x: string]: any; [x: string]: any;
label?: string | undefined; name?: string | undefined;
value?: any; options?:
color?: string | undefined; | {
type?: string | undefined; [x: string]: any;
}[]; label?: string | undefined;
} | undefined; value?: any;
props?: { color?: string | undefined;
[x: string]: any; type?: string | undefined;
onChange?: ((value: any) => void) | undefined; }[]
} | { | {
value: { value: {
[x: string]: any; [x: string]: any;
onChange?: ((value: any) => void) | undefined; label?: string | undefined;
}; value?: any;
} | undefined; color?: string | undefined;
style?: obj | undefined; type?: string | undefined;
slots?: { }[];
[key: string]: (data?: any) => any; }
} | undefined; | undefined;
vm?: any; props?:
}; | {
}; [x: string]: any;
dict: { onChange?: ((value: any) => void) | undefined;
[x: string]: any; }
label?: string | undefined; | {
value?: any; value: {
color?: string | undefined; [x: string]: any;
type?: string | undefined; onChange?: ((value: any) => void) | undefined;
}[] | { };
value: { }
[x: string]: any; | undefined;
label?: string | undefined; style?: obj | undefined;
value?: any; slots?:
color?: string | undefined; | {
type?: string | undefined; [key: string]: (data?: any) => any;
}[]; }
}; | undefined;
dictFormatter: (values: DictOptions) => string; vm?: any;
dictColor: boolean; };
dictSeparator: string; };
dictAllLevels: boolean; dict:
buttons: ((options: { | {
scope: any; [x: string]: any;
}) => ClTable.OpButton) | ("info" | "delete" | "edit" | AnyString | `slot-${string}` | { label?: string | undefined;
[x: string]: any; value?: any;
label: string; color?: string | undefined;
type?: string | undefined; type?: string | undefined;
hidden?: boolean | undefined; }[]
onClick: (options: { | {
scope: obj; value: {
}) => void; [x: string]: any;
})[]; label?: string | undefined;
align: ElementPlus.Align; value?: any;
label: any; color?: string | undefined;
className: string; type?: string | undefined;
prop: string & {}; }[];
orderNum: number; };
width: number; dictFormatter: (values: DictOptions) => string;
minWidth: string | number; dictColor: boolean;
renderHeader: (options: { dictSeparator: string;
column: any; dictAllLevels: boolean;
$index: number; buttons:
}) => any; | ((options: { scope: any }) => ClTable.OpButton)
sortable: boolean | "asc" | "desc" | "custom" | "descending" | "ascending"; | (
sortMethod: fn; | "info"
sortBy: string | any[] | ((row: any, index: number) => any); | "delete"
resizable: boolean; | "edit"
columnKey: string; | AnyString
headerAlign: ElementPlus.Align; | `slot-${string}`
showOverflowTooltip: boolean; | {
fixed: string | boolean; [x: string]: any;
formatter: (row: any, column: any, value: any, index: number) => any; label: string;
selectable: (row: any, index: number) => boolean; type?: string | undefined;
reserveSelection: boolean; hidden?: boolean | undefined;
filterMethod: fn; onClick: (options: { scope: obj }) => void;
filteredValue: unknown[]; }
filters: unknown[]; )[];
filterPlacement: string; align: ElementPlus.Align;
filterMultiple: boolean; label: any;
index: number | ((index: number) => number); className: string;
sortOrders: unknown[]; prop: string & {};
children: any[]; orderNum: number;
}[]; width: number;
autoHeight: boolean; minWidth: string | number;
height: any; renderHeader: (options: { column: any; $index: number }) => any;
contextMenu: ("info" | "update" | "delete" | "edit" | "refresh" | { sortable: boolean | "asc" | "desc" | "custom" | "descending" | "ascending";
[x: string]: any; sortMethod: fn;
label: string; sortBy: string | any[] | ((row: any, index: number) => any);
prefixIcon?: any; resizable: boolean;
suffixIcon?: any; columnKey: string;
ellipsis?: boolean | undefined; headerAlign: ElementPlus.Align;
disabled?: boolean | undefined; showOverflowTooltip: boolean;
hidden?: boolean | undefined; fixed: string | boolean;
children?: any[] | undefined; formatter: (row: any, column: any, value: any, index: number) => any;
showChildren?: boolean | undefined; selectable: (row: any, index: number) => boolean;
callback?: ((done: fn) => void) | undefined; reserveSelection: boolean;
} | ((row: obj, column: obj, event: PointerEvent) => ClContextMenu.Item) | "check" | "order-desc" | "order-asc")[]; filterMethod: fn;
defaultSort: { filteredValue: unknown[];
prop: string; filters: unknown[];
order: "descending" | "ascending"; filterPlacement: string;
}; filterMultiple: boolean;
sortRefresh: boolean; index: number | ((index: number) => number);
emptyText: string; sortOrders: unknown[];
rowKey: string; children: any[];
plugins?: ClTable.Plugin[] | undefined; }[];
onRowContextmenu?: ((row: any, column: any, event: any) => void) | undefined; autoHeight: boolean;
}; height: any;
contextMenu: (
| "info"
| "update"
| "delete"
| "edit"
| "refresh"
| {
[x: string]: any;
label: string;
prefixIcon?: any;
suffixIcon?: any;
ellipsis?: boolean | undefined;
disabled?: boolean | undefined;
hidden?: boolean | undefined;
children?: any[] | undefined;
showChildren?: boolean | undefined;
callback?: ((done: fn) => void) | undefined;
}
| ((row: obj, column: obj, event: PointerEvent) => ClContextMenu.Item)
| "check"
| "order-desc"
| "order-asc"
)[];
defaultSort: {
prop: string;
order: "descending" | "ascending";
};
sortRefresh: boolean;
emptyText: string;
rowKey: string;
plugins?: ClTable.Plugin[] | undefined;
onRowContextmenu?: ((row: any, column: any, event: any) => void) | undefined;
};
}; };
export * from "./data"; export * from "./data";
export * from "./height"; export * from "./height";

View File

@ -1,10 +1,8 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useOp({ config }: { export declare function useOp({ config }: { config: ClTable.Config }): {
config: ClTable.Config; visible: import("vue").Ref<boolean, boolean>;
}): { reBuild: (cb?: fn) => Promise<void>;
visible: import("vue").Ref<boolean, boolean>; showColumn: (prop: string | string[], status?: boolean) => void;
reBuild: (cb?: fn) => Promise<void>; hideColumn: (prop: string | string[]) => void;
showColumn: (prop: string | string[], status?: boolean) => void; setColumns: (list: ClTable.Column[]) => void;
hideColumn: (prop: string | string[]) => void;
setColumns: (list: ClTable.Column[]) => void;
}; };

View File

@ -1,4 +1,4 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function usePlugins(): { export declare function usePlugins(): {
create: (plugins?: ClTable.Plugin[]) => void; create: (plugins?: ClTable.Plugin[]) => void;
}; };

View File

@ -1,8 +1,15 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useRender(): { export declare function useRender(): {
renderColumn: (columns: ClTable.Column[]) => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { renderColumn: (columns: ClTable.Column[]) => (
[key: string]: any; | import("vue").VNode<
}> | null)[]; import("vue").RendererNode,
renderEmpty: (emptyText: String) => any; import("vue").RendererElement,
renderAppend: () => any; {
[key: string]: any;
}
>
| null
)[];
renderEmpty: (emptyText: string) => any;
renderAppend: () => any;
}; };

View File

@ -1,14 +1,18 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useRow({ Table, config, Sort }: { export declare function useRow({
Table: Vue.Ref<any>; Table,
config: ClTable.Config; config,
Sort: { Sort
defaultSort: { }: {
prop?: string; Table: Vue.Ref<any>;
order?: string; config: ClTable.Config;
}; Sort: {
changeSort(prop: string, order: string): void; defaultSort: {
}; prop?: string;
order?: string;
};
changeSort(prop: string, order: string): void;
};
}): { }): {
onRowContextMenu: (row: obj, column: obj, event: PointerEvent) => void; onRowContextMenu: (row: obj, column: obj, event: PointerEvent) => void;
}; };

View File

@ -1,7 +1,5 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useSelection({ emit }: { export declare function useSelection({ emit }: { emit: Vue.Emit }): {
emit: Vue.Emit; selection: obj[];
}): { onSelectionChange: (selection: any[]) => void;
selection: obj[];
onSelectionChange: (selection: any[]) => void;
}; };

View File

@ -1,19 +1,22 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare function useSort({ config, Table, emit }: { export declare function useSort({
config: ClTable.Config; config,
Table: Vue.Ref<any>; Table,
emit: Vue.Emit; emit
}: {
config: ClTable.Config;
Table: Vue.Ref<any>;
emit: Vue.Emit;
}): { }): {
defaultSort: { defaultSort:
prop: string; | {
order: "descending" | "ascending"; prop: string;
} | { order: "descending" | "ascending";
prop?: undefined; }
order?: undefined; | {
}; prop?: undefined;
onSortChange: ({ prop, order }: { order?: undefined;
prop: string | undefined; };
order: string; onSortChange: ({ prop, order }: { prop: string | undefined; order: string }) => void;
}) => void; changeSort: (prop: string, order: string) => void;
changeSort: (prop: string, order: string) => void;
}; };

View File

@ -1,61 +1,91 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
columns: { import("vue").ExtractPropTypes<{
type: ArrayConstructor; columns: {
default: () => never[]; type: ArrayConstructor;
}; default: () => never[];
autoHeight: { };
type: BooleanConstructor; autoHeight: {
default: null; type: BooleanConstructor;
}; default: null;
height: null; };
contextMenu: { height: null;
type: (BooleanConstructor | ArrayConstructor)[]; contextMenu: {
default: null; type: (BooleanConstructor | ArrayConstructor)[];
}; default: null;
defaultSort: ObjectConstructor; };
sortRefresh: { defaultSort: ObjectConstructor;
type: BooleanConstructor; sortRefresh: {
default: boolean; type: BooleanConstructor;
}; default: boolean;
emptyText: StringConstructor; };
rowKey: { emptyText: StringConstructor;
type: StringConstructor; rowKey: {
default: string; type: StringConstructor;
}; default: string;
}>, () => false | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { };
[key: string]: any; }>,
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("selection-change" | "sort-change")[], "selection-change" | "sort-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ () =>
columns: { | false
type: ArrayConstructor; | import("vue").VNode<
default: () => never[]; import("vue").RendererNode,
}; import("vue").RendererElement,
autoHeight: { {
type: BooleanConstructor; [key: string]: any;
default: null; }
}; >,
height: null; {},
contextMenu: { {},
type: (BooleanConstructor | ArrayConstructor)[]; {},
default: null; import("vue").ComponentOptionsMixin,
}; import("vue").ComponentOptionsMixin,
defaultSort: ObjectConstructor; ("selection-change" | "sort-change")[],
sortRefresh: { "selection-change" | "sort-change",
type: BooleanConstructor; import("vue").PublicProps,
default: boolean; Readonly<
}; import("vue").ExtractPropTypes<{
emptyText: StringConstructor; columns: {
rowKey: { type: ArrayConstructor;
type: StringConstructor; default: () => never[];
default: string; };
}; autoHeight: {
}>> & Readonly<{ type: BooleanConstructor;
"onSelection-change"?: ((...args: any[]) => any) | undefined; default: null;
"onSort-change"?: ((...args: any[]) => any) | undefined; };
}>, { height: null;
columns: unknown[]; contextMenu: {
autoHeight: boolean; type: (BooleanConstructor | ArrayConstructor)[];
contextMenu: boolean | unknown[]; default: null;
sortRefresh: boolean; };
rowKey: string; defaultSort: ObjectConstructor;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; sortRefresh: {
type: BooleanConstructor;
default: boolean;
};
emptyText: StringConstructor;
rowKey: {
type: StringConstructor;
default: string;
};
}>
> &
Readonly<{
"onSelection-change"?: ((...args: any[]) => any) | undefined;
"onSort-change"?: ((...args: any[]) => any) | undefined;
}>,
{
columns: unknown[];
autoHeight: boolean;
contextMenu: boolean | unknown[];
sortRefresh: boolean;
rowKey: string;
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,38 +1,62 @@
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{ declare const _default: import("vue").DefineComponent<
items: { import("vue").ExtractPropTypes<{
type: ArrayConstructor; items: {
default: () => never[]; type: ArrayConstructor;
}; default: () => never[];
props: ObjectConstructor; };
sync: BooleanConstructor; props: ObjectConstructor;
op: ObjectConstructor; sync: BooleanConstructor;
dialog: ObjectConstructor; op: ObjectConstructor;
onOpen: FunctionConstructor; dialog: ObjectConstructor;
onOpened: FunctionConstructor; onOpen: FunctionConstructor;
onClose: FunctionConstructor; onOpened: FunctionConstructor;
onClosed: FunctionConstructor; onClose: FunctionConstructor;
onInfo: FunctionConstructor; onClosed: FunctionConstructor;
onSubmit: FunctionConstructor; onInfo: FunctionConstructor;
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("opened" | "closed")[], "opened" | "closed", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ onSubmit: FunctionConstructor;
items: { }>,
type: ArrayConstructor; () => any,
default: () => never[]; {},
}; {},
props: ObjectConstructor; {},
sync: BooleanConstructor; import("vue").ComponentOptionsMixin,
op: ObjectConstructor; import("vue").ComponentOptionsMixin,
dialog: ObjectConstructor; ("opened" | "closed")[],
onOpen: FunctionConstructor; "opened" | "closed",
onOpened: FunctionConstructor; import("vue").PublicProps,
onClose: FunctionConstructor; Readonly<
onClosed: FunctionConstructor; import("vue").ExtractPropTypes<{
onInfo: FunctionConstructor; items: {
onSubmit: FunctionConstructor; type: ArrayConstructor;
}>> & Readonly<{ default: () => never[];
onOpened?: ((...args: any[]) => any) | undefined; };
onClosed?: ((...args: any[]) => any) | undefined; props: ObjectConstructor;
}>, { sync: BooleanConstructor;
sync: boolean; op: ObjectConstructor;
items: unknown[]; dialog: ObjectConstructor;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; onOpen: FunctionConstructor;
onOpened: FunctionConstructor;
onClose: FunctionConstructor;
onClosed: FunctionConstructor;
onInfo: FunctionConstructor;
onSubmit: FunctionConstructor;
}>
> &
Readonly<{
onOpened?: ((...args: any[]) => any) | undefined;
onClosed?: ((...args: any[]) => any) | undefined;
}>,
{
sync: boolean;
items: unknown[];
},
{},
{},
{},
string,
import("vue").ComponentProvideOptions,
true,
{},
any
>;
export default _default; export default _default;

View File

@ -1,9 +1,9 @@
import { App } from "vue"; import { App } from "vue";
export declare type Browser = { export declare type Browser = {
screen: string; screen: string;
isMini: boolean; isMini: boolean;
}; };
export declare function useBrowser(app?: App): { export declare function useBrowser(app?: App): {
screen: string; screen: string;
isMini: boolean; isMini: boolean;
}; };

View File

@ -1,40 +1,43 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { Browser } from "./browser"; import { Browser } from "./browser";
export declare function useRefs(): { export declare function useRefs(): {
refs: { refs: {
[key: string]: obj; [key: string]: obj;
}; };
setRefs: (name: string) => (el: any) => void; setRefs: (name: string) => (el: any) => void;
}; };
export declare function useGlobal(): GlobalOptions; export declare function useGlobal(): GlobalOptions;
export declare function useTools(): { export declare function useTools(): {
slots: Readonly<{ slots: Readonly<{
[name: string]: import("vue").Slot | undefined; [name: string]: import("vue").Slot | undefined;
}>; }>;
getValue: (data: any, params?: any) => any; getValue: (data: any, params?: any) => any;
dict: ClCrud.Dict; dict: ClCrud.Dict;
permission: ClCrud.Permission; permission: ClCrud.Permission;
style: { style: {
size: ElementPlus.Size; size: ElementPlus.Size;
}; };
events: { events: {
[key: string]: (...args: any[]) => any; [key: string]: (...args: any[]) => any;
}; };
render: { render: {
autoHeight: boolean; autoHeight: boolean;
functionSlots: { functionSlots: {
exclude: string[]; exclude: string[];
}; };
}; };
crud: any; crud: any;
browser: Browser; browser: Browser;
}; };
export declare function useCore(): { export declare function useCore(): {
crud: ClCrud.Provide; crud: ClCrud.Provide;
mitt: Emitter; mitt: Emitter;
}; };
export declare function useElApi(keys: string[], el: any): { export declare function useElApi(
[key: string]: any; keys: string[],
el: any
): {
[key: string]: any;
}; };
export declare function useConfig({ props }: any): any; export declare function useConfig({ props }: any): any;
export declare function useEventListener(name: string, cb: () => any): void; export declare function useEventListener(name: string, cb: () => any): void;

View File

@ -1,11 +1,24 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { Ref } from "vue"; import { Ref } from "vue";
export declare function useCrud(options?: ClCrud.Options, cb?: (app: ClCrud.Ref) => void): Ref<ClCrud.Ref | undefined, ClCrud.Ref | undefined>; export declare function useCrud(
export declare function useUpsert<T = any>(options?: ClUpsert.Options<T>): Ref<ClUpsert.Ref<any> | undefined, ClUpsert.Ref<any> | undefined>; options?: ClCrud.Options,
export declare function useTable<T = any>(options?: ClTable.Options<T>): Ref<ClTable.Ref<T> | undefined, ClTable.Ref<T> | undefined>; cb?: (app: ClCrud.Ref) => void
export declare function useForm<T = any>(cb?: (app: ClForm.Ref<T>) => void): Ref<ClForm.Ref<T> | undefined, ClForm.Ref<T> | undefined>; ): Ref<ClCrud.Ref | undefined, ClCrud.Ref | undefined>;
export declare function useAdvSearch<T = any>(options?: ClAdvSearch.Options<T>): Ref<ClAdvSearch.Ref<T> | undefined, ClAdvSearch.Ref<T> | undefined>; export declare function useUpsert<T = any>(
export declare function useSearch<T = any>(options?: ClSearch.Options<T>): Ref<ClSearch.Ref<T> | undefined, ClSearch.Ref<T> | undefined>; options?: ClUpsert.Options<T>
): Ref<ClUpsert.Ref<any> | undefined, ClUpsert.Ref<any> | undefined>;
export declare function useTable<T = any>(
options?: ClTable.Options<T>
): Ref<ClTable.Ref<T> | undefined, ClTable.Ref<T> | undefined>;
export declare function useForm<T = any>(
cb?: (app: ClForm.Ref<T>) => void
): Ref<ClForm.Ref<T> | undefined, ClForm.Ref<T> | undefined>;
export declare function useAdvSearch<T = any>(
options?: ClAdvSearch.Options<T>
): Ref<ClAdvSearch.Ref<T> | undefined, ClAdvSearch.Ref<T> | undefined>;
export declare function useSearch<T = any>(
options?: ClSearch.Options<T>
): Ref<ClSearch.Ref<T> | undefined, ClSearch.Ref<T> | undefined>;
export declare function useDialog(options?: { export declare function useDialog(options?: {
onFullscreen(visible: boolean): void; onFullscreen(visible: boolean): void;
}): ClDialog.Provide; }): ClDialog.Provide;

View File

@ -1,6 +1,6 @@
export declare const format: any; export declare const format: any;
declare const _default: { declare const _default: {
bind(data: any): any; bind(data: any): any;
submit(data: any): any; submit(data: any): any;
}; };
export default _default; export default _default;

View File

@ -1,16 +1,16 @@
/// <reference types="../index" /> /// <reference types="../index" />
import { Mitt } from "../utils/mitt"; import { Mitt } from "../utils/mitt";
export declare function useCore(): { export declare function useCore(): {
crud: ClCrud.Ref; crud: ClCrud.Ref;
mitt: Mitt; mitt: Mitt;
}; };
export declare function useConfig(): Config; export declare function useConfig(): Config;
export declare function useBrowser(): Browser; export declare function useBrowser(): Browser;
export declare function useRefs(): { export declare function useRefs(): {
refs: { refs: {
[key: string]: obj; [key: string]: obj;
}; };
setRefs: (name: string) => (el: any) => void; setRefs: (name: string) => (el: any) => void;
}; };
export declare function useProxy(ctx: any): any; export declare function useProxy(ctx: any): any;
export declare function useElApi(keys: string[], el: any): obj; export declare function useElApi(keys: string[], el: any): obj;

View File

@ -2,9 +2,12 @@
import type { App } from "vue"; import type { App } from "vue";
import "./static/index.scss"; import "./static/index.scss";
declare const Crud: { declare const Crud: {
install(app: App, options?: Options): { install(
name: string; app: App,
}; options?: Options
): {
name: string;
};
}; };
export default Crud; export default Crud;
export * from "./emitter"; export * from "./emitter";

View File

@ -1,32 +1,32 @@
declare const _default: { declare const _default: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
export default _default; export default _default;

View File

@ -1,126 +1,126 @@
export declare const locale: { export declare const locale: {
en: { en: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
ja: { ja: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
zhCn: { zhCn: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
zhTw: { zhTw: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
}; };

View File

@ -1,32 +1,32 @@
declare const _default: { declare const _default: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
export default _default; export default _default;

View File

@ -1,32 +1,32 @@
declare const _default: { declare const _default: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
export default _default; export default _default;

View File

@ -1,32 +1,32 @@
declare const _default: { declare const _default: {
op: string; op: string;
add: string; add: string;
delete: string; delete: string;
multiDelete: string; multiDelete: string;
update: string; update: string;
refresh: string; refresh: string;
info: string; info: string;
search: string; search: string;
reset: string; reset: string;
clear: string; clear: string;
save: string; save: string;
close: string; close: string;
confirm: string; confirm: string;
advSearch: string; advSearch: string;
searchKey: string; searchKey: string;
placeholder: string; placeholder: string;
placeholderSelect: string; placeholderSelect: string;
tips: string; tips: string;
saveSuccess: string; saveSuccess: string;
deleteSuccess: string; deleteSuccess: string;
deleteConfirm: string; deleteConfirm: string;
empty: string; empty: string;
desc: string; desc: string;
asc: string; asc: string;
select: string; select: string;
deselect: string; deselect: string;
seeMore: string; seeMore: string;
hideContent: string; hideContent: string;
nonEmpty: string; nonEmpty: string;
}; };
export default _default; export default _default;

View File

@ -1,34 +1,32 @@
declare class TestService { declare class TestService {
page(params: any): Promise<unknown>; page(params: any): Promise<unknown>;
update(params: { update(params: { id: any; [key: string]: any }): Promise<void>;
id: any; add(params: any): Promise<string>;
[key: string]: any; info(params: { id: any }): Promise<
}): Promise<void>; | {
add(params: any): Promise<string>; id: number;
info(params: { name: string;
id: any; createTime: string;
}): Promise<{ wages: number;
id: number; status: number;
name: string; account: string;
createTime: string; occupation: number;
wages: number; phone: number;
status: number; }
account: string; | undefined
occupation: number; >;
phone: number; delete(params: { ids: any[] }): Promise<void>;
} | undefined>; list(): Promise<
delete(params: { {
ids: any[]; id: number;
}): Promise<void>; name: string;
list(): Promise<{ createTime: string;
id: number; wages: number;
name: string; status: number;
createTime: string; account: string;
wages: number; occupation: number;
status: number; phone: number;
account: string; }[]
occupation: number; >;
phone: number;
}[]>;
} }
export { TestService }; export { TestService };

View File

@ -1,10 +1,10 @@
/// <reference types="../index" /> /// <reference types="../index" />
export declare const format: { export declare const format: {
[key: string]: ClForm.HookFn; [key: string]: ClForm.HookFn;
}; };
declare const formHook: { declare const formHook: {
bind(data: any): void; bind(data: any): void;
submit(data: any): void; submit(data: any): void;
}; };
export declare function registerFormHook(name: string, fn: ClForm.HookFn): void; export declare function registerFormHook(name: string, fn: ClForm.HookFn): void;
export default formHook; export default formHook;

View File

@ -1,7 +1,7 @@
import { App } from "vue"; import { App } from "vue";
declare const _default: { declare const _default: {
readonly vue: App<any>; readonly vue: App<any>;
get(key: string): any; get(key: string): any;
set(key: string, value: any): void; set(key: string, value: any): void;
}; };
export default _default; export default _default;

View File

@ -7,7 +7,11 @@ export declare function merge(d1: any, d2: any): any;
export declare function addClass(el: Element, name: string): void; export declare function addClass(el: Element, name: string): void;
export declare function removeClass(el: Element, name: string): void; export declare function removeClass(el: Element, name: string): void;
export declare function getValue(data: any, params?: any): any; export declare function getValue(data: any, params?: any): any;
export declare function deepFind(value: any, list: any[], options?: { export declare function deepFind(
allLevels: boolean; value: any,
}): any; list: any[],
options?: {
allLevels: boolean;
}
): any;
export declare function uuid(separator?: string): string; export declare function uuid(separator?: string): string;

View File

@ -1,10 +1,10 @@
declare const mitt: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>; declare const mitt: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
declare class Mitt { declare class Mitt {
id: number; id: number;
constructor(id?: number); constructor(id?: number);
send(type: "emit" | "off" | "on", name: string, ...args: any[]): void; send(type: "emit" | "off" | "on", name: string, ...args: any[]): void;
emit(name: string, ...args: any[]): void; emit(name: string, ...args: any[]): void;
off(name: string, handler: (...args: any[]) => void): void; off(name: string, handler: (...args: any[]) => void): void;
on(name: string, handler: (...args: any[]) => void): void; on(name: string, handler: (...args: any[]) => void): void;
} }
export { Mitt, mitt }; export { Mitt, mitt };

View File

@ -6,9 +6,18 @@ export declare function parseFormHidden(value: any, { scope }: any): any;
/** /**
* table.dict * table.dict
*/ */
export declare function parseTableDict(value: any, item: ClTable.Column): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { export declare function parseTableDict(
[key: string]: any; value: any,
}>[]; item: ClTable.Column
):
| string
| import("vue").VNode<
import("vue").RendererNode,
import("vue").RendererElement,
{
[key: string]: any;
}
>[];
/** /**
* table.op.buttons * table.op.buttons
*/ */
@ -16,8 +25,10 @@ export declare function parseTableOpButtons(buttons: any[], { scope }: any): any
/** /**
* *
*/ */
export declare function parseExtensionComponent(vnode: any): { export declare function parseExtensionComponent(vnode: any):
children: any; | {
} | { children: any;
children?: undefined; }
}; | {
children?: undefined;
};

View File

@ -1,7 +1,7 @@
import { App } from "vue"; import { App } from "vue";
declare const _default: { declare const _default: {
readonly vue: App<any>; readonly vue: App<any>;
get(key: string): any; get(key: string): any;
set(key: string, value: any): void; set(key: string, value: any): void;
}; };
export default _default; export default _default;

View File

@ -1,31 +1,34 @@
export declare const UserList: ({ export declare const UserList: (
id: number; | {
name: string; id: number;
createTime: string; name: string;
price: number; createTime: string;
status: number; price: number;
hook: string; status: number;
user: { hook: string;
name: string; user: {
}; name: string;
t2: string; };
tags: number[]; t2: string;
} | { tags: number[];
id: number; }
name: string; | {
createTime: string; id: number;
price: number; name: string;
status: number; createTime: string;
tags: number[]; price: number;
hook?: undefined; status: number;
user?: undefined; tags: number[];
t2?: undefined; hook?: undefined;
})[]; user?: undefined;
t2?: undefined;
}
)[];
export declare const TestService: { export declare const TestService: {
page: (p: any) => Promise<unknown>; page: (p: any) => Promise<unknown>;
list: (p: any) => Promise<unknown>; list: (p: any) => Promise<unknown>;
info: (d: any) => Promise<unknown>; info: (d: any) => Promise<unknown>;
add: (d: any) => Promise<void>; add: (d: any) => Promise<void>;
delete: (d: any) => Promise<unknown>; delete: (d: any) => Promise<unknown>;
update: (d: any) => Promise<void>; update: (d: any) => Promise<void>;
}; };

View File

@ -1,13 +1,13 @@
import { VNode } from "vue"; import { VNode } from "vue";
interface Options { interface Options {
prop?: string; prop?: string;
scope?: any; scope?: any;
item?: any; item?: any;
slots?: any; slots?: any;
children?: any[] & any; children?: any[] & any;
custom?: (vnode: any) => any; custom?: (vnode: any) => any;
render?: "slot" | null; render?: "slot" | null;
[key: string]: any; [key: string]: any;
} }
export declare function parseNode(vnode: any, options: Options): VNode; export declare function parseNode(vnode: any, options: Options): VNode;
export declare function renderNode(vnode: any, options: Options): any; export declare function renderNode(vnode: any, options: Options): any;

View File

@ -7,7 +7,7 @@ import prettier from "prettier";
import { config } from "../config"; import { config } from "../config";
import type { Eps } from "../../types"; import type { Eps } from "../../types";
let service = {}; const service = {};
let list: Eps.Entity[] = []; let list: Eps.Entity[] = [];
let customList: Eps.Entity[] = []; let customList: Eps.Entity[] = [];

View File

@ -18,12 +18,12 @@ export function createTag(code: string, id: string) {
export default defineComponent({ export default defineComponent({
name: "${name}" name: "${name}"
}) })
<\/script>` <\/script>`,
); );
return { return {
map: str().generateMap(), map: str().generateMap(),
code: str().toString() code: str().toString(),
}; };
} }
} }

7005
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,6 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ElConfigProvider } from "element-plus"; import { ElConfigProvider } from 'element-plus';
import zhCn from "element-plus/dist/locale/zh-cn.mjs"; import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
</script> </script>

View File

@ -1,18 +1,18 @@
import { getUrlParam, storage } from "/@/cool/utils"; import { getUrlParam, storage } from '/@/cool/utils';
import { proxy } from "./proxy"; import { proxy } from './proxy';
export default { export default {
// 根地址 // 根地址
host: proxy["/dev/"].target, host: proxy['/dev/'].target,
// 请求地址 // 请求地址
get baseUrl() { get baseUrl() {
let proxy = getUrlParam("proxy"); let proxy = getUrlParam('proxy');
if (proxy) { if (proxy) {
storage.set("proxy", proxy); storage.set('proxy', proxy);
} else { } else {
proxy = storage.get("proxy") || "dev"; proxy = storage.get('proxy') || 'dev';
} }
return `/${proxy}`; return `/${proxy}`;

View File

@ -1,5 +1,5 @@
import dev from "./dev"; import dev from './dev';
import prod from "./prod"; import prod from './prod';
// 是否开发模式 // 是否开发模式
export const isDev = import.meta.env.DEV; export const isDev = import.meta.env.DEV;
@ -21,9 +21,9 @@ export const config = {
// 路由 // 路由
router: { router: {
// 模式 // 模式
mode: "history", mode: 'history',
// 转场动画 // 转场动画
transition: "slide" transition: 'slide'
}, },
// 字体图标库 // 字体图标库
@ -34,22 +34,22 @@ export const config = {
ignore: { ignore: {
// 不显示请求进度条 // 不显示请求进度条
NProgress: [ NProgress: [
"/__cool_eps", '/__cool_eps',
"/base/open/eps", '/base/open/eps',
"/base/comm/person", '/base/comm/person',
"/base/comm/permmenu", '/base/comm/permmenu',
"/base/comm/upload", '/base/comm/upload',
"/base/comm/uploadMode", '/base/comm/uploadMode',
"/dict/info/data", '/dict/info/data',
"/space/info/add" '/space/info/add'
], ],
// 页面不需要登录验证 // 页面不需要登录验证
token: ["/login", "/401", "/403", "/404", "/500", "/502"] token: ['/login', '/401', '/403', '/404', '/500', '/502']
}, },
// 调试 // 调试
test: { test: {
token: "", token: '',
eps: true eps: true
}, },
@ -57,4 +57,4 @@ export const config = {
...(isDev ? dev : prod) ...(isDev ? dev : prod)
}; };
export * from "./proxy"; export * from './proxy';

View File

@ -1,9 +1,9 @@
import { proxy } from "./proxy"; import { proxy } from './proxy';
export default { export default {
// 根地址 // 根地址
host: proxy["/prod/"].target, host: proxy['/prod/'].target,
// 请求地址 // 请求地址
baseUrl: "/api" baseUrl: '/api'
}; };

View File

@ -1,13 +1,13 @@
export const proxy = { export const proxy = {
"/dev/": { '/dev/': {
target: "http://127.0.0.1:8001", target: 'http://127.0.0.1:8888',
changeOrigin: true, changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/dev/, "") rewrite: (path: string) => path.replace(/^\/dev/, '')
}, },
"/prod/": { '/prod/': {
target: "https://show.cool-admin.com", target: 'https://show.cool-admin.com',
changeOrigin: true, changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/prod/, "/api") rewrite: (path: string) => path.replace(/^\/prod/, '/api')
} }
}; };

View File

@ -1,11 +1,11 @@
import { cloneDeep, merge } from "lodash-es"; import { cloneDeep, merge } from 'lodash-es';
import { BaseService, service } from "../service"; import { BaseService, service } from '../service';
import { Module } from "../types"; import type { Module } from '../types';
import { path2Obj } from "../utils"; import { path2Obj } from '../utils';
import { config, isDev } from "/@/config"; import { config, isDev } from '/@/config';
import { eps } from "virtual:eps"; import { eps } from 'virtual:eps';
import { hmr } from "../hooks"; import { hmr } from '../hooks';
import { module } from "../module"; import { module } from '../module';
// 更新事件 // 更新事件
function onUpdate() { function onUpdate() {
@ -15,22 +15,24 @@ function onUpdate() {
const a = new BaseService(d.namespace); const a = new BaseService(d.namespace);
for (const i in d) { for (const i in d) {
const { path, method = "get" } = d[i]; const { path, method = 'get' } = d[i];
if (path) { if (path) {
a.request = a.request; a.request = a.request;
// @ts-ignore
a[i] = function (data?: any) { a[i] = function (data?: any) {
return this.request({ return this.request({
url: path, url: path,
method, method,
[method.toLocaleLowerCase() == "post" ? "data" : "params"]: data [method.toLocaleLowerCase() == 'post' ? 'data' : 'params']: data
}); });
}; };
} }
} }
for (const i in a) { for (const i in a) {
// @ts-ignore
d[i] = a[i]; d[i] = a[i];
} }
} else { } else {
@ -59,11 +61,11 @@ function onUpdate() {
); );
// 热更新处理 // 热更新处理
hmr.setData("service", service); hmr.setData('service', service);
// 提示 // 提示
if (isDev) { if (isDev) {
console.log("[cool-eps] updated"); console.log('[cool-eps] updated');
} }
} }
@ -76,21 +78,21 @@ export function createEps(modules: Module[]) {
const list: any[] = []; const list: any[] = [];
// 模拟 eps 数据 // 模拟 eps 数据
modules.forEach((m) => { modules.forEach(m => {
m.services?.forEach((s) => { m.services?.forEach(s => {
const api = Array.from( const api = Array.from(
new Set([ new Set([
...Object.getOwnPropertyNames(s.value.constructor.prototype), ...Object.getOwnPropertyNames(s.value.constructor.prototype),
"page", 'page',
"list", 'list',
"info", 'info',
"delete", 'delete',
"update", 'update',
"add" 'add'
]) ])
) )
.filter((e) => !["constructor", "namespace"].includes(e)) .filter(e => !['constructor', 'namespace'].includes(e))
.map((e) => { .map(e => {
return { return {
path: `/${e}` path: `/${e}`
}; };
@ -99,7 +101,7 @@ export function createEps(modules: Module[]) {
list.push({ list.push({
api, api,
module: m.name, module: m.name,
name: s.value.constructor.name + "Entity", name: s.value.constructor.name + 'Entity',
prefix: `/admin/${s.path}`, prefix: `/admin/${s.path}`,
isLocal: true isLocal: true
}); });
@ -108,8 +110,8 @@ export function createEps(modules: Module[]) {
// 生成文件 // 生成文件
service.request({ service.request({
url: "/__cool_eps", url: '/__cool_eps',
method: "POST", method: 'POST',
proxy: false, proxy: false,
data: { data: {
list list
@ -120,7 +122,7 @@ export function createEps(modules: Module[]) {
// 监听 vite 触发事件 // 监听 vite 触发事件
if (import.meta.hot) { if (import.meta.hot) {
import.meta.hot.on("eps-update", ({ service }) => { import.meta.hot.on('eps-update', ({ service }) => {
if (service) { if (service) {
eps.service = service; eps.service = service;
} }

Some files were not shown because too many files have changed in this diff Show More