UNPKG

@aplus-frontend/ui

Version:

2 lines (1 loc) 3.42 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../utils/cssinjs/index.js"),t=()=>({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}),a=e=>({position:"absolute",zIndex:1,display:"none",background:e.colorPrimary,opacity:.2,transition:"none",pointerEvents:"none"}),l=e=>{const{componentCls:r,namespace:o}=e,i=`--${o}-splitter-bar-preview-offset`;return{[r]:{boxSizing:"border-box",margin:0,padding:0,color:e.textColor1,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:"inherit",display:"flex",width:"100%",height:"100%",alignItems:"stretch",[`${r}-bar`]:{flex:"none",position:"relative",userSelect:"none",[`${r}-bar-dragger`]:{zIndex:1,...t(e),"&::before":{content:'""',background:"rgba(0, 0, 0, 0.04)",...t(e)},"&::after":{content:'""',background:"rgba(0, 0, 0, 0.15)",...t(e)},[`&:hover:not(${r}-bar-dragger-active)`]:{"&::before":{background:"#e6f4ff"}},"&-active":{zIndex:2,"&::before":{background:"#bae0ff"}},[`&-disabled${r}-bar-dragger`]:{zIndex:0,"&, &:hover, &-active":{cursor:"default","&::before":{background:"rgba(0,0,0,0.04)"}},"&::after":{display:"none"}}},[`${r}-bar-collapse-bar`]:{...t(e),zIndex:1e3,background:"rgba(0,0,0,0.04)",fontSize:e.fontSizeSM,borderRadius:"2px",color:e.textColor1,cursor:"pointer",opacity:0,display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.15)"},"&:active":{backgroundColor:"#e6f4ff"}},"&:hover, &:active":{[`${r}-bar-collapse-bar`]:{opacity:1}}},[`${r}-mask`]:{position:"fixed",zIndex:1e3,inset:0,"&-horizontal":{cursor:"col-resize"},"&-vertical":{cursor:"row-resize"}},"&-horizontal":{flexDirection:"row",[`& > ${r}-bar`]:{width:0,[`${r}-bar-preview`]:{height:"100%",width:e.splitterBarSize,...a(e),"&-active":{display:"block",transform:`translateX(var(${i}))`}},[`${r}-bar-dragger`]:{cursor:"col-resize",height:"100%",width:e.splitterTriggerSize,"&::before":{height:"100%",width:e.splitterBarSize},"&::after":{height:e.splitterSplitBarDraggableSize,width:e.splitterBarSize}},[`${r}-bar-collapse-bar`]:{width:e.fontSizeSM,height:"24px","&-start":{left:"auto",right:e.calc(e.splitterTriggerSize).div(2).equal(),transform:"translateY(-50%)"},"&-end":{left:e.calc(e.splitterTriggerSize).div(2).equal(),right:"auto",transform:"translateY(-50%)"}}}},"&-vertical":{flexDirection:"column",[`& > ${r}-bar`]:{height:0,[`${r}-bar-preview`]:{height:e.splitterBarSize,width:"100%",...a(e),[`&${r}-bar-preview-active`]:{display:"block",transform:`translateY(var(${i}))`}},[`${r}-bar-dragger`]:{cursor:"row-resize",width:"100%",height:e.splitterTriggerSize,"&::before":{width:"100%",height:e.splitterBarSize},"&::after":{width:e.splitterSplitBarDraggableSize,height:e.splitterBarSize}},[`${r}-bar-collapse-bar`]:{height:e.fontSizeSM,width:"24px","&-start":{top:"auto",bottom:e.calc(e.splitterTriggerSize).div(2).equal(),transform:"translateX(-50%)"},"&-end":{top:e.calc(e.splitterTriggerSize).div(2).equal(),bottom:"auto",transform:"translateX(-50%)"}}}},[`${r}-panel`]:{overflow:"auto",padding:"0 1px",scrollbarWidth:"thin",boxSizing:"border-box","&-hidden":{padding:0,overflow:"hidden"},[`&:has(${r}:only-child)`]:{overflow:"hidden"}}}}},n=s.genComponentStyleHook("Splitter",e=>[l(e)],{splitterBarSize:2,splitterTriggerSize:6,splitterSplitBarDraggableSize:20});exports.default=n;exports.genSplitterStyle=l;