es-plus-ui 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/es-plus.js +4 -4
- package/dist/es-plus.js.map +1 -1
- package/dist/es-plus.umd.cjs +1 -1
- package/dist/es-plus.umd.cjs.map +1 -1
- package/dist/src/components/es-dialog/__tests__/use-dialog.spec.d.ts +1 -0
- package/dist/src/components/es-table/__tests__/es-table.spec.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +7 -3
- package/schemas/README.md +75 -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 +142 -0
- package/schemas/index.schema.json +71 -0
- package/schemas/table-column.schema.json +111 -0
- package/schemas/table-options.schema.json +141 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.btns[data-v-8e62c688]{padding:0 0 5px;display:flex;justify-content:space-between;align-items:center}.left-text[data-v-8e62c688]{color:#7d7d7d;font-size:14px}.btn-container_block[data-v-8e62c688]{display:flex;justify-content:space-between;align-items:center;flex:1}.btn-container_block .btn-left[data-v-8e62c688]{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.btn-container_block .btn-right[data-v-8e62c688]{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap}@media (max-width: 768px){.btns[data-v-8e62c688]{flex-direction:column;align-items:flex-start}.btn-container_block[data-v-8e62c688]{flex-direction:column;align-items:flex-start;gap:10px}.btn-container_block .btn-left[data-v-8e62c688],.btn-container_block .btn-right[data-v-8e62c688]{width:100%;justify-content:flex-start}}.el-dp_tables[data-v-
|
|
1
|
+
@charset "UTF-8";.btns[data-v-8e62c688]{padding:0 0 5px;display:flex;justify-content:space-between;align-items:center}.left-text[data-v-8e62c688]{color:#7d7d7d;font-size:14px}.btn-container_block[data-v-8e62c688]{display:flex;justify-content:space-between;align-items:center;flex:1}.btn-container_block .btn-left[data-v-8e62c688]{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.btn-container_block .btn-right[data-v-8e62c688]{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap}@media (max-width: 768px){.btns[data-v-8e62c688]{flex-direction:column;align-items:flex-start}.btn-container_block[data-v-8e62c688]{flex-direction:column;align-items:flex-start;gap:10px}.btn-container_block .btn-left[data-v-8e62c688],.btn-container_block .btn-right[data-v-8e62c688]{width:100%;justify-content:flex-start}}.el-dp_tables[data-v-c23b96e8],.el-dp_tables[data-v-c23b96e8] .el-table__body-wrapper{height:auto}.table_component[data-v-c23b96e8]{width:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;overflow:hidden}.table_containers[data-v-c23b96e8]{flex:1;width:100%;height:100%;display:flex;justify-content:space-between;flex-direction:column;align-items:flex-start;position:relative}.pagination_page[data-v-c23b96e8]{width:100%;display:flex;justify-content:center;align-items:center}.btn-slot[data-v-c23b96e8]{width:100%}.btn-slot .headerBar[data-v-c23b96e8]{box-sizing:border-box;background-color:#fff;border-radius:6px}.btn-slot .headerBar[data-v-c23b96e8] .el-form-item--small .el-form-item__label{box-sizing:border-box}.tableContainer[data-v-c23b96e8]{border-radius:0;transition:all 1.5s;flex:1;width:100%;display:flex;justify-content:space-between;flex-direction:column;align-items:flex-start}.tableContainer .table_inner_containers[data-v-c23b96e8]{width:100%}.tableContainer[data-v-c23b96e8] .el-table__empty-block{width:100%!important;margin:32px 0;font-size:14px;line-height:1.5715}.tableContainer[data-v-c23b96e8] .el-table__empty-block .el-table__empty-text{width:auto!important}.tableContainer[data-v-c23b96e8] .el-table__empty-block .ant-empty-image{height:40px;margin-bottom:8px}.tableContainer[data-v-c23b96e8] .el-table__empty-block .ant-empty-image .ant-empty-img-simple-ellipse{fill:#f5f5f5}.tableContainer[data-v-c23b96e8] .el-table__empty-block .ant-empty-image .ant-empty-img-simple-g{stroke:#d9d9d9}.tableContainer[data-v-c23b96e8] .el-table__empty-block .ant-empty-image .ant-empty-img-simple-path{fill:#fafafa}.tableContainer[data-v-c23b96e8] .el-table__empty-block .ant-empty-description{line-height:1.5715;color:#00000040}.tableContainer[data-v-c23b96e8] .el-tag{height:20px;padding:0 7px;line-height:20px;background:#fafafa;border:none;border-radius:4px}.tableContainer[data-v-c23b96e8] .el-tag.el-tag--info{color:#000000d9}.tableContainer[data-v-c23b96e8] .el-tag.el-tag--success{color:#52c41a;background:#f6ffed;border-color:#b7eb8f}.es-form[data-v-5bcb00c5] .el-form-item{margin-bottom:18px}.es-form[data-v-5bcb00c5] .el-form-item__label{font-weight:500}.es-form .buttonOperate[data-v-5bcb00c5]{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.es-form .leftRightBtn[data-v-5bcb00c5]{display:flex;justify-content:space-between;align-items:center;width:100%}.es-form .leftRightBtn .btn-left[data-v-5bcb00c5],.es-form .leftRightBtn .btn-right[data-v-5bcb00c5]{display:flex;align-items:center}.es-form .btn-formItem[data-v-5bcb00c5]{margin-bottom:0}.es-form .formItemCols[data-v-5bcb00c5]{width:100%}.dp-dialog_wrapper[data-v-857351a8] .dialogAuto{margin:0!important}.dp-dialog_wrapper[data-v-857351a8] .el-overlay-dialog{display:flex;justify-content:center;align-items:center}.dp-dialog_wrapper[data-v-857351a8] .el-dialog{padding:10px}.dp-dialog_wrapper[data-v-857351a8] .el-dialog .el-dialog__footer{padding-top:0}.dp-dialog_wrapper[data-v-857351a8] .el-dialog .el-dialog__body{padding:10px 0}.dp-dialog_wrapper[data-v-857351a8] .el-dialog .el-dialog__header{border-bottom:1px solid #eee;display:flex;padding:0 0 10px;align-items:center;justify-content:space-between;margin:0}.dialog-title[data-v-857351a8]{line-height:24px;font-size:14px;color:#303133;font-weight:700}.btns[data-v-857351a8]{display:flex;align-items:center}.btns i[data-v-857351a8]{margin-right:8px;font-size:14px;cursor:pointer}.btns i[data-v-857351a8]:last-child{margin-right:0}.dialog_body_layouts[data-v-857351a8]{overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(135,162,189,.1490196078) rgba(200,213,225,.2784313725)}[data-v-857351a8]::-webkit-scrollbar{width:14px;height:14px}[data-v-857351a8]::-webkit-scrollbar-button{width:0;height:0;display:none}[data-v-857351a8]::-webkit-scrollbar-corner{background-color:transparent}[data-v-857351a8]::-webkit-scrollbar-thumb{min-height:12px;border:4px solid transparent;background-clip:content-box;border-radius:7px;background-color:#c8d5e1}[data-v-857351a8]::-webkit-scrollbar-thumb:hover{background-color:#a8bbcf}[data-v-857351a8]::-webkit-scrollbar-thumb:active{background-color:#87a2bd}[data-v-857351a8]::-webkit-scrollbar-track{background-color:transparent}[data-v-857351a8]::-webkit-scrollbar-track-piece{background-color:transparent}.svg-icon[data-v-3a11db57]{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.svg-external-icon[data-v-3a11db57]{background-color:currentColor;-webkit-mask-size:cover!important;mask-size:cover!important;display:inline-block}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-plus-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "基于 Vue 3 和 Element Plus 的企业级中后台前端组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/es-plus.umd.cjs",
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
"require": "./dist/es-plus.umd.cjs",
|
|
13
13
|
"types": "./dist/index.d.ts"
|
|
14
14
|
},
|
|
15
|
-
"./dist/style.css": "./dist/style.css"
|
|
15
|
+
"./dist/style.css": "./dist/style.css",
|
|
16
|
+
"./schemas/*": "./schemas/*"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
18
19
|
"dist",
|
|
20
|
+
"schemas",
|
|
19
21
|
"README.md"
|
|
20
22
|
],
|
|
21
23
|
"sideEffects": [
|
|
@@ -40,7 +42,9 @@
|
|
|
40
42
|
"typescript",
|
|
41
43
|
"enterprise",
|
|
42
44
|
"config-driven",
|
|
43
|
-
"crud"
|
|
45
|
+
"crud",
|
|
46
|
+
"json-schema",
|
|
47
|
+
"ai-friendly"
|
|
44
48
|
],
|
|
45
49
|
"author": "",
|
|
46
50
|
"license": "MIT",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# ES-Plus UI JSON Schema
|
|
2
|
+
|
|
3
|
+
JSON Schema definitions for es-plus-ui configuration objects. Enables IDE autocompletion, validation, and hover documentation when writing es-plus-ui configs.
|
|
4
|
+
|
|
5
|
+
## Usage in VS Code
|
|
6
|
+
|
|
7
|
+
### Method 1: Per-file `$schema` (for JSON config files)
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"$schema": "node_modules/es-plus-ui/schemas/form-item.schema.json",
|
|
12
|
+
"prop": "name",
|
|
13
|
+
"label": "Name",
|
|
14
|
+
"formtype": "Input"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Method 2: VS Code settings (for `.json` files matching a pattern)
|
|
19
|
+
|
|
20
|
+
Add to `.vscode/settings.json`:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"json.schemas": [
|
|
25
|
+
{
|
|
26
|
+
"fileMatch": ["**/form-items.json", "**/formItems.json"],
|
|
27
|
+
"url": "./node_modules/es-plus-ui/schemas/form-item.schema.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"fileMatch": ["**/table-columns.json", "**/columns.json"],
|
|
31
|
+
"url": "./node_modules/es-plus-ui/schemas/table-column.schema.json"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"fileMatch": ["**/table-options.json"],
|
|
35
|
+
"url": "./node_modules/es-plus-ui/schemas/table-options.schema.json"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Method 3: Use with AI coding assistants
|
|
42
|
+
|
|
43
|
+
When using Cursor, Claude Code, or GitHub Copilot, include the schema in your prompt context:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Use the es-plus-ui JSON Schema at node_modules/es-plus-ui/schemas/index.schema.json
|
|
47
|
+
to generate valid configuration for my CRUD page.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Available Schemas
|
|
51
|
+
|
|
52
|
+
| Schema | Description |
|
|
53
|
+
|--------|-------------|
|
|
54
|
+
| `form-item.schema.json` | Single form field config (FormItemOption) |
|
|
55
|
+
| `table-column.schema.json` | Single table column config (TableColumn) |
|
|
56
|
+
| `table-options.schema.json` | Table options config (TableOptions) |
|
|
57
|
+
| `btn-config.schema.json` | Button config (BtnConfig) |
|
|
58
|
+
| `dialog-options.schema.json` | Dialog options for useDialog() |
|
|
59
|
+
| `api-params.schema.json` | API request parameters |
|
|
60
|
+
| `index.schema.json` | Root schema with all definitions |
|
|
61
|
+
|
|
62
|
+
## Schema Structure
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
index.schema.json
|
|
66
|
+
├── form-item.schema.json
|
|
67
|
+
│ └── api-params.schema.json
|
|
68
|
+
├── table-column.schema.json
|
|
69
|
+
├── table-options.schema.json
|
|
70
|
+
│ ├── api-params.schema.json
|
|
71
|
+
│ └── btn-config.schema.json
|
|
72
|
+
├── btn-config.schema.json
|
|
73
|
+
└── dialog-options.schema.json
|
|
74
|
+
└── btn-config.schema.json
|
|
75
|
+
```
|
|
@@ -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,142 @@
|
|
|
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
|
+
"formtype": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": [
|
|
20
|
+
"Input",
|
|
21
|
+
"Select",
|
|
22
|
+
"datePicker",
|
|
23
|
+
"timePicker",
|
|
24
|
+
"Slider",
|
|
25
|
+
"ColorPicker",
|
|
26
|
+
"Transfer",
|
|
27
|
+
"Cascader",
|
|
28
|
+
"Radio",
|
|
29
|
+
"Checkbox",
|
|
30
|
+
"Switch",
|
|
31
|
+
"Rate",
|
|
32
|
+
"Upload"
|
|
33
|
+
],
|
|
34
|
+
"description": "Input component type. Maps to the corresponding Element Plus component"
|
|
35
|
+
},
|
|
36
|
+
"span": {
|
|
37
|
+
"type": "integer",
|
|
38
|
+
"minimum": 1,
|
|
39
|
+
"maximum": 24,
|
|
40
|
+
"default": 6,
|
|
41
|
+
"description": "Grid column span (el-col span, 24-column layout)"
|
|
42
|
+
},
|
|
43
|
+
"attrs": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "Attributes passed through to the underlying Element Plus component (e.g., placeholder, clearable, type, multiple)",
|
|
46
|
+
"additionalProperties": true
|
|
47
|
+
},
|
|
48
|
+
"on": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"description": "Event listeners passed to the component (e.g., change, input, blur)",
|
|
51
|
+
"additionalProperties": true
|
|
52
|
+
},
|
|
53
|
+
"dataOptions": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"description": "Options data for Select, Radio, Checkbox, Cascader components",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["label", "value"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"label": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Display text"
|
|
63
|
+
},
|
|
64
|
+
"value": {
|
|
65
|
+
"description": "Option value (string, number, or boolean)"
|
|
66
|
+
},
|
|
67
|
+
"disabled": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"description": "Whether this option is disabled"
|
|
70
|
+
},
|
|
71
|
+
"children": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"description": "Child options for Cascader",
|
|
74
|
+
"items": { "$ref": "#/properties/dataOptions/items" }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"width": {
|
|
80
|
+
"oneOf": [
|
|
81
|
+
{ "type": "number" },
|
|
82
|
+
{ "type": "string" }
|
|
83
|
+
],
|
|
84
|
+
"description": "Field width (number for px, string for CSS value)"
|
|
85
|
+
},
|
|
86
|
+
"isHidden": {
|
|
87
|
+
"description": "Function (model, item, formProps) => boolean. Returns true to hide the field conditionally"
|
|
88
|
+
},
|
|
89
|
+
"render": {
|
|
90
|
+
"description": "Custom render function (h, model, ctx) => VNode. Used when formtype is not set"
|
|
91
|
+
},
|
|
92
|
+
"apiParams": {
|
|
93
|
+
"$ref": "api-params.schema.json",
|
|
94
|
+
"description": "Configuration for loading options from an API endpoint"
|
|
95
|
+
},
|
|
96
|
+
"isInitRun": {
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"default": true,
|
|
99
|
+
"description": "Whether to auto-load API data on component initialization"
|
|
100
|
+
},
|
|
101
|
+
"callOptionListFormat": {
|
|
102
|
+
"description": "Function (data) => Array<{label, value}>. Transforms API response to dataOptions format"
|
|
103
|
+
},
|
|
104
|
+
"httpRequest": {
|
|
105
|
+
"description": "Custom HTTP request function override for this field. Signature: (params) => Promise"
|
|
106
|
+
},
|
|
107
|
+
"listenToCallBack": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"description": "Callback mapping. Use 'crtn' key for option format conversion",
|
|
110
|
+
"properties": {
|
|
111
|
+
"crtn": {
|
|
112
|
+
"description": "Function to convert API response to [{label, value}] format"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"additionalProperties": true
|
|
116
|
+
},
|
|
117
|
+
"formItemOptions": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"description": "Additional props passed to el-form-item (e.g., rules, labelWidth, required)",
|
|
120
|
+
"properties": {
|
|
121
|
+
"rules": {
|
|
122
|
+
"description": "Validation rules for this field (Element Plus format)"
|
|
123
|
+
},
|
|
124
|
+
"labelWidth": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "Override label width for this field"
|
|
127
|
+
},
|
|
128
|
+
"required": {
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"description": "Show required asterisk"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"additionalProperties": true
|
|
134
|
+
},
|
|
135
|
+
"components": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"description": "Custom component mapping for this field",
|
|
138
|
+
"additionalProperties": true
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": true
|
|
142
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://es-plus-ui.github.io/schemas/index.schema.json",
|
|
4
|
+
"title": "ES-Plus UI Configuration Schema",
|
|
5
|
+
"description": "Complete JSON Schema for es-plus-ui component library configuration. Covers EsForm, EsTable, useDialog, and shared types.",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"FormItemOption": {
|
|
8
|
+
"$ref": "form-item.schema.json"
|
|
9
|
+
},
|
|
10
|
+
"TableColumn": {
|
|
11
|
+
"$ref": "table-column.schema.json"
|
|
12
|
+
},
|
|
13
|
+
"TableOptions": {
|
|
14
|
+
"$ref": "table-options.schema.json"
|
|
15
|
+
},
|
|
16
|
+
"BtnConfig": {
|
|
17
|
+
"$ref": "btn-config.schema.json"
|
|
18
|
+
},
|
|
19
|
+
"DialogOptions": {
|
|
20
|
+
"$ref": "dialog-options.schema.json"
|
|
21
|
+
},
|
|
22
|
+
"ApiParams": {
|
|
23
|
+
"$ref": "api-params.schema.json"
|
|
24
|
+
},
|
|
25
|
+
"FormItemList": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"description": "Array of form field configurations",
|
|
28
|
+
"items": { "$ref": "form-item.schema.json" }
|
|
29
|
+
},
|
|
30
|
+
"TableColumnList": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"description": "Array of table column configurations",
|
|
33
|
+
"items": { "$ref": "table-column.schema.json" }
|
|
34
|
+
},
|
|
35
|
+
"PaginationConfig": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "Pagination configuration",
|
|
38
|
+
"properties": {
|
|
39
|
+
"pageSize": {
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"default": 10,
|
|
42
|
+
"description": "Number of items per page"
|
|
43
|
+
},
|
|
44
|
+
"current": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"default": 1,
|
|
47
|
+
"description": "Current page number"
|
|
48
|
+
},
|
|
49
|
+
"total": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"description": "Total number of records"
|
|
52
|
+
},
|
|
53
|
+
"pageSizes": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"items": { "type": "integer" },
|
|
56
|
+
"description": "Available page size options"
|
|
57
|
+
},
|
|
58
|
+
"size": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": ["large", "default", "small"],
|
|
61
|
+
"default": "small"
|
|
62
|
+
},
|
|
63
|
+
"isSmall": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"default": true,
|
|
66
|
+
"description": "Use compact pagination style"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|