import { singleRow as a, resetComponent as t } from "../../style/index.mjs";
import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
import { defaultValue as o } from "./index.mjs";
const p = (e) => {
  const { componentCls: l, namespace: i } = e;
  return {
    [l]: {
      ".ant-modal-content": {
        padding: 0
      },
      "div.ant-modal-header": {
        marginBottom: 0,
        padding: "12px 20px",
        borderBottom: `1px solid ${e.antdv.colorSplit}`
      },
      ".ant-modal-footer": {
        padding: "12px 20px",
        marginTop: 0,
        borderTop: "1px solid #E9EDF3"
      },
      [`${l}-wrapper`]: {
        display: "flex",
        flexDirection: "row",
        flexWrap: "nowrap",
        height: "100%",
        [`.${i}-ap-table-table-header__title`]: {
          ...a(e)
        },
        [`.${i}-ap-grid-table-header__title`]: {
          ...a(e),
          fontWeight: "normal",
          color: e.textColor1
        },
        [`.${i}-ag-grid-table-header__title`]: {
          ...a(e)
        }
      },
      [`${l}-left`]: {
        width: e.apTableSettingLeftWidth
      },
      [`${l}-center`]: {
        flex: 1,
        flexShrink: 1,
        minWidth: 0,
        paddingInline: e.spaceLG,
        display: "flex",
        flexDirection: "column",
        "&__header": {
          display: "flex",
          flexDirection: "row",
          flexWrap: "nowrap",
          justifyContent: "space-between",
          alignItems: "center",
          paddingInline: e.space,
          paddingBlock: e.spaceMD,
          "&-tips": {
            color: e.textColor3
          }
        },
        "&__tip-wrapper": {
          flex: 1,
          display: "flex",
          alignItems: "center"
        },
        "&__content": {
          flex: 1,
          padding: e.spaceLG,
          overflowY: "auto",
          ".ant-col": {
            lineHeight: 0
          },
          // 覆盖全局样式
          ".ant-checkbox-wrapper": {
            maxWidth: "100%",
            display: "inline-flex",
            alignItems: "center",
            lineHeight: 0,
            "> span:last-child": {
              flex: 1,
              minWidth: 0
            }
          }
        }
      },
      [`${l}-right`]: {
        width: e.apTableSettingRightWidth
      },
      [`${l}-modify-tip`]: {
        color: e.colorWarn
      }
    }
  };
}, c = (e) => {
  const { componentCls: l } = e;
  return {
    [l]: {
      [`${l}-select-group`]: {
        "&-header": {
          backgroundColor: "#F2F6F9",
          paddingInline: e.spaceLG,
          paddingBlock: e.spaceXS,
          borderRadius: e.borderRadius,
          marginBlockEnd: e.spaceLG,
          marginInline: e.calc(e.spaceLG).mul(-1).equal(),
          display: "flex"
        }
      }
    }
  };
}, d = (e) => {
  const { componentCls: l } = e, i = `${l}-sortable-item-meta`, r = `${i}-action-icon`;
  return {
    [l]: {
      [i]: {
        paddingInline: e.space,
        paddingBlock: e.spaceSM,
        marginBlockStart: e.spaceXS,
        display: "flex",
        flexDirection: "row",
        flexWrap: "nowrap",
        justifyContent: "space-between",
        alignItems: "center",
        "&:hover": {
          backgroundColor: e.calc(e.colorPrimary).colorMix(8),
          borderRadius: e.borderRadiusSM,
          cursor: "pointer",
          [`${i}-right`]: {
            display: "block"
          },
          [`${i}-left__holder`]: {
            color: `${e.colorPrimary} !important`
          }
        },
        "&-left": {
          flex: 1,
          display: "inline-flex",
          alignItems: "center",
          minWidth: 0,
          "&__indicator": {
            display: "inline-flex",
            justifyContent: "center",
            alignItems: "center",
            width: "16px",
            height: "16px",
            marginInlineEnd: e.spaceXS,
            flexShrink: 0
          },
          "&__label-wrapper": {
            whiteSpace: "nowrap",
            overflow: "hidden",
            textOverflow: "ellipsis"
          }
        },
        "&-right": {
          display: "none",
          paddingInlineStart: e.spaceLG
        },
        ".is-level2": {
          marginInlineStart: e.spaceXL
        },
        [r]: {
          [`&:not(${r}-disabled):hover`]: {
            color: e.colorPrimary
          }
        },
        [`${r}-disabled`]: {
          color: e.antdv.colorTextDisabled
        }
      }
    }
  };
}, s = (e) => {
  const { componentCls: l } = e;
  return {
    [l]: {
      [`${e.componentCls}-sortable-item`]: {
        ".is-hidden": {
          display: "none"
        }
      }
    }
  };
}, g = (e) => {
  const { componentCls: l } = e;
  return {
    [l]: {
      [`${e.componentCls}-sorter`]: {
        display: "flex",
        flexDirection: "column",
        height: "100%",
        "&-section-title": {
          fontSize: e.fontSize,
          lineHeight: e.lineHeight,
          color: e.textColor3,
          paddingInline: e.space,
          paddingBlock: e.spaceXXS,
          margin: e.spaceXS
        },
        "&-header": {
          paddingInline: "20px",
          paddingBlock: e.spaceXL,
          "&-title": {
            ...t(e),
            fontWeight: "bold",
            color: e.textColor1
          }
        },
        "&-content": {
          flex: 1,
          overflowY: "auto",
          paddingBlockStart: e.space,
          paddingInlineEnd: e.spaceLG,
          paddingBlockEnd: 0,
          paddingInlineStart: e.space
        }
      }
    }
  };
}, m = (e) => {
  const { componentCls: l } = e;
  return {
    [l]: {
      [`${e.componentCls}-template-list`]: {
        height: "100%",
        "&-title": {
          paddingInline: 20,
          paddingBlock: e.spaceXL,
          fontWeight: "bold"
        },
        "&-content": {
          flex: 1,
          overflow: "auto",
          paddingInline: e.spaceLG,
          paddingBlock: e.space
        }
      }
    }
  };
}, f = (e) => {
  const { componentCls: l } = e, i = `${e.componentCls}-template-item`;
  return {
    [l]: {
      [i]: {
        display: "flex",
        flexDirection: "row",
        flexWrap: "nowrap",
        justifyContent: "space-between",
        paddingInline: e.space,
        paddingBlock: e.spaceSM,
        borderRadius: e.borderRadius,
        marginBlockEnd: e.spaceXS,
        "&:last-child": {
          marginBottom: 0
        },
        "&:hover": {
          backgroundColor: e.colorBg3,
          cursor: "pointer",
          [`${e.componentCls}-template-item-action-wrapper`]: {
            display: "flex"
          }
        },
        "&-label": {
          ...a(e),
          lineHeight: "20px"
        },
        "&-action-wrapper": {
          display: "none"
        },
        "&-icon-wrapper": {
          paddingInline: e.spaceXS,
          borderRadius: e.borderRadius,
          "&:hover": {
            backgroundColor: e.colorBg1
          }
        }
      },
      [`${i}-active`]: {
        backgroundColor: e.calc(e.colorPrimary).colorMix(5),
        [`${i}-label`]: {
          color: e.colorPrimary
        }
      }
    }
  };
}, S = n(
  "ApTable.Setting",
  (e) => [
    p(e),
    c(e),
    s(e),
    d(e),
    g(e),
    f(e),
    m(e)
  ],
  o
);
export {
  S as default,
  c as genTableSettingSelectGroupStyle,
  d as genTableSettingSortableItemMetaStyle,
  s as genTableSettingSortableItemStyle,
  g as genTableSettingSorterStyle,
  p as genTableSettingStyle,
  f as genTableSettingTemplateItemStyle,
  m as genTableSettingTemplateListStyle
};
