@steedos-widgets/sortable 1.3.21 → 1.3.22-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.
@@ -55101,21 +55101,21 @@ async function getQuickEditSchema(field, options){
55101
55101
  break;
55102
55102
  case "avatar":
55103
55103
  case "image":
55104
- quickEditSchema.body[0].receiver.adaptor = `
55105
- const { context } = api.body;
55106
- var rootUrl = context.rootUrl + "/api/files/${field.type}s/";
55107
- payload = {
55108
- status: response.status == 200 ? 0 : response.status,
55109
- msg: response.statusText,
55110
- data: {
55111
- value: rootUrl + payload._id,//为了实现图片crud的回显,需要将value从id改为url,当保存数据数据时,再在发送适配器内重新将id提取出来
55112
- name: payload.original.name,
55113
- url: rootUrl + payload._id,
55104
+ quickEditSchema.body[0].receiver.adaptor = `
55105
+ const { context } = api.body;
55106
+ var rootUrl = context.rootUrl + "/api/files/${field.type}s/";
55107
+ payload = {
55108
+ status: response.status == 200 ? 0 : response.status,
55109
+ msg: response.statusText,
55110
+ data: {
55111
+ value: rootUrl + payload._id,//为了实现图片crud的回显,需要将value从id改为url,当保存数据数据时,再在发送适配器内重新将id提取出来
55112
+ name: payload.original.name,
55113
+ url: rootUrl + payload._id,
55114
+ }
55114
55115
  }
55115
- }
55116
- return payload;
55117
- `;
55118
- break;
55116
+ return payload;
55117
+ `;
55118
+ break;
55119
55119
  }
55120
55120
  quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
55121
55121
  quickEditSchema.body.push({
@@ -55322,6 +55322,11 @@ async function getQuickEditSchema(field, options){
55322
55322
  if(field.type == "location"){
55323
55323
  quickEditSchema = false;
55324
55324
  }
55325
+ if(field.type == "color"){
55326
+ quickEditSchema = {
55327
+ type: "input-color"
55328
+ };
55329
+ }
55325
55330
  }
55326
55331
  return quickEditSchema;
55327
55332
  }
@@ -58172,7 +58177,8 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
58172
58177
  {
58173
58178
  "type": "pagination",
58174
58179
  "maxButtons": 5,
58175
- "showPageInput": false
58180
+ "showPageInput": true,
58181
+ "layout": "total,pager,go"
58176
58182
  }
58177
58183
  ]
58178
58184
  }
@@ -59932,6 +59938,19 @@ function getGridFieldSubFields(mainField, fields){
59932
59938
  return newMainField;
59933
59939
  }
59934
59940
 
59941
+ function getTabledFieldSubFields(mainField, fields){
59942
+ const newMainField = Object.assign({subFields: []}, mainField);
59943
+ const subFields = lodash.exports.filter(fields, function(field){
59944
+ let result = field.name.startsWith(`${mainField.name}.`);
59945
+ if(result){
59946
+ field._prefix = `${mainField.name}.`;
59947
+ }
59948
+ return result;
59949
+ });
59950
+ newMainField.subFields = subFields;
59951
+ return newMainField;
59952
+ }
59953
+
59935
59954
 
59936
59955
  function getSelectFieldOptions(field){
59937
59956
  const dataType = field.data_type || 'text';
@@ -60037,6 +60056,13 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60037
60056
  };
60038
60057
  if(readonly){
60039
60058
  convertData.defaultColor = null;
60059
+ }else {
60060
+ convertData.pipeIn = (value, data) => {
60061
+ if(value && value.indexOf('#')<0){
60062
+ return '#'+value;
60063
+ }
60064
+ return value;
60065
+ };
60040
60066
  }
60041
60067
  break;
60042
60068
  case 'boolean':
@@ -60053,7 +60079,16 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60053
60079
  format:'YYYY-MM-DDT00:00:00.000[Z]',
60054
60080
  tpl: readonly ? getDateTpl(field) : null,
60055
60081
  // utc: true,
60056
- joinValues: false
60082
+ joinValues: false,
60083
+ "shortcuts": [
60084
+ "thismonth",
60085
+ "2monthsago",
60086
+ "3monthslater",
60087
+ "prevquarter",
60088
+ "thisquarter",
60089
+ "thisyear",
60090
+ "lastYear"
60091
+ ]
60057
60092
  };
60058
60093
  break;
60059
60094
  case 'date':
@@ -60464,6 +60499,8 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60464
60499
  let subFieldName = subField.name.replace(`${field.name}.$.`, '').replace(`${field.name}.`, '');
60465
60500
  if(subField.type === 'grid'){
60466
60501
  subField = await getGridFieldSubFields(subField, ctx.__formFields);
60502
+ }else if(subField.type === 'table'){
60503
+ subField = await getTabledFieldSubFields(subField, ctx.__formFields);
60467
60504
  }else {
60468
60505
  if(readonly){
60469
60506
  subFieldName = `${field.name}.${subFieldName}`;
@@ -60580,7 +60617,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
60580
60617
  fieldNamePrefix = `${fieldNamePrefix}between__`;
60581
60618
  }
60582
60619
  if(_field.type === 'datetime'){
60583
- _field.type = 'input-datetime-range';
60620
+ // 特意改为日期范围而不是日期时间范围,因为搜索时一般精确到日期就足够了,需要精确到日期时间范围需要在字段上配置amis属性来实现
60621
+ _field.type = 'input-date-range';
60584
60622
  _field.is_wide = true;
60585
60623
  fieldNamePrefix = `${fieldNamePrefix}between__`;
60586
60624
  }