@steedos-widgets/sortable 3.6.14 → 6.3.0-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/dist/assets.json CHANGED
@@ -3,8 +3,8 @@
3
3
  {
4
4
  "package": "@steedos-widgets/sortable",
5
5
  "urls": [
6
- "https://unpkg.com/@steedos-widgets/sortable@3.6.14/dist/sortable.umd.js",
7
- "https://unpkg.com/@steedos-widgets/sortable@3.6.14/dist/sortable.umd.css"
6
+ "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/sortable.umd.js",
7
+ "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/sortable.umd.css"
8
8
  ],
9
9
  "library": "BuilderSortable"
10
10
  }
@@ -15,10 +15,10 @@
15
15
  "npm": {
16
16
  "package": "@steedos-widgets/sortable"
17
17
  },
18
- "url": "https://unpkg.com/@steedos-widgets/sortable@3.6.14/dist/meta.js",
18
+ "url": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/meta.js",
19
19
  "urls": {
20
- "default": "https://unpkg.com/@steedos-widgets/sortable@3.6.14/dist/meta.js",
21
- "design": "https://unpkg.com/@steedos-widgets/sortable@3.6.14/dist/meta.js"
20
+ "default": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/meta.js",
21
+ "design": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/meta.js"
22
22
  }
23
23
  }
24
24
  ]
@@ -54145,10 +54145,23 @@ function getNameTpl(field, ctx){
54145
54145
  if(ctx && ctx.isLookup){
54146
54146
  linkTarget = "target='_blank'";
54147
54147
  }
54148
+ let nameLabel = field.name;
54149
+ //若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
54150
+ if (field.type == "lookup") {
54151
+ if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
54152
+ if(!field.isTableField){
54153
+ nameLabel = `\${${field.name}__label}`;
54154
+ }
54155
+ } else {
54156
+ nameLabel = `\${_display.${field.name}.label}`;
54157
+ }
54158
+ } else {
54159
+ nameLabel = `\${_display.${field.name} || ${field.name}}`;
54160
+ }
54148
54161
  if(ctx.isRelated && window.innerWidth >= 768){
54149
- return `<a href="${href}" ${linkTarget} onclick="return false;">\${${field.name} | raw}</a>`
54162
+ return `<a href="${href}" ${linkTarget} onclick="return false;">\${${nameLabel} | raw}</a>`
54150
54163
  }else {
54151
- return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
54164
+ return `<a href="${href}" ${linkTarget}>\${${nameLabel} | raw}</a>`
54152
54165
  }
54153
54166
  }
54154
54167
 
@@ -54273,7 +54286,7 @@ function getLocationTpl(field){
54273
54286
  }
54274
54287
 
54275
54288
  async function getFieldTpl (field, options){
54276
- if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel){
54289
+ if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel && field.multiple !== true){
54277
54290
  return getNameTpl(field, options)
54278
54291
  }
54279
54292
  switch (field.type) {
@@ -55662,7 +55675,7 @@ async function getTableColumns(object, fields, options){
55662
55675
  "title": "&nbsp;",
55663
55676
  "headerClassName": "hidden",
55664
55677
  "size": "lg",
55665
- "bodyClassName": "p-0 m-0",
55678
+ "bodyClassName": "p-0 m-0 bg-gray-100",
55666
55679
  "closeOnEsc": true,
55667
55680
  "closeOnOutside": true,
55668
55681
  "resizable": true,
@@ -56524,7 +56537,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
56524
56537
  type: 'button',
56525
56538
  actionType: 'confirm',
56526
56539
  label: instance.t('frontend_form_save'),
56527
- primary: true
56540
+ primary: true,
56541
+ close: `object_actions_drawer_${uiSchema.name}`
56528
56542
  },
56529
56543
  ]
56530
56544
  }
@@ -58742,7 +58756,7 @@ async function getObjectFilter(objectSchema, fields, options) {
58742
58756
  * @Author: baozhoutao@steedos.com
58743
58757
  * @Date: 2022-07-05 15:55:39
58744
58758
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
58745
- * @LastEditTime: 2024-02-23 16:37:06
58759
+ * @LastEditTime: 2024-04-26 16:46:44
58746
58760
  * @Description:
58747
58761
  */
58748
58762
 
@@ -58975,37 +58989,44 @@ async function getListSchema(
58975
58989
  * 本次存储代码段
58976
58990
  */
58977
58991
  try {
58978
- const listViewPropsStoreKey = location.pathname + "/crud";
58979
- let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
58980
- /**
58981
- * localListViewProps规范来自crud请求api中api.data.$self参数值的。
58982
- * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
58983
- * __searchable__...:顶部放大镜搜索条件
58984
- * filter:右侧过滤器
58985
- * perPage:每页条数
58986
- * page:当前页码
58987
- * orderBy:排序字段
58988
- * orderDir:排序方向
58989
- */
58990
- if (localListViewProps) {
58991
- localListViewProps = JSON.parse(localListViewProps);
58992
- // localListViewProps.perPage = 3;
58993
- let listSchema = {};
58994
- if(localListViewProps.orderBy){
58995
- listSchema.orderBy = localListViewProps.orderBy;
58996
- }
58997
- if(localListViewProps.orderDir){
58998
- listSchema.orderDir = localListViewProps.orderDir;
58999
- }
58992
+ const listViewPropsStoreKey = location.pathname + "/crud";
58993
+ let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
58994
+ /**
58995
+ * localListViewProps规范来自crud请求api中api.data.$self参数值的。
58996
+ * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
58997
+ * __searchable__...:顶部放大镜搜索条件
58998
+ * filter:右侧过滤器
58999
+ * perPage:每页条数
59000
+ * page:当前页码
59001
+ * orderBy:排序字段
59002
+ * orderDir:排序方向
59003
+ */
59004
+ if (localListViewProps) {
59005
+ localListViewProps = JSON.parse(localListViewProps);
59006
+ // localListViewProps.perPage = 3;
59007
+ let listSchema = {};
59008
+ if (localListViewProps.orderBy) {
59009
+ listSchema.orderBy = localListViewProps.orderBy;
59010
+ }
59011
+ if (localListViewProps.orderDir) {
59012
+ listSchema.orderDir = localListViewProps.orderDir;
59013
+ }
59000
59014
 
59001
- if(localListViewProps.perPage){
59002
- listSchema.perPage = localListViewProps.perPage;
59015
+ if (localListViewProps.perPage) {
59016
+ listSchema.perPage = localListViewProps.perPage;
59017
+ }
59018
+ defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
59003
59019
  }
59004
- defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
59005
- }
59006
59020
  }
59007
59021
  catch (ex) {
59008
- console.error("本地存储中crud参数解析异常:", ex);
59022
+ console.error("本地存储中crud参数解析异常:", ex);
59023
+ }
59024
+
59025
+ if (window.innerWidth > 768) {
59026
+ // 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight,且允许重写微页面中重新组件autoFillHeight属性
59027
+ defaults.listSchema = lodash.exports.defaultsDeep({}, defaults.listSchema || {}, {
59028
+ autoFillHeight: true
59029
+ });
59009
59030
  }
59010
59031
 
59011
59032
  ctx.defaults = defaults;
@@ -59566,7 +59587,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
59566
59587
  });
59567
59588
 
59568
59589
  // 把自动填充规则中依赖的字段也加到api请求中
59569
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
59590
+ let autoFillMapping = field.auto_fill_mapping;
59570
59591
  if (autoFillMapping && autoFillMapping.length) {
59571
59592
  autoFillMapping.forEach(function (item) {
59572
59593
  if(!lodash.exports.find(tableFields, function(f){
@@ -59716,7 +59737,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
59716
59737
  // 如果当前元素不是数组,则处理该元素
59717
59738
  // 下面正则用于匹配amis公式\${}
59718
59739
  if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
59719
- arr[i] = currentAmis.evaluate(arr[i], api.data.$);
59740
+ arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
59720
59741
  }
59721
59742
  }
59722
59743
  }
@@ -60038,7 +60059,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
60038
60059
  ];
60039
60060
 
60040
60061
  // 把自动填充规则中依赖的字段也加到api请求中
60041
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
60062
+ let autoFillMapping = field.auto_fill_mapping;
60042
60063
  if (autoFillMapping && autoFillMapping.length) {
60043
60064
  autoFillMapping.forEach(function (item) {
60044
60065
  queryFields.push(refObjectConfig.fields[item.from]);
@@ -60133,7 +60154,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
60133
60154
  // 如果当前元素不是数组,则处理该元素
60134
60155
  // 下面正则用于匹配amis公式\${}
60135
60156
  if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
60136
- arr[i] = currentAmis.evaluate(arr[i], api.data.$);
60157
+ arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
60137
60158
  }
60138
60159
  }
60139
60160
  }
@@ -60280,14 +60301,25 @@ async function getApi(object, recordId, fields, options){
60280
60301
  }
60281
60302
 
60282
60303
  async function getAutoFill(field, refObject) {
60283
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
60304
+ let autoFillMapping = field.auto_fill_mapping;
60284
60305
  if (autoFillMapping && autoFillMapping.length) {
60285
60306
  let fillMapping = {};
60307
+ if (field.multiple) {
60308
+ autoFillMapping.forEach(function (item) {
60309
+ //from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
60310
+ if (lodash.exports.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
60311
+ fillMapping[item.to] = `\${items | pick:${item.from}}`;
60312
+ } else {
60313
+ fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
60314
+ }
60315
+ });
60316
+ }else {
60317
+ autoFillMapping.forEach(function (item) {
60318
+ fillMapping[item.to] = `\${${item.from}}`;
60319
+ });
60320
+ }
60286
60321
  // let fieldsForApi = [];
60287
- autoFillMapping.forEach(function (item) {
60288
- fillMapping[item.to] = `\${${item.from}}`;
60289
- // fieldsForApi.push(item.from);
60290
- });
60322
+ // fieldsForApi.push(item.from);
60291
60323
  // let api = {
60292
60324
  // // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
60293
60325
  // "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
@@ -60389,7 +60421,7 @@ async function lookupToAmis(field, readonly, ctx){
60389
60421
  amisSchema = lodash.exports.defaultsDeep({}, pageAmisSchema, amisSchema);
60390
60422
  }
60391
60423
  }
60392
- const autoFill = await getAutoFill(field);
60424
+ const autoFill = await getAutoFill(field, refObject);
60393
60425
  if(autoFill){
60394
60426
  amisSchema.autoFill = autoFill;
60395
60427
  // 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本