@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.
package/dist/assets.json CHANGED
@@ -3,8 +3,8 @@
3
3
  {
4
4
  "package": "@steedos-widgets/sortable",
5
5
  "urls": [
6
- "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.10/dist/sortable.umd.js",
7
- "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.10/dist/sortable.umd.css"
6
+ "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.12/dist/sortable.umd.js",
7
+ "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.12/dist/sortable.umd.css"
8
8
  ],
9
9
  "library": "BuilderSortable"
10
10
  }
@@ -15,10 +15,10 @@
15
15
  "npm": {
16
16
  "package": "@steedos-widgets/sortable"
17
17
  },
18
- "url": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.10/dist/meta.js",
18
+ "url": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.12/dist/meta.js",
19
19
  "urls": {
20
- "default": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.10/dist/meta.js",
21
- "design": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.10/dist/meta.js"
20
+ "default": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.12/dist/meta.js",
21
+ "design": "https://unpkg.com/@steedos-widgets/sortable@1.3.4-beta.12/dist/meta.js"
22
22
  }
23
23
  }
24
24
  ]
@@ -54080,7 +54080,7 @@ function getSelectMap(selectOptions){
54080
54080
  if(optionColor){
54081
54081
  const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
54082
54082
  const color = getContrastColor(background);
54083
- const optionColorStyle = 'background:'+background+';color:'+color;
54083
+ const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
54084
54084
  map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
54085
54085
  }else {
54086
54086
  map[optionValue] = option.label;
@@ -54341,17 +54341,17 @@ async function getFindQuery(object, recordId, fields, options){
54341
54341
  }
54342
54342
 
54343
54343
  const countQuery = options.count === false ? "" : `,count:${object.name}__count(filters:{__filters})`;
54344
- const moreQuerie = options.moreQueries?.length ? ("," + options.moreQueries.map(function(item){
54345
- // 把最外层的{}去除
54346
- return item.replace(/^{/,"").replace(/}$/,"");
54347
- }).join(",")) : "";
54344
+ // const moreQuerie = options.moreQueries?.length ? ("," + options.moreQueries.map(function(item){
54345
+ // // 把最外层的{}去除
54346
+ // return item.replace(/^{/,"").replace(/}$/,"");
54347
+ // }).join(",")) : "";
54348
54348
 
54349
54349
  return {
54350
54350
  orderBy: "${orderBy}",
54351
54351
  orderDir: "${orderDir}",
54352
54352
  pageNo: "${page}",
54353
54353
  pageSize: "${perPage}",
54354
- query: `{${alias}:${object.name}${queryOptions}{${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}}${countQuery}${moreQuerie}}`
54354
+ query: `{${alias}:${object.name}${queryOptions}{${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}}${countQuery}}`
54355
54355
  }
54356
54356
  }
54357
54357
 
@@ -56831,6 +56831,7 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
56831
56831
  ]
56832
56832
  }else {
56833
56833
  return [
56834
+ "statistics",
56834
56835
  {
56835
56836
  "type": "pagination",
56836
56837
  "maxButtons": 5
@@ -57622,10 +57623,10 @@ async function lookupToAmisSelect(field, readonly, ctx){
57622
57623
  // const labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';
57623
57624
 
57624
57625
  let apiInfo;
57625
-
57626
+ let defaultValueOptionsQueryData;
57626
57627
  if(referenceTo){
57627
57628
  // 字段值单独走一个请求合并到source的同一个GraphQL接口中
57628
- const defaultValueOptionsQueryData = await getFindQuery({ name: referenceTo.objectName }, null, [
57629
+ defaultValueOptionsQueryData = await getFindQuery({ name: referenceTo.objectName }, null, [
57629
57630
  Object.assign({}, referenceTo.labelField, {alias: 'label'}),
57630
57631
  Object.assign({}, referenceTo.valueField, {alias: 'value'})
57631
57632
  ], {
@@ -57638,7 +57639,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
57638
57639
  }, null, [
57639
57640
  Object.assign({}, referenceTo.labelField, {alias: 'label'}),
57640
57641
  Object.assign({}, referenceTo.valueField, {alias: 'value'})
57641
- ], {expand: false, alias: 'options', queryOptions: `filters: {__filters}, top: {__top}, sort: "{__sort}"`, moreQueries: [defaultValueOptionsQueryData.query]});
57642
+ ], {expand: false, alias: 'options', queryOptions: `filters: {__filters}, top: {__top}, sort: "{__sort}"`});
57642
57643
 
57643
57644
  apiInfo.adaptor = `
57644
57645
  const data = payload.data;
@@ -57732,13 +57733,16 @@ async function lookupToAmisSelect(field, readonly, ctx){
57732
57733
  var optionsFiltersOp = "${field.multiple ? "in" : "="}";
57733
57734
  var optionsFilters = [["${valueFieldKey}", optionsFiltersOp, []]];
57734
57735
  if (defaultValue && !api.data.$term) {
57736
+ const defaultValueOptionsQueryData = ${JSON.stringify(defaultValueOptionsQueryData)};
57737
+ const defaultValueOptionsQuery = defaultValueOptionsQueryData.query.replace(/^{/,"").replace(/}$/,"");
57735
57738
  // 字段值单独请求,没值的时候在请求中返回空
57736
57739
  optionsFilters = [["${valueFieldKey}", optionsFiltersOp, defaultValue]];
57737
57740
  if(filters.length > 0){
57738
57741
  optionsFilters = [filters, optionsFilters];
57739
57742
  }
57743
+ api.data.query = "{"+api.data.query.replace(/^{/,"").replace(/}$/,"")+","+defaultValueOptionsQuery+"}";
57744
+ api.data.query = api.data.query.replace(/{__options_filters}/g, JSON.stringify(optionsFilters))
57740
57745
  }
57741
- api.data.query = api.data.query.replace(/{__options_filters}/g, JSON.stringify(optionsFilters));
57742
57746
  return api;
57743
57747
  `;
57744
57748
  referenceTo ? referenceTo.labelField.name : '';