UNPKG

ingenious-flow-designer

Version:

[演示地址](http://antd-vben5-pro.madong.tech/)

78 lines (77 loc) 2.37 kB
import { ref } from "vue"; import { _ as _extends } from "./index-33HV6VHr.js"; function useState(defaultStateValue) { const initValue = typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue; const innerValue = ref(initValue); function triggerChange(newValue) { innerValue.value = newValue; } return [innerValue, triggerChange]; } function compactItemBorder(token, parentCls, options) { const { focusElCls, focus, borderElCls } = options; const childCombinator = borderElCls ? "> *" : ""; const hoverEffects = ["hover", focus ? "focus" : null, "active"].filter(Boolean).map((n) => `&:${n} ${childCombinator}`).join(","); return { [`&-item:not(${parentCls}-last-item)`]: { marginInlineEnd: -token.lineWidth }, "&-item": _extends(_extends({ [hoverEffects]: { zIndex: 2 } }, focusElCls ? { [`&${focusElCls}`]: { zIndex: 2 } } : {}), { [`&[disabled] ${childCombinator}`]: { zIndex: 0 } }) }; } function compactItemBorderRadius(prefixCls, parentCls, options) { const { borderElCls } = options; const childCombinator = borderElCls ? `> ${borderElCls}` : ""; return { [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: { borderRadius: 0 }, [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: { [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: { borderStartEndRadius: 0, borderEndEndRadius: 0 } }, [`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: { [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: { borderStartStartRadius: 0, borderEndStartRadius: 0 } } }; } function genCompactItemStyle(token) { let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { focus: true }; const { componentCls } = token; const compactCls = `${componentCls}-compact`; return { [compactCls]: _extends(_extends({}, compactItemBorder(token, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options)) }; } export { genCompactItemStyle as g, useState as u }; //# sourceMappingURL=compact-item-CaKUqZoL.js.map