@steedos/service-plugin-amis 2.6.1-beta.6 → 2.6.2-beta.10
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} +14 -14
- 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 +119 -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,26 +108,30 @@
|
|
|
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 {
|
|
116
128
|
margin-top: 0.75rem
|
|
117
129
|
}
|
|
118
130
|
|
|
131
|
+
.mr-7 {
|
|
132
|
+
margin-right: 1.75rem
|
|
133
|
+
}
|
|
134
|
+
|
|
119
135
|
.mb-0 {
|
|
120
136
|
margin-bottom: 0px
|
|
121
137
|
}
|
|
@@ -128,6 +144,10 @@
|
|
|
128
144
|
display: block
|
|
129
145
|
}
|
|
130
146
|
|
|
147
|
+
.inline-block {
|
|
148
|
+
display: inline-block
|
|
149
|
+
}
|
|
150
|
+
|
|
131
151
|
.inline {
|
|
132
152
|
display: inline
|
|
133
153
|
}
|
|
@@ -152,6 +172,10 @@
|
|
|
152
172
|
display: none
|
|
153
173
|
}
|
|
154
174
|
|
|
175
|
+
.h-9 {
|
|
176
|
+
height: 2.25rem
|
|
177
|
+
}
|
|
178
|
+
|
|
155
179
|
.h-full {
|
|
156
180
|
height: 100%
|
|
157
181
|
}
|
|
@@ -160,6 +184,14 @@
|
|
|
160
184
|
height: 0px
|
|
161
185
|
}
|
|
162
186
|
|
|
187
|
+
.h-7 {
|
|
188
|
+
height: 1.75rem
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.w-9 {
|
|
192
|
+
width: 2.25rem
|
|
193
|
+
}
|
|
194
|
+
|
|
163
195
|
.w-10 {
|
|
164
196
|
width: 2.5rem
|
|
165
197
|
}
|
|
@@ -172,6 +204,10 @@
|
|
|
172
204
|
width: 100%
|
|
173
205
|
}
|
|
174
206
|
|
|
207
|
+
.w-4\/5 {
|
|
208
|
+
width: 80%
|
|
209
|
+
}
|
|
210
|
+
|
|
175
211
|
.w-96 {
|
|
176
212
|
width: 24rem
|
|
177
213
|
}
|
|
@@ -189,6 +225,10 @@
|
|
|
189
225
|
min-width: 200px
|
|
190
226
|
}
|
|
191
227
|
|
|
228
|
+
.max-w-4xl {
|
|
229
|
+
max-width: 56rem
|
|
230
|
+
}
|
|
231
|
+
|
|
192
232
|
.flex-1 {
|
|
193
233
|
flex: 1 1 0%
|
|
194
234
|
}
|
|
@@ -197,6 +237,10 @@
|
|
|
197
237
|
flex-shrink: 0
|
|
198
238
|
}
|
|
199
239
|
|
|
240
|
+
.flex-grow {
|
|
241
|
+
flex-grow: 1
|
|
242
|
+
}
|
|
243
|
+
|
|
200
244
|
.-translate-x-0 {
|
|
201
245
|
--tw-translate-x: -0px;
|
|
202
246
|
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 +266,10 @@
|
|
|
222
266
|
justify-content: center
|
|
223
267
|
}
|
|
224
268
|
|
|
269
|
+
.justify-between {
|
|
270
|
+
justify-content: space-between
|
|
271
|
+
}
|
|
272
|
+
|
|
225
273
|
.overflow-auto {
|
|
226
274
|
overflow: auto
|
|
227
275
|
}
|
|
@@ -234,10 +282,26 @@
|
|
|
234
282
|
overflow-y: auto
|
|
235
283
|
}
|
|
236
284
|
|
|
285
|
+
.whitespace-nowrap {
|
|
286
|
+
white-space: nowrap
|
|
287
|
+
}
|
|
288
|
+
|
|
237
289
|
.rounded {
|
|
238
290
|
border-radius: 0.25rem
|
|
239
291
|
}
|
|
240
292
|
|
|
293
|
+
.rounded-full {
|
|
294
|
+
border-radius: 9999px
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.border {
|
|
298
|
+
border-width: 1px
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.border-0 {
|
|
302
|
+
border-width: 0px
|
|
303
|
+
}
|
|
304
|
+
|
|
241
305
|
.border-b {
|
|
242
306
|
border-bottom-width: 1px
|
|
243
307
|
}
|
|
@@ -250,21 +314,11 @@
|
|
|
250
314
|
border-style: solid
|
|
251
315
|
}
|
|
252
316
|
|
|
253
|
-
.border-slate-300 {
|
|
254
|
-
--tw-border-opacity: 1;
|
|
255
|
-
border-color: rgb(203 213 225 / var(--tw-border-opacity))
|
|
256
|
-
}
|
|
257
|
-
|
|
258
317
|
.border-gray-300 {
|
|
259
318
|
--tw-border-opacity: 1;
|
|
260
319
|
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
|
261
320
|
}
|
|
262
321
|
|
|
263
|
-
.border-slate-200 {
|
|
264
|
-
--tw-border-opacity: 1;
|
|
265
|
-
border-color: rgb(226 232 240 / var(--tw-border-opacity))
|
|
266
|
-
}
|
|
267
|
-
|
|
268
322
|
.border-gray-200 {
|
|
269
323
|
--tw-border-opacity: 1;
|
|
270
324
|
border-color: rgb(229 231 235 / var(--tw-border-opacity))
|
|
@@ -275,11 +329,20 @@
|
|
|
275
329
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
|
276
330
|
}
|
|
277
331
|
|
|
332
|
+
.bg-gray-50 {
|
|
333
|
+
--tw-bg-opacity: 1;
|
|
334
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity))
|
|
335
|
+
}
|
|
336
|
+
|
|
278
337
|
.bg-gray-100 {
|
|
279
338
|
--tw-bg-opacity: 1;
|
|
280
339
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity))
|
|
281
340
|
}
|
|
282
341
|
|
|
342
|
+
.bg-none {
|
|
343
|
+
background-image: none
|
|
344
|
+
}
|
|
345
|
+
|
|
283
346
|
.p-0 {
|
|
284
347
|
padding: 0px
|
|
285
348
|
}
|
|
@@ -292,16 +355,30 @@
|
|
|
292
355
|
padding: 0.5rem
|
|
293
356
|
}
|
|
294
357
|
|
|
358
|
+
.p-1 {
|
|
359
|
+
padding: 0.25rem
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.px-2 {
|
|
363
|
+
padding-left: 0.5rem;
|
|
364
|
+
padding-right: 0.5rem
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.py-0\.5 {
|
|
368
|
+
padding-top: 0.125rem;
|
|
369
|
+
padding-bottom: 0.125rem
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.py-0 {
|
|
373
|
+
padding-top: 0px;
|
|
374
|
+
padding-bottom: 0px
|
|
375
|
+
}
|
|
376
|
+
|
|
295
377
|
.px-1 {
|
|
296
378
|
padding-left: 0.25rem;
|
|
297
379
|
padding-right: 0.25rem
|
|
298
380
|
}
|
|
299
381
|
|
|
300
|
-
.py-3 {
|
|
301
|
-
padding-top: 0.75rem;
|
|
302
|
-
padding-bottom: 0.75rem
|
|
303
|
-
}
|
|
304
|
-
|
|
305
382
|
.px-10 {
|
|
306
383
|
padding-left: 2.5rem;
|
|
307
384
|
padding-right: 2.5rem
|
|
@@ -317,22 +394,17 @@
|
|
|
317
394
|
padding-right: 0px
|
|
318
395
|
}
|
|
319
396
|
|
|
320
|
-
.py-0 {
|
|
321
|
-
padding-top: 0px;
|
|
322
|
-
padding-bottom: 0px
|
|
323
|
-
}
|
|
324
|
-
|
|
325
397
|
.py-1 {
|
|
326
398
|
padding-top: 0.25rem;
|
|
327
399
|
padding-bottom: 0.25rem
|
|
328
400
|
}
|
|
329
401
|
|
|
330
|
-
.
|
|
331
|
-
padding-
|
|
402
|
+
.pb-3 {
|
|
403
|
+
padding-bottom: 0.75rem
|
|
332
404
|
}
|
|
333
405
|
|
|
334
|
-
.pl-
|
|
335
|
-
padding-left:
|
|
406
|
+
.pl-10 {
|
|
407
|
+
padding-left: 2.5rem
|
|
336
408
|
}
|
|
337
409
|
|
|
338
410
|
.text-left {
|
|
@@ -351,10 +423,6 @@
|
|
|
351
423
|
font-weight: 700
|
|
352
424
|
}
|
|
353
425
|
|
|
354
|
-
.lowercase {
|
|
355
|
-
text-transform: lowercase
|
|
356
|
-
}
|
|
357
|
-
|
|
358
426
|
.italic {
|
|
359
427
|
font-style: italic
|
|
360
428
|
}
|
|
@@ -363,6 +431,11 @@
|
|
|
363
431
|
line-height: 1
|
|
364
432
|
}
|
|
365
433
|
|
|
434
|
+
.text-gray-600 {
|
|
435
|
+
--tw-text-opacity: 1;
|
|
436
|
+
color: rgb(75 85 99 / var(--tw-text-opacity))
|
|
437
|
+
}
|
|
438
|
+
|
|
366
439
|
.text-black {
|
|
367
440
|
--tw-text-opacity: 1;
|
|
368
441
|
color: rgb(0 0 0 / var(--tw-text-opacity))
|
|
@@ -383,6 +456,12 @@
|
|
|
383
456
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
|
384
457
|
}
|
|
385
458
|
|
|
459
|
+
.shadow {
|
|
460
|
+
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
461
|
+
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
462
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
|
463
|
+
}
|
|
464
|
+
|
|
386
465
|
.filter {
|
|
387
466
|
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
467
|
}
|
|
@@ -413,14 +492,14 @@
|
|
|
413
492
|
margin-top: 0.75rem
|
|
414
493
|
}
|
|
415
494
|
|
|
416
|
-
.sm\:rounded-lg {
|
|
417
|
-
border-radius: 0.5rem
|
|
418
|
-
}
|
|
419
|
-
|
|
420
495
|
.sm\:rounded {
|
|
421
496
|
border-radius: 0.25rem
|
|
422
497
|
}
|
|
423
498
|
|
|
499
|
+
.sm\:rounded-lg {
|
|
500
|
+
border-radius: 0.5rem
|
|
501
|
+
}
|
|
502
|
+
|
|
424
503
|
.sm\:border {
|
|
425
504
|
border-width: 1px
|
|
426
505
|
}
|
|
@@ -430,10 +509,6 @@
|
|
|
430
509
|
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
|
431
510
|
}
|
|
432
511
|
|
|
433
|
-
.sm\:p-3 {
|
|
434
|
-
padding: 0.75rem
|
|
435
|
-
}
|
|
436
|
-
|
|
437
512
|
.sm\:px-3 {
|
|
438
513
|
padding-left: 0.75rem;
|
|
439
514
|
padding-right: 0.75rem
|