1 line
10 KiB
JSON
1 line
10 KiB
JSON
|
{"ast":null,"code":"import { TinyColor } from '@ctrl/tinycolor';\nimport { initComponentToken } from '../../input/style/token';\nimport { getArrowToken } from '../../style/roundedArrow';\nexport const initPickerPanelToken = token => {\n const {\n componentCls,\n controlHeightLG,\n paddingXXS,\n padding\n } = token;\n return {\n pickerCellCls: `${componentCls}-cell`,\n pickerCellInnerCls: `${componentCls}-cell-inner`,\n pickerYearMonthCellWidth: token.calc(controlHeightLG).mul(1.5).equal(),\n pickerQuarterPanelContentHeight: token.calc(controlHeightLG).mul(1.4).equal(),\n pickerCellPaddingVertical: token.calc(paddingXXS).add(token.calc(paddingXXS).div(2)).equal(),\n pickerCellBorderGap: 2,\n // Magic for gap between cells\n pickerControlIconSize: 7,\n pickerControlIconMargin: 4,\n pickerControlIconBorderWidth: 1.5,\n pickerDatePanelPaddingHorizontal: token.calc(padding).add(token.calc(paddingXXS).div(2)).equal() // 18 in normal\n };\n};\nexport const initPanelComponentToken = token => {\n const {\n colorBgContainerDisabled,\n controlHeight,\n controlHeightSM,\n controlHeightLG,\n paddingXXS,\n lineWidth\n } = token;\n // Item height default use `controlHeight - 2 * paddingXXS`,\n // but some case `paddingXXS=0`.\n // Let's fallback it.\n const dblPaddingXXS = paddingXXS * 2;\n const dblLineWidth = lineWidth * 2;\n const multipleItemHeight = Math.min(controlHeight - dblPaddingXXS, controlHeight - dblLineWidth);\n const multipleItemHeightSM = Math.min(controlHeightSM - dblPaddingXXS, controlHeightSM - dblLineWidth);\n const multipleItemHeightLG = Math.min(controlHeightLG - dblPaddingXXS, controlHeightLG - dblLineWidth);\n // FIXED_ITEM_MARGIN is a hardcode calculation since calc not support rounding\n const INTERNAL_FIXED_ITEM_MARGIN = Math.floor(paddingXXS / 2);\n const filledToken = {\n INTERNAL_FIXED_ITEM_MARGIN,\n cellHoverBg: token.controlItemBgHover,\n cellActiveWithRangeBg: token.controlItemBgActive,\n cellHoverWithRangeBg: new TinyColor(token.colorPrimary).lighten(35).toHexString(),\n cellRangeBorderColor: new TinyColor(token.colorPrimary).lighten(20).toHexString(),\n cellBgDisabled: colorBgContainerDisabled,\n timeColumnWidth: controlHeightLG * 1.4,\n timeColumnHeight: 28 * 8,\n timeCellHeight: 28,\n cellWidth: controlHeightSM * 1.5,\n cellHeight: controlHeightSM,\n textHeight: controlHeightLG,\n withoutTimeCellHeight: controlHeightLG * 1.65,\n multipleItemBg: token.colorFillSecondary,\n multipleItemBorderColor: 'transparent',\n multipleItemHeight,\n multipleItemHeightSM,\n multipleItemHeightLG,\n multipleSelectorBgDisabled: colorBgContainerDisabled,\n multipleItemColorDisabled: token.colorTextDisabled,\n multipleItemBorderColorDisabled: 'transparent'\n };\n return filledToken;\n};\nexport const prepareComponentToken = token => Object.assign(Object.assign(Object.assign(Object.assign({}, initComponentToken(token)), initPanelComponentToken(token)), getArrowToken(token)), {\n presetsWidth: 120,\n presetsMaxWidth: 200,\n zIndexPopup: token.zIndexPopupBase + 50\n});","map":{"version":3,"names":["TinyColor","initComponentToken","getArrowToken","initPickerPanelToken","token","componentCls","controlHeightLG","paddingXXS","padding","pickerCellCls","pickerCellInnerCls","pickerYearMonthCellWidth","calc","mul","equal","pickerQuarterPanelContentHeight","pickerCellPaddingVertical","add","div","pickerCellBorderGap","pickerControlIconSize","pickerControlIconMargin","pickerControlIconBorderWidth","pickerDatePanelPaddingHorizontal","initPanelComponentToken","colorBgContainerDisabled","controlHeight","controlHeightSM","lineWidth","dblPaddingXXS","dblLineWidth","multipleItemHeight","Math","min","multipleItemHeightSM","multipleItemHeightLG","INTERNAL_FIXED_ITEM_MARGIN","floor","filledToken","cellHoverBg","controlItemBgHover","cellActiveWithRangeBg","controlItemBgActive","cellHoverWithRangeBg","colorPrimary","lighten","toHexString","cellRangeBorderColor","cellBgDisabled","timeColumnWidth","
|