bkui-vue 0.0.2-beta.14 → 0.0.2-beta.141

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 (505) hide show
  1. package/dist/index.cjs.js +142 -160
  2. package/dist/index.esm.js +18004 -19937
  3. package/dist/index.umd.js +142 -160
  4. package/dist/locale/en.esm.js +1 -1
  5. package/dist/locale/en.esm.js.map +1 -1
  6. package/dist/locale/en.umd.js +1 -1
  7. package/dist/locale/en.umd.js.map +1 -1
  8. package/dist/locale/zh-cn.esm.js +1 -1
  9. package/dist/locale/zh-cn.esm.js.map +1 -1
  10. package/dist/locale/zh-cn.umd.js +1 -1
  11. package/dist/locale/zh-cn.umd.js.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/style.variable.css +1 -1
  14. package/lib/affix/affix.d.ts +1 -1
  15. package/lib/affix/affix.variable.css +6 -2
  16. package/lib/affix/index.d.ts +4 -4
  17. package/lib/affix/index.js +322 -1
  18. package/lib/alert/alert.css +7 -0
  19. package/lib/alert/alert.d.ts +5 -5
  20. package/lib/alert/alert.less +16 -6
  21. package/lib/alert/alert.variable.css +13 -2
  22. package/lib/alert/index.d.ts +10 -10
  23. package/lib/alert/index.js +215 -1
  24. package/lib/animate-number/index.d.ts +1 -1
  25. package/lib/animate-number/index.js +155 -1
  26. package/lib/backtop/backtop.css +8 -8
  27. package/lib/backtop/backtop.less +3 -1
  28. package/lib/backtop/backtop.variable.css +17 -13
  29. package/lib/backtop/index.d.ts +1 -1
  30. package/lib/backtop/index.js +189 -1
  31. package/lib/badge/badge.css +8 -2
  32. package/lib/badge/badge.d.ts +2 -2
  33. package/lib/badge/badge.less +8 -4
  34. package/lib/badge/badge.variable.css +14 -4
  35. package/lib/badge/index.d.ts +7 -7
  36. package/lib/badge/index.js +236 -1
  37. package/lib/breadcrumb/breadcrumb.css +4 -4
  38. package/lib/breadcrumb/breadcrumb.variable.css +10 -6
  39. package/lib/breadcrumb/index.d.ts +2 -2
  40. package/lib/breadcrumb/index.js +310 -1
  41. package/lib/button/button-group.d.ts +2 -2
  42. package/lib/button/button.css +30 -7
  43. package/lib/button/button.d.ts +1 -1
  44. package/lib/button/button.less +29 -13
  45. package/lib/button/button.variable.css +44 -17
  46. package/lib/button/index.d.ts +7 -7
  47. package/lib/button/index.js +329 -1
  48. package/lib/card/card.css +11 -11
  49. package/lib/card/card.d.ts +1 -1
  50. package/lib/card/card.less +7 -7
  51. package/lib/card/card.variable.css +17 -13
  52. package/lib/card/index.d.ts +4 -4
  53. package/lib/card/index.js +292 -1
  54. package/lib/cascader/cascader-panel.d.ts +1 -0
  55. package/lib/cascader/cascader.css +7 -7
  56. package/lib/cascader/cascader.d.ts +1 -0
  57. package/lib/cascader/cascader.less +4 -6
  58. package/lib/cascader/cascader.variable.css +13 -9
  59. package/lib/cascader/index.d.ts +6 -2
  60. package/lib/cascader/index.js +2072 -2
  61. package/lib/cascader/interface.d.ts +1 -1
  62. package/lib/checkbox/checkbox-group.d.ts +6 -3
  63. package/lib/checkbox/checkbox.css +13 -1
  64. package/lib/checkbox/checkbox.d.ts +15 -12
  65. package/lib/checkbox/checkbox.less +15 -1
  66. package/lib/checkbox/checkbox.variable.css +19 -3
  67. package/lib/checkbox/common.d.ts +1 -0
  68. package/lib/checkbox/index.d.ts +43 -31
  69. package/lib/checkbox/index.js +570 -1
  70. package/lib/code-diff/code-diff.variable.css +6 -2
  71. package/lib/code-diff/index.d.ts +1 -1
  72. package/lib/code-diff/index.js +5502 -1
  73. package/lib/collapse/collapse.variable.css +6 -2
  74. package/lib/collapse/index.d.ts +2 -2
  75. package/lib/collapse/index.js +571 -1
  76. package/lib/collapse-transition/collapse-transition.variable.css +6 -2
  77. package/lib/collapse-transition/index.d.ts +128 -2
  78. package/lib/collapse-transition/index.js +177 -1
  79. package/lib/color-picker/color-picker.d.ts +16 -0
  80. package/lib/color-picker/color-picker.variable.css +6 -2
  81. package/lib/color-picker/components/recommend-colors.d.ts +16 -0
  82. package/lib/color-picker/index.d.ts +19 -1
  83. package/lib/color-picker/index.js +2666 -1
  84. package/lib/components.js +530 -1
  85. package/lib/config-provider/config-provider.d.ts +21 -0
  86. package/lib/config-provider/config-provider.variable.css +6 -2
  87. package/lib/config-provider/index.d.ts +29 -1
  88. package/lib/config-provider/index.js +365 -1
  89. package/lib/config-provider/token.d.ts +7 -0
  90. package/lib/config-provider/use-global-config.d.ts +2 -0
  91. package/lib/config-provider/use-prefix.d.ts +2 -0
  92. package/lib/container/container.css +4 -4
  93. package/lib/container/container.variable.css +10 -6
  94. package/lib/container/index.d.ts +2 -2
  95. package/lib/container/index.js +392 -1
  96. package/lib/date-picker/common.d.ts +2 -0
  97. package/lib/date-picker/date-picker.d.ts +6 -2
  98. package/lib/date-picker/date-picker.variable.css +6 -2
  99. package/lib/date-picker/index.d.ts +21 -8
  100. package/lib/date-picker/index.js +5636 -1
  101. package/lib/date-picker/panel/date-range.d.ts +2 -1
  102. package/lib/date-picker/panel/date.d.ts +2 -2
  103. package/lib/date-picker/panel/time-range.d.ts +17 -0
  104. package/lib/date-picker/panel/time.d.ts +17 -1
  105. package/lib/date-picker/time-picker.d.ts +3 -1
  106. package/lib/dialog/dialog.css +9 -6
  107. package/lib/dialog/dialog.less +7 -6
  108. package/lib/dialog/dialog.variable.css +15 -8
  109. package/lib/dialog/index.d.ts +1 -1
  110. package/lib/dialog/index.js +984 -2
  111. package/lib/directives/index.js +1387 -2
  112. package/lib/directives/tooltips.d.ts +2 -2
  113. package/lib/dist.index.js +87 -1
  114. package/lib/divider/divider.variable.css +6 -2
  115. package/lib/divider/index.d.ts +1 -1
  116. package/lib/divider/index.js +170 -1
  117. package/lib/dropdown/dropdown.css +2 -1
  118. package/lib/dropdown/dropdown.variable.css +8 -3
  119. package/lib/dropdown/index.d.ts +2 -2
  120. package/lib/dropdown/index.js +376 -1
  121. package/lib/exception/exception.variable.css +6 -2
  122. package/lib/exception/index.d.ts +2 -2
  123. package/lib/exception/index.js +386 -1
  124. package/lib/fixed-navbar/fixed-navbar.variable.css +6 -2
  125. package/lib/fixed-navbar/index.d.ts +1 -1
  126. package/lib/fixed-navbar/index.js +155 -1
  127. package/lib/form/form.css +2 -1
  128. package/lib/form/form.less +3 -2
  129. package/lib/form/form.variable.css +8 -3
  130. package/lib/form/index.d.ts +3 -3
  131. package/lib/form/index.js +953 -1
  132. package/lib/hooks.d.ts +1 -1
  133. package/lib/hooks.js +73 -1
  134. package/lib/icon/angle-double-down-line.js +191 -1
  135. package/lib/icon/angle-double-left-line.js +191 -1
  136. package/lib/icon/angle-double-left.js +191 -1
  137. package/lib/icon/angle-double-right-line.js +191 -1
  138. package/lib/icon/angle-double-right.js +191 -1
  139. package/lib/icon/angle-double-up-line.js +191 -1
  140. package/lib/icon/angle-down-fill.js +191 -1
  141. package/lib/icon/angle-down-line.js +191 -1
  142. package/lib/icon/angle-down.js +191 -1
  143. package/lib/icon/angle-left.js +191 -1
  144. package/lib/icon/angle-right.js +191 -1
  145. package/lib/icon/angle-up-fill.js +191 -1
  146. package/lib/icon/angle-up.js +191 -1
  147. package/lib/icon/archive-fill.js +191 -1
  148. package/lib/icon/arrows-left.js +191 -1
  149. package/lib/icon/arrows-right.js +191 -1
  150. package/lib/icon/assistant.d.ts +4 -0
  151. package/lib/icon/assistant.js +191 -0
  152. package/lib/icon/audio-fill.js +191 -1
  153. package/lib/icon/bk.js +191 -1
  154. package/lib/icon/circle.js +191 -1
  155. package/lib/icon/close-line.js +191 -1
  156. package/lib/icon/close.js +191 -1
  157. package/lib/icon/code.js +191 -1
  158. package/lib/icon/cog-shape.js +191 -1
  159. package/lib/icon/collapse-left.js +191 -1
  160. package/lib/icon/copy-shape.js +191 -1
  161. package/lib/icon/copy.js +191 -1
  162. package/lib/icon/data-shape.js +191 -1
  163. package/lib/icon/del.js +191 -1
  164. package/lib/icon/doc-fill.js +191 -1
  165. package/lib/icon/done.js +191 -1
  166. package/lib/icon/down-shape.js +191 -1
  167. package/lib/icon/down-small.js +191 -1
  168. package/lib/icon/edit-line.js +191 -1
  169. package/lib/icon/ellipsis.js +191 -1
  170. package/lib/icon/enlarge-line.js +191 -1
  171. package/lib/icon/error.js +191 -1
  172. package/lib/icon/excel-fill.js +191 -1
  173. package/lib/icon/exclamation-circle-shape.js +191 -1
  174. package/lib/icon/eye.js +191 -1
  175. package/lib/icon/filliscreen-line.js +191 -1
  176. package/lib/icon/fix-line.js +191 -1
  177. package/lib/icon/fix-shape.js +191 -1
  178. package/lib/icon/folder-open.js +191 -1
  179. package/lib/icon/folder-shape-open.js +191 -1
  180. package/lib/icon/folder-shape.js +191 -1
  181. package/lib/icon/folder.js +191 -1
  182. package/lib/icon/funnel.js +191 -1
  183. package/lib/icon/help-document-fill.js +191 -1
  184. package/lib/icon/help-fill.js +191 -1
  185. package/lib/icon/help.js +191 -1
  186. package/lib/icon/image-fill.js +276 -1
  187. package/lib/icon/img-error.js +276 -1
  188. package/lib/icon/img-placehoulder.js +276 -1
  189. package/lib/icon/index.d.ts +2 -0
  190. package/lib/icon/index.js +2432 -1
  191. package/lib/icon/info-line.js +276 -1
  192. package/lib/icon/info.js +276 -1
  193. package/lib/icon/left-shape.js +276 -1
  194. package/lib/icon/left-turn-line.js +276 -1
  195. package/lib/icon/loading.d.ts +4 -0
  196. package/lib/icon/loading.js +276 -0
  197. package/lib/icon/narrow-line.js +276 -1
  198. package/lib/icon/original.js +276 -1
  199. package/lib/icon/pdf-fill.js +276 -1
  200. package/lib/icon/play-shape.js +276 -1
  201. package/lib/icon/plus.js +276 -1
  202. package/lib/icon/ppt-fill.js +276 -1
  203. package/lib/icon/qq.js +276 -1
  204. package/lib/icon/right-shape.js +276 -1
  205. package/lib/icon/right-turn-line.js +276 -1
  206. package/lib/icon/search.js +276 -1
  207. package/lib/icon/share.js +276 -1
  208. package/lib/icon/spinner.js +276 -1
  209. package/lib/icon/success.js +276 -1
  210. package/lib/icon/switcher-loading.js +276 -1
  211. package/lib/icon/text-file.js +276 -1
  212. package/lib/icon/text-fill.js +276 -1
  213. package/lib/icon/transfer.js +276 -1
  214. package/lib/icon/tree-application-shape.js +276 -1
  215. package/lib/icon/unfull-screen.js +276 -1
  216. package/lib/icon/unvisible.js +276 -1
  217. package/lib/icon/up-shape.js +276 -1
  218. package/lib/icon/upload.js +276 -1
  219. package/lib/icon/video-fill.js +276 -1
  220. package/lib/icon/warn.js +276 -1
  221. package/lib/icon/weixin-pro.js +276 -1
  222. package/lib/icon/weixin.js +276 -1
  223. package/lib/image/image-viewer.variable.css +6 -2
  224. package/lib/image/image.variable.css +6 -2
  225. package/lib/image/index.d.ts +1 -1
  226. package/lib/image/index.js +641 -1
  227. package/lib/index.js +97 -1
  228. package/lib/info-box/index.js +1174 -2
  229. package/lib/info-box/info-box.css +2 -0
  230. package/lib/info-box/info-box.d.ts +4 -0
  231. package/lib/info-box/info-box.less +2 -1
  232. package/lib/info-box/info-box.variable.css +8 -2
  233. package/lib/input/index.d.ts +90 -12
  234. package/lib/input/index.js +1234 -1
  235. package/lib/input/input.css +51 -19
  236. package/lib/input/input.d.ts +79 -6
  237. package/lib/input/input.less +50 -13
  238. package/lib/input/input.variable.css +57 -21
  239. package/lib/input/util.d.ts +6 -0
  240. package/lib/link/index.d.ts +4 -4
  241. package/lib/link/index.js +161 -1
  242. package/lib/link/link.d.ts +1 -1
  243. package/lib/link/link.variable.css +6 -2
  244. package/lib/loading/index.d.ts +5 -5
  245. package/lib/loading/index.js +382 -1
  246. package/lib/loading/loading.css +13 -13
  247. package/lib/loading/loading.d.ts +1 -1
  248. package/lib/loading/loading.less +14 -9
  249. package/lib/loading/loading.variable.css +19 -15
  250. package/lib/locale/index.js +477 -1
  251. package/lib/locale/lang/en.d.ts +7 -0
  252. package/lib/menu/index.d.ts +2 -2
  253. package/lib/menu/index.js +725 -1
  254. package/lib/menu/menu.css +4 -4
  255. package/lib/menu/menu.variable.css +10 -6
  256. package/lib/menu/submenu.variable.css +6 -2
  257. package/lib/message/index.js +1796 -2
  258. package/lib/message/message.css +18 -2
  259. package/lib/message/message.less +16 -2
  260. package/lib/message/message.variable.css +24 -4
  261. package/lib/message/messageConstructor.d.ts +23 -3
  262. package/lib/modal/index.d.ts +2 -2
  263. package/lib/modal/index.js +397 -1
  264. package/lib/modal/modal.css +2 -0
  265. package/lib/modal/modal.variable.css +8 -2
  266. package/lib/navigation/index.d.ts +4 -1
  267. package/lib/navigation/index.js +368 -1
  268. package/lib/navigation/navigation.d.ts +1 -0
  269. package/lib/navigation/navigation.variable.css +6 -2
  270. package/lib/notify/index.js +398 -1
  271. package/lib/notify/notify.css +6 -6
  272. package/lib/notify/notify.less +6 -6
  273. package/lib/notify/notify.variable.css +12 -8
  274. package/lib/notify/notifyConstructor.d.ts +1 -1
  275. package/lib/overflow-title/components/overflow-title.d.ts +257 -2
  276. package/lib/overflow-title/index.d.ts +387 -2
  277. package/lib/overflow-title/index.js +292 -1
  278. package/lib/overflow-title/props.d.ts +129 -0
  279. package/lib/pagination/index.d.ts +6 -6
  280. package/lib/pagination/index.js +894 -1
  281. package/lib/pagination/pagination.css +1 -0
  282. package/lib/pagination/pagination.d.ts +3 -3
  283. package/lib/pagination/pagination.less +1 -0
  284. package/lib/pagination/pagination.variable.css +7 -2
  285. package/lib/plugin-popover/index.js +3833 -1
  286. package/lib/plugins/index.js +63 -1
  287. package/lib/pop-confirm/index.d.ts +43 -4
  288. package/lib/pop-confirm/index.js +294 -1
  289. package/lib/pop-confirm/pop-confirm.css +4 -4
  290. package/lib/pop-confirm/pop-confirm.d.ts +14 -1
  291. package/lib/pop-confirm/pop-confirm.less +4 -4
  292. package/lib/pop-confirm/pop-confirm.variable.css +10 -6
  293. package/lib/popover/content.d.ts +33 -0
  294. package/lib/popover/index.d.ts +74 -16
  295. package/lib/popover/index.js +3842 -1
  296. package/lib/popover/popover.css +2 -1
  297. package/lib/popover/popover.d.ts +40 -7
  298. package/lib/popover/popover.less +4 -3
  299. package/lib/popover/popover.variable.css +8 -3
  300. package/lib/popover/props.d.ts +25 -2
  301. package/lib/popover/use-floating.d.ts +1 -1
  302. package/lib/popover/use-popover-init.d.ts +2 -1
  303. package/lib/popover2/index.d.ts +1 -1
  304. package/lib/popover2/index.js +107 -1
  305. package/lib/preset.d.ts +14 -0
  306. package/lib/preset.js +93 -1
  307. package/lib/process/index.d.ts +1 -1
  308. package/lib/process/index.js +759 -2
  309. package/lib/process/process.variable.css +6 -2
  310. package/lib/progress/index.d.ts +5 -5
  311. package/lib/progress/index.js +432 -1
  312. package/lib/progress/progress.css +11 -7
  313. package/lib/progress/progress.d.ts +3 -3
  314. package/lib/progress/progress.less +8 -3
  315. package/lib/progress/progress.variable.css +17 -9
  316. package/lib/radio/common.d.ts +1 -0
  317. package/lib/radio/index.d.ts +31 -25
  318. package/lib/radio/index.js +636 -1
  319. package/lib/radio/radio-button.d.ts +8 -7
  320. package/lib/radio/radio-group.d.ts +7 -4
  321. package/lib/radio/radio.css +26 -12
  322. package/lib/radio/radio.d.ts +5 -4
  323. package/lib/radio/radio.less +42 -8
  324. package/lib/radio/radio.variable.css +26 -8
  325. package/lib/rate/index.d.ts +12 -8
  326. package/lib/rate/index.js +355 -1
  327. package/lib/rate/rate.d.ts +4 -3
  328. package/lib/rate/rate.variable.css +6 -2
  329. package/lib/rate/star.css +3 -0
  330. package/lib/rate/star.less +3 -0
  331. package/lib/rate/star.variable.css +9 -2
  332. package/lib/resize-layout/index.d.ts +4 -4
  333. package/lib/resize-layout/index.js +430 -1
  334. package/lib/resize-layout/resize-layout.css +14 -2
  335. package/lib/resize-layout/resize-layout.d.ts +1 -1
  336. package/lib/resize-layout/resize-layout.less +14 -2
  337. package/lib/resize-layout/resize-layout.variable.css +20 -4
  338. package/lib/search-select/index.d.ts +62 -29
  339. package/lib/search-select/index.js +2747 -2
  340. package/lib/search-select/input.d.ts +5 -1
  341. package/lib/search-select/menu.d.ts +33 -2
  342. package/lib/search-select/search-select.css +39 -21
  343. package/lib/search-select/search-select.d.ts +23 -20
  344. package/lib/search-select/search-select.less +44 -23
  345. package/lib/search-select/search-select.variable.css +45 -23
  346. package/lib/search-select/selected.d.ts +5 -1
  347. package/lib/search-select/utils.d.ts +13 -5
  348. package/lib/select/common.d.ts +4 -1
  349. package/lib/select/index.d.ts +287 -90
  350. package/lib/select/index.js +2422 -2
  351. package/lib/select/option.d.ts +12 -0
  352. package/lib/select/select.css +16 -5
  353. package/lib/select/select.d.ts +120 -39
  354. package/lib/select/select.less +14 -1
  355. package/lib/select/select.variable.css +46 -31
  356. package/lib/select/selectTagInput.d.ts +10 -5
  357. package/lib/select/type.d.ts +3 -0
  358. package/lib/shared/helper.d.ts +1 -1
  359. package/lib/shared/index.js +2690 -1
  360. package/lib/shared/mask-manager.d.ts +3 -4
  361. package/lib/shared/pop-manager.d.ts +6 -2
  362. package/lib/shared/popover.d.ts +2 -2
  363. package/lib/shared/vue-types.d.ts +4 -3
  364. package/lib/sideslider/index.d.ts +1 -1
  365. package/lib/sideslider/index.js +711 -2
  366. package/lib/sideslider/sideslider.variable.css +6 -2
  367. package/lib/slider/index.d.ts +1 -1
  368. package/lib/slider/index.js +1310 -2
  369. package/lib/slider/slider.css +2 -0
  370. package/lib/slider/slider.less +2 -0
  371. package/lib/slider/slider.variable.css +8 -2
  372. package/lib/steps/index.d.ts +5 -5
  373. package/lib/steps/index.js +826 -2
  374. package/lib/steps/steps.css +18 -6
  375. package/lib/steps/steps.d.ts +3 -3
  376. package/lib/steps/steps.less +26 -5
  377. package/lib/steps/steps.variable.css +24 -8
  378. package/lib/styles/index.d.ts +1 -0
  379. package/lib/styles/mixins/animate.css +4 -4
  380. package/lib/styles/mixins/animate.less +10 -6
  381. package/lib/styles/mixins/animate.variable.css +130 -4
  382. package/lib/styles/mixins/mixins.css +4 -4
  383. package/lib/styles/mixins/mixins.variable.css +4 -4
  384. package/lib/styles/mixins/popper.variable.css +6 -2
  385. package/lib/styles/mixins/scroll.variable.css +6 -2
  386. package/lib/styles/reset.variable.css +6 -2
  387. package/lib/styles/themes/themes.less +7 -3
  388. package/lib/swiper/index.d.ts +1 -1
  389. package/lib/swiper/index.js +337 -1
  390. package/lib/swiper/swiper.css +0 -6
  391. package/lib/swiper/swiper.less +0 -8
  392. package/lib/swiper/swiper.variable.css +6 -8
  393. package/lib/switcher/index.d.ts +34 -20
  394. package/lib/switcher/index.js +278 -1
  395. package/lib/switcher/switcher.css +4 -4
  396. package/lib/switcher/switcher.d.ts +76 -7
  397. package/lib/switcher/switcher.variable.css +10 -6
  398. package/lib/tab/index.d.ts +3 -3
  399. package/lib/tab/index.js +915 -1
  400. package/lib/tab/tab-nav.d.ts +12 -2
  401. package/lib/tab/tab-panel.d.ts +1 -1
  402. package/lib/tab/tab.variable.css +6 -2
  403. package/lib/table/components/table-cell.d.ts +22 -24
  404. package/lib/table/components/table-column.d.ts +100 -71
  405. package/lib/table/const.d.ts +25 -3
  406. package/lib/table/events.d.ts +26 -26
  407. package/lib/table/index.d.ts +309 -191
  408. package/lib/table/index.js +6562 -1
  409. package/lib/table/plugins/body-empty.d.ts +1 -1
  410. package/lib/table/plugins/head-filter.css +4 -28
  411. package/lib/table/plugins/head-filter.d.ts +2 -7
  412. package/lib/table/plugins/head-filter.less +5 -34
  413. package/lib/table/plugins/head-filter.variable.css +10 -30
  414. package/lib/table/plugins/head-sort.d.ts +2 -7
  415. package/lib/table/plugins/head-sort.variable.css +6 -2
  416. package/lib/table/plugins/settings.d.ts +2 -19
  417. package/lib/table/plugins/settings.variable.css +6 -2
  418. package/lib/table/plugins/use-column-resize.d.ts +30 -10
  419. package/lib/table/plugins/use-fixed-column.d.ts +9 -9
  420. package/lib/table/plugins/use-head-cell.d.ts +7 -0
  421. package/lib/table/plugins/use-pagination.d.ts +8 -4
  422. package/lib/table/props.d.ts +84 -52
  423. package/lib/table/table.css +117 -53
  424. package/lib/table/table.d.ts +91 -68
  425. package/lib/table/table.less +70 -26
  426. package/lib/table/table.variable.css +123 -55
  427. package/lib/table/use-attributes.d.ts +59 -0
  428. package/lib/table/use-column.d.ts +264 -53
  429. package/lib/table/use-common.d.ts +1607 -88
  430. package/lib/table/use-render.d.ts +11 -0
  431. package/lib/table/utils.d.ts +34 -31
  432. package/lib/table-column/index.d.ts +356 -113
  433. package/lib/table-column/index.js +775 -1
  434. package/lib/tag/index.d.ts +10 -10
  435. package/lib/tag/index.js +234 -1
  436. package/lib/tag/tag.d.ts +5 -5
  437. package/lib/tag/tag.variable.css +6 -2
  438. package/lib/tag-input/index.d.ts +49 -7
  439. package/lib/tag-input/index.js +1678 -1
  440. package/lib/tag-input/list-tag-render.d.ts +11 -0
  441. package/lib/tag-input/tag-input.css +8 -0
  442. package/lib/tag-input/tag-input.d.ts +46 -6
  443. package/lib/tag-input/tag-input.less +9 -0
  444. package/lib/tag-input/tag-input.variable.css +14 -2
  445. package/lib/tag-input/tag-props.d.ts +16 -2
  446. package/lib/time-picker/index.d.ts +10 -4
  447. package/lib/time-picker/index.js +72 -1
  448. package/lib/time-picker/time-picker.css +4 -3
  449. package/lib/time-picker/time-picker.less +5 -9
  450. package/lib/time-picker/time-picker.variable.css +10 -5
  451. package/lib/timeline/index.d.ts +1 -1
  452. package/lib/timeline/index.js +241 -1
  453. package/lib/timeline/timeline.variable.css +6 -2
  454. package/lib/transfer/index.d.ts +1 -1
  455. package/lib/transfer/index.js +687 -1
  456. package/lib/transfer/transfer.css +2 -2
  457. package/lib/transfer/transfer.less +2 -2
  458. package/lib/transfer/transfer.variable.css +8 -4
  459. package/lib/tree/constant.d.ts +2 -2
  460. package/lib/tree/index.d.ts +70 -40
  461. package/lib/tree/index.js +2603 -1
  462. package/lib/tree/props.d.ts +20 -10
  463. package/lib/tree/tree.css +13 -1
  464. package/lib/tree/tree.d.ts +42 -21
  465. package/lib/tree/tree.variable.css +19 -3
  466. package/lib/tree/use-empty.d.ts +1 -3
  467. package/lib/tree/use-node-action.d.ts +5 -3
  468. package/lib/tree/use-node-attribute.d.ts +17 -8
  469. package/lib/tree/use-search.d.ts +2 -2
  470. package/lib/tree/use-tree-init.d.ts +1 -2
  471. package/lib/tree/util.d.ts +9 -3
  472. package/lib/upload/index.d.ts +1 -1
  473. package/lib/upload/index.js +2888 -2
  474. package/lib/upload/upload.css +4 -4
  475. package/lib/upload/upload.type.d.ts +1 -1
  476. package/lib/upload/upload.variable.css +10 -6
  477. package/lib/upload/use-file-handler.d.ts +2 -2
  478. package/lib/virtual-render/index.d.ts +43 -1
  479. package/lib/virtual-render/index.js +902 -1
  480. package/lib/virtual-render/props.d.ts +15 -0
  481. package/lib/virtual-render/use-fix-top.d.ts +18 -0
  482. package/lib/virtual-render/v-virtual-render.d.ts +24 -1
  483. package/lib/virtual-render/virtual-render.d.ts +25 -0
  484. package/lib/virtual-render/virtual-render.variable.css +6 -2
  485. package/lib/volar.components.d.ts +24 -24
  486. package/package.json +34 -19
  487. package/dist/index.cjs.source.js +0 -45605
  488. package/dist/index.esm.source.js +0 -45605
  489. package/dist/index.umd.source.js +0 -45608
  490. package/lib/cascader/index.js.LICENSE.txt +0 -1
  491. package/lib/dialog/index.js.LICENSE.txt +0 -1
  492. package/lib/directives/index.js.LICENSE.txt +0 -14
  493. package/lib/info-box/index.js.LICENSE.txt +0 -1
  494. package/lib/message/index.js.LICENSE.txt +0 -6
  495. package/lib/process/index.js.LICENSE.txt +0 -1
  496. package/lib/search-select/index.js.LICENSE.txt +0 -1
  497. package/lib/select/index.js.LICENSE.txt +0 -1
  498. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  499. package/lib/slider/index.js.LICENSE.txt +0 -1
  500. package/lib/steps/index.js.LICENSE.txt +0 -1
  501. package/lib/table/render.d.ts +0 -140
  502. package/lib/upload/index.js.LICENSE.txt +0 -1
  503. /package/lib/overflow-title/{overflow.css → overflow-title.css} +0 -0
  504. /package/lib/overflow-title/{overflow.less → overflow-title.less} +0 -0
  505. /package/lib/overflow-title/{overflow.variable.css → overflow-title.variable.css} +0 -0
@@ -1 +1,2666 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types","../config-provider","../directives","../icon"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon")):t(e["../shared"],e.vue,e["vue-types"],e["../config-provider"],e["../directives"],e["../icon"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,a)=>(()=>{"use strict";var i={2717:e=>{e.exports=n},4061:e=>{e.exports=o},6870:e=>{e.exports=a},4212:t=>{t.exports=e},748:e=>{e.exports=t},210:e=>{e.exports=r}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return i[e](r,r.exports,u),r.exports}u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{u.r(l),u.d(l,{default:()=>fe});var e=u(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var n=u(748);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=/^\s+/,i=/\s+$/;function c(e,t){if(t=t||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,t);var r=function(e){var t,r,n,c={r:0,g:0,b:0},u=1,l=null,s=null,f=null,d=!1,h=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(i,"").toLowerCase();var t,r=!1;if(S[e])e=S[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=L.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=L.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=L.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=L.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=L.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=L.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=L.hex8.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:F(t[4]),format:r?"name":"hex8"}:(t=L.hex6.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:r?"name":"hex"}:(t=L.hex4.exec(e))?{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:F(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=L.hex3.exec(e))&&{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==o(e)&&(E(e.r)&&E(e.g)&&E(e.b)?(t=e.r,r=e.g,n=e.b,c={r:255*C(t,255),g:255*C(r,255),b:255*C(n,255)},d=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):E(e.h)&&E(e.s)&&E(e.v)?(l=R(e.s),s=R(e.v),c=function(e,t,r){e=6*C(e,360),t=C(t,100),r=C(r,100);var n=Math.floor(e),o=e-n,a=r*(1-t),i=r*(1-o*t),c=r*(1-(1-o)*t),u=n%6;return{r:255*[r,i,a,a,c,r][u],g:255*[c,r,r,i,a,a][u],b:255*[a,a,c,r,r,i][u]}}(e.h,l,s),d=!0,h="hsv"):E(e.h)&&E(e.s)&&E(e.l)&&(l=R(e.s),f=R(e.l),c=function(e,t,r){var n,o,a;function i(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=o=a=r;else{var c=r<.5?r*(1+t):r+t-r*t,u=2*r-c;n=i(u,c,e+1/3),o=i(u,c,e),a=i(u,c,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,l,f),d=!0,h="hsl"),e.hasOwnProperty("a")&&(u=e.a)),u=j(u),{ok:d,format:e.format||h,r:Math.min(255,Math.max(c.r,0)),g:Math.min(255,Math.max(c.g,0)),b:Math.min(255,Math.max(c.b,0)),a:u}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function s(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,o,a=Math.max(e,t,r),i=Math.min(e,t,r),c=(a+i)/2;if(a==i)n=o=0;else{var u=a-i;switch(o=c>.5?u/(2-a-i):u/(a+i),a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:o,l:c}}function f(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,o,a=Math.max(e,t,r),i=Math.min(e,t,r),c=a,u=a-i;if(o=0===a?0:u/a,a==i)n=0;else{switch(a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:o,v:c}}function d(e,t,r,n){var o=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function h(e,t,r,n){return[P(T(n)),P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))].join("")}function p(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=V(r.s),c(r)}function v(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=V(r.s),c(r)}function g(e){return c(e).desaturate(100)}function b(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=V(r.l),c(r)}function m(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-t/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-t/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-t/100*255))),c(r)}function y(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=V(r.l),c(r)}function k(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function w(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function x(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=c(e).toHsl(),n=[c(e)],o=360/t,a=1;a<t;a++)n.push(c({h:(r.h+a*o)%360,s:r.s,l:r.l}));return n}function _(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function M(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),o=360/r,a=[c(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(c(n));return a}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,o=r.s,a=r.v,i=[],u=1/t;t--;)i.push(c({h:n,s:o,v:a})),a=(a+u)%1;return i}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=j(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var a=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16)),P(T(n))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*C(this._r,255))+"%",g:Math.round(100*C(this._g,255))+"%",b:Math.round(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*C(this._r,255))+"%, "+Math.round(100*C(this._g,255))+"%, "+Math.round(100*C(this._b,255))+"%)":"rgba("+Math.round(100*C(this._r,255))+"%, "+Math.round(100*C(this._g,255))+"%, "+Math.round(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(N[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=c(e);r="#"+h(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(x,[3])},tetrad:function(){return this._applyCombination(x,[4])}},c.fromRatio=function(e,t){if("object"==o(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),o=c(t).toRgb(),a=r/100;return c({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},c.readability=function(e,t){var r=c(e),n=c(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,o,a,i,u,l=c.readability(e,t);switch(o=!1,(a=r,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(u=(a.size||"small").toLowerCase())&&"large"!==u&&(u="small"),n={level:i,size:u}).level+n.size){case"AAsmall":case"AAAlarge":o=l>=4.5;break;case"AAlarge":o=l>=3;break;case"AAAsmall":o=l>=7}return o},c.mostReadable=function(e,t,r){var n,o,a,i,u=null,l=0;o=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var s=0;s<t.length;s++)(n=c.readability(e,t[s]))>l&&(l=n,u=c(t[s]));return c.isReadable(e,u,{level:a,size:i})||!o?u:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function j(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function V(e){return Math.min(1,Math.max(0,e))}function O(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function T(e){return Math.round(255*parseFloat(e)).toString(16)}function F(e){return O(e)/255}var H,q,D,L=(q="[\\s|\\(]+("+(H="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",D="[\\s|\\(]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",{CSS_UNIT:new RegExp(H),rgb:new RegExp("rgb"+q),rgba:new RegExp("rgba"+D),hsl:new RegExp("hsl"+q),hsla:new RegExp("hsla"+D),hsv:new RegExp("hsv"+q),hsva:new RegExp("hsva"+D),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function E(e){return!!L.CSS_UNIT.exec(e)}var I=u(210),B=u(2717),U=u(4061),z=u(6870),K={placement:{type:String,default:"bottom-start",validator:function(e){return!(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0&&(console.error("placement property is not valid: '".concat(e,"'")),1))}},className:{type:String},extPopoverCls:{type:String},appendToBody:{type:Boolean},triggerRef:{type:Object},onClick:Function};const W=(0,n.defineComponent)({props:K,emits:["changeVisible"],setup:function(t,r){var o=r.emit,a=Object.create(null),i=(0,n.ref)(null);(0,n.onMounted)((function(){u()})),(0,n.onBeforeUnmount)((function(){c()}));var c=function(){if(a&&0!==Object.keys(a).length){var e=a;e.isShow&&e.hide(),e.destroy(),a=null,o("changeVisible",!1)}},u=function(){a&&0!==Object.keys(a).length?(0,n.nextTick)((function(){a.update()})):(0,n.nextTick)((function(){a=new e.BKPopover(t.triggerRef,i.value,{placement:t.placement,trigger:"manual",modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},{name:"offset",options:{offset:[0,4]}}]})}))},l=(0,n.computed)((function(){var r={};return t.appendToBody&&(r["z-index"]=1060+e.bkZIndexManager.getModalNextIndex()),r})),s=(0,n.reactive)({styles:l}),f=(0,B.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,n.toRefs)(s)),{refContentRef:i,forceUpdate:function(){var e;a&&(null===(e=null==a?void 0:a.forceUpdate)||void 0===e||e.call(a))},updateDropdown:u,destoryDropdown:c,resolveClassName:f})},render:function(){var e,t,r;return(0,n.createVNode)("div",{ref:"refContentRef",class:[this.resolveClassName("date-picker-dropdown"),this.className,this.extPopoverCls],style:this.styles,onClick:this.onClick},[null!==(r=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==r?r:""])}});var X={info:e.PropTypes.object.isRequired};const $=(0,n.defineComponent)({props:X,emits:["tab","input"],setup:function(t,r){var o=r.emit,a=function(e){"a"===t.info.key&&o("tab",e)},i=function(e){var r=t.info.key,n=e.target.value;o("input",r,n)},c=(0,B.usePrefix)().resolveClassName,u=(0,n.computed)((function(){return(0,e.classes)({error:t.info.error},"".concat(c("color-picker-input-value")))}));return function(){return(0,n.createVNode)("div",{class:"".concat(c("color-picker-input-part"))},[(0,n.createVNode)("input",{type:"HEX"===t.info.name?"text":"number",class:u.value,value:t.info.value,onKeydown:a,onInput:i},null),(0,n.createVNode)("span",{class:"".concat(c("color-picker-input-text"))},[t.info.name])])}}});var G={colorObj:e.PropTypes.object.isRequired};const Y=(0,n.defineComponent)({name:"ColorPicker",props:G,emits:["change","tab"],setup:function(e,t){var r=t.emit,o=(0,n.reactive)({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=(0,n.reactive)({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),i=(0,n.reactive)({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),u=(0,n.reactive)({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),l=(0,n.reactive)({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});(0,n.watch)((function(){return e.colorObj}),(function(e){c(e.hex).toString()!==c(o.value).toString()&&(o.value=e.hex),a.value=e.rgba.r.toString(),i.value=e.rgba.g.toString(),u.value=e.rgba.b.toString(),l.value=e.rgba.a.toString(),d()}),{deep:!0});var s=function(e){r("tab",e)},f=function(e,t){if({r:a,g:i,b:u,a:l,hex:o}[e].value=t,d()){var n="hex"===e?o.value:"rgba(".concat(a.value,", ").concat(i.value,", ").concat(u.value,", ").concat(l.value,")");r("change",n)}},d=function(){var e=!0;!o.value.startsWith("#")||4!==o.value.length&&7!==o.value.length||o.value.slice(1).match(/[^0-9a-fA-F]/)?(o.error=!0,e=!1):o.error=!1,""!==l.value&&l.value>=0&&l.value<=1?l.error=!1:(l.error=!0,e=!1);for(var t=0,r=[a,i,u];t<r.length;t++){var n=r[t],c=n.value;""!==c&&c>=0&&c<=255?n.error=!1:(n.error=!0,e=!1)}return e},h=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{class:"".concat(h("color-picker-input"))},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-input-hex"))},[(0,n.createVNode)($,{info:o,onInput:f},null)]),(0,n.createVNode)("div",{class:"".concat(h("color-picker-input-rgba"))},[(0,n.createVNode)($,{info:a,onInput:f},null),(0,n.createVNode)($,{info:i,onInput:f},null),(0,n.createVNode)($,{info:u,onInput:f},null),(0,n.createVNode)($,{info:l,onInput:f,onTab:s},null)])])}}});var J=function(e){var t=e;""===e&&(t="#FFFFFF");var r=c(e),n=r.toHsl(),o=r.toHsv();return 0===n.s&&(n.h=t.h||0,o.h=t.h||0),o.v<.0164&&(o.h=t.h||0,o.s=t.s||0),n.l<.01&&(n.h=t.h||0,n.s=t.s||0),{hsl:n,hsv:o,hex:r.toHexString().toUpperCase(),rgba:r.toRgb()}},Z=function(e,t,r){return e<t?t:e>r?r:e},Q=function(e,t){return e.touches?e.touches[0][t]:0},ee=function(e){var t=e.r,r=e.g,n=e.b,o=e.a;return"rgba(".concat([t,r,n,o].join(","),")")},te={colorObj:e.PropTypes.object.isRequired};const re=(0,n.defineComponent)({name:"ColorPicker",props:te,emits:["change"],setup:function(e,t){var r=t.emit,o=(0,n.ref)(null),a=(0,n.computed)((function(){return{left:"".concat(e.colorObj.hsv.h/360*100,"%")}})),i=function(t){var r=o.value.clientWidth,n=e.colorObj.hsv.h/360*r;switch(t.code){case"ArrowLeft":t.preventDefault(),n=Z(n-2,0,r);break;case"ArrowRight":t.preventDefault(),n=Z(n+2,0,r);break;case"ArrowUp":t.preventDefault(),n=Z(n-10,0,r);break;case"ArrowDown":t.preventDefault(),n=Z(n+10,0,r);break;default:return}u(null,n)},c=function e(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",e)},u=function(e,t){var r=o.value.clientWidth,n=void 0!==t?t:l(e);s(n/r)},l=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||Q(e,"PageX");return Z(r-t,0,o.value.clientWidth)},s=function(t){var n=e.colorObj.hsl,o=n.h,a=n.s,i=n.l,c=n.a,u=360*t;o!==u&&r("change",{h:u,s:a,l:i,a:c})},f=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{ref:o,tabindex:"0",class:"".concat(f("color-picker-hue")),onKeydown:i,onMousedown:function(e){e.stopPropagation(),e.preventDefault(),function(e){o.value.focus(),u(e),window.addEventListener("mousemove",u,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-hue-pointer")),style:a.value},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-hue-rectangle"))},null)])])}}});var ne={colorObj:e.PropTypes.object.isRequired,recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).isRequired};const oe=(0,n.defineComponent)({props:ne,emits:["change","tab"],setup:function(t,o){var a=o.emit,i=(0,n.ref)(!1),u=(0,n.ref)(-1),l=(0,n.ref)(null);(0,n.watch)((function(){return t.colorObj}),(function(){u.value=-1,l.value=null}),{deep:!0});var s=(0,n.computed)((function(){return v(t.recommend)})),f=(0,B.usePrefix)().resolveClassName,d=function(t,n){var o;return(0,e.classes)((r(o={},"".concat(f("color-picker-empty")),""===t),r(o,"".concat(f("color-picker-recommend-selected-color")),i.value&&u.value===n),o),"".concat(f("color-picker-recommend-color")))},h=function(e){if("Tab"===e.code)a("tab",e);else{var t=0,r=s.value.length-1;switch(e.code){case"ArrowLeft":e.preventDefault(),t=Z(u.value-1,0,r);break;case"ArrowRight":e.preventDefault(),t=Z(u.value+1,0,r);break;case"ArrowUp":e.preventDefault(),t=Z(u.value-10,0,r);break;case"ArrowDown":e.preventDefault(),t=Z(u.value+10,0,r);break;default:return}p(t)}},p=function(e){var t=s.value[e];a("change",t),(0,n.nextTick)((function(){u.value=e,l.value=t}))},v=function(e){return!0===e?["","#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"]:Array.isArray(e)?e.map((function(e){return c(e).isValid()?e:""})):void 0};return function(){return(0,n.createVNode)("div",{tabindex:"0",class:"".concat(f("color-picker-recommend")," "),onFocus:function(){return i.value=!0},onBlur:function(){return i.value=!1},onKeydown:h},[s.value.map((function(e,t){return(0,n.createVNode)("div",{style:"background: ".concat(e||"#fff"),class:d(e,t),onClick:function(){return p(t)}},[u.value===t?(0,n.createVNode)("div",{class:"".concat(f("color-picker-pointer"))},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-circle"))},null)]):void 0])}))])}}});var ae={colorObj:e.PropTypes.object.isRequired};const ie=(0,n.defineComponent)({props:ae,emits:["change"],setup:function(e,t){var r=t.emit,o=(0,n.ref)(null),a=(0,n.computed)((function(){return{background:"hsl(".concat(e.colorObj.hsv.h,", 100%, 50%)")}})),i=(0,n.computed)((function(){return{top:"".concat(100*(1-e.colorObj.hsv.v),"%"),left:"".concat(100*e.colorObj.hsv.s,"%")}})),c=function e(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",e)},u=function(t){var r=o.value,n=r.clientWidth,a=r.clientHeight,i=e.colorObj.hsv.s*n,c=(1-e.colorObj.hsv.v)*a;switch(t.code){case"ArrowLeft":t.preventDefault(),i=Z(i-10,0,n);break;case"ArrowRight":t.preventDefault(),i=Z(i+10,0,n);break;case"ArrowUp":t.preventDefault(),c=Z(c-10,0,a);break;case"ArrowDown":t.preventDefault(),c=Z(c+10,0,a);break;default:return}l(null,i,c)},l=function(t,r,n){var a=o.value,i=a.clientWidth,c=a.clientHeight,u=(void 0!==r?r:s(t))/i,l=1-(void 0!==n?n:f(t))/c;d(e.colorObj.hsv.h,u,l,e.colorObj.hsv.a)},s=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||Q(e,"PageX");return Z(r-t,0,o.value.clientWidth)},f=function(e){var t=o.value.getBoundingClientRect().top+window.pageYOffset,r=e.pageY||Q(e,"PageY");return Z(r-t,0,o.value.clientHeight)},d=function(e,t,n,o){r("change",{h:e,s:t,v:n,a:o})},h=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{ref:o,tabindex:"0",class:"".concat(h("color-picker-saturation")),style:a.value,onKeydown:u,onMousedown:function(e){e.stopPropagation(),function(e){o.value.focus(),l(e),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-saturation-white"))},null),(0,n.createVNode)("div",{class:"".concat(h("color-picker-saturation-black"))},null),(0,n.createVNode)("div",{class:"".concat(h("color-picker-pointer")),style:i.value},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-circle"))},null)])])}}});var ce;!function(e){e.UNKNOWN="",e.SMALL="small",e.LARGE="large"}(ce||(ce={}));var ue={modelValue:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),readonly:e.PropTypes.bool.def(!1),transfer:e.PropTypes.bool.def(!1),size:(0,I.toType)("colorPickSize",{}).def(ce.UNKNOWN),showValue:e.PropTypes.bool.def(!0),recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).def(!0),extCls:e.PropTypes.string.def(""),withValidate:e.PropTypes.bool.def(!0)},le=J("#FFFFFF");const se=(0,n.defineComponent)({name:"ColorPicker",directives:{clickoutside:U.clickoutside},props:ue,emits:["update:modelValue","change"],setup:function(t,o){var a=o.emit,i=(0,e.useFormItem)(),u=(0,n.ref)(!1),l=(0,n.ref)(""),s=(0,n.reactive)(JSON.parse(JSON.stringify(le))),f=(0,n.ref)(null),d=(0,n.ref)(null),h=(0,n.ref)(null),p=(0,B.usePrefix)().resolveClassName,v=(0,n.computed)((function(){var n;return(0,e.classes)((r(n={},"".concat(p("color-picker-".concat(t.size))),t.size),r(n,"".concat(p("color-picker-show-dropdown")),u.value),r(n,"".concat(p("color-picker-show-value")),t.showValue),r(n,"".concat(p("color-picker-disabled")),t.disabled||t.readonly),n),"".concat(p("color-picker")," ").concat(t.extCls))})),g=(0,n.computed)((function(){return Boolean(!0===t.recommend||Array.isArray(t.recommend)&&t.recommend.length)}));(0,n.onBeforeMount)((function(){M({isCreated:!0})})),(0,n.watch)((function(){return t.modelValue}),(function(){var e;M(),t.withValidate&&(null===(e=null==i?void 0:i.validate)||void 0===e||e.call(i,"change"))}));var b=function(e){"Enter"===e.code||"NumpadEnter"===e.code?y():"Escape"===e.code&&_()},m=function(e){t.transfer&&b(e)},y=function(){t.disabled||t.readonly||(u.value?_():x())},k=function(e){g.value||(e.preventDefault(),d.value.$el.focus())},w=function(e){e.preventDefault(),d.value.$el.focus()},x=function(){var e;u.value=!0,null===(e=f.value)||void 0===e||e.updateDropdown(),setTimeout((function(){f.value.$el.querySelector(".".concat(p("color-picker-input-hex")," .").concat(p("color-picker-input-value"))).select()}),100)},_=function(){var e;u.value&&((0,n.nextTick)((function(){return h.value.focus()})),u.value=!1,null===(e=f.value)||void 0===e||e.destoryDropdown(),M())},M=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).isCreated,r=void 0!==e&&e;if(""!==t.modelValue){var n=J(t.modelValue),o=1===n.rgba.a?n.hex:ee(n.rgba);if(o!==l.value){var i=c(t.modelValue).isValid();r?i?(l.value=o.toLowerCase()===t.modelValue.toLowerCase()?t.modelValue:o,Object.assign(s,n)):(Object.assign(s,le),a("change","")):i?o.toLowerCase()!==l.value.toLowerCase()&&(Object.assign(s,n),l.value=o):(l.value="",Object.assign(s,le))}}else""!==l.value&&(l.value="",Object.assign(s,le),a("update:modelValue",l.value))},A=function(e){if(""===e)return l.value="",Object.assign(s,le),a("update:modelValue",""),void a("change","");var t=J(e),r=1===t.rgba.a?t.hex:ee(t.rgba);l.value=r,Object.assign(s,t),a("update:modelValue",l.value),a("change",r)},S=function(){u.value=!1};return function(){return(0,n.withDirectives)((0,n.createVNode)("div",{ref:h,tabindex:"0",class:v.value,onKeydown:b,onClick:y},[(0,n.createVNode)("div",{class:"".concat(p("color-picker-color"))},[(0,n.createVNode)("span",{class:"".concat(p("color-picker-color-square")," ").concat(!l.value&&"".concat(p("color-picker-empty"))),style:"background: ".concat(l.value||"#FFF")},null)]),t.showValue?(0,n.createVNode)("div",{class:"".concat(p("color-picker-text"))},[(0,n.createVNode)("span",null,[l.value])]):void 0,(0,n.createVNode)("div",{class:"".concat(p("color-picker-icon"))},[(0,n.createVNode)(z.AngleUp,{class:"icon-angle-down"},null)]),(0,n.createVNode)(n.Transition,{name:"bk-fade-down-transition"},{default:function(){return[(0,n.withDirectives)((0,n.createVNode)(W,{ref:f,triggerRef:h.value},{default:function(){return[(0,n.createVNode)("div",{class:"".concat(p("color-dropdown-container"))},[(0,n.createVNode)("div",{class:"".concat(p("color-picker-dropdown")),onClick:function(e){e.stopPropagation()},onMousedown:function(e){e.stopPropagation()},onKeydown:m},[(0,n.createVNode)(ie,{ref:d,colorObj:s,onChange:A},null),(0,n.createVNode)(re,{colorObj:s,onChange:A},null),(0,n.createVNode)(Y,{colorObj:s,onTab:k,onChange:A},null),g.value?(0,n.createVNode)("div",{class:"".concat(p("color-picker-recommend-container"))},[(0,n.createVNode)(oe,{colorObj:s,recommend:t.recommend,onTab:w,onChange:A},null)]):void 0])])]}}),[[n.vShow,u.value]])]}})]),[[(0,n.resolveDirective)("clickoutside"),S]])}}}),fe=(0,e.withInstall)(se)})(),l})()));
1
+ import "./color-picker.less";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__ from "../directives";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
8
+ /******/ // The require scope
9
+ /******/ var __webpack_require__ = {};
10
+ /******/
11
+ /************************************************************************/
12
+ /******/ /* webpack/runtime/define property getters */
13
+ /******/ (() => {
14
+ /******/ // define getter functions for harmony exports
15
+ /******/ __webpack_require__.d = (exports, definition) => {
16
+ /******/ for(var key in definition) {
17
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
18
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
19
+ /******/ }
20
+ /******/ }
21
+ /******/ };
22
+ /******/ })();
23
+ /******/
24
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
25
+ /******/ (() => {
26
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
27
+ /******/ })();
28
+ /******/
29
+ /************************************************************************/
30
+ var __webpack_exports__ = {};
31
+
32
+ // EXPORTS
33
+ __webpack_require__.d(__webpack_exports__, {
34
+ Z: () => (/* binding */ src)
35
+ });
36
+
37
+ ;// CONCATENATED MODULE: external "../shared"
38
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
39
+ var y = x => () => x
40
+ const shared_namespaceObject = x({ ["BKPopover"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.BKPopover, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["classes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.classes, ["useFormItem"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.useFormItem, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
41
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
42
+ function _typeof(obj) {
43
+ "@babel/helpers - typeof";
44
+
45
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
46
+ return typeof obj;
47
+ } : function (obj) {
48
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
49
+ }, _typeof(obj);
50
+ }
51
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
52
+
53
+ function _toPrimitive(input, hint) {
54
+ if (_typeof(input) !== "object" || input === null) return input;
55
+ var prim = input[Symbol.toPrimitive];
56
+ if (prim !== undefined) {
57
+ var res = prim.call(input, hint || "default");
58
+ if (_typeof(res) !== "object") return res;
59
+ throw new TypeError("@@toPrimitive must return a primitive value.");
60
+ }
61
+ return (hint === "string" ? String : Number)(input);
62
+ }
63
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
64
+
65
+
66
+ function _toPropertyKey(arg) {
67
+ var key = _toPrimitive(arg, "string");
68
+ return _typeof(key) === "symbol" ? key : String(key);
69
+ }
70
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
71
+
72
+ function _defineProperty(obj, key, value) {
73
+ key = _toPropertyKey(key);
74
+ if (key in obj) {
75
+ Object.defineProperty(obj, key, {
76
+ value: value,
77
+ enumerable: true,
78
+ configurable: true,
79
+ writable: true
80
+ });
81
+ } else {
82
+ obj[key] = value;
83
+ }
84
+ return obj;
85
+ }
86
+ ;// CONCATENATED MODULE: external "vue"
87
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
88
+ var external_vue_y = x => () => x
89
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeMount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
90
+ ;// CONCATENATED MODULE: ../../node_modules/tinycolor2/esm/tinycolor.js
91
+ // This file is autogenerated. It's used to publish ESM to npm.
92
+ function tinycolor_typeof(obj) {
93
+ "@babel/helpers - typeof";
94
+
95
+ return tinycolor_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
96
+ return typeof obj;
97
+ } : function (obj) {
98
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
99
+ }, tinycolor_typeof(obj);
100
+ }
101
+
102
+ // https://github.com/bgrins/TinyColor
103
+ // Brian Grinstead, MIT License
104
+
105
+ var trimLeft = /^\s+/;
106
+ var trimRight = /\s+$/;
107
+ function tinycolor(color, opts) {
108
+ color = color ? color : "";
109
+ opts = opts || {};
110
+
111
+ // If input is already a tinycolor, return itself
112
+ if (color instanceof tinycolor) {
113
+ return color;
114
+ }
115
+ // If we are called as a function, call using new instead
116
+ if (!(this instanceof tinycolor)) {
117
+ return new tinycolor(color, opts);
118
+ }
119
+ var rgb = inputToRGB(color);
120
+ this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
121
+ this._gradientType = opts.gradientType;
122
+
123
+ // Don't let the range of [0,255] come back in [0,1].
124
+ // Potentially lose a little bit of precision here, but will fix issues where
125
+ // .5 gets interpreted as half of the total, instead of half of 1
126
+ // If it was supposed to be 128, this was already taken care of by `inputToRgb`
127
+ if (this._r < 1) this._r = Math.round(this._r);
128
+ if (this._g < 1) this._g = Math.round(this._g);
129
+ if (this._b < 1) this._b = Math.round(this._b);
130
+ this._ok = rgb.ok;
131
+ }
132
+ tinycolor.prototype = {
133
+ isDark: function isDark() {
134
+ return this.getBrightness() < 128;
135
+ },
136
+ isLight: function isLight() {
137
+ return !this.isDark();
138
+ },
139
+ isValid: function isValid() {
140
+ return this._ok;
141
+ },
142
+ getOriginalInput: function getOriginalInput() {
143
+ return this._originalInput;
144
+ },
145
+ getFormat: function getFormat() {
146
+ return this._format;
147
+ },
148
+ getAlpha: function getAlpha() {
149
+ return this._a;
150
+ },
151
+ getBrightness: function getBrightness() {
152
+ //http://www.w3.org/TR/AERT#color-contrast
153
+ var rgb = this.toRgb();
154
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
155
+ },
156
+ getLuminance: function getLuminance() {
157
+ //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
158
+ var rgb = this.toRgb();
159
+ var RsRGB, GsRGB, BsRGB, R, G, B;
160
+ RsRGB = rgb.r / 255;
161
+ GsRGB = rgb.g / 255;
162
+ BsRGB = rgb.b / 255;
163
+ if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
164
+ if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
165
+ if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
166
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
167
+ },
168
+ setAlpha: function setAlpha(value) {
169
+ this._a = boundAlpha(value);
170
+ this._roundA = Math.round(100 * this._a) / 100;
171
+ return this;
172
+ },
173
+ toHsv: function toHsv() {
174
+ var hsv = rgbToHsv(this._r, this._g, this._b);
175
+ return {
176
+ h: hsv.h * 360,
177
+ s: hsv.s,
178
+ v: hsv.v,
179
+ a: this._a
180
+ };
181
+ },
182
+ toHsvString: function toHsvString() {
183
+ var hsv = rgbToHsv(this._r, this._g, this._b);
184
+ var h = Math.round(hsv.h * 360),
185
+ s = Math.round(hsv.s * 100),
186
+ v = Math.round(hsv.v * 100);
187
+ return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
188
+ },
189
+ toHsl: function toHsl() {
190
+ var hsl = rgbToHsl(this._r, this._g, this._b);
191
+ return {
192
+ h: hsl.h * 360,
193
+ s: hsl.s,
194
+ l: hsl.l,
195
+ a: this._a
196
+ };
197
+ },
198
+ toHslString: function toHslString() {
199
+ var hsl = rgbToHsl(this._r, this._g, this._b);
200
+ var h = Math.round(hsl.h * 360),
201
+ s = Math.round(hsl.s * 100),
202
+ l = Math.round(hsl.l * 100);
203
+ return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
204
+ },
205
+ toHex: function toHex(allow3Char) {
206
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
207
+ },
208
+ toHexString: function toHexString(allow3Char) {
209
+ return "#" + this.toHex(allow3Char);
210
+ },
211
+ toHex8: function toHex8(allow4Char) {
212
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
213
+ },
214
+ toHex8String: function toHex8String(allow4Char) {
215
+ return "#" + this.toHex8(allow4Char);
216
+ },
217
+ toRgb: function toRgb() {
218
+ return {
219
+ r: Math.round(this._r),
220
+ g: Math.round(this._g),
221
+ b: Math.round(this._b),
222
+ a: this._a
223
+ };
224
+ },
225
+ toRgbString: function toRgbString() {
226
+ return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
227
+ },
228
+ toPercentageRgb: function toPercentageRgb() {
229
+ return {
230
+ r: Math.round(bound01(this._r, 255) * 100) + "%",
231
+ g: Math.round(bound01(this._g, 255) * 100) + "%",
232
+ b: Math.round(bound01(this._b, 255) * 100) + "%",
233
+ a: this._a
234
+ };
235
+ },
236
+ toPercentageRgbString: function toPercentageRgbString() {
237
+ return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
238
+ },
239
+ toName: function toName() {
240
+ if (this._a === 0) {
241
+ return "transparent";
242
+ }
243
+ if (this._a < 1) {
244
+ return false;
245
+ }
246
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
247
+ },
248
+ toFilter: function toFilter(secondColor) {
249
+ var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
250
+ var secondHex8String = hex8String;
251
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
252
+ if (secondColor) {
253
+ var s = tinycolor(secondColor);
254
+ secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
255
+ }
256
+ return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
257
+ },
258
+ toString: function toString(format) {
259
+ var formatSet = !!format;
260
+ format = format || this._format;
261
+ var formattedString = false;
262
+ var hasAlpha = this._a < 1 && this._a >= 0;
263
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
264
+ if (needsAlphaFormat) {
265
+ // Special case for "transparent", all other non-alpha formats
266
+ // will return rgba when there is transparency.
267
+ if (format === "name" && this._a === 0) {
268
+ return this.toName();
269
+ }
270
+ return this.toRgbString();
271
+ }
272
+ if (format === "rgb") {
273
+ formattedString = this.toRgbString();
274
+ }
275
+ if (format === "prgb") {
276
+ formattedString = this.toPercentageRgbString();
277
+ }
278
+ if (format === "hex" || format === "hex6") {
279
+ formattedString = this.toHexString();
280
+ }
281
+ if (format === "hex3") {
282
+ formattedString = this.toHexString(true);
283
+ }
284
+ if (format === "hex4") {
285
+ formattedString = this.toHex8String(true);
286
+ }
287
+ if (format === "hex8") {
288
+ formattedString = this.toHex8String();
289
+ }
290
+ if (format === "name") {
291
+ formattedString = this.toName();
292
+ }
293
+ if (format === "hsl") {
294
+ formattedString = this.toHslString();
295
+ }
296
+ if (format === "hsv") {
297
+ formattedString = this.toHsvString();
298
+ }
299
+ return formattedString || this.toHexString();
300
+ },
301
+ clone: function clone() {
302
+ return tinycolor(this.toString());
303
+ },
304
+ _applyModification: function _applyModification(fn, args) {
305
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
306
+ this._r = color._r;
307
+ this._g = color._g;
308
+ this._b = color._b;
309
+ this.setAlpha(color._a);
310
+ return this;
311
+ },
312
+ lighten: function lighten() {
313
+ return this._applyModification(_lighten, arguments);
314
+ },
315
+ brighten: function brighten() {
316
+ return this._applyModification(_brighten, arguments);
317
+ },
318
+ darken: function darken() {
319
+ return this._applyModification(_darken, arguments);
320
+ },
321
+ desaturate: function desaturate() {
322
+ return this._applyModification(_desaturate, arguments);
323
+ },
324
+ saturate: function saturate() {
325
+ return this._applyModification(_saturate, arguments);
326
+ },
327
+ greyscale: function greyscale() {
328
+ return this._applyModification(_greyscale, arguments);
329
+ },
330
+ spin: function spin() {
331
+ return this._applyModification(_spin, arguments);
332
+ },
333
+ _applyCombination: function _applyCombination(fn, args) {
334
+ return fn.apply(null, [this].concat([].slice.call(args)));
335
+ },
336
+ analogous: function analogous() {
337
+ return this._applyCombination(_analogous, arguments);
338
+ },
339
+ complement: function complement() {
340
+ return this._applyCombination(_complement, arguments);
341
+ },
342
+ monochromatic: function monochromatic() {
343
+ return this._applyCombination(_monochromatic, arguments);
344
+ },
345
+ splitcomplement: function splitcomplement() {
346
+ return this._applyCombination(_splitcomplement, arguments);
347
+ },
348
+ // Disabled until https://github.com/bgrins/TinyColor/issues/254
349
+ // polyad: function (number) {
350
+ // return this._applyCombination(polyad, [number]);
351
+ // },
352
+ triad: function triad() {
353
+ return this._applyCombination(polyad, [3]);
354
+ },
355
+ tetrad: function tetrad() {
356
+ return this._applyCombination(polyad, [4]);
357
+ }
358
+ };
359
+
360
+ // If input is an object, force 1 into "1.0" to handle ratios properly
361
+ // String input requires "1.0" as input, so 1 will be treated as 1
362
+ tinycolor.fromRatio = function (color, opts) {
363
+ if (tinycolor_typeof(color) == "object") {
364
+ var newColor = {};
365
+ for (var i in color) {
366
+ if (color.hasOwnProperty(i)) {
367
+ if (i === "a") {
368
+ newColor[i] = color[i];
369
+ } else {
370
+ newColor[i] = convertToPercentage(color[i]);
371
+ }
372
+ }
373
+ }
374
+ color = newColor;
375
+ }
376
+ return tinycolor(color, opts);
377
+ };
378
+
379
+ // Given a string or object, convert that input to RGB
380
+ // Possible string inputs:
381
+ //
382
+ // "red"
383
+ // "#f00" or "f00"
384
+ // "#ff0000" or "ff0000"
385
+ // "#ff000000" or "ff000000"
386
+ // "rgb 255 0 0" or "rgb (255, 0, 0)"
387
+ // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
388
+ // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
389
+ // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
390
+ // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
391
+ // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
392
+ // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
393
+ //
394
+ function inputToRGB(color) {
395
+ var rgb = {
396
+ r: 0,
397
+ g: 0,
398
+ b: 0
399
+ };
400
+ var a = 1;
401
+ var s = null;
402
+ var v = null;
403
+ var l = null;
404
+ var ok = false;
405
+ var format = false;
406
+ if (typeof color == "string") {
407
+ color = stringInputToObject(color);
408
+ }
409
+ if (tinycolor_typeof(color) == "object") {
410
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
411
+ rgb = rgbToRgb(color.r, color.g, color.b);
412
+ ok = true;
413
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
414
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
415
+ s = convertToPercentage(color.s);
416
+ v = convertToPercentage(color.v);
417
+ rgb = hsvToRgb(color.h, s, v);
418
+ ok = true;
419
+ format = "hsv";
420
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
421
+ s = convertToPercentage(color.s);
422
+ l = convertToPercentage(color.l);
423
+ rgb = hslToRgb(color.h, s, l);
424
+ ok = true;
425
+ format = "hsl";
426
+ }
427
+ if (color.hasOwnProperty("a")) {
428
+ a = color.a;
429
+ }
430
+ }
431
+ a = boundAlpha(a);
432
+ return {
433
+ ok: ok,
434
+ format: color.format || format,
435
+ r: Math.min(255, Math.max(rgb.r, 0)),
436
+ g: Math.min(255, Math.max(rgb.g, 0)),
437
+ b: Math.min(255, Math.max(rgb.b, 0)),
438
+ a: a
439
+ };
440
+ }
441
+
442
+ // Conversion Functions
443
+ // --------------------
444
+
445
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
446
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
447
+
448
+ // `rgbToRgb`
449
+ // Handle bounds / percentage checking to conform to CSS color spec
450
+ // <http://www.w3.org/TR/css3-color/>
451
+ // *Assumes:* r, g, b in [0, 255] or [0, 1]
452
+ // *Returns:* { r, g, b } in [0, 255]
453
+ function rgbToRgb(r, g, b) {
454
+ return {
455
+ r: bound01(r, 255) * 255,
456
+ g: bound01(g, 255) * 255,
457
+ b: bound01(b, 255) * 255
458
+ };
459
+ }
460
+
461
+ // `rgbToHsl`
462
+ // Converts an RGB color value to HSL.
463
+ // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
464
+ // *Returns:* { h, s, l } in [0,1]
465
+ function rgbToHsl(r, g, b) {
466
+ r = bound01(r, 255);
467
+ g = bound01(g, 255);
468
+ b = bound01(b, 255);
469
+ var max = Math.max(r, g, b),
470
+ min = Math.min(r, g, b);
471
+ var h,
472
+ s,
473
+ l = (max + min) / 2;
474
+ if (max == min) {
475
+ h = s = 0; // achromatic
476
+ } else {
477
+ var d = max - min;
478
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
479
+ switch (max) {
480
+ case r:
481
+ h = (g - b) / d + (g < b ? 6 : 0);
482
+ break;
483
+ case g:
484
+ h = (b - r) / d + 2;
485
+ break;
486
+ case b:
487
+ h = (r - g) / d + 4;
488
+ break;
489
+ }
490
+ h /= 6;
491
+ }
492
+ return {
493
+ h: h,
494
+ s: s,
495
+ l: l
496
+ };
497
+ }
498
+
499
+ // `hslToRgb`
500
+ // Converts an HSL color value to RGB.
501
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
502
+ // *Returns:* { r, g, b } in the set [0, 255]
503
+ function hslToRgb(h, s, l) {
504
+ var r, g, b;
505
+ h = bound01(h, 360);
506
+ s = bound01(s, 100);
507
+ l = bound01(l, 100);
508
+ function hue2rgb(p, q, t) {
509
+ if (t < 0) t += 1;
510
+ if (t > 1) t -= 1;
511
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
512
+ if (t < 1 / 2) return q;
513
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
514
+ return p;
515
+ }
516
+ if (s === 0) {
517
+ r = g = b = l; // achromatic
518
+ } else {
519
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
520
+ var p = 2 * l - q;
521
+ r = hue2rgb(p, q, h + 1 / 3);
522
+ g = hue2rgb(p, q, h);
523
+ b = hue2rgb(p, q, h - 1 / 3);
524
+ }
525
+ return {
526
+ r: r * 255,
527
+ g: g * 255,
528
+ b: b * 255
529
+ };
530
+ }
531
+
532
+ // `rgbToHsv`
533
+ // Converts an RGB color value to HSV
534
+ // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
535
+ // *Returns:* { h, s, v } in [0,1]
536
+ function rgbToHsv(r, g, b) {
537
+ r = bound01(r, 255);
538
+ g = bound01(g, 255);
539
+ b = bound01(b, 255);
540
+ var max = Math.max(r, g, b),
541
+ min = Math.min(r, g, b);
542
+ var h,
543
+ s,
544
+ v = max;
545
+ var d = max - min;
546
+ s = max === 0 ? 0 : d / max;
547
+ if (max == min) {
548
+ h = 0; // achromatic
549
+ } else {
550
+ switch (max) {
551
+ case r:
552
+ h = (g - b) / d + (g < b ? 6 : 0);
553
+ break;
554
+ case g:
555
+ h = (b - r) / d + 2;
556
+ break;
557
+ case b:
558
+ h = (r - g) / d + 4;
559
+ break;
560
+ }
561
+ h /= 6;
562
+ }
563
+ return {
564
+ h: h,
565
+ s: s,
566
+ v: v
567
+ };
568
+ }
569
+
570
+ // `hsvToRgb`
571
+ // Converts an HSV color value to RGB.
572
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
573
+ // *Returns:* { r, g, b } in the set [0, 255]
574
+ function hsvToRgb(h, s, v) {
575
+ h = bound01(h, 360) * 6;
576
+ s = bound01(s, 100);
577
+ v = bound01(v, 100);
578
+ var i = Math.floor(h),
579
+ f = h - i,
580
+ p = v * (1 - s),
581
+ q = v * (1 - f * s),
582
+ t = v * (1 - (1 - f) * s),
583
+ mod = i % 6,
584
+ r = [v, q, p, p, t, v][mod],
585
+ g = [t, v, v, q, p, p][mod],
586
+ b = [p, p, t, v, v, q][mod];
587
+ return {
588
+ r: r * 255,
589
+ g: g * 255,
590
+ b: b * 255
591
+ };
592
+ }
593
+
594
+ // `rgbToHex`
595
+ // Converts an RGB color to hex
596
+ // Assumes r, g, and b are contained in the set [0, 255]
597
+ // Returns a 3 or 6 character hex
598
+ function rgbToHex(r, g, b, allow3Char) {
599
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
600
+
601
+ // Return a 3 character hex if possible
602
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
603
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
604
+ }
605
+ return hex.join("");
606
+ }
607
+
608
+ // `rgbaToHex`
609
+ // Converts an RGBA color plus alpha transparency to hex
610
+ // Assumes r, g, b are contained in the set [0, 255] and
611
+ // a in [0, 1]. Returns a 4 or 8 character rgba hex
612
+ function rgbaToHex(r, g, b, a, allow4Char) {
613
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
614
+
615
+ // Return a 4 character hex if possible
616
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
617
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
618
+ }
619
+ return hex.join("");
620
+ }
621
+
622
+ // `rgbaToArgbHex`
623
+ // Converts an RGBA color to an ARGB Hex8 string
624
+ // Rarely used, but required for "toFilter()"
625
+ function rgbaToArgbHex(r, g, b, a) {
626
+ var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
627
+ return hex.join("");
628
+ }
629
+
630
+ // `equals`
631
+ // Can be called with any tinycolor input
632
+ tinycolor.equals = function (color1, color2) {
633
+ if (!color1 || !color2) return false;
634
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
635
+ };
636
+ tinycolor.random = function () {
637
+ return tinycolor.fromRatio({
638
+ r: Math.random(),
639
+ g: Math.random(),
640
+ b: Math.random()
641
+ });
642
+ };
643
+
644
+ // Modification Functions
645
+ // ----------------------
646
+ // Thanks to less.js for some of the basics here
647
+ // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
648
+
649
+ function _desaturate(color, amount) {
650
+ amount = amount === 0 ? 0 : amount || 10;
651
+ var hsl = tinycolor(color).toHsl();
652
+ hsl.s -= amount / 100;
653
+ hsl.s = clamp01(hsl.s);
654
+ return tinycolor(hsl);
655
+ }
656
+ function _saturate(color, amount) {
657
+ amount = amount === 0 ? 0 : amount || 10;
658
+ var hsl = tinycolor(color).toHsl();
659
+ hsl.s += amount / 100;
660
+ hsl.s = clamp01(hsl.s);
661
+ return tinycolor(hsl);
662
+ }
663
+ function _greyscale(color) {
664
+ return tinycolor(color).desaturate(100);
665
+ }
666
+ function _lighten(color, amount) {
667
+ amount = amount === 0 ? 0 : amount || 10;
668
+ var hsl = tinycolor(color).toHsl();
669
+ hsl.l += amount / 100;
670
+ hsl.l = clamp01(hsl.l);
671
+ return tinycolor(hsl);
672
+ }
673
+ function _brighten(color, amount) {
674
+ amount = amount === 0 ? 0 : amount || 10;
675
+ var rgb = tinycolor(color).toRgb();
676
+ rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
677
+ rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
678
+ rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
679
+ return tinycolor(rgb);
680
+ }
681
+ function _darken(color, amount) {
682
+ amount = amount === 0 ? 0 : amount || 10;
683
+ var hsl = tinycolor(color).toHsl();
684
+ hsl.l -= amount / 100;
685
+ hsl.l = clamp01(hsl.l);
686
+ return tinycolor(hsl);
687
+ }
688
+
689
+ // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
690
+ // Values outside of this range will be wrapped into this range.
691
+ function _spin(color, amount) {
692
+ var hsl = tinycolor(color).toHsl();
693
+ var hue = (hsl.h + amount) % 360;
694
+ hsl.h = hue < 0 ? 360 + hue : hue;
695
+ return tinycolor(hsl);
696
+ }
697
+
698
+ // Combination Functions
699
+ // ---------------------
700
+ // Thanks to jQuery xColor for some of the ideas behind these
701
+ // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
702
+
703
+ function _complement(color) {
704
+ var hsl = tinycolor(color).toHsl();
705
+ hsl.h = (hsl.h + 180) % 360;
706
+ return tinycolor(hsl);
707
+ }
708
+ function polyad(color, number) {
709
+ if (isNaN(number) || number <= 0) {
710
+ throw new Error("Argument to polyad must be a positive number");
711
+ }
712
+ var hsl = tinycolor(color).toHsl();
713
+ var result = [tinycolor(color)];
714
+ var step = 360 / number;
715
+ for (var i = 1; i < number; i++) {
716
+ result.push(tinycolor({
717
+ h: (hsl.h + i * step) % 360,
718
+ s: hsl.s,
719
+ l: hsl.l
720
+ }));
721
+ }
722
+ return result;
723
+ }
724
+ function _splitcomplement(color) {
725
+ var hsl = tinycolor(color).toHsl();
726
+ var h = hsl.h;
727
+ return [tinycolor(color), tinycolor({
728
+ h: (h + 72) % 360,
729
+ s: hsl.s,
730
+ l: hsl.l
731
+ }), tinycolor({
732
+ h: (h + 216) % 360,
733
+ s: hsl.s,
734
+ l: hsl.l
735
+ })];
736
+ }
737
+ function _analogous(color, results, slices) {
738
+ results = results || 6;
739
+ slices = slices || 30;
740
+ var hsl = tinycolor(color).toHsl();
741
+ var part = 360 / slices;
742
+ var ret = [tinycolor(color)];
743
+ for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
744
+ hsl.h = (hsl.h + part) % 360;
745
+ ret.push(tinycolor(hsl));
746
+ }
747
+ return ret;
748
+ }
749
+ function _monochromatic(color, results) {
750
+ results = results || 6;
751
+ var hsv = tinycolor(color).toHsv();
752
+ var h = hsv.h,
753
+ s = hsv.s,
754
+ v = hsv.v;
755
+ var ret = [];
756
+ var modification = 1 / results;
757
+ while (results--) {
758
+ ret.push(tinycolor({
759
+ h: h,
760
+ s: s,
761
+ v: v
762
+ }));
763
+ v = (v + modification) % 1;
764
+ }
765
+ return ret;
766
+ }
767
+
768
+ // Utility Functions
769
+ // ---------------------
770
+
771
+ tinycolor.mix = function (color1, color2, amount) {
772
+ amount = amount === 0 ? 0 : amount || 50;
773
+ var rgb1 = tinycolor(color1).toRgb();
774
+ var rgb2 = tinycolor(color2).toRgb();
775
+ var p = amount / 100;
776
+ var rgba = {
777
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
778
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
779
+ b: (rgb2.b - rgb1.b) * p + rgb1.b,
780
+ a: (rgb2.a - rgb1.a) * p + rgb1.a
781
+ };
782
+ return tinycolor(rgba);
783
+ };
784
+
785
+ // Readability Functions
786
+ // ---------------------
787
+ // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
788
+
789
+ // `contrast`
790
+ // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
791
+ tinycolor.readability = function (color1, color2) {
792
+ var c1 = tinycolor(color1);
793
+ var c2 = tinycolor(color2);
794
+ return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
795
+ };
796
+
797
+ // `isReadable`
798
+ // Ensure that foreground and background color combinations meet WCAG2 guidelines.
799
+ // The third argument is an optional Object.
800
+ // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
801
+ // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
802
+ // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
803
+
804
+ // *Example*
805
+ // tinycolor.isReadable("#000", "#111") => false
806
+ // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
807
+ tinycolor.isReadable = function (color1, color2, wcag2) {
808
+ var readability = tinycolor.readability(color1, color2);
809
+ var wcag2Parms, out;
810
+ out = false;
811
+ wcag2Parms = validateWCAG2Parms(wcag2);
812
+ switch (wcag2Parms.level + wcag2Parms.size) {
813
+ case "AAsmall":
814
+ case "AAAlarge":
815
+ out = readability >= 4.5;
816
+ break;
817
+ case "AAlarge":
818
+ out = readability >= 3;
819
+ break;
820
+ case "AAAsmall":
821
+ out = readability >= 7;
822
+ break;
823
+ }
824
+ return out;
825
+ };
826
+
827
+ // `mostReadable`
828
+ // Given a base color and a list of possible foreground or background
829
+ // colors for that base, returns the most readable color.
830
+ // Optionally returns Black or White if the most readable color is unreadable.
831
+ // *Example*
832
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
833
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
834
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
835
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
836
+ tinycolor.mostReadable = function (baseColor, colorList, args) {
837
+ var bestColor = null;
838
+ var bestScore = 0;
839
+ var readability;
840
+ var includeFallbackColors, level, size;
841
+ args = args || {};
842
+ includeFallbackColors = args.includeFallbackColors;
843
+ level = args.level;
844
+ size = args.size;
845
+ for (var i = 0; i < colorList.length; i++) {
846
+ readability = tinycolor.readability(baseColor, colorList[i]);
847
+ if (readability > bestScore) {
848
+ bestScore = readability;
849
+ bestColor = tinycolor(colorList[i]);
850
+ }
851
+ }
852
+ if (tinycolor.isReadable(baseColor, bestColor, {
853
+ level: level,
854
+ size: size
855
+ }) || !includeFallbackColors) {
856
+ return bestColor;
857
+ } else {
858
+ args.includeFallbackColors = false;
859
+ return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
860
+ }
861
+ };
862
+
863
+ // Big List of Colors
864
+ // ------------------
865
+ // <https://www.w3.org/TR/css-color-4/#named-colors>
866
+ var names = tinycolor.names = {
867
+ aliceblue: "f0f8ff",
868
+ antiquewhite: "faebd7",
869
+ aqua: "0ff",
870
+ aquamarine: "7fffd4",
871
+ azure: "f0ffff",
872
+ beige: "f5f5dc",
873
+ bisque: "ffe4c4",
874
+ black: "000",
875
+ blanchedalmond: "ffebcd",
876
+ blue: "00f",
877
+ blueviolet: "8a2be2",
878
+ brown: "a52a2a",
879
+ burlywood: "deb887",
880
+ burntsienna: "ea7e5d",
881
+ cadetblue: "5f9ea0",
882
+ chartreuse: "7fff00",
883
+ chocolate: "d2691e",
884
+ coral: "ff7f50",
885
+ cornflowerblue: "6495ed",
886
+ cornsilk: "fff8dc",
887
+ crimson: "dc143c",
888
+ cyan: "0ff",
889
+ darkblue: "00008b",
890
+ darkcyan: "008b8b",
891
+ darkgoldenrod: "b8860b",
892
+ darkgray: "a9a9a9",
893
+ darkgreen: "006400",
894
+ darkgrey: "a9a9a9",
895
+ darkkhaki: "bdb76b",
896
+ darkmagenta: "8b008b",
897
+ darkolivegreen: "556b2f",
898
+ darkorange: "ff8c00",
899
+ darkorchid: "9932cc",
900
+ darkred: "8b0000",
901
+ darksalmon: "e9967a",
902
+ darkseagreen: "8fbc8f",
903
+ darkslateblue: "483d8b",
904
+ darkslategray: "2f4f4f",
905
+ darkslategrey: "2f4f4f",
906
+ darkturquoise: "00ced1",
907
+ darkviolet: "9400d3",
908
+ deeppink: "ff1493",
909
+ deepskyblue: "00bfff",
910
+ dimgray: "696969",
911
+ dimgrey: "696969",
912
+ dodgerblue: "1e90ff",
913
+ firebrick: "b22222",
914
+ floralwhite: "fffaf0",
915
+ forestgreen: "228b22",
916
+ fuchsia: "f0f",
917
+ gainsboro: "dcdcdc",
918
+ ghostwhite: "f8f8ff",
919
+ gold: "ffd700",
920
+ goldenrod: "daa520",
921
+ gray: "808080",
922
+ green: "008000",
923
+ greenyellow: "adff2f",
924
+ grey: "808080",
925
+ honeydew: "f0fff0",
926
+ hotpink: "ff69b4",
927
+ indianred: "cd5c5c",
928
+ indigo: "4b0082",
929
+ ivory: "fffff0",
930
+ khaki: "f0e68c",
931
+ lavender: "e6e6fa",
932
+ lavenderblush: "fff0f5",
933
+ lawngreen: "7cfc00",
934
+ lemonchiffon: "fffacd",
935
+ lightblue: "add8e6",
936
+ lightcoral: "f08080",
937
+ lightcyan: "e0ffff",
938
+ lightgoldenrodyellow: "fafad2",
939
+ lightgray: "d3d3d3",
940
+ lightgreen: "90ee90",
941
+ lightgrey: "d3d3d3",
942
+ lightpink: "ffb6c1",
943
+ lightsalmon: "ffa07a",
944
+ lightseagreen: "20b2aa",
945
+ lightskyblue: "87cefa",
946
+ lightslategray: "789",
947
+ lightslategrey: "789",
948
+ lightsteelblue: "b0c4de",
949
+ lightyellow: "ffffe0",
950
+ lime: "0f0",
951
+ limegreen: "32cd32",
952
+ linen: "faf0e6",
953
+ magenta: "f0f",
954
+ maroon: "800000",
955
+ mediumaquamarine: "66cdaa",
956
+ mediumblue: "0000cd",
957
+ mediumorchid: "ba55d3",
958
+ mediumpurple: "9370db",
959
+ mediumseagreen: "3cb371",
960
+ mediumslateblue: "7b68ee",
961
+ mediumspringgreen: "00fa9a",
962
+ mediumturquoise: "48d1cc",
963
+ mediumvioletred: "c71585",
964
+ midnightblue: "191970",
965
+ mintcream: "f5fffa",
966
+ mistyrose: "ffe4e1",
967
+ moccasin: "ffe4b5",
968
+ navajowhite: "ffdead",
969
+ navy: "000080",
970
+ oldlace: "fdf5e6",
971
+ olive: "808000",
972
+ olivedrab: "6b8e23",
973
+ orange: "ffa500",
974
+ orangered: "ff4500",
975
+ orchid: "da70d6",
976
+ palegoldenrod: "eee8aa",
977
+ palegreen: "98fb98",
978
+ paleturquoise: "afeeee",
979
+ palevioletred: "db7093",
980
+ papayawhip: "ffefd5",
981
+ peachpuff: "ffdab9",
982
+ peru: "cd853f",
983
+ pink: "ffc0cb",
984
+ plum: "dda0dd",
985
+ powderblue: "b0e0e6",
986
+ purple: "800080",
987
+ rebeccapurple: "663399",
988
+ red: "f00",
989
+ rosybrown: "bc8f8f",
990
+ royalblue: "4169e1",
991
+ saddlebrown: "8b4513",
992
+ salmon: "fa8072",
993
+ sandybrown: "f4a460",
994
+ seagreen: "2e8b57",
995
+ seashell: "fff5ee",
996
+ sienna: "a0522d",
997
+ silver: "c0c0c0",
998
+ skyblue: "87ceeb",
999
+ slateblue: "6a5acd",
1000
+ slategray: "708090",
1001
+ slategrey: "708090",
1002
+ snow: "fffafa",
1003
+ springgreen: "00ff7f",
1004
+ steelblue: "4682b4",
1005
+ tan: "d2b48c",
1006
+ teal: "008080",
1007
+ thistle: "d8bfd8",
1008
+ tomato: "ff6347",
1009
+ turquoise: "40e0d0",
1010
+ violet: "ee82ee",
1011
+ wheat: "f5deb3",
1012
+ white: "fff",
1013
+ whitesmoke: "f5f5f5",
1014
+ yellow: "ff0",
1015
+ yellowgreen: "9acd32"
1016
+ };
1017
+
1018
+ // Make it easy to access colors via `hexNames[hex]`
1019
+ var hexNames = tinycolor.hexNames = flip(names);
1020
+
1021
+ // Utilities
1022
+ // ---------
1023
+
1024
+ // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
1025
+ function flip(o) {
1026
+ var flipped = {};
1027
+ for (var i in o) {
1028
+ if (o.hasOwnProperty(i)) {
1029
+ flipped[o[i]] = i;
1030
+ }
1031
+ }
1032
+ return flipped;
1033
+ }
1034
+
1035
+ // Return a valid alpha value [0,1] with all invalid values being set to 1
1036
+ function boundAlpha(a) {
1037
+ a = parseFloat(a);
1038
+ if (isNaN(a) || a < 0 || a > 1) {
1039
+ a = 1;
1040
+ }
1041
+ return a;
1042
+ }
1043
+
1044
+ // Take input from [0, n] and return it as [0, 1]
1045
+ function bound01(n, max) {
1046
+ if (isOnePointZero(n)) n = "100%";
1047
+ var processPercent = isPercentage(n);
1048
+ n = Math.min(max, Math.max(0, parseFloat(n)));
1049
+
1050
+ // Automatically convert percentage into number
1051
+ if (processPercent) {
1052
+ n = parseInt(n * max, 10) / 100;
1053
+ }
1054
+
1055
+ // Handle floating point rounding errors
1056
+ if (Math.abs(n - max) < 0.000001) {
1057
+ return 1;
1058
+ }
1059
+
1060
+ // Convert into [0, 1] range if it isn't already
1061
+ return n % max / parseFloat(max);
1062
+ }
1063
+
1064
+ // Force a number between 0 and 1
1065
+ function clamp01(val) {
1066
+ return Math.min(1, Math.max(0, val));
1067
+ }
1068
+
1069
+ // Parse a base-16 hex value into a base-10 integer
1070
+ function parseIntFromHex(val) {
1071
+ return parseInt(val, 16);
1072
+ }
1073
+
1074
+ // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
1075
+ // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
1076
+ function isOnePointZero(n) {
1077
+ return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
1078
+ }
1079
+
1080
+ // Check to see if string passed in is a percentage
1081
+ function isPercentage(n) {
1082
+ return typeof n === "string" && n.indexOf("%") != -1;
1083
+ }
1084
+
1085
+ // Force a hex value to have 2 characters
1086
+ function pad2(c) {
1087
+ return c.length == 1 ? "0" + c : "" + c;
1088
+ }
1089
+
1090
+ // Replace a decimal with it's percentage value
1091
+ function convertToPercentage(n) {
1092
+ if (n <= 1) {
1093
+ n = n * 100 + "%";
1094
+ }
1095
+ return n;
1096
+ }
1097
+
1098
+ // Converts a decimal to a hex value
1099
+ function convertDecimalToHex(d) {
1100
+ return Math.round(parseFloat(d) * 255).toString(16);
1101
+ }
1102
+ // Converts a hex value to a decimal
1103
+ function convertHexToDecimal(h) {
1104
+ return parseIntFromHex(h) / 255;
1105
+ }
1106
+ var matchers = function () {
1107
+ // <http://www.w3.org/TR/css3-values/#integers>
1108
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
1109
+
1110
+ // <http://www.w3.org/TR/css3-values/#number-value>
1111
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
1112
+
1113
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
1114
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
1115
+
1116
+ // Actual matching.
1117
+ // Parentheses and commas are optional, but not required.
1118
+ // Whitespace can take the place of commas or opening paren
1119
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1120
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1121
+ return {
1122
+ CSS_UNIT: new RegExp(CSS_UNIT),
1123
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
1124
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
1125
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
1126
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
1127
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
1128
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
1129
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1130
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
1131
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1132
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
1133
+ };
1134
+ }();
1135
+
1136
+ // `isValidCSSUnit`
1137
+ // Take in a single string / number and check to see if it looks like a CSS unit
1138
+ // (see `matchers` above for definition).
1139
+ function isValidCSSUnit(color) {
1140
+ return !!matchers.CSS_UNIT.exec(color);
1141
+ }
1142
+
1143
+ // `stringInputToObject`
1144
+ // Permissive string parsing. Take in a number of formats, and output an object
1145
+ // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
1146
+ function stringInputToObject(color) {
1147
+ color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
1148
+ var named = false;
1149
+ if (names[color]) {
1150
+ color = names[color];
1151
+ named = true;
1152
+ } else if (color == "transparent") {
1153
+ return {
1154
+ r: 0,
1155
+ g: 0,
1156
+ b: 0,
1157
+ a: 0,
1158
+ format: "name"
1159
+ };
1160
+ }
1161
+
1162
+ // Try to match string input using regular expressions.
1163
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
1164
+ // Just return an object and let the conversion functions handle that.
1165
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
1166
+ var match;
1167
+ if (match = matchers.rgb.exec(color)) {
1168
+ return {
1169
+ r: match[1],
1170
+ g: match[2],
1171
+ b: match[3]
1172
+ };
1173
+ }
1174
+ if (match = matchers.rgba.exec(color)) {
1175
+ return {
1176
+ r: match[1],
1177
+ g: match[2],
1178
+ b: match[3],
1179
+ a: match[4]
1180
+ };
1181
+ }
1182
+ if (match = matchers.hsl.exec(color)) {
1183
+ return {
1184
+ h: match[1],
1185
+ s: match[2],
1186
+ l: match[3]
1187
+ };
1188
+ }
1189
+ if (match = matchers.hsla.exec(color)) {
1190
+ return {
1191
+ h: match[1],
1192
+ s: match[2],
1193
+ l: match[3],
1194
+ a: match[4]
1195
+ };
1196
+ }
1197
+ if (match = matchers.hsv.exec(color)) {
1198
+ return {
1199
+ h: match[1],
1200
+ s: match[2],
1201
+ v: match[3]
1202
+ };
1203
+ }
1204
+ if (match = matchers.hsva.exec(color)) {
1205
+ return {
1206
+ h: match[1],
1207
+ s: match[2],
1208
+ v: match[3],
1209
+ a: match[4]
1210
+ };
1211
+ }
1212
+ if (match = matchers.hex8.exec(color)) {
1213
+ return {
1214
+ r: parseIntFromHex(match[1]),
1215
+ g: parseIntFromHex(match[2]),
1216
+ b: parseIntFromHex(match[3]),
1217
+ a: convertHexToDecimal(match[4]),
1218
+ format: named ? "name" : "hex8"
1219
+ };
1220
+ }
1221
+ if (match = matchers.hex6.exec(color)) {
1222
+ return {
1223
+ r: parseIntFromHex(match[1]),
1224
+ g: parseIntFromHex(match[2]),
1225
+ b: parseIntFromHex(match[3]),
1226
+ format: named ? "name" : "hex"
1227
+ };
1228
+ }
1229
+ if (match = matchers.hex4.exec(color)) {
1230
+ return {
1231
+ r: parseIntFromHex(match[1] + "" + match[1]),
1232
+ g: parseIntFromHex(match[2] + "" + match[2]),
1233
+ b: parseIntFromHex(match[3] + "" + match[3]),
1234
+ a: convertHexToDecimal(match[4] + "" + match[4]),
1235
+ format: named ? "name" : "hex8"
1236
+ };
1237
+ }
1238
+ if (match = matchers.hex3.exec(color)) {
1239
+ return {
1240
+ r: parseIntFromHex(match[1] + "" + match[1]),
1241
+ g: parseIntFromHex(match[2] + "" + match[2]),
1242
+ b: parseIntFromHex(match[3] + "" + match[3]),
1243
+ format: named ? "name" : "hex"
1244
+ };
1245
+ }
1246
+ return false;
1247
+ }
1248
+ function validateWCAG2Parms(parms) {
1249
+ // return valid WCAG2 parms for isReadable.
1250
+ // If input parms are invalid, return {"level":"AA", "size":"small"}
1251
+ var level, size;
1252
+ parms = parms || {
1253
+ level: "AA",
1254
+ size: "small"
1255
+ };
1256
+ level = (parms.level || "AA").toUpperCase();
1257
+ size = (parms.size || "small").toLowerCase();
1258
+ if (level !== "AA" && level !== "AAA") {
1259
+ level = "AA";
1260
+ }
1261
+ if (size !== "small" && size !== "large") {
1262
+ size = "small";
1263
+ }
1264
+ return {
1265
+ level: level,
1266
+ size: size
1267
+ };
1268
+ }
1269
+
1270
+
1271
+
1272
+ ;// CONCATENATED MODULE: external "vue-types"
1273
+ var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1274
+ var external_vue_types_y = x => () => x
1275
+ const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
1276
+ ;// CONCATENATED MODULE: external "../config-provider"
1277
+ var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1278
+ var config_provider_y = x => () => x
1279
+ const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
1280
+ ;// CONCATENATED MODULE: external "../directives"
1281
+ var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1282
+ var directives_y = x => () => x
1283
+ const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.clickoutside });
1284
+ ;// CONCATENATED MODULE: external "../icon"
1285
+ var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1286
+ var icon_y = x => () => x
1287
+ const icon_namespaceObject = icon_x({ ["AngleUp"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AngleUp });
1288
+ ;// CONCATENATED MODULE: ../../packages/date-picker/src/base/picker-dropdown.tsx
1289
+
1290
+
1291
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1292
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1293
+ /*
1294
+ * Tencent is pleased to support the open source community by making
1295
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1296
+ *
1297
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1298
+ *
1299
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1300
+ *
1301
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1302
+ *
1303
+ * ---------------------------------------------------
1304
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1305
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1306
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1307
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1308
+ *
1309
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1310
+ * the Software.
1311
+ *
1312
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1313
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1314
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1315
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1316
+ * IN THE SOFTWARE.
1317
+ */
1318
+
1319
+
1320
+
1321
+ var pickerDropdownProps = {
1322
+ placement: {
1323
+ type: String,
1324
+ "default": 'bottom-start',
1325
+ validator: function validator(value) {
1326
+ var validList = ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'];
1327
+ if (validList.indexOf(value) < 0) {
1328
+ console.error("placement property is not valid: '".concat(value, "'"));
1329
+ return false;
1330
+ }
1331
+ return true;
1332
+ }
1333
+ },
1334
+ className: {
1335
+ type: String
1336
+ },
1337
+ extPopoverCls: {
1338
+ type: String
1339
+ },
1340
+ appendToBody: {
1341
+ type: Boolean
1342
+ },
1343
+ triggerRef: {
1344
+ type: Object
1345
+ },
1346
+ onClick: Function
1347
+ };
1348
+ /* harmony default export */ const picker_dropdown = ((0,external_vue_namespaceObject.defineComponent)({
1349
+ props: pickerDropdownProps,
1350
+ emits: ['changeVisible'],
1351
+ setup: function setup(props, _ref) {
1352
+ var emit = _ref.emit;
1353
+ var popoverInstance = Object.create(null);
1354
+ var refContentRef = (0,external_vue_namespaceObject.ref)(null);
1355
+ (0,external_vue_namespaceObject.onMounted)(function () {
1356
+ updateDropdown();
1357
+ });
1358
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
1359
+ destoryDropdown();
1360
+ });
1361
+ // const resetTransformOrigin = (state) => {
1362
+ // if (popoverInstance && Object.keys(popoverInstance).length !== 0) {
1363
+ // const dataPopperPlacement = state.attributes.popper['data-popper-placement'] as string;
1364
+ // const arr = dataPopperPlacement.split('-');
1365
+ // const placementStart = arr[0];
1366
+ // const placementEnd = arr[1];
1367
+ // const leftOrRight = dataPopperPlacement === 'left' || dataPopperPlacement === 'right';
1368
+ // if (!leftOrRight) {
1369
+ // state.styles.popper.transformOrigin = placementStart === 'bottom'
1370
+ // || (placementStart !== 'top' && placementEnd === 'start')
1371
+ // ? 'center top'
1372
+ // : 'center bottom';
1373
+ // }
1374
+ // }
1375
+ // };
1376
+ var forceUpdate = function forceUpdate() {
1377
+ if (popoverInstance) {
1378
+ var _popoverInstance, _popoverInstance$forc;
1379
+ (_popoverInstance = popoverInstance) === null || _popoverInstance === void 0 || (_popoverInstance$forc = _popoverInstance.forceUpdate) === null || _popoverInstance$forc === void 0 ? void 0 : _popoverInstance$forc.call(_popoverInstance);
1380
+ }
1381
+ };
1382
+ var destoryDropdown = function destoryDropdown() {
1383
+ if (popoverInstance && Object.keys(popoverInstance).length !== 0) {
1384
+ var instance = popoverInstance;
1385
+ instance.isShow && instance.hide();
1386
+ instance.destroy();
1387
+ popoverInstance = null;
1388
+ emit('changeVisible', false);
1389
+ }
1390
+ };
1391
+ // const transforms = {
1392
+ // top: 'bottom center',
1393
+ // 'top-start': 'bottom left',
1394
+ // 'top-end': 'bottom right',
1395
+ // bottom: 'top center',
1396
+ // 'bottom-start': 'top left',
1397
+ // 'bottom-end': 'top right',
1398
+ // left: 'right center',
1399
+ // 'left-start': 'right top',
1400
+ // 'left-end': 'right bottom',
1401
+ // right: 'left center',
1402
+ // 'right-start': 'left top',
1403
+ // 'right-end': 'left bottom',
1404
+ // };
1405
+ // const toTransformOrigin = (placement: Placement) => transforms[placement];
1406
+ // const toVar = (value: string, fallback?: string) => ({
1407
+ // var: value,
1408
+ // varRef: fallback ? `var(${value}, ${fallback})` : `var(${value})`,
1409
+ // });
1410
+ // const cssVars = {
1411
+ // arrowShadowColor: toVar('--popper-arrow-shadow-color'),
1412
+ // arrowSize: toVar('--popper-arrow-size', '8px'),
1413
+ // arrowSizeHalf: toVar('--popper-arrow-size-half'),
1414
+ // arrowBg: toVar('--popper-arrow-bg'),
1415
+ // transformOrigin: toVar('--popper-transform-origin'),
1416
+ // arrowOffset: toVar('--popper-arrow-offset'),
1417
+ // } as const;
1418
+ // const setTransformOrigin = (state: State) => {
1419
+ // state.elements.popper.style.setProperty(
1420
+ // cssVars.transformOrigin.var,
1421
+ // toTransformOrigin(state.placement),
1422
+ // );
1423
+ // };
1424
+ // const transformOrigin: Modifier<'transformOrigin', any> = {
1425
+ // name: 'transformOrigin',
1426
+ // enabled: true,
1427
+ // phase: 'write',
1428
+ // fn: ({ state }) => {
1429
+ // setTransformOrigin(state);
1430
+ // },
1431
+ // effect: ({ state }) => () => {
1432
+ // setTransformOrigin(state);
1433
+ // },
1434
+ // };
1435
+ // const matchWidth: Modifier<'matchWidth', any> = {
1436
+ // name: 'matchWidth',
1437
+ // enabled: true,
1438
+ // phase: 'beforeWrite',
1439
+ // requires: ['computeStyles'],
1440
+ // fn: ({ state }) => {
1441
+ // state.styles.popper.width = `${state.rects.reference.width + 1}px`;
1442
+ // },
1443
+ // effect: ({ state }) => () => {
1444
+ // const reference = state.elements.reference as HTMLElement;
1445
+ // state.elements.popper.style.width = `${reference.offsetWidth}px`;
1446
+ // },
1447
+ // };
1448
+ var updateDropdown = function updateDropdown() {
1449
+ if (popoverInstance && Object.keys(popoverInstance).length !== 0) {
1450
+ (0,external_vue_namespaceObject.nextTick)(function () {
1451
+ popoverInstance.update();
1452
+ });
1453
+ } else {
1454
+ (0,external_vue_namespaceObject.nextTick)(function () {
1455
+ popoverInstance = new shared_namespaceObject.BKPopover(props.triggerRef, refContentRef.value, {
1456
+ placement: props.placement,
1457
+ trigger: 'manual',
1458
+ modifiers: [
1459
+ // matchWidth,
1460
+ // transformOrigin,
1461
+ {
1462
+ name: 'computeStyles',
1463
+ options: {
1464
+ adaptive: false,
1465
+ gpuAcceleration: false
1466
+ }
1467
+ }, {
1468
+ name: 'offset',
1469
+ options: {
1470
+ offset: [0, 4]
1471
+ }
1472
+ }
1473
+ // {
1474
+ // name: 'preventOverflow',
1475
+ // options: {
1476
+ // // boundariesElement: 'window',
1477
+ // padding: {
1478
+ // top: 2,
1479
+ // bottom: 2,
1480
+ // left: 5,
1481
+ // right: 5,
1482
+ // },
1483
+ // },
1484
+ // },
1485
+ // {
1486
+ // name: 'flip',
1487
+ // options: {
1488
+ // padding: 5,
1489
+ // rootBoundary: 'document',
1490
+ // },
1491
+ // },
1492
+ // {
1493
+ // name: 'onUpdate',
1494
+ // enabled: true,
1495
+ // phase: 'afterWrite',
1496
+ // fn({ state }) {
1497
+ // resetTransformOrigin(state);
1498
+ // },
1499
+ // },
1500
+ ]
1501
+ // onFirstUpdate: () => {
1502
+ // resetTransformOrigin(popoverInstance.instance.state);
1503
+ // },
1504
+ });
1505
+ // popoverInstance.update();
1506
+ });
1507
+ }
1508
+ };
1509
+
1510
+ var styles = (0,external_vue_namespaceObject.computed)(function () {
1511
+ var style = {};
1512
+ if (props.appendToBody) {
1513
+ style['z-index'] = 1060 + shared_namespaceObject.bkZIndexManager.getModalNextIndex();
1514
+ }
1515
+ return style;
1516
+ });
1517
+ var state = (0,external_vue_namespaceObject.reactive)({
1518
+ styles: styles
1519
+ });
1520
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1521
+ resolveClassName = _usePrefix.resolveClassName;
1522
+ return _objectSpread(_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(state)), {}, {
1523
+ refContentRef: refContentRef,
1524
+ forceUpdate: forceUpdate,
1525
+ updateDropdown: updateDropdown,
1526
+ destoryDropdown: destoryDropdown,
1527
+ resolveClassName: resolveClassName
1528
+ });
1529
+ },
1530
+ render: function render() {
1531
+ var _this$$slots$default, _this$$slots$default2, _this$$slots;
1532
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1533
+ "ref": "refContentRef",
1534
+ "class": [this.resolveClassName('date-picker-dropdown'), this.className, this.extPopoverCls],
1535
+ "style": this.styles,
1536
+ "onClick": this.onClick
1537
+ }, [(_this$$slots$default = (_this$$slots$default2 = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : '']);
1538
+ }
1539
+ }));
1540
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/input-container.tsx
1541
+
1542
+ /*
1543
+ * Tencent is pleased to support the open source community by making
1544
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1545
+ *
1546
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1547
+ *
1548
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1549
+ *
1550
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1551
+ *
1552
+ * ---------------------------------------------------
1553
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1554
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1555
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1556
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1557
+ *
1558
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1559
+ * the Software.
1560
+ *
1561
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1562
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1563
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1564
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1565
+ * IN THE SOFTWARE.
1566
+ */
1567
+
1568
+
1569
+
1570
+ var inputContainerProps = {
1571
+ info: shared_namespaceObject.PropTypes.object.isRequired
1572
+ };
1573
+ /* harmony default export */ const input_container = ((0,external_vue_namespaceObject.defineComponent)({
1574
+ props: inputContainerProps,
1575
+ emits: ['tab', 'input'],
1576
+ setup: function setup(props, _ref) {
1577
+ var emit = _ref.emit;
1578
+ var handleTab = function handleTab(e) {
1579
+ if (props.info.key === 'a') {
1580
+ emit('tab', e);
1581
+ }
1582
+ };
1583
+ var handleInput = function handleInput(e) {
1584
+ var key = props.info.key;
1585
+ var value = e.target.value;
1586
+ emit('input', key, value);
1587
+ };
1588
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1589
+ resolveClassName = _usePrefix.resolveClassName;
1590
+ var colorPickerCls = (0,external_vue_namespaceObject.computed)(function () {
1591
+ return (0,shared_namespaceObject.classes)({
1592
+ error: props.info.error
1593
+ }, "".concat(resolveClassName('color-picker-input-value')));
1594
+ });
1595
+ return function () {
1596
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1597
+ "class": "".concat(resolveClassName('color-picker-input-part'))
1598
+ }, [(0,external_vue_namespaceObject.createVNode)("input", {
1599
+ "type": props.info.name === 'HEX' ? 'text' : 'number',
1600
+ "class": colorPickerCls.value,
1601
+ "value": props.info.value,
1602
+ "onKeydown": handleTab,
1603
+ "onInput": handleInput
1604
+ }, null), (0,external_vue_namespaceObject.createVNode)("span", {
1605
+ "class": "".concat(resolveClassName('color-picker-input-text'))
1606
+ }, [props.info.name])]);
1607
+ };
1608
+ }
1609
+ }));
1610
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/color-input.tsx
1611
+
1612
+ /*
1613
+ * Tencent is pleased to support the open source community by making
1614
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1615
+ *
1616
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1617
+ *
1618
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1619
+ *
1620
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1621
+ *
1622
+ * ---------------------------------------------------
1623
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1624
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1625
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1626
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1627
+ *
1628
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1629
+ * the Software.
1630
+ *
1631
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1632
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1633
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1634
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1635
+ * IN THE SOFTWARE.
1636
+ */
1637
+
1638
+
1639
+
1640
+
1641
+
1642
+ var colorPickerProps = {
1643
+ colorObj: shared_namespaceObject.PropTypes.object.isRequired
1644
+ };
1645
+ /* harmony default export */ const color_input = ((0,external_vue_namespaceObject.defineComponent)({
1646
+ name: 'ColorPicker',
1647
+ props: colorPickerProps,
1648
+ emits: ['change', 'tab'],
1649
+ setup: function setup(props, _ref) {
1650
+ var emit = _ref.emit;
1651
+ var hex = (0,external_vue_namespaceObject.reactive)({
1652
+ key: 'hex',
1653
+ name: 'HEX',
1654
+ value: props.colorObj.hex,
1655
+ error: false
1656
+ });
1657
+ var r = (0,external_vue_namespaceObject.reactive)({
1658
+ key: 'r',
1659
+ name: 'R',
1660
+ value: props.colorObj.rgba.r.toString(),
1661
+ error: false
1662
+ });
1663
+ var g = (0,external_vue_namespaceObject.reactive)({
1664
+ key: 'g',
1665
+ name: 'G',
1666
+ value: props.colorObj.rgba.g.toString(),
1667
+ error: false
1668
+ });
1669
+ var b = (0,external_vue_namespaceObject.reactive)({
1670
+ key: 'b',
1671
+ name: 'B',
1672
+ value: props.colorObj.rgba.b.toString(),
1673
+ error: false
1674
+ });
1675
+ var a = (0,external_vue_namespaceObject.reactive)({
1676
+ key: 'a',
1677
+ name: 'Alpha',
1678
+ value: props.colorObj.rgba.a.toString(),
1679
+ error: false
1680
+ });
1681
+ (0,external_vue_namespaceObject.watch)(function () {
1682
+ return props.colorObj;
1683
+ }, function (val) {
1684
+ if (tinycolor(val.hex).toString() !== tinycolor(hex.value).toString()) {
1685
+ // 只有 hex 代表的颜色不同才同步,像这种手动输入了 #fEF 等价于 #ffeeff 就不同步
1686
+ hex.value = val.hex;
1687
+ }
1688
+ r.value = val.rgba.r.toString();
1689
+ g.value = val.rgba.g.toString();
1690
+ b.value = val.rgba.b.toString();
1691
+ a.value = val.rgba.a.toString();
1692
+ // 每次变化时校验以更新存在的错误
1693
+ validate();
1694
+ }, {
1695
+ deep: true
1696
+ });
1697
+ // 最后的 alpha 表单 tab 事件
1698
+ var handleAlphaTab = function handleAlphaTab(e) {
1699
+ emit('tab', e);
1700
+ };
1701
+ /**
1702
+ * 处理手动输入颜色
1703
+ * @param {String} key
1704
+ * @param {String} value
1705
+ */
1706
+ var handleInput = function handleInput(key, value) {
1707
+ var colorList = {
1708
+ r: r,
1709
+ g: g,
1710
+ b: b,
1711
+ a: a,
1712
+ hex: hex
1713
+ };
1714
+ colorList[key].value = value;
1715
+ if (validate()) {
1716
+ var colorStr = key === 'hex' ? hex.value : "rgba(".concat(r.value, ", ").concat(g.value, ", ").concat(b.value, ", ").concat(a.value, ")");
1717
+ emit('change', colorStr);
1718
+ }
1719
+ };
1720
+ // 判断表单输入值是否合法
1721
+ var validate = function validate() {
1722
+ var result = true;
1723
+ // hex
1724
+ if (hex.value.startsWith('#') && (hex.value.length === 4 || hex.value.length === 7) && !hex.value.slice(1).match(/[^0-9a-fA-F]/)) {
1725
+ hex.error = false;
1726
+ } else {
1727
+ hex.error = true;
1728
+ result = false;
1729
+ }
1730
+ // a
1731
+ if (a.value !== '' && a.value >= 0 && a.value <= 1) {
1732
+ a.error = false;
1733
+ } else {
1734
+ a.error = true;
1735
+ result = false;
1736
+ }
1737
+ // r g b
1738
+ for (var _i = 0, _arr = [r, g, b]; _i < _arr.length; _i++) {
1739
+ var colorInfo = _arr[_i];
1740
+ var value = colorInfo.value;
1741
+ if (value !== '' && value >= 0 && value <= 255) {
1742
+ colorInfo.error = false;
1743
+ } else {
1744
+ colorInfo.error = true;
1745
+ result = false;
1746
+ }
1747
+ }
1748
+ return result;
1749
+ };
1750
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1751
+ resolveClassName = _usePrefix.resolveClassName;
1752
+ return function () {
1753
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1754
+ "class": "".concat(resolveClassName('color-picker-input'))
1755
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
1756
+ "class": "".concat(resolveClassName('color-picker-input-hex'))
1757
+ }, [(0,external_vue_namespaceObject.createVNode)(input_container, {
1758
+ "info": hex,
1759
+ "onInput": handleInput
1760
+ }, null)]), (0,external_vue_namespaceObject.createVNode)("div", {
1761
+ "class": "".concat(resolveClassName('color-picker-input-rgba'))
1762
+ }, [(0,external_vue_namespaceObject.createVNode)(input_container, {
1763
+ "info": r,
1764
+ "onInput": handleInput
1765
+ }, null), (0,external_vue_namespaceObject.createVNode)(input_container, {
1766
+ "info": g,
1767
+ "onInput": handleInput
1768
+ }, null), (0,external_vue_namespaceObject.createVNode)(input_container, {
1769
+ "info": b,
1770
+ "onInput": handleInput
1771
+ }, null), (0,external_vue_namespaceObject.createVNode)(input_container, {
1772
+ "info": a,
1773
+ "onInput": handleInput,
1774
+ "onTab": handleAlphaTab
1775
+ }, null)])]);
1776
+ };
1777
+ }
1778
+ }));
1779
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/utils.ts
1780
+ /*
1781
+ * Tencent is pleased to support the open source community by making
1782
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1783
+ *
1784
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1785
+ *
1786
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1787
+ *
1788
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1789
+ *
1790
+ * ---------------------------------------------------
1791
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1792
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1793
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1794
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1795
+ *
1796
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1797
+ * the Software.
1798
+ *
1799
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1800
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1801
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1802
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1803
+ * IN THE SOFTWARE.
1804
+ */
1805
+
1806
+ /**
1807
+ * 根据饱和度面板、色值面板或普通色值标准化颜色信息
1808
+ * @param {String|Object} colorParam - 色值信息
1809
+ * @param {String} colorParam.h - 色相
1810
+ * @param {String} colorParam.s - 饱和度
1811
+ * @param {String} [colorParam.l] - 亮度
1812
+ * @param {String} [colorParam.v] - 明度
1813
+ * @param {String} colorParam.a - 透明度
1814
+ * @returns {Object} - 转化后的色值对象
1815
+ */
1816
+ var formatColor = function formatColor(colorParam) {
1817
+ var colorValue = colorParam;
1818
+ if (colorParam === '') {
1819
+ colorValue = '#FFFFFF';
1820
+ }
1821
+ // 如果参数不合法会返回黑色#000相关信息
1822
+ var tinyColor = tinycolor(colorParam);
1823
+ var hsl = tinyColor.toHsl();
1824
+ var hsv = tinyColor.toHsv();
1825
+ // 因为饱和度为0时,颜色不受色相值影响,色相会置零,但是这里需要在面板中保存色相值
1826
+ if (hsl.s === 0) {
1827
+ hsl.h = colorValue.h || 0;
1828
+ hsv.h = colorValue.h || 0;
1829
+ }
1830
+ // when the hsv.v is less than 0.0164 (base on test)
1831
+ // because of possible loss of precision
1832
+ // the result of hue and saturation would be miscalculated
1833
+ if (hsv.v < 0.0164) {
1834
+ hsv.h = colorValue.h || 0;
1835
+ hsv.s = colorValue.s || 0;
1836
+ }
1837
+ if (hsl.l < 0.01) {
1838
+ hsl.h = colorValue.h || 0;
1839
+ hsl.s = colorValue.s || 0;
1840
+ }
1841
+ return {
1842
+ hsl: hsl,
1843
+ hsv: hsv,
1844
+ hex: tinyColor.toHexString().toUpperCase(),
1845
+ rgba: tinyColor.toRgb()
1846
+ };
1847
+ };
1848
+ /**
1849
+ * 返回指定闭区间数值
1850
+ * @param {Number} value
1851
+ * @param {Number} min
1852
+ * @param {Number} max
1853
+ * @returns {Number}
1854
+ */
1855
+ var clamp = function clamp(value, min, max) {
1856
+ if (value < min) {
1857
+ return min;
1858
+ }
1859
+ if (value > max) {
1860
+ return max;
1861
+ }
1862
+ return value;
1863
+ };
1864
+ /**
1865
+ * 移动端获取事件位置
1866
+ * @param {Object} e
1867
+ * @param {String} prop
1868
+ * @returns {Number}
1869
+ */
1870
+ var getTouches = function getTouches(e, prop) {
1871
+ return e.touches ? e.touches[0][prop] : 0;
1872
+ };
1873
+ /**
1874
+ * 转化 rgba 色值字符串
1875
+ * @param {Object} rgba
1876
+ * @returns {String}
1877
+ */
1878
+ var toRGBAString = function toRGBAString(rgba) {
1879
+ var r = rgba.r,
1880
+ g = rgba.g,
1881
+ b = rgba.b,
1882
+ a = rgba.a;
1883
+ return "rgba(".concat([r, g, b, a].join(','), ")");
1884
+ };
1885
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/hue-slider.tsx
1886
+
1887
+ /*
1888
+ * Tencent is pleased to support the open source community by making
1889
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1890
+ *
1891
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1892
+ *
1893
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1894
+ *
1895
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1896
+ *
1897
+ * ---------------------------------------------------
1898
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1899
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1900
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1901
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1902
+ *
1903
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1904
+ * the Software.
1905
+ *
1906
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1907
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1908
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1909
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1910
+ * IN THE SOFTWARE.
1911
+ */
1912
+
1913
+
1914
+
1915
+
1916
+ var hue_slider_colorPickerProps = {
1917
+ colorObj: shared_namespaceObject.PropTypes.object.isRequired
1918
+ };
1919
+ /* harmony default export */ const hue_slider = ((0,external_vue_namespaceObject.defineComponent)({
1920
+ name: 'ColorPicker',
1921
+ props: hue_slider_colorPickerProps,
1922
+ emits: ['change'],
1923
+ setup: function setup(props, _ref) {
1924
+ var emit = _ref.emit;
1925
+ var containerRef = (0,external_vue_namespaceObject.ref)(null);
1926
+ var pointerStyle = (0,external_vue_namespaceObject.computed)(function () {
1927
+ return {
1928
+ left: "".concat(props.colorObj.hsv.h / 360 * 100, "%")
1929
+ };
1930
+ });
1931
+ var handleArrowKeydown = function handleArrowKeydown(e) {
1932
+ var clientWidth = containerRef.value.clientWidth;
1933
+ var left = props.colorObj.hsv.h / 360 * clientWidth;
1934
+ var step = 2;
1935
+ var hugeStep = 10;
1936
+ switch (e.code) {
1937
+ case 'ArrowLeft':
1938
+ e.preventDefault();
1939
+ left = clamp(left - step, 0, clientWidth);
1940
+ break;
1941
+ case 'ArrowRight':
1942
+ e.preventDefault();
1943
+ left = clamp(left + step, 0, clientWidth);
1944
+ break;
1945
+ case 'ArrowUp':
1946
+ e.preventDefault();
1947
+ left = clamp(left - hugeStep, 0, clientWidth);
1948
+ break;
1949
+ case 'ArrowDown':
1950
+ e.preventDefault();
1951
+ left = clamp(left + hugeStep, 0, clientWidth);
1952
+ break;
1953
+ default:
1954
+ return;
1955
+ }
1956
+ handlePointChange(null, left);
1957
+ };
1958
+ var handleMouseDown = function handleMouseDown(e) {
1959
+ containerRef.value.focus();
1960
+ handlePointChange(e);
1961
+ window.addEventListener('mousemove', handlePointChange, {
1962
+ passive: true
1963
+ });
1964
+ window.addEventListener('mouseup', handleMouseUp);
1965
+ };
1966
+ var handleMouseUp = function handleMouseUp() {
1967
+ window.removeEventListener('mousemove', handlePointChange);
1968
+ window.removeEventListener('mouseup', handleMouseUp);
1969
+ };
1970
+ /**
1971
+ * 色相面板变化
1972
+ * @param {MouseEvent|null} e - 鼠标滑动事件
1973
+ * @param {Number} [appointedLeft] - 键盘事件对应坐标,如果有就优先使用
1974
+ */
1975
+ var handlePointChange = function handlePointChange(e, appointedLeft) {
1976
+ var clientWidth = containerRef.value.clientWidth;
1977
+ var left = appointedLeft !== undefined ? appointedLeft : getLeft(e);
1978
+ changeColor(left / clientWidth);
1979
+ };
1980
+ var getLeft = function getLeft(e) {
1981
+ var xOffset = containerRef.value.getBoundingClientRect().left + window.pageXOffset;
1982
+ var pageX = e.pageX || getTouches(e, 'PageX');
1983
+ return clamp(pageX - xOffset, 0, containerRef.value.clientWidth);
1984
+ };
1985
+ var changeColor = function changeColor(ratio) {
1986
+ var _props$colorObj$hsl = props.colorObj.hsl,
1987
+ h = _props$colorObj$hsl.h,
1988
+ s = _props$colorObj$hsl.s,
1989
+ l = _props$colorObj$hsl.l,
1990
+ a = _props$colorObj$hsl.a;
1991
+ var newHue = ratio * 360;
1992
+ if (h !== newHue) {
1993
+ emit('change', {
1994
+ h: newHue,
1995
+ s: s,
1996
+ l: l,
1997
+ a: a
1998
+ });
1999
+ }
2000
+ };
2001
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
2002
+ resolveClassName = _usePrefix.resolveClassName;
2003
+ return function () {
2004
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2005
+ "ref": containerRef,
2006
+ "tabindex": "0",
2007
+ "class": "".concat(resolveClassName('color-picker-hue')),
2008
+ "onKeydown": handleArrowKeydown,
2009
+ "onMousedown": function onMousedown(e) {
2010
+ e.stopPropagation();
2011
+ e.preventDefault();
2012
+ handleMouseDown(e);
2013
+ }
2014
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2015
+ "class": "".concat(resolveClassName('color-picker-hue-pointer')),
2016
+ "style": pointerStyle.value
2017
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2018
+ "class": "".concat(resolveClassName('color-picker-hue-rectangle'))
2019
+ }, null)])]);
2020
+ };
2021
+ }
2022
+ }));
2023
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/recommend-colors.tsx
2024
+
2025
+
2026
+ /*
2027
+ * Tencent is pleased to support the open source community by making
2028
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2029
+ *
2030
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2031
+ *
2032
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2033
+ *
2034
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2035
+ *
2036
+ * ---------------------------------------------------
2037
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2038
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2039
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2040
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2041
+ *
2042
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2043
+ * the Software.
2044
+ *
2045
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2046
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2047
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2048
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2049
+ * IN THE SOFTWARE.
2050
+ */
2051
+
2052
+
2053
+
2054
+
2055
+
2056
+ var recommend_colors_colorPickerProps = {
2057
+ colorObj: shared_namespaceObject.PropTypes.object.isRequired,
2058
+ recommend: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.array.def(function () {
2059
+ return [];
2060
+ }), shared_namespaceObject.PropTypes.bool.def(true)]).isRequired,
2061
+ recommendEmpty: shared_namespaceObject.PropTypes.bool.def(true)
2062
+ };
2063
+ /* harmony default export */ const recommend_colors = ((0,external_vue_namespaceObject.defineComponent)({
2064
+ props: recommend_colors_colorPickerProps,
2065
+ emits: ['change', 'tab'],
2066
+ setup: function setup(props, _ref) {
2067
+ var emit = _ref.emit;
2068
+ var isFocused = (0,external_vue_namespaceObject.ref)(false);
2069
+ var selectedIndex = (0,external_vue_namespaceObject.ref)(-1);
2070
+ var selectedColor = (0,external_vue_namespaceObject.ref)(null);
2071
+ (0,external_vue_namespaceObject.watch)(function () {
2072
+ return props.colorObj;
2073
+ }, function () {
2074
+ // 每次在外部修改颜色后预设面板都会取消预设选择的样式,即便预设和当前色一样
2075
+ // 预设里面修改颜色会在 $nextTick 恢复状态
2076
+ selectedIndex.value = -1;
2077
+ selectedColor.value = null;
2078
+ }, {
2079
+ deep: true
2080
+ });
2081
+ var colors = (0,external_vue_namespaceObject.computed)(function () {
2082
+ return getColorsFromRecommend(props.recommend);
2083
+ });
2084
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
2085
+ resolveClassName = _usePrefix.resolveClassName;
2086
+ var getColorClass = function getColorClass(color, index) {
2087
+ var _classes;
2088
+ return (0,shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, "".concat(resolveClassName('color-picker-empty')), color === ''), _defineProperty(_classes, "".concat(resolveClassName('color-picker-recommend-selected-color')), isFocused.value && selectedIndex.value === index), _classes), "".concat(resolveClassName('color-picker-recommend-color')));
2089
+ };
2090
+ var handleKeydown = function handleKeydown(e) {
2091
+ if (e.code === 'Tab') {
2092
+ emit('tab', e);
2093
+ } else {
2094
+ var index = 0;
2095
+ var rowNum = 10; // 每行展示的颜色块个数,和样式相关联
2096
+ var max = colors.value.length - 1;
2097
+ switch (e.code) {
2098
+ case 'ArrowLeft':
2099
+ e.preventDefault();
2100
+ index = clamp(selectedIndex.value - 1, 0, max);
2101
+ break;
2102
+ case 'ArrowRight':
2103
+ e.preventDefault();
2104
+ index = clamp(selectedIndex.value + 1, 0, max);
2105
+ break;
2106
+ case 'ArrowUp':
2107
+ e.preventDefault();
2108
+ index = clamp(selectedIndex.value - rowNum, 0, max);
2109
+ break;
2110
+ case 'ArrowDown':
2111
+ e.preventDefault();
2112
+ index = clamp(selectedIndex.value + rowNum, 0, max);
2113
+ break;
2114
+ default:
2115
+ return;
2116
+ }
2117
+ selectColor(index);
2118
+ }
2119
+ };
2120
+ var selectColor = function selectColor(index) {
2121
+ var color = colors.value[index];
2122
+ emit('change', color);
2123
+ // 预设里面修改颜色不重置状态(恢复状态)
2124
+ (0,external_vue_namespaceObject.nextTick)(function () {
2125
+ selectedIndex.value = index;
2126
+ selectedColor.value = color;
2127
+ });
2128
+ };
2129
+ /**
2130
+ * 校验、处理预设值
2131
+ * @param {Boolean|String[]} recommend
2132
+ * @returns {String[]}
2133
+ */
2134
+ var getColorsFromRecommend = function getColorsFromRecommend(recommend) {
2135
+ if (recommend === true) {
2136
+ var list = ['#ff4500', '#ff8c00', '#ffd700', '#90ee90', '#ddffff', '#00ced1', '#3a84ff', '#a933f5', '#db7093', '#000000', '#494949', '#9B9B9B', '#ffffff'];
2137
+ if (props.recommendEmpty) {
2138
+ list.unshift('');
2139
+ }
2140
+ return list;
2141
+ }
2142
+ if (Array.isArray(recommend)) {
2143
+ // 如果预设值是无效的,这里按空字符串处理以显示提示用户,应该输入正确的色值
2144
+ return recommend.map(function (color) {
2145
+ return tinycolor(color).isValid() ? color : '';
2146
+ });
2147
+ }
2148
+ };
2149
+ return function () {
2150
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2151
+ "tabindex": "0",
2152
+ "class": "".concat(resolveClassName('color-picker-recommend'), " "),
2153
+ "onFocus": function onFocus() {
2154
+ return isFocused.value = true;
2155
+ },
2156
+ "onBlur": function onBlur() {
2157
+ return isFocused.value = false;
2158
+ },
2159
+ "onKeydown": handleKeydown
2160
+ }, [colors.value.map(function (color, index) {
2161
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2162
+ "style": "background: ".concat(color || '#fff'),
2163
+ "class": getColorClass(color, index),
2164
+ "onClick": function onClick() {
2165
+ return selectColor(index);
2166
+ }
2167
+ }, [selectedIndex.value === index ? (0,external_vue_namespaceObject.createVNode)("div", {
2168
+ "class": "".concat(resolveClassName('color-picker-pointer'))
2169
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2170
+ "class": "".concat(resolveClassName('color-picker-circle'))
2171
+ }, null)]) : undefined]);
2172
+ })]);
2173
+ };
2174
+ }
2175
+ }));
2176
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/components/saturation-panel.tsx
2177
+
2178
+ /*
2179
+ * Tencent is pleased to support the open source community by making
2180
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2181
+ *
2182
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2183
+ *
2184
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2185
+ *
2186
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2187
+ *
2188
+ * ---------------------------------------------------
2189
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2190
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2191
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2192
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2193
+ *
2194
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2195
+ * the Software.
2196
+ *
2197
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2198
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2199
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2200
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2201
+ * IN THE SOFTWARE.
2202
+ */
2203
+
2204
+
2205
+
2206
+
2207
+ var saturation_panel_colorPickerProps = {
2208
+ colorObj: shared_namespaceObject.PropTypes.object.isRequired
2209
+ };
2210
+ /* harmony default export */ const saturation_panel = ((0,external_vue_namespaceObject.defineComponent)({
2211
+ props: saturation_panel_colorPickerProps,
2212
+ emits: ['change'],
2213
+ setup: function setup(props, _ref) {
2214
+ var emit = _ref.emit;
2215
+ var containerRef = (0,external_vue_namespaceObject.ref)(null);
2216
+ var backgroundStyle = (0,external_vue_namespaceObject.computed)(function () {
2217
+ return {
2218
+ background: "hsl(".concat(props.colorObj.hsv.h, ", 100%, 50%)")
2219
+ };
2220
+ });
2221
+ var pointerStyle = (0,external_vue_namespaceObject.computed)(function () {
2222
+ return {
2223
+ top: "".concat((1 - props.colorObj.hsv.v) * 100, "%"),
2224
+ left: "".concat(props.colorObj.hsv.s * 100, "%")
2225
+ };
2226
+ });
2227
+ var handleMouseDown = function handleMouseDown(e) {
2228
+ containerRef.value.focus();
2229
+ handlePointChange(e);
2230
+ window.addEventListener('mousemove', handlePointChange, {
2231
+ passive: true
2232
+ });
2233
+ window.addEventListener('mouseup', handleMouseUp);
2234
+ };
2235
+ var handleMouseUp = function handleMouseUp() {
2236
+ window.removeEventListener('mousemove', handlePointChange);
2237
+ window.removeEventListener('mouseup', handleMouseUp);
2238
+ };
2239
+ var handleArrowKeydown = function handleArrowKeydown(e) {
2240
+ var _containerRef$value = containerRef.value,
2241
+ clientWidth = _containerRef$value.clientWidth,
2242
+ clientHeight = _containerRef$value.clientHeight;
2243
+ var left = props.colorObj.hsv.s * clientWidth;
2244
+ var top = (1 - props.colorObj.hsv.v) * clientHeight;
2245
+ var step = 10;
2246
+ switch (e.code) {
2247
+ case 'ArrowLeft':
2248
+ e.preventDefault();
2249
+ left = clamp(left - step, 0, clientWidth);
2250
+ break;
2251
+ case 'ArrowRight':
2252
+ e.preventDefault();
2253
+ left = clamp(left + step, 0, clientWidth);
2254
+ break;
2255
+ case 'ArrowUp':
2256
+ e.preventDefault();
2257
+ top = clamp(top - step, 0, clientHeight);
2258
+ break;
2259
+ case 'ArrowDown':
2260
+ e.preventDefault();
2261
+ top = clamp(top + step, 0, clientHeight);
2262
+ break;
2263
+ default:
2264
+ return;
2265
+ }
2266
+ handlePointChange(null, left, top);
2267
+ };
2268
+ /**
2269
+ * 饱和度面板变化
2270
+ * @param {MouseEvent|null} e - 鼠标滑动事件
2271
+ * @param {Number} [appointedLeft] - 键盘事件对应坐标,如果有就优先使用
2272
+ * @param {Number} [appointedTop] - 键盘事件对应坐标,如果有就优先使用
2273
+ */
2274
+ var handlePointChange = function handlePointChange(e, appointedLeft, appointedTop) {
2275
+ var _containerRef$value2 = containerRef.value,
2276
+ clientWidth = _containerRef$value2.clientWidth,
2277
+ clientHeight = _containerRef$value2.clientHeight;
2278
+ var left = appointedLeft !== undefined ? appointedLeft : getLeft(e);
2279
+ var top = appointedTop !== undefined ? appointedTop : getTop(e);
2280
+ var saturation = left / clientWidth;
2281
+ var bright = 1 - top / clientHeight;
2282
+ changeColor(props.colorObj.hsv.h, saturation, bright, props.colorObj.hsv.a);
2283
+ };
2284
+ var getLeft = function getLeft(e) {
2285
+ var xOffset = containerRef.value.getBoundingClientRect().left + window.pageXOffset;
2286
+ var pageX = e.pageX || getTouches(e, 'PageX');
2287
+ return clamp(pageX - xOffset, 0, containerRef.value.clientWidth);
2288
+ };
2289
+ var getTop = function getTop(e) {
2290
+ var yOffset = containerRef.value.getBoundingClientRect().top + window.pageYOffset;
2291
+ var pageY = e.pageY || getTouches(e, 'PageY');
2292
+ return clamp(pageY - yOffset, 0, containerRef.value.clientHeight);
2293
+ };
2294
+ var changeColor = function changeColor(h, s, v, a) {
2295
+ emit('change', {
2296
+ h: h,
2297
+ s: s,
2298
+ v: v,
2299
+ a: a
2300
+ });
2301
+ };
2302
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
2303
+ resolveClassName = _usePrefix.resolveClassName;
2304
+ return function () {
2305
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2306
+ "ref": containerRef,
2307
+ "tabindex": "0",
2308
+ "class": "".concat(resolveClassName('color-picker-saturation')),
2309
+ "style": backgroundStyle.value,
2310
+ "onKeydown": handleArrowKeydown,
2311
+ "onMousedown": function onMousedown(e) {
2312
+ e.stopPropagation();
2313
+ handleMouseDown(e);
2314
+ }
2315
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2316
+ "class": "".concat(resolveClassName('color-picker-saturation-white'))
2317
+ }, null), (0,external_vue_namespaceObject.createVNode)("div", {
2318
+ "class": "".concat(resolveClassName('color-picker-saturation-black'))
2319
+ }, null), (0,external_vue_namespaceObject.createVNode)("div", {
2320
+ "class": "".concat(resolveClassName('color-picker-pointer')),
2321
+ "style": pointerStyle.value
2322
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2323
+ "class": "".concat(resolveClassName('color-picker-circle'))
2324
+ }, null)])]);
2325
+ };
2326
+ }
2327
+ }));
2328
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/color-picker.tsx
2329
+
2330
+
2331
+ /*
2332
+ * Tencent is pleased to support the open source community by making
2333
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2334
+ *
2335
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2336
+ *
2337
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2338
+ *
2339
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2340
+ *
2341
+ * ---------------------------------------------------
2342
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2343
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2344
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2345
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2346
+ *
2347
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2348
+ * the Software.
2349
+ *
2350
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2351
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2352
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2353
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2354
+ * IN THE SOFTWARE.
2355
+ */
2356
+
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+
2365
+
2366
+
2367
+
2368
+
2369
+ var ColorPickSizeEnum;
2370
+ (function (ColorPickSizeEnum) {
2371
+ ColorPickSizeEnum["UNKNOWN"] = "";
2372
+ ColorPickSizeEnum["SMALL"] = "small";
2373
+ ColorPickSizeEnum["LARGE"] = "large";
2374
+ })(ColorPickSizeEnum || (ColorPickSizeEnum = {}));
2375
+ var color_picker_colorPickerProps = {
2376
+ modelValue: shared_namespaceObject.PropTypes.string.def(''),
2377
+ disabled: shared_namespaceObject.PropTypes.bool.def(false),
2378
+ readonly: shared_namespaceObject.PropTypes.bool.def(false),
2379
+ transfer: shared_namespaceObject.PropTypes.bool.def(false),
2380
+ size: (0,external_vue_types_namespaceObject.toType)('colorPickSize', {}).def(ColorPickSizeEnum.UNKNOWN),
2381
+ showValue: shared_namespaceObject.PropTypes.bool.def(true),
2382
+ // true 展示组件内置预设值
2383
+ // false 不展示预设值
2384
+ // 数组 自定义预设值
2385
+ recommend: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.array.def(function () {
2386
+ return [];
2387
+ }), shared_namespaceObject.PropTypes.bool.def(true)]).def(true),
2388
+ extCls: shared_namespaceObject.PropTypes.string.def(''),
2389
+ withValidate: shared_namespaceObject.PropTypes.bool.def(true),
2390
+ recommendEmpty: shared_namespaceObject.PropTypes.bool.def(true)
2391
+ };
2392
+ var whiteColorObj = formatColor('#FFFFFF');
2393
+ /* harmony default export */ const color_picker = ((0,external_vue_namespaceObject.defineComponent)({
2394
+ name: 'ColorPicker',
2395
+ directives: {
2396
+ clickoutside: directives_namespaceObject.clickoutside
2397
+ },
2398
+ props: color_picker_colorPickerProps,
2399
+ emits: ['update:modelValue', 'change'],
2400
+ setup: function setup(props, _ref) {
2401
+ var emit = _ref.emit,
2402
+ slots = _ref.slots;
2403
+ var formItem = (0,shared_namespaceObject.useFormItem)();
2404
+ var showDropdown = (0,external_vue_namespaceObject.ref)(false);
2405
+ // 当前颜色的色值,如果为空字符串显示:默认白色背景 + 中间一个叉
2406
+ var colorStr = (0,external_vue_namespaceObject.ref)('');
2407
+ // 储存当前颜色的相关信息
2408
+ var colorObj = (0,external_vue_namespaceObject.reactive)(JSON.parse(JSON.stringify(whiteColorObj)));
2409
+ var dropRef = (0,external_vue_namespaceObject.ref)(null);
2410
+ var saturationPanelRef = (0,external_vue_namespaceObject.ref)(null);
2411
+ var referenceRef = (0,external_vue_namespaceObject.ref)(null);
2412
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
2413
+ resolveClassName = _usePrefix.resolveClassName;
2414
+ var colorPickerCls = (0,external_vue_namespaceObject.computed)(function () {
2415
+ var _classes;
2416
+ return (0,shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, "".concat(resolveClassName("color-picker-".concat(props.size))), props.size), _defineProperty(_classes, "".concat(resolveClassName('color-picker-show-dropdown')), showDropdown.value), _defineProperty(_classes, "".concat(resolveClassName('color-picker-show-value')), props.showValue), _defineProperty(_classes, "".concat(resolveClassName('color-picker-disabled')), props.disabled || props.readonly), _classes), "".concat(resolveClassName('color-picker'), " ").concat(props.extCls));
2417
+ });
2418
+ // 是否渲染预设值
2419
+ var isRenderRecommend = (0,external_vue_namespaceObject.computed)(function () {
2420
+ return Boolean(props.recommend === true || Array.isArray(props.recommend) && props.recommend.length);
2421
+ });
2422
+ (0,external_vue_namespaceObject.onBeforeMount)(function () {
2423
+ // 1. 组件初始化时,如果计算的色值和传入的值不一样,显示计算的色值
2424
+ changeColorFromProps({
2425
+ isCreated: true
2426
+ });
2427
+ });
2428
+ (0,external_vue_namespaceObject.watch)(function () {
2429
+ return props.modelValue;
2430
+ }, function () {
2431
+ // 2. 如果组件绑定值被外部修改,自动根据绑定至更新组件色值
2432
+ changeColorFromProps();
2433
+ if (props.withValidate) {
2434
+ var _formItem$validate;
2435
+ formItem === null || formItem === void 0 || (_formItem$validate = formItem.validate) === null || _formItem$validate === void 0 ? void 0 : _formItem$validate.call(formItem, 'change');
2436
+ }
2437
+ });
2438
+ var handleTriggerKeydown = function handleTriggerKeydown(e) {
2439
+ if (e.code === 'Enter' || e.code === 'NumpadEnter') {
2440
+ toggleDropdown();
2441
+ } else if (e.code === 'Escape') {
2442
+ closeDropdown();
2443
+ }
2444
+ };
2445
+ var handleDropdownKeydown = function handleDropdownKeydown(e) {
2446
+ if (props.transfer) {
2447
+ handleTriggerKeydown(e);
2448
+ }
2449
+ };
2450
+ var toggleDropdown = function toggleDropdown() {
2451
+ if (props.disabled || props.readonly) {
2452
+ return;
2453
+ }
2454
+ showDropdown.value ? closeDropdown() : openDropdown();
2455
+ };
2456
+ // 如果未开启预设则此 tab 事件为颜色选择器最后一个表单 tab 事件,重新聚焦于饱和度面板
2457
+ var handleTabInput = function handleTabInput(e) {
2458
+ if (!isRenderRecommend.value) {
2459
+ e.preventDefault();
2460
+ saturationPanelRef.value.$el.focus();
2461
+ }
2462
+ };
2463
+ // 颜色选择器最后一个表单 tab 事件,重新聚焦于饱和度面板
2464
+ var handleTabRecommend = function handleTabRecommend(e) {
2465
+ e.preventDefault();
2466
+ saturationPanelRef.value.$el.focus();
2467
+ };
2468
+ var openDropdown = function openDropdown() {
2469
+ var _dropRef$value;
2470
+ showDropdown.value = true;
2471
+ (_dropRef$value = dropRef.value) === null || _dropRef$value === void 0 ? void 0 : _dropRef$value.updateDropdown();
2472
+ // 展开后默认聚焦于 HEX 输入框,setTimeout 等 transfer 出现
2473
+ setTimeout(function () {
2474
+ var hexInput = dropRef.value.$el.querySelector(".".concat(resolveClassName('color-picker-input-hex'), " .").concat(resolveClassName('color-picker-input-value')));
2475
+ hexInput.select();
2476
+ }, 100);
2477
+ };
2478
+ var closeDropdown = function closeDropdown() {
2479
+ if (showDropdown.value) {
2480
+ var _dropRef$value2;
2481
+ (0,external_vue_namespaceObject.nextTick)(function () {
2482
+ return referenceRef.value.focus();
2483
+ });
2484
+ showDropdown.value = false;
2485
+ (_dropRef$value2 = dropRef.value) === null || _dropRef$value2 === void 0 ? void 0 : _dropRef$value2.destoryDropdown();
2486
+ // 3. 关闭组件时如果绑定值与组件内部选择的值不一致(比如既没有使用 v-model 也没有监听 change 事件)显示绑定值
2487
+ changeColorFromProps();
2488
+ }
2489
+ };
2490
+ /**
2491
+ * created 时、props.value 变化时、每次关闭组件时调用
2492
+ * @param {Object} option
2493
+ * @param {Boolean} [option.isCreated = false] - 是否是实例创建完成后的第一次调用
2494
+ */
2495
+ var changeColorFromProps = function changeColorFromProps() {
2496
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2497
+ _ref2$isCreated = _ref2.isCreated,
2498
+ isCreated = _ref2$isCreated === void 0 ? false : _ref2$isCreated;
2499
+ // 空字符串为默认值且合法
2500
+ if (props.modelValue === '') {
2501
+ // 颜色选择器有色值,用户手动修改为空字符串;或用户关闭组件时绑定的value为空字符串(没有使用组件传递的值)
2502
+ if (colorStr.value !== '') {
2503
+ colorStr.value = '';
2504
+ Object.assign(colorObj, whiteColorObj);
2505
+ emit('update:modelValue', colorStr.value);
2506
+ }
2507
+ return;
2508
+ }
2509
+ // 根据 props 计算色值
2510
+ var propsColorObj = formatColor(props.modelValue);
2511
+ var propsColorStr = propsColorObj.rgba.a === 1 ? propsColorObj.hex : toRGBAString(propsColorObj.rgba);
2512
+ // 根据 props 计算的色值和组件内部色值不一致,有几种情况
2513
+ if (propsColorStr !== colorStr.value) {
2514
+ // 传入的值是否是合法的色值
2515
+ var isValid = tinycolor(props.modelValue).isValid();
2516
+ // 实例挂载之前
2517
+ if (isCreated) {
2518
+ // 传入了非法的色值,按空字符串处理并触发 change 事件
2519
+ if (!isValid) {
2520
+ Object.assign(colorObj, whiteColorObj);
2521
+ emit('change', '');
2522
+ } else {
2523
+ // 到了这里,说明传入的色值已经计算出来了,是合法的,但可能存在格式上的偏差,如用户传入 #fff 计算得 #FFFFFF
2524
+ colorStr.value = propsColorStr.toLowerCase() === props.modelValue.toLowerCase() ? props.modelValue // 如果只是大小写不一致,显示用户传入的字符
2525
+ : propsColorStr; // 其它格式上的不一致,以本组件计算值为准
2526
+ Object.assign(colorObj, propsColorObj);
2527
+ }
2528
+ } else {
2529
+ // 实例挂载之后
2530
+ // 用户在实例挂载之后在组件外面修改色值 组件内部只是跟着 props 变化色值 并不触发 change 事件
2531
+ if (!isValid) {
2532
+ colorStr.value = '';
2533
+ Object.assign(colorObj, whiteColorObj);
2534
+ } else if (propsColorStr.toLowerCase() !== colorStr.value.toLowerCase()) {
2535
+ // 如果只是外部传入的值和当前组件显示的的值大小写不一致,不作处理
2536
+ // 比如 this.value === '#ffffff',计算值为 '#FFFFFF',不进行下面的处理直接显示 '#ffffff'
2537
+ // 反之显示内部计算值:
2538
+ Object.assign(colorObj, propsColorObj);
2539
+ colorStr.value = propsColorStr;
2540
+ }
2541
+ }
2542
+ }
2543
+ };
2544
+ /**
2545
+ * 组件内部选择颜色处理
2546
+ * @param {String|Object} val - hex,rgba,hsla,hsva
2547
+ */
2548
+ var handleColorChange = function handleColorChange(val) {
2549
+ // 组件内拿到的色值都是合法的,空字符串特殊处理
2550
+ if (val === '') {
2551
+ colorStr.value = '';
2552
+ Object.assign(colorObj, whiteColorObj);
2553
+ emit('update:modelValue', '');
2554
+ emit('change', '');
2555
+ return;
2556
+ }
2557
+ var handleColorObj = formatColor(val);
2558
+ var handleColorStr = handleColorObj.rgba.a === 1 ? handleColorObj.hex : toRGBAString(handleColorObj.rgba);
2559
+ colorStr.value = handleColorStr;
2560
+ Object.assign(colorObj, handleColorObj);
2561
+ emit('update:modelValue', colorStr.value);
2562
+ emit('change', handleColorStr);
2563
+ };
2564
+ var hideDropDown = function hideDropDown() {
2565
+ showDropdown.value = false;
2566
+ };
2567
+ return function () {
2568
+ return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
2569
+ "ref": referenceRef,
2570
+ "tabindex": "0",
2571
+ "class": colorPickerCls.value,
2572
+ "onKeydown": handleTriggerKeydown,
2573
+ "onClick": toggleDropdown
2574
+ }, [typeof slots.trigger === 'function' ? slots.trigger({
2575
+ value: colorStr.value,
2576
+ isShowDropdown: showDropdown.value
2577
+ }) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("div", {
2578
+ "class": "".concat(resolveClassName('color-picker-color'))
2579
+ }, [(0,external_vue_namespaceObject.createVNode)("span", {
2580
+ "class": "".concat(resolveClassName('color-picker-color-square'), " ").concat(!colorStr.value && "".concat(resolveClassName('color-picker-empty'))),
2581
+ "style": "background: ".concat(colorStr.value || '#FFF')
2582
+ }, null)]), props.showValue ? (0,external_vue_namespaceObject.createVNode)("div", {
2583
+ "class": "".concat(resolveClassName('color-picker-text'))
2584
+ }, [(0,external_vue_namespaceObject.createVNode)("span", null, [colorStr.value])]) : undefined, (0,external_vue_namespaceObject.createVNode)("div", {
2585
+ "class": "".concat(resolveClassName('color-picker-icon'))
2586
+ }, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.AngleUp, {
2587
+ "class": "icon-angle-down"
2588
+ }, null)])]), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
2589
+ "name": "bk-fade-down-transition"
2590
+ }, {
2591
+ "default": function _default() {
2592
+ return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)(picker_dropdown, {
2593
+ "ref": dropRef,
2594
+ "triggerRef": referenceRef.value
2595
+ }, {
2596
+ "default": function _default() {
2597
+ return [(0,external_vue_namespaceObject.createVNode)("div", {
2598
+ "class": "".concat(resolveClassName('color-dropdown-container'))
2599
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2600
+ "class": "".concat(resolveClassName('color-picker-dropdown')),
2601
+ "onClick": function onClick(e) {
2602
+ e.stopPropagation();
2603
+ },
2604
+ "onMousedown": function onMousedown(e) {
2605
+ e.stopPropagation();
2606
+ },
2607
+ "onKeydown": handleDropdownKeydown
2608
+ }, [(0,external_vue_namespaceObject.createVNode)(saturation_panel, {
2609
+ "ref": saturationPanelRef,
2610
+ "colorObj": colorObj,
2611
+ "onChange": handleColorChange
2612
+ }, null), (0,external_vue_namespaceObject.createVNode)(hue_slider, {
2613
+ "colorObj": colorObj,
2614
+ "onChange": handleColorChange
2615
+ }, null), (0,external_vue_namespaceObject.createVNode)(color_input, {
2616
+ "colorObj": colorObj,
2617
+ "onTab": handleTabInput,
2618
+ "onChange": handleColorChange
2619
+ }, null), isRenderRecommend.value ? (0,external_vue_namespaceObject.createVNode)("div", {
2620
+ "class": "".concat(resolveClassName('color-picker-recommend-container'))
2621
+ }, [(0,external_vue_namespaceObject.createVNode)(recommend_colors, {
2622
+ "colorObj": colorObj,
2623
+ "recommend": props.recommend,
2624
+ "recommendEmpty": props.recommendEmpty,
2625
+ "onTab": handleTabRecommend,
2626
+ "onChange": handleColorChange
2627
+ }, null)]) : undefined])])];
2628
+ }
2629
+ }), [[external_vue_namespaceObject.vShow, showDropdown.value]])];
2630
+ }
2631
+ })]), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), hideDropDown]]);
2632
+ };
2633
+ }
2634
+ }));
2635
+ ;// CONCATENATED MODULE: ../../packages/color-picker/src/index.ts
2636
+ /*
2637
+ * Tencent is pleased to support the open source community by making
2638
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2639
+ *
2640
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2641
+ *
2642
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2643
+ *
2644
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2645
+ *
2646
+ * ---------------------------------------------------
2647
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2648
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2649
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2650
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2651
+ *
2652
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2653
+ * the Software.
2654
+ *
2655
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2656
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2657
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2658
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2659
+ * IN THE SOFTWARE.
2660
+ */
2661
+
2662
+
2663
+ var BkColorPicker = (0,shared_namespaceObject.withInstall)(color_picker);
2664
+ /* harmony default export */ const src = (BkColorPicker);
2665
+ var __webpack_exports__default = __webpack_exports__.Z;
2666
+ export { __webpack_exports__default as default };