@steedos-widgets/amis-lib 1.3.12 → 1.3.14

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
@@ -609,6 +609,8 @@ function getSaveDataTpl(fields){
609
609
  delete formData.editFormInited;
610
610
  delete formData.isLookup;
611
611
  delete formData.selectedRowResponseResult;
612
+ delete formData.instance_state;
613
+ delete formData.instances;
612
614
  ${getScriptForReadonlyFields(fields)}
613
615
  ${getScriptForRemoveUrlPrefixForImgFields(fields)}
614
616
  ${getScriptForSimplifiedValueForFileFields(fields)}
@@ -775,6 +777,7 @@ var frontend_record_detail_tab_detailed$1 = "Details";
775
777
  var frontend_record_detail_tab_related$1 = "Related";
776
778
  var frontend_all_apps$1 = "All apps";
777
779
  var frontend_all_projects$1 = "All projects";
780
+ var frontend_open_app_launcher$1 = "Open App Launcher";
778
781
  var frontend_application_launcher$1 = "Application launcher";
779
782
  var frontend_menu$1 = "Menu";
780
783
  var frontend_help$1 = "Help";
@@ -860,6 +863,7 @@ var en_us = {
860
863
  frontend_record_detail_tab_related: frontend_record_detail_tab_related$1,
861
864
  frontend_all_apps: frontend_all_apps$1,
862
865
  frontend_all_projects: frontend_all_projects$1,
866
+ frontend_open_app_launcher: frontend_open_app_launcher$1,
863
867
  frontend_application_launcher: frontend_application_launcher$1,
864
868
  frontend_menu: frontend_menu$1,
865
869
  frontend_help: frontend_help$1,
@@ -947,6 +951,7 @@ var frontend_record_detail_tab_detailed = "详细";
947
951
  var frontend_record_detail_tab_related = "相关";
948
952
  var frontend_all_apps = "所有应用";
949
953
  var frontend_all_projects = "所有项目";
954
+ var frontend_open_app_launcher = "打开应用程序启动器";
950
955
  var frontend_application_launcher = "应用程序启动器";
951
956
  var frontend_menu = "菜单";
952
957
  var frontend_help = "帮助";
@@ -1033,6 +1038,7 @@ var zh_cn = {
1033
1038
  frontend_record_detail_tab_related: frontend_record_detail_tab_related,
1034
1039
  frontend_all_apps: frontend_all_apps,
1035
1040
  frontend_all_projects: frontend_all_projects,
1041
+ frontend_open_app_launcher: frontend_open_app_launcher,
1036
1042
  frontend_application_launcher: frontend_application_launcher,
1037
1043
  frontend_menu: frontend_menu,
1038
1044
  frontend_help: frontend_help,
@@ -5020,7 +5026,30 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
5020
5026
  "value": crudKeywords,
5021
5027
  "clearable": true,
5022
5028
  "clearAndSubmit": true,
5023
- "searchImediately": false
5029
+ "searchImediately": false,
5030
+ "onEvent": {
5031
+ "blur": {
5032
+ "actions": [
5033
+ {
5034
+ "actionType": "custom",
5035
+ "script": `
5036
+ try {
5037
+ const scope = event.context.scoped;
5038
+ const filterCrud = scope.parent.getComponents().find(function(n) {
5039
+ return n.props.type === "crud";
5040
+ });
5041
+ if (filterCrud && typeof filterCrud.reload === 'function') {
5042
+ const keyWords = { '${keywordsSearchBoxName}': event.data.value };
5043
+ filterCrud.reload(null, keyWords);
5044
+ }
5045
+ } catch (error) {
5046
+ console.error('An error occurred:', error);
5047
+ }
5048
+ `
5049
+ }
5050
+ ]
5051
+ }
5052
+ }
5024
5053
  }
5025
5054
  ]
5026
5055
  }
@@ -6615,8 +6644,8 @@ function getAmisStaticFieldType(type, readonly, options){
6615
6644
  /*
6616
6645
  * @Author: baozhoutao@steedos.com
6617
6646
  * @Date: 2022-10-28 14:15:09
6618
- * @LastEditors: liaodaxue
6619
- * @LastEditTime: 2023-10-30 17:51:54
6647
+ * @LastEditors: 孙浩林 sunhaolin@steedos.com
6648
+ * @LastEditTime: 2023-11-24 13:45:24
6620
6649
  * @Description:
6621
6650
  */
6622
6651
 
@@ -6653,7 +6682,7 @@ const getAmisFileReadonlySchema = (steedosField)=>{
6653
6682
  <% let fileData = data._display.${steedosField.name}; if (fileData) { %>
6654
6683
  <% if(!Array.isArray(fileData)){ fileData = [fileData]} %>
6655
6684
  <% fileData.forEach(function(item) { %>
6656
- <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
6685
+ <a href='<%= item.url+"?download=1" %>' target='_self' class='block'><%= item.name %></a>
6657
6686
  <% });} %>`
6658
6687
  }
6659
6688
  }
@@ -7495,9 +7524,38 @@ async function getFieldSearchable(perField, permissionFields, ctx){
7495
7524
 
7496
7525
  const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
7497
7526
  if(amisField){
7498
- return Object.assign({}, amisField,{
7499
- submitOnChange: true
7500
- });
7527
+ const changeActionsFields = ['select', 'boolean', 'toggle', 'date', 'datetime', 'time', 'number', 'currency', 'lookup', 'master_detail'];
7528
+ const isChangeActions = changeActionsFields.indexOf(field.type) > -1;
7529
+ let additionalProps = {
7530
+ submitOnChange: false
7531
+ };
7532
+ if (isChangeActions) {
7533
+ additionalProps.submitOnChange = true;
7534
+ } else {
7535
+ additionalProps.onEvent = {
7536
+ blur: {
7537
+ actions: [
7538
+ {
7539
+ actionType: "custom",
7540
+ script: `
7541
+ try {
7542
+ const scope = event.context.scoped;
7543
+ const filterForm = scope.parent.parent.parent.getComponents().find(function(n) {
7544
+ return n.props.type === "form";
7545
+ });
7546
+ if (filterForm && typeof filterForm.handleFormSubmit === 'function') {
7547
+ filterForm.handleFormSubmit(event);
7548
+ }
7549
+ } catch (error) {
7550
+ console.error('An error occurred:', error);
7551
+ }
7552
+ `
7553
+ }
7554
+ ]
7555
+ }
7556
+ };
7557
+ }
7558
+ return Object.assign({}, amisField, additionalProps);
7501
7559
  }
7502
7560
  }
7503
7561
  }
@@ -11798,6 +11856,7 @@ async function getTableApi(mainObject, fields, options){
11798
11856
  if(options.isRelated){
11799
11857
  api.url += "&recordId=${_master.recordId}";
11800
11858
  }
11859
+ api.cache = 3000;
11801
11860
 
11802
11861
  api.data.$term = "$term";
11803
11862
  api.data.term = "$term";