best-lowcode-runtime 0.1.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 (52) hide show
  1. package/README.md +59 -0
  2. package/dist/dev.d.ts +2 -0
  3. package/dist/dev.d.ts.map +1 -0
  4. package/dist/dev.js +269 -0
  5. package/dist/dev.js.map +7 -0
  6. package/dist/index.css +16 -0
  7. package/dist/index.css.map +7 -0
  8. package/dist/index.d.ts +9 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +1130 -0
  11. package/dist/index.js.map +7 -0
  12. package/dist/lowcode/BestCrudPage.d.ts +16 -0
  13. package/dist/lowcode/BestCrudPage.d.ts.map +1 -0
  14. package/dist/lowcode/dev.d.ts +9 -0
  15. package/dist/lowcode/dev.d.ts.map +1 -0
  16. package/dist/lowcode/index.d.ts +8 -0
  17. package/dist/lowcode/index.d.ts.map +1 -0
  18. package/dist/lowcode/list.d.ts +14 -0
  19. package/dist/lowcode/list.d.ts.map +1 -0
  20. package/dist/lowcode/runtime.d.ts +21 -0
  21. package/dist/lowcode/runtime.d.ts.map +1 -0
  22. package/dist/lowcode/schema.d.ts +101 -0
  23. package/dist/lowcode/schema.d.ts.map +1 -0
  24. package/dist/lowcode/validate.d.ts +14 -0
  25. package/dist/lowcode/validate.d.ts.map +1 -0
  26. package/dist/runtime/BestProvider.d.ts +46 -0
  27. package/dist/runtime/BestProvider.d.ts.map +1 -0
  28. package/dist/runtime/index.d.ts +4 -0
  29. package/dist/runtime/index.d.ts.map +1 -0
  30. package/dist/ui/BestBatchInput.d.ts +11 -0
  31. package/dist/ui/BestBatchInput.d.ts.map +1 -0
  32. package/dist/ui/BestDetail.d.ts +8 -0
  33. package/dist/ui/BestDetail.d.ts.map +1 -0
  34. package/dist/ui/BestFilePreview.d.ts +11 -0
  35. package/dist/ui/BestFilePreview.d.ts.map +1 -0
  36. package/dist/ui/BestForm.d.ts +16 -0
  37. package/dist/ui/BestForm.d.ts.map +1 -0
  38. package/dist/ui/BestLightTable.d.ts +13 -0
  39. package/dist/ui/BestLightTable.d.ts.map +1 -0
  40. package/dist/ui/BestOverlay.d.ts +11 -0
  41. package/dist/ui/BestOverlay.d.ts.map +1 -0
  42. package/dist/ui/BestSearch.d.ts +14 -0
  43. package/dist/ui/BestSearch.d.ts.map +1 -0
  44. package/dist/ui/BestStates.d.ts +10 -0
  45. package/dist/ui/BestStates.d.ts.map +1 -0
  46. package/dist/ui/BestTable.d.ts +11 -0
  47. package/dist/ui/BestTable.d.ts.map +1 -0
  48. package/dist/ui/index.d.ts +18 -0
  49. package/dist/ui/index.d.ts.map +1 -0
  50. package/dist/ui/types.d.ts +47 -0
  51. package/dist/ui/types.d.ts.map +1 -0
  52. package/package.json +65 -0
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # best-lowcode-runtime
2
+
3
+ BEST 的 React 低代码运行时统一入口,包含 Schema 驱动的 CRUD 页面、运行时 Registry 与基础 UI 组件。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install best-lowcode-runtime
9
+ ```
10
+
11
+ 本包将 React、React DOM、Ant Design、Ant Design Pro Components 和 Day.js 声明为 peer dependencies;应用应使用与项目兼容的版本安装它们。
12
+
13
+ ## 快速开始
14
+
15
+ ```tsx
16
+ import 'best-lowcode-runtime/style.css'
17
+ import {
18
+ BestCrudPage,
19
+ BestProvider,
20
+ CRUD_SCHEMA_ID,
21
+ CRUD_SCHEMA_VERSION,
22
+ type CrudPageSchema
23
+ } from 'best-lowcode-runtime'
24
+
25
+ const schema = {
26
+ $schema: CRUD_SCHEMA_ID,
27
+ version: CRUD_SCHEMA_VERSION,
28
+ id: 'customer-list',
29
+ kind: 'crud',
30
+ title: '客户列表',
31
+ dataSource: { list: 'customer.list' },
32
+ table: {
33
+ rowKey: 'id',
34
+ columns: [{ field: 'name', title: '名称' }]
35
+ }
36
+ } satisfies CrudPageSchema
37
+
38
+ export function CustomerPage() {
39
+ return (
40
+ <BestProvider registry={{ services: { 'customer.list': async () => ({ list: [], total: 0 }) } }}>
41
+ <BestCrudPage schema={schema} />
42
+ </BestProvider>
43
+ )
44
+ }
45
+ ```
46
+
47
+ ## 开发期校验入口
48
+
49
+ CLI 或工具链可从 `best-lowcode-runtime/dev` 导入不依赖页面渲染的能力:
50
+
51
+ ```ts
52
+ import { getBuiltinCapabilities, validateUnknownCrudPageSchema } from 'best-lowcode-runtime/dev'
53
+ ```
54
+
55
+ ## 发布内容
56
+
57
+ 发布包只包含编译后的 `dist` 与本 README。`npm pack --dry-run` 可用于在不发布的情况下检查最终包内容。
58
+
59
+ 本包当前标记为 `UNLICENSED`;在对外公开前,应由代码所有方确定正式许可证。
package/dist/dev.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { getBuiltinCapabilities, validateUnknownCrudPageSchema } from './lowcode/dev';
2
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAA"}
package/dist/dev.js ADDED
@@ -0,0 +1,269 @@
1
+ // src/lowcode/schema.ts
2
+ var CRUD_SCHEMA_ID = "https://best.dev/schema/crud/v1";
3
+ var CRUD_SCHEMA_VERSION = 1;
4
+
5
+ // src/lowcode/validate.ts
6
+ var fieldComponents = /* @__PURE__ */ new Set([
7
+ "input",
8
+ "number",
9
+ "select",
10
+ "date",
11
+ "dateRange",
12
+ "textarea",
13
+ "slot",
14
+ "repeatable"
15
+ ]);
16
+ var builtInEffects = /* @__PURE__ */ new Set([
17
+ "openCreate",
18
+ "openDetail",
19
+ "openEdit",
20
+ "remove",
21
+ "runAction",
22
+ "slot"
23
+ ]);
24
+ var columnFormats = /* @__PURE__ */ new Set(["date", "datetime", "money", "text"]);
25
+ function push(diagnostics, path, code, message) {
26
+ diagnostics.push({ path, code, message });
27
+ }
28
+ function validateCondition(condition, path, diagnostics) {
29
+ if ((condition.operator === "and" || condition.operator === "or") && condition.conditions.length === 0) {
30
+ push(diagnostics, path, "condition.empty", "\u7EC4\u5408\u6761\u4EF6\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u5B50\u6761\u4EF6");
31
+ }
32
+ if (condition.operator === "and" || condition.operator === "or") {
33
+ condition.conditions.forEach((item, index) => {
34
+ validateCondition(item, `${path}/conditions/${index}`, diagnostics);
35
+ });
36
+ }
37
+ if (condition.operator === "not")
38
+ validateCondition(condition.condition, `${path}/condition`, diagnostics);
39
+ }
40
+ function validateFields(fields, path, registry, diagnostics) {
41
+ const seen = /* @__PURE__ */ new Set();
42
+ fields?.forEach((field, index) => {
43
+ const fieldPath = `${path}/${index}`;
44
+ if (!field.field) push(diagnostics, fieldPath, "field.missing", "\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A");
45
+ if (seen.has(field.field))
46
+ push(diagnostics, fieldPath, "field.duplicate", `\u5B57\u6BB5\u91CD\u590D\uFF1A${field.field}`);
47
+ seen.add(field.field);
48
+ if (!fieldComponents.has(field.component))
49
+ push(diagnostics, fieldPath, "field.component", `\u4E0D\u652F\u6301\u7684\u7EC4\u4EF6\uFF1A${field.component}`);
50
+ if (field.dict && registry && !registry.dictionaries[field.dict]) {
51
+ push(diagnostics, fieldPath, "registry.dictionary", `\u672A\u6CE8\u518C\u5B57\u5178\uFF1A${field.dict}`);
52
+ }
53
+ if (field.component === "slot" && !field.slot)
54
+ push(diagnostics, fieldPath, "field.slot", "slot \u7EC4\u4EF6\u5FC5\u987B\u6307\u5B9A slot key");
55
+ if (field.component === "repeatable" && !field.itemFields?.length)
56
+ push(
57
+ diagnostics,
58
+ fieldPath,
59
+ "field.repeatable",
60
+ "repeatable \u7EC4\u4EF6\u81F3\u5C11\u9700\u8981\u4E00\u4E2A itemFields \u5B57\u6BB5"
61
+ );
62
+ if (field.minItems !== void 0 && field.maxItems !== void 0 && field.minItems > field.maxItems)
63
+ push(diagnostics, fieldPath, "field.repeatable.range", "minItems \u4E0D\u80FD\u5927\u4E8E maxItems");
64
+ if (field.slot && registry && !registry.slots[field.slot])
65
+ push(diagnostics, fieldPath, "registry.slot", `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${field.slot}`);
66
+ if (field.visibleWhen)
67
+ validateCondition(field.visibleWhen, `${fieldPath}/visibleWhen`, diagnostics);
68
+ if (field.disabledWhen)
69
+ validateCondition(field.disabledWhen, `${fieldPath}/disabledWhen`, diagnostics);
70
+ });
71
+ }
72
+ function validateActions(actions, path, registry, hasRemoveService, diagnostics) {
73
+ actions?.forEach((action, index) => {
74
+ const actionPath = `${path}/${index}`;
75
+ if (!action.id) push(diagnostics, actionPath, "action.missing", "\u52A8\u4F5C id \u4E0D\u80FD\u4E3A\u7A7A");
76
+ if (!builtInEffects.has(action.effect))
77
+ push(diagnostics, actionPath, "action.effect", `\u4E0D\u652F\u6301\u7684\u52A8\u4F5C\uFF1A${action.effect}`);
78
+ if (action.effect === "runAction" && !action.action)
79
+ push(diagnostics, actionPath, "action.key", "runAction \u5FC5\u987B\u6307\u5B9A action key");
80
+ if (action.effect === "remove" && !hasRemoveService)
81
+ push(diagnostics, actionPath, "action.removeService", "remove \u52A8\u4F5C\u5FC5\u987B\u914D\u7F6E dataSource.remove");
82
+ if (action.effect === "slot" && !action.slot)
83
+ push(diagnostics, actionPath, "action.slot", "slot \u52A8\u4F5C\u5FC5\u987B\u6307\u5B9A slot key");
84
+ if (action.action && registry && !registry.actions[action.action]) {
85
+ push(diagnostics, actionPath, "registry.action", `\u672A\u6CE8\u518C\u52A8\u4F5C\uFF1A${action.action}`);
86
+ }
87
+ if (action.slot && registry && !registry.slots[action.slot]) {
88
+ push(diagnostics, actionPath, "registry.slot", `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${action.slot}`);
89
+ }
90
+ });
91
+ }
92
+ function validateCrudPageSchema(schema, registry) {
93
+ const diagnostics = [];
94
+ if (schema.$schema !== CRUD_SCHEMA_ID)
95
+ push(diagnostics, "/$schema", "schema.id", `\u4EC5\u652F\u6301 ${CRUD_SCHEMA_ID}`);
96
+ if (schema.version !== CRUD_SCHEMA_VERSION)
97
+ push(diagnostics, "/version", "schema.version", `\u4EC5\u652F\u6301\u7248\u672C ${CRUD_SCHEMA_VERSION}`);
98
+ if (!schema.id) push(diagnostics, "/id", "page.id", "\u9875\u9762 id \u4E0D\u80FD\u4E3A\u7A7A");
99
+ if (!schema.title) push(diagnostics, "/title", "page.title", "\u9875\u9762\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");
100
+ if (!schema.dataSource?.list)
101
+ push(diagnostics, "/dataSource/list", "service.list", "\u5217\u8868\u670D\u52A1\u4E0D\u80FD\u4E3A\u7A7A");
102
+ if (schema.dataSource?.list && registry && !registry.listServices[schema.dataSource.list]) {
103
+ push(
104
+ diagnostics,
105
+ "/dataSource/list",
106
+ "registry.service",
107
+ `\u672A\u6CE8\u518C\u670D\u52A1\uFF1A${schema.dataSource.list}`
108
+ );
109
+ }
110
+ if (schema.dataSource?.detail && registry && !registry.services[schema.dataSource.detail]) {
111
+ push(
112
+ diagnostics,
113
+ "/dataSource/detail",
114
+ "registry.service",
115
+ `\u672A\u6CE8\u518C\u670D\u52A1\uFF1A${schema.dataSource.detail}`
116
+ );
117
+ }
118
+ if (schema.dataSource?.remove && registry && !registry.services[schema.dataSource.remove]) {
119
+ push(
120
+ diagnostics,
121
+ "/dataSource/remove",
122
+ "registry.service",
123
+ `\u672A\u6CE8\u518C\u670D\u52A1\uFF1A${schema.dataSource.remove}`
124
+ );
125
+ }
126
+ validateFields(schema.search, "/search", registry, diagnostics);
127
+ validateFields(schema.form, "/form", registry, diagnostics);
128
+ if (!schema.table?.rowKey) push(diagnostics, "/table/rowKey", "table.rowKey", "rowKey \u4E0D\u80FD\u4E3A\u7A7A");
129
+ if (!schema.table?.columns?.length)
130
+ push(diagnostics, "/table/columns", "table.columns", "\u81F3\u5C11\u9700\u8981\u4E00\u5217");
131
+ schema.table?.columns?.forEach((column, index) => {
132
+ if (column.format && !columnFormats.has(column.format)) {
133
+ push(
134
+ diagnostics,
135
+ `/table/columns/${index}/format`,
136
+ "column.format",
137
+ `\u4E0D\u652F\u6301\u7684\u683C\u5F0F\uFF1A${column.format}`
138
+ );
139
+ }
140
+ if (column.dict && registry && !registry.dictionaries[column.dict]) {
141
+ push(
142
+ diagnostics,
143
+ `/table/columns/${index}/dict`,
144
+ "registry.dictionary",
145
+ `\u672A\u6CE8\u518C\u5B57\u5178\uFF1A${column.dict}`
146
+ );
147
+ }
148
+ if (column.slot && registry && !registry.slots[column.slot]) {
149
+ push(
150
+ diagnostics,
151
+ `/table/columns/${index}/slot`,
152
+ "registry.slot",
153
+ `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${column.slot}`
154
+ );
155
+ }
156
+ });
157
+ schema.detail?.fields.forEach((field, index) => {
158
+ if (field.slot && registry && !registry.slots[field.slot])
159
+ push(
160
+ diagnostics,
161
+ `/detail/fields/${index}/slot`,
162
+ "registry.slot",
163
+ `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${field.slot}`
164
+ );
165
+ });
166
+ validateActions(
167
+ schema.table?.actions,
168
+ "/table/actions",
169
+ registry,
170
+ Boolean(schema.dataSource?.remove),
171
+ diagnostics
172
+ );
173
+ validateActions(
174
+ schema.toolbar,
175
+ "/toolbar",
176
+ registry,
177
+ Boolean(schema.dataSource?.remove),
178
+ diagnostics
179
+ );
180
+ return { valid: diagnostics.length === 0, diagnostics };
181
+ }
182
+
183
+ // src/lowcode/dev.ts
184
+ var builtInCapabilities = [
185
+ "builtin.effect.openCreate",
186
+ "builtin.effect.openDetail",
187
+ "builtin.effect.openEdit",
188
+ "builtin.effect.remove",
189
+ "builtin.effect.runAction",
190
+ "builtin.effect.slot",
191
+ "builtin.format.date",
192
+ "builtin.format.datetime",
193
+ "builtin.format.money",
194
+ "builtin.format.text",
195
+ "builtin.field.input",
196
+ "builtin.field.number",
197
+ "builtin.field.select",
198
+ "builtin.field.date",
199
+ "builtin.field.dateRange",
200
+ "builtin.field.textarea",
201
+ "builtin.field.slot",
202
+ "builtin.field.repeatable"
203
+ ];
204
+ function isRecord(value) {
205
+ return !!value && typeof value === "object" && !Array.isArray(value);
206
+ }
207
+ function arrayOfRecords(value) {
208
+ return Array.isArray(value) && value.every(isRecord) ? value : void 0;
209
+ }
210
+ function diagnostic(path, code, message) {
211
+ return { path, code, message };
212
+ }
213
+ function validateUnknownShape(candidate) {
214
+ if (!isRecord(candidate)) return [diagnostic("", "schema.type", "Schema \u5FC5\u987B\u662F JSON \u5BF9\u8C61")];
215
+ const diagnostics = [];
216
+ if (!isRecord(candidate.dataSource))
217
+ diagnostics.push(diagnostic("/dataSource", "dataSource.type", "dataSource \u5FC5\u987B\u662F\u5BF9\u8C61"));
218
+ if (!isRecord(candidate.table))
219
+ diagnostics.push(diagnostic("/table", "table.type", "table \u5FC5\u987B\u662F\u5BF9\u8C61"));
220
+ for (const key of ["search", "form"]) {
221
+ if (candidate[key] !== void 0 && !arrayOfRecords(candidate[key])) {
222
+ diagnostics.push(diagnostic(`/${key}`, "field.list", `${key} \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4`));
223
+ }
224
+ }
225
+ if (isRecord(candidate.table)) {
226
+ if (!arrayOfRecords(candidate.table.columns)) {
227
+ diagnostics.push(diagnostic("/table/columns", "column.list", "columns \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4"));
228
+ }
229
+ if (candidate.table.actions !== void 0 && !arrayOfRecords(candidate.table.actions)) {
230
+ diagnostics.push(diagnostic("/table/actions", "action.list", "actions \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4"));
231
+ }
232
+ }
233
+ if (candidate.toolbar !== void 0 && !arrayOfRecords(candidate.toolbar)) {
234
+ diagnostics.push(diagnostic("/toolbar", "action.list", "toolbar \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4"));
235
+ }
236
+ return diagnostics;
237
+ }
238
+ function toRuntimeSchema(candidate) {
239
+ return {
240
+ $schema: candidate.$schema,
241
+ version: candidate.version,
242
+ id: candidate.id,
243
+ kind: candidate.kind,
244
+ title: candidate.title,
245
+ dataSource: candidate.dataSource,
246
+ search: candidate.search,
247
+ searchMode: candidate.searchMode,
248
+ form: candidate.form,
249
+ table: candidate.table,
250
+ detail: candidate.detail,
251
+ toolbar: candidate.toolbar,
252
+ meta: candidate.meta
253
+ };
254
+ }
255
+ function validateUnknownCrudPageSchema(candidate) {
256
+ const shapeDiagnostics = validateUnknownShape(candidate);
257
+ if (shapeDiagnostics.length || !isRecord(candidate)) {
258
+ return { valid: false, diagnostics: shapeDiagnostics };
259
+ }
260
+ return validateCrudPageSchema(toRuntimeSchema(candidate));
261
+ }
262
+ function getBuiltinCapabilities() {
263
+ return [...builtInCapabilities];
264
+ }
265
+ export {
266
+ getBuiltinCapabilities,
267
+ validateUnknownCrudPageSchema
268
+ };
269
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lowcode/schema.ts", "../src/lowcode/validate.ts", "../src/lowcode/dev.ts"],
4
+ "sourcesContent": ["import type { BestFieldComponent } from '../ui/types'\n\nexport const CRUD_SCHEMA_ID = 'https://best.dev/schema/crud/v1' as const\nexport const CRUD_SCHEMA_VERSION = 1 as const\n\nexport type Condition =\n | { operator: 'equals'; field: string; value: string | number | boolean | null }\n | { operator: 'notEmpty'; field: string }\n | { operator: 'modeEquals'; value: FormMode }\n | { operator: 'and' | 'or'; conditions: Condition[] }\n | { operator: 'not'; condition: Condition }\n\nexport type FormMode = 'create' | 'edit' | 'detail'\n\nexport type FieldSchema = {\n field: string\n label: string\n component: BestFieldComponent\n placeholder?: string\n dict?: string\n required?: boolean\n disabled?: boolean\n hidden?: boolean\n maxDate?: 'today'\n span?: number\n defaultValue?: string | number | boolean | null\n /** Application-specific form control registered in the BestProvider registry. */\n slot?: string\n visibleWhen?: Condition\n disabledWhen?: Condition\n /** Clears stale dependent values when this field becomes hidden. */\n clearWhenHidden?: boolean\n /** Repeated object fields, for rules such as tiered pricing. */\n itemFields?: Omit<FieldSchema, 'itemFields'>[]\n minItems?: number\n maxItems?: number\n}\n\nexport type TableColumnSchema = {\n field: string\n title: string\n dict?: string\n width?: number\n format?: 'date' | 'datetime' | 'money' | 'text'\n slot?: string\n}\n\nexport type DetailFieldSchema = {\n field: string\n label: string\n dict?: string\n span?: number\n slot?: string\n}\n\nexport type PageActionSchema = {\n id: string\n label: string\n effect: 'openCreate' | 'openDetail' | 'openEdit' | 'remove' | 'runAction' | 'slot'\n action?: string\n slot?: string\n access?: string\n confirm?: string\n}\n\nexport type CrudPageSchema = {\n $schema: typeof CRUD_SCHEMA_ID\n version: typeof CRUD_SCHEMA_VERSION\n id: string\n kind: 'crud'\n title: string\n dataSource: {\n list: string\n detail?: string\n create?: string\n update?: string\n remove?: string\n }\n search?: FieldSchema[]\n searchMode?: 'proTable' | 'bestSearch'\n form?: FieldSchema[]\n table: {\n rowKey: string | string[]\n columns: TableColumnSchema[]\n actions?: PageActionSchema[]\n scrollX?: number\n pageSize?: number\n }\n detail?: { fields: DetailFieldSchema[] }\n toolbar?: PageActionSchema[]\n meta?: {\n generatedBy?: string\n generatedAt?: string\n }\n}\n", "import type { BestRegistry } from '../runtime'\nimport {\n type Condition,\n CRUD_SCHEMA_ID,\n CRUD_SCHEMA_VERSION,\n type CrudPageSchema,\n type FieldSchema,\n type PageActionSchema\n} from './schema'\n\nexport type SchemaDiagnostic = {\n path: string\n code: string\n message: string\n}\n\nexport type SchemaValidationResult = {\n valid: boolean\n diagnostics: SchemaDiagnostic[]\n}\n\nconst fieldComponents = new Set([\n 'input',\n 'number',\n 'select',\n 'date',\n 'dateRange',\n 'textarea',\n 'slot',\n 'repeatable'\n])\nconst builtInEffects = new Set([\n 'openCreate',\n 'openDetail',\n 'openEdit',\n 'remove',\n 'runAction',\n 'slot'\n])\nconst columnFormats = new Set(['date', 'datetime', 'money', 'text'])\n\nfunction push(diagnostics: SchemaDiagnostic[], path: string, code: string, message: string) {\n diagnostics.push({ path, code, message })\n}\n\nfunction validateCondition(condition: Condition, path: string, diagnostics: SchemaDiagnostic[]) {\n if (\n (condition.operator === 'and' || condition.operator === 'or') &&\n condition.conditions.length === 0\n ) {\n push(diagnostics, path, 'condition.empty', '\u7EC4\u5408\u6761\u4EF6\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u5B50\u6761\u4EF6')\n }\n if (condition.operator === 'and' || condition.operator === 'or') {\n condition.conditions.forEach((item, index) => {\n validateCondition(item, `${path}/conditions/${index}`, diagnostics)\n })\n }\n if (condition.operator === 'not')\n validateCondition(condition.condition, `${path}/condition`, diagnostics)\n}\n\nfunction validateFields(\n fields: FieldSchema[] | undefined,\n path: string,\n registry: BestRegistry | undefined,\n diagnostics: SchemaDiagnostic[]\n) {\n const seen = new Set<string>()\n fields?.forEach((field, index) => {\n const fieldPath = `${path}/${index}`\n if (!field.field) push(diagnostics, fieldPath, 'field.missing', '\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A')\n if (seen.has(field.field))\n push(diagnostics, fieldPath, 'field.duplicate', `\u5B57\u6BB5\u91CD\u590D\uFF1A${field.field}`)\n seen.add(field.field)\n if (!fieldComponents.has(field.component))\n push(diagnostics, fieldPath, 'field.component', `\u4E0D\u652F\u6301\u7684\u7EC4\u4EF6\uFF1A${field.component}`)\n if (field.dict && registry && !registry.dictionaries[field.dict]) {\n push(diagnostics, fieldPath, 'registry.dictionary', `\u672A\u6CE8\u518C\u5B57\u5178\uFF1A${field.dict}`)\n }\n if (field.component === 'slot' && !field.slot)\n push(diagnostics, fieldPath, 'field.slot', 'slot \u7EC4\u4EF6\u5FC5\u987B\u6307\u5B9A slot key')\n if (field.component === 'repeatable' && !field.itemFields?.length)\n push(\n diagnostics,\n fieldPath,\n 'field.repeatable',\n 'repeatable \u7EC4\u4EF6\u81F3\u5C11\u9700\u8981\u4E00\u4E2A itemFields \u5B57\u6BB5'\n )\n if (\n field.minItems !== undefined &&\n field.maxItems !== undefined &&\n field.minItems > field.maxItems\n )\n push(diagnostics, fieldPath, 'field.repeatable.range', 'minItems \u4E0D\u80FD\u5927\u4E8E maxItems')\n if (field.slot && registry && !registry.slots[field.slot])\n push(diagnostics, fieldPath, 'registry.slot', `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${field.slot}`)\n if (field.visibleWhen)\n validateCondition(field.visibleWhen, `${fieldPath}/visibleWhen`, diagnostics)\n if (field.disabledWhen)\n validateCondition(field.disabledWhen, `${fieldPath}/disabledWhen`, diagnostics)\n })\n}\n\nfunction validateActions(\n actions: PageActionSchema[] | undefined,\n path: string,\n registry: BestRegistry | undefined,\n hasRemoveService: boolean,\n diagnostics: SchemaDiagnostic[]\n) {\n actions?.forEach((action, index) => {\n const actionPath = `${path}/${index}`\n if (!action.id) push(diagnostics, actionPath, 'action.missing', '\u52A8\u4F5C id \u4E0D\u80FD\u4E3A\u7A7A')\n if (!builtInEffects.has(action.effect))\n push(diagnostics, actionPath, 'action.effect', `\u4E0D\u652F\u6301\u7684\u52A8\u4F5C\uFF1A${action.effect}`)\n if (action.effect === 'runAction' && !action.action)\n push(diagnostics, actionPath, 'action.key', 'runAction \u5FC5\u987B\u6307\u5B9A action key')\n if (action.effect === 'remove' && !hasRemoveService)\n push(diagnostics, actionPath, 'action.removeService', 'remove \u52A8\u4F5C\u5FC5\u987B\u914D\u7F6E dataSource.remove')\n if (action.effect === 'slot' && !action.slot)\n push(diagnostics, actionPath, 'action.slot', 'slot \u52A8\u4F5C\u5FC5\u987B\u6307\u5B9A slot key')\n if (action.action && registry && !registry.actions[action.action]) {\n push(diagnostics, actionPath, 'registry.action', `\u672A\u6CE8\u518C\u52A8\u4F5C\uFF1A${action.action}`)\n }\n if (action.slot && registry && !registry.slots[action.slot]) {\n push(diagnostics, actionPath, 'registry.slot', `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${action.slot}`)\n }\n })\n}\n\nexport function validateCrudPageSchema(\n schema: CrudPageSchema,\n registry?: BestRegistry\n): SchemaValidationResult {\n const diagnostics: SchemaDiagnostic[] = []\n if (schema.$schema !== CRUD_SCHEMA_ID)\n push(diagnostics, '/$schema', 'schema.id', `\u4EC5\u652F\u6301 ${CRUD_SCHEMA_ID}`)\n if (schema.version !== CRUD_SCHEMA_VERSION)\n push(diagnostics, '/version', 'schema.version', `\u4EC5\u652F\u6301\u7248\u672C ${CRUD_SCHEMA_VERSION}`)\n if (!schema.id) push(diagnostics, '/id', 'page.id', '\u9875\u9762 id \u4E0D\u80FD\u4E3A\u7A7A')\n if (!schema.title) push(diagnostics, '/title', 'page.title', '\u9875\u9762\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A')\n if (!schema.dataSource?.list)\n push(diagnostics, '/dataSource/list', 'service.list', '\u5217\u8868\u670D\u52A1\u4E0D\u80FD\u4E3A\u7A7A')\n if (schema.dataSource?.list && registry && !registry.listServices[schema.dataSource.list]) {\n push(\n diagnostics,\n '/dataSource/list',\n 'registry.service',\n `\u672A\u6CE8\u518C\u670D\u52A1\uFF1A${schema.dataSource.list}`\n )\n }\n if (schema.dataSource?.detail && registry && !registry.services[schema.dataSource.detail]) {\n push(\n diagnostics,\n '/dataSource/detail',\n 'registry.service',\n `\u672A\u6CE8\u518C\u670D\u52A1\uFF1A${schema.dataSource.detail}`\n )\n }\n if (schema.dataSource?.remove && registry && !registry.services[schema.dataSource.remove]) {\n push(\n diagnostics,\n '/dataSource/remove',\n 'registry.service',\n `\u672A\u6CE8\u518C\u670D\u52A1\uFF1A${schema.dataSource.remove}`\n )\n }\n validateFields(schema.search, '/search', registry, diagnostics)\n validateFields(schema.form, '/form', registry, diagnostics)\n if (!schema.table?.rowKey) push(diagnostics, '/table/rowKey', 'table.rowKey', 'rowKey \u4E0D\u80FD\u4E3A\u7A7A')\n if (!schema.table?.columns?.length)\n push(diagnostics, '/table/columns', 'table.columns', '\u81F3\u5C11\u9700\u8981\u4E00\u5217')\n schema.table?.columns?.forEach((column, index) => {\n if (column.format && !columnFormats.has(column.format)) {\n push(\n diagnostics,\n `/table/columns/${index}/format`,\n 'column.format',\n `\u4E0D\u652F\u6301\u7684\u683C\u5F0F\uFF1A${column.format}`\n )\n }\n if (column.dict && registry && !registry.dictionaries[column.dict]) {\n push(\n diagnostics,\n `/table/columns/${index}/dict`,\n 'registry.dictionary',\n `\u672A\u6CE8\u518C\u5B57\u5178\uFF1A${column.dict}`\n )\n }\n if (column.slot && registry && !registry.slots[column.slot]) {\n push(\n diagnostics,\n `/table/columns/${index}/slot`,\n 'registry.slot',\n `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${column.slot}`\n )\n }\n })\n schema.detail?.fields.forEach((field, index) => {\n if (field.slot && registry && !registry.slots[field.slot])\n push(\n diagnostics,\n `/detail/fields/${index}/slot`,\n 'registry.slot',\n `\u672A\u6CE8\u518C\u63D2\u69FD\uFF1A${field.slot}`\n )\n })\n validateActions(\n schema.table?.actions,\n '/table/actions',\n registry,\n Boolean(schema.dataSource?.remove),\n diagnostics\n )\n validateActions(\n schema.toolbar,\n '/toolbar',\n registry,\n Boolean(schema.dataSource?.remove),\n diagnostics\n )\n return { valid: diagnostics.length === 0, diagnostics }\n}\n\nexport function assertValidCrudPageSchema(schema: CrudPageSchema, registry?: BestRegistry) {\n const result = validateCrudPageSchema(schema, registry)\n if (!result.valid) {\n const message = result.diagnostics.map((item) => `${item.path}: ${item.message}`).join('\\n')\n throw new Error(`Schema \u6821\u9A8C\u5931\u8D25\uFF1A\\n${message}`)\n }\n}\n", "import type {\n CRUD_SCHEMA_ID,\n CRUD_SCHEMA_VERSION,\n CrudPageSchema,\n FieldSchema,\n PageActionSchema\n} from './schema'\nimport type { SchemaDiagnostic, SchemaValidationResult } from './validate'\nimport { validateCrudPageSchema } from './validate'\n\nconst builtInCapabilities = [\n 'builtin.effect.openCreate',\n 'builtin.effect.openDetail',\n 'builtin.effect.openEdit',\n 'builtin.effect.remove',\n 'builtin.effect.runAction',\n 'builtin.effect.slot',\n 'builtin.format.date',\n 'builtin.format.datetime',\n 'builtin.format.money',\n 'builtin.format.text',\n 'builtin.field.input',\n 'builtin.field.number',\n 'builtin.field.select',\n 'builtin.field.date',\n 'builtin.field.dateRange',\n 'builtin.field.textarea',\n 'builtin.field.slot',\n 'builtin.field.repeatable'\n] as const\n\ntype JsonRecord = Record<string, unknown>\n\nfunction isRecord(value: unknown): value is JsonRecord {\n return !!value && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction arrayOfRecords(value: unknown): JsonRecord[] | undefined {\n return Array.isArray(value) && value.every(isRecord) ? value : undefined\n}\n\nfunction diagnostic(path: string, code: string, message: string): SchemaDiagnostic {\n return { path, code, message }\n}\n\nfunction validateUnknownShape(candidate: unknown): SchemaDiagnostic[] {\n if (!isRecord(candidate)) return [diagnostic('', 'schema.type', 'Schema \u5FC5\u987B\u662F JSON \u5BF9\u8C61')]\n const diagnostics: SchemaDiagnostic[] = []\n if (!isRecord(candidate.dataSource))\n diagnostics.push(diagnostic('/dataSource', 'dataSource.type', 'dataSource \u5FC5\u987B\u662F\u5BF9\u8C61'))\n if (!isRecord(candidate.table))\n diagnostics.push(diagnostic('/table', 'table.type', 'table \u5FC5\u987B\u662F\u5BF9\u8C61'))\n for (const key of ['search', 'form'] as const) {\n if (candidate[key] !== undefined && !arrayOfRecords(candidate[key])) {\n diagnostics.push(diagnostic(`/${key}`, 'field.list', `${key} \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4`))\n }\n }\n if (isRecord(candidate.table)) {\n if (!arrayOfRecords(candidate.table.columns)) {\n diagnostics.push(diagnostic('/table/columns', 'column.list', 'columns \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4'))\n }\n if (candidate.table.actions !== undefined && !arrayOfRecords(candidate.table.actions)) {\n diagnostics.push(diagnostic('/table/actions', 'action.list', 'actions \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4'))\n }\n }\n if (candidate.toolbar !== undefined && !arrayOfRecords(candidate.toolbar)) {\n diagnostics.push(diagnostic('/toolbar', 'action.list', 'toolbar \u5FC5\u987B\u662F\u5BF9\u8C61\u6570\u7EC4'))\n }\n return diagnostics\n}\n\nfunction toRuntimeSchema(candidate: JsonRecord): CrudPageSchema {\n return {\n $schema: candidate.$schema as typeof CRUD_SCHEMA_ID,\n version: candidate.version as typeof CRUD_SCHEMA_VERSION,\n id: candidate.id as string,\n kind: candidate.kind as 'crud',\n title: candidate.title as string,\n dataSource: candidate.dataSource as CrudPageSchema['dataSource'],\n search: candidate.search as FieldSchema[] | undefined,\n searchMode: candidate.searchMode as CrudPageSchema['searchMode'],\n form: candidate.form as FieldSchema[] | undefined,\n table: candidate.table as CrudPageSchema['table'],\n detail: candidate.detail as CrudPageSchema['detail'],\n toolbar: candidate.toolbar as PageActionSchema[] | undefined,\n meta: candidate.meta as CrudPageSchema['meta']\n }\n}\n\n/**\n * Server-safe development entry. It accepts unknown JSON from CLI/MCP before delegating to the\n * runtime validator, so untrusted candidates cannot trigger assumptions in typed runtime code.\n */\nexport function validateUnknownCrudPageSchema(candidate: unknown): SchemaValidationResult {\n const shapeDiagnostics = validateUnknownShape(candidate)\n if (shapeDiagnostics.length || !isRecord(candidate)) {\n return { valid: false, diagnostics: shapeDiagnostics }\n }\n return validateCrudPageSchema(toRuntimeSchema(candidate))\n}\n\n/** Serializable capabilities supplied by the current runtime without application Manifest entries. */\nexport function getBuiltinCapabilities(): string[] {\n return [...builtInCapabilities]\n}\n"],
5
+ "mappings": ";AAEO,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;;;ACkBnC,IAAM,kBAAkB,oBAAI,IAAI;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACD,IAAM,iBAAiB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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B,CAAC;AAAA,IACjF;AAAA,EACF;AACA,MAAI,UAAU,YAAY,UAAa,CAAC,eAAe,UAAU,OAAO,GAAG;AACzE,gBAAY,KAAK,WAAW,YAAY,eAAe,oDAAiB,CAAC;AAAA,EAC3E;AACA,SAAO;AACT;AAEA,SAAS,gBAAgB,WAAuC;AAC9D,SAAO;AAAA,IACL,SAAS,UAAU;AAAA,IACnB,SAAS,UAAU;AAAA,IACnB,IAAI,UAAU;AAAA,IACd,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU;AAAA,IACjB,YAAY,UAAU;AAAA,IACtB,QAAQ,UAAU;AAAA,IAClB,YAAY,UAAU;AAAA,IACtB,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU;AAAA,IACjB,QAAQ,UAAU;AAAA,IAClB,SAAS,UAAU;AAAA,IACnB,MAAM,UAAU;AAAA,EAClB;AACF;AAMO,SAAS,8BAA8B,WAA4C;AACxF,QAAM,mBAAmB,qBAAqB,SAAS;AACvD,MAAI,iBAAiB,UAAU,CAAC,SAAS,SAAS,GAAG;AACnD,WAAO,EAAE,OAAO,OAAO,aAAa,iBAAiB;AAAA,EACvD;AACA,SAAO,uBAAuB,gBAAgB,SAAS,CAAC;AAC1D;AAGO,SAAS,yBAAmC;AACjD,SAAO,CAAC,GAAG,mBAAmB;AAChC;",
6
+ "names": []
7
+ }
package/dist/index.css ADDED
@@ -0,0 +1,16 @@
1
+ /* src/ui/BestTable.module.less */
2
+ .root {
3
+ :global(.ant-pro-card-body) {
4
+ padding: 12px;
5
+ }
6
+ :global(.ant-pro-query-filter-actions .ant-form-item-label) {
7
+ display: none;
8
+ }
9
+ :global(.ant-pro-query-filter-actions) {
10
+ height: 100%;
11
+ display: flex;
12
+ flex-direction: column;
13
+ justify-content: flex-end;
14
+ }
15
+ }
16
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/ui/BestTable.module.less"],
4
+ "sourcesContent": [".root {\n :global(.ant-pro-card-body) {\n padding: 12px;\n }\n\n :global(.ant-pro-query-filter-actions .ant-form-item-label) {\n display: none;\n }\n\n :global(.ant-pro-query-filter-actions) {\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n}\n"],
5
+ "mappings": ";AAAA,CAAC;AACC,UAAQ,CAAC;AACP,aAAS;AACX;AAEA,UAAQ,CAAC,6BAA6B,CAAC;AACrC,aAAS;AACX;AAEA,UAAQ,CAJC;AAKP,YAAQ;AACR,aAAS;AACT,oBAAgB;AAChB,qBAAiB;AACnB;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * React 项目的 BEST 低代码统一入口。
3
+ *
4
+ * 该包只聚合公开 API:运行时、CRUD 页面和基础 UI 仍由各自底层包维护。
5
+ */
6
+ export * from './lowcode';
7
+ export * from './runtime';
8
+ export * from './ui';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,MAAM,CAAA"}