@king-design/react 3.0.1 → 3.1.0-beta.1

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 (368) hide show
  1. package/components/affix/index.d.ts +1 -0
  2. package/components/affix/index.js +2 -0
  3. package/components/affix/index.vdt.js +5 -5
  4. package/components/affix/styles.d.ts +1 -1
  5. package/components/affix/styles.js +1 -1
  6. package/components/badge/index.d.ts +1 -0
  7. package/components/badge/index.js +13 -1
  8. package/components/badge/index.vdt.js +5 -4
  9. package/components/badge/styles.d.ts +1 -1
  10. package/components/badge/styles.js +2 -2
  11. package/components/breadcrumb/index.d.ts +1 -0
  12. package/components/breadcrumb/index.js +13 -1
  13. package/components/breadcrumb/index.vdt.js +4 -5
  14. package/components/breadcrumb/item.d.ts +1 -0
  15. package/components/breadcrumb/item.js +2 -0
  16. package/components/breadcrumb/item.vdt.js +4 -5
  17. package/components/breadcrumb/styles.d.ts +1 -1
  18. package/components/breadcrumb/styles.js +2 -2
  19. package/components/button/group.d.ts +1 -0
  20. package/components/button/group.js +13 -1
  21. package/components/button/group.vdt.js +2 -6
  22. package/components/button/index.d.ts +1 -0
  23. package/components/button/index.js +2 -0
  24. package/components/button/index.vdt.js +7 -7
  25. package/components/button/styles.d.ts +2 -4
  26. package/components/button/styles.js +19 -20
  27. package/components/card/column.d.ts +1 -0
  28. package/components/card/column.js +13 -1
  29. package/components/card/column.vdt.js +2 -5
  30. package/components/card/index.d.ts +1 -0
  31. package/components/card/index.js +13 -1
  32. package/components/card/index.vdt.js +5 -11
  33. package/components/card/styles.d.ts +1 -1
  34. package/components/card/styles.js +2 -2
  35. package/components/carousel/index.d.ts +1 -0
  36. package/components/carousel/index.js +2 -0
  37. package/components/carousel/index.vdt.js +15 -19
  38. package/components/carousel/item.d.ts +1 -0
  39. package/components/carousel/item.js +13 -1
  40. package/components/carousel/item.vdt.js +2 -3
  41. package/components/carousel/styles.d.ts +2 -2
  42. package/components/carousel/styles.js +4 -4
  43. package/components/cascader/index.vdt.js +20 -29
  44. package/components/cascader/styles.d.ts +2 -2
  45. package/components/cascader/styles.js +3 -3
  46. package/components/checkbox/index.d.ts +1 -0
  47. package/components/checkbox/index.js +2 -0
  48. package/components/checkbox/index.vdt.js +4 -8
  49. package/components/checkbox/styles.d.ts +1 -1
  50. package/components/checkbox/styles.js +2 -2
  51. package/components/code/index.d.ts +1 -0
  52. package/components/code/index.js +2 -0
  53. package/components/code/index.vdt.js +2 -3
  54. package/components/code/styles.d.ts +1 -1
  55. package/components/code/styles.js +1 -1
  56. package/components/collapse/index.d.ts +1 -0
  57. package/components/collapse/index.js +13 -1
  58. package/components/collapse/index.vdt.js +2 -3
  59. package/components/collapse/item.d.ts +1 -0
  60. package/components/collapse/item.js +2 -0
  61. package/components/collapse/item.vdt.js +6 -8
  62. package/components/collapse/styles.d.ts +2 -3
  63. package/components/collapse/styles.js +5 -9
  64. package/components/colorpicker/drag.d.ts +1 -0
  65. package/components/colorpicker/drag.js +2 -0
  66. package/components/colorpicker/drag.vdt.js +3 -2
  67. package/components/colorpicker/index.d.ts +1 -0
  68. package/components/colorpicker/index.js +13 -1
  69. package/components/colorpicker/index.vdt.js +5 -6
  70. package/components/colorpicker/panel.d.ts +1 -0
  71. package/components/colorpicker/panel.js +2 -0
  72. package/components/colorpicker/panel.vdt.js +16 -19
  73. package/components/colorpicker/styles.d.ts +3 -3
  74. package/components/colorpicker/styles.js +8 -8
  75. package/components/config/index.d.ts +10 -0
  76. package/components/config/index.js +23 -0
  77. package/components/config/index.spec.d.ts +1 -0
  78. package/components/config/index.spec.js +71 -0
  79. package/components/context.d.ts +2 -1
  80. package/components/context.js +8 -2
  81. package/components/copy/index.d.ts +1 -0
  82. package/components/copy/index.js +2 -0
  83. package/components/copy/index.vdt.js +9 -9
  84. package/components/copy/styles.d.ts +1 -1
  85. package/components/copy/styles.js +1 -1
  86. package/components/datepicker/calendar.d.ts +1 -0
  87. package/components/datepicker/calendar.js +2 -0
  88. package/components/datepicker/calendar.vdt.js +38 -51
  89. package/components/datepicker/index.vdt.js +13 -16
  90. package/components/datepicker/styles.d.ts +3 -3
  91. package/components/datepicker/styles.js +6 -6
  92. package/components/datepicker/time.d.ts +1 -0
  93. package/components/datepicker/time.js +2 -0
  94. package/components/datepicker/time.vdt.js +2 -3
  95. package/components/diagram/diagram.d.ts +1 -0
  96. package/components/diagram/diagram.js +2 -0
  97. package/components/diagram/diagram.vdt.js +3 -4
  98. package/components/diagram/styles.d.ts +1 -1
  99. package/components/diagram/styles.js +1 -1
  100. package/components/dialog/alert.vdt.js +6 -10
  101. package/components/dialog/base.d.ts +4 -0
  102. package/components/dialog/base.js +2 -0
  103. package/components/dialog/base.vdt.js +15 -21
  104. package/components/dialog/index.d.ts +1 -1
  105. package/components/dialog/styles.d.ts +3 -3
  106. package/components/dialog/styles.js +12 -12
  107. package/components/drawer/index.vdt.js +3 -4
  108. package/components/drawer/styles.d.ts +1 -1
  109. package/components/drawer/styles.js +3 -3
  110. package/components/dropdown/dropdown.d.ts +1 -0
  111. package/components/dropdown/dropdown.js +4 -3
  112. package/components/dropdown/item.d.ts +1 -0
  113. package/components/dropdown/item.js +2 -0
  114. package/components/dropdown/item.vdt.js +2 -4
  115. package/components/dropdown/menu.d.ts +1 -0
  116. package/components/dropdown/menu.js +2 -0
  117. package/components/dropdown/menu.vdt.js +2 -3
  118. package/components/dropdown/styles.d.ts +2 -2
  119. package/components/dropdown/styles.js +4 -4
  120. package/components/editable/index.d.ts +1 -0
  121. package/components/editable/index.js +2 -0
  122. package/components/editable/index.vdt.js +3 -7
  123. package/components/editable/styles.d.ts +1 -1
  124. package/components/editable/styles.js +2 -2
  125. package/components/form/form.d.ts +1 -0
  126. package/components/form/form.js +2 -0
  127. package/components/form/form.vdt.js +2 -3
  128. package/components/form/item.d.ts +1 -0
  129. package/components/form/item.js +2 -0
  130. package/components/form/item.vdt.js +13 -19
  131. package/components/form/styles.d.ts +2 -2
  132. package/components/form/styles.js +5 -5
  133. package/components/form/useError.d.ts +1 -0
  134. package/components/grid/col.d.ts +1 -0
  135. package/components/grid/col.js +2 -0
  136. package/components/grid/col.vdt.js +3 -6
  137. package/components/grid/row.d.ts +1 -0
  138. package/components/grid/row.js +2 -0
  139. package/components/grid/row.vdt.js +2 -3
  140. package/components/grid/styles.d.ts +2 -2
  141. package/components/grid/styles.js +8 -18
  142. package/components/grid/useBreakpoints.d.ts +1 -1
  143. package/components/grid/useBreakpoints.js +2 -2
  144. package/components/grid/useGutter.d.ts +1 -0
  145. package/components/icon/index.d.ts +1 -0
  146. package/components/icon/index.js +2 -0
  147. package/components/icon/index.vdt.js +7 -11
  148. package/components/icon/styles.d.ts +1 -2
  149. package/components/icon/styles.js +7 -5
  150. package/components/input/index.d.ts +1 -0
  151. package/components/input/index.js +2 -0
  152. package/components/input/index.vdt.js +16 -26
  153. package/components/input/search.d.ts +1 -0
  154. package/components/input/search.js +2 -0
  155. package/components/input/search.vdt.js +5 -7
  156. package/components/input/styles.d.ts +2 -2
  157. package/components/input/styles.js +11 -11
  158. package/components/layout/aside.d.ts +1 -0
  159. package/components/layout/aside.js +2 -0
  160. package/components/layout/aside.vdt.js +5 -8
  161. package/components/layout/body.d.ts +1 -0
  162. package/components/layout/body.js +4 -3
  163. package/components/layout/footer.d.ts +1 -0
  164. package/components/layout/footer.js +15 -4
  165. package/components/layout/header.d.ts +1 -0
  166. package/components/layout/header.js +4 -6
  167. package/components/layout/layout.d.ts +1 -0
  168. package/components/layout/layout.js +4 -3
  169. package/components/layout/styles.d.ts +3 -3
  170. package/components/layout/styles.js +8 -8
  171. package/components/layout/template.vdt.js +2 -1
  172. package/components/menu/item.d.ts +1 -0
  173. package/components/menu/item.js +2 -0
  174. package/components/menu/item.vdt.js +7 -12
  175. package/components/menu/menu.d.ts +1 -0
  176. package/components/menu/menu.js +2 -0
  177. package/components/menu/menu.vdt.js +3 -6
  178. package/components/menu/styles.d.ts +3 -3
  179. package/components/menu/styles.js +10 -10
  180. package/components/message/message.d.ts +1 -0
  181. package/components/message/message.js +2 -0
  182. package/components/message/message.vdt.js +12 -17
  183. package/components/message/messages.d.ts +1 -0
  184. package/components/message/messages.js +2 -0
  185. package/components/message/messages.vdt.js +2 -3
  186. package/components/message/styles.d.ts +2 -2
  187. package/components/message/styles.js +4 -4
  188. package/components/pagination/index.d.ts +1 -0
  189. package/components/pagination/index.js +2 -0
  190. package/components/pagination/index.vdt.js +14 -17
  191. package/components/pagination/styles.d.ts +1 -1
  192. package/components/pagination/styles.js +4 -4
  193. package/components/popover/content.vdt.js +5 -4
  194. package/components/popover/styles.d.ts +1 -1
  195. package/components/popover/styles.js +2 -2
  196. package/components/portal.d.ts +1 -0
  197. package/components/portal.js +3 -1
  198. package/components/progress/index.d.ts +1 -0
  199. package/components/progress/index.js +2 -0
  200. package/components/progress/index.vdt.js +14 -17
  201. package/components/progress/styles.d.ts +1 -1
  202. package/components/progress/styles.js +6 -6
  203. package/components/radio/index.d.ts +1 -0
  204. package/components/radio/index.js +2 -0
  205. package/components/radio/index.vdt.js +4 -7
  206. package/components/radio/styles.d.ts +1 -1
  207. package/components/radio/styles.js +2 -2
  208. package/components/rate/index.d.ts +1 -0
  209. package/components/rate/index.js +2 -0
  210. package/components/rate/index.vdt.js +4 -8
  211. package/components/rate/styles.d.ts +1 -1
  212. package/components/rate/styles.js +2 -2
  213. package/components/scrollSelect/index.d.ts +1 -0
  214. package/components/scrollSelect/index.js +2 -0
  215. package/components/scrollSelect/index.vdt.js +7 -12
  216. package/components/scrollSelect/styles.d.ts +1 -1
  217. package/components/scrollSelect/styles.js +2 -2
  218. package/components/select/base.d.ts +4 -0
  219. package/components/select/base.js +2 -0
  220. package/components/select/base.vdt.js +17 -21
  221. package/components/select/group.d.ts +1 -0
  222. package/components/select/group.js +2 -0
  223. package/components/select/group.vdt.js +3 -4
  224. package/components/select/menu.d.ts +1 -0
  225. package/components/select/menu.js +2 -0
  226. package/components/select/menu.vdt.js +9 -13
  227. package/components/select/option.d.ts +1 -0
  228. package/components/select/option.js +2 -0
  229. package/components/select/option.vdt.js +6 -8
  230. package/components/select/styles.d.ts +3 -3
  231. package/components/select/styles.js +8 -8
  232. package/components/select/useSearchable.d.ts +1 -0
  233. package/components/skeleton/item.d.ts +1 -0
  234. package/components/skeleton/item.js +13 -1
  235. package/components/skeleton/item.vdt.js +4 -7
  236. package/components/skeleton/skeleton.d.ts +1 -0
  237. package/components/skeleton/skeleton.js +13 -1
  238. package/components/skeleton/skeleton.vdt.js +4 -6
  239. package/components/skeleton/styles.d.ts +6 -0
  240. package/components/skeleton/styles.js +35 -0
  241. package/components/slider/index.d.ts +1 -0
  242. package/components/slider/index.js +2 -0
  243. package/components/slider/index.vdt.js +18 -22
  244. package/components/slider/styles.d.ts +1 -1
  245. package/components/slider/styles.js +2 -2
  246. package/components/spin/index.d.ts +1 -0
  247. package/components/spin/index.js +13 -1
  248. package/components/spin/index.vdt.js +6 -7
  249. package/components/spin/styles.d.ts +1 -1
  250. package/components/spin/styles.js +4 -4
  251. package/components/spinner/index.d.ts +1 -0
  252. package/components/spinner/index.js +2 -0
  253. package/components/spinner/index.vdt.js +15 -21
  254. package/components/spinner/styles.d.ts +1 -1
  255. package/components/spinner/styles.js +7 -7
  256. package/components/split/index.d.ts +2 -1
  257. package/components/split/index.js +2 -0
  258. package/components/split/index.vdt.js +7 -9
  259. package/components/split/styles.d.ts +4 -0
  260. package/components/split/styles.js +55 -0
  261. package/components/steps/context.d.ts +1 -0
  262. package/components/steps/index.d.ts +1 -0
  263. package/components/steps/index.js +13 -1
  264. package/components/steps/index.vdt.js +2 -3
  265. package/components/steps/step.d.ts +1 -0
  266. package/components/steps/step.js +13 -1
  267. package/components/steps/step.vdt.js +10 -16
  268. package/components/steps/styles.d.ts +3 -3
  269. package/components/steps/styles.js +18 -18
  270. package/components/switch/index.d.ts +1 -0
  271. package/components/switch/index.js +2 -0
  272. package/components/switch/index.vdt.js +6 -7
  273. package/components/switch/styles.d.ts +1 -1
  274. package/components/switch/styles.js +4 -4
  275. package/components/table/cell.d.ts +1 -0
  276. package/components/table/cell.js +13 -1
  277. package/components/table/cell.vdt.js +6 -6
  278. package/components/table/column.d.ts +1 -0
  279. package/components/table/column.js +2 -0
  280. package/components/table/column.vdt.js +24 -32
  281. package/components/table/row.d.ts +1 -0
  282. package/components/table/row.js +13 -1
  283. package/components/table/row.vdt.js +3 -10
  284. package/components/table/styles.d.ts +2 -2
  285. package/components/table/styles.js +6 -6
  286. package/components/table/table.d.ts +1 -0
  287. package/components/table/table.js +2 -0
  288. package/components/table/table.vdt.js +16 -20
  289. package/components/table/useColumns.d.ts +1 -0
  290. package/components/table/useFixedColumns.d.ts +2 -1
  291. package/components/table/useGroup.d.ts +1 -0
  292. package/components/table/useResizable.d.ts +1 -0
  293. package/components/table/useSortable.d.ts +1 -0
  294. package/components/tabs/index.d.ts +4 -0
  295. package/components/tabs/index.js +2 -0
  296. package/components/tabs/index.vdt.js +9 -10
  297. package/components/tabs/styles.d.ts +1 -1
  298. package/components/tabs/styles.js +15 -15
  299. package/components/tabs/tab.d.ts +1 -0
  300. package/components/tabs/tab.js +2 -0
  301. package/components/tabs/tab.vdt.js +3 -5
  302. package/components/tabs/useActiveBar.js +2 -1
  303. package/components/tabs/useScroll.js +2 -1
  304. package/components/tag/base.d.ts +1 -0
  305. package/components/tag/base.js +13 -1
  306. package/components/tag/index.vdt.js +4 -5
  307. package/components/tag/styles.d.ts +2 -2
  308. package/components/tag/styles.js +7 -7
  309. package/components/tag/tags.d.ts +1 -0
  310. package/components/tag/tags.js +2 -0
  311. package/components/tag/tags.vdt.js +5 -11
  312. package/components/timeline/item.d.ts +1 -0
  313. package/components/timeline/item.js +13 -1
  314. package/components/timeline/item.vdt.js +4 -5
  315. package/components/timeline/styles.d.ts +2 -2
  316. package/components/timeline/styles.js +6 -6
  317. package/components/timeline/timeline.d.ts +1 -0
  318. package/components/timeline/timeline.js +13 -1
  319. package/components/timeline/timeline.vdt.js +2 -3
  320. package/components/timepicker/index.d.ts +2 -1
  321. package/components/timepicker/panelPicker.vdt.js +13 -17
  322. package/components/timepicker/selectPicker.d.ts +1 -0
  323. package/components/timepicker/selectPicker.js +2 -0
  324. package/components/timepicker/selectPicker.vdt.js +4 -4
  325. package/components/timepicker/styles.d.ts +1 -1
  326. package/components/timepicker/styles.js +2 -2
  327. package/components/tip/index.vdt.js +5 -6
  328. package/components/tip/styles.d.ts +1 -1
  329. package/components/tip/styles.js +2 -2
  330. package/components/tooltip/content.vdt.js +4 -9
  331. package/components/tooltip/styles.d.ts +1 -1
  332. package/components/tooltip/styles.js +6 -6
  333. package/components/transfer/index.d.ts +1 -0
  334. package/components/transfer/index.js +2 -0
  335. package/components/transfer/index.vdt.js +20 -25
  336. package/components/transfer/styles.d.ts +1 -1
  337. package/components/transfer/styles.js +2 -2
  338. package/components/tree/index.d.ts +1 -0
  339. package/components/tree/index.js +2 -0
  340. package/components/tree/index.vdt.js +19 -30
  341. package/components/tree/styles.d.ts +1 -1
  342. package/components/tree/styles.js +2 -2
  343. package/components/treeSelect/index.vdt.js +2 -3
  344. package/components/treeSelect/styles.d.ts +1 -1
  345. package/components/treeSelect/styles.js +1 -1
  346. package/components/upload/index.d.ts +1 -0
  347. package/components/upload/index.js +2 -0
  348. package/components/upload/index.vdt.js +39 -50
  349. package/components/upload/styles.d.ts +2 -2
  350. package/components/upload/styles.js +3 -3
  351. package/components/utils.d.ts +2 -1
  352. package/components/utils.js +20 -9
  353. package/components/wave/index.d.ts +1 -0
  354. package/components/wave/index.js +4 -2
  355. package/components/wave/styles.d.ts +1 -1
  356. package/components/wave/styles.js +2 -2
  357. package/index.d.ts +3 -2
  358. package/index.js +3 -2
  359. package/package.json +2 -2
  360. package/styles/fonts/iconfont.d.ts +1 -1
  361. package/styles/fonts/iconfont.js +4 -1
  362. package/styles/global.js +4 -4
  363. package/styles/theme.d.ts +1 -1
  364. package/styles/theme.js +4 -53
  365. package/components/skeleton/style.d.ts +0 -6
  366. package/components/skeleton/style.js +0 -35
  367. package/components/split/style.d.ts +0 -4
  368. package/components/split/style.js +0 -55
@@ -24,6 +24,6 @@ setDefault(function () {
24
24
  card: defaults
25
25
  }).card;
26
26
  });
27
- export function makeStyles() {
28
- return /*#__PURE__*/css("border-radius:", card.borderRadius, ";background:", card.bgColor, ";.k-card-header{height:", card.headerHeight, ";line-height:", card.headerHeight, ";padding:0 ", card.padding, ";}.k-card-title{font-size:", card.headerFontSize, ";display:inline-block;}.k-card-extra{float:right;height:100%;display:flex;align-items:center;}.k-card-body{padding:0 ", card.padding, " ", card.padding, ";}&.k-shadow{box-shadow:", card.boxShadow, ";}&.k-none{box-shadow:none;}&.k-border{border:", card.border, ";.k-card-header{border-bottom:", card.border, ";}.k-card-body{padding-top:", card.padding, ";}}&.k-no-header{.k-card-body{padding-top:", card.padding, ";}}&.k-card-grid{.k-card-body{display:flex;padding:0;}&.k-border{.k-card-column:not(:last-of-type){border-right:", card.border, ";}}}.k-card-column{display:flex;align-items:center;padding:", card.padding, ";&.k-fluid{flex:1;}&.k-center{justify-content:center;}}");
27
+ export function makeStyles(k) {
28
+ return /*#__PURE__*/css("border-radius:", card.borderRadius, ";background:", card.bgColor, ";.", k, "-card-header{height:", card.headerHeight, ";line-height:", card.headerHeight, ";padding:0 ", card.padding, ";}.", k, "-card-title{font-size:", card.headerFontSize, ";display:inline-block;}.", k, "-card-extra{float:right;height:100%;display:flex;align-items:center;}.", k, "-card-body{padding:0 ", card.padding, " ", card.padding, ";}&.", k, "-shadow{box-shadow:", card.boxShadow, ";}&.", k, "-none{box-shadow:none;}&.", k, "-border{border:", card.border, ";.", k, "-card-header{border-bottom:", card.border, ";}.", k, "-card-body{padding-top:", card.padding, ";}}&.", k, "-no-header{.", k, "-card-body{padding-top:", card.padding, ";}}&.", k, "-card-grid{.", k, "-card-body{display:flex;padding:0;}&.", k, "-border{.", k, "-card-column:not(:last-of-type){border-right:", card.border, ";}}}.", k, "-card-column{display:flex;align-items:center;padding:", card.padding, ";&.", k, "-fluid{flex:1;}&.", k, "-center{justify-content:center;}}");
29
29
  }
@@ -14,6 +14,7 @@ export declare class Carousel extends Component<CarouselProps> {
14
14
  private items;
15
15
  private slide;
16
16
  private autoplay;
17
+ private config;
17
18
  isActive(value: string): boolean;
18
19
  getIndex(): number;
19
20
  setIndex(index: number): void;
@@ -8,6 +8,7 @@ import { useItems } from './useItems';
8
8
  import { useSlide } from './useSlide';
9
9
  import { bind } from '../utils';
10
10
  import { useAutoplay } from './useAutoplay';
11
+ import { useConfigContext } from '../config';
11
12
  export * from './item';
12
13
  var typeDefs = {
13
14
  value: String,
@@ -41,6 +42,7 @@ export var Carousel = /*#__PURE__*/function (_Component) {
41
42
  _this.items = useItems();
42
43
  _this.slide = useSlide(_this.items.getItems, _this.items.getItemsWithCloned);
43
44
  _this.autoplay = useAutoplay(_this.next);
45
+ _this.config = useConfigContext();
44
46
  return _this;
45
47
  }
46
48
 
@@ -6,12 +6,6 @@ import { Button } from '../button';
6
6
  import { Icon } from '../icon';
7
7
  import { makeStyles } from './styles';
8
8
  import { linkEvent } from 'intact';
9
- var _$tmp0 = {
10
- 'className': 'k-icon-left'
11
- };
12
- var _$tmp1 = {
13
- 'className': 'k-icon-right'
14
- };
15
9
  export default function ($props, $blocks, $__proto__) {
16
10
  var _classNameObj;
17
11
 
@@ -30,9 +24,8 @@ export default function ($props, $blocks, $__proto__) {
30
24
  shouldTransition = _this$slide.shouldTransition,
31
25
  elementRef = _this$slide.elementRef,
32
26
  isSlide = _this$slide.isSlide;
33
- var classNameObj = (_classNameObj = {
34
- 'k-carousel': true
35
- }, _classNameObj[className] = className, _classNameObj["k-" + arrow] = true, _classNameObj['k-stop'] = !shouldTransition.value, _classNameObj["k-" + effect] = true, _classNameObj[makeStyles()] = true, _classNameObj);
27
+ var k = this.config.k;
28
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-carousel"] = true, _classNameObj[className] = className, _classNameObj[k + "-" + arrow] = true, _classNameObj[k + "-stop"] = !shouldTransition.value, _classNameObj[k + "-" + effect] = true, _classNameObj[makeStyles(k)] = true, _classNameObj);
36
29
  var _this$items = this.items,
37
30
  getItems = _this$items.getItems,
38
31
  getItemsWithCloned = _this$items.getItemsWithCloned;
@@ -45,7 +38,7 @@ export default function ($props, $blocks, $__proto__) {
45
38
  'ref': elementRef,
46
39
  'ev-mouseenter': stop,
47
40
  'ev-mouseleave': play
48
- }), [_$ce(2, 'div', getItemsWithCloned(), 0, 'k-carousel-wrapper', {
41
+ }), [_$ce(2, 'div', getItemsWithCloned(), 0, _$cn(k + "-carousel-wrapper"), {
49
42
  'style': {
50
43
  transform: isSlide() ? "translate3d(" + translate.value + "px, 0, 0)" : undefined
51
44
  }
@@ -54,24 +47,27 @@ export default function ($props, $blocks, $__proto__) {
54
47
  'circle': true,
55
48
  'type': 'none',
56
49
  'size': 'large',
57
- 'className': 'k-carousel-btn k-prev',
50
+ 'className': _$cn(k + "-carousel-btn " + k + "-prev"),
58
51
  'ev-click': this.prev,
59
- 'children': _$cc(Icon, _$tmp0)
52
+ 'children': _$cc(Icon, {
53
+ 'className': _$cn(k + "-icon-left")
54
+ })
60
55
  }), _$cc(Button, {
61
56
  'icon': true,
62
57
  'circle': true,
63
58
  'type': 'none',
64
59
  'size': 'large',
65
- 'className': 'k-carousel-btn k-next',
60
+ 'className': _$cn(k + "-carousel-btn " + k + "-next"),
66
61
  'ev-click': this.next,
67
- 'children': _$cc(Icon, _$tmp1)
62
+ 'children': _$cc(Icon, {
63
+ 'className': _$cn(k + "-icon-right")
64
+ })
68
65
  }), _$ce(2, 'div', _$ma(getItems(), function ($value, $key) {
69
- return _$ce(2, 'div', null, 1, _$cn({
70
- 'k-carousel-dot': true,
71
- 'k-active': this.isActive($value.props.value)
72
- }), {
66
+ var _$cn2;
67
+
68
+ return _$ce(2, 'div', null, 1, _$cn((_$cn2 = {}, _$cn2[k + "-carousel-dot"] = true, _$cn2[k + "-active"] = this.isActive($value.props.value), _$cn2)), {
73
69
  'ev-click': linkEvent($key, this.setIndex)
74
70
  });
75
- }, $this), 4, 'k-carousel-indicator c-clearfix')]);
71
+ }, $this), 4, _$cn(k + "-carousel-indicator c-clearfix"))]);
76
72
  }
77
73
  ;
@@ -6,4 +6,5 @@ export interface CarouselItemProps {
6
6
  export declare class CarouselItem extends Component<CarouselItemProps> {
7
7
  static template: string | import("intact").Template<any>;
8
8
  static typeDefs: Required<TypeDefs<CarouselItemProps>>;
9
+ private config;
9
10
  }
@@ -1,6 +1,8 @@
1
1
  import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
2
3
  import { Component } from 'intact-react';
3
4
  import template from './item.vdt';
5
+ import { useConfigContext } from '../config';
4
6
  var typeDefs = {
5
7
  value: String,
6
8
  cloned: null
@@ -9,7 +11,17 @@ export var CarouselItem = /*#__PURE__*/function (_Component) {
9
11
  _inheritsLoose(CarouselItem, _Component);
10
12
 
11
13
  function CarouselItem() {
12
- return _Component.apply(this, arguments) || this;
14
+ var _context;
15
+
16
+ var _this;
17
+
18
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
19
+ args[_key] = arguments[_key];
20
+ }
21
+
22
+ _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
23
+ _this.config = useConfigContext();
24
+ return _this;
13
25
  }
14
26
 
15
27
  return CarouselItem;
@@ -18,9 +18,8 @@ export default function ($props, $blocks, $__proto__) {
18
18
 
19
19
  var parent = this.$senior;
20
20
  var active = parent.isActive(value);
21
- var classNameObj = (_classNameObj = {
22
- 'k-carousel-item': true
23
- }, _classNameObj[className] = className, _classNameObj['k-active'] = active, _classNameObj['k-cloned'] = cloned, _classNameObj[makeItemStyles()] = true, _classNameObj);
21
+ var k = this.config.k;
22
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-carousel-item"] = true, _classNameObj[className] = className, _classNameObj[k + "-active"] = active, _classNameObj[k + "-cloned"] = cloned, _classNameObj[makeItemStyles(k)] = true, _classNameObj);
24
23
  var isSlide = parent.get('effect') === 'slide';
25
24
  return _$cc(Transition, {
26
25
  'show': active || isSlide,
@@ -1,3 +1,3 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(): string;
3
- export declare function makeItemStyles(): string;
2
+ export declare function makeStyles(k: string): string;
3
+ export declare function makeItemStyles(k: string): string;
@@ -39,9 +39,9 @@ setDefault(function () {
39
39
  carousel: defaults
40
40
  }).carousel;
41
41
  });
42
- export function makeStyles() {
43
- return /*#__PURE__*/css("height:", carousel.height, ";position:relative;overflow:hidden;.k-carousel-indicator{position:absolute;left:50%;transform:translateX(-50%);bottom:", carousel.indicator.bottom, ";}.k-carousel-dot{height:", carousel.indicator.height, ";float:left;margin:", carousel.dot.margin, ";cursor:pointer;padding-top:", carousel.dot.paddingTop, ";&:before{content:'';display:block;width:", carousel.dot.width, ";height:", carousel.dot.height, ";background:", carousel.dot.bgColor, ";opacity:", carousel.dot.opacity, ";transition:width ", carousel.transition, ";}&.k-active:before{opacity:", carousel.dot.active.opacity, ";width:", carousel.dot.active.width, ";}}.k-carousel-btn{position:absolute;background:", carousel.arrow.bgColor, "!important;top:50%;transform:translateY(-50%);color:", carousel.arrow.color, ";opacity:", carousel.arrow.opacity, ";&:hover{color:#fff;opacity:", carousel.arrow.hoverOpacity, "!important;background:", carousel.arrow.bgColor, ";}&.k-prev{left:", carousel.arrow.left, ";}&.k-next{right:", carousel.arrow.right, ";}}&.k-hover{.k-carousel-btn{opacity:0;}&:hover{.k-carousel-btn{opacity:", carousel.arrow.opacity, ";}}}&.k-never{.k-carousel-btn{display:none;}}&.k-slide{.k-carousel-wrapper{transition:transform ", carousel.transition, ";white-space:nowrap;}}&.k-stop{.k-carousel-wrapper{transition:none;}}&.k-fade{.k-carousel-item{position:absolute;}}");
42
+ export function makeStyles(k) {
43
+ return /*#__PURE__*/css("height:", carousel.height, ";position:relative;overflow:hidden;.", k, "-carousel-indicator{position:absolute;left:50%;transform:translateX(-50%);bottom:", carousel.indicator.bottom, ";}.", k, "-carousel-dot{height:", carousel.indicator.height, ";float:left;margin:", carousel.dot.margin, ";cursor:pointer;padding-top:", carousel.dot.paddingTop, ";&:before{content:'';display:block;width:", carousel.dot.width, ";height:", carousel.dot.height, ";background:", carousel.dot.bgColor, ";opacity:", carousel.dot.opacity, ";transition:width ", carousel.transition, ";}&.", k, "-active:before{opacity:", carousel.dot.active.opacity, ";width:", carousel.dot.active.width, ";}}.", k, "-carousel-btn{position:absolute;background:", carousel.arrow.bgColor, "!important;top:50%;transform:translateY(-50%);color:", carousel.arrow.color, ";opacity:", carousel.arrow.opacity, ";&:hover{color:#fff;opacity:", carousel.arrow.hoverOpacity, "!important;background:", carousel.arrow.bgColor, ";}&.", k, "-prev{left:", carousel.arrow.left, ";}&.", k, "-next{right:", carousel.arrow.right, ";}}&.", k, "-hover{.", k, "-carousel-btn{opacity:0;}&:hover{.", k, "-carousel-btn{opacity:", carousel.arrow.opacity, ";}}}&.", k, "-never{.", k, "-carousel-btn{display:none;}}&.", k, "-slide{.", k, "-carousel-wrapper{transition:transform ", carousel.transition, ";white-space:nowrap;}}&.", k, "-stop{.", k, "-carousel-wrapper{transition:none;}}&.", k, "-fade{.", k, "-carousel-item{position:absolute;}}");
44
44
  }
45
- export function makeItemStyles() {
46
- return /*#__PURE__*/css("display:inline-block;width:100%;height:100%;&.k-carousel-fade-enter-active,&.k-carousel-fade-leave-active{transition:opacity ", carousel.transition, ";}&.k-carousel-fade-enter-from,&.k-carousel-fade-leave-to{opacity:0;}");
45
+ export function makeItemStyles(k) {
46
+ return /*#__PURE__*/css("display:inline-block;width:100%;height:100%;&.", k, "-carousel-fade-enter-active,&.", k, "-carousel-fade-leave-active{transition:opacity ", carousel.transition, ";}&.", k, "-carousel-fade-enter-from,&.", k, "-carousel-fade-leave-to{opacity:0;}");
47
47
  }
@@ -1,21 +1,11 @@
1
1
  import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/values";
2
2
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
3
3
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
4
- import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, className as _$cn, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, map as _$ma } from 'intact-react';
4
+ import { createUnknownComponentVNode as _$cc, className as _$cn, createElementVNode as _$ce, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, map as _$ma } from 'intact-react';
5
5
  import { Dropdown, DropdownMenu, DropdownItem } from '../dropdown';
6
6
  import { Icon } from '../icon';
7
7
  import { _$ } from '../../i18n';
8
8
  import { makeMenuStyles, makeFilterMenuStyles } from './styles';
9
- var _$tmp0 = {
10
- 'className': 'ion-load-c k-cascader-loading',
11
- 'rotate': true
12
- };
13
- var _$tmp1 = {
14
- 'className': 'k-cascader-arrow k-icon-right'
15
- };
16
- var _$tmp2 = {
17
- 'className': 'k-cascader'
18
- };
19
9
  export default function ($props, $blocks, $__proto__) {
20
10
  var _classNameObj,
21
11
  _this = this;
@@ -30,10 +20,8 @@ export default function ($props, $blocks, $__proto__) {
30
20
  filterable = _this$get.filterable,
31
21
  fields = _this$get.fields;
32
22
 
33
- var baseMenuStyles = makeMenuStyles();
34
- var classNameObj = (_classNameObj = {
35
- 'k-cascader-menu': true
36
- }, _classNameObj[baseMenuStyles] = true, _classNameObj);
23
+ var k = this.config.k;
24
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-cascader-menu"] = true, _classNameObj[makeMenuStyles(k)] = true, _classNameObj);
37
25
  var getField = this.fields;
38
26
 
39
27
  var _this$value = this.value,
@@ -46,9 +34,12 @@ export default function ($props, $blocks, $__proto__) {
46
34
  var Options = function Options(data, level, loaded, parentSelected) {
47
35
  if (!data.length) {
48
36
  if (!loaded) {
49
- return _$cc(Icon, _$tmp0);
37
+ return _$cc(Icon, {
38
+ 'className': _$cn("ion-load-c " + k + "-cascader-loading"),
39
+ 'rotate': true
40
+ });
50
41
  } else {
51
- return _$ce(2, 'div', _$('无数据'), 0, 'k-cascader-empty');
42
+ return _$ce(2, 'div', _$('无数据'), 0, _$cn(k + "-cascader-empty"));
52
43
  }
53
44
  }
54
45
 
@@ -59,15 +50,15 @@ export default function ($props, $blocks, $__proto__) {
59
50
  var children = getField(item, 'children');
60
51
 
61
52
  var Item = function Item() {
53
+ var _$cn2;
54
+
62
55
  return _$cc(DropdownItem, {
63
56
  'disabled': getField(item, 'disabled'),
64
- 'className': _$cn({
65
- 'k-cascader-option': true,
66
- 'k-active': showed,
67
- 'k-selected': selected
68
- }),
57
+ 'className': _$cn((_$cn2 = {}, _$cn2[k + "-cascader-option"] = true, _$cn2[k + "-active"] = showed, _$cn2[k + "-selected"] = selected, _$cn2)),
69
58
  'ev-select': onSelect.bind(null, value, level),
70
- 'children': [getField(item, 'label'), children ? _$cc(Icon, _$tmp1) : undefined]
59
+ 'children': [getField(item, 'label'), children ? _$cc(Icon, {
60
+ 'className': _$cn(k + "-cascader-arrow " + k + "-icon-right")
61
+ }) : undefined]
71
62
  });
72
63
  };
73
64
 
@@ -92,12 +83,14 @@ export default function ($props, $blocks, $__proto__) {
92
83
  keywords = _this$filterable.keywords.value,
93
84
  selectByFilter = _this$filterable.selectByFilter;
94
85
 
95
- return _$su.call($this, _$tmp2, function ($blocks) {
86
+ return _$su.call($this, {
87
+ 'className': _$cn(k + "-cascader")
88
+ }, function ($blocks) {
96
89
  var _$blocks = {},
97
90
  __$blocks = _$ex({}, $blocks);
98
91
 
99
92
  return (_$blocks['base-menu'] = function ($super) {
100
- var _$cn2;
93
+ var _$cn3;
101
94
 
102
95
  return !filterable || !keywords ? _$cc(DropdownMenu, {
103
96
  'className': _$cn(classNameObj),
@@ -105,12 +98,10 @@ export default function ($props, $blocks, $__proto__) {
105
98
  'children': Options(data, 0, true, true)
106
99
  }, 'common') : _$cc(DropdownMenu, {
107
100
  'key': 'filter',
108
- 'className': _$cn((_$cn2 = {
109
- 'k-cascader-filter': true
110
- }, _$cn2[baseMenuStyles] = true, _$cn2[makeFilterMenuStyles()] = true, _$cn2)),
101
+ 'className': _$cn((_$cn3 = {}, _$cn3[k + "-cascader-filter"] = true, _$cn3[baseMenuStyles] = true, _$cn3[makeFilterMenuStyles(k)] = true, _$cn3)),
111
102
  'children': function () {
112
103
  var items = filter();
113
- if (!items.length) return _$ce(2, 'div', _$('无匹配数据'), 0, 'k-cascader-empty');
104
+ if (!items.length) return _$ce(2, 'div', _$('无匹配数据'), 0, _$cn(k + "-cascader-empty"));
114
105
  return _$ma(items, function ($value, $key) {
115
106
  return _$cc(DropdownItem, {
116
107
  'ev-select': selectByFilter.bind(null, $value),
@@ -1,3 +1,3 @@
1
1
  import '../../styles/global';
2
- export declare function makeMenuStyles(): string;
3
- export declare function makeFilterMenuStyles(): string;
2
+ export declare function makeMenuStyles(k: string): string;
3
+ export declare function makeFilterMenuStyles(k: string): string;
@@ -42,9 +42,9 @@ setDefault(function () {
42
42
  cascader: defaults
43
43
  }).cascader;
44
44
  });
45
- export function makeMenuStyles() {
46
- return /*#__PURE__*/css("min-width:", cascader.width, "!important;height:", cascader.height, ";overflow:auto;.k-cascader-arrow{float:right;height:100%;margin-left:", cascader.arrowGap, ";line-height:inherit;}.k-cascader-loading{display:block;text-align:center;margin-top:", cascader.loadingGap, ";}.k-cascader-empty{padding:", cascader.empty.padding, ";color:", cascader.empty.color, ";text-align:center;}.k-cascader-option{&.k-selected{color:", cascader.selectedColor, ";}&.k-active{background:", cascader.activeBgColor, ";}}");
45
+ export function makeMenuStyles(k) {
46
+ return /*#__PURE__*/css("min-width:", cascader.width, "!important;height:", cascader.height, ";overflow:auto;.", k, "-cascader-arrow{float:right;height:100%;margin-left:", cascader.arrowGap, ";line-height:inherit;}.", k, "-cascader-loading{display:block;text-align:center;margin-top:", cascader.loadingGap, ";}.", k, "-cascader-empty{padding:", cascader.empty.padding, ";color:", cascader.empty.color, ";text-align:center;}.", k, "-cascader-option{&.", k, "-selected{color:", cascader.selectedColor, ";}&.", k, "-active{background:", cascader.activeBgColor, ";}}");
47
47
  }
48
- export function makeFilterMenuStyles() {
48
+ export function makeFilterMenuStyles(k) {
49
49
  return /*#__PURE__*/css("min-width:", _filterInstanceProperty(cascader).minWidth, "!important;height:auto;max-height:", _filterInstanceProperty(cascader).maxHeight, ";em{font-style:normal;color:", _filterInstanceProperty(cascader).highlightColor, ";}");
50
50
  }
@@ -17,6 +17,7 @@ export declare class Checkbox<V = boolean> extends Component<CheckboxProps<V>, C
17
17
  static defaults: () => Partial<CheckboxProps<boolean>>;
18
18
  static events: Events<CheckboxEvents<boolean>>;
19
19
  private inputRef;
20
+ private config;
20
21
  private isChecked;
21
22
  private setCheckboxModel;
22
23
  private onClick;
@@ -7,6 +7,7 @@ import { Component, createRef } from 'intact-react';
7
7
  import template from './index.vdt';
8
8
  import { bind } from '../utils';
9
9
  import { isArray } from 'intact-shared';
10
+ import { useConfigContext } from '../config';
10
11
  var typeDefs = {
11
12
  disabled: Boolean,
12
13
  value: null,
@@ -40,6 +41,7 @@ export var Checkbox = /*#__PURE__*/function (_Component) {
40
41
 
41
42
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
42
43
  _this.inputRef = createRef();
44
+ _this.config = useConfigContext();
43
45
  return _this;
44
46
  }
45
47
 
@@ -25,12 +25,8 @@ export default function ($props, $blocks, $__proto__) {
25
25
  rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
26
26
 
27
27
  var isChecked = this.isChecked();
28
- var classNameObj = (_classNameObj = {
29
- 'k-checkbox': true,
30
- 'k-disabled': disabled,
31
- 'k-checked': isChecked,
32
- 'k-indeterminate': indeterminate
33
- }, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
28
+ var k = this.config.k;
29
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-checkbox"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-checked"] = isChecked, _classNameObj[k + "-indeterminate"] = indeterminate, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
34
30
  var events = ['ev-click', 'ev-change', 'ev-mouseenter', 'ev-mouseleave'].reduce(function (memo, name) {
35
31
  if (rest[name]) {
36
32
  if (name === 'ev-click' || name === 'ev-change') {// do not bind click to label, otherwise it will trigger click event twice
@@ -64,7 +60,7 @@ export default function ($props, $blocks, $__proto__) {
64
60
  'disabled': disabled,
65
61
  'tabindex': '-1',
66
62
  'ref': this.inputRef
67
- }, getRestProps(this, rest))), 2, 'k-checkbox-wrapper')
68
- }), children ? _$ce(2, 'span', children, 0, 'k-checkbox-text') : undefined]);
63
+ }, getRestProps(this, rest))), 2, _$cn(k + "-checkbox-wrapper"))
64
+ }), children ? _$ce(2, 'span', children, 0, _$cn(k + "-checkbox-text")) : undefined]);
69
65
  }
70
66
  ;
@@ -1,2 +1,2 @@
1
1
  import '../../styles/global';
2
- export default function makeStyles(): string;
2
+ export default function makeStyles(k: string): string;
@@ -77,6 +77,6 @@ setDefault(function () {
77
77
  checkbox: defaults
78
78
  }).checkbox;
79
79
  });
80
- export default function makeStyles() {
81
- return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-checkbox-wrapper{width:", checkbox.width, ";height:", checkbox.width, ";border:1px solid ", checkbox.borderColor, ";border-radius:", checkbox.borderRadius, ";position:relative;transition:all ", checkbox.transition, ";background:", checkbox.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", checkbox.inner.width, ";height:", checkbox.inner.height, ";top:", checkbox.inner.top, ";left:", checkbox.inner.left, ";border:", checkbox.inner.border, ";border-top:0;border-left:0;transform:rotate(45deg) scale(0);transition:all ", checkbox.transition, ";}}&:hover{.k-checkbox-wrapper{border:", checkbox.hoverBorder, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;left:0;top:0;margin:0;}.k-checkbox-text{margin-left:", checkbox.text.gap, ";flex:0 1 auto;}&.k-checked,&.k-indeterminate{.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";background:", checkbox.checked.bgColor, ";}}&.k-indeterminate{.k-checkbox-wrapper{&:before{transform:rotate(90deg) scale(1);border-bottom:0;}}}&.k-checked{.k-checkbox-wrapper{&:before{transform:rotate(45deg) scale(1);}}}&:focus{outline:none;.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";}}&.k-disabled{color:", checkbox.disabled.color, ";cursor:not-allowed;.k-checkbox-wrapper{border-color:", checkbox.disabled.borderColor, ";background:", checkbox.disabled.bgColor, ";&:before{border-color:", checkbox.disabled.innerColor, ";}}input{cursor:not-allowed;}&.k-checked,&.k-indeterminate{.k-checkbox-wrapper{border-color:", checkbox.disabled.checked.borderColor, ";background:", checkbox.disabled.checked.bgColor, ";}}}");
80
+ export default function makeStyles(k) {
81
+ return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.", k, "-checkbox-wrapper{width:", checkbox.width, ";height:", checkbox.width, ";border:1px solid ", checkbox.borderColor, ";border-radius:", checkbox.borderRadius, ";position:relative;transition:all ", checkbox.transition, ";background:", checkbox.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", checkbox.inner.width, ";height:", checkbox.inner.height, ";top:", checkbox.inner.top, ";left:", checkbox.inner.left, ";border:", checkbox.inner.border, ";border-top:0;border-left:0;transform:rotate(45deg) scale(0);transition:all ", checkbox.transition, ";}}&:hover{.", k, "-checkbox-wrapper{border:", checkbox.hoverBorder, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;left:0;top:0;margin:0;}.", k, "-checkbox-text{margin-left:", checkbox.text.gap, ";flex:0 1 auto;}&.", k, "-checked,&.", k, "-indeterminate{.", k, "-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";background:", checkbox.checked.bgColor, ";}}&.", k, "-indeterminate{.", k, "-checkbox-wrapper{&:before{transform:rotate(90deg) scale(1);border-bottom:0;}}}&.", k, "-checked{.", k, "-checkbox-wrapper{&:before{transform:rotate(45deg) scale(1);}}}&:focus{outline:none;.", k, "-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";}}&.", k, "-disabled{color:", checkbox.disabled.color, ";cursor:not-allowed;.", k, "-checkbox-wrapper{border-color:", checkbox.disabled.borderColor, ";background:", checkbox.disabled.bgColor, ";&:before{border-color:", checkbox.disabled.innerColor, ";}}input{cursor:not-allowed;}&.", k, "-checked,&.", k, "-indeterminate{.", k, "-checkbox-wrapper{border-color:", checkbox.disabled.checked.borderColor, ";background:", checkbox.disabled.checked.bgColor, ";}}}");
82
82
  }
@@ -19,5 +19,6 @@ export declare class Code extends Component<CodeProps, CodeEvents> {
19
19
  static defaults: () => Partial<CodeProps>;
20
20
  static events: Events<CodeEvents>;
21
21
  private editor;
22
+ private config;
22
23
  getEditor(): editor.IStandaloneCodeEditor | null;
23
24
  }
@@ -3,6 +3,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
3
3
  import { Component } from 'intact-react';
4
4
  import template from './index.vdt';
5
5
  import { useEditor } from './useEditor';
6
+ import { useConfigContext } from '../config';
6
7
  var typeDefs = {
7
8
  value: String,
8
9
  language: String,
@@ -39,6 +40,7 @@ export var Code = /*#__PURE__*/function (_Component) {
39
40
 
40
41
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
41
42
  _this.editor = useEditor();
43
+ _this.config = useConfigContext();
42
44
  return _this;
43
45
  }
44
46
 
@@ -21,9 +21,8 @@ export default function ($props, $blocks, $__proto__) {
21
21
  className = _this$get.className,
22
22
  style = _this$get.style;
23
23
 
24
- var classNameObj = (_classNameObj = {
25
- 'k-code': true
26
- }, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
24
+ var k = this.config.k;
25
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-code"] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
27
26
 
28
27
  if (width || height) {
29
28
  var _style = {};
@@ -1,2 +1,2 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(): string;
2
+ export declare function makeStyles(k: string): string;
@@ -2,7 +2,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
2
2
 
3
3
  import { css } from '@emotion/css';
4
4
  import '../../styles/global';
5
- export function makeStyles() {
5
+ export function makeStyles(k) {
6
6
  return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
7
7
  name: "1wv4onu",
8
8
  styles: "position:relative;height:100%"
@@ -14,6 +14,7 @@ export declare class Collapse extends Component<CollapseProps, CollapseEvents> {
14
14
  static template: string | import("intact").Template<any>;
15
15
  static typeDefs: Required<TypeDefs<CollapseProps>>;
16
16
  static defaults: () => Partial<CollapseProps>;
17
+ private config;
17
18
  init(): void;
18
19
  changeValue(v: string): void;
19
20
  private isActive;
@@ -1,8 +1,10 @@
1
1
  import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
2
3
  import { Component, provide } from 'intact-react';
3
4
  import template from './index.vdt';
4
5
  import { toggleArray } from '../utils';
5
6
  export * from './item';
7
+ import { useConfigContext } from '../config';
6
8
  var typeDefs = {
7
9
  value: Array,
8
10
  accordion: Boolean,
@@ -21,7 +23,17 @@ export var Collapse = /*#__PURE__*/function (_Component) {
21
23
  _inheritsLoose(Collapse, _Component);
22
24
 
23
25
  function Collapse() {
24
- return _Component.apply(this, arguments) || this;
26
+ var _context;
27
+
28
+ var _this;
29
+
30
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
+ args[_key] = arguments[_key];
32
+ }
33
+
34
+ _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
35
+ _this.config = useConfigContext();
36
+ return _this;
25
37
  }
26
38
 
27
39
  var _proto = Collapse.prototype;
@@ -18,9 +18,8 @@ export default function ($props, $blocks, $__proto__) {
18
18
  arrow = _this$get.arrow,
19
19
  noBorder = _this$get.noBorder;
20
20
 
21
- var classNameObj = (_classNameObj = {
22
- 'k-collapse': true
23
- }, _classNameObj[makeStyles()] = true, _classNameObj[className] = className, _classNameObj['k-left'] = arrow === 'left', _classNameObj['k-border'] = !noBorder, _classNameObj);
21
+ var k = this.config.k;
22
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-collapse"] = true, _classNameObj[makeStyles(k)] = true, _classNameObj[className] = className, _classNameObj[k + "-left"] = arrow === 'left', _classNameObj[k + "-border"] = !noBorder, _classNameObj);
24
23
 
25
24
  var _children = mapChildren(children, function (vNode, index) {
26
25
  if (vNode.tag === CollapseItem) {
@@ -15,6 +15,7 @@ export declare class CollapseItem extends Component<CollapseItemProps, CollapseI
15
15
  static template: string | import("intact").Template<any>;
16
16
  static typeDefs: Required<TypeDefs<CollapseItemProps>>;
17
17
  private collapse;
18
+ private config;
18
19
  toggle(): void;
19
20
  private onEnter;
20
21
  private onAfterLeave;
@@ -5,6 +5,7 @@ import { Component, inject } from 'intact-react';
5
5
  import { COLLAPSE } from './index';
6
6
  import template from './item.vdt';
7
7
  import { bind } from '../utils';
8
+ import { useConfigContext } from '../config';
8
9
  var typeDefs = {
9
10
  value: String,
10
11
  title: [String, Object],
@@ -24,6 +25,7 @@ export var CollapseItem = /*#__PURE__*/function (_Component) {
24
25
 
25
26
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
26
27
  _this.collapse = inject(COLLAPSE);
28
+ _this.config = useConfigContext();
27
29
  return _this;
28
30
  }
29
31
 
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, noop as _$no, createUnknownComponentVNode as _$cc } from 'intact-react';
3
3
  import { Transition } from 'intact';
4
4
  import { expandAnimationCallbacks, getRestProps } from '../utils';
5
- import { kls, makeItemStyles } from './styles';
5
+ import { makeItemStyles } from './styles';
6
6
  import { Icon } from '../icon';
7
7
  export default function ($props, $blocks, $__proto__) {
8
8
  var _classNameObj,
@@ -23,9 +23,8 @@ export default function ($props, $blocks, $__proto__) {
23
23
  disabled = _this$get.disabled;
24
24
 
25
25
  var isActive = this.collapse.isActive(value);
26
- var classNameObj = (_classNameObj = {
27
- 'k-collapse-item': true
28
- }, _classNameObj[makeItemStyles()] = true, _classNameObj[className] = className, _classNameObj['k-active'] = isActive, _classNameObj['k-disabled'] = disabled, _classNameObj);
26
+ var k = this.config.k;
27
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-collapse-item"] = true, _classNameObj[makeItemStyles(k)] = true, _classNameObj[className] = className, _classNameObj[k + "-active"] = isActive, _classNameObj[k + "-disabled"] = disabled, _classNameObj);
29
28
  return _$cv('div', _extends({
30
29
  'className': _$cn(classNameObj)
31
30
  }, getRestProps(this)), [_$ce(2, 'div', [(_$blocks['title'] = function ($super) {
@@ -39,14 +38,13 @@ export default function ($props, $blocks, $__proto__) {
39
38
 
40
39
  return block ? block.call($this, callBlock, data) : callBlock();
41
40
  }, __$blocks['title'](_$no)), _$cc(Icon, {
42
- 'className': _$cn((_$cn2 = {}, _$cn2[kls('arrow')] = true, _$cn2['k-icon-right'] = true, _$cn2)),
41
+ 'className': _$cn((_$cn2 = {}, _$cn2[k + "-collapse-arrow"] = true, _$cn2[k + "-icon-right"] = true, _$cn2)),
43
42
  'hoverable': !disabled
44
- })], 0, _$cn(kls('title')), {
43
+ })], 0, _$cn(k + "-collapse-title"), {
45
44
  'ev-click': this.toggle
46
45
  }), _$cc(Transition, _extends({
47
46
  'show': isActive
48
47
  }, expandAnimationCallbacks, {
49
- 'className': _$cn(kls('content')),
50
48
  'onEnter': function onEnter(el) {
51
49
  expandAnimationCallbacks.onEnter(el);
52
50
 
@@ -57,7 +55,7 @@ export default function ($props, $blocks, $__proto__) {
57
55
 
58
56
  _this.onAfterLeave();
59
57
  },
60
- 'children': _$ce(2, 'div', children, 0, _$cn(kls('wrapper')))
58
+ 'children': _$ce(2, 'div', children, 0, _$cn(k + "-collapse-wrapper"))
61
59
  }))]);
62
60
  }
63
61
  ;
@@ -1,4 +1,3 @@
1
1
  import '../../styles/global';
2
- export declare const kls: (className: string) => string;
3
- export declare function makeStyles(): string;
4
- export declare function makeItemStyles(): string;
2
+ export declare function makeStyles(k: string): string;
3
+ export declare function makeItemStyles(k: string): string;
@@ -2,9 +2,6 @@ import { deepDefaults } from '../../styles/utils';
2
2
  import { theme, setDefault } from '../../styles/theme';
3
3
  import { css } from '@emotion/css';
4
4
  import '../../styles/global';
5
- export var kls = function kls(className) {
6
- return "k-collapse-" + className;
7
- };
8
5
  var defaults = {
9
6
  get transition() {
10
7
  return theme.transition.large;
@@ -21,8 +18,7 @@ var defaults = {
21
18
 
22
19
  item: {
23
20
  borderBottom: '1px solid #e5e5e5',
24
- titleHeight: '40px',
25
- contentPadding: '0 16px 16px'
21
+ titleHeight: '40px'
26
22
  }
27
23
  };
28
24
  var collapse;
@@ -31,10 +27,10 @@ setDefault(function () {
31
27
  collapse: defaults
32
28
  }).collapse;
33
29
  });
34
- export function makeStyles() {
35
- return /*#__PURE__*/css("font-size:", collapse.fontSize, ";&.k-left{.", kls('arrow'), "{float:left;margin-right:", collapse.titleMarginRight, ";}}&.k-border{border-radius:", collapse.borderRadius, ";padding:", collapse.borderPadding, ";border:", collapse.collBorder, ";}");
30
+ export function makeStyles(k) {
31
+ return /*#__PURE__*/css("font-size:", collapse.fontSize, ";&.", k, "-left{.", k, "-collapse-arrow{float:left;margin-right:", collapse.titleMarginRight, ";}}&.", k, "-border{border-radius:", collapse.borderRadius, ";padding:", collapse.borderPadding, ";border:", collapse.collBorder, ";}");
36
32
  }
37
- export function makeItemStyles() {
33
+ export function makeItemStyles(k) {
38
34
  var collapseItem = collapse.item;
39
- return /*#__PURE__*/css("border-bottom:", collapseItem.borderBottom, ";&:last-of-type{border-bottom-color:transparent;}.", kls('title'), "{cursor:pointer;font-weight:bold;height:", collapseItem.titleHeight, ";line-height:", collapseItem.titleHeight, ";transition:color ", collapse.transition, ";}.", kls('arrow'), "{float:right;transition:transform ", collapse.transition, ";line-height:", collapseItem.titleHeight, ";height:", collapseItem.titleHeight, ";}&:not(.k-disabled){.", kls('title'), "{&:hover{color:", theme.color.primary, ";}}}.", kls('content'), "{overflow:hidden;.", kls('wrapper'), "{overflow:hidden;padding:", collapseItem.contentPadding, ";}}&.k-active{.", kls('arrow'), "{transform:rotate(90deg);}}&.k-disabled{color:", theme.color.disabledBorder, ";.", kls('title'), "{cursor:not-allowed;}}");
35
+ return /*#__PURE__*/css("border-bottom:", collapseItem.borderBottom, ";&:last-of-type{border-bottom-color:transparent;}.", k, "-collapse-title{cursor:pointer;font-weight:bold;height:", collapseItem.titleHeight, ";line-height:", collapseItem.titleHeight, ";transition:color ", collapse.transition, ";}.", k, "-collapse-arrow{float:right;transition:transform ", collapse.transition, ";line-height:", collapseItem.titleHeight, ";height:", collapseItem.titleHeight, ";}&:not(.", k, "-disabled){.", k, "-collapse-title{&:hover{color:", theme.color.primary, ";}}}&.", k, "-active{.", k, "-collapse-arrow{transform:rotate(90deg);}}&.", k, "-disabled{color:", theme.color.disabledBorder, ";.", k, "-collapse-title{cursor:not-allowed;}}");
40
36
  }
@@ -11,5 +11,6 @@ interface ColorpickerDragEvents {
11
11
  export declare class ColorpickerDrag extends Component<ColorpickerDragProps, ColorpickerDragEvents> {
12
12
  static template: string | import("intact").Template<any>;
13
13
  private drag;
14
+ private config;
14
15
  }
15
16
  export {};