@steedos-widgets/sortable 3.6.2-beta.7 → 3.6.2-beta.9

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@3.6.2-beta.7/dist/sortable.umd.js",
7
- "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.7/dist/sortable.umd.css"
6
+ "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.9/dist/sortable.umd.js",
7
+ "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.9/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@3.6.2-beta.7/dist/meta.js",
18
+ "url": "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.9/dist/meta.js",
19
19
  "urls": {
20
- "default": "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.7/dist/meta.js",
21
- "design": "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.7/dist/meta.js"
20
+ "default": "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.9/dist/meta.js",
21
+ "design": "https://unpkg.com/@steedos-widgets/sortable@3.6.2-beta.9/dist/meta.js"
22
22
  }
23
23
  }
24
24
  ]
@@ -53937,22 +53937,26 @@ function getRootUrl(defaultRootUrl){
53937
53937
  * @Description:
53938
53938
  */
53939
53939
 
53940
-
53941
53940
  const Router = {
53942
53941
  getTabDisplayAs(tab_id){
53942
+ const uiSchema = getUISchemaSync$1(tab_id, false);
53943
53943
  var urlSearch = new URLSearchParams(document.location.search);
53944
53944
  if(urlSearch.has('display')){
53945
53945
  return urlSearch.get('display')
53946
53946
  }
53947
53947
  const key = `tab_${tab_id}_display`;
53948
53948
  // const key = `page_display`;
53949
- const value = localStorage.getItem(key);
53950
- return value ? value : 'grid'
53949
+ const value = sessionStorage.getItem(key);
53950
+ let defaultDisplay = "grid";
53951
+ if(uiSchema.enable_split){
53952
+ defaultDisplay = "split";
53953
+ }
53954
+ return value ? value : defaultDisplay;
53951
53955
  },
53952
53956
 
53953
53957
  setTabDisplayAs(tab_id, displayAs){
53954
53958
  const key = `tab_${tab_id}_display`;
53955
- localStorage.setItem(key, displayAs);
53959
+ sessionStorage.setItem(key, displayAs);
53956
53960
  },
53957
53961
  getAppPath({formFactor, appId}){
53958
53962
  return `/app/${appId}`;
@@ -54106,7 +54110,7 @@ function getSelectMap(selectOptions){
54106
54110
 
54107
54111
  function getNameTplUrl(field, ctx){
54108
54112
  if(ctx.objectName === 'cms_files'){
54109
- return `\${context.rootUrl}/api/files/files/\${versions[0]}?download=true`
54113
+ return "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}"
54110
54114
  }
54111
54115
  const href = Router.getObjectDetailPath({
54112
54116
  ...ctx, formFactor: ctx.formFactor, appId: "${appId}", objectName: ctx.objectName || "${objectName}", recordId: `\${${ctx.idFieldName}}`
@@ -55403,7 +55407,11 @@ async function getTableColumns(fields, options){
55403
55407
  const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
55404
55408
  let className = "";
55405
55409
  if(field.wrap != true){
55406
- className += " whitespace-nowrap ";
55410
+ if(field.wrap != false && field.is_wide){
55411
+ className += " break-words ";
55412
+ }else {
55413
+ className += " whitespace-nowrap ";
55414
+ }
55407
55415
  }else {
55408
55416
  className += " break-words ";
55409
55417
  }
@@ -55502,12 +55510,12 @@ async function getTableColumns(fields, options){
55502
55510
  if(field.type === 'textarea'){
55503
55511
  className += 'min-w-56';
55504
55512
  }
55505
- if(field.type === 'date'){
55506
- className += 'date-min-w';
55507
- }
55508
- if(field.type === 'datetime'){
55509
- className += 'datetime-min-w';
55510
- }
55513
+ // if(field.type === 'date'){
55514
+ // className += 'date-min-w';
55515
+ // }
55516
+ // if(field.type === 'datetime'){
55517
+ // className += 'datetime-min-w';
55518
+ // }
55511
55519
 
55512
55520
  //field上的amis属性里的clssname需要单独判断类型合并
55513
55521
  if (typeof field.amis?.className == "object") {
@@ -55602,7 +55610,7 @@ function getMobileLines(tpls){
55602
55610
  }
55603
55611
  if(isLeft){
55604
55612
  // 左侧半行
55605
- lineChildrenClassName = "steedos-listview-item-left truncate";
55613
+ lineChildrenClassName = "steedos-listview-item-left truncate h-5";
55606
55614
  if(item.field.is_wide){
55607
55615
  // 左侧全行样式可以单独写,如果需要配置两行省略号效果,可以加样式类 two-lines-truncate
55608
55616
  lineChildrenClassName = "steedos-listview-item-wide";
@@ -55614,7 +55622,7 @@ function getMobileLines(tpls){
55614
55622
  }
55615
55623
  else {
55616
55624
  // 右侧半行,这里加样式类 flex flex-shrink-0,是为了省略号只显示在左半行,右半行文字一般比较短,如果也加省略号效果的话,左侧文字多的话,右侧没几个字就显示省略号了
55617
- lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0";
55625
+ lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0 h-5";
55618
55626
  }
55619
55627
  //支持字段amis属性配置classname,识别classname的类型,与原样式合并
55620
55628
  var className;
@@ -55725,7 +55733,15 @@ async function getMobileTableColumns(fields, options){
55725
55733
  "actions": [
55726
55734
  {
55727
55735
  "script": `
55728
- let cms_url = "/api/files/files/"+event.data.versions[0]+"?download=true"
55736
+ let cms_url = '';
55737
+ let value = event.data.versions[0];
55738
+ if(value){
55739
+ if(value.url){
55740
+ cms_url = value.url;
55741
+ }else{
55742
+ cms_url = "/api/files/files/"+value+"?download=true"
55743
+ }
55744
+ }
55729
55745
  Steedos.cordovaDownload(encodeURI(Steedos.absoluteUrl(cms_url)), event.data.name);
55730
55746
  `,
55731
55747
  "actionType": "custom"
@@ -56097,7 +56113,7 @@ async function getListBody(fields, options){
56097
56113
 
56098
56114
  function getDefaultParams(options){
56099
56115
  return {
56100
- perPage: options.top || options.perPage || 10
56116
+ perPage: options.top || options.perPage || 20
56101
56117
  }
56102
56118
  }
56103
56119
 
@@ -56151,7 +56167,6 @@ const getSchema$5 = async (uiSchema, ctx) => {
56151
56167
  "objectApiName": "\${objectName}",
56152
56168
  "recordId": "",
56153
56169
  "mode": "edit",
56154
- "layout": "normal"
56155
56170
  };
56156
56171
 
56157
56172
  if (payload && payload.schema) {
@@ -57935,14 +57950,14 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
57935
57950
  {
57936
57951
  "type": "button",
57937
57952
  "label": instance.t('frontend_display_type_is_table'),
57938
- "onClick": "const key = 'tab_"+objectName+"_display';localStorage.setItem(key, 'grid');let url = document.location.pathname; var urlSearch = new URLSearchParams(document.location.search); if(urlSearch.get(\"side_object\") && urlSearch.get(\"side_listview_id\")){url=`/app/${props.data.appId}/${urlSearch.get(\"side_object\")}/grid/${urlSearch.get(\"side_listview_id\")}`;}; props.env.jumpTo(url + '?display=grid');",
57953
+ "onClick": "const key = 'tab_"+objectName+"_display';sessionStorage.setItem(key, 'grid');let url = document.location.pathname; var urlSearch = new URLSearchParams(document.location.search); if(urlSearch.get(\"side_object\") && urlSearch.get(\"side_listview_id\")){url=`/app/${props.data.appId}/${urlSearch.get(\"side_object\")}/grid/${urlSearch.get(\"side_listview_id\")}`;}; props.env.jumpTo(url + '?display=grid');",
57939
57954
  "rightIcon": displayAs != 'split' ? "fa fa-check" : null,
57940
57955
  "rightIconClassName": "m-l-sm"
57941
57956
  },
57942
57957
  {
57943
57958
  "type": "button",
57944
57959
  "label": instance.t('frontend_display_type_is_split'),
57945
- "onClick": "const key = 'tab_"+objectName+"_display';localStorage.setItem(key, 'split');const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);",
57960
+ "onClick": "const key = 'tab_"+objectName+"_display';sessionStorage.setItem(key, 'split');const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);",
57946
57961
  "rightIcon": displayAs === 'split' ? "fa fa-check" : null,
57947
57962
  "rightIconClassName": "m-l-sm"
57948
57963
  }
@@ -59595,8 +59610,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
59595
59610
  labelField: referenceTo.labelField.name,
59596
59611
  valueField: referenceTo.valueField.name,
59597
59612
  // disabledOn: this._master目的是相关表新建时禁止编辑关联字段; this.relatedKey目的是相关表编辑时禁止编辑关联字段,多选字段可以编辑。
59598
- disabledOn: `${readonly}`,
59599
- hiddenOn: `( (this._master && (this._master.relatedKey ==='${field.name}')) || ((this.relatedKey ==='${field.name}') && (${field.multiple} != true)) )`,
59613
+ disabledOn: `${readonly} || ( (this._master && (this._master.relatedKey ==='${field.name}')) || ((this.relatedKey ==='${field.name}') && (${field.multiple} != true)) )`,
59600
59614
  modalMode: 'dialog', //TODO 设置 dialog 或者 drawer,用来配置弹出方式
59601
59615
  source: source,
59602
59616
  size: "lg",
@@ -59839,16 +59853,18 @@ async function lookupToAmis(field, readonly, ctx){
59839
59853
  }
59840
59854
  // console.log(`lookupToAmis====`, field, readonly, ctx)
59841
59855
  if(readonly){
59842
- return {
59843
- type: 'steedos-field',
59844
- config: field,
59845
- static: true
59856
+ if(field.reference_to){
59857
+ return {
59858
+ type: 'steedos-field',
59859
+ config: field,
59860
+ static: true
59861
+ }
59862
+ }else {
59863
+ return {
59864
+ type: getAmisStaticFieldType('picker', readonly),
59865
+ tpl: getRelatedFieldTpl(field, ctx)
59866
+ }
59846
59867
  }
59847
-
59848
- // return {
59849
- // type: Field.getAmisStaticFieldType('picker', readonly),
59850
- // tpl: Tpl.getRelatedFieldTpl(field, ctx)
59851
- // }
59852
59868
  }
59853
59869
  if(field.reference_to && !lodash.exports.isString(field.reference_to) && !readonly){
59854
59870
  return {
@@ -60784,7 +60800,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60784
60800
  if(field.is_wide || convertData.type === 'group'){
60785
60801
  convertData.className = 'col-span-2 m-0';
60786
60802
  }else {
60787
- convertData.className = 'm-1';
60803
+ convertData.className = 'm-0';
60788
60804
  }
60789
60805
  if(readonly){
60790
60806
  convertData.className = `${convertData.className} border-b`;
@@ -60809,6 +60825,10 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60809
60825
  }
60810
60826
  }
60811
60827
 
60828
+ if(ctx.amisData && ctx.amisData._master && ctx.amisData._master.relatedKey === field.name){
60829
+ convertData.className = `${convertData.className || ''} hidden`;
60830
+ }
60831
+
60812
60832
  if(lodash.exports.isString(baseData.required)){
60813
60833
  if(baseData.required.startsWith("{{")){
60814
60834
  baseData.requiredOn = `${baseData.required.substring(2, baseData.required.length -2).replace(/formData./g, 'data.')}`;