@kdcloudjs/kdesign 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/LICENSE +104 -105
  2. package/dist/default-theme.js +17 -12
  3. package/dist/kdesign-complete.less +3334 -1374
  4. package/dist/kdesign.css +2565 -1931
  5. package/dist/kdesign.css.map +1 -1
  6. package/dist/kdesign.js +783 -112
  7. package/dist/kdesign.js.map +1 -1
  8. package/dist/kdesign.min.css +4 -4
  9. package/dist/kdesign.min.js +6 -6
  10. package/dist/kdesign.min.js.map +1 -1
  11. package/es/alert/style/index.css +32 -30
  12. package/es/alert/style/index.less +36 -37
  13. package/es/alert/style/token.less +29 -0
  14. package/es/anchor/style/index.css +48 -34
  15. package/es/anchor/style/index.less +19 -16
  16. package/es/anchor/style/mixin.less +1 -0
  17. package/es/anchor/style/token.less +33 -0
  18. package/es/avatar/style/index.css +18 -18
  19. package/es/avatar/style/index.less +4 -25
  20. package/es/avatar/style/mixin.less +21 -4
  21. package/es/avatar/style/token.less +20 -0
  22. package/es/badge/style/index.css +38 -29
  23. package/es/badge/style/index.less +28 -30
  24. package/es/badge/style/mixin.less +1 -5
  25. package/es/badge/style/token.less +23 -0
  26. package/es/base-data/style/index.css +25 -16
  27. package/es/base-data/style/index.less +17 -17
  28. package/es/base-data/style/token.less +27 -0
  29. package/es/button/button.d.ts +1 -3
  30. package/es/button/button.js +3 -15
  31. package/es/button/style/index.css +80 -81
  32. package/es/button/style/index.less +43 -51
  33. package/es/button/style/mixin.less +6 -4
  34. package/es/button/style/token.less +88 -0
  35. package/es/card/card.d.ts +1 -0
  36. package/es/card/card.js +4 -1
  37. package/es/card/style/index.css +48 -23
  38. package/es/card/style/index.less +43 -23
  39. package/es/card/style/token.less +28 -0
  40. package/es/carousel/style/index.css +36 -30
  41. package/es/carousel/style/index.less +14 -6
  42. package/es/carousel/style/mixin.less +1 -4
  43. package/es/carousel/style/token.less +20 -0
  44. package/es/cascader/cascader.js +1 -1
  45. package/es/cascader/style/index.css +35 -26
  46. package/es/cascader/style/index.less +24 -23
  47. package/es/cascader/style/token.less +28 -0
  48. package/es/checkbox/style/index.css +86 -80
  49. package/es/checkbox/style/index.less +26 -27
  50. package/es/checkbox/style/token.less +48 -0
  51. package/es/city-picker/style/index.css +24 -14
  52. package/es/city-picker/style/index.less +16 -16
  53. package/es/city-picker/style/token.less +25 -0
  54. package/es/collapse/style/index.css +37 -26
  55. package/es/collapse/style/index.less +7 -5
  56. package/es/collapse/style/mixin.less +1 -5
  57. package/es/collapse/style/token.less +26 -0
  58. package/es/config-provider/compDefaultProps.d.ts +4 -1
  59. package/es/config-provider/compDefaultProps.js +5 -2
  60. package/es/date-picker/style/index.css +81 -72
  61. package/es/date-picker/style/index.less +36 -36
  62. package/es/date-picker/style/mixin.less +20 -18
  63. package/es/date-picker/style/token.less +71 -0
  64. package/es/drawer/drawer.d.ts +0 -1
  65. package/es/drawer/drawer.js +6 -26
  66. package/es/drawer/style/index.css +37 -31
  67. package/es/drawer/style/index.less +24 -39
  68. package/es/drawer/style/token.less +23 -0
  69. package/es/dropdown/dropdown.d.ts +1 -0
  70. package/es/dropdown/dropdown.js +13 -8
  71. package/es/dropdown/menu.d.ts +1 -1
  72. package/es/dropdown/menu.js +3 -3
  73. package/es/dropdown/style/index.css +57 -48
  74. package/es/dropdown/style/index.less +27 -24
  75. package/es/dropdown/style/token.less +26 -0
  76. package/es/empty/defaultEmptyImg.d.ts +2 -0
  77. package/es/empty/defaultEmptyImg.js +92 -0
  78. package/es/empty/empty.d.ts +5 -1
  79. package/es/empty/empty.js +10 -9
  80. package/es/empty/illustrationEmptyImg.d.ts +2 -0
  81. package/es/empty/illustrationEmptyImg.js +439 -0
  82. package/es/empty/style/index.css +12 -3
  83. package/es/empty/style/index.less +1 -1
  84. package/es/empty/style/token.less +12 -0
  85. package/es/filter/style/index.css +44 -32
  86. package/es/filter/style/index.less +34 -32
  87. package/es/filter/style/token.less +28 -0
  88. package/es/form/style/index.css +19 -10
  89. package/es/form/style/index.less +9 -6
  90. package/es/form/style/token.less +27 -0
  91. package/es/grid/style/index.css +9 -0
  92. package/es/image/style/index.css +32 -23
  93. package/es/image/style/index.less +23 -22
  94. package/es/image/style/token.less +45 -0
  95. package/es/image-cropper/style/index.css +9 -0
  96. package/es/image-cropper/style/index.less +1 -1
  97. package/es/index.d.ts +1 -0
  98. package/es/index.js +2 -1
  99. package/es/input/style/index.css +97 -88
  100. package/es/input/style/index.less +34 -31
  101. package/es/input/style/mixin.less +54 -47
  102. package/es/input/style/token.less +46 -0
  103. package/es/input-number/style/css.js +1 -0
  104. package/es/input-number/style/index.css +25 -16
  105. package/es/input-number/style/index.d.ts +1 -0
  106. package/es/input-number/style/index.js +1 -0
  107. package/es/input-number/style/index.less +12 -12
  108. package/es/input-number/style/mixin.less +4 -2
  109. package/es/input-number/style/token.less +20 -0
  110. package/es/layout/style/index.css +41 -32
  111. package/es/layout/style/index.less +9 -8
  112. package/es/layout/style/token.less +30 -0
  113. package/es/link/index.d.ts +3 -0
  114. package/es/link/index.js +3 -0
  115. package/es/link/link.d.ts +18 -0
  116. package/es/link/link.js +89 -0
  117. package/es/link/style/css.js +2 -0
  118. package/es/link/style/index.css +155 -0
  119. package/es/link/style/index.d.ts +2 -0
  120. package/es/link/style/index.js +2 -0
  121. package/es/link/style/index.less +61 -0
  122. package/es/link/style/mixin.less +7 -0
  123. package/es/link/style/token.less +24 -0
  124. package/es/menu/menuItem.js +1 -2
  125. package/es/menu/style/index.css +89 -80
  126. package/es/menu/style/index.less +51 -26
  127. package/es/menu/style/mixin.less +16 -19
  128. package/es/menu/style/token.less +32 -0
  129. package/es/message/style/index.css +23 -13
  130. package/es/message/style/index.less +15 -13
  131. package/es/message/style/token.less +21 -0
  132. package/es/modal/style/index.css +37 -28
  133. package/es/modal/style/index.less +16 -26
  134. package/es/modal/style/mixin.less +2 -0
  135. package/es/modal/style/token.less +46 -0
  136. package/es/notification/content.js +1 -1
  137. package/es/notification/style/index.css +34 -25
  138. package/es/notification/style/index.less +21 -20
  139. package/es/notification/style/token.less +28 -0
  140. package/es/pagination/pagination.js +2 -2
  141. package/es/pagination/style/index.css +159 -159
  142. package/es/pagination/style/index.less +104 -113
  143. package/es/pagination/style/token.less +28 -0
  144. package/es/popconfirm/style/index.css +54 -33
  145. package/es/popconfirm/style/index.less +41 -20
  146. package/es/popconfirm/style/token.less +28 -0
  147. package/es/progress/style/index.css +41 -27
  148. package/es/progress/style/index.less +24 -8
  149. package/es/progress/style/mixin.less +2 -1
  150. package/es/progress/style/token.less +40 -0
  151. package/es/radio/style/index.css +91 -76
  152. package/es/radio/style/index.less +76 -64
  153. package/es/radio/style/token.less +47 -0
  154. package/es/rate/style/index.css +26 -17
  155. package/es/rate/style/index.less +4 -3
  156. package/es/rate/style/token.less +18 -0
  157. package/es/search/style/index.css +103 -82
  158. package/es/search/style/index.less +49 -35
  159. package/es/search/style/mixin.less +4 -2
  160. package/es/search/style/token.less +60 -0
  161. package/es/select/select.js +3 -14
  162. package/es/select/style/index.css +46 -37
  163. package/es/select/style/index.less +10 -10
  164. package/es/select/style/mixin.less +4 -7
  165. package/es/select/style/token.less +43 -0
  166. package/es/slider/slider.js +5 -13
  167. package/es/slider/sliderTooltip.js +0 -1
  168. package/es/slider/style/index.css +21 -12
  169. package/es/slider/style/index.less +10 -10
  170. package/es/slider/style/mixin.less +3 -1
  171. package/es/slider/style/token.less +17 -0
  172. package/es/space/style/index.css +9 -0
  173. package/es/spin/style/index.css +23 -14
  174. package/es/spin/style/index.less +3 -2
  175. package/es/spin/style/mixin.less +1 -0
  176. package/es/spin/style/token.less +15 -0
  177. package/es/split-panel/style/index.css +35 -44
  178. package/es/split-panel/style/index.less +16 -34
  179. package/es/split-panel/style/token.less +23 -0
  180. package/es/stepper/style/index.css +50 -25
  181. package/es/stepper/style/index.less +45 -11
  182. package/es/stepper/style/mixin.less +7 -5
  183. package/es/stepper/style/token.less +28 -0
  184. package/es/steps/Steps.js +4 -1
  185. package/es/steps/style/index.css +74 -37
  186. package/es/steps/style/index.less +281 -189
  187. package/es/steps/style/token.less +31 -0
  188. package/es/style/mixins/index.less +10 -9
  189. package/es/style/mixins/overlay.less +2 -2
  190. package/es/style/themes/default.less +22 -12
  191. package/es/style/themes/token.less +128 -0
  192. package/es/switch/style/index.css +38 -29
  193. package/es/switch/style/index.less +17 -6
  194. package/es/switch/style/mixin.less +6 -5
  195. package/es/switch/style/token.less +45 -0
  196. package/es/tabs/style/index.css +59 -50
  197. package/es/tabs/style/index.less +3 -3
  198. package/es/tabs/style/mixin.less +2 -0
  199. package/es/tabs/style/token.less +32 -0
  200. package/es/tabs/tabs.js +3 -1
  201. package/es/tag/style/index.css +122 -113
  202. package/es/tag/style/index.less +19 -19
  203. package/es/tag/style/mixin.less +2 -1
  204. package/es/tag/style/token.less +42 -0
  205. package/es/timeline/style/index.css +40 -30
  206. package/es/timeline/style/index.less +33 -30
  207. package/es/timeline/style/token.less +45 -0
  208. package/es/tooltip/style/index.css +26 -17
  209. package/es/tooltip/style/index.less +6 -5
  210. package/es/tooltip/style/token.less +20 -0
  211. package/es/transfer/operation.js +2 -2
  212. package/es/transfer/style/index.css +37 -24
  213. package/es/transfer/style/index.less +4 -0
  214. package/es/transfer/style/mixins.less +2 -0
  215. package/es/transfer/style/token.less +29 -0
  216. package/es/tree/style/index.css +37 -37
  217. package/es/tree/style/index.less +8 -20
  218. package/es/tree/style/mixin.less +1 -5
  219. package/es/tree/style/token.less +27 -0
  220. package/es/typography/style/index.css +46 -53
  221. package/es/typography/style/index.less +15 -15
  222. package/es/typography/style/mixin.less +9 -11
  223. package/es/typography/style/token.less +38 -0
  224. package/es/upload/style/index.css +41 -31
  225. package/es/upload/style/index.less +27 -25
  226. package/es/upload/style/token.less +28 -0
  227. package/lib/alert/style/index.css +32 -30
  228. package/lib/alert/style/index.less +36 -37
  229. package/lib/alert/style/token.less +29 -0
  230. package/lib/anchor/style/index.css +48 -34
  231. package/lib/anchor/style/index.less +19 -16
  232. package/lib/anchor/style/mixin.less +1 -0
  233. package/lib/anchor/style/token.less +33 -0
  234. package/lib/avatar/style/index.css +18 -18
  235. package/lib/avatar/style/index.less +4 -25
  236. package/lib/avatar/style/mixin.less +21 -4
  237. package/lib/avatar/style/token.less +20 -0
  238. package/lib/badge/style/index.css +38 -29
  239. package/lib/badge/style/index.less +28 -30
  240. package/lib/badge/style/mixin.less +1 -5
  241. package/lib/badge/style/token.less +23 -0
  242. package/lib/base-data/style/index.css +25 -16
  243. package/lib/base-data/style/index.less +17 -17
  244. package/lib/base-data/style/token.less +27 -0
  245. package/lib/button/button.d.ts +1 -3
  246. package/lib/button/button.js +3 -15
  247. package/lib/button/style/index.css +80 -81
  248. package/lib/button/style/index.less +43 -51
  249. package/lib/button/style/mixin.less +6 -4
  250. package/lib/button/style/token.less +88 -0
  251. package/lib/card/card.d.ts +1 -0
  252. package/lib/card/card.js +4 -1
  253. package/lib/card/style/index.css +48 -23
  254. package/lib/card/style/index.less +43 -23
  255. package/lib/card/style/token.less +28 -0
  256. package/lib/carousel/style/index.css +36 -30
  257. package/lib/carousel/style/index.less +14 -6
  258. package/lib/carousel/style/mixin.less +1 -4
  259. package/lib/carousel/style/token.less +20 -0
  260. package/lib/cascader/cascader.js +1 -1
  261. package/lib/cascader/style/index.css +35 -26
  262. package/lib/cascader/style/index.less +24 -23
  263. package/lib/cascader/style/token.less +28 -0
  264. package/lib/checkbox/style/index.css +86 -80
  265. package/lib/checkbox/style/index.less +26 -27
  266. package/lib/checkbox/style/token.less +48 -0
  267. package/lib/city-picker/style/index.css +24 -14
  268. package/lib/city-picker/style/index.less +16 -16
  269. package/lib/city-picker/style/token.less +25 -0
  270. package/lib/collapse/style/index.css +37 -26
  271. package/lib/collapse/style/index.less +7 -5
  272. package/lib/collapse/style/mixin.less +1 -5
  273. package/lib/collapse/style/token.less +26 -0
  274. package/lib/config-provider/compDefaultProps.d.ts +4 -1
  275. package/lib/config-provider/compDefaultProps.js +5 -2
  276. package/lib/date-picker/style/index.css +81 -72
  277. package/lib/date-picker/style/index.less +36 -36
  278. package/lib/date-picker/style/mixin.less +20 -18
  279. package/lib/date-picker/style/token.less +71 -0
  280. package/lib/drawer/drawer.d.ts +0 -1
  281. package/lib/drawer/drawer.js +6 -26
  282. package/lib/drawer/style/index.css +37 -31
  283. package/lib/drawer/style/index.less +24 -39
  284. package/lib/drawer/style/token.less +23 -0
  285. package/lib/dropdown/dropdown.d.ts +1 -0
  286. package/lib/dropdown/dropdown.js +13 -8
  287. package/lib/dropdown/menu.d.ts +1 -1
  288. package/lib/dropdown/menu.js +3 -3
  289. package/lib/dropdown/style/index.css +57 -48
  290. package/lib/dropdown/style/index.less +27 -24
  291. package/lib/dropdown/style/token.less +26 -0
  292. package/lib/empty/defaultEmptyImg.d.ts +2 -0
  293. package/lib/empty/defaultEmptyImg.js +113 -0
  294. package/lib/empty/empty.d.ts +5 -1
  295. package/lib/empty/empty.js +13 -9
  296. package/lib/empty/illustrationEmptyImg.d.ts +2 -0
  297. package/lib/empty/illustrationEmptyImg.js +460 -0
  298. package/lib/empty/style/index.css +12 -3
  299. package/lib/empty/style/index.less +1 -1
  300. package/lib/empty/style/token.less +12 -0
  301. package/lib/filter/style/index.css +44 -32
  302. package/lib/filter/style/index.less +34 -32
  303. package/lib/filter/style/token.less +28 -0
  304. package/lib/form/style/index.css +19 -10
  305. package/lib/form/style/index.less +9 -6
  306. package/lib/form/style/token.less +27 -0
  307. package/lib/grid/style/index.css +9 -0
  308. package/lib/image/style/index.css +32 -23
  309. package/lib/image/style/index.less +23 -22
  310. package/lib/image/style/token.less +45 -0
  311. package/lib/image-cropper/style/index.css +9 -0
  312. package/lib/image-cropper/style/index.less +1 -1
  313. package/lib/index.d.ts +1 -0
  314. package/lib/index.js +8 -0
  315. package/lib/input/style/index.css +97 -88
  316. package/lib/input/style/index.less +34 -31
  317. package/lib/input/style/mixin.less +54 -47
  318. package/lib/input/style/token.less +46 -0
  319. package/lib/input-number/style/css.js +2 -0
  320. package/lib/input-number/style/index.css +25 -16
  321. package/lib/input-number/style/index.d.ts +1 -0
  322. package/lib/input-number/style/index.js +2 -0
  323. package/lib/input-number/style/index.less +12 -12
  324. package/lib/input-number/style/mixin.less +4 -2
  325. package/lib/input-number/style/token.less +20 -0
  326. package/lib/layout/style/index.css +41 -32
  327. package/lib/layout/style/index.less +9 -8
  328. package/lib/layout/style/token.less +30 -0
  329. package/lib/link/index.d.ts +3 -0
  330. package/lib/link/index.js +36 -0
  331. package/lib/link/link.d.ts +18 -0
  332. package/lib/link/link.js +120 -0
  333. package/lib/link/style/css.js +5 -0
  334. package/lib/link/style/index.css +155 -0
  335. package/lib/link/style/index.d.ts +2 -0
  336. package/lib/link/style/index.js +5 -0
  337. package/lib/link/style/index.less +61 -0
  338. package/lib/link/style/mixin.less +7 -0
  339. package/lib/link/style/token.less +24 -0
  340. package/lib/menu/menuItem.js +1 -2
  341. package/lib/menu/style/index.css +89 -80
  342. package/lib/menu/style/index.less +51 -26
  343. package/lib/menu/style/mixin.less +16 -19
  344. package/lib/menu/style/token.less +32 -0
  345. package/lib/message/style/index.css +23 -13
  346. package/lib/message/style/index.less +15 -13
  347. package/lib/message/style/token.less +21 -0
  348. package/lib/modal/style/index.css +37 -28
  349. package/lib/modal/style/index.less +16 -26
  350. package/lib/modal/style/mixin.less +2 -0
  351. package/lib/modal/style/token.less +46 -0
  352. package/lib/notification/content.js +1 -1
  353. package/lib/notification/style/index.css +34 -25
  354. package/lib/notification/style/index.less +21 -20
  355. package/lib/notification/style/token.less +28 -0
  356. package/lib/pagination/pagination.js +2 -2
  357. package/lib/pagination/style/index.css +159 -159
  358. package/lib/pagination/style/index.less +104 -113
  359. package/lib/pagination/style/token.less +28 -0
  360. package/lib/popconfirm/style/index.css +54 -33
  361. package/lib/popconfirm/style/index.less +41 -20
  362. package/lib/popconfirm/style/token.less +28 -0
  363. package/lib/progress/style/index.css +41 -27
  364. package/lib/progress/style/index.less +24 -8
  365. package/lib/progress/style/mixin.less +2 -1
  366. package/lib/progress/style/token.less +40 -0
  367. package/lib/radio/style/index.css +91 -76
  368. package/lib/radio/style/index.less +76 -64
  369. package/lib/radio/style/token.less +47 -0
  370. package/lib/rate/style/index.css +26 -17
  371. package/lib/rate/style/index.less +4 -3
  372. package/lib/rate/style/token.less +18 -0
  373. package/lib/search/style/index.css +103 -82
  374. package/lib/search/style/index.less +49 -35
  375. package/lib/search/style/mixin.less +4 -2
  376. package/lib/search/style/token.less +60 -0
  377. package/lib/select/select.js +3 -14
  378. package/lib/select/style/index.css +46 -37
  379. package/lib/select/style/index.less +10 -10
  380. package/lib/select/style/mixin.less +4 -7
  381. package/lib/select/style/token.less +43 -0
  382. package/lib/slider/slider.js +5 -13
  383. package/lib/slider/sliderTooltip.js +0 -1
  384. package/lib/slider/style/index.css +21 -12
  385. package/lib/slider/style/index.less +10 -10
  386. package/lib/slider/style/mixin.less +3 -1
  387. package/lib/slider/style/token.less +17 -0
  388. package/lib/space/style/index.css +9 -0
  389. package/lib/spin/style/index.css +23 -14
  390. package/lib/spin/style/index.less +3 -2
  391. package/lib/spin/style/mixin.less +1 -0
  392. package/lib/spin/style/token.less +15 -0
  393. package/lib/split-panel/style/index.css +35 -44
  394. package/lib/split-panel/style/index.less +16 -34
  395. package/lib/split-panel/style/token.less +23 -0
  396. package/lib/stepper/style/index.css +50 -25
  397. package/lib/stepper/style/index.less +45 -11
  398. package/lib/stepper/style/mixin.less +7 -5
  399. package/lib/stepper/style/token.less +28 -0
  400. package/lib/steps/Steps.js +4 -1
  401. package/lib/steps/style/index.css +74 -37
  402. package/lib/steps/style/index.less +281 -189
  403. package/lib/steps/style/token.less +31 -0
  404. package/lib/style/components.less +1 -0
  405. package/lib/style/mixins/index.less +10 -9
  406. package/lib/style/mixins/overlay.less +2 -2
  407. package/lib/style/themes/default.less +22 -12
  408. package/lib/style/themes/token.less +128 -0
  409. package/lib/switch/style/index.css +38 -29
  410. package/lib/switch/style/index.less +17 -6
  411. package/lib/switch/style/mixin.less +6 -5
  412. package/lib/switch/style/token.less +45 -0
  413. package/lib/tabs/style/index.css +59 -50
  414. package/lib/tabs/style/index.less +3 -3
  415. package/lib/tabs/style/mixin.less +2 -0
  416. package/lib/tabs/style/token.less +32 -0
  417. package/lib/tabs/tabs.js +3 -1
  418. package/lib/tag/style/index.css +122 -113
  419. package/lib/tag/style/index.less +19 -19
  420. package/lib/tag/style/mixin.less +2 -1
  421. package/lib/tag/style/token.less +42 -0
  422. package/lib/timeline/style/index.css +40 -30
  423. package/lib/timeline/style/index.less +33 -30
  424. package/lib/timeline/style/token.less +45 -0
  425. package/lib/tooltip/style/index.css +26 -17
  426. package/lib/tooltip/style/index.less +6 -5
  427. package/lib/tooltip/style/token.less +20 -0
  428. package/lib/transfer/operation.js +2 -2
  429. package/lib/transfer/style/index.css +37 -24
  430. package/lib/transfer/style/index.less +4 -0
  431. package/lib/transfer/style/mixins.less +2 -0
  432. package/lib/transfer/style/token.less +29 -0
  433. package/lib/tree/style/index.css +37 -37
  434. package/lib/tree/style/index.less +8 -20
  435. package/lib/tree/style/mixin.less +1 -5
  436. package/lib/tree/style/token.less +27 -0
  437. package/lib/typography/style/index.css +46 -53
  438. package/lib/typography/style/index.less +15 -15
  439. package/lib/typography/style/mixin.less +9 -11
  440. package/lib/typography/style/token.less +38 -0
  441. package/lib/upload/style/index.css +41 -31
  442. package/lib/upload/style/index.less +27 -25
  443. package/lib/upload/style/token.less +28 -0
  444. package/package.json +5 -4
  445. package/es/base-data/style/mixin.less +0 -5
  446. package/es/empty/style/mixin.less +0 -5
  447. package/es/form/style/mixin.less +0 -5
  448. package/es/steps/style/mixin.less +0 -41
  449. package/lib/base-data/style/mixin.less +0 -5
  450. package/lib/empty/style/mixin.less +0 -5
  451. package/lib/form/style/mixin.less +0 -5
  452. package/lib/steps/style/mixin.less +0 -41
@@ -1,22 +1,24 @@
1
+ @import './token.less';
2
+
1
3
  .input-wrapper() {
2
4
  display: inline-flex;
3
- border: 1px solid @strong-border-color;
4
- border-radius: @radius-size;
5
+ border: 1px solid @date-input-color-border;
6
+ border-radius: @date-input-border-radius;
5
7
  box-sizing: border-box;
6
- background-color: @date-background-color;
8
+ background-color: @date-input-color-background;
7
9
  &-borderless {
8
10
  border: 0;
9
11
  }
10
12
  &-underline {
11
13
  border: none;
12
- border-bottom: 1px solid @input-color;
14
+ border-bottom: 1px solid @date-input-underline-color;
13
15
  border-radius: 0;
14
16
  padding-left: 0;
15
17
  }
16
18
  &-disabled {
17
- background-color: @disabled-contain-bg !important;
18
- border-color: @strong-border-color !important;
19
- color: @disabled-color !important;
19
+ background-color: @date-input-color-background-disabled !important;
20
+ border-color: @date-input-color-border !important;
21
+ color: @date-input-color-disabled !important;
20
22
  cursor: not-allowed !important;
21
23
  input {
22
24
  cursor: not-allowed !important;
@@ -24,48 +26,48 @@
24
26
  }
25
27
  &-underline&-disabled,
26
28
  &-borderless&-disabled {
27
- background-color: @date-background-color;
28
- border-color: @strong-border-color;
29
+ background-color: @date-input-color-background;
30
+ border-color: @date-input-color-border;
29
31
  }
30
32
 
31
33
  &-focused {
32
34
  box-shadow: none;
33
35
  outline: none;
34
- border-color: @theme-color;
36
+ border-color: @date-color-background-checked;
35
37
  }
36
38
 
37
39
  &:hover {
38
- border-color: @theme-color;
40
+ border-color: @date-color-background-checked;
39
41
  }
40
42
 
41
43
  &:not(&-disabled) input:focus {
42
- color: @date-focus-color;
44
+ color: @date-input-color-focus;
43
45
  }
44
46
  }
45
47
 
46
48
  .input() {
47
49
  width: 100%;
48
50
  min-width: 0;
49
- color: @date-font-color;
51
+ color: @date-input-color;
50
52
  &::-webkit-input-placeholder {
51
- color: @date-placeholder-color;
53
+ color: @date-input-color-placeholder;
52
54
  }
53
55
  &::-moz-input-placeholder {
54
- color: @date-placeholder-color;
56
+ color: @date-input-color-placeholder;
55
57
  }
56
58
  &::-ms-input-placeholder {
57
- color: @date-placeholder-color;
59
+ color: @date-input-color-placeholder;
58
60
  }
59
61
  &:focus {
60
62
  box-shadow: none;
61
63
  outline: none;
62
- border-color: @theme-color;
64
+ border-color: @date-color-background-checked;
63
65
  }
64
66
  }
65
67
 
66
68
  .input-size(@height, @fonSize, @padding-vertical, @padding-horizontal) {
67
69
  height: @height;
68
- line-height: @height - (@padding-vertical * 2) - (@input-border-width * 2);
70
+ line-height: calc(@height - (@padding-vertical * 2) - 2);
69
71
  font-size: @fonSize;
70
72
  padding: @padding-vertical @padding-horizontal;
71
73
  }
@@ -0,0 +1,71 @@
1
+ @import '../../style/themes/token.less';
2
+
3
+ @date-picker-custom-prefix: ~'--@{kd-prefix}-c-date-picker';
4
+
5
+ // shadow
6
+ // color
7
+ @date-color-background-checked: var(~'@{date-picker-custom-prefix}-color-background-checked', @color-theme);
8
+ @date-wrapper-color-background: var(~'@{date-picker-custom-prefix}-wrapper-color-background', @color-background);
9
+ @date-input-color: var(~'@{date-picker-custom-prefix}-input-color', @color-text-secondary);
10
+ @date-input-color-placeholder: var(~'@{date-picker-custom-prefix}-input-color-placeholder', @color-text-secondary);
11
+ @date-input-underline-color: var(~'@{date-picker-custom-prefix}-input-underline-color', #999);
12
+ @date-input-color-border: var(~'@{date-picker-custom-prefix}-input-color-border', @color-border-strong);
13
+ @date-input-color-disabled: var(~'@{date-picker-custom-prefix}-input-color-disabled', @color-disabled);
14
+ @date-input-color-background: var(~'@{date-picker-custom-prefix}-input-color-background', @color-white);
15
+ @date-input-color-background-disabled: var(~'@{date-picker-custom-prefix}-input-color-background-disabled', @color-background-contain-disabled);
16
+ @date-input-color-focus: var(~'@{date-picker-custom-prefix}-input-color-focused', @color-text-primary);
17
+
18
+ @date-icon-color: var(~'@{date-picker-custom-prefix}-icon-color', @color-disabled);
19
+ @date-clear-background-color: var(~'@{date-picker-custom-prefix}-clear-color-background', @color-background);
20
+ @date-clear-background-color-hover: var(~'@{date-picker-custom-prefix}-clear-color-background-hover', @color-theme-5);
21
+ @date-clear-background-color-focused: var(~'@{date-picker-custom-prefix}-clear-color-background-focused', @color-theme);
22
+ @date-container-color: var(~'@{date-picker-custom-prefix}-container-color', @color-text-primary);
23
+ @date-container-color-border: var(~'@{date-picker-custom-prefix}-container-color-border', @color-border-weak);
24
+ @date-container-color-background: var(~'@{date-picker-custom-prefix}-container-color-background', @color-background-2);
25
+
26
+ @date-footer-color-background: var(~'@{date-picker-custom-prefix}-footer-color-background', @color-background);
27
+
28
+ // sizing
29
+ @date-width: var(~'@{date-picker-custom-prefix}-sizing-width', 230px);
30
+ @date-large-height: var(~'@{date-picker-custom-prefix}-large-sizing-height', 36px); // 大号 高度
31
+ @date-middle-height: var(~'@{date-picker-custom-prefix}-middle-sizing-height', 30px); // 中号 高度
32
+ @date-small-height: var(~'@{date-picker-custom-prefix}-small-sizing-height', 20px); // 小号 高度
33
+ @date-panel-header-height: var(~'@{date-picker-custom-prefix}-panel-header-sizing-height', 36px);
34
+
35
+ // spacing
36
+ @date-small-padding-vertical: var(~'@{date-picker-custom-prefix}-small-spacing-padding-vertical', 4px); // 小号 内间距 纵向
37
+ @date-small-padding-horizontal: var(~'@{date-picker-custom-prefix}-small-spacing-padding-horizontal', 9px); // 小号 内间距 横向
38
+ @date-middle-padding-vertical: var(~'@{date-picker-custom-prefix}-middle-spacing-padding-vertical', 5px); // 中号 内间距 纵向
39
+ @date-middle-padding-horizontal: var(~'@{date-picker-custom-prefix}-middle-spacing-padding-horizontal', 9px); // 中号 内间距 纵向
40
+ @date-large-padding-vertical: var(~'@{date-picker-custom-prefix}-large-spacing-padding-vertical', 8px); // 大号 内间距 纵向
41
+ @date-large-padding-horizontal: var(~'@{date-picker-custom-prefix}-large-spacing-padding-horizontal', 9px); // 大号 内间距 横向
42
+ @date-suffix-spacing-margin-left: var(~'@{date-picker-custom-prefix}-suffix-spacing-margin-left', 10px);
43
+
44
+
45
+ // motion
46
+ // font
47
+ @date-container-font-size: var(~'@{date-picker-custom-prefix}-container-font-size', @font-size-small);
48
+ @date-panel-font-size: var(~'@{date-picker-custom-prefix}-panel-font-size', @font-size-middle);
49
+ @date-small-font-size: var(~'@{date-picker-custom-prefix}-small-font-size', @font-size-small); // 小号 文字大小
50
+ @date-middle-font-size: var(~'@{date-picker-custom-prefix}-middle-font-size', @font-size-middle); // 中号 文字大小
51
+ @date-large-font-size: var(~'@{date-picker-custom-prefix}-large-font-size', @font-size-large); // 大号 文字大小
52
+
53
+ // radius
54
+ @date-input-border-radius: var(~'@{date-picker-custom-prefix}-input-radius-border', @radius-border);
55
+ @date-panel-border-radius: var(~'@{date-picker-custom-prefix}-panel-radius-border', @radius-border);
56
+
57
+ // line-height
58
+ // z-index
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
@@ -21,7 +21,6 @@ export interface IDrawerProps {
21
21
  getContainer?: (() => Element | CSSSelector | false | null) | Element | false;
22
22
  headerStyle?: CSSProperties;
23
23
  headerClassName?: string;
24
- height?: string | number;
25
24
  keyboard?: boolean;
26
25
  mask?: boolean;
27
26
  maskClassName?: string;
@@ -100,7 +100,6 @@ var InternalDrawer = function InternalDrawer(props, ref) {
100
100
  footerClassName = drawerProps.footerClassName,
101
101
  visible = drawerProps.visible,
102
102
  width = drawerProps.width,
103
- height = drawerProps.height,
104
103
  headerStyle = drawerProps.headerStyle,
105
104
  headerClassName = drawerProps.headerClassName,
106
105
  zindex = drawerProps.zIndex,
@@ -118,12 +117,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
118
117
  var _useState3 = (0, _react.useState)(width),
119
118
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
120
119
  currentWidth = _useState4[0],
121
- setCurrentWidth = _useState4[1];
122
-
123
- var _useState5 = (0, _react.useState)(height),
124
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
125
- currentHeight = _useState6[0],
126
- setCurrentHeight = _useState6[1]; // const previousWidthRef = usePrevious(currentWidth)
120
+ setCurrentWidth = _useState4[1]; // const previousWidthRef = usePrevious(currentWidth)
127
121
  // const previousHeightRef = usePrevious(currentHeight)
128
122
 
129
123
 
@@ -162,9 +156,8 @@ var InternalDrawer = function InternalDrawer(props, ref) {
162
156
  }
163
157
  }, [drawerContainer, isBody, isAtOriginalPlace, containerRef]);
164
158
  var handleContainerResize = (0, _react.useCallback)(function (_ref) {
165
- var containerWidth = _ref.width,
166
- containerHeight = _ref.height;
167
- if (!visible && width === currentWidth && height === currentHeight) return;
159
+ var containerWidth = _ref.width;
160
+ if (!visible && width === currentWidth) return;
168
161
 
169
162
  if (containerWidth < currentWidth) {
170
163
  // 这里改成操作DOM?
@@ -174,13 +167,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
174
167
  } else {
175
168
  setCurrentWidth(width);
176
169
  }
177
-
178
- if (containerHeight < currentHeight) {
179
- setCurrentHeight(containerHeight);
180
- } else {
181
- setCurrentHeight(height);
182
- }
183
- }, [width, height, visible, currentWidth, currentHeight]);
170
+ }, [width, visible, currentWidth]);
184
171
  (0, _hooks.useResizeObserver)(function () {
185
172
  var _a;
186
173
 
@@ -191,9 +178,6 @@ var InternalDrawer = function InternalDrawer(props, ref) {
191
178
  (0, _react.useEffect)(function () {
192
179
  setCurrentWidth(width);
193
180
  }, [width]);
194
- (0, _react.useEffect)(function () {
195
- setCurrentHeight(height);
196
- }, [height]);
197
181
  var closeDrawer = (0, _react.useCallback)(function () {
198
182
  onClose && onClose();
199
183
  destroyOnClose && setShowChildren(false);
@@ -225,10 +209,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
225
209
  var containerStyle = (0, _extends3.default)((0, _defineProperty2.default)({}, placement, 0), (0, _includes.default)(horizontalPlacements).call(horizontalPlacements, placement) ? {
226
210
  width: currentWidth,
227
211
  transform: "translateX(".concat(visible ? 0 : transformSize(currentWidth, placement), ")")
228
- } : {
229
- height: currentHeight,
230
- transform: "translateY(".concat(visible ? 0 : transformSize(currentHeight, placement), ")")
231
- });
212
+ } : {});
232
213
 
233
214
  var container = /*#__PURE__*/_react.default.createElement("div", {
234
215
  className: (0, _classnames.default)((_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(drawerPrefixCls, "-container-box"), true), (0, _defineProperty2.default)(_classNames2, "".concat(drawerPrefixCls, "-has-container-box"), drawerContainer), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context2 = "".concat(drawerPrefixCls, "-container-")).call(_context2, placement), true), _classNames2)),
@@ -259,8 +240,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
259
240
  return p !== placement;
260
241
  })[0] : '';
261
242
  var noneMaskStyle = !mask ? {
262
- width: containerStyle.width,
263
- height: containerStyle.height
243
+ width: containerStyle.width
264
244
  } : {};
265
245
 
266
246
  var comp = /*#__PURE__*/_react.default.createElement("div", {
@@ -106,11 +106,20 @@
106
106
  top: 0;
107
107
  bottom: 0;
108
108
  }
109
+ /* ----------- motion ——————---- start */
110
+ /* ----------- motion ——————---- end */
111
+ /* ----------- transition ——————---- start */
112
+ /* ----------- transition ——————---- end */
113
+ /* ----------- zIndex ——————---- start */
114
+ /*
115
+ 普通组件内部自身层级应设置在0-100间
116
+ */
117
+ /* ----------- zIndex ——————---- end */
109
118
  .kd-drawer {
110
119
  display: -webkit-box;
111
120
  display: -ms-flexbox;
112
121
  display: flex;
113
- z-index: 1050;
122
+ z-index: var(--kd-g-z-index-dialog, 1050);
114
123
  position: fixed;
115
124
  left: 0;
116
125
  right: 0;
@@ -120,13 +129,13 @@
120
129
  .kd-drawer-active .kd-drawer-mask {
121
130
  opacity: 1;
122
131
  visibility: visible;
123
- -webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
124
- transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
132
+ -webkit-transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
133
+ transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
125
134
  }
126
135
  .kd-drawer-hide {
127
136
  visibility: hidden;
128
- -webkit-transition: visibility calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
129
- transition: visibility calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
137
+ -webkit-transition: visibility calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
138
+ transition: visibility calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
130
139
  }
131
140
  .kd-drawer-mask {
132
141
  position: fixed;
@@ -137,8 +146,8 @@
137
146
  top: 0;
138
147
  bottom: 0;
139
148
  opacity: 0;
140
- -webkit-transition: opacity calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
141
- transition: opacity calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
149
+ -webkit-transition: opacity calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
150
+ transition: opacity calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
142
151
  }
143
152
  .kd-drawer-not-at-body {
144
153
  position: absolute;
@@ -146,22 +155,21 @@
146
155
  .kd-drawer-not-at-body .kd-drawer-mask {
147
156
  position: absolute;
148
157
  }
149
- .kd-drawer-container-left {
150
- top: 0;
151
- bottom: 0;
152
- }
158
+ .kd-drawer-container-left,
153
159
  .kd-drawer-container-right {
154
160
  top: 0;
155
161
  bottom: 0;
156
162
  }
157
- .kd-drawer-container-top {
158
- left: 0;
159
- right: 0;
160
- }
163
+ .kd-drawer-container-top,
161
164
  .kd-drawer-container-bottom {
162
165
  left: 0;
163
166
  right: 0;
164
167
  }
168
+ .kd-drawer-container-top .kd-drawer-body,
169
+ .kd-drawer-container-bottom .kd-drawer-body {
170
+ max-height: var(--kd-c-drawer-body-max-height-vertical, 470px);
171
+ overflow-y: auto;
172
+ }
165
173
  .kd-drawer-container-box {
166
174
  display: -webkit-box;
167
175
  display: -ms-flexbox;
@@ -171,11 +179,11 @@
171
179
  -webkit-box-direction: normal;
172
180
  -ms-flex-direction: column;
173
181
  flex-direction: column;
174
- background: #fff;
182
+ background: var(--kd-c-drawer-color-background, var(--kd-g-color-background, #fff));
175
183
  -webkit-box-shadow: -4px 0 10px 0 rgba(0, 0, 0, 0.1);
176
184
  box-shadow: -4px 0 10px 0 rgba(0, 0, 0, 0.1);
177
- -webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
178
- transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
185
+ -webkit-transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
186
+ transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
179
187
  }
180
188
  .kd-drawer-container-box .kd-drawer-header {
181
189
  display: -webkit-box;
@@ -187,24 +195,21 @@
187
195
  -webkit-box-align: center;
188
196
  -ms-flex-align: center;
189
197
  align-items: center;
190
- border-bottom: 1px solid #cccccc;
191
- min-height: 50px;
192
- background: #fff;
193
- font-size: 18px;
194
- color: #333333;
198
+ padding: var(--kd-c-drawer-header-sizing-padding-vertical, 12px) var(--kd-c-drawer-header-sizing-padding-horizontal, 16px);
199
+ border-bottom: var(--kd-c-drawer-dividing-sizing-width, 1px) solid var(--kd-c-drawer-dividing-color-border, var(--kd-g-color-border-disabled, #ccc));
195
200
  }
196
201
  .kd-drawer-container-box .kd-drawer-header .kd-drawer-title {
197
- margin-left: 20px;
198
- font-size: 18px;
199
202
  letter-spacing: 0;
200
203
  line-height: 26px;
204
+ font-size: var(--kd-c-drawer-title-font-size, var(--kd-g-font-size-x-large, 18px));
205
+ color: var(--kd-c-drawer-title-color-text, var(--kd-g-color-text-primary, #212121));
201
206
  }
202
207
  .kd-drawer-container-box .kd-drawer-header .kd-drawer-close-icon {
203
- margin-right: 10px;
204
208
  cursor: pointer;
205
209
  }
206
210
  .kd-drawer-container-box .kd-drawer-header .kd-drawer-close-icon i {
207
- font-size: 26px;
211
+ color: var(--kd-c-drawer-close-icon-color-text, var(--kd-g-color-text-secondary, #666));
212
+ font-size: var(--kd-c-drawer-close-icon-font-size, var(--kd-g-font-size-large, 16px));
208
213
  }
209
214
  .kd-drawer-container-box .kd-drawer-body {
210
215
  display: -webkit-box;
@@ -217,14 +222,15 @@
217
222
  -webkit-box-direction: normal;
218
223
  -ms-flex-direction: column;
219
224
  flex-direction: column;
220
- font-size: 14px;
221
- color: #333333;
225
+ padding: var(--kd-c-drawer-body-sizing-padding, 16px);
226
+ font-size: var(--kd-g-font-size-middle, 14px);
227
+ color: var(--kd-g-color-text-primary, #212121);
222
228
  }
223
229
  .kd-drawer-container-box .kd-drawer-footer {
224
230
  display: -webkit-box;
225
231
  display: -ms-flexbox;
226
232
  display: flex;
227
233
  min-height: 40px;
228
- font-size: 12px;
229
- color: #333333;
234
+ font-size: var(--kd-g-font-size-small, 12px);
235
+ color: var(--kd-g-color-text-primary, #212121);
230
236
  }
@@ -1,43 +1,30 @@
1
1
  @import '../../style/themes/index';
2
2
  @import './mixin.less';
3
3
  @import '../../style/mixins/overlay';
4
+ @import './token.less';
4
5
 
5
6
  @drawer-prefix-cls: ~'@{kd-prefix}-drawer';
6
7
 
7
- @placement-left: left;
8
- @placement-right: right;
9
- @placement-top: top;
10
- @placement-bottom: bottom;
11
-
12
- @drawer-title-font-size: 18px;
13
- @drawer-title-font-color: #333333;
14
- @drawer-dividing-width: 1px;
15
- @drawer-dividing-color: #cccccc;
16
- @drawer-body-font-size: 14px;
17
- @drawer-body-font-color: #333333;
18
- @drawer-footer-font-size: 12px;
19
- @drawer-footer-font-color: #333333;
20
-
21
8
  .@{drawer-prefix-cls} {
22
9
  display: flex;
23
- z-index: @zIndex-dialog;
10
+ z-index: @z-index-dialog;
24
11
  &-active {
25
12
  .@{drawer-prefix-cls}-mask {
26
13
  opacity: 1;
27
14
  visibility: visible;
28
- transition: all calc(@transition-duration - 0.1s) @ease-out;
15
+ transition: all calc(@duration-promptly - 0.1s) @motion-ease-out;
29
16
  }
30
17
  }
31
18
  &-hide {
32
19
  visibility: hidden;
33
- transition: visibility calc(@transition-duration - 0.1s) @ease-out;
20
+ transition: visibility calc(@duration-promptly - 0.1s) @motion-ease-out;
34
21
  }
35
22
  position: fixed;
36
23
  .overall-postion();
37
24
  &-mask {
38
25
  .overlay(rgba(55, 55, 55, 0.5), 0);
39
26
  opacity: 0;
40
- transition: opacity calc(@transition-duration - 0.1s) @ease-out;
27
+ transition: opacity calc(@duration-promptly - 0.1s) @motion-ease-out;
41
28
  }
42
29
  &-not-at-body {
43
30
  position: absolute;
@@ -45,46 +32,43 @@
45
32
  position: absolute;
46
33
  }
47
34
  }
48
- &-container-left {
49
- .drawer-container-placement-horizontal();
50
- }
35
+ &-container-left,
51
36
  &-container-right {
52
37
  .drawer-container-placement-horizontal();
53
38
  }
54
- &-container-top {
55
- .drawer-container-placement-vertical();
56
- }
39
+ &-container-top,
57
40
  &-container-bottom {
58
41
  .drawer-container-placement-vertical();
42
+ .@{drawer-prefix-cls}-body {
43
+ max-height: @drawer-body-max-height-vertical;
44
+ overflow-y: auto;
45
+ }
59
46
  }
60
47
 
61
48
  &-container-box {
62
49
  display: flex;
63
50
  position: absolute;
64
51
  flex-direction: column;
65
- background: @bg;
52
+ background: @drawer-bg;
66
53
  box-shadow: -4px 0 10px 0 rgba(0, 0, 0, 0.1);
67
- transition: all calc(@transition-duration - 0.1s) @ease-out;
54
+ transition: all calc(@duration-promptly - 0.1s) @motion-ease-out;
68
55
  .@{drawer-prefix-cls}-header {
69
56
  display: flex;
70
57
  justify-content: space-between;
71
58
  align-items: center;
72
- border-bottom: 1px solid @drawer-dividing-color;
73
- min-height: 50px;
74
- background: @bg;
75
- font-size: @drawer-title-font-size;
76
- color: @drawer-title-font-color;
59
+ padding: @drawer-header-padding-vertical @drawer-header-padding-horizontal;
60
+ border-bottom: @drawer-dividing-width solid @drawer-dividing-color;
77
61
  .@{drawer-prefix-cls}-title {
78
- margin-left: 20px;
79
- font-size: @drawer-title-font-size;
80
62
  letter-spacing: 0;
81
63
  line-height: 26px;
64
+ font-size: @drawer-title-font-size;
65
+ color: @drawer-title-font-color;
82
66
  }
83
67
  .@{drawer-prefix-cls}-close-icon {
84
68
  i {
85
- font-size: 26px;
69
+ color: @drawer-close-icon-color;
70
+ font-size: @drawer-close-icon-font-size;
86
71
  }
87
- margin-right: 10px;
88
72
  cursor: pointer;
89
73
  }
90
74
  }
@@ -92,14 +76,15 @@
92
76
  display: flex;
93
77
  flex-grow: 1;
94
78
  flex-direction: column;
95
- font-size: @drawer-body-font-size;
96
- color: @drawer-body-font-color;
79
+ padding: @drawer-body-padding;
80
+ font-size: @font-size-middle;
81
+ color: @color-text-primary;
97
82
  }
98
83
  .@{drawer-prefix-cls}-footer {
99
84
  display: flex;
100
85
  min-height: 40px;
101
- font-size: @drawer-footer-font-size;
102
- color: @drawer-footer-font-color;
86
+ font-size: @font-size-small;
87
+ color: @color-text-primary;
103
88
  }
104
89
  }
105
90
  }
@@ -0,0 +1,23 @@
1
+
2
+ @import '../../style/themes/token.less';
3
+
4
+ @drawer-custom-prefix: ~'--@{kd-prefix}-c-drawer';
5
+
6
+ // color
7
+ @drawer-bg: var(~'@{drawer-custom-prefix}-color-background', @color-background);
8
+ @drawer-title-font-color: var(~'@{drawer-custom-prefix}-title-color-text', @color-text-primary);
9
+ @drawer-dividing-color: var(~'@{drawer-custom-prefix}-dividing-color-border', @color-border-disabled);
10
+ @drawer-close-icon-color: var(~'@{drawer-custom-prefix}-close-icon-color-text', @color-text-secondary);
11
+
12
+ // font
13
+ @drawer-title-font-size: var(~'@{drawer-custom-prefix}-title-font-size', @font-size-x-large);
14
+ @drawer-close-icon-font-size: var(~'@{drawer-custom-prefix}-close-icon-font-size', @font-size-large);
15
+
16
+ // sizing
17
+ @drawer-body-max-height-vertical: var(~'@{drawer-custom-prefix}-body-max-height-vertical', 470px);
18
+ @drawer-dividing-width: var(~'@{drawer-custom-prefix}-dividing-sizing-width', 1px);
19
+
20
+ // spacing
21
+ @drawer-header-padding-vertical: var(~'@{drawer-custom-prefix}-header-sizing-padding-vertical', 12px);
22
+ @drawer-header-padding-horizontal: var(~'@{drawer-custom-prefix}-header-sizing-padding-horizontal', 16px);
23
+ @drawer-body-padding: var(~'@{drawer-custom-prefix}-body-sizing-padding', 16px);
@@ -12,6 +12,7 @@ declare type MenuItem = {
12
12
  };
13
13
  export interface DropDownProps extends PopperProps {
14
14
  defaultKey?: string;
15
+ selectedKey?: string;
15
16
  selectable?: boolean;
16
17
  children?: React.ReactNode;
17
18
  onItemClick?: (key: string) => void;
@@ -72,32 +72,37 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
72
72
  });
73
73
  var isMenu = menu.type === _menu.Menu;
74
74
 
75
- var _React$useState3 = React.useState(((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
75
+ var _React$useState3 = React.useState(props.selectedKey || ((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
76
76
  _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
77
- defaultKey = _React$useState4[0],
78
- setKeyValue = _React$useState4[1];
77
+ selectedKey = _React$useState4[0],
78
+ setSelectedKey = _React$useState4[1];
79
79
 
80
+ React.useEffect(function () {
81
+ setSelectedKey(props.selectedKey);
82
+ }, [props.selectedKey]);
80
83
  var menuSelectable = ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.selectable) === undefined ? selectable : (_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable;
81
84
 
82
85
  var handleItemClick = function handleItemClick(e) {
83
86
  var _a, _b;
84
87
 
85
- var key = ((_a = e.target.dataset) === null || _a === void 0 ? void 0 : _a.key) || ((_b = e.target.parentNode.dataset) === null || _b === void 0 ? void 0 : _b.key);
88
+ var currentTarget = e.target;
89
+ var parentTarget = currentTarget.parentNode;
90
+ var key = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a.key) || ((_b = currentTarget.parentNode.dataset) === null || _b === void 0 ? void 0 : _b.key);
86
91
 
87
- if (e.target.className.indexOf('disabled') === -1 && key) {
92
+ if (currentTarget.className.indexOf('disabled') === -1 && parentTarget.className.indexOf('disabled') === -1 && key) {
88
93
  if (isMenu && menu.props.onClick) {
89
94
  menu.props.onClick(key);
90
95
  } else if (onItemClick) {
91
96
  onItemClick(key);
92
97
  }
93
98
 
94
- menuSelectable && setKeyValue(key);
99
+ menuSelectable && setSelectedKey(key);
95
100
  props.visible === undefined && setVisible(false);
96
101
  }
97
102
  };
98
103
 
99
104
  var menuElement = isMenu ? /*#__PURE__*/React.cloneElement(menu, {
100
- defaultKey: defaultKey,
105
+ selectedKey: selectedKey,
101
106
  onClick: handleItemClick,
102
107
  selectable: menuSelectable
103
108
  }) : /*#__PURE__*/React.createElement("ul", {
@@ -117,7 +122,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
117
122
  rel: 'noopener noreferrer'
118
123
  };
119
124
  var key = itemKey || label;
120
- var selected = selectable && String(defaultKey) === String(key);
125
+ var selected = selectable && String(selectedKey) === String(key);
121
126
  return /*#__PURE__*/React.createElement("li", {
122
127
  title: label,
123
128
  key: key,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  export interface MenuProps {
3
- defaultKey?: string;
3
+ selectedKey?: string;
4
4
  className?: string;
5
5
  selectable?: boolean;
6
6
  style?: React.CSSProperties;
@@ -57,16 +57,16 @@ var Menu = /*#__PURE__*/React.forwardRef(function (props, ref) {
57
57
  customPrefixcls = _a.prefixCls,
58
58
  children = _a.children,
59
59
  selectable = _a.selectable,
60
- defaultKey = _a.defaultKey,
60
+ selectedKey = _a.selectedKey,
61
61
  className = _a.className,
62
- restProps = __rest(_a, ["prefixCls", "children", "selectable", "defaultKey", "className"]); // className前缀
62
+ restProps = __rest(_a, ["prefixCls", "children", "selectable", "selectedKey", "className"]); // className前缀
63
63
 
64
64
 
65
65
  var prefixCls = getPrefixCls(pkgPrefixCls, 'dropdown-menu', customPrefixcls);
66
66
 
67
67
  var cloneItem = function cloneItem(item, index) {
68
68
  var key = item.key || index;
69
- var selected = selectable && String(defaultKey) === String(key);
69
+ var selected = selectable && String(selectedKey) === String(key);
70
70
  return /*#__PURE__*/React.cloneElement(item, {
71
71
  key: key,
72
72
  selected: selected,