UNPKG

@aplus-frontend/ui

Version:

305 lines (304 loc) 7.52 kB
import { singleRow as a, resetComponent as r } from "../../style/index.mjs"; import { genComponentStyleHook as t } from "../../utils/cssinjs/index.mjs"; import { defaultValue as n } from "./index.mjs"; const o = (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 } } }; }, p = (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" } } } }; }, c = (e) => { const { componentCls: l } = e, i = `${l}-sortable-item-meta`; 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 }, "&-action-item": { "&:hover": { color: e.colorPrimary } } } } }; }, d = (e) => { const { componentCls: l } = e; return { [l]: { [`${e.componentCls}-sortable-item`]: { ".is-hidden": { display: "none" } } } }; }, s = (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": { ...r(e), fontWeight: "bold", color: e.textColor1 } }, "&-content": { flex: 1, overflowY: "auto", paddingBlockStart: e.space, paddingInlineEnd: e.spaceLG, paddingBlockEnd: 0, paddingInlineStart: e.space } } } }; }, g = (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 } } } }; }, m = (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.calc(e.colorPrimary).colorMix(5), 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), "&-label": { color: e.colorPrimary } } } }; }, S = t( "ApTable.Setting", (e) => [ o(e), p(e), d(e), c(e), s(e), m(e), g(e) ], n ); export { S as default, p as genTableSettingSelectGroupStyle, c as genTableSettingSortableItemMetaStyle, d as genTableSettingSortableItemStyle, s as genTableSettingSorterStyle, o as genTableSettingStyle, m as genTableSettingTemplateItemStyle, g as genTableSettingTemplateListStyle };