index.js 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.initPickerPanelToken = exports.genPanelStyle = exports.default = void 0;
  7. var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
  8. var _tinycolor = require("@ctrl/tinycolor");
  9. var _style = require("../../input/style");
  10. var _motion = require("../../style/motion");
  11. var _internal = require("../../theme/internal");
  12. var _style2 = require("../../style");
  13. var _compactItem = require("../../style/compact-item");
  14. const genPikerPadding = (token, inputHeight, fontSize, paddingHorizontal) => {
  15. const {
  16. lineHeight
  17. } = token;
  18. const fontHeight = Math.floor(fontSize * lineHeight) + 2;
  19. const paddingTop = Math.max((inputHeight - fontHeight) / 2, 0);
  20. const paddingBottom = Math.max(inputHeight - fontHeight - paddingTop, 0);
  21. return {
  22. padding: `${paddingTop}px ${paddingHorizontal}px ${paddingBottom}px`
  23. };
  24. };
  25. const genPickerCellInnerStyle = token => {
  26. const {
  27. componentCls,
  28. pickerCellCls,
  29. pickerCellInnerCls,
  30. pickerPanelCellHeight,
  31. motionDurationSlow,
  32. borderRadiusSM,
  33. motionDurationMid,
  34. controlItemBgHover,
  35. lineWidth,
  36. lineType,
  37. colorPrimary,
  38. controlItemBgActive,
  39. colorTextLightSolid,
  40. controlHeightSM,
  41. pickerDateHoverRangeBorderColor,
  42. pickerCellBorderGap,
  43. pickerBasicCellHoverWithRangeColor,
  44. pickerPanelCellWidth,
  45. colorTextDisabled,
  46. colorBgContainerDisabled
  47. } = token;
  48. return {
  49. '&::before': {
  50. position: 'absolute',
  51. top: '50%',
  52. insetInlineStart: 0,
  53. insetInlineEnd: 0,
  54. zIndex: 1,
  55. height: pickerPanelCellHeight,
  56. transform: 'translateY(-50%)',
  57. transition: `all ${motionDurationSlow}`,
  58. content: '""'
  59. },
  60. // >>> Default
  61. [pickerCellInnerCls]: {
  62. position: 'relative',
  63. zIndex: 2,
  64. display: 'inline-block',
  65. minWidth: pickerPanelCellHeight,
  66. height: pickerPanelCellHeight,
  67. lineHeight: `${pickerPanelCellHeight}px`,
  68. borderRadius: borderRadiusSM,
  69. transition: `background ${motionDurationMid}, border ${motionDurationMid}`
  70. },
  71. // >>> Hover
  72. [`&:hover:not(${pickerCellCls}-in-view),
  73. &:hover:not(${pickerCellCls}-selected):not(${pickerCellCls}-range-start):not(${pickerCellCls}-range-end):not(${pickerCellCls}-range-hover-start):not(${pickerCellCls}-range-hover-end)`]: {
  74. [pickerCellInnerCls]: {
  75. background: controlItemBgHover
  76. }
  77. },
  78. // >>> Today
  79. [`&-in-view${pickerCellCls}-today ${pickerCellInnerCls}`]: {
  80. '&::before': {
  81. position: 'absolute',
  82. top: 0,
  83. insetInlineEnd: 0,
  84. bottom: 0,
  85. insetInlineStart: 0,
  86. zIndex: 1,
  87. border: `${lineWidth}px ${lineType} ${colorPrimary}`,
  88. borderRadius: borderRadiusSM,
  89. content: '""'
  90. }
  91. },
  92. // >>> In Range
  93. [`&-in-view${pickerCellCls}-in-range`]: {
  94. position: 'relative',
  95. '&::before': {
  96. background: controlItemBgActive
  97. }
  98. },
  99. // >>> Selected
  100. [`&-in-view${pickerCellCls}-selected ${pickerCellInnerCls},
  101. &-in-view${pickerCellCls}-range-start ${pickerCellInnerCls},
  102. &-in-view${pickerCellCls}-range-end ${pickerCellInnerCls}`]: {
  103. color: colorTextLightSolid,
  104. background: colorPrimary
  105. },
  106. [`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-range-start-single),
  107. &-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-range-end-single)`]: {
  108. '&::before': {
  109. background: controlItemBgActive
  110. }
  111. },
  112. [`&-in-view${pickerCellCls}-range-start::before`]: {
  113. insetInlineStart: '50%'
  114. },
  115. [`&-in-view${pickerCellCls}-range-end::before`]: {
  116. insetInlineEnd: '50%'
  117. },
  118. // >>> Range Hover
  119. [`&-in-view${pickerCellCls}-range-hover-start:not(${pickerCellCls}-in-range):not(${pickerCellCls}-range-start):not(${pickerCellCls}-range-end),
  120. &-in-view${pickerCellCls}-range-hover-end:not(${pickerCellCls}-in-range):not(${pickerCellCls}-range-start):not(${pickerCellCls}-range-end),
  121. &-in-view${pickerCellCls}-range-hover-start${pickerCellCls}-range-start-single,
  122. &-in-view${pickerCellCls}-range-hover-start${pickerCellCls}-range-start${pickerCellCls}-range-end${pickerCellCls}-range-end-near-hover,
  123. &-in-view${pickerCellCls}-range-hover-end${pickerCellCls}-range-start${pickerCellCls}-range-end${pickerCellCls}-range-start-near-hover,
  124. &-in-view${pickerCellCls}-range-hover-end${pickerCellCls}-range-end-single,
  125. &-in-view${pickerCellCls}-range-hover:not(${pickerCellCls}-in-range)`]: {
  126. '&::after': {
  127. position: 'absolute',
  128. top: '50%',
  129. zIndex: 0,
  130. height: controlHeightSM,
  131. borderTop: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  132. borderBottom: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  133. transform: 'translateY(-50%)',
  134. transition: `all ${motionDurationSlow}`,
  135. content: '""'
  136. }
  137. },
  138. // Add space for stash
  139. [`&-range-hover-start::after,
  140. &-range-hover-end::after,
  141. &-range-hover::after`]: {
  142. insetInlineEnd: 0,
  143. insetInlineStart: pickerCellBorderGap
  144. },
  145. // Hover with in range
  146. [`&-in-view${pickerCellCls}-in-range${pickerCellCls}-range-hover::before,
  147. &-in-view${pickerCellCls}-range-start${pickerCellCls}-range-hover::before,
  148. &-in-view${pickerCellCls}-range-end${pickerCellCls}-range-hover::before,
  149. &-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-range-start-single)${pickerCellCls}-range-hover-start::before,
  150. &-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-range-end-single)${pickerCellCls}-range-hover-end::before,
  151. ${componentCls}-panel
  152. > :not(${componentCls}-date-panel)
  153. &-in-view${pickerCellCls}-in-range${pickerCellCls}-range-hover-start::before,
  154. ${componentCls}-panel
  155. > :not(${componentCls}-date-panel)
  156. &-in-view${pickerCellCls}-in-range${pickerCellCls}-range-hover-end::before`]: {
  157. background: pickerBasicCellHoverWithRangeColor
  158. },
  159. // range start border-radius
  160. [`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-range-start-single):not(${pickerCellCls}-range-end) ${pickerCellInnerCls}`]: {
  161. borderStartStartRadius: borderRadiusSM,
  162. borderEndStartRadius: borderRadiusSM,
  163. borderStartEndRadius: 0,
  164. borderEndEndRadius: 0
  165. },
  166. // range end border-radius
  167. [`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-range-end-single):not(${pickerCellCls}-range-start) ${pickerCellInnerCls}`]: {
  168. borderStartStartRadius: 0,
  169. borderEndStartRadius: 0,
  170. borderStartEndRadius: borderRadiusSM,
  171. borderEndEndRadius: borderRadiusSM
  172. },
  173. [`&-range-hover${pickerCellCls}-range-end::after`]: {
  174. insetInlineStart: '50%'
  175. },
  176. // Edge start
  177. [`tr > &-in-view${pickerCellCls}-range-hover:first-child::after,
  178. tr > &-in-view${pickerCellCls}-range-hover-end:first-child::after,
  179. &-in-view${pickerCellCls}-start${pickerCellCls}-range-hover-edge-start${pickerCellCls}-range-hover-edge-start-near-range::after,
  180. &-in-view${pickerCellCls}-range-hover-edge-start:not(${pickerCellCls}-range-hover-edge-start-near-range)::after,
  181. &-in-view${pickerCellCls}-range-hover-start::after`]: {
  182. insetInlineStart: (pickerPanelCellWidth - pickerPanelCellHeight) / 2,
  183. borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  184. borderStartStartRadius: lineWidth,
  185. borderEndStartRadius: lineWidth
  186. },
  187. // Edge end
  188. [`tr > &-in-view${pickerCellCls}-range-hover:last-child::after,
  189. tr > &-in-view${pickerCellCls}-range-hover-start:last-child::after,
  190. &-in-view${pickerCellCls}-end${pickerCellCls}-range-hover-edge-end${pickerCellCls}-range-hover-edge-end-near-range::after,
  191. &-in-view${pickerCellCls}-range-hover-edge-end:not(${pickerCellCls}-range-hover-edge-end-near-range)::after,
  192. &-in-view${pickerCellCls}-range-hover-end::after`]: {
  193. insetInlineEnd: (pickerPanelCellWidth - pickerPanelCellHeight) / 2,
  194. borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  195. borderStartEndRadius: lineWidth,
  196. borderEndEndRadius: lineWidth
  197. },
  198. // >>> Disabled
  199. '&-disabled': {
  200. color: colorTextDisabled,
  201. pointerEvents: 'none',
  202. [pickerCellInnerCls]: {
  203. background: 'transparent'
  204. },
  205. '&::before': {
  206. background: colorBgContainerDisabled
  207. }
  208. },
  209. [`&-disabled${pickerCellCls}-today ${pickerCellInnerCls}::before`]: {
  210. borderColor: colorTextDisabled
  211. }
  212. };
  213. };
  214. const genPanelStyle = token => {
  215. const {
  216. componentCls,
  217. pickerCellInnerCls,
  218. pickerYearMonthCellWidth,
  219. pickerControlIconSize,
  220. pickerPanelCellWidth,
  221. paddingSM,
  222. paddingXS,
  223. paddingXXS,
  224. colorBgContainer,
  225. lineWidth,
  226. lineType,
  227. borderRadiusLG,
  228. colorPrimary,
  229. colorTextHeading,
  230. colorSplit,
  231. pickerControlIconBorderWidth,
  232. colorIcon,
  233. pickerTextHeight,
  234. motionDurationMid,
  235. colorIconHover,
  236. fontWeightStrong,
  237. pickerPanelCellHeight,
  238. pickerCellPaddingVertical,
  239. colorTextDisabled,
  240. colorText,
  241. fontSize,
  242. pickerBasicCellHoverWithRangeColor,
  243. motionDurationSlow,
  244. pickerPanelWithoutTimeCellHeight,
  245. pickerQuarterPanelContentHeight,
  246. colorLink,
  247. colorLinkActive,
  248. colorLinkHover,
  249. pickerDateHoverRangeBorderColor,
  250. borderRadiusSM,
  251. colorTextLightSolid,
  252. borderRadius,
  253. controlItemBgHover,
  254. pickerTimePanelColumnHeight,
  255. pickerTimePanelColumnWidth,
  256. pickerTimePanelCellHeight,
  257. controlItemBgActive,
  258. marginXXS
  259. } = token;
  260. const pickerPanelWidth = pickerPanelCellWidth * 7 + paddingSM * 2 + 4;
  261. const hoverCellFixedDistance = (pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth - paddingSM;
  262. return {
  263. [componentCls]: {
  264. '&-panel': {
  265. display: 'inline-flex',
  266. flexDirection: 'column',
  267. textAlign: 'center',
  268. background: colorBgContainer,
  269. border: `${lineWidth}px ${lineType} ${colorSplit}`,
  270. borderRadius: borderRadiusLG,
  271. outline: 'none',
  272. '&-focused': {
  273. borderColor: colorPrimary
  274. },
  275. '&-rtl': {
  276. direction: 'rtl',
  277. [`${componentCls}-prev-icon,
  278. ${componentCls}-super-prev-icon`]: {
  279. transform: 'rotate(45deg)'
  280. },
  281. [`${componentCls}-next-icon,
  282. ${componentCls}-super-next-icon`]: {
  283. transform: 'rotate(-135deg)'
  284. }
  285. }
  286. },
  287. // ========================================================
  288. // = Shared Panel =
  289. // ========================================================
  290. [`&-decade-panel,
  291. &-year-panel,
  292. &-quarter-panel,
  293. &-month-panel,
  294. &-week-panel,
  295. &-date-panel,
  296. &-time-panel`]: {
  297. display: 'flex',
  298. flexDirection: 'column',
  299. width: pickerPanelWidth
  300. },
  301. // ======================= Header =======================
  302. '&-header': {
  303. display: 'flex',
  304. padding: `0 ${paddingXS}px`,
  305. color: colorTextHeading,
  306. borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`,
  307. '> *': {
  308. flex: 'none'
  309. },
  310. button: {
  311. padding: 0,
  312. color: colorIcon,
  313. lineHeight: `${pickerTextHeight}px`,
  314. background: 'transparent',
  315. border: 0,
  316. cursor: 'pointer',
  317. transition: `color ${motionDurationMid}`
  318. },
  319. '> button': {
  320. minWidth: '1.6em',
  321. fontSize,
  322. '&:hover': {
  323. color: colorIconHover
  324. }
  325. },
  326. '&-view': {
  327. flex: 'auto',
  328. fontWeight: fontWeightStrong,
  329. lineHeight: `${pickerTextHeight}px`,
  330. button: {
  331. color: 'inherit',
  332. fontWeight: 'inherit',
  333. verticalAlign: 'top',
  334. '&:not(:first-child)': {
  335. marginInlineStart: paddingXS
  336. },
  337. '&:hover': {
  338. color: colorPrimary
  339. }
  340. }
  341. }
  342. },
  343. // Arrow button
  344. [`&-prev-icon,
  345. &-next-icon,
  346. &-super-prev-icon,
  347. &-super-next-icon`]: {
  348. position: 'relative',
  349. display: 'inline-block',
  350. width: pickerControlIconSize,
  351. height: pickerControlIconSize,
  352. '&::before': {
  353. position: 'absolute',
  354. top: 0,
  355. insetInlineStart: 0,
  356. display: 'inline-block',
  357. width: pickerControlIconSize,
  358. height: pickerControlIconSize,
  359. border: `0 solid currentcolor`,
  360. borderBlockStartWidth: pickerControlIconBorderWidth,
  361. borderBlockEndWidth: 0,
  362. borderInlineStartWidth: pickerControlIconBorderWidth,
  363. borderInlineEndWidth: 0,
  364. content: '""'
  365. }
  366. },
  367. [`&-super-prev-icon,
  368. &-super-next-icon`]: {
  369. '&::after': {
  370. position: 'absolute',
  371. top: Math.ceil(pickerControlIconSize / 2),
  372. insetInlineStart: Math.ceil(pickerControlIconSize / 2),
  373. display: 'inline-block',
  374. width: pickerControlIconSize,
  375. height: pickerControlIconSize,
  376. border: '0 solid currentcolor',
  377. borderBlockStartWidth: pickerControlIconBorderWidth,
  378. borderBlockEndWidth: 0,
  379. borderInlineStartWidth: pickerControlIconBorderWidth,
  380. borderInlineEndWidth: 0,
  381. content: '""'
  382. }
  383. },
  384. [`&-prev-icon,
  385. &-super-prev-icon`]: {
  386. transform: 'rotate(-45deg)'
  387. },
  388. [`&-next-icon,
  389. &-super-next-icon`]: {
  390. transform: 'rotate(135deg)'
  391. },
  392. // ======================== Body ========================
  393. '&-content': {
  394. width: '100%',
  395. tableLayout: 'fixed',
  396. borderCollapse: 'collapse',
  397. 'th, td': {
  398. position: 'relative',
  399. minWidth: pickerPanelCellHeight,
  400. fontWeight: 'normal'
  401. },
  402. th: {
  403. height: pickerPanelCellHeight + pickerCellPaddingVertical * 2,
  404. color: colorText,
  405. verticalAlign: 'middle'
  406. }
  407. },
  408. '&-cell': (0, _extends2.default)({
  409. padding: `${pickerCellPaddingVertical}px 0`,
  410. color: colorTextDisabled,
  411. cursor: 'pointer',
  412. // In view
  413. '&-in-view': {
  414. color: colorText
  415. }
  416. }, genPickerCellInnerStyle(token)),
  417. // DatePanel only
  418. [`&-date-panel ${componentCls}-cell-in-view${componentCls}-cell-in-range${componentCls}-cell-range-hover-start ${pickerCellInnerCls},
  419. &-date-panel ${componentCls}-cell-in-view${componentCls}-cell-in-range${componentCls}-cell-range-hover-end ${pickerCellInnerCls}`]: {
  420. '&::after': {
  421. position: 'absolute',
  422. top: 0,
  423. bottom: 0,
  424. zIndex: -1,
  425. background: pickerBasicCellHoverWithRangeColor,
  426. transition: `all ${motionDurationSlow}`,
  427. content: '""'
  428. }
  429. },
  430. [`&-date-panel
  431. ${componentCls}-cell-in-view${componentCls}-cell-in-range${componentCls}-cell-range-hover-start
  432. ${pickerCellInnerCls}::after`]: {
  433. insetInlineEnd: -(pickerPanelCellWidth - pickerPanelCellHeight) / 2,
  434. insetInlineStart: 0
  435. },
  436. [`&-date-panel ${componentCls}-cell-in-view${componentCls}-cell-in-range${componentCls}-cell-range-hover-end ${pickerCellInnerCls}::after`]: {
  437. insetInlineEnd: 0,
  438. insetInlineStart: -(pickerPanelCellWidth - pickerPanelCellHeight) / 2
  439. },
  440. // Hover with range start & end
  441. [`&-range-hover${componentCls}-range-start::after`]: {
  442. insetInlineEnd: '50%'
  443. },
  444. [`&-decade-panel,
  445. &-year-panel,
  446. &-quarter-panel,
  447. &-month-panel`]: {
  448. [`${componentCls}-content`]: {
  449. height: pickerPanelWithoutTimeCellHeight * 4
  450. },
  451. [pickerCellInnerCls]: {
  452. padding: `0 ${paddingXS}px`
  453. }
  454. },
  455. '&-quarter-panel': {
  456. [`${componentCls}-content`]: {
  457. height: pickerQuarterPanelContentHeight
  458. }
  459. },
  460. // ======================== Footer ========================
  461. [`&-panel ${componentCls}-footer`]: {
  462. borderTop: `${lineWidth}px ${lineType} ${colorSplit}`
  463. },
  464. '&-footer': {
  465. width: 'min-content',
  466. minWidth: '100%',
  467. lineHeight: `${pickerTextHeight - 2 * lineWidth}px`,
  468. textAlign: 'center',
  469. '&-extra': {
  470. padding: `0 ${paddingSM}`,
  471. lineHeight: `${pickerTextHeight - 2 * lineWidth}px`,
  472. textAlign: 'start',
  473. '&:not(:last-child)': {
  474. borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`
  475. }
  476. }
  477. },
  478. '&-now': {
  479. textAlign: 'start'
  480. },
  481. '&-today-btn': {
  482. color: colorLink,
  483. '&:hover': {
  484. color: colorLinkHover
  485. },
  486. '&:active': {
  487. color: colorLinkActive
  488. },
  489. [`&${componentCls}-today-btn-disabled`]: {
  490. color: colorTextDisabled,
  491. cursor: 'not-allowed'
  492. }
  493. },
  494. // ========================================================
  495. // = Special =
  496. // ========================================================
  497. // ===================== Decade Panel =====================
  498. '&-decade-panel': {
  499. [pickerCellInnerCls]: {
  500. padding: `0 ${paddingXS / 2}px`
  501. },
  502. [`${componentCls}-cell::before`]: {
  503. display: 'none'
  504. }
  505. },
  506. // ============= Year & Quarter & Month Panel =============
  507. [`&-year-panel,
  508. &-quarter-panel,
  509. &-month-panel`]: {
  510. [`${componentCls}-body`]: {
  511. padding: `0 ${paddingXS}px`
  512. },
  513. [pickerCellInnerCls]: {
  514. width: pickerYearMonthCellWidth
  515. },
  516. [`${componentCls}-cell-range-hover-start::after`]: {
  517. insetInlineStart: hoverCellFixedDistance,
  518. borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  519. borderStartStartRadius: borderRadiusSM,
  520. borderBottomStartRadius: borderRadiusSM,
  521. borderStartEndRadius: 0,
  522. borderBottomEndRadius: 0,
  523. [`${componentCls}-panel-rtl &`]: {
  524. insetInlineEnd: hoverCellFixedDistance,
  525. borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  526. borderStartStartRadius: 0,
  527. borderBottomStartRadius: 0,
  528. borderStartEndRadius: borderRadiusSM,
  529. borderBottomEndRadius: borderRadiusSM
  530. }
  531. },
  532. [`${componentCls}-cell-range-hover-end::after`]: {
  533. insetInlineEnd: hoverCellFixedDistance,
  534. borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  535. borderStartStartRadius: 0,
  536. borderEndStartRadius: 0,
  537. borderStartEndRadius: borderRadius,
  538. borderEndEndRadius: borderRadius,
  539. [`${componentCls}-panel-rtl &`]: {
  540. insetInlineStart: hoverCellFixedDistance,
  541. borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
  542. borderStartStartRadius: borderRadius,
  543. borderEndStartRadius: borderRadius,
  544. borderStartEndRadius: 0,
  545. borderEndEndRadius: 0
  546. }
  547. }
  548. },
  549. // ====================== Week Panel ======================
  550. '&-week-panel': {
  551. [`${componentCls}-body`]: {
  552. padding: `${paddingXS}px ${paddingSM}px`
  553. },
  554. // Clear cell style
  555. [`${componentCls}-cell`]: {
  556. [`&:hover ${pickerCellInnerCls},
  557. &-selected ${pickerCellInnerCls},
  558. ${pickerCellInnerCls}`]: {
  559. background: 'transparent !important'
  560. }
  561. },
  562. '&-row': {
  563. td: {
  564. transition: `background ${motionDurationMid}`,
  565. '&:first-child': {
  566. borderStartStartRadius: borderRadiusSM,
  567. borderEndStartRadius: borderRadiusSM
  568. },
  569. '&:last-child': {
  570. borderStartEndRadius: borderRadiusSM,
  571. borderEndEndRadius: borderRadiusSM
  572. }
  573. },
  574. '&:hover td': {
  575. background: controlItemBgHover
  576. },
  577. [`&-selected td,
  578. &-selected:hover td`]: {
  579. background: colorPrimary,
  580. [`&${componentCls}-cell-week`]: {
  581. color: new _tinycolor.TinyColor(colorTextLightSolid).setAlpha(0.5).toHexString()
  582. },
  583. [`&${componentCls}-cell-today ${pickerCellInnerCls}::before`]: {
  584. borderColor: colorTextLightSolid
  585. },
  586. [pickerCellInnerCls]: {
  587. color: colorTextLightSolid
  588. }
  589. }
  590. }
  591. },
  592. // ====================== Date Panel ======================
  593. '&-date-panel': {
  594. [`${componentCls}-body`]: {
  595. padding: `${paddingXS}px ${paddingSM}px`
  596. },
  597. [`${componentCls}-content`]: {
  598. width: pickerPanelCellWidth * 7,
  599. th: {
  600. width: pickerPanelCellWidth
  601. }
  602. }
  603. },
  604. // ==================== Datetime Panel ====================
  605. '&-datetime-panel': {
  606. display: 'flex',
  607. [`${componentCls}-time-panel`]: {
  608. borderInlineStart: `${lineWidth}px ${lineType} ${colorSplit}`
  609. },
  610. [`${componentCls}-date-panel,
  611. ${componentCls}-time-panel`]: {
  612. transition: `opacity ${motionDurationSlow}`
  613. },
  614. // Keyboard
  615. '&-active': {
  616. [`${componentCls}-date-panel,
  617. ${componentCls}-time-panel`]: {
  618. opacity: 0.3,
  619. '&-active': {
  620. opacity: 1
  621. }
  622. }
  623. }
  624. },
  625. // ====================== Time Panel ======================
  626. '&-time-panel': {
  627. width: 'auto',
  628. minWidth: 'auto',
  629. direction: 'ltr',
  630. [`${componentCls}-content`]: {
  631. display: 'flex',
  632. flex: 'auto',
  633. height: pickerTimePanelColumnHeight
  634. },
  635. '&-column': {
  636. flex: '1 0 auto',
  637. width: pickerTimePanelColumnWidth,
  638. margin: `${paddingXXS}px 0`,
  639. padding: 0,
  640. overflowY: 'hidden',
  641. textAlign: 'start',
  642. listStyle: 'none',
  643. transition: `background ${motionDurationMid}`,
  644. overflowX: 'hidden',
  645. '&::after': {
  646. display: 'block',
  647. height: pickerTimePanelColumnHeight - pickerTimePanelCellHeight,
  648. content: '""'
  649. },
  650. '&:not(:first-child)': {
  651. borderInlineStart: `${lineWidth}px ${lineType} ${colorSplit}`
  652. },
  653. '&-active': {
  654. background: new _tinycolor.TinyColor(controlItemBgActive).setAlpha(0.2).toHexString()
  655. },
  656. '&:hover': {
  657. overflowY: 'auto'
  658. },
  659. '> li': {
  660. margin: 0,
  661. padding: 0,
  662. [`&${componentCls}-time-panel-cell`]: {
  663. marginInline: marginXXS,
  664. [`${componentCls}-time-panel-cell-inner`]: {
  665. display: 'block',
  666. width: pickerTimePanelColumnWidth - 2 * marginXXS,
  667. height: pickerTimePanelCellHeight,
  668. margin: 0,
  669. paddingBlock: 0,
  670. paddingInlineEnd: 0,
  671. paddingInlineStart: (pickerTimePanelColumnWidth - pickerTimePanelCellHeight) / 2,
  672. color: colorText,
  673. lineHeight: `${pickerTimePanelCellHeight}px`,
  674. borderRadius: borderRadiusSM,
  675. cursor: 'pointer',
  676. transition: `background ${motionDurationMid}`,
  677. '&:hover': {
  678. background: controlItemBgHover
  679. }
  680. },
  681. '&-selected': {
  682. [`${componentCls}-time-panel-cell-inner`]: {
  683. background: controlItemBgActive
  684. }
  685. },
  686. '&-disabled': {
  687. [`${componentCls}-time-panel-cell-inner`]: {
  688. color: colorTextDisabled,
  689. background: 'transparent',
  690. cursor: 'not-allowed'
  691. }
  692. }
  693. }
  694. }
  695. }
  696. },
  697. // https://github.com/ant-design/ant-design/issues/39227
  698. [`&-datetime-panel ${componentCls}-time-panel-column:after`]: {
  699. height: pickerTimePanelColumnHeight - pickerTimePanelCellHeight + paddingXXS * 2
  700. }
  701. }
  702. };
  703. };
  704. exports.genPanelStyle = genPanelStyle;
  705. const genPickerStatusStyle = token => {
  706. const {
  707. componentCls,
  708. colorBgContainer,
  709. colorError,
  710. colorErrorOutline,
  711. colorWarning,
  712. colorWarningOutline
  713. } = token;
  714. return {
  715. [componentCls]: {
  716. [`&-status-error${componentCls}`]: {
  717. '&, &:not([disabled]):hover': {
  718. backgroundColor: colorBgContainer,
  719. borderColor: colorError
  720. },
  721. '&-focused, &:focus': (0, _extends2.default)({}, (0, _style.genActiveStyle)((0, _internal.mergeToken)(token, {
  722. inputBorderActiveColor: colorError,
  723. inputBorderHoverColor: colorError,
  724. controlOutline: colorErrorOutline
  725. }))),
  726. [`${componentCls}-active-bar`]: {
  727. background: colorError
  728. }
  729. },
  730. [`&-status-warning${componentCls}`]: {
  731. '&, &:not([disabled]):hover': {
  732. backgroundColor: colorBgContainer,
  733. borderColor: colorWarning
  734. },
  735. '&-focused, &:focus': (0, _extends2.default)({}, (0, _style.genActiveStyle)((0, _internal.mergeToken)(token, {
  736. inputBorderActiveColor: colorWarning,
  737. inputBorderHoverColor: colorWarning,
  738. controlOutline: colorWarningOutline
  739. }))),
  740. [`${componentCls}-active-bar`]: {
  741. background: colorWarning
  742. }
  743. }
  744. }
  745. };
  746. };
  747. const genPickerStyle = token => {
  748. const {
  749. componentCls,
  750. antCls,
  751. boxShadowPopoverArrow,
  752. controlHeight,
  753. fontSize,
  754. inputPaddingHorizontal,
  755. colorBgContainer,
  756. lineWidth,
  757. lineType,
  758. colorBorder,
  759. borderRadius,
  760. motionDurationMid,
  761. colorBgContainerDisabled,
  762. colorTextDisabled,
  763. colorTextPlaceholder,
  764. controlHeightLG,
  765. fontSizeLG,
  766. controlHeightSM,
  767. inputPaddingHorizontalSM,
  768. paddingXS,
  769. marginXS,
  770. colorTextDescription,
  771. lineWidthBold,
  772. lineHeight,
  773. colorPrimary,
  774. motionDurationSlow,
  775. zIndexPopup,
  776. paddingXXS,
  777. paddingSM,
  778. pickerTextHeight,
  779. controlItemBgActive,
  780. colorPrimaryBorder,
  781. sizePopupArrow,
  782. borderRadiusXS,
  783. borderRadiusOuter,
  784. colorBgElevated,
  785. borderRadiusLG,
  786. boxShadowSecondary,
  787. borderRadiusSM,
  788. colorSplit,
  789. controlItemBgHover,
  790. presetsWidth,
  791. presetsMaxWidth
  792. } = token;
  793. return [{
  794. [componentCls]: (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, (0, _style2.resetComponent)(token)), genPikerPadding(token, controlHeight, fontSize, inputPaddingHorizontal)), {
  795. position: 'relative',
  796. display: 'inline-flex',
  797. alignItems: 'center',
  798. background: colorBgContainer,
  799. lineHeight: 1,
  800. border: `${lineWidth}px ${lineType} ${colorBorder}`,
  801. borderRadius,
  802. transition: `border ${motionDurationMid}, box-shadow ${motionDurationMid}`,
  803. '&:hover, &-focused': (0, _extends2.default)({}, (0, _style.genHoverStyle)(token)),
  804. '&-focused': (0, _extends2.default)({}, (0, _style.genActiveStyle)(token)),
  805. [`&${componentCls}-disabled`]: {
  806. background: colorBgContainerDisabled,
  807. borderColor: colorBorder,
  808. cursor: 'not-allowed',
  809. [`${componentCls}-suffix`]: {
  810. color: colorTextDisabled
  811. }
  812. },
  813. [`&${componentCls}-borderless`]: {
  814. backgroundColor: 'transparent !important',
  815. borderColor: 'transparent !important',
  816. boxShadow: 'none !important'
  817. },
  818. // ======================== Input =========================
  819. [`${componentCls}-input`]: {
  820. position: 'relative',
  821. display: 'inline-flex',
  822. alignItems: 'center',
  823. width: '100%',
  824. '> input': (0, _extends2.default)((0, _extends2.default)({}, (0, _style.genBasicInputStyle)(token)), {
  825. flex: 'auto',
  826. // Fix Firefox flex not correct:
  827. // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
  828. minWidth: 1,
  829. height: 'auto',
  830. padding: 0,
  831. background: 'transparent',
  832. border: 0,
  833. '&:focus': {
  834. boxShadow: 'none'
  835. },
  836. '&[disabled]': {
  837. background: 'transparent'
  838. }
  839. }),
  840. '&:hover': {
  841. [`${componentCls}-clear`]: {
  842. opacity: 1
  843. }
  844. },
  845. '&-placeholder': {
  846. '> input': {
  847. color: colorTextPlaceholder
  848. }
  849. }
  850. },
  851. // Size
  852. '&-large': (0, _extends2.default)((0, _extends2.default)({}, genPikerPadding(token, controlHeightLG, fontSizeLG, inputPaddingHorizontal)), {
  853. [`${componentCls}-input > input`]: {
  854. fontSize: fontSizeLG
  855. }
  856. }),
  857. '&-small': (0, _extends2.default)({}, genPikerPadding(token, controlHeightSM, fontSize, inputPaddingHorizontalSM)),
  858. [`${componentCls}-suffix`]: {
  859. display: 'flex',
  860. flex: 'none',
  861. alignSelf: 'center',
  862. marginInlineStart: paddingXS / 2,
  863. color: colorTextDisabled,
  864. lineHeight: 1,
  865. pointerEvents: 'none',
  866. '> *': {
  867. verticalAlign: 'top',
  868. '&:not(:last-child)': {
  869. marginInlineEnd: marginXS
  870. }
  871. }
  872. },
  873. [`${componentCls}-clear`]: {
  874. position: 'absolute',
  875. top: '50%',
  876. insetInlineEnd: 0,
  877. color: colorTextDisabled,
  878. lineHeight: 1,
  879. background: colorBgContainer,
  880. transform: 'translateY(-50%)',
  881. cursor: 'pointer',
  882. opacity: 0,
  883. transition: `opacity ${motionDurationMid}, color ${motionDurationMid}`,
  884. '> *': {
  885. verticalAlign: 'top'
  886. },
  887. '&:hover': {
  888. color: colorTextDescription
  889. }
  890. },
  891. [`${componentCls}-separator`]: {
  892. position: 'relative',
  893. display: 'inline-block',
  894. width: '1em',
  895. height: fontSizeLG,
  896. color: colorTextDisabled,
  897. fontSize: fontSizeLG,
  898. verticalAlign: 'top',
  899. cursor: 'default',
  900. [`${componentCls}-focused &`]: {
  901. color: colorTextDescription
  902. },
  903. [`${componentCls}-range-separator &`]: {
  904. [`${componentCls}-disabled &`]: {
  905. cursor: 'not-allowed'
  906. }
  907. }
  908. },
  909. // ======================== Range =========================
  910. '&-range': {
  911. position: 'relative',
  912. display: 'inline-flex',
  913. // Clear
  914. [`${componentCls}-clear`]: {
  915. insetInlineEnd: inputPaddingHorizontal
  916. },
  917. '&:hover': {
  918. [`${componentCls}-clear`]: {
  919. opacity: 1
  920. }
  921. },
  922. // Active bar
  923. [`${componentCls}-active-bar`]: {
  924. bottom: -lineWidth,
  925. height: lineWidthBold,
  926. marginInlineStart: inputPaddingHorizontal,
  927. background: colorPrimary,
  928. opacity: 0,
  929. transition: `all ${motionDurationSlow} ease-out`,
  930. pointerEvents: 'none'
  931. },
  932. [`&${componentCls}-focused`]: {
  933. [`${componentCls}-active-bar`]: {
  934. opacity: 1
  935. }
  936. },
  937. [`${componentCls}-range-separator`]: {
  938. alignItems: 'center',
  939. padding: `0 ${paddingXS}px`,
  940. lineHeight: 1
  941. },
  942. [`&${componentCls}-small`]: {
  943. [`${componentCls}-clear`]: {
  944. insetInlineEnd: inputPaddingHorizontalSM
  945. },
  946. [`${componentCls}-active-bar`]: {
  947. marginInlineStart: inputPaddingHorizontalSM
  948. }
  949. }
  950. },
  951. // ======================= Dropdown =======================
  952. '&-dropdown': (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, (0, _style2.resetComponent)(token)), genPanelStyle(token)), {
  953. position: 'absolute',
  954. // Fix incorrect position of picker popup
  955. // https://github.com/ant-design/ant-design/issues/35590
  956. top: -9999,
  957. left: {
  958. _skip_check_: true,
  959. value: -9999
  960. },
  961. zIndex: zIndexPopup,
  962. [`&${componentCls}-dropdown-hidden`]: {
  963. display: 'none'
  964. },
  965. [`&${componentCls}-dropdown-placement-bottomLeft`]: {
  966. [`${componentCls}-range-arrow`]: {
  967. top: 0,
  968. display: 'block',
  969. transform: 'translateY(-100%)'
  970. }
  971. },
  972. [`&${componentCls}-dropdown-placement-topLeft`]: {
  973. [`${componentCls}-range-arrow`]: {
  974. bottom: 0,
  975. display: 'block',
  976. transform: 'translateY(100%) rotate(180deg)'
  977. }
  978. },
  979. [`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topLeft,
  980. &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topRight,
  981. &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topLeft,
  982. &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topRight`]: {
  983. animationName: _motion.slideDownIn
  984. },
  985. [`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomLeft,
  986. &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomRight,
  987. &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomLeft,
  988. &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomRight`]: {
  989. animationName: _motion.slideUpIn
  990. },
  991. [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topLeft,
  992. &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topRight`]: {
  993. animationName: _motion.slideDownOut
  994. },
  995. [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomLeft,
  996. &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomRight`]: {
  997. animationName: _motion.slideUpOut
  998. },
  999. // Time picker with additional style
  1000. [`${componentCls}-panel > ${componentCls}-time-panel`]: {
  1001. paddingTop: paddingXXS
  1002. },
  1003. // ======================== Ranges ========================
  1004. [`${componentCls}-ranges`]: {
  1005. marginBottom: 0,
  1006. padding: `${paddingXXS}px ${paddingSM}px`,
  1007. overflow: 'hidden',
  1008. lineHeight: `${pickerTextHeight - 2 * lineWidth - paddingXS / 2}px`,
  1009. textAlign: 'start',
  1010. listStyle: 'none',
  1011. display: 'flex',
  1012. justifyContent: 'space-between',
  1013. '> li': {
  1014. display: 'inline-block'
  1015. },
  1016. // https://github.com/ant-design/ant-design/issues/23687
  1017. [`${componentCls}-preset > ${antCls}-tag-blue`]: {
  1018. color: colorPrimary,
  1019. background: controlItemBgActive,
  1020. borderColor: colorPrimaryBorder,
  1021. cursor: 'pointer'
  1022. },
  1023. [`${componentCls}-ok`]: {
  1024. marginInlineStart: 'auto'
  1025. }
  1026. },
  1027. [`${componentCls}-range-wrapper`]: {
  1028. display: 'flex',
  1029. position: 'relative'
  1030. },
  1031. [`${componentCls}-range-arrow`]: (0, _extends2.default)({
  1032. position: 'absolute',
  1033. zIndex: 1,
  1034. display: 'none',
  1035. marginInlineStart: inputPaddingHorizontal * 1.5,
  1036. transition: `left ${motionDurationSlow} ease-out`
  1037. }, (0, _style2.roundedArrow)(sizePopupArrow, borderRadiusXS, borderRadiusOuter, colorBgElevated, boxShadowPopoverArrow)),
  1038. [`${componentCls}-panel-container`]: {
  1039. overflow: 'hidden',
  1040. verticalAlign: 'top',
  1041. background: colorBgElevated,
  1042. borderRadius: borderRadiusLG,
  1043. boxShadow: boxShadowSecondary,
  1044. transition: `margin ${motionDurationSlow}`,
  1045. // ======================== Layout ========================
  1046. [`${componentCls}-panel-layout`]: {
  1047. display: 'flex',
  1048. flexWrap: 'nowrap',
  1049. alignItems: 'stretch'
  1050. },
  1051. // ======================== Preset ========================
  1052. [`${componentCls}-presets`]: {
  1053. display: 'flex',
  1054. flexDirection: 'column',
  1055. minWidth: presetsWidth,
  1056. maxWidth: presetsMaxWidth,
  1057. ul: {
  1058. height: 0,
  1059. flex: 'auto',
  1060. listStyle: 'none',
  1061. overflow: 'auto',
  1062. margin: 0,
  1063. padding: paddingXS,
  1064. borderInlineEnd: `${lineWidth}px ${lineType} ${colorSplit}`,
  1065. li: (0, _extends2.default)((0, _extends2.default)({}, _style2.textEllipsis), {
  1066. borderRadius: borderRadiusSM,
  1067. paddingInline: paddingXS,
  1068. paddingBlock: (controlHeightSM - Math.round(fontSize * lineHeight)) / 2,
  1069. cursor: 'pointer',
  1070. transition: `all ${motionDurationSlow}`,
  1071. '+ li': {
  1072. marginTop: marginXS
  1073. },
  1074. '&:hover': {
  1075. background: controlItemBgHover
  1076. }
  1077. })
  1078. }
  1079. },
  1080. // ======================== Panels ========================
  1081. [`${componentCls}-panels`]: {
  1082. display: 'inline-flex',
  1083. flexWrap: 'nowrap',
  1084. direction: 'ltr',
  1085. [`${componentCls}-panel`]: {
  1086. borderWidth: `0 0 ${lineWidth}px`
  1087. },
  1088. '&:last-child': {
  1089. [`${componentCls}-panel`]: {
  1090. borderWidth: 0
  1091. }
  1092. }
  1093. },
  1094. [`${componentCls}-panel`]: {
  1095. verticalAlign: 'top',
  1096. background: 'transparent',
  1097. borderRadius: 0,
  1098. borderWidth: 0,
  1099. [`${componentCls}-content,
  1100. table`]: {
  1101. textAlign: 'center'
  1102. },
  1103. '&-focused': {
  1104. borderColor: colorBorder
  1105. }
  1106. }
  1107. }
  1108. }),
  1109. '&-dropdown-range': {
  1110. padding: `${sizePopupArrow * 2 / 3}px 0`,
  1111. '&-hidden': {
  1112. display: 'none'
  1113. }
  1114. },
  1115. '&-rtl': {
  1116. direction: 'rtl',
  1117. [`${componentCls}-separator`]: {
  1118. transform: 'rotate(180deg)'
  1119. },
  1120. [`${componentCls}-footer`]: {
  1121. '&-extra': {
  1122. direction: 'rtl'
  1123. }
  1124. }
  1125. }
  1126. })
  1127. },
  1128. // Follow code may reuse in other components
  1129. (0, _motion.initSlideMotion)(token, 'slide-up'), (0, _motion.initSlideMotion)(token, 'slide-down'), (0, _motion.initMoveMotion)(token, 'move-up'), (0, _motion.initMoveMotion)(token, 'move-down')];
  1130. };
  1131. const initPickerPanelToken = token => {
  1132. const pickerTimePanelCellHeight = 28;
  1133. const {
  1134. componentCls,
  1135. controlHeightLG,
  1136. controlHeightSM,
  1137. colorPrimary,
  1138. paddingXXS
  1139. } = token;
  1140. return {
  1141. pickerCellCls: `${componentCls}-cell`,
  1142. pickerCellInnerCls: `${componentCls}-cell-inner`,
  1143. pickerTextHeight: controlHeightLG,
  1144. pickerPanelCellWidth: controlHeightSM * 1.5,
  1145. pickerPanelCellHeight: controlHeightSM,
  1146. pickerDateHoverRangeBorderColor: new _tinycolor.TinyColor(colorPrimary).lighten(20).toHexString(),
  1147. pickerBasicCellHoverWithRangeColor: new _tinycolor.TinyColor(colorPrimary).lighten(35).toHexString(),
  1148. pickerPanelWithoutTimeCellHeight: controlHeightLG * 1.65,
  1149. pickerYearMonthCellWidth: controlHeightLG * 1.5,
  1150. pickerTimePanelColumnHeight: pickerTimePanelCellHeight * 8,
  1151. pickerTimePanelColumnWidth: controlHeightLG * 1.4,
  1152. pickerTimePanelCellHeight,
  1153. pickerQuarterPanelContentHeight: controlHeightLG * 1.4,
  1154. pickerCellPaddingVertical: paddingXXS,
  1155. pickerCellBorderGap: 2,
  1156. pickerControlIconSize: 7,
  1157. pickerControlIconBorderWidth: 1.5
  1158. };
  1159. };
  1160. // ============================== Export ==============================
  1161. exports.initPickerPanelToken = initPickerPanelToken;
  1162. var _default = exports.default = (0, _internal.genComponentStyleHook)('DatePicker', token => {
  1163. const pickerToken = (0, _internal.mergeToken)((0, _style.initInputToken)(token), initPickerPanelToken(token));
  1164. return [genPickerStyle(pickerToken), genPickerStatusStyle(pickerToken),
  1165. // =====================================================
  1166. // == Space Compact ==
  1167. // =====================================================
  1168. (0, _compactItem.genCompactItemStyle)(token, {
  1169. focusElCls: `${token.componentCls}-focused`
  1170. })];
  1171. }, token => ({
  1172. presetsWidth: 120,
  1173. presetsMaxWidth: 200,
  1174. zIndexPopup: token.zIndexPopupBase + 50
  1175. }));