@steedos-widgets/sortable 1.3.4-beta.10 → 1.3.4-beta.12

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.
@@ -54076,7 +54076,7 @@ function getSelectMap(selectOptions){
54076
54076
  if(optionColor){
54077
54077
  const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
54078
54078
  const color = getContrastColor(background);
54079
- const optionColorStyle = 'background:'+background+';color:'+color;
54079
+ const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
54080
54080
  map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
54081
54081
  }else {
54082
54082
  map[optionValue] = option.label;
@@ -54337,17 +54337,17 @@ async function getFindQuery(object, recordId, fields, options){
54337
54337
  }
54338
54338
 
54339
54339
  const countQuery = options.count === false ? "" : `,count:${object.name}__count(filters:{__filters})`;
54340
- const moreQuerie = options.moreQueries?.length ? ("," + options.moreQueries.map(function(item){
54341
- // 把最外层的{}去除
54342
- return item.replace(/^{/,"").replace(/}$/,"");
54343
- }).join(",")) : "";
54340
+ // const moreQuerie = options.moreQueries?.length ? ("," + options.moreQueries.map(function(item){
54341
+ // // 把最外层的{}去除
54342
+ // return item.replace(/^{/,"").replace(/}$/,"");
54343
+ // }).join(",")) : "";
54344
54344
 
54345
54345
  return {
54346
54346
  orderBy: "${orderBy}",
54347
54347
  orderDir: "${orderDir}",
54348
54348
  pageNo: "${page}",
54349
54349
  pageSize: "${perPage}",
54350
- query: `{${alias}:${object.name}${queryOptions}{${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}}${countQuery}${moreQuerie}}`
54350
+ query: `{${alias}:${object.name}${queryOptions}{${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}}${countQuery}}`
54351
54351
  }
54352
54352
  }
54353
54353
 
@@ -56827,6 +56827,7 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
56827
56827
  ]
56828
56828
  }else {
56829
56829
  return [
56830
+ "statistics",
56830
56831
  {
56831
56832
  "type": "pagination",
56832
56833
  "maxButtons": 5
@@ -57618,10 +57619,10 @@ async function lookupToAmisSelect(field, readonly, ctx){
57618
57619
  // const labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';
57619
57620
 
57620
57621
  let apiInfo;
57621
-
57622
+ let defaultValueOptionsQueryData;
57622
57623
  if(referenceTo){
57623
57624
  // 字段值单独走一个请求合并到source的同一个GraphQL接口中
57624
- const defaultValueOptionsQueryData = await getFindQuery({ name: referenceTo.objectName }, null, [
57625
+ defaultValueOptionsQueryData = await getFindQuery({ name: referenceTo.objectName }, null, [
57625
57626
  Object.assign({}, referenceTo.labelField, {alias: 'label'}),
57626
57627
  Object.assign({}, referenceTo.valueField, {alias: 'value'})
57627
57628
  ], {
@@ -57634,7 +57635,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
57634
57635
  }, null, [
57635
57636
  Object.assign({}, referenceTo.labelField, {alias: 'label'}),
57636
57637
  Object.assign({}, referenceTo.valueField, {alias: 'value'})
57637
- ], {expand: false, alias: 'options', queryOptions: `filters: {__filters}, top: {__top}, sort: "{__sort}"`, moreQueries: [defaultValueOptionsQueryData.query]});
57638
+ ], {expand: false, alias: 'options', queryOptions: `filters: {__filters}, top: {__top}, sort: "{__sort}"`});
57638
57639
 
57639
57640
  apiInfo.adaptor = `
57640
57641
  const data = payload.data;
@@ -57728,13 +57729,16 @@ async function lookupToAmisSelect(field, readonly, ctx){
57728
57729
  var optionsFiltersOp = "${field.multiple ? "in" : "="}";
57729
57730
  var optionsFilters = [["${valueFieldKey}", optionsFiltersOp, []]];
57730
57731
  if (defaultValue && !api.data.$term) {
57732
+ const defaultValueOptionsQueryData = ${JSON.stringify(defaultValueOptionsQueryData)};
57733
+ const defaultValueOptionsQuery = defaultValueOptionsQueryData.query.replace(/^{/,"").replace(/}$/,"");
57731
57734
  // 字段值单独请求,没值的时候在请求中返回空
57732
57735
  optionsFilters = [["${valueFieldKey}", optionsFiltersOp, defaultValue]];
57733
57736
  if(filters.length > 0){
57734
57737
  optionsFilters = [filters, optionsFilters];
57735
57738
  }
57739
+ api.data.query = "{"+api.data.query.replace(/^{/,"").replace(/}$/,"")+","+defaultValueOptionsQuery+"}";
57740
+ api.data.query = api.data.query.replace(/{__options_filters}/g, JSON.stringify(optionsFilters))
57736
57741
  }
57737
- api.data.query = api.data.query.replace(/{__options_filters}/g, JSON.stringify(optionsFilters));
57738
57742
  return api;
57739
57743
  `;
57740
57744
  referenceTo ? referenceTo.labelField.name : '';