@steedos/service-pages 2.4.0-beta.14 → 2.4.0-beta.16

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.
@@ -221,24 +221,21 @@
221
221
  },
222
222
  body: [
223
223
  {
224
- "type": "panel",
225
- "title": {
226
224
  "type": "breadcrumb",
227
- "source": "${$breadcrumb}"
228
- },
229
- "body": [
230
- {
231
- type: 'steedos-object-related-listview',
232
- objectApiName: masterObject.name,
233
- recordId: FlowRouter.getParam("record_id"),
234
- relatedObjectApiName: objectApiName,
235
- foreign_key: relatedKey,
236
- relatedKey: relatedKey,
237
- hiddenOn: "!!!this.$loaded"
238
- // top: 5
239
- }
240
- ]
241
- }
225
+ "source": "${$breadcrumb}",
226
+ "className": "mx-4 my-2",
227
+ },
228
+ {
229
+ type: 'steedos-object-related-listview',
230
+ objectApiName: masterObject.name,
231
+ recordId: FlowRouter.getParam("record_id"),
232
+ relatedObjectApiName: objectApiName,
233
+ foreign_key: relatedKey,
234
+ relatedKey: relatedKey,
235
+ hiddenOn: "!!!this.$loaded",
236
+ "className": "mx-4",
237
+ // top: 5
238
+ }
242
239
  ,
243
240
  // {
244
241
  // type: 'steedos-object-related-listview',
@@ -257,55 +254,7 @@
257
254
  }
258
255
 
259
256
  Steedos.Page.render = function (root, page, data, options = {}) {
260
- const loadingContentData = {
261
- "inputs": [],
262
- // "title": "loading",
263
- "blocks": [
264
- {
265
- "@type": "@builder.io/sdk:Element",
266
- "@version": 2,
267
- "layerName": "Box",
268
- "id": "builder-8070f86b1aed4e78a5878fa5c0d79e49",
269
- "children": [
270
- {
271
- "@type": "@builder.io/sdk:Element",
272
- "@version": 2,
273
- "layerName": "Loading...\n...",
274
- "id": "builder-4b16375a68dc4e49b4844843091bf91d",
275
- "component": {
276
- "name": "Text",
277
- "options": {
278
- "text": "<p>Loading...</p>\n"
279
- }
280
- },
281
- "responsiveStyles": {
282
- "large": {
283
- "display": "flex",
284
- "flexDirection": "column",
285
- "position": "relative",
286
- "flexShrink": "0",
287
- "boxSizing": "border-box",
288
- "marginTop": "20px",
289
- "lineHeight": "normal",
290
- "height": "auto",
291
- "textAlign": "center"
292
- }
293
- }
294
- }
295
- ],
296
- "responsiveStyles": {
297
- "large": {
298
- "display": "flex",
299
- "flexDirection": "column",
300
- "position": "relative",
301
- "flexShrink": "0",
302
- "boxSizing": "border-box"
303
- }
304
- }
305
- }
306
- ]
307
- };
308
-
257
+
309
258
  if (page.render_engine && page.render_engine != 'redash') {
310
259
 
311
260
  let schema = typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema;
@@ -362,24 +311,20 @@
362
311
 
363
312
  if(!lodash.isFunction(root)){
364
313
  //渲染loading
365
- // render(BuilderComponent, {
366
- // model: "page", content: {
367
- // "data": loadingContentData
368
- // }
369
- // }, root)
370
314
  }
371
315
 
372
316
  Promise.all([
317
+ waitForThing(window, 'renderAmis'),
373
318
  waitForThing(window, 'BuilderComponent'),
374
319
  waitForThing(Builder.components, upperFirst(page.render_engine), findComponent)
375
320
  ]).then(()=>{
376
321
  //渲染page
377
322
  if(!lodash.isFunction(root)){
378
- render(BuilderComponent, {
379
- model: "page", content: {
380
- "data": pageContentData
381
- }
382
- }, root)
323
+ renderAmis(
324
+ root,
325
+ schema,
326
+ data,
327
+ )
383
328
  }else{
384
329
  if(root === SteedosUI.Drawer){
385
330
  data.drawerName = data.drawerName || lodash.uniqueId(`drawer-${page.object_name}`);
@@ -761,7 +706,8 @@
761
706
  }
762
707
  try {
763
708
  const data = {
764
- app
709
+ app,
710
+ isMobile: window.innerWidth <= 768
765
711
  };
766
712
  const page = Steedos.Page.Header.getPage(appId, tabId);
767
713
  var rootId = "steedosGlobalHeaderRoot";
@@ -793,7 +739,7 @@
793
739
  body: [
794
740
  {
795
741
  "type": "wrapper",
796
- "className": "p-0 slds-global-header_container sticky top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 sm:shadow border-b-[3px] border-sky-500 border-solid",
742
+ "className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 sm:shadow border-b-[3px] border-sky-500 border-solid",
797
743
  body: [
798
744
  {
799
745
  "type": "wrapper",
@@ -804,15 +750,34 @@
804
750
  className: 'p-0 flex flex-1 items-center',
805
751
  body: [
806
752
  {
807
- "type": "steedos-logo",
808
- "src": "/logo.png",
809
- "className": 'block h-7 w-auto mr-4',
810
- "hiddenOn": "window.innerWidth < 768",
753
+ "type": "button",
754
+ "className": "toggle-sidebar flex items-center pr-4",
755
+ "hiddenOn": "${!isMobile}",
756
+ "onEvent": {
757
+ "click": {
758
+ "actions": [
759
+ {
760
+ "actionType": "custom",
761
+ "script": "document.body.classList.toggle('sidebar-open')",
762
+ }
763
+ ]
764
+ }
765
+ },
766
+ "body": [
767
+ {
768
+ "type": "steedos-icon",
769
+ "category": "utility",
770
+ "name": "rows",
771
+ "colorVariant": "default",
772
+ "id": "u:afc3a08e8cf3",
773
+ "className": "slds-button_icon slds-global-header__icon"
774
+ }
775
+ ],
811
776
  },
812
777
  {
813
- "type": "steedos-app-launcher",
814
- hiddenOn: "${app.showSidebar != true}",
815
- "showAppName": true
778
+ "className": 'block h-10 w-auto mr-4',
779
+ "type": "tpl",
780
+ "tpl": `<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='${logoSrc}'></a>`,
816
781
  },
817
782
  ],
818
783
  },
@@ -825,7 +790,7 @@
825
790
  {
826
791
  "type": "button",
827
792
  "className": "toggle-sidebar",
828
- "hiddenOn": "${app.showSidebar != true}",
793
+ "visibleOn": "${AND(app.showSidebar,!isMobile)}",
829
794
  "onEvent": {
830
795
  "click": {
831
796
  "actions": [
@@ -853,11 +818,11 @@
853
818
 
854
819
  {
855
820
  "type": "grid",
856
- hiddenOn: "${app.showSidebar === true}",
857
- "className": 'steedos-context-bar hidden sm:flex h-10 leading-5 pl-4 mb-[-3px]',
821
+ "hiddenOn": "${isMobile}",
822
+ "className": 'steedos-context-bar flex h-10 leading-5 pl-4 mb-[-3px]',
858
823
  "columns": [
859
824
  {
860
- "columnClassName": "items-center hidden sm:flex pb-0",
825
+ "columnClassName": "items-center flex pb-0",
861
826
  "body": [
862
827
  {
863
828
  "type": "steedos-app-launcher",
@@ -869,6 +834,7 @@
869
834
  "valign": "middle"
870
835
  },
871
836
  {
837
+ hiddenOn: "${app.showSidebar === true}",
872
838
  "columnClassName": "flex ",
873
839
  "body": [
874
840
  {
@@ -876,6 +842,7 @@
876
842
  "stacked": false,
877
843
  showIcon: false,
878
844
  "appId": "${app.id}",
845
+ hiddenOn: "${app.showSidebar === true}",
879
846
  overflow: {
880
847
  enable: false,
881
848
  itemWidth: 80,
@@ -895,17 +862,23 @@
895
862
  {
896
863
 
897
864
  "type": "button",
898
- "className": 'p-0 absolute inset-0 mt-[50px]',
865
+ "className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
899
866
  hiddenOn: "${app.showSidebar != true}",
900
867
  body: [{
901
868
  type: "wrapper",
902
869
  className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-slate-200 block -translate-x-0 sm:w-[220px] w-64',
903
870
  body: [
904
- {
905
- "type": "steedos-app-menu",
906
- "stacked": true,
907
- "appId": "${app.id}",
908
- },
871
+ {
872
+ "type": "steedos-app-launcher",
873
+ "className": "px-4 pb-4",
874
+ "visibleOn": "${isMobile}",
875
+ "showAppName": true
876
+ },
877
+ {
878
+ "type": "steedos-app-menu",
879
+ "stacked": true,
880
+ "appId": "${app.id}",
881
+ },
909
882
  ]
910
883
  }],
911
884
  "onEvent": {
@@ -5,7 +5,7 @@ defaultValue: amis
5
5
  options:
6
6
  - label: Amis
7
7
  value: amis
8
- - label: Redash
9
- value: redash
8
+ # - label: Redash
9
+ # value: redash
10
10
  required: true
11
11
  sort_no: 125
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "2.4.0-beta.14",
3
+ "version": "2.4.0-beta.16",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "gitHead": "47f3797a400790410c8f333a4dbb21c877642aa9",
11
+ "gitHead": "1a6e749338be48912c63f1019b39294267132e3b",
12
12
  "dependencies": {
13
13
  "ejs": "^3.1.8"
14
14
  }