@steedos-widgets/amis-lib 6.10.34-beta.4 → 6.10.34-beta.5

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
@@ -14049,6 +14049,12 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
14049
14049
  columnsTogglable: false
14050
14050
  }
14051
14051
  };
14052
+ if (readonly && !_$1.isEmpty(field.amis)){
14053
+ Object.assign(field.amis, {
14054
+ disabled: true,
14055
+ disabledOn: true
14056
+ });
14057
+ }
14052
14058
  // console.log(`convertData ======>`, field, convertData)
14053
14059
  for (const subField of field.subFields) {
14054
14060
  if(!subField.name.endsWith(".$")){
@@ -18538,7 +18544,6 @@ const getFieldEditTpl = async (field, label)=>{
18538
18544
  tpl.type = "steedos-input-table";
18539
18545
  tpl.addable = field.permission === "editable";
18540
18546
  tpl.editable = tpl.addable;
18541
- tpl.copyable = tpl.addable;
18542
18547
  tpl.removable = tpl.addable;
18543
18548
  if(tpl.addable){
18544
18549
  tpl.actionData = {
@@ -18641,16 +18646,23 @@ const getFieldReadonlyTpl = async (field, label)=>{
18641
18646
  // tpl.format = 'YYYY-MM-DD HH:mm'
18642
18647
  tpl.tpl = `\${${field.code}.name}`;
18643
18648
  }else if(field.type === 'table'){
18644
- tpl.type = "input-table"; //TODO
18645
- tpl.addable = field.permission === "editable";
18646
- tpl.editable = tpl.addable;
18647
- tpl.removable = tpl.addable;
18648
- tpl.copyable = tpl.addable;
18649
- tpl.columns = [];
18649
+ tpl.type = "steedos-input-table";
18650
+ tpl.disabled = true;
18651
+ tpl.autoGeneratePrimaryKeyValue = true;
18652
+ tpl.fields = [];
18650
18653
  for (const sField of field.fields) {
18651
18654
  if (sField.type != "hidden") {
18655
+ sField.permission = "readonly";
18652
18656
  const column = await getTdInputTpl(sField, true);
18653
- tpl.columns.push(column);
18657
+ // console.log('table column', column, sField);
18658
+ if(column.type === 'steedos-field'){
18659
+ if(sField.visibleOn){
18660
+ column.config.visibleOn = sField.visibleOn;
18661
+ }
18662
+ tpl.fields.push(column.config);
18663
+ }else {
18664
+ tpl.fields.push(column);
18665
+ }
18654
18666
  }
18655
18667
  }
18656
18668
  }else if(field.type === 'html'){