@nocobase/plugin-block-list 2.1.0-alpha.12 → 2.1.0-alpha.13
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/dist/externalVersion.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/flow-engine": "2.1.0-alpha.
|
|
12
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
13
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/flow-engine": "2.1.0-alpha.13",
|
|
12
|
+
"@nocobase/client": "2.1.0-alpha.13",
|
|
13
|
+
"@nocobase/server": "2.1.0-alpha.13",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
15
15
|
"react": "18.2.0",
|
|
16
16
|
"antd": "5.24.2",
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import type { FlowSchemaContribution } from '@nocobase/flow-engine';
|
|
10
9
|
import { Plugin } from '@nocobase/server';
|
|
11
10
|
export declare class PluginBlockListServer extends Plugin {
|
|
12
11
|
afterAdd(): Promise<void>;
|
|
13
|
-
getFlowSchemaContributions(): FlowSchemaContribution;
|
|
14
12
|
beforeLoad(): Promise<void>;
|
|
15
13
|
load(): Promise<void>;
|
|
16
14
|
install(): Promise<void>;
|
package/dist/server/plugin.js
CHANGED
|
@@ -31,13 +31,9 @@ __export(plugin_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(plugin_exports);
|
|
33
33
|
var import_server = require("@nocobase/server");
|
|
34
|
-
var import_flow_schema_contributions = require("./flow-schema-contributions");
|
|
35
34
|
class PluginBlockListServer extends import_server.Plugin {
|
|
36
35
|
async afterAdd() {
|
|
37
36
|
}
|
|
38
|
-
getFlowSchemaContributions() {
|
|
39
|
-
return import_flow_schema_contributions.flowSchemaContribution;
|
|
40
|
-
}
|
|
41
37
|
async beforeLoad() {
|
|
42
38
|
}
|
|
43
39
|
async load() {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "区块:列表",
|
|
5
5
|
"description": "Display data in a list with pagination support.",
|
|
6
6
|
"description.zh-CN": "以列表形式展示数据,支持分页设置",
|
|
7
|
-
"version": "2.1.0-alpha.
|
|
7
|
+
"version": "2.1.0-alpha.13",
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/block-list",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"keywords": [
|
|
18
18
|
"Blocks"
|
|
19
19
|
],
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "2807a8948412d9c235115a31a81a66f7c82dd173"
|
|
21
21
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import type { FlowSchemaContribution } from '@nocobase/flow-engine';
|
|
10
|
-
export declare const flowSchemaContribution: FlowSchemaContribution;
|
|
@@ -1,435 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var flow_schema_contributions_exports = {};
|
|
28
|
-
__export(flow_schema_contributions_exports, {
|
|
29
|
-
flowSchemaContribution: () => flowSchemaContribution
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(flow_schema_contributions_exports);
|
|
32
|
-
const genericFilterSchemaId = "urn:nocobase:schema:plugin-block-list:generic-filter";
|
|
33
|
-
const genericFilterSchema = {
|
|
34
|
-
$id: genericFilterSchemaId,
|
|
35
|
-
definitions: {
|
|
36
|
-
filterCondition: {
|
|
37
|
-
type: "object",
|
|
38
|
-
properties: {
|
|
39
|
-
path: {
|
|
40
|
-
type: "string"
|
|
41
|
-
},
|
|
42
|
-
operator: {
|
|
43
|
-
type: "string"
|
|
44
|
-
},
|
|
45
|
-
value: {},
|
|
46
|
-
noValue: {
|
|
47
|
-
type: "boolean"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
required: ["path"],
|
|
51
|
-
additionalProperties: true,
|
|
52
|
-
allOf: [
|
|
53
|
-
{
|
|
54
|
-
not: {
|
|
55
|
-
required: ["logic"]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
not: {
|
|
60
|
-
required: ["items"]
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
filterGroup: {
|
|
66
|
-
type: "object",
|
|
67
|
-
properties: {
|
|
68
|
-
logic: {
|
|
69
|
-
type: "string",
|
|
70
|
-
enum: ["$and", "$or"]
|
|
71
|
-
},
|
|
72
|
-
items: {
|
|
73
|
-
type: "array",
|
|
74
|
-
items: {
|
|
75
|
-
oneOf: [
|
|
76
|
-
{ $ref: `${genericFilterSchemaId}#/definitions/filterCondition` },
|
|
77
|
-
{ $ref: `${genericFilterSchemaId}#/definitions/filterGroup` }
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
required: ["logic", "items"],
|
|
83
|
-
additionalProperties: true,
|
|
84
|
-
allOf: [
|
|
85
|
-
{
|
|
86
|
-
not: {
|
|
87
|
-
required: ["path"]
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
not: {
|
|
92
|
-
required: ["operator"]
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
not: {
|
|
97
|
-
required: ["value"]
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
not: {
|
|
102
|
-
required: ["noValue"]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
type: "object",
|
|
109
|
-
properties: {
|
|
110
|
-
logic: {
|
|
111
|
-
type: "string",
|
|
112
|
-
enum: ["$and", "$or"]
|
|
113
|
-
},
|
|
114
|
-
items: {
|
|
115
|
-
type: "array",
|
|
116
|
-
items: {
|
|
117
|
-
oneOf: [
|
|
118
|
-
{ $ref: `${genericFilterSchemaId}#/definitions/filterCondition` },
|
|
119
|
-
{ $ref: `${genericFilterSchemaId}#/definitions/filterGroup` }
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
required: ["logic", "items"],
|
|
125
|
-
additionalProperties: true,
|
|
126
|
-
allOf: [
|
|
127
|
-
{
|
|
128
|
-
not: {
|
|
129
|
-
required: ["path"]
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
not: {
|
|
134
|
-
required: ["operator"]
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
not: {
|
|
139
|
-
required: ["value"]
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
not: {
|
|
144
|
-
required: ["noValue"]
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
]
|
|
148
|
-
};
|
|
149
|
-
const sortingRuleParamsSchema = {
|
|
150
|
-
type: "object",
|
|
151
|
-
properties: {
|
|
152
|
-
sort: {
|
|
153
|
-
type: "array",
|
|
154
|
-
items: {
|
|
155
|
-
type: "object",
|
|
156
|
-
properties: {
|
|
157
|
-
field: { type: "string" },
|
|
158
|
-
direction: { type: "string", enum: ["asc", "desc"] }
|
|
159
|
-
},
|
|
160
|
-
required: ["field", "direction"],
|
|
161
|
-
additionalProperties: false
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
additionalProperties: false
|
|
166
|
-
};
|
|
167
|
-
const layoutParamsSchema = {
|
|
168
|
-
type: "object",
|
|
169
|
-
properties: {
|
|
170
|
-
layout: {
|
|
171
|
-
type: "string",
|
|
172
|
-
enum: ["vertical", "horizontal"]
|
|
173
|
-
},
|
|
174
|
-
labelAlign: {
|
|
175
|
-
type: "string",
|
|
176
|
-
enum: ["left", "right"]
|
|
177
|
-
},
|
|
178
|
-
labelWidth: { type: ["number", "string", "null"] },
|
|
179
|
-
labelWrap: { type: "boolean" },
|
|
180
|
-
colon: { type: "boolean" }
|
|
181
|
-
},
|
|
182
|
-
required: ["layout"],
|
|
183
|
-
additionalProperties: false
|
|
184
|
-
};
|
|
185
|
-
const genericModelNodeSchema = {
|
|
186
|
-
type: "object",
|
|
187
|
-
required: ["uid", "use"],
|
|
188
|
-
properties: {
|
|
189
|
-
uid: { type: "string" },
|
|
190
|
-
use: { type: "string" }
|
|
191
|
-
},
|
|
192
|
-
additionalProperties: true
|
|
193
|
-
};
|
|
194
|
-
const collectionResourceInitSchema = {
|
|
195
|
-
type: "object",
|
|
196
|
-
properties: {
|
|
197
|
-
dataSourceKey: { type: "string" },
|
|
198
|
-
collectionName: { type: "string" },
|
|
199
|
-
associationName: { type: "string" },
|
|
200
|
-
sourceId: { type: ["string", "number"] },
|
|
201
|
-
filterByTk: { type: ["string", "number"] }
|
|
202
|
-
},
|
|
203
|
-
required: ["dataSourceKey", "collectionName"],
|
|
204
|
-
additionalProperties: true
|
|
205
|
-
};
|
|
206
|
-
const collectionResourceSettingsStepParamsSchema = {
|
|
207
|
-
type: "object",
|
|
208
|
-
properties: {
|
|
209
|
-
resourceSettings: {
|
|
210
|
-
type: "object",
|
|
211
|
-
properties: {
|
|
212
|
-
init: collectionResourceInitSchema
|
|
213
|
-
},
|
|
214
|
-
additionalProperties: true
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
additionalProperties: true
|
|
218
|
-
};
|
|
219
|
-
const createCollectionResourceStepParams = (init = {}, extraStepParams = {}) => ({
|
|
220
|
-
resourceSettings: {
|
|
221
|
-
init: {
|
|
222
|
-
dataSourceKey: "main",
|
|
223
|
-
collectionName: "users",
|
|
224
|
-
...init
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
...extraStepParams
|
|
228
|
-
});
|
|
229
|
-
const createAssociatedCollectionPattern = (use, extraStepParams = {}) => ({
|
|
230
|
-
title: "Associated records in popup/new scene",
|
|
231
|
-
description: "Use associationName + sourceId when the block should load records through a parent relation.",
|
|
232
|
-
snippet: {
|
|
233
|
-
use,
|
|
234
|
-
stepParams: createCollectionResourceStepParams(
|
|
235
|
-
{
|
|
236
|
-
collectionName: "roles",
|
|
237
|
-
associationName: "users.roles",
|
|
238
|
-
sourceId: "{{ctx.view.inputArgs.sourceId}}"
|
|
239
|
-
},
|
|
240
|
-
extraStepParams
|
|
241
|
-
)
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
const listItemModelInternalSchemaContribution = {
|
|
245
|
-
use: "ListItemModel",
|
|
246
|
-
title: "List item",
|
|
247
|
-
source: "plugin",
|
|
248
|
-
strict: false,
|
|
249
|
-
exposure: "internal",
|
|
250
|
-
subModelSlots: {
|
|
251
|
-
grid: {
|
|
252
|
-
type: "object",
|
|
253
|
-
use: "DetailsGridModel",
|
|
254
|
-
description: "Per-record details grid."
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
skeleton: {
|
|
258
|
-
uid: "todo-list-item-uid",
|
|
259
|
-
use: "ListItemModel",
|
|
260
|
-
subModels: {
|
|
261
|
-
grid: {
|
|
262
|
-
uid: "todo-list-item-grid-uid",
|
|
263
|
-
use: "DetailsGridModel"
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
const listBlockModelSchemaContribution = {
|
|
269
|
-
use: "ListBlockModel",
|
|
270
|
-
title: "List block",
|
|
271
|
-
source: "plugin",
|
|
272
|
-
strict: false,
|
|
273
|
-
stepParamsSchema: {
|
|
274
|
-
type: "object",
|
|
275
|
-
properties: {
|
|
276
|
-
...collectionResourceSettingsStepParamsSchema.properties || {},
|
|
277
|
-
resourceSettings2: {
|
|
278
|
-
type: "object",
|
|
279
|
-
additionalProperties: true
|
|
280
|
-
},
|
|
281
|
-
listSettings: {
|
|
282
|
-
type: "object",
|
|
283
|
-
properties: {
|
|
284
|
-
pageSize: {
|
|
285
|
-
type: "object",
|
|
286
|
-
properties: {
|
|
287
|
-
pageSize: {
|
|
288
|
-
type: "number",
|
|
289
|
-
enum: [5, 10, 20, 50, 100, 200]
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
additionalProperties: false
|
|
293
|
-
},
|
|
294
|
-
dataScope: {
|
|
295
|
-
type: "object",
|
|
296
|
-
properties: {
|
|
297
|
-
filter: genericFilterSchema
|
|
298
|
-
},
|
|
299
|
-
additionalProperties: false
|
|
300
|
-
},
|
|
301
|
-
defaultSorting: sortingRuleParamsSchema,
|
|
302
|
-
layout: layoutParamsSchema
|
|
303
|
-
},
|
|
304
|
-
additionalProperties: true
|
|
305
|
-
},
|
|
306
|
-
paginationChange: {
|
|
307
|
-
type: "object",
|
|
308
|
-
properties: {
|
|
309
|
-
linkageRulesRefresh: {
|
|
310
|
-
type: "object",
|
|
311
|
-
properties: {
|
|
312
|
-
actionName: { type: "string" },
|
|
313
|
-
flowKey: { type: "string" },
|
|
314
|
-
stepKey: { type: "string" }
|
|
315
|
-
},
|
|
316
|
-
required: ["actionName", "flowKey"],
|
|
317
|
-
additionalProperties: false
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
additionalProperties: true
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
additionalProperties: true
|
|
324
|
-
},
|
|
325
|
-
subModelSlots: {
|
|
326
|
-
item: {
|
|
327
|
-
type: "object",
|
|
328
|
-
use: "ListItemModel",
|
|
329
|
-
description: "List item layout."
|
|
330
|
-
},
|
|
331
|
-
actions: {
|
|
332
|
-
type: "array",
|
|
333
|
-
dynamic: true,
|
|
334
|
-
schema: genericModelNodeSchema,
|
|
335
|
-
description: "List actions depend on runtime collection-action registries."
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
skeleton: {
|
|
339
|
-
uid: "todo-uid",
|
|
340
|
-
use: "ListBlockModel",
|
|
341
|
-
stepParams: createCollectionResourceStepParams(
|
|
342
|
-
{},
|
|
343
|
-
{
|
|
344
|
-
listSettings: {
|
|
345
|
-
pageSize: {
|
|
346
|
-
pageSize: 20
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
),
|
|
351
|
-
subModels: {
|
|
352
|
-
item: {
|
|
353
|
-
uid: "todo-list-item-uid",
|
|
354
|
-
use: "ListItemModel"
|
|
355
|
-
},
|
|
356
|
-
actions: []
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
docs: {
|
|
360
|
-
minimalExample: {
|
|
361
|
-
uid: "list-users",
|
|
362
|
-
use: "ListBlockModel",
|
|
363
|
-
stepParams: createCollectionResourceStepParams(
|
|
364
|
-
{},
|
|
365
|
-
{
|
|
366
|
-
listSettings: {
|
|
367
|
-
pageSize: {
|
|
368
|
-
pageSize: 20
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
),
|
|
373
|
-
subModels: {
|
|
374
|
-
item: {
|
|
375
|
-
uid: "list-item-users",
|
|
376
|
-
use: "ListItemModel"
|
|
377
|
-
},
|
|
378
|
-
actions: []
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
commonPatterns: [
|
|
382
|
-
{
|
|
383
|
-
title: "Basic list block",
|
|
384
|
-
snippet: {
|
|
385
|
-
use: "ListBlockModel",
|
|
386
|
-
stepParams: createCollectionResourceStepParams(
|
|
387
|
-
{},
|
|
388
|
-
{
|
|
389
|
-
listSettings: {
|
|
390
|
-
pageSize: {
|
|
391
|
-
pageSize: 20
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
)
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
createAssociatedCollectionPattern("ListBlockModel", {
|
|
399
|
-
listSettings: {
|
|
400
|
-
pageSize: {
|
|
401
|
-
pageSize: 20
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
})
|
|
405
|
-
],
|
|
406
|
-
dynamicHints: [
|
|
407
|
-
{
|
|
408
|
-
kind: "dynamic-children",
|
|
409
|
-
path: "ListBlockModel.subModels.actions",
|
|
410
|
-
message: "List actions depend on runtime collection-action registries.",
|
|
411
|
-
"x-flow": {
|
|
412
|
-
slotRules: {
|
|
413
|
-
slotKey: "actions",
|
|
414
|
-
type: "array"
|
|
415
|
-
},
|
|
416
|
-
contextRequirements: ["collection action registry"],
|
|
417
|
-
unresolvedReason: "runtime-list-actions"
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
]
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
const flowSchemaContribution = {
|
|
424
|
-
inventory: {
|
|
425
|
-
publicTreeRoots: ["ListBlockModel"]
|
|
426
|
-
},
|
|
427
|
-
models: [listItemModelInternalSchemaContribution, listBlockModelSchemaContribution],
|
|
428
|
-
defaults: {
|
|
429
|
-
source: "plugin"
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
433
|
-
0 && (module.exports = {
|
|
434
|
-
flowSchemaContribution
|
|
435
|
-
});
|