@steedos-widgets/sortable 3.6.11-beta.5 → 3.6.11-beta.7

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.
@@ -24603,6 +24603,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
24603
24603
  }
24604
24604
 
24605
24605
  const onChangeScript = `
24606
+ // console.log("==search=onChangeScript===");
24606
24607
  const scope = event.context.scoped;
24607
24608
  let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
24608
24609
  // let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
@@ -24618,14 +24619,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
24618
24619
  }
24619
24620
  `;
24620
24621
 
24621
- // onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
24622
+ // 之前onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
24622
24623
  // 而点击回车按键又不会触发blur事件,所以只能每次回车事件中额外再执行一次onChangeScript
24623
24624
  // 等升级到amis 3.4+,blur事件换成change事件执行onChangeScript,就可以不用在onSearchScript中执行onChangeScript了
24625
+ // 基于amis3.6,已经不再用blur事件触发onChangeScript,所以这里把之前加上的onChangeScript去掉了,如果以后还要换blur来触发onChangeScript脚本的话,这里又要加回onChangeScript脚本
24624
24626
  const onSearchScript = `
24625
- ${onChangeScript}
24626
-
24627
24627
  // 下面的脚本只为解决点击搜索表单取消按钮,再重新在其中输入过滤条件但是不点击搜索按钮或回车按键触发搜索,此时在快速搜索框输入过滤条件按回车按键会把搜索表单中的过滤条件清空的问题
24628
- // const scope = event.context.scoped;
24628
+ const scope = event.context.scoped;
24629
24629
  // 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
24630
24630
  // 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
24631
24631
  let isLookup = event.data.isLookup;
@@ -24644,6 +24644,16 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
24644
24644
  }, 500);
24645
24645
  `;
24646
24646
 
24647
+ // const onBlurScript = `
24648
+ // // 失去焦点事件触发搜索,先去掉,因为会有bug,见:[Bug]: 列表上快速搜索输入框输入内容后点击放大镜界面上列表未显示过滤后的内容 #6742
24649
+ // const value = event.data.value;
24650
+ // setTimeout(function(){
24651
+ // const scope = event.context.scoped;
24652
+ // const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
24653
+ // sb.handleSearch(value);
24654
+ // }, 500);
24655
+ // `;
24656
+
24647
24657
  return {
24648
24658
  "type": "tooltip-wrapper",
24649
24659
  "id": "steedos_crud_toolbar_quick_search",
@@ -24661,7 +24671,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
24661
24671
  "name": keywordsSearchBoxName,
24662
24672
  "placeholder": "快捷搜索",
24663
24673
  "value": crudKeywords,
24664
- // "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
24674
+ "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
24665
24675
  "clearAndSubmit": true,
24666
24676
  "searchImediately": false,
24667
24677
  "onEvent": {
@@ -24673,14 +24683,22 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
24673
24683
  }
24674
24684
  ]
24675
24685
  },
24676
- "blur": { //这里把change事件换成blur是因为amis 3.2change事件中setData会卡,升级到3.4+后就可以换回change事件
24686
+ "change": { //amis 3.2change事件中setData会卡,升级到amis 3.4+应该不会再卡了,所以这里换回change事件,如果还是会卡就要考虑重新换成blur事件
24677
24687
  "actions": [
24678
24688
  {
24679
24689
  "actionType": "custom",
24680
24690
  "script": onChangeScript
24681
24691
  },
24682
24692
  ]
24683
- }
24693
+ },
24694
+ // "blur": {
24695
+ // "actions": [
24696
+ // {
24697
+ // "actionType": "custom",
24698
+ // "script": onBlurScript
24699
+ // },
24700
+ // ]
24701
+ // }
24684
24702
  }
24685
24703
  }
24686
24704
  ]
@@ -24705,59 +24723,64 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
24705
24723
  };
24706
24724
  }
24707
24725
  let toolbarReloadButton;
24708
- if(formFactor === 'SMALL'){
24709
- // const onReloadScript = `
24710
- // const scope = event.context.scoped;
24711
- // var listView = scope.parent.getComponents().find(function(n){
24712
- // return n.props.type === "crud";
24713
- // });
24714
- // listView.handleChangePage(1);
24715
- // `;
24716
- // toolbarReloadButton = {
24717
- // // "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页,这在加载更多按钮的翻页模式下会有问题
24718
- // "type": "button",
24719
- // "align": "right",
24720
- // //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
24721
- // // "tooltip": i18next.t('frontend_button_reload_tooltip'),
24722
- // "tooltipPlacement": "top",
24723
- // "className": "bg-white p-2 rounded text-gray-500",
24724
- // "label": "",
24725
- // "icon": "fa fa-sync",
24726
- // "visibleOn": "${!showFieldsFilter}",
24727
- // "onEvent": {
24728
- // "click": {
24729
- // "actions": [
24730
- // {
24731
- // "actionType": "custom",
24732
- // "script": onReloadScript
24733
- // }
24734
- // ]
24735
- // }
24736
- // },
24737
- // };
24738
-
24739
- // 后续如果换成加载更多按钮的翻页模式的话,不可以直接使用下面的reload,需要换成上面的自定义脚本模式
24740
- toolbarReloadButton = {
24741
- "type": "reload",
24742
- "align": "right",
24743
- //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
24744
- // "tooltip": i18next.t('frontend_button_reload_tooltip'),
24745
- "tooltip":"",
24746
- "tooltipPlacement": "top",
24747
- "className": "bg-white p-2 rounded text-gray-500"
24748
- };
24749
- }
24750
- else {
24751
- toolbarReloadButton = {
24752
- "type": "reload",
24753
- "align": "right",
24754
- //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
24755
- // "tooltip": i18next.t('frontend_button_reload_tooltip'),
24756
- "tooltip":"",
24757
- "tooltipPlacement": "top",
24758
- "className": "bg-white p-2 rounded text-gray-500"
24759
- };
24760
- }
24726
+ const onReloadScript = `
24727
+ // const scope = event.context.scoped;
24728
+ // var listView = scope.parent.getComponents().find(function(n){
24729
+ // return n.props.type === "crud";
24730
+ // });
24731
+ // listView.handleChangePage(1);
24732
+
24733
+
24734
+ // 触发搜索,而不是reload,因为使用search-box可以在amissdk是3.6.3-patch.8+实现快速搜索输入框中过滤条件变更时再点刷新可以自动跳转到第一页面
24735
+ const scope = event.context.scoped;
24736
+ const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
24737
+ sb.handleSearch();
24738
+ `;
24739
+ toolbarReloadButton = {
24740
+ // "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页,这在加载更多按钮的翻页模式下会有问题
24741
+ "type": "button",
24742
+ "align": "right",
24743
+ //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
24744
+ // "tooltip": i18next.t('frontend_button_reload_tooltip'),
24745
+ "tooltipPlacement": "top",
24746
+ "className": "bg-white p-2 rounded text-gray-500",
24747
+ "label": "",
24748
+ "icon": "fa fa-sync",
24749
+ // "visibleOn": "${!showFieldsFilter}",
24750
+ "onEvent": {
24751
+ "click": {
24752
+ "actions": [
24753
+ {
24754
+ "actionType": "custom",
24755
+ "script": onReloadScript
24756
+ }
24757
+ ]
24758
+ }
24759
+ },
24760
+ };
24761
+ // if(formFactor === 'SMALL'){
24762
+ // // 后续如果换成加载更多按钮的翻页模式的话,不可以直接使用下面的reload,需要换成上面的自定义脚本模式
24763
+ // toolbarReloadButton = {
24764
+ // "type": "reload",
24765
+ // "align": "right",
24766
+ // //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
24767
+ // // "tooltip": i18next.t('frontend_button_reload_tooltip'),
24768
+ // "tooltip":"",
24769
+ // "tooltipPlacement": "top",
24770
+ // "className": "bg-white p-2 rounded text-gray-500"
24771
+ // };
24772
+ // }
24773
+ // else{
24774
+ // toolbarReloadButton = {
24775
+ // "type": "reload",
24776
+ // "align": "right",
24777
+ // //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
24778
+ // // "tooltip": i18next.t('frontend_button_reload_tooltip'),
24779
+ // "tooltip":"",
24780
+ // "tooltipPlacement": "top",
24781
+ // "className": "bg-white p-2 rounded text-gray-500"
24782
+ // };
24783
+ // }
24761
24784
  let toolbarFilter;
24762
24785
  if(filterVisible){
24763
24786
  toolbarFilter ={
@@ -25888,6 +25911,11 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
25888
25911
  }
25889
25912
  }
25890
25913
 
25914
+ // amis@3.6.3和6.3.0如果不配置 trackExpression监听当前字段值变化,那么当前lookup字段(比如T)作为其它lookup字段(比如F)autoFill自动填充的目标字段的话,
25915
+ // F字段值变更后,虽然会自动填充值到T字段中,但是并不会触发T字段的source接口重新请求,这会造成T字段被填充后,可能会显示为字段id而不是label了,见issue:https://github.com/steedos/steedos-platform/issues/6601
25916
+ // amis@6.2.2不需要配置trackExpression不会有#6601所示问题,但是更高版本6.3.0也会有,所以这里只能加上trackExpression避开相关bug。
25917
+ source.trackExpression = `\${${field.name}}`;
25918
+
25891
25919
  source.data.$term = "$term";
25892
25920
  source.data.$self = "$$";
25893
25921
 
@@ -26966,7 +26994,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
26966
26994
  if(lodash.exports.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
26967
26995
  return;
26968
26996
  }
26969
- const baseData = {name: ctx.fieldNamePrefix ? `${ctx.fieldNamePrefix}${field.name}` : field.name, label: field.label, labelRemark: field.inlineHelpText, required: lodash.exports.has(ctx, 'required') ? ctx.required : field.required};
26997
+ const baseData = {name: ctx.fieldNamePrefix ? `${ctx.fieldNamePrefix}${field.name}` : field.name, label: field.label, labelRemark: field.inlineHelpText, description: field.description, required: lodash.exports.has(ctx, 'required') ? ctx.required : field.required};
26970
26998
  let convertData = {
26971
26999
  };
26972
27000
  // if(_.includes(OMIT_FIELDS, field.name)){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-widgets/sortable",
3
- "version": "3.6.11-beta.5",
3
+ "version": "3.6.11-beta.7",
4
4
  "main": "dist/sortable.cjs.js",
5
5
  "module": "dist/sortable.esm.js",
6
6
  "unpkg": "dist/sortable.umd.js",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@dnd-kit/core": "^6.0.5",
47
47
  "@dnd-kit/sortable": "^7.0.1",
48
- "@steedos-widgets/amis-lib": "3.6.11-beta.5"
48
+ "@steedos-widgets/amis-lib": "3.6.11-beta.7"
49
49
  },
50
- "gitHead": "135e8529c5e31029d866d59a1cc1c4d78c35d721"
50
+ "gitHead": "46c5199ed3fa9d1dc9ba82dfcfcad56e1638639e"
51
51
  }