1 line
19 KiB
JSON
1 line
19 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { genPanelStyle, initPanelComponentToken, initPickerPanelToken } from '../../date-picker/style';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\nexport const genCalendarStyles = token => {\n const {\n calendarCls,\n componentCls,\n fullBg,\n fullPanelBg,\n itemActiveBg\n } = token;\n return {\n [calendarCls]: Object.assign(Object.assign(Object.assign({}, genPanelStyle(token)), resetComponent(token)), {\n background: fullBg,\n '&-rtl': {\n direction: 'rtl'\n },\n [`${calendarCls}-header`]: {\n display: 'flex',\n justifyContent: 'flex-end',\n padding: `${unit(token.paddingSM)} 0`,\n [`${calendarCls}-year-select`]: {\n minWidth: token.yearControlWidth\n },\n [`${calendarCls}-month-select`]: {\n minWidth: token.monthControlWidth,\n marginInlineStart: token.marginXS\n },\n [`${calendarCls}-mode-switch`]: {\n marginInlineStart: token.marginXS\n }\n }\n }),\n [`${calendarCls} ${componentCls}-panel`]: {\n background: fullPanelBg,\n border: 0,\n borderTop: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,\n borderRadius: 0,\n [`${componentCls}-month-panel, ${componentCls}-date-panel`]: {\n width: 'auto'\n },\n [`${componentCls}-body`]: {\n padding: `${unit(token.paddingXS)} 0`\n },\n [`${componentCls}-content`]: {\n width: '100%'\n }\n },\n [`${calendarCls}-mini`]: {\n borderRadius: token.borderRadiusLG,\n [`${calendarCls}-header`]: {\n paddingInlineEnd: token.paddingXS,\n paddingInlineStart: token.paddingXS\n },\n [`${componentCls}-panel`]: {\n borderRadius: `0 0 ${unit(token.borderRadiusLG)} ${unit(token.borderRadiusLG)}`\n },\n [`${componentCls}-content`]: {\n height: token.miniContentHeight,\n th: {\n height: 'auto',\n padding: 0,\n lineHeight: unit(token.weekHeight)\n }\n },\n [`${componentCls}-cell::before`]: {\n pointerEvents: 'none'\n }\n },\n [`${calendarCls}${calendarCls}-full`]: {\n [`${componentCls}-panel`]: {\n display: 'block',\n width: '100%',\n textAlign: 'end',\n background: fullBg,\n border: 0,\n [`${componentCls}-body`]: {\n 'th, td': {\n padding: 0\n },\n th: {\n height: 'auto',\n paddingInlineEnd: token.paddingSM,\n paddingBottom: token.paddingXXS,\n lineHeight: unit(token.weekHeight)\n }\n }\n },\n [`${componentCls}-cell`]: {\n '&::before': {\n display: 'none'\n },\n '&:hover': {\n [`${calendarCls}-date`]: {\n background: token.controlItemBgHover\n }\n },\n [`${calendarCls}-date-today::before`]: {\n display: 'none'\n },\n // >>> Selected\n [`&-in-view${componentCls}-cell-selected`]: {\n [`${calendarCls}-date, ${calendarCls}-date-today`]: {\n background: itemActiveBg\n }\n },\n '&-selected, &-selected:hover': {\n [`${calendarCls}-date, ${calendarCls}-date-today`]: {\n [`${calendarCls}-date-value`]: {\n color: token.colorPrimary\n }\n }\n }\n },\n [`${calendarCls}-date`]: {\n display: 'block',\n width: 'auto',\n height: 'auto',\n margin: `0 ${unit(token.calc(token.marginXS).div(2).equal())}`,\n padding: `${unit(token.calc(token.paddingXS).div(2).equal())} ${unit(token.paddingXS)} 0`,\n border: 0,\n borderTop: `${unit(token.lineWidthBold)} ${token.lineType} ${token.colorSplit}`,\n borderRadius: 0,\n transition: `background ${token.motionDurationSlow}`,\n '&-value': {\n
|