@steedos/service-plugin-amis 2.6.1-beta.6 → 2.6.2-beta.2
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/main/default/client/amis.render.client.js +67 -16
- package/main/default/client/creator.function.client.js +4 -4
- package/main/default/pages/{action_field_updates.page.amis.json → action_field_updates_form.page.amis.json} +12 -12
- package/main/default/pages/{action_field_updates.page.yml → action_field_updates_form.page.yml} +1 -1
- package/main/default/pages/apps_form.page.amis.json +295 -567
- package/main/default/pages/listview_form.page.amis.json +179 -552
- package/main/default/pages/object_layouts_form.page.amis.json +100 -0
- package/main/default/pages/{object_layouts.page.yml → object_layouts_form.page.yml} +1 -1
- package/main/default/services/amis-design.service.js +39 -12
- package/main/default/services/metadata/objects.service.js +38 -13
- package/main/default/services/utils/page-schema.js +5 -8
- package/main/default/translations/en.translation.yml +28 -0
- package/main/default/translations/zh-CN.translation.yml +28 -0
- package/package.json +2 -2
- package/package.service.js +62 -4
- package/public/tailwind/tailwind-steedos.css +115 -44
- package/main/default/pages/object_layouts.page.amis.json +0 -913
package/package.service.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-05-19 11:38:30
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-08-02 15:05:31
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
1
8
|
"use strict";
|
|
2
9
|
const project = require('./package.json');
|
|
3
10
|
const packageName = project.name;
|
|
4
11
|
const packageLoader = require('@steedos/service-package-loader');
|
|
5
12
|
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const fs = require("fs");
|
|
15
|
+
|
|
6
16
|
/**
|
|
7
17
|
* @typedef {import('moleculer').Context} Context Moleculer's Context
|
|
8
18
|
* 软件包服务启动后也需要抛出事件。
|
|
@@ -19,7 +29,8 @@ module.exports = {
|
|
|
19
29
|
path: __dirname,
|
|
20
30
|
name: this.name,
|
|
21
31
|
isPackage: false
|
|
22
|
-
}
|
|
32
|
+
},
|
|
33
|
+
loadedPublicClientJS: false,
|
|
23
34
|
},
|
|
24
35
|
|
|
25
36
|
/**
|
|
@@ -38,14 +49,59 @@ module.exports = {
|
|
|
38
49
|
* Events
|
|
39
50
|
*/
|
|
40
51
|
events: {
|
|
41
|
-
|
|
52
|
+
"steedos-server.started": {
|
|
53
|
+
async handler() {
|
|
54
|
+
await this.publicClientJS();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"space.initialized": {
|
|
58
|
+
async handler() {
|
|
59
|
+
await this.publicClientJS();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
42
62
|
},
|
|
43
63
|
|
|
44
64
|
/**
|
|
45
65
|
* Methods
|
|
46
66
|
*/
|
|
47
67
|
methods: {
|
|
48
|
-
|
|
68
|
+
publicClientJS: {
|
|
69
|
+
handler() {
|
|
70
|
+
let packageInfo = this.settings.packageInfo;
|
|
71
|
+
if (!packageInfo) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const { path : packagePath } = packageInfo;
|
|
75
|
+
let publicPath = path.join(packagePath, 'main', 'default', 'client');
|
|
76
|
+
try {
|
|
77
|
+
if (!fs.existsSync(publicPath) || this.settings.loadedPublicClientJS || typeof WebApp == 'undefined') {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
} catch (error) {
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
const express = require('express');
|
|
86
|
+
this.settings.loadedPublicClientJS = true;
|
|
87
|
+
try {
|
|
88
|
+
const router = require('@steedos/router').staticRouter();
|
|
89
|
+
let routerPath = "";
|
|
90
|
+
if (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX) {
|
|
91
|
+
routerPath = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
|
|
92
|
+
}
|
|
93
|
+
const cacheTime = 86400000 * 1; // one day
|
|
94
|
+
router.use(`${routerPath}/amis-pages/js`, express.static(publicPath, { maxAge: cacheTime }));
|
|
95
|
+
// WebApp.connectHandlers.use(router);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.error(error)
|
|
98
|
+
this.settings.loadedPublicClientJS = false;
|
|
99
|
+
}
|
|
100
|
+
} catch (error) {
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
49
105
|
},
|
|
50
106
|
|
|
51
107
|
/**
|
|
@@ -59,7 +115,9 @@ module.exports = {
|
|
|
59
115
|
* Service started lifecycle event handler
|
|
60
116
|
*/
|
|
61
117
|
async started() {
|
|
62
|
-
|
|
118
|
+
this.broker.waitForServices("steedos-server").then(async () => {
|
|
119
|
+
await this.publicClientJS()
|
|
120
|
+
});
|
|
63
121
|
},
|
|
64
122
|
|
|
65
123
|
/**
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
grid-column: span 2 / span 2
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
.float-right {
|
|
77
|
+
float: right
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
.m-1 {
|
|
77
81
|
margin: 0.25rem
|
|
78
82
|
}
|
|
@@ -81,6 +85,14 @@
|
|
|
81
85
|
margin: 0px
|
|
82
86
|
}
|
|
83
87
|
|
|
88
|
+
.-m-8 {
|
|
89
|
+
margin: -2rem
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.m-auto {
|
|
93
|
+
margin: auto
|
|
94
|
+
}
|
|
95
|
+
|
|
84
96
|
.mx-4 {
|
|
85
97
|
margin-left: 1rem;
|
|
86
98
|
margin-right: 1rem
|
|
@@ -96,20 +108,20 @@
|
|
|
96
108
|
margin-right: -2.75rem
|
|
97
109
|
}
|
|
98
110
|
|
|
99
|
-
.
|
|
100
|
-
margin-
|
|
111
|
+
.mb-4 {
|
|
112
|
+
margin-bottom: 1rem
|
|
101
113
|
}
|
|
102
114
|
|
|
103
|
-
.mt-
|
|
104
|
-
margin-top:
|
|
115
|
+
.mt-2 {
|
|
116
|
+
margin-top: 0.5rem
|
|
105
117
|
}
|
|
106
118
|
|
|
107
|
-
|
|
108
|
-
margin-
|
|
119
|
+
.mr-4 {
|
|
120
|
+
margin-right: 1rem
|
|
109
121
|
}
|
|
110
122
|
|
|
111
|
-
|
|
112
|
-
margin-
|
|
123
|
+
.-mt-3 {
|
|
124
|
+
margin-top: -0.75rem
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
.mt-3 {
|
|
@@ -128,6 +140,10 @@
|
|
|
128
140
|
display: block
|
|
129
141
|
}
|
|
130
142
|
|
|
143
|
+
.inline-block {
|
|
144
|
+
display: inline-block
|
|
145
|
+
}
|
|
146
|
+
|
|
131
147
|
.inline {
|
|
132
148
|
display: inline
|
|
133
149
|
}
|
|
@@ -152,6 +168,10 @@
|
|
|
152
168
|
display: none
|
|
153
169
|
}
|
|
154
170
|
|
|
171
|
+
.h-9 {
|
|
172
|
+
height: 2.25rem
|
|
173
|
+
}
|
|
174
|
+
|
|
155
175
|
.h-full {
|
|
156
176
|
height: 100%
|
|
157
177
|
}
|
|
@@ -160,6 +180,14 @@
|
|
|
160
180
|
height: 0px
|
|
161
181
|
}
|
|
162
182
|
|
|
183
|
+
.h-7 {
|
|
184
|
+
height: 1.75rem
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.w-9 {
|
|
188
|
+
width: 2.25rem
|
|
189
|
+
}
|
|
190
|
+
|
|
163
191
|
.w-10 {
|
|
164
192
|
width: 2.5rem
|
|
165
193
|
}
|
|
@@ -172,6 +200,10 @@
|
|
|
172
200
|
width: 100%
|
|
173
201
|
}
|
|
174
202
|
|
|
203
|
+
.w-4\/5 {
|
|
204
|
+
width: 80%
|
|
205
|
+
}
|
|
206
|
+
|
|
175
207
|
.w-96 {
|
|
176
208
|
width: 24rem
|
|
177
209
|
}
|
|
@@ -189,6 +221,10 @@
|
|
|
189
221
|
min-width: 200px
|
|
190
222
|
}
|
|
191
223
|
|
|
224
|
+
.max-w-4xl {
|
|
225
|
+
max-width: 56rem
|
|
226
|
+
}
|
|
227
|
+
|
|
192
228
|
.flex-1 {
|
|
193
229
|
flex: 1 1 0%
|
|
194
230
|
}
|
|
@@ -197,6 +233,10 @@
|
|
|
197
233
|
flex-shrink: 0
|
|
198
234
|
}
|
|
199
235
|
|
|
236
|
+
.flex-grow {
|
|
237
|
+
flex-grow: 1
|
|
238
|
+
}
|
|
239
|
+
|
|
200
240
|
.-translate-x-0 {
|
|
201
241
|
--tw-translate-x: -0px;
|
|
202
242
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
|
@@ -222,6 +262,10 @@
|
|
|
222
262
|
justify-content: center
|
|
223
263
|
}
|
|
224
264
|
|
|
265
|
+
.justify-between {
|
|
266
|
+
justify-content: space-between
|
|
267
|
+
}
|
|
268
|
+
|
|
225
269
|
.overflow-auto {
|
|
226
270
|
overflow: auto
|
|
227
271
|
}
|
|
@@ -234,10 +278,26 @@
|
|
|
234
278
|
overflow-y: auto
|
|
235
279
|
}
|
|
236
280
|
|
|
281
|
+
.whitespace-nowrap {
|
|
282
|
+
white-space: nowrap
|
|
283
|
+
}
|
|
284
|
+
|
|
237
285
|
.rounded {
|
|
238
286
|
border-radius: 0.25rem
|
|
239
287
|
}
|
|
240
288
|
|
|
289
|
+
.rounded-full {
|
|
290
|
+
border-radius: 9999px
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.border {
|
|
294
|
+
border-width: 1px
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.border-0 {
|
|
298
|
+
border-width: 0px
|
|
299
|
+
}
|
|
300
|
+
|
|
241
301
|
.border-b {
|
|
242
302
|
border-bottom-width: 1px
|
|
243
303
|
}
|
|
@@ -250,21 +310,11 @@
|
|
|
250
310
|
border-style: solid
|
|
251
311
|
}
|
|
252
312
|
|
|
253
|
-
.border-slate-300 {
|
|
254
|
-
--tw-border-opacity: 1;
|
|
255
|
-
border-color: rgb(203 213 225 / var(--tw-border-opacity))
|
|
256
|
-
}
|
|
257
|
-
|
|
258
313
|
.border-gray-300 {
|
|
259
314
|
--tw-border-opacity: 1;
|
|
260
315
|
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
|
261
316
|
}
|
|
262
317
|
|
|
263
|
-
.border-slate-200 {
|
|
264
|
-
--tw-border-opacity: 1;
|
|
265
|
-
border-color: rgb(226 232 240 / var(--tw-border-opacity))
|
|
266
|
-
}
|
|
267
|
-
|
|
268
318
|
.border-gray-200 {
|
|
269
319
|
--tw-border-opacity: 1;
|
|
270
320
|
border-color: rgb(229 231 235 / var(--tw-border-opacity))
|
|
@@ -275,11 +325,20 @@
|
|
|
275
325
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
|
276
326
|
}
|
|
277
327
|
|
|
328
|
+
.bg-gray-50 {
|
|
329
|
+
--tw-bg-opacity: 1;
|
|
330
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity))
|
|
331
|
+
}
|
|
332
|
+
|
|
278
333
|
.bg-gray-100 {
|
|
279
334
|
--tw-bg-opacity: 1;
|
|
280
335
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity))
|
|
281
336
|
}
|
|
282
337
|
|
|
338
|
+
.bg-none {
|
|
339
|
+
background-image: none
|
|
340
|
+
}
|
|
341
|
+
|
|
283
342
|
.p-0 {
|
|
284
343
|
padding: 0px
|
|
285
344
|
}
|
|
@@ -292,16 +351,30 @@
|
|
|
292
351
|
padding: 0.5rem
|
|
293
352
|
}
|
|
294
353
|
|
|
354
|
+
.p-1 {
|
|
355
|
+
padding: 0.25rem
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.px-2 {
|
|
359
|
+
padding-left: 0.5rem;
|
|
360
|
+
padding-right: 0.5rem
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.py-0\.5 {
|
|
364
|
+
padding-top: 0.125rem;
|
|
365
|
+
padding-bottom: 0.125rem
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.py-0 {
|
|
369
|
+
padding-top: 0px;
|
|
370
|
+
padding-bottom: 0px
|
|
371
|
+
}
|
|
372
|
+
|
|
295
373
|
.px-1 {
|
|
296
374
|
padding-left: 0.25rem;
|
|
297
375
|
padding-right: 0.25rem
|
|
298
376
|
}
|
|
299
377
|
|
|
300
|
-
.py-3 {
|
|
301
|
-
padding-top: 0.75rem;
|
|
302
|
-
padding-bottom: 0.75rem
|
|
303
|
-
}
|
|
304
|
-
|
|
305
378
|
.px-10 {
|
|
306
379
|
padding-left: 2.5rem;
|
|
307
380
|
padding-right: 2.5rem
|
|
@@ -317,22 +390,17 @@
|
|
|
317
390
|
padding-right: 0px
|
|
318
391
|
}
|
|
319
392
|
|
|
320
|
-
.py-0 {
|
|
321
|
-
padding-top: 0px;
|
|
322
|
-
padding-bottom: 0px
|
|
323
|
-
}
|
|
324
|
-
|
|
325
393
|
.py-1 {
|
|
326
394
|
padding-top: 0.25rem;
|
|
327
395
|
padding-bottom: 0.25rem
|
|
328
396
|
}
|
|
329
397
|
|
|
330
|
-
.
|
|
331
|
-
padding-
|
|
398
|
+
.pb-3 {
|
|
399
|
+
padding-bottom: 0.75rem
|
|
332
400
|
}
|
|
333
401
|
|
|
334
|
-
.pl-
|
|
335
|
-
padding-left:
|
|
402
|
+
.pl-10 {
|
|
403
|
+
padding-left: 2.5rem
|
|
336
404
|
}
|
|
337
405
|
|
|
338
406
|
.text-left {
|
|
@@ -351,10 +419,6 @@
|
|
|
351
419
|
font-weight: 700
|
|
352
420
|
}
|
|
353
421
|
|
|
354
|
-
.lowercase {
|
|
355
|
-
text-transform: lowercase
|
|
356
|
-
}
|
|
357
|
-
|
|
358
422
|
.italic {
|
|
359
423
|
font-style: italic
|
|
360
424
|
}
|
|
@@ -363,6 +427,11 @@
|
|
|
363
427
|
line-height: 1
|
|
364
428
|
}
|
|
365
429
|
|
|
430
|
+
.text-gray-600 {
|
|
431
|
+
--tw-text-opacity: 1;
|
|
432
|
+
color: rgb(75 85 99 / var(--tw-text-opacity))
|
|
433
|
+
}
|
|
434
|
+
|
|
366
435
|
.text-black {
|
|
367
436
|
--tw-text-opacity: 1;
|
|
368
437
|
color: rgb(0 0 0 / var(--tw-text-opacity))
|
|
@@ -383,6 +452,12 @@
|
|
|
383
452
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
|
384
453
|
}
|
|
385
454
|
|
|
455
|
+
.shadow {
|
|
456
|
+
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
457
|
+
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
458
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
|
459
|
+
}
|
|
460
|
+
|
|
386
461
|
.filter {
|
|
387
462
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)
|
|
388
463
|
}
|
|
@@ -413,14 +488,14 @@
|
|
|
413
488
|
margin-top: 0.75rem
|
|
414
489
|
}
|
|
415
490
|
|
|
416
|
-
.sm\:rounded-lg {
|
|
417
|
-
border-radius: 0.5rem
|
|
418
|
-
}
|
|
419
|
-
|
|
420
491
|
.sm\:rounded {
|
|
421
492
|
border-radius: 0.25rem
|
|
422
493
|
}
|
|
423
494
|
|
|
495
|
+
.sm\:rounded-lg {
|
|
496
|
+
border-radius: 0.5rem
|
|
497
|
+
}
|
|
498
|
+
|
|
424
499
|
.sm\:border {
|
|
425
500
|
border-width: 1px
|
|
426
501
|
}
|
|
@@ -430,10 +505,6 @@
|
|
|
430
505
|
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
|
431
506
|
}
|
|
432
507
|
|
|
433
|
-
.sm\:p-3 {
|
|
434
|
-
padding: 0.75rem
|
|
435
|
-
}
|
|
436
|
-
|
|
437
508
|
.sm\:px-3 {
|
|
438
509
|
padding-left: 0.75rem;
|
|
439
510
|
padding-right: 0.75rem
|