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