@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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +421 -0
  3. package/build/commands/create.d.ts +3 -0
  4. package/build/commands/create.d.ts.map +1 -0
  5. package/build/commands/create.js +79 -0
  6. package/build/commands/create.js.map +1 -0
  7. package/build/commands/scaffold.d.ts +3 -0
  8. package/build/commands/scaffold.d.ts.map +1 -0
  9. package/build/commands/scaffold.js +29 -0
  10. package/build/commands/scaffold.js.map +1 -0
  11. package/build/commands/validate.d.ts +3 -0
  12. package/build/commands/validate.d.ts.map +1 -0
  13. package/build/commands/validate.js +57 -0
  14. package/build/commands/validate.js.map +1 -0
  15. package/build/core/code-generator.d.ts +9 -0
  16. package/build/core/code-generator.d.ts.map +1 -0
  17. package/build/core/code-generator.js +87 -0
  18. package/build/core/code-generator.js.map +1 -0
  19. package/build/core/constants.d.ts +61 -0
  20. package/build/core/constants.d.ts.map +1 -0
  21. package/build/core/constants.js +51 -0
  22. package/build/core/constants.js.map +1 -0
  23. package/build/core/crud-engine.d.ts +12 -0
  24. package/build/core/crud-engine.d.ts.map +1 -0
  25. package/build/core/crud-engine.js +405 -0
  26. package/build/core/crud-engine.js.map +1 -0
  27. package/build/core/schema-validator.d.ts +9 -0
  28. package/build/core/schema-validator.d.ts.map +1 -0
  29. package/build/core/schema-validator.js +83 -0
  30. package/build/core/schema-validator.js.map +1 -0
  31. package/build/index.d.ts +3 -0
  32. package/build/index.d.ts.map +1 -0
  33. package/build/index.js +16 -0
  34. package/build/index.js.map +1 -0
  35. package/package.json +57 -0
  36. package/schemas/api-params.schema.json +36 -0
  37. package/schemas/btn-config.schema.json +77 -0
  38. package/schemas/dialog-options.schema.json +149 -0
  39. package/schemas/form-item.schema.json +146 -0
  40. package/schemas/index.schema.json +71 -0
  41. package/schemas/table-column.schema.json +118 -0
  42. package/schemas/table-options.schema.json +141 -0
@@ -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
+ }
@@ -0,0 +1,118 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://es-plus-ui.github.io/schemas/table-column.schema.json",
4
+ "title": "EsTable Column Configuration",
5
+ "description": "Configuration for a single column in es-plus-ui EsTable component",
6
+ "type": "object",
7
+ "properties": {
8
+ "prop": {
9
+ "type": "string",
10
+ "description": "Data field name in the row object"
11
+ },
12
+ "key": {
13
+ "type": "string",
14
+ "description": "Alternative to prop. Column unique identifier (converted to prop internally)"
15
+ },
16
+ "label": {
17
+ "type": "string",
18
+ "description": "Column header text"
19
+ },
20
+ "labelKey": {
21
+ "type": "string",
22
+ "description": "i18n translation key for the column header. When a global t() function is configured via app.use(ESPlus, { t }), the header will be translated using t(labelKey). Falls back to label when t() is not configured"
23
+ },
24
+ "width": {
25
+ "oneOf": [
26
+ { "type": "number" },
27
+ { "type": "string" }
28
+ ],
29
+ "description": "Column width in pixels"
30
+ },
31
+ "minWidth": {
32
+ "oneOf": [
33
+ { "type": "number" },
34
+ { "type": "string" }
35
+ ],
36
+ "description": "Minimum column width"
37
+ },
38
+ "align": {
39
+ "type": "string",
40
+ "enum": ["left", "center", "right"],
41
+ "default": "center",
42
+ "description": "Text alignment"
43
+ },
44
+ "fixed": {
45
+ "oneOf": [
46
+ { "type": "boolean" },
47
+ { "type": "string", "enum": ["left", "right"] }
48
+ ],
49
+ "description": "Fix column to left or right side"
50
+ },
51
+ "formatter": {
52
+ "description": "Function (row) => string. Format cell display value"
53
+ },
54
+ "render": {
55
+ "description": "Custom render function (h, { row, value, index }) => VNode"
56
+ },
57
+ "scopedSlots": {
58
+ "type": "object",
59
+ "description": "Named slot configuration for custom column rendering",
60
+ "properties": {
61
+ "customRender": {
62
+ "type": "string",
63
+ "description": "Slot name to use for rendering this column"
64
+ }
65
+ }
66
+ },
67
+ "groups": {
68
+ "type": "array",
69
+ "description": "Nested child columns for multi-level headers",
70
+ "items": { "$ref": "#" }
71
+ },
72
+ "ellipsis": {
73
+ "type": "boolean",
74
+ "description": "Enable text overflow ellipsis with tooltip"
75
+ },
76
+ "hidCol": {
77
+ "type": "boolean",
78
+ "description": "Hide this column from rendering"
79
+ },
80
+ "btns": {
81
+ "type": "array",
82
+ "description": "Row operation buttons (typically used in an 'actions' column)",
83
+ "items": {
84
+ "type": "object",
85
+ "required": ["name"],
86
+ "properties": {
87
+ "name": {
88
+ "type": "string",
89
+ "description": "Button text"
90
+ },
91
+ "type": {
92
+ "type": "string",
93
+ "enum": ["primary", "success", "warning", "danger", "info", ""],
94
+ "default": "primary",
95
+ "description": "Button type (renders as text/link button)"
96
+ },
97
+ "clickEvent": {
98
+ "description": "Function (row) => void. Click handler receiving the row data"
99
+ },
100
+ "permissionValue": {
101
+ "type": "string",
102
+ "description": "Permission code for button visibility. When a global permission() function is configured, buttons with unmatched permissionValue will be hidden"
103
+ }
104
+ }
105
+ },
106
+ "type": {
107
+ "type": "string",
108
+ "enum": ["selection", "expand", "index"],
109
+ "description": "Special column type: selection checkbox, expand row, or row index"
110
+ },
111
+ "emptyPlaceholder": {
112
+ "type": "string",
113
+ "default": "-",
114
+ "description": "Placeholder text for empty cell values"
115
+ }
116
+ },
117
+ "additionalProperties": true
118
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://es-plus-ui.github.io/schemas/table-options.schema.json",
4
+ "title": "EsTable Options Configuration",
5
+ "description": "Configuration object for es-plus-ui EsTable options prop",
6
+ "type": "object",
7
+ "properties": {
8
+ "border": {
9
+ "type": "boolean",
10
+ "default": false,
11
+ "description": "Show table border"
12
+ },
13
+ "stripe": {
14
+ "type": "boolean",
15
+ "default": false,
16
+ "description": "Show striped rows"
17
+ },
18
+ "size": {
19
+ "type": "string",
20
+ "enum": ["large", "default", "small"],
21
+ "default": "small",
22
+ "description": "Table size"
23
+ },
24
+ "headerCellStyle": {
25
+ "type": "object",
26
+ "default": { "background": "#f5f7fa" },
27
+ "description": "Style object for header cells"
28
+ },
29
+ "highlightCurrentRow": {
30
+ "type": "boolean",
31
+ "default": true,
32
+ "description": "Highlight the currently selected row"
33
+ },
34
+ "multiSelect": {
35
+ "type": "boolean",
36
+ "default": false,
37
+ "description": "Show checkbox selection column"
38
+ },
39
+ "expand": {
40
+ "type": "boolean",
41
+ "default": false,
42
+ "description": "Show expand row column"
43
+ },
44
+ "snIndex": {
45
+ "type": "boolean",
46
+ "default": false,
47
+ "description": "Show row index column"
48
+ },
49
+ "loading": {
50
+ "type": "boolean",
51
+ "default": false,
52
+ "description": "Show loading overlay"
53
+ },
54
+ "heightType": {
55
+ "type": "string",
56
+ "enum": ["auto", "height", "maxHeight"],
57
+ "description": "Height calculation mode. 'height' recommended for adaptive height with ResizeObserver"
58
+ },
59
+ "tabHeight": {
60
+ "oneOf": [
61
+ { "type": "number" },
62
+ { "type": "string" }
63
+ ],
64
+ "description": "Container height value (used with heightType)"
65
+ },
66
+ "cachePageSelection": {
67
+ "type": "boolean",
68
+ "default": true,
69
+ "description": "Persist checkbox selections across page changes"
70
+ },
71
+ "rowkey": {
72
+ "type": "string",
73
+ "description": "Row unique identifier field name. Required for cross-page selection"
74
+ },
75
+ "isInitRun": {
76
+ "type": "boolean",
77
+ "default": true,
78
+ "description": "Auto-fetch data on component mount"
79
+ },
80
+ "httpRequest": {
81
+ "description": "Custom request handler. Signature: (params: { url, method, headers, formParams, pageIndex, pageSize }) => Promise<response>"
82
+ },
83
+ "apiParams": {
84
+ "$ref": "api-params.schema.json",
85
+ "description": "API request configuration"
86
+ },
87
+ "actionUrl": {
88
+ "type": "string",
89
+ "description": "API endpoint URL (shorthand for apiParams.url)"
90
+ },
91
+ "configTableOut": {
92
+ "type": "object",
93
+ "description": "Map backend response field names to internal fields. Uses recursive key lookup (no dot-path needed)",
94
+ "properties": {
95
+ "total": {
96
+ "type": "string",
97
+ "description": "Field name for total record count in response"
98
+ },
99
+ "tableData": {
100
+ "type": "string",
101
+ "description": "Field name for data array in response"
102
+ },
103
+ "pageSize": {
104
+ "type": "string",
105
+ "description": "Field name for page size in response"
106
+ },
107
+ "current": {
108
+ "type": "string",
109
+ "description": "Field name for current page number in response"
110
+ }
111
+ }
112
+ },
113
+ "listenToCallBack": {
114
+ "type": "object",
115
+ "description": "Request/response interceptor pipeline",
116
+ "properties": {
117
+ "brcb": {
118
+ "description": "Before Request CallBack. Function (params) => transformedParams"
119
+ },
120
+ "qrcb": {
121
+ "description": "Query Result CallBack. Function (response) => transformedResponse"
122
+ }
123
+ }
124
+ },
125
+ "entryQuery": {
126
+ "type": "object",
127
+ "description": "Default query parameters when no form is connected",
128
+ "additionalProperties": true
129
+ },
130
+ "configBtn": {
131
+ "type": "array",
132
+ "description": "Table header toolbar buttons",
133
+ "items": { "$ref": "btn-config.schema.json" }
134
+ },
135
+ "leftText": {
136
+ "type": "string",
137
+ "description": "Text displayed on the left side of the table toolbar"
138
+ }
139
+ },
140
+ "additionalProperties": true
141
+ }