@steedos-widgets/amis-lib 3.6.4-beta.4 → 3.6.4-beta.6

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
@@ -2395,7 +2395,7 @@ function getMobileLines(tpls){
2395
2395
  }
2396
2396
  if(isLeft){
2397
2397
  // 左侧半行
2398
- lineChildrenClassName = "steedos-listview-item-left truncate h-5";
2398
+ lineChildrenClassName = "steedos-listview-item-left truncate";
2399
2399
  if(item.field.is_wide){
2400
2400
  // 左侧全行样式可以单独写,如果需要配置两行省略号效果,可以加样式类 two-lines-truncate
2401
2401
  lineChildrenClassName = "steedos-listview-item-wide";
@@ -2407,7 +2407,7 @@ function getMobileLines(tpls){
2407
2407
  }
2408
2408
  else {
2409
2409
  // 右侧半行,这里加样式类 flex flex-shrink-0,是为了省略号只显示在左半行,右半行文字一般比较短,如果也加省略号效果的话,左侧文字多的话,右侧没几个字就显示省略号了
2410
- lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0 h-5";
2410
+ lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0";
2411
2411
  }
2412
2412
  //支持字段amis属性配置classname,识别classname的类型,与原样式合并
2413
2413
  var className;
@@ -2650,7 +2650,7 @@ async function getTableOperation(ctx){
2650
2650
  "label": "xxx",
2651
2651
  "buttons": operationButtons,
2652
2652
  "placement": "bottomRight",
2653
- "overlayClassName": "shadow !min-w-[160px]",
2653
+ "overlayClassName": "border rounded !min-w-[160px]",
2654
2654
  "trigger": ["click"],
2655
2655
  "id": "u:c2140a365019",
2656
2656
  onOpenApi: {
@@ -5728,6 +5728,7 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
5728
5728
  type: "steedos-dropdown-button",
5729
5729
  label: "",
5730
5730
  buttons: moreButtons,
5731
+ "overlayClassName": "border rounded !min-w-[160px]",
5731
5732
  className: 'slds-icon ml-1',
5732
5733
  visibleOn: moreButtonsVisibleOn
5733
5734
  };
@@ -6954,6 +6955,15 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
6954
6955
  divWidth = divWidth - 210;
6955
6956
  }
6956
6957
 
6958
+ if(options._inDrawer){
6959
+ try {
6960
+ divWidth = new Number($("html").css("font-size").replace('px', '')) * 60;
6961
+ } catch (error) {
6962
+ console.error(error);
6963
+ divWidth = 16 * 60;
6964
+ }
6965
+ }
6966
+
6957
6967
  // 根据屏幕宽度计算显示数量, 使高亮字段只占1行
6958
6968
  max = Math.trunc(divWidth / 200 );
6959
6969
  if(max > 10){
@@ -10222,7 +10232,7 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
10222
10232
  };
10223
10233
  const content = {
10224
10234
  "type": "tabs",
10225
- "className": "steedos-record-tabs bg-white p-4 mt-3 border-y",
10235
+ "className": "steedos-record-tabs bg-white p-4 mt-2",
10226
10236
  "contentClassName": "bg-none",
10227
10237
  "tabs": [
10228
10238
  detailed
@@ -13674,10 +13684,32 @@ async function getInputTableColumns(props) {
13674
13684
  // 实测过,直接不生成对应的隐藏column并不会对input-table值造成丢失问题,隐藏的列字段值能正常维护
13675
13685
 
13676
13686
  let fieldPrefix = props.fieldPrefix;
13677
- let fields = props.fields || [];
13687
+ let fields = cloneDeep(props.fields || []);
13678
13688
  if (fieldPrefix) {
13679
13689
  fields = getTableFieldsWithoutFieldPrefix(fields, fieldPrefix);
13680
13690
  }
13691
+ if (inlineEditMode == true) {
13692
+ let popOverContainerSelector = "";
13693
+ let popOverContainer = props.popOverContainer && props.popOverContainer();
13694
+ //获取到当前input-table所处的popOverContainer(可能是modal-dialog中),
13695
+ //给所有的下拉框字段配置popOverContainerSelector,使下拉框组件的弹出框挂载到当前dialog上,防止被dialog遮挡
13696
+ if (popOverContainer) {
13697
+ let classList = Array.prototype.slice.call(popOverContainer.parentElement.classList);
13698
+ if (classList.includes('amis-dialog-widget')) {
13699
+ popOverContainerSelector = '.' + classList.join('.') + ' .antd-Modal-content';
13700
+ }
13701
+ }
13702
+ fields.forEach(function (field) {
13703
+ //lookup存在下拉框模式;弹出模式用的是picker组件,不认popOverContainerSelector属性,所以统一加上
13704
+ if (field.type == "select" || field.type == "lookup") {
13705
+ field.amis = {
13706
+ ...field.amis,
13707
+ popOverContainerSelector
13708
+ };
13709
+ }
13710
+ });
13711
+ }
13712
+
13681
13713
  if (columns && columns.length) {
13682
13714
  return columns.map(function (column) {
13683
13715
  let field, extendColumnProps = {};
@@ -13727,7 +13759,7 @@ async function getInputTableColumns(props) {
13727
13759
  }
13728
13760
  else {
13729
13761
  return fields.map(function (field) {
13730
- let tableCell = getInputTableCell(field, showAsInlineEditMode);
13762
+ let tableCell = getInputTableCell(field, showAsInlineEditMode);
13731
13763
  tableCell.className = " whitespace-nowrap ";
13732
13764
  return tableCell;
13733
13765
  }) || [];
@@ -14694,7 +14726,7 @@ async function getButtonDelete(props) {
14694
14726
  return {
14695
14727
  "type": "dropdown-button",
14696
14728
  "level": "link",
14697
- "btnClassName": "text-gray-400",
14729
+ "btnClassName": "text-gray-400 steedos-delete-button",
14698
14730
  "icon": "fa fa-trash-alt",
14699
14731
  "size": "xs",
14700
14732
  "hideCaret": true,
@@ -14857,11 +14889,11 @@ const getAmisInputTableSchema = async (props) => {
14857
14889
  }
14858
14890
  };
14859
14891
  if (buttonsForColumnOperations.length) {
14860
- inputTableSchema.columns.push({
14892
+ inputTableSchema.columns.unshift({
14861
14893
  "name": "__op__",
14862
14894
  "type": "operation",
14863
14895
  "buttons": buttonsForColumnOperations,
14864
- "width": buttonsForColumnOperations.length > 1 ? "60px" : "20px"
14896
+ "width": 1
14865
14897
  });
14866
14898
  }
14867
14899
  // if (showAsInlineEditMode) {
@@ -14910,6 +14942,18 @@ const getAmisInputTableSchema = async (props) => {
14910
14942
  }
14911
14943
  let className = "steedos-input-table";
14912
14944
 
14945
+ if (props.showIndex) {
14946
+ className += " steedos-show-index";
14947
+ }
14948
+
14949
+ if (buttonsForColumnOperations.length) {
14950
+ className += " steedos-has-operations";
14951
+ }
14952
+
14953
+ if (props.enableTree) {
14954
+ className += " steedos-tree-mode";
14955
+ }
14956
+
14913
14957
  if (typeof props.className == "object") {
14914
14958
  className = {
14915
14959
  [className]: "true",