@es-plus/cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +421 -0
- package/build/commands/create.d.ts +3 -0
- package/build/commands/create.d.ts.map +1 -0
- package/build/commands/create.js +79 -0
- package/build/commands/create.js.map +1 -0
- package/build/commands/scaffold.d.ts +3 -0
- package/build/commands/scaffold.d.ts.map +1 -0
- package/build/commands/scaffold.js +29 -0
- package/build/commands/scaffold.js.map +1 -0
- package/build/commands/validate.d.ts +3 -0
- package/build/commands/validate.d.ts.map +1 -0
- package/build/commands/validate.js +57 -0
- package/build/commands/validate.js.map +1 -0
- package/build/core/code-generator.d.ts +9 -0
- package/build/core/code-generator.d.ts.map +1 -0
- package/build/core/code-generator.js +87 -0
- package/build/core/code-generator.js.map +1 -0
- package/build/core/constants.d.ts +61 -0
- package/build/core/constants.d.ts.map +1 -0
- package/build/core/constants.js +51 -0
- package/build/core/constants.js.map +1 -0
- package/build/core/crud-engine.d.ts +12 -0
- package/build/core/crud-engine.d.ts.map +1 -0
- package/build/core/crud-engine.js +405 -0
- package/build/core/crud-engine.js.map +1 -0
- package/build/core/schema-validator.d.ts +9 -0
- package/build/core/schema-validator.d.ts.map +1 -0
- package/build/core/schema-validator.js +83 -0
- package/build/core/schema-validator.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +16 -0
- package/build/index.js.map +1 -0
- package/package.json +57 -0
- package/schemas/api-params.schema.json +36 -0
- package/schemas/btn-config.schema.json +77 -0
- package/schemas/dialog-options.schema.json +149 -0
- package/schemas/form-item.schema.json +146 -0
- package/schemas/index.schema.json +71 -0
- package/schemas/table-column.schema.json +118 -0
- package/schemas/table-options.schema.json +141 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crud-engine.js","sourceRoot":"","sources":["../../src/core/crud-engine.ts"],"names":[],"mappings":"AAmBA,MA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AA;IAC3B,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oCAAoC,EACtD,+EAA+E,CAAC,CAAA;IAClF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oCAAoC,EACtD,+EAA+E,CAAC,CAAA;IAClF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,mCAAmC,EACrD,0EAA0E,CAAC,CAAA;IAE7E,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ValidationResult {
|
|
2
|
+
valid: boolean;
|
|
3
|
+
errors: string[];
|
|
4
|
+
suggestions: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function validateConfig(config: unknown, schemaType?: string): ValidationResult;
|
|
7
|
+
export declare function listAvailableSchemas(): string[];
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=schema-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-validator.d.ts","sourceRoot":"","sources":["../../src/core/schema-validator.ts"],"names":[],"mappings":"AAwBA,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AASD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAiClB;AA6BD,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
import { readFileSync, readdirSync, existsSync } from "node:fs";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const SCHEMAS_DIR = join(__dirname, "../../schemas");
|
|
7
|
+
const ajv = new Ajv({ allErrors: true, verbose: true });
|
|
8
|
+
let schemasLoaded = false;
|
|
9
|
+
function ensureSchemasLoaded() {
|
|
10
|
+
if (schemasLoaded)
|
|
11
|
+
return;
|
|
12
|
+
schemasLoaded = true;
|
|
13
|
+
if (!existsSync(SCHEMAS_DIR))
|
|
14
|
+
return;
|
|
15
|
+
const files = readdirSync(SCHEMAS_DIR).filter((f) => f.endsWith(".schema.json"));
|
|
16
|
+
for (const file of files) {
|
|
17
|
+
const schema = JSON.parse(readFileSync(join(SCHEMAS_DIR, file), "utf-8"));
|
|
18
|
+
if (schema.$id) {
|
|
19
|
+
try {
|
|
20
|
+
ajv.addSchema(schema);
|
|
21
|
+
}
|
|
22
|
+
catch { /* already added */ }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function loadSchema(schemaName) {
|
|
27
|
+
ensureSchemasLoaded();
|
|
28
|
+
const schemaPath = join(SCHEMAS_DIR, `${schemaName}.schema.json`);
|
|
29
|
+
if (!existsSync(schemaPath))
|
|
30
|
+
return null;
|
|
31
|
+
return JSON.parse(readFileSync(schemaPath, "utf-8"));
|
|
32
|
+
}
|
|
33
|
+
export function validateConfig(config, schemaType) {
|
|
34
|
+
const schemaName = schemaType || "form-item";
|
|
35
|
+
const schema = loadSchema(schemaName);
|
|
36
|
+
if (!schema) {
|
|
37
|
+
return {
|
|
38
|
+
valid: false,
|
|
39
|
+
errors: [`Schema "${schemaName}" not found. Available: form-item, table-column, table-options, dialog-options`],
|
|
40
|
+
suggestions: ["Check schema name spelling"],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const schemaObj = schema;
|
|
44
|
+
let validate;
|
|
45
|
+
if (schemaObj.$id && ajv.getSchema(schemaObj.$id)) {
|
|
46
|
+
validate = ajv.getSchema(schemaObj.$id);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
validate = ajv.compile(schema);
|
|
50
|
+
}
|
|
51
|
+
const valid = validate(config);
|
|
52
|
+
if (valid) {
|
|
53
|
+
return { valid: true, errors: [], suggestions: [] };
|
|
54
|
+
}
|
|
55
|
+
const errors = (validate.errors || []).map((err) => {
|
|
56
|
+
const path = err.instancePath || "(root)";
|
|
57
|
+
return `${path}: ${err.message}`;
|
|
58
|
+
});
|
|
59
|
+
const suggestions = generateSuggestions(validate.errors || [], schemaName);
|
|
60
|
+
return { valid: false, errors, suggestions };
|
|
61
|
+
}
|
|
62
|
+
function generateSuggestions(errors, schemaName) {
|
|
63
|
+
const suggestions = [];
|
|
64
|
+
for (const err of errors) {
|
|
65
|
+
if (err.keyword === "required") {
|
|
66
|
+
suggestions.push(`Add missing property "${err.params.missingProperty}"`);
|
|
67
|
+
}
|
|
68
|
+
if (err.keyword === "enum") {
|
|
69
|
+
suggestions.push(`Valid values for ${err.instancePath}: ${err.params.allowedValues?.join(", ")}`);
|
|
70
|
+
}
|
|
71
|
+
if (err.keyword === "type") {
|
|
72
|
+
suggestions.push(`${err.instancePath} should be type "${err.params.type}"`);
|
|
73
|
+
}
|
|
74
|
+
if (err.keyword === "additionalProperties") {
|
|
75
|
+
suggestions.push(`Remove unknown property "${err.params.additionalProperty}"`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return suggestions;
|
|
79
|
+
}
|
|
80
|
+
export function listAvailableSchemas() {
|
|
81
|
+
return ["form-item", "table-column", "table-options", "dialog-options"];
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=schema-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-validator.js","sourceRoot":"","sources":["../../src/core/schema-validator.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAA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/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { program } from "commander";
|
|
4
|
+
import { createCommand } from "./commands/create.js";
|
|
5
|
+
import { validateCommand } from "./commands/validate.js";
|
|
6
|
+
import { scaffoldCommand } from "./commands/scaffold.js";
|
|
7
|
+
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
8
|
+
program
|
|
9
|
+
.name("es-plus")
|
|
10
|
+
.description("es-plus-ui CLI — generate CRUD pages & validate configs")
|
|
11
|
+
.version(pkg.version);
|
|
12
|
+
program.addCommand(createCommand);
|
|
13
|
+
program.addCommand(validateCommand);
|
|
14
|
+
program.addCommand(scaffoldCommand);
|
|
15
|
+
program.parse();
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3F,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,yDAAyD,CAAC;KACtE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACpC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEpC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@es-plus/cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool for es-plus-ui - generate CRUD pages, validate configs",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"es-plus": "./build/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./build/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./build/index.d.ts",
|
|
13
|
+
"import": "./build/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"build",
|
|
18
|
+
"schemas"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"es-plus",
|
|
27
|
+
"cli",
|
|
28
|
+
"crud",
|
|
29
|
+
"vue3",
|
|
30
|
+
"code-generator",
|
|
31
|
+
"element-plus"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.0.0"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/es-plus-ui/es-plus.git",
|
|
40
|
+
"directory": "packages/cli"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"registry": "https://registry.npmjs.org/"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"commander": "^12.0.0",
|
|
48
|
+
"prompts": "^2.4.2",
|
|
49
|
+
"picocolors": "^1.0.0",
|
|
50
|
+
"ajv": "^8.12.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^20.0.0",
|
|
54
|
+
"@types/prompts": "^2.4.0",
|
|
55
|
+
"typescript": "^5.3.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://es-plus-ui.github.io/schemas/api-params.schema.json",
|
|
4
|
+
"title": "API Parameters Configuration",
|
|
5
|
+
"description": "Configuration for API requests in es-plus-ui components",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["url"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"url": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "API endpoint URL"
|
|
12
|
+
},
|
|
13
|
+
"method": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
|
|
16
|
+
"default": "GET",
|
|
17
|
+
"description": "HTTP request method"
|
|
18
|
+
},
|
|
19
|
+
"headers": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Request headers",
|
|
22
|
+
"additionalProperties": { "type": "string" }
|
|
23
|
+
},
|
|
24
|
+
"model": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"description": "Additional parameters merged into the request",
|
|
27
|
+
"additionalProperties": true
|
|
28
|
+
},
|
|
29
|
+
"options": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"description": "Extra request options",
|
|
32
|
+
"additionalProperties": true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"additionalProperties": true
|
|
36
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://es-plus-ui.github.io/schemas/btn-config.schema.json",
|
|
4
|
+
"title": "Button Configuration",
|
|
5
|
+
"description": "Configuration for action buttons in es-plus-ui EsForm and EsTable",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["name"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Button display text"
|
|
12
|
+
},
|
|
13
|
+
"key": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Button identifier. Special values: 'query' triggers table data fetch, 'reset' resets the form",
|
|
16
|
+
"examples": ["query", "reset", "add", "export"]
|
|
17
|
+
},
|
|
18
|
+
"type": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["primary", "success", "warning", "danger", "info", ""],
|
|
21
|
+
"description": "Button visual type (Element Plus button types)"
|
|
22
|
+
},
|
|
23
|
+
"size": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"enum": ["large", "default", "small"],
|
|
26
|
+
"description": "Button size"
|
|
27
|
+
},
|
|
28
|
+
"icon": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Element Plus icon name (e.g., 'Search', 'Plus', 'Delete')"
|
|
31
|
+
},
|
|
32
|
+
"direction": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["left", "right"],
|
|
35
|
+
"default": "right",
|
|
36
|
+
"description": "Button alignment in the form button area"
|
|
37
|
+
},
|
|
38
|
+
"loading": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": false,
|
|
41
|
+
"description": "Show loading spinner on the button"
|
|
42
|
+
},
|
|
43
|
+
"disabled": {
|
|
44
|
+
"oneOf": [
|
|
45
|
+
{ "type": "boolean" }
|
|
46
|
+
],
|
|
47
|
+
"description": "Disable the button. Can be a boolean or a function () => boolean"
|
|
48
|
+
},
|
|
49
|
+
"triggerEvent": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"default": false,
|
|
52
|
+
"description": "When true, automatically triggers form-table linkage. With key='query', calls parent EsTable's httpRequestInstance. With key='reset', resets form fields"
|
|
53
|
+
},
|
|
54
|
+
"click": {
|
|
55
|
+
"description": "Click handler. In form context: (model, formRef, httpRequestInstance?) => void. In dialog context: (instance, { close, getRefs, dialogVm }) => void"
|
|
56
|
+
},
|
|
57
|
+
"code": {
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"enum": [1, 2],
|
|
60
|
+
"description": "Button group position in table toolbar. 1 = left group, 2 = right group"
|
|
61
|
+
},
|
|
62
|
+
"isHide": {
|
|
63
|
+
"oneOf": [
|
|
64
|
+
{ "type": "boolean" }
|
|
65
|
+
],
|
|
66
|
+
"description": "Hide the button. Can be a boolean or a function () => boolean"
|
|
67
|
+
},
|
|
68
|
+
"permissionValue": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Permission code for button visibility control"
|
|
71
|
+
},
|
|
72
|
+
"render": {
|
|
73
|
+
"description": "Custom render function for the button slot"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"additionalProperties": true
|
|
77
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://es-plus-ui.github.io/schemas/dialog-options.schema.json",
|
|
4
|
+
"title": "useDialog Options Configuration",
|
|
5
|
+
"description": "Configuration object passed to the useDialog() hook in es-plus-ui",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"title": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Dialog title"
|
|
11
|
+
},
|
|
12
|
+
"width": {
|
|
13
|
+
"oneOf": [
|
|
14
|
+
{ "type": "string" },
|
|
15
|
+
{ "type": "number" }
|
|
16
|
+
],
|
|
17
|
+
"default": "50%",
|
|
18
|
+
"description": "Dialog width (CSS value or number in px)"
|
|
19
|
+
},
|
|
20
|
+
"height": {
|
|
21
|
+
"oneOf": [
|
|
22
|
+
{ "type": "string" },
|
|
23
|
+
{ "type": "number" }
|
|
24
|
+
],
|
|
25
|
+
"description": "Dialog height"
|
|
26
|
+
},
|
|
27
|
+
"maxHeight": {
|
|
28
|
+
"oneOf": [
|
|
29
|
+
{ "type": "string" },
|
|
30
|
+
{ "type": "number" }
|
|
31
|
+
],
|
|
32
|
+
"description": "Maximum height for dialog body content area"
|
|
33
|
+
},
|
|
34
|
+
"key": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Unique identifier. Same key reuses dialog instance"
|
|
37
|
+
},
|
|
38
|
+
"render": {
|
|
39
|
+
"description": "Content render function. Signature: (h, { registerRef, getRefs }, components) => VNode"
|
|
40
|
+
},
|
|
41
|
+
"renderHeader": {
|
|
42
|
+
"description": "Header render function. Signature: (h, instance) => VNode"
|
|
43
|
+
},
|
|
44
|
+
"renderFooter": {
|
|
45
|
+
"description": "Footer render function. Signature: (h, instance) => VNode"
|
|
46
|
+
},
|
|
47
|
+
"configBtn": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"description": "Footer action buttons. Click signature: (currentRef, { close, getRefs, dialogInstance }) => void",
|
|
50
|
+
"items": { "$ref": "btn-config.schema.json" }
|
|
51
|
+
},
|
|
52
|
+
"isDraggable": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": false,
|
|
55
|
+
"description": "Enable drag to move the dialog"
|
|
56
|
+
},
|
|
57
|
+
"fullscreen": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"default": false,
|
|
60
|
+
"description": "Start dialog in fullscreen mode"
|
|
61
|
+
},
|
|
62
|
+
"hiddenFullBtn": {
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"default": false,
|
|
65
|
+
"description": "Hide the fullscreen toggle button in header"
|
|
66
|
+
},
|
|
67
|
+
"isHiddenFooter": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"default": false,
|
|
70
|
+
"description": "Hide the entire footer section"
|
|
71
|
+
},
|
|
72
|
+
"center": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"description": "Vertically center the dialog"
|
|
75
|
+
},
|
|
76
|
+
"closeOnClickModal": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"default": false,
|
|
79
|
+
"description": "Close dialog when clicking the overlay mask"
|
|
80
|
+
},
|
|
81
|
+
"closeOnPressEscape": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"default": false,
|
|
84
|
+
"description": "Close dialog when pressing ESC key"
|
|
85
|
+
},
|
|
86
|
+
"showClose": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"default": true,
|
|
89
|
+
"description": "Show the close button in header"
|
|
90
|
+
},
|
|
91
|
+
"destroyOnClose": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"default": true,
|
|
94
|
+
"description": "Destroy dialog content when closed"
|
|
95
|
+
},
|
|
96
|
+
"loading": {
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"default": false,
|
|
99
|
+
"description": "Show loading state on the dialog"
|
|
100
|
+
},
|
|
101
|
+
"customClass": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Custom CSS class for the dialog"
|
|
104
|
+
},
|
|
105
|
+
"appendToBody": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"description": "Mount dialog to document body"
|
|
108
|
+
},
|
|
109
|
+
"appendTo": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "CSS selector or HTMLElement for dialog mount target"
|
|
112
|
+
},
|
|
113
|
+
"modal": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"description": "Show overlay mask behind dialog"
|
|
116
|
+
},
|
|
117
|
+
"lockScroll": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"description": "Lock page scroll when dialog is open"
|
|
120
|
+
},
|
|
121
|
+
"onlyInstance": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"default": false,
|
|
124
|
+
"description": "Singleton mode: reuses one dialog instance, updates content on subsequent calls"
|
|
125
|
+
},
|
|
126
|
+
"showDefaultButtons": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"description": "Show default Confirm/Cancel buttons"
|
|
129
|
+
},
|
|
130
|
+
"confirmText": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"description": "Custom text for the confirm button"
|
|
133
|
+
},
|
|
134
|
+
"cancelText": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"description": "Custom text for the cancel button"
|
|
137
|
+
},
|
|
138
|
+
"onSubmit": {
|
|
139
|
+
"description": "Submit callback. Signature: (close) => void"
|
|
140
|
+
},
|
|
141
|
+
"onClosed": {
|
|
142
|
+
"description": "Callback fired after dialog is fully closed"
|
|
143
|
+
},
|
|
144
|
+
"onOpen": {
|
|
145
|
+
"description": "Callback fired when dialog opens"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"additionalProperties": true
|
|
149
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://es-plus-ui.github.io/schemas/form-item.schema.json",
|
|
4
|
+
"title": "EsForm Item Configuration",
|
|
5
|
+
"description": "Configuration for a single form field in es-plus-ui EsForm component",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["prop", "label"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"prop": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Field name bound to the form model. Supports nested paths like 'a.b' or 'a[0].b'"
|
|
12
|
+
},
|
|
13
|
+
"label": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Display label for the form field"
|
|
16
|
+
},
|
|
17
|
+
"labelKey": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "i18n translation key for the label. When a global t() function is configured via app.use(ESPlus, { t }), the label will be translated using t(labelKey). Falls back to label when t() is not configured"
|
|
20
|
+
},
|
|
21
|
+
"formtype": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"enum": [
|
|
24
|
+
"Input",
|
|
25
|
+
"Select",
|
|
26
|
+
"datePicker",
|
|
27
|
+
"timePicker",
|
|
28
|
+
"Slider",
|
|
29
|
+
"ColorPicker",
|
|
30
|
+
"Transfer",
|
|
31
|
+
"Cascader",
|
|
32
|
+
"Radio",
|
|
33
|
+
"Checkbox",
|
|
34
|
+
"Switch",
|
|
35
|
+
"Rate",
|
|
36
|
+
"Upload"
|
|
37
|
+
],
|
|
38
|
+
"description": "Input component type. Maps to the corresponding Element Plus component"
|
|
39
|
+
},
|
|
40
|
+
"span": {
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"minimum": 1,
|
|
43
|
+
"maximum": 24,
|
|
44
|
+
"default": 6,
|
|
45
|
+
"description": "Grid column span (el-col span, 24-column layout)"
|
|
46
|
+
},
|
|
47
|
+
"attrs": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "Attributes passed through to the underlying Element Plus component (e.g., placeholder, clearable, type, multiple)",
|
|
50
|
+
"additionalProperties": true
|
|
51
|
+
},
|
|
52
|
+
"on": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"description": "Event listeners passed to the component (e.g., change, input, blur)",
|
|
55
|
+
"additionalProperties": true
|
|
56
|
+
},
|
|
57
|
+
"dataOptions": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"description": "Options data for Select, Radio, Checkbox, Cascader components",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": ["label", "value"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"label": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "Display text"
|
|
67
|
+
},
|
|
68
|
+
"value": {
|
|
69
|
+
"description": "Option value (string, number, or boolean)"
|
|
70
|
+
},
|
|
71
|
+
"disabled": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"description": "Whether this option is disabled"
|
|
74
|
+
},
|
|
75
|
+
"children": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"description": "Child options for Cascader",
|
|
78
|
+
"items": { "$ref": "#/properties/dataOptions/items" }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"width": {
|
|
84
|
+
"oneOf": [
|
|
85
|
+
{ "type": "number" },
|
|
86
|
+
{ "type": "string" }
|
|
87
|
+
],
|
|
88
|
+
"description": "Field width (number for px, string for CSS value)"
|
|
89
|
+
},
|
|
90
|
+
"isHidden": {
|
|
91
|
+
"description": "Function (model, item, formProps) => boolean. Returns true to hide the field conditionally"
|
|
92
|
+
},
|
|
93
|
+
"render": {
|
|
94
|
+
"description": "Custom render function (h, model, ctx) => VNode. Used when formtype is not set"
|
|
95
|
+
},
|
|
96
|
+
"apiParams": {
|
|
97
|
+
"$ref": "api-params.schema.json",
|
|
98
|
+
"description": "Configuration for loading options from an API endpoint"
|
|
99
|
+
},
|
|
100
|
+
"isInitRun": {
|
|
101
|
+
"type": "boolean",
|
|
102
|
+
"default": true,
|
|
103
|
+
"description": "Whether to auto-load API data on component initialization"
|
|
104
|
+
},
|
|
105
|
+
"callOptionListFormat": {
|
|
106
|
+
"description": "Function (data) => Array<{label, value}>. Transforms API response to dataOptions format"
|
|
107
|
+
},
|
|
108
|
+
"httpRequest": {
|
|
109
|
+
"description": "Custom HTTP request function override for this field. Signature: (params) => Promise"
|
|
110
|
+
},
|
|
111
|
+
"listenToCallBack": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"description": "Callback mapping. Use 'crtn' key for option format conversion",
|
|
114
|
+
"properties": {
|
|
115
|
+
"crtn": {
|
|
116
|
+
"description": "Function to convert API response to [{label, value}] format"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"additionalProperties": true
|
|
120
|
+
},
|
|
121
|
+
"formItemOptions": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"description": "Additional props passed to el-form-item (e.g., rules, labelWidth, required)",
|
|
124
|
+
"properties": {
|
|
125
|
+
"rules": {
|
|
126
|
+
"description": "Validation rules for this field (Element Plus format)"
|
|
127
|
+
},
|
|
128
|
+
"labelWidth": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Override label width for this field"
|
|
131
|
+
},
|
|
132
|
+
"required": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"description": "Show required asterisk"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"additionalProperties": true
|
|
138
|
+
},
|
|
139
|
+
"components": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"description": "Custom component mapping for this field",
|
|
142
|
+
"additionalProperties": true
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"additionalProperties": true
|
|
146
|
+
}
|