1 line
52 KiB
JSON
1 line
52 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { TinyColor } from '@ctrl/tinycolor';\nconst genPickerCellInnerStyle = token => {\n const {\n pickerCellCls,\n pickerCellInnerCls,\n cellHeight,\n borderRadiusSM,\n motionDurationMid,\n cellHoverBg,\n lineWidth,\n lineType,\n colorPrimary,\n cellActiveWithRangeBg,\n colorTextLightSolid,\n colorTextDisabled,\n cellBgDisabled,\n colorFillSecondary\n } = token;\n return {\n '&::before': {\n position: 'absolute',\n top: '50%',\n insetInlineStart: 0,\n insetInlineEnd: 0,\n zIndex: 1,\n height: cellHeight,\n transform: 'translateY(-50%)',\n content: '\"\"'\n },\n // >>> Default\n [pickerCellInnerCls]: {\n position: 'relative',\n zIndex: 2,\n display: 'inline-block',\n minWidth: cellHeight,\n height: cellHeight,\n lineHeight: unit(cellHeight),\n borderRadius: borderRadiusSM,\n transition: `background ${motionDurationMid}`\n },\n // >>> Hover\n [`&:hover:not(${pickerCellCls}-in-view),\n &:hover:not(${pickerCellCls}-selected):not(${pickerCellCls}-range-start):not(${pickerCellCls}-range-end)`]: {\n [pickerCellInnerCls]: {\n background: cellHoverBg\n }\n },\n // >>> Today\n [`&-in-view${pickerCellCls}-today ${pickerCellInnerCls}`]: {\n '&::before': {\n position: 'absolute',\n top: 0,\n insetInlineEnd: 0,\n bottom: 0,\n insetInlineStart: 0,\n zIndex: 1,\n border: `${unit(lineWidth)} ${lineType} ${colorPrimary}`,\n borderRadius: borderRadiusSM,\n content: '\"\"'\n }\n },\n // >>> In Range\n [`&-in-view${pickerCellCls}-in-range,\n &-in-view${pickerCellCls}-range-start,\n &-in-view${pickerCellCls}-range-end`]: {\n position: 'relative',\n [`&:not(${pickerCellCls}-disabled):before`]: {\n background: cellActiveWithRangeBg\n }\n },\n // >>> Selected\n [`&-in-view${pickerCellCls}-selected,\n &-in-view${pickerCellCls}-range-start,\n &-in-view${pickerCellCls}-range-end`]: {\n [`&:not(${pickerCellCls}-disabled) ${pickerCellInnerCls}`]: {\n color: colorTextLightSolid,\n background: colorPrimary\n },\n [`&${pickerCellCls}-disabled ${pickerCellInnerCls}`]: {\n background: colorFillSecondary\n }\n },\n [`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-disabled):before`]: {\n insetInlineStart: '50%'\n },\n [`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-disabled):before`]: {\n insetInlineEnd: '50%'\n },\n // range start border-radius\n [`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-range-end) ${pickerCellInnerCls}`]: {\n borderStartStartRadius: borderRadiusSM,\n borderEndStartRadius: borderRadiusSM,\n borderStartEndRadius: 0,\n borderEndEndRadius: 0\n },\n // range end border-radius\n [`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-range-start) ${pickerCellInnerCls}`]: {\n borderStartStartRadius: 0,\n borderEndStartRadius: 0,\n borderStartEndRadius: borderRadiusSM,\n borderEndEndRadius: borderRadiusSM\n },\n // >>> Disabled\n '&-disabled': {\n color: colorTextDisabled,\n pointerEvents: 'none',\n [pickerCellInnerCls]: {\n background: 'transparent'\n },\n '&::before': {\n background: cellBgDisabled\n }\n },\n [`&-disabled${pickerCellCls}-today ${pickerCellInnerCls}::before`]: {\n borderColor: colorTextDisabled\n }\n };\n};\nexport const genPanelStyle = token => {\n const {\n componentCls,\n pickerCellCls,\n pickerCellInnerCls,\n pickerYearMonthCellWidth,\n pickerControlIconSize,\n cellWidth,\n paddingSM,\n paddingXS,\n paddingXXS,\n colorBgContainer,\n lineWidth,\n lineType,\n borderRadiusLG,\n colorPrimary,\n colorTextHeading,\n colorSplit,\n pickerControlIconBorderWidth,\n colorIcon,\n
|