@steedos-widgets/amis-lib 3.6.6 → 3.6.7-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/dist/index.esm.js CHANGED
@@ -689,7 +689,7 @@ function getSwitchTpl(field){
689
689
 
690
690
  function getPasswordTpl(field){
691
691
  return `<% if (data.${field.name}) { %>
692
- <span>······</span>
692
+ <span>******</span>
693
693
  <% } %>`
694
694
  }
695
695
 
@@ -2744,14 +2744,14 @@ async function getTableSchema$1(object, fields, options){
2744
2744
  headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
2745
2745
  className: "",
2746
2746
  draggable: false,
2747
- defaultParams: getDefaultParams$1(options),
2748
2747
  card: card,
2749
2748
  syncLocation: false,
2750
2749
  keepItemSelectionOnPageChange: true,
2751
2750
  checkOnItemClick: isLookup ? true : false,
2752
2751
  labelTpl: `\${${options.labelFieldName}}`,
2753
2752
  autoFillHeight: false, // 自动高度效果不理想,先关闭
2754
- columnsTogglable: false
2753
+ columnsTogglable: false,
2754
+ ...getDefaultParams$1(options) //不可以使用crud的defaultParams属性,会造成翻页bug,https://github.com/steedos/steedos-platform/issues/6576
2755
2755
  }
2756
2756
  }
2757
2757
 
@@ -2777,7 +2777,6 @@ async function getTableSchema$1(object, fields, options){
2777
2777
  headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
2778
2778
  className: "",
2779
2779
  draggable: false,
2780
- defaultParams: getDefaultParams$1(options),
2781
2780
  columns: columns,
2782
2781
  syncLocation: false,
2783
2782
  keepItemSelectionOnPageChange: true,
@@ -2785,7 +2784,8 @@ async function getTableSchema$1(object, fields, options){
2785
2784
  labelTpl: `\${${options.labelFieldName}}`,
2786
2785
  autoFillHeight: false, // 自动高度效果不理想,先关闭
2787
2786
  columnsTogglable: false,
2788
- ...treeConfig
2787
+ ...treeConfig,
2788
+ ...getDefaultParams$1(options) //不可以使用crud的defaultParams属性,会造成翻页bug,https://github.com/steedos/steedos-platform/issues/6576
2789
2789
  }
2790
2790
  }
2791
2791
 
@@ -4388,7 +4388,6 @@ async function getListSchema$1(fields, options){
4388
4388
  name: "thelist",
4389
4389
  draggable: false,
4390
4390
  headerToolbar: ['reload'],
4391
- defaultParams: getDefaultParams(options),
4392
4391
  syncLocation: false,
4393
4392
  keepItemSelectionOnPageChange: true,
4394
4393
  checkOnItemClick: false,
@@ -4410,7 +4409,8 @@ async function getListSchema$1(fields, options){
4410
4409
  })
4411
4410
  }
4412
4411
  ]
4413
- }
4412
+ },
4413
+ ...getDefaultParams(options) //不可以使用crud的defaultParams属性,会造成翻页bug,https://github.com/steedos/steedos-platform/issues/6576
4414
4414
  }
4415
4415
  }
4416
4416
 
@@ -4431,7 +4431,6 @@ async function getCardSchema(fields, options){
4431
4431
  name: "cards",
4432
4432
  draggable: false,
4433
4433
  headerToolbar: ['statistics', 'pagination'],
4434
- defaultParams: getDefaultParams(options),
4435
4434
  syncLocation: false,
4436
4435
  keepItemSelectionOnPageChange: false,
4437
4436
  checkOnItemClick: false,
@@ -4442,7 +4441,8 @@ async function getCardSchema(fields, options){
4442
4441
  "title": title
4443
4442
  },
4444
4443
  "body": [...listBody.columns]
4445
- }
4444
+ },
4445
+ ...getDefaultParams(options)
4446
4446
  }
4447
4447
  }
4448
4448
 
@@ -9993,9 +9993,7 @@ async function getListSchema(
9993
9993
  }
9994
9994
 
9995
9995
  if(localListViewProps.perPage){
9996
- listSchema.defaultParams = {
9997
- perPage: localListViewProps.perPage
9998
- };
9996
+ listSchema.perPage = localListViewProps.perPage;
9999
9997
  }
10000
9998
  defaults.listSchema = defaultsDeep$1({}, listSchema, defaults.listSchema || {});
10001
9999
  }
@@ -11316,6 +11314,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
11316
11314
 
11317
11315
  var fieldFilters = ${JSON.stringify(field.filters)};
11318
11316
  if(fieldFilters && fieldFilters.length){
11317
+ var filtersForString = JSON.stringify(fieldFilters);
11318
+ if(filtersForString.indexOf('$') > -1) {
11319
+ var currentAmis = amisRequire('amis');
11320
+ fieldFilters = JSON.parse(currentAmis.evaluate(filtersForString, api.data.$self.__super))
11321
+ }
11319
11322
  filters.push(fieldFilters);
11320
11323
  }
11321
11324
 
@@ -11716,6 +11719,11 @@ async function lookupToAmisSelect(field, readonly, ctx){
11716
11719
 
11717
11720
  var fieldFilters = ${JSON.stringify(field.filters)};
11718
11721
  if(fieldFilters && fieldFilters.length){
11722
+ var filtersForString = JSON.stringify(fieldFilters);
11723
+ if(filtersForString.indexOf('$') > -1) {
11724
+ var currentAmis = amisRequire('amis');
11725
+ fieldFilters = JSON.parse(currentAmis.evaluate(filtersForString, api.data.$))
11726
+ }
11719
11727
  filters.push(fieldFilters);
11720
11728
  }
11721
11729
 
@@ -14917,7 +14925,8 @@ const getAmisInputTableSchema = async (props) => {
14917
14925
  }
14918
14926
  }
14919
14927
  return value;
14920
- }
14928
+ },
14929
+ "required": props.required
14921
14930
  };
14922
14931
  if (buttonsForColumnOperations.length) {
14923
14932
  inputTableSchema.columns.unshift({
@@ -15012,7 +15021,8 @@ const getAmisInputTableSchema = async (props) => {
15012
15021
  "visible": props.$schema.visible,
15013
15022
  "hiddenOn": props.$schema.hiddenOn,
15014
15023
  "hidden": props.$schema.hidden,
15015
- className
15024
+ "required": props.required,
15025
+ className,
15016
15026
  };
15017
15027
  // console.log("===schema===", schema);
15018
15028
  return schema;
@@ -15314,9 +15324,7 @@ async function getSpaceUsersPickerAmisSchema(spaceUserSchema, name, options) {
15314
15324
  "switch-per-page",
15315
15325
  "pagination"
15316
15326
  ],
15317
- "defaultParams": {
15318
- "perPage": 50
15319
- },
15327
+ "perPage": 50,
15320
15328
  "columns": [
15321
15329
  {
15322
15330
  "name": "_index",