@steedos-widgets/amis-lib 1.1.7 → 1.1.8

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/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('lodash/isPlainObject'), require('@steedos-widgets/amis-lib')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'lodash/isPlainObject', '@steedos-widgets/amis-lib'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["amis-lib"] = {}, global._$1, global.isPlainObject, global.amisLib));
5
- })(this, (function (exports, _$1, isPlainObject, amisLib) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('@steedos-widgets/amis-lib'), require('lodash/isPlainObject')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash', '@steedos-widgets/amis-lib', 'lodash/isPlainObject'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["amis-lib"] = {}, global._$1, global.amisLib, global.isPlainObject));
5
+ })(this, (function (exports, _$1, amisLib, isPlainObject) {
6
6
  const global = window;
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -3316,17 +3316,22 @@
3316
3316
  async function getObjectRelatedListHeader(objectSchema, recordId, relatedObjectName) {
3317
3317
  }
3318
3318
 
3319
- const getDisplayAsButton = function(showDisplayAs){
3319
+ const getDisplayAsButton = function(objectName, showDisplayAs){
3320
+ let displayAs = amisLib.Router.getTabDisplayAs(objectName);
3320
3321
  let buttons = [
3321
3322
  {
3322
3323
  "type": "button",
3323
3324
  "label": "表格",
3324
- "onClick": "const url = document.location.pathname + '?display=grid'; props.env.jumpTo(url);"
3325
+ "onClick": "let url = document.location.pathname; var urlSearch = new URLSearchParams(document.location.search); if(urlSearch.get(\"side_object\") && urlSearch.get(\"side_listview_id\")){url=`/app/${props.data.appId}/${urlSearch.get(\"side_object\")}/grid/${urlSearch.get(\"side_listview_id\")}`;}; props.env.jumpTo(url + '?display=grid');",
3326
+ "rightIcon": displayAs != 'split' ? "fa fa-check" : null,
3327
+ "rightIconClassName": "m-l-sm"
3325
3328
  },
3326
3329
  {
3327
3330
  "type": "button",
3328
3331
  "label": "分栏视图",
3329
- "onClick": "const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);"
3332
+ "onClick": "const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);",
3333
+ "rightIcon": displayAs === 'split' ? "fa fa-check" : null,
3334
+ "rightIconClassName": "m-l-sm"
3330
3335
  }
3331
3336
  ];
3332
3337
  return {
@@ -3468,7 +3473,7 @@ setTimeout(()=>{
3468
3473
  }
3469
3474
  }
3470
3475
  },
3471
- showDisplayAs? getDisplayAsButton() : {}
3476
+ showDisplayAs? getDisplayAsButton(mainObject?.name) : {}
3472
3477
  ]
3473
3478
  }else {
3474
3479
  return [
@@ -3549,7 +3554,7 @@ setTimeout(()=>{
3549
3554
  }
3550
3555
  }
3551
3556
  },
3552
- showDisplayAs? getDisplayAsButton() : {}
3557
+ showDisplayAs? getDisplayAsButton(showDisplayAs) : {}
3553
3558
  // {
3554
3559
  // "type": "search-box",
3555
3560
  // "align": "right",
@@ -5791,7 +5796,7 @@ setTimeout(()=>{
5791
5796
  keepItemSelectionOnPageChange: true,
5792
5797
  api: await getTableApi(objectSchema, fields, options),
5793
5798
  hiddenOn: options.tableHiddenOn,
5794
- autoFillHeight: true,
5799
+ autoFillHeight: options.isRelated ? false : true,
5795
5800
  className: `flex-auto ${crudClassName || ""}`,
5796
5801
  crudClassName: crudClassName,
5797
5802
  },
@@ -5951,6 +5956,10 @@ setTimeout(()=>{
5951
5956
  "objectName": "${_master.objectName}"
5952
5957
  },
5953
5958
  "expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
5959
+ },
5960
+ {
5961
+ "args": {},
5962
+ "actionType": "closeDialog"
5954
5963
  }
5955
5964
  ]
5956
5965
  }