@king-design/react 3.0.0 → 3.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/__tests__/__snapshots__/Dialog.md +1 -1
  2. package/__tests__/__snapshots__/React Demos.md +268 -268
  3. package/components/affix/index.d.ts +1 -0
  4. package/components/affix/index.js +2 -0
  5. package/components/affix/index.vdt.js +5 -5
  6. package/components/affix/styles.d.ts +1 -1
  7. package/components/affix/styles.js +1 -1
  8. package/components/badge/index.d.ts +1 -0
  9. package/components/badge/index.js +13 -1
  10. package/components/badge/index.vdt.js +5 -4
  11. package/components/badge/styles.d.ts +1 -1
  12. package/components/badge/styles.js +2 -2
  13. package/components/breadcrumb/index.d.ts +1 -0
  14. package/components/breadcrumb/index.js +13 -1
  15. package/components/breadcrumb/index.vdt.js +4 -5
  16. package/components/breadcrumb/item.d.ts +1 -0
  17. package/components/breadcrumb/item.js +2 -0
  18. package/components/breadcrumb/item.vdt.js +4 -5
  19. package/components/breadcrumb/styles.d.ts +1 -1
  20. package/components/breadcrumb/styles.js +2 -2
  21. package/components/button/group.d.ts +1 -0
  22. package/components/button/group.js +13 -1
  23. package/components/button/group.vdt.js +2 -6
  24. package/components/button/index.d.ts +1 -0
  25. package/components/button/index.js +2 -0
  26. package/components/button/index.vdt.js +7 -7
  27. package/components/button/styles.d.ts +2 -4
  28. package/components/button/styles.js +19 -20
  29. package/components/card/column.d.ts +1 -0
  30. package/components/card/column.js +13 -1
  31. package/components/card/column.vdt.js +2 -5
  32. package/components/card/index.d.ts +1 -0
  33. package/components/card/index.js +13 -1
  34. package/components/card/index.vdt.js +5 -11
  35. package/components/card/styles.d.ts +1 -1
  36. package/components/card/styles.js +2 -2
  37. package/components/carousel/index.d.ts +1 -0
  38. package/components/carousel/index.js +2 -0
  39. package/components/carousel/index.vdt.js +15 -19
  40. package/components/carousel/item.d.ts +1 -0
  41. package/components/carousel/item.js +13 -1
  42. package/components/carousel/item.vdt.js +2 -3
  43. package/components/carousel/styles.d.ts +2 -2
  44. package/components/carousel/styles.js +4 -4
  45. package/components/cascader/index.vdt.js +20 -29
  46. package/components/cascader/styles.d.ts +2 -2
  47. package/components/cascader/styles.js +3 -3
  48. package/components/checkbox/index.d.ts +1 -0
  49. package/components/checkbox/index.js +2 -0
  50. package/components/checkbox/index.vdt.js +4 -8
  51. package/components/checkbox/styles.d.ts +1 -1
  52. package/components/checkbox/styles.js +2 -2
  53. package/components/code/index.d.ts +1 -0
  54. package/components/code/index.js +2 -0
  55. package/components/code/index.vdt.js +2 -3
  56. package/components/code/styles.d.ts +1 -1
  57. package/components/code/styles.js +1 -1
  58. package/components/collapse/index.d.ts +1 -0
  59. package/components/collapse/index.js +13 -1
  60. package/components/collapse/index.vdt.js +2 -3
  61. package/components/collapse/item.d.ts +1 -0
  62. package/components/collapse/item.js +2 -0
  63. package/components/collapse/item.vdt.js +6 -8
  64. package/components/collapse/styles.d.ts +2 -3
  65. package/components/collapse/styles.js +5 -9
  66. package/components/colorpicker/drag.d.ts +1 -0
  67. package/components/colorpicker/drag.js +2 -0
  68. package/components/colorpicker/drag.vdt.js +3 -2
  69. package/components/colorpicker/index.d.ts +1 -0
  70. package/components/colorpicker/index.js +13 -1
  71. package/components/colorpicker/index.vdt.js +5 -6
  72. package/components/colorpicker/panel.d.ts +1 -0
  73. package/components/colorpicker/panel.js +2 -0
  74. package/components/colorpicker/panel.vdt.js +16 -19
  75. package/components/colorpicker/styles.d.ts +3 -3
  76. package/components/colorpicker/styles.js +8 -8
  77. package/components/config/index.d.ts +10 -0
  78. package/components/config/index.js +23 -0
  79. package/components/config/index.spec.d.ts +1 -0
  80. package/components/config/index.spec.js +71 -0
  81. package/components/context.d.ts +2 -1
  82. package/components/context.js +8 -2
  83. package/components/copy/index.d.ts +1 -0
  84. package/components/copy/index.js +2 -0
  85. package/components/copy/index.vdt.js +9 -9
  86. package/components/copy/styles.d.ts +1 -1
  87. package/components/copy/styles.js +1 -1
  88. package/components/datepicker/calendar.d.ts +1 -0
  89. package/components/datepicker/calendar.js +2 -0
  90. package/components/datepicker/calendar.vdt.js +38 -51
  91. package/components/datepicker/index.vdt.js +13 -16
  92. package/components/datepicker/styles.d.ts +3 -3
  93. package/components/datepicker/styles.js +6 -6
  94. package/components/datepicker/time.d.ts +1 -0
  95. package/components/datepicker/time.js +2 -0
  96. package/components/datepicker/time.vdt.js +2 -3
  97. package/components/diagram/diagram.d.ts +1 -0
  98. package/components/diagram/diagram.js +2 -0
  99. package/components/diagram/diagram.vdt.js +3 -4
  100. package/components/diagram/styles.d.ts +1 -1
  101. package/components/diagram/styles.js +1 -1
  102. package/components/dialog/alert.vdt.js +6 -10
  103. package/components/dialog/base.d.ts +4 -0
  104. package/components/dialog/base.js +2 -0
  105. package/components/dialog/base.vdt.js +15 -21
  106. package/components/dialog/index.d.ts +1 -1
  107. package/components/dialog/styles.d.ts +3 -3
  108. package/components/dialog/styles.js +12 -12
  109. package/components/drawer/index.vdt.js +3 -4
  110. package/components/drawer/styles.d.ts +1 -1
  111. package/components/drawer/styles.js +3 -3
  112. package/components/dropdown/dropdown.d.ts +1 -0
  113. package/components/dropdown/dropdown.js +4 -3
  114. package/components/dropdown/item.d.ts +1 -0
  115. package/components/dropdown/item.js +2 -0
  116. package/components/dropdown/item.vdt.js +2 -4
  117. package/components/dropdown/menu.d.ts +1 -0
  118. package/components/dropdown/menu.js +2 -0
  119. package/components/dropdown/menu.vdt.js +2 -3
  120. package/components/dropdown/styles.d.ts +2 -2
  121. package/components/dropdown/styles.js +4 -4
  122. package/components/dropdown/usePosition.js +2 -2
  123. package/components/editable/index.d.ts +1 -0
  124. package/components/editable/index.js +2 -0
  125. package/components/editable/index.vdt.js +3 -7
  126. package/components/editable/styles.d.ts +1 -1
  127. package/components/editable/styles.js +2 -2
  128. package/components/form/form.d.ts +1 -0
  129. package/components/form/form.js +2 -0
  130. package/components/form/form.vdt.js +2 -3
  131. package/components/form/item.d.ts +1 -0
  132. package/components/form/item.js +2 -0
  133. package/components/form/item.vdt.js +13 -19
  134. package/components/form/styles.d.ts +2 -2
  135. package/components/form/styles.js +5 -5
  136. package/components/form/useError.d.ts +1 -0
  137. package/components/grid/col.d.ts +1 -0
  138. package/components/grid/col.js +2 -0
  139. package/components/grid/col.vdt.js +3 -6
  140. package/components/grid/row.d.ts +1 -0
  141. package/components/grid/row.js +2 -0
  142. package/components/grid/row.vdt.js +2 -3
  143. package/components/grid/styles.d.ts +2 -2
  144. package/components/grid/styles.js +8 -18
  145. package/components/grid/useBreakpoints.d.ts +1 -1
  146. package/components/grid/useBreakpoints.js +2 -2
  147. package/components/grid/useGutter.d.ts +1 -0
  148. package/components/icon/index.d.ts +1 -0
  149. package/components/icon/index.js +2 -0
  150. package/components/icon/index.vdt.js +7 -11
  151. package/components/icon/styles.d.ts +1 -2
  152. package/components/icon/styles.js +7 -5
  153. package/components/input/index.d.ts +1 -0
  154. package/components/input/index.js +2 -0
  155. package/components/input/index.vdt.js +16 -26
  156. package/components/input/search.d.ts +1 -0
  157. package/components/input/search.js +2 -0
  158. package/components/input/search.vdt.js +5 -7
  159. package/components/input/styles.d.ts +2 -2
  160. package/components/input/styles.js +11 -11
  161. package/components/layout/aside.d.ts +1 -0
  162. package/components/layout/aside.js +2 -0
  163. package/components/layout/aside.vdt.js +5 -8
  164. package/components/layout/body.d.ts +2 -0
  165. package/components/layout/body.js +11 -5
  166. package/components/layout/footer.d.ts +1 -0
  167. package/components/layout/footer.js +15 -4
  168. package/components/layout/header.d.ts +3 -0
  169. package/components/layout/header.js +10 -6
  170. package/components/layout/helpers.d.ts +1 -0
  171. package/components/layout/helpers.js +1 -0
  172. package/components/layout/index.spec.d.ts +1 -0
  173. package/components/layout/index.spec.js +53 -0
  174. package/components/layout/layout.d.ts +2 -0
  175. package/components/layout/layout.js +7 -5
  176. package/components/layout/styles.d.ts +3 -3
  177. package/components/layout/styles.js +11 -11
  178. package/components/layout/template.vdt.js +2 -1
  179. package/components/menu/item.d.ts +1 -0
  180. package/components/menu/item.js +2 -0
  181. package/components/menu/item.vdt.js +7 -12
  182. package/components/menu/menu.d.ts +1 -0
  183. package/components/menu/menu.js +2 -0
  184. package/components/menu/menu.vdt.js +3 -6
  185. package/components/menu/styles.d.ts +3 -3
  186. package/components/menu/styles.js +11 -11
  187. package/components/menu/useDropdown.js +6 -1
  188. package/components/message/message.d.ts +1 -0
  189. package/components/message/message.js +2 -0
  190. package/components/message/message.vdt.js +12 -17
  191. package/components/message/messages.d.ts +1 -0
  192. package/components/message/messages.js +2 -0
  193. package/components/message/messages.vdt.js +2 -3
  194. package/components/message/styles.d.ts +2 -2
  195. package/components/message/styles.js +4 -4
  196. package/components/pagination/index.d.ts +1 -0
  197. package/components/pagination/index.js +2 -0
  198. package/components/pagination/index.vdt.js +14 -17
  199. package/components/pagination/styles.d.ts +1 -1
  200. package/components/pagination/styles.js +4 -4
  201. package/components/popover/content.vdt.js +5 -4
  202. package/components/popover/styles.d.ts +1 -1
  203. package/components/popover/styles.js +2 -2
  204. package/components/portal.d.ts +1 -0
  205. package/components/portal.js +3 -1
  206. package/components/progress/index.d.ts +1 -0
  207. package/components/progress/index.js +2 -0
  208. package/components/progress/index.vdt.js +14 -17
  209. package/components/progress/styles.d.ts +1 -1
  210. package/components/progress/styles.js +6 -6
  211. package/components/radio/index.d.ts +1 -0
  212. package/components/radio/index.js +2 -0
  213. package/components/radio/index.vdt.js +4 -7
  214. package/components/radio/styles.d.ts +1 -1
  215. package/components/radio/styles.js +2 -2
  216. package/components/rate/index.d.ts +1 -0
  217. package/components/rate/index.js +2 -0
  218. package/components/rate/index.vdt.js +4 -8
  219. package/components/rate/styles.d.ts +1 -1
  220. package/components/rate/styles.js +2 -2
  221. package/components/scrollSelect/index.d.ts +1 -0
  222. package/components/scrollSelect/index.js +2 -0
  223. package/components/scrollSelect/index.vdt.js +7 -12
  224. package/components/scrollSelect/styles.d.ts +1 -1
  225. package/components/scrollSelect/styles.js +2 -2
  226. package/components/select/base.d.ts +4 -0
  227. package/components/select/base.js +2 -0
  228. package/components/select/base.vdt.js +17 -21
  229. package/components/select/group.d.ts +1 -0
  230. package/components/select/group.js +2 -0
  231. package/components/select/group.vdt.js +3 -4
  232. package/components/select/menu.d.ts +1 -0
  233. package/components/select/menu.js +2 -0
  234. package/components/select/menu.vdt.js +9 -13
  235. package/components/select/option.d.ts +1 -0
  236. package/components/select/option.js +2 -0
  237. package/components/select/option.vdt.js +6 -8
  238. package/components/select/styles.d.ts +3 -3
  239. package/components/select/styles.js +8 -8
  240. package/components/select/useSearchable.d.ts +1 -0
  241. package/components/skeleton/item.d.ts +1 -0
  242. package/components/skeleton/item.js +13 -1
  243. package/components/skeleton/item.vdt.js +4 -7
  244. package/components/skeleton/skeleton.d.ts +1 -0
  245. package/components/skeleton/skeleton.js +13 -1
  246. package/components/skeleton/skeleton.vdt.js +4 -6
  247. package/components/skeleton/styles.d.ts +6 -0
  248. package/components/skeleton/styles.js +35 -0
  249. package/components/slider/index.d.ts +1 -0
  250. package/components/slider/index.js +2 -0
  251. package/components/slider/index.vdt.js +18 -22
  252. package/components/slider/styles.d.ts +1 -1
  253. package/components/slider/styles.js +2 -2
  254. package/components/spin/index.d.ts +1 -0
  255. package/components/spin/index.js +13 -1
  256. package/components/spin/index.vdt.js +6 -7
  257. package/components/spin/styles.d.ts +1 -1
  258. package/components/spin/styles.js +4 -4
  259. package/components/spinner/index.d.ts +1 -0
  260. package/components/spinner/index.js +2 -0
  261. package/components/spinner/index.vdt.js +15 -21
  262. package/components/spinner/styles.d.ts +1 -1
  263. package/components/spinner/styles.js +7 -7
  264. package/components/split/index.d.ts +2 -1
  265. package/components/split/index.js +2 -0
  266. package/components/split/index.vdt.js +7 -9
  267. package/components/split/styles.d.ts +4 -0
  268. package/components/split/styles.js +55 -0
  269. package/components/steps/context.d.ts +1 -0
  270. package/components/steps/index.d.ts +1 -0
  271. package/components/steps/index.js +13 -1
  272. package/components/steps/index.vdt.js +2 -3
  273. package/components/steps/step.d.ts +1 -0
  274. package/components/steps/step.js +13 -1
  275. package/components/steps/step.vdt.js +10 -16
  276. package/components/steps/styles.d.ts +3 -3
  277. package/components/steps/styles.js +18 -18
  278. package/components/switch/index.d.ts +1 -0
  279. package/components/switch/index.js +2 -0
  280. package/components/switch/index.vdt.js +6 -7
  281. package/components/switch/styles.d.ts +1 -1
  282. package/components/switch/styles.js +4 -4
  283. package/components/table/cell.d.ts +1 -0
  284. package/components/table/cell.js +13 -1
  285. package/components/table/cell.vdt.js +6 -6
  286. package/components/table/column.d.ts +1 -0
  287. package/components/table/column.js +2 -0
  288. package/components/table/column.vdt.js +24 -32
  289. package/components/table/index.spec.js +1 -1
  290. package/components/table/row.d.ts +1 -0
  291. package/components/table/row.js +21 -2
  292. package/components/table/row.vdt.js +3 -10
  293. package/components/table/styles.d.ts +2 -2
  294. package/components/table/styles.js +6 -6
  295. package/components/table/table.d.ts +2 -1
  296. package/components/table/table.js +3 -1
  297. package/components/table/table.vdt.js +16 -20
  298. package/components/table/useColumns.d.ts +1 -0
  299. package/components/table/useFixedColumns.d.ts +2 -1
  300. package/components/table/useGroup.d.ts +1 -0
  301. package/components/table/usePagination.js +1 -1
  302. package/components/table/useResizable.d.ts +1 -0
  303. package/components/table/useSortable.d.ts +1 -0
  304. package/components/tabs/index.d.ts +4 -0
  305. package/components/tabs/index.js +2 -0
  306. package/components/tabs/index.vdt.js +9 -10
  307. package/components/tabs/styles.d.ts +1 -1
  308. package/components/tabs/styles.js +15 -15
  309. package/components/tabs/tab.d.ts +1 -0
  310. package/components/tabs/tab.js +2 -0
  311. package/components/tabs/tab.vdt.js +3 -5
  312. package/components/tabs/useActiveBar.js +2 -1
  313. package/components/tabs/useScroll.js +2 -1
  314. package/components/tag/base.d.ts +1 -0
  315. package/components/tag/base.js +13 -1
  316. package/components/tag/index.vdt.js +4 -5
  317. package/components/tag/styles.d.ts +2 -2
  318. package/components/tag/styles.js +7 -7
  319. package/components/tag/tags.d.ts +1 -0
  320. package/components/tag/tags.js +2 -0
  321. package/components/tag/tags.vdt.js +5 -11
  322. package/components/timeline/item.d.ts +1 -0
  323. package/components/timeline/item.js +13 -1
  324. package/components/timeline/item.vdt.js +4 -5
  325. package/components/timeline/styles.d.ts +2 -2
  326. package/components/timeline/styles.js +6 -6
  327. package/components/timeline/timeline.d.ts +1 -0
  328. package/components/timeline/timeline.js +13 -1
  329. package/components/timeline/timeline.vdt.js +2 -3
  330. package/components/timepicker/index.d.ts +2 -1
  331. package/components/timepicker/panelPicker.vdt.js +13 -17
  332. package/components/timepicker/selectPicker.d.ts +1 -0
  333. package/components/timepicker/selectPicker.js +2 -0
  334. package/components/timepicker/selectPicker.vdt.js +4 -4
  335. package/components/timepicker/styles.d.ts +1 -1
  336. package/components/timepicker/styles.js +2 -2
  337. package/components/tip/index.vdt.js +5 -6
  338. package/components/tip/styles.d.ts +1 -1
  339. package/components/tip/styles.js +2 -2
  340. package/components/tooltip/content.vdt.js +4 -9
  341. package/components/tooltip/styles.d.ts +1 -1
  342. package/components/tooltip/styles.js +6 -6
  343. package/components/transfer/index.d.ts +1 -0
  344. package/components/transfer/index.js +2 -0
  345. package/components/transfer/index.vdt.js +20 -25
  346. package/components/transfer/styles.d.ts +1 -1
  347. package/components/transfer/styles.js +2 -2
  348. package/components/tree/index.d.ts +1 -0
  349. package/components/tree/index.js +2 -0
  350. package/components/tree/index.vdt.js +19 -30
  351. package/components/tree/styles.d.ts +1 -1
  352. package/components/tree/styles.js +2 -2
  353. package/components/treeSelect/index.vdt.js +2 -3
  354. package/components/treeSelect/styles.d.ts +1 -1
  355. package/components/treeSelect/styles.js +1 -1
  356. package/components/upload/index.d.ts +1 -0
  357. package/components/upload/index.js +2 -0
  358. package/components/upload/index.vdt.js +39 -50
  359. package/components/upload/styles.d.ts +2 -2
  360. package/components/upload/styles.js +3 -3
  361. package/components/utils.d.ts +3 -1
  362. package/components/utils.js +36 -9
  363. package/components/virtual.js +5 -2
  364. package/components/wave/index.d.ts +1 -0
  365. package/components/wave/index.js +4 -2
  366. package/components/wave/styles.d.ts +1 -1
  367. package/components/wave/styles.js +2 -2
  368. package/index.d.ts +3 -2
  369. package/index.js +3 -2
  370. package/package.json +2 -2
  371. package/styles/fonts/iconfont.d.ts +1 -1
  372. package/styles/fonts/iconfont.js +4 -1
  373. package/styles/global.js +4 -4
  374. package/styles/theme.d.ts +1 -1
  375. package/styles/theme.js +4 -53
  376. package/styles/utils.d.ts +1 -0
  377. package/styles/utils.js +3 -0
  378. package/components/skeleton/style.d.ts +0 -6
  379. package/components/skeleton/style.js +0 -35
  380. package/components/split/style.d.ts +0 -4
  381. package/components/split/style.js +0 -55
@@ -4,14 +4,6 @@ import { linkEvent } from 'intact';
4
4
  import { getRestProps, addStyle } from '../utils';
5
5
  import { context as StepsContext } from './context';
6
6
  import { Icon } from '../icon';
7
- var _$tmp0 = {
8
- 'className': 'k-icon-close-bold',
9
- 'color': 'danger'
10
- };
11
- var _$tmp1 = {
12
- 'className': 'k-icon-check-bold',
13
- 'color': 'primary'
14
- };
15
7
  export default function ($props, $blocks, $__proto__) {
16
8
  var _this = this;
17
9
 
@@ -26,6 +18,7 @@ export default function ($props, $blocks, $__proto__) {
26
18
  className = _this$get.className,
27
19
  style = _this$get.style;
28
20
 
21
+ var k = this.config.k;
29
22
  return _$cc(StepsContext.Consumer, {
30
23
  'children': function children(_ref) {
31
24
  var _classNameObj;
@@ -37,18 +30,19 @@ export default function ($props, $blocks, $__proto__) {
37
30
  var selected = value === index;
38
31
  var error = selected && status === 'error';
39
32
  var done = value > index;
40
- var classNameObj = (_classNameObj = {
41
- 'k-step': true,
42
- 'k-active': selected,
43
- 'k-done': done,
44
- 'k-error': error
45
- }, _classNameObj[className] = className, _classNameObj);
33
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-step"] = true, _classNameObj[k + "-active"] = selected, _classNameObj[k + "-done"] = done, _classNameObj[k + "-error"] = error, _classNameObj[className] = className, _classNameObj);
46
34
  return _$cv('div', _extends({}, getRestProps(_this), {
47
35
  'className': _$cn(classNameObj),
48
36
  'style': style
49
- }), [_$ce(2, 'div', [_$ce(2, 'div', error && type !== 'simple' ? _$cc(Icon, _$tmp0) : done && (type === 'line' || type === 'line-compact') ? _$cc(Icon, _$tmp1) : type !== 'simple' ? _$ce(2, 'span', index + 1, 0) : undefined, 0, 'k-step-mark'), _$ce(2, 'div', [_$ce(2, 'div', title, 0, 'k-step-title'), _$ce(2, 'div', _children, 0, 'k-step-content')], 4, 'k-step-main')], 4, 'k-step-wrapper', {
37
+ }), [_$ce(2, 'div', [_$ce(2, 'div', error && type !== 'simple' ? _$cc(Icon, {
38
+ 'className': _$cn(k + "-icon-close-bold"),
39
+ 'color': 'danger'
40
+ }) : done && (type === 'line' || type === 'line-compact') ? _$cc(Icon, {
41
+ 'className': _$cn(k + "-icon-check-bold"),
42
+ 'color': 'primary'
43
+ }) : type !== 'simple' ? _$ce(2, 'span', index + 1, 0) : undefined, 0, _$cn(k + "-step-mark")), _$ce(2, 'div', [_$ce(2, 'div', title, 0, _$cn(k + "-step-title")), _$ce(2, 'div', _children, 0, _$cn(k + "-step-content"))], 4, _$cn(k + "-step-main"))], 4, _$cn(k + "-step-wrapper"), {
50
44
  'ev-click': linkEvent(index, onChange)
51
- }), _$ce(2, 'div', null, 1, 'k-step-tail')]);
45
+ }), _$ce(2, 'div', null, 1, _$cn(k + "-step-tail"))]);
52
46
  }
53
47
  });
54
48
  }
@@ -1,4 +1,4 @@
1
1
  import '../../styles/global';
2
- export declare function makeStepsStyles(): string;
3
- export declare function makeCommonStyles(): string;
4
- export declare function makeVerticalStyles(): string;
2
+ export declare function makeStepsStyles(k: string): string;
3
+ export declare function makeCommonStyles(k: string): string;
4
+ export declare function makeVerticalStyles(k: string): string;
@@ -143,37 +143,37 @@ setDefault(function () {
143
143
  }).steps;
144
144
  });
145
145
  var stepStatus = ['done', 'active', 'error'];
146
- export function makeStepsStyles() {
147
- return /*#__PURE__*/css("display:flex;", makeCommonStyles(), ";&.k-default{", makeDefaultStyles(), ";}&.k-line,&.k-line-compact,&.k-simple{", makeLineStyles(), ";}&.k-line-compact{", makeLineCompactStyles(), ";}&.k-simple{", makeSimpleStyles(), ";}&.k-clickable{.k-done{cursor:pointer;.k-step-wrapper:hover .k-step-mark{background:", steps.done.markHoverBgColor, ";}}}", makeVerticalStyles(), ";");
146
+ export function makeStepsStyles(k) {
147
+ return /*#__PURE__*/css("display:flex;", makeCommonStyles(k), ";&.", k, "-default{", makeDefaultStyles(k), ";}&.", k, "-line,&.", k, "-line-compact,&.", k, "-simple{", makeLineStyles(k), ";}&.", k, "-line-compact{", makeLineCompactStyles(k), ";}&.", k, "-simple{", makeSimpleStyles(k), ";}&.", k, "-clickable{.", k, "-done{cursor:pointer;.", k, "-step-wrapper:hover .", k, "-step-mark{background:", steps.done.markHoverBgColor, ";}}}", makeVerticalStyles(k), ";");
148
148
  }
149
149
 
150
- function makeDefaultStyles() {
150
+ function makeDefaultStyles(k) {
151
151
  var defaults = steps.default;
152
- return /*#__PURE__*/css("text-align:center;height:", defaults.height, ";background:", defaults.bgColor, ";.k-step-wrapper{", center(), ";height:100%;padding:0 ", defaults.padding, ";}.k-step-mark{width:", defaults.markWidth, ";height:", defaults.markWidth, ";margin-right:", steps.gap, ";}.k-step-main{display:flex;overflow:hidden;white-space:nowrap;}.k-step-title{padding-right:", steps.gap, ";}.k-step:last-of-type{.k-step-tail{display:none;}}&:not(.k-vertical){", makeArrow(false), ";}");
152
+ return /*#__PURE__*/css("text-align:center;height:", defaults.height, ";background:", defaults.bgColor, ";.", k, "-step-wrapper{", center(), ";height:100%;padding:0 ", defaults.padding, ";}.", k, "-step-mark{width:", defaults.markWidth, ";height:", defaults.markWidth, ";margin-right:", steps.gap, ";}.", k, "-step-main{display:flex;overflow:hidden;white-space:nowrap;}.", k, "-step-title{padding-right:", steps.gap, ";}.", k, "-step:last-of-type{.", k, "-step-tail{display:none;}}&:not(.", k, "-vertical){", makeArrow(false, k), ";}");
153
153
  }
154
154
 
155
- function makeArrow(isVertical) {
155
+ function makeArrow(isVertical, k) {
156
156
  var defaults = steps.default;
157
157
  var offset = "calc(-1 * (" + defaults.height + " / 2 + " + steps.gap + "))";
158
158
  var size = "calc(" + defaults.height + " / 2 + " + steps.gap + ")";
159
- return /*#__PURE__*/css(".k-step-tail{position:absolute;", !isVertical ? "\n top: 0;\n right: " + offset + ";\n width: " + size + ";\n height: " + defaults.height + ";\n " : "\n left: 0;\n bottom: " + offset + ";\n height: " + size + ";\n width: " + defaults.height + ";\n ", " overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", defaults.height, " / 2 + ", steps.gap, ");border-style:solid;border-color:transparent;position:absolute;", isVertical ? 'left' : 'top', ":calc(-1 * ", steps.gap, ");}&:after{border-", isVertical ? 'top' : 'left', "-color:", defaults.bgColor, ";", isVertical ? 'top' : 'left', ":calc(-1 * ", steps.gap, ");}&:before{border-", isVertical ? 'top' : 'left', "-color:#fff;", isVertical ? 'top' : 'left', ":0;}}.k-step:not(:first-of-type){padding-", isVertical ? 'top' : 'left', ":calc(", defaults.height, " / 2 + ", steps.gap, ");}");
159
+ return /*#__PURE__*/css(".", k, "-step-tail{position:absolute;", !isVertical ? /*#__PURE__*/css("top:0;right:", offset, ";width:", size, ";height:", defaults.height, ";") : /*#__PURE__*/css("left:0;bottom:", offset, ";height:", size, ";width:", defaults.height, ";"), " overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", defaults.height, " / 2 + ", steps.gap, ");border-style:solid;border-color:transparent;position:absolute;", isVertical ? 'left' : 'top', ":calc(-1 * ", steps.gap, ");}&:after{border-", isVertical ? 'top' : 'left', "-color:", defaults.bgColor, ";", isVertical ? 'top' : 'left', ":calc(-1 * ", steps.gap, ");}&:before{border-", isVertical ? 'top' : 'left', "-color:#fff;", isVertical ? 'top' : 'left', ":0;}}.", k, "-step:not(:first-of-type){padding-", isVertical ? 'top' : 'left', ":calc(", defaults.height, " / 2 + ", steps.gap, ");}");
160
160
  }
161
161
 
162
- function makeLineStyles() {
162
+ function makeLineStyles(k) {
163
163
  var line = steps.line;
164
164
  var top = "calc(" + line.markWidth + " / 2 - " + line.lineWidth + " / 2)";
165
- return /*#__PURE__*/css(".k-step{display:flex;}.k-step-wrapper{display:inline-block;text-align:center;position:relative;width:", line.contentWidth, ";}.k-step:last-of-type{flex:0 0 auto;}.k-step-mark{border:", line.markborder, ";width:", line.markWidth, ";height:", line.markWidth, ";position:relative;z-index:1;&,.k-icon{font-size:", line.markFontSize, ";}}.k-step-main{padding-top:", line.titleGap, ";}.k-step-title{font-size:14px;color:", theme.color.text, ";}.k-step-content{margin-top:", line.descGap, ";color:", theme.color.placeholder, ";}.k-step-wrapper{&:before,&:after{content:'';display:block;height:", line.lineWidth, ";background:", line.lineColor, ";width:50%;position:absolute;top:", top, ";}&:after{right:0;}}.k-step{&:first-of-type .k-step-wrapper:before,&:last-of-type .k-step-wrapper:after{background:transparent;}}.k-step-tail{flex:1;height:", line.lineWidth, ";background:", line.lineColor, ";margin-top:", top, ";}.k-step{&.k-done{.k-step-tail,&:not(:last-of-type) .k-step-wrapper:after,&:not(:first-of-type) .k-step-wrapper:before{background:", theme.color.primary, ";}}&:not(:first-of-type).k-active{.k-step-wrapper:before{background:", theme.color.primary, ";}}&.k-active .k-step-title{color:", theme.color.primary, ";}&.k-error .k-step-title{color:", theme.color.danger, ";}}");
165
+ return /*#__PURE__*/css(".", k, "-step{display:flex;}.", k, "-step-wrapper{display:inline-block;text-align:center;position:relative;width:", line.contentWidth, ";}.", k, "-step:last-of-type{flex:0 0 auto;}.", k, "-step-mark{border:", line.markborder, ";width:", line.markWidth, ";height:", line.markWidth, ";position:relative;z-index:1;&,.", k, "-icon{font-size:", line.markFontSize, ";}}.", k, "-step-main{padding-top:", line.titleGap, ";}.", k, "-step-title{font-size:14px;color:", theme.color.text, ";}.", k, "-step-content{margin-top:", line.descGap, ";color:", theme.color.placeholder, ";}.", k, "-step-wrapper{&:before,&:after{content:'';display:block;height:", line.lineWidth, ";background:", line.lineColor, ";width:50%;position:absolute;top:", top, ";}&:after{right:0;}}.", k, "-step{&:first-of-type .", k, "-step-wrapper:before,&:last-of-type .", k, "-step-wrapper:after{background:transparent;}}.", k, "-step-tail{flex:1;height:", line.lineWidth, ";background:", line.lineColor, ";margin-top:", top, ";}.", k, "-step{&.", k, "-done{.", k, "-step-tail,&:not(:last-of-type) .", k, "-step-wrapper:after,&:not(:first-of-type) .", k, "-step-wrapper:before{background:", theme.color.primary, ";}}&:not(:first-of-type).", k, "-active{.", k, "-step-wrapper:before{background:", theme.color.primary, ";}}&.", k, "-active .", k, "-step-title{color:", theme.color.primary, ";}&.", k, "-error .", k, "-step-title{color:", theme.color.danger, ";}}");
166
166
  }
167
167
 
168
- function makeLineCompactStyles() {
168
+ function makeLineCompactStyles(k) {
169
169
  var line = steps.line;
170
- return /*#__PURE__*/css(".k-step-wrapper{display:inline-flex;text-align:left;width:auto;&:before,&:after{display:none;}}.k-step-main{flex:1;padding:0 0 0 ", line.titleGap, ";}.k-step-content{margin:0;}.k-step-tail{margin-right:", line.titleGap, ";}.k-step-title{display:flex;align-items:center;height:", line.markWidth, ";&:after{content:'';display:block;flex:1;height:", line.lineWidth, ";background:", line.lineColor, ";margin-left:", line.titleGap, ";}}.k-step:last-of-type .k-step-title:after{display:none;}.k-step{&.k-done{.k-step-title:after{background:", theme.color.primary, ";}}}");
170
+ return /*#__PURE__*/css(".", k, "-step-wrapper{display:inline-flex;text-align:left;width:auto;&:before,&:after{display:none;}}.", k, "-step-main{flex:1;padding:0 0 0 ", line.titleGap, ";}.", k, "-step-content{margin:0;}.", k, "-step-tail{margin-right:", line.titleGap, ";}.", k, "-step-title{display:flex;align-items:center;height:", line.markWidth, ";&:after{content:'';display:block;flex:1;height:", line.lineWidth, ";background:", line.lineColor, ";margin-left:", line.titleGap, ";}}.", k, "-step:last-of-type .", k, "-step-title:after{display:none;}.", k, "-step{&.", k, "-done{.", k, "-step-title:after{background:", theme.color.primary, ";}}}");
171
171
  }
172
172
 
173
- function makeSimpleStyles() {
173
+ function makeSimpleStyles(k) {
174
174
  var simple = steps.simple;
175
175
  var top = "calc(" + simple.markWidth + " / 2 - " + steps.line.lineWidth + " / 2)";
176
- return /*#__PURE__*/css(".k-step-mark{width:", simple.markWidth, ";height:", simple.markWidth, ";background:", simple.markBgColor, ";}.k-step-wrapper{font-size:0;&:before,&:after{top:", top, ";}}.k-step-main{font-size:", theme.default.fontSize, ";}.k-step-tail{margin-top:", top, ";}.k-step{&.k-done{.k-step-mark{background:", simple.doneMarkBgColor, ";}}&.k-error{.k-step-mark{background:", simple.errorMarkBgColor, ";}}}");
176
+ return /*#__PURE__*/css(".", k, "-step-mark{width:", simple.markWidth, ";height:", simple.markWidth, ";background:", simple.markBgColor, ";}.", k, "-step-wrapper{font-size:0;&:before,&:after{top:", top, ";}}.", k, "-step-main{font-size:", theme.default.fontSize, ";}.", k, "-step-tail{margin-top:", top, ";}.", k, "-step{&.", k, "-done{.", k, "-step-mark{background:", simple.doneMarkBgColor, ";}}&.", k, "-error{.", k, "-step-mark{background:", simple.errorMarkBgColor, ";}}}");
177
177
  }
178
178
 
179
179
  function center(flex) {
@@ -184,13 +184,13 @@ function center(flex) {
184
184
  return /*#__PURE__*/css("display:", flex, ";align-items:center;justify-content:center;");
185
185
  }
186
186
 
187
- export function makeCommonStyles() {
188
- return /*#__PURE__*/css(".k-step{position:relative;flex:1;", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
187
+ export function makeCommonStyles(k) {
188
+ return /*#__PURE__*/css(".", k, "-step{position:relative;flex:1;", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
189
189
  var styles = steps[status];
190
- return /*#__PURE__*/css("&.k-", status, "{.k-step-mark{color:", styles.markColor, ";border-color:", styles.markBorderColor, ";background:", styles.markBgColor, ";}.k-step-main{color:", styles.mainColor, ";}}");
191
- }), ";}.k-step-mark{", center('inline-flex'), ";border:", steps.default.markborder, ";border-radius:50%;vertical-align:top;color:", steps.markColor, ";background:", steps.markBgColor, ";}");
190
+ return /*#__PURE__*/css("&.", k, "-", status, "{.", k, "-step-mark{color:", styles.markColor, ";border-color:", styles.markBorderColor, ";background:", styles.markBgColor, ";}.", k, "-step-main{color:", styles.mainColor, ";}}");
191
+ }), ";}.", k, "-step-mark{", center('inline-flex'), ";border:", steps.default.markborder, ";border-radius:50%;vertical-align:top;color:", steps.markColor, ";background:", steps.markBgColor, ";}");
192
192
  }
193
- export function makeVerticalStyles() {
193
+ export function makeVerticalStyles(k) {
194
194
  var verticalLine = steps.vertical.line;
195
- return /*#__PURE__*/css("&.k-vertical{&.k-default{height:auto;width:", steps.default.height, ";writing-mode:vertical-rl;letter-spacing:1px;", makeArrow(true), ";.k-step-wrapper{width:100%;padding:", steps.default.padding, " 0;}.k-step-mark{margin-right:0;margin-bottom:", steps.gap, ";}.k-step-title{padding-right:0;padding-bottom:", steps.gap, ";}}&.k-line,&.k-line-compact,&.k-simple{flex-direction:column;.k-step{flex:none;min-height:", verticalLine.minHeight, ";}.k-step-wrapper{display:flex;width:auto;text-align:left;}.k-step-main{flex:1;padding:0 0 ", verticalLine.padding, " ", verticalLine.padding, ";}.k-step-title{display:flex;align-items:center;height:", steps.line.markWidth, ";&:after{display:none;}}.k-step-wrapper{&:before,&:after{display:none;}}.k-step-tail{position:absolute;left:calc(", steps.line.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);height:100%;width:", steps.line.lineWidth, ";background:", steps.line.lineColor, ";}.k-step:last-of-type{.k-step-tail{display:none;}}}&.k-simple{.k-step-tail{left:calc(", steps.simple.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);}.k-step-title{height:", steps.simple.markWidth, ";margin-bottom:", steps.vertical.simple.titleGap, ";}}}");
195
+ return /*#__PURE__*/css("&.", k, "-vertical{&.", k, "-default{height:auto;width:", steps.default.height, ";writing-mode:vertical-rl;letter-spacing:1px;", makeArrow(true, k), ";.", k, "-step-wrapper{width:100%;padding:", steps.default.padding, " 0;}.", k, "-step-mark{margin-right:0;margin-bottom:", steps.gap, ";}.", k, "-step-title{padding-right:0;padding-bottom:", steps.gap, ";}}&.", k, "-line,&.", k, "-line-compact,&.", k, "-simple{flex-direction:column;.", k, "-step{flex:none;min-height:", verticalLine.minHeight, ";}.", k, "-step-wrapper{display:flex;width:auto;text-align:left;}.", k, "-step-main{flex:1;padding:0 0 ", verticalLine.padding, " ", verticalLine.padding, ";}.", k, "-step-title{display:flex;align-items:center;height:", steps.line.markWidth, ";&:after{display:none;}}.", k, "-step-wrapper{&:before,&:after{display:none;}}.", k, "-step-tail{position:absolute;left:calc(", steps.line.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);height:100%;width:", steps.line.lineWidth, ";background:", steps.line.lineColor, ";}.", k, "-step:last-of-type{.", k, "-step-tail{display:none;}}}&.", k, "-simple{.", k, "-step-tail{left:calc(", steps.simple.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);}.", k, "-step-title{height:", steps.simple.markWidth, ";margin-bottom:", steps.vertical.simple.titleGap, ";}}}");
196
196
  }
@@ -28,6 +28,7 @@ export declare class Switch<True = true, False = false> extends Component<Switch
28
28
  static events: Events<SwitchEvents>;
29
29
  private elementRef;
30
30
  private draggable;
31
+ private config;
31
32
  private onClick;
32
33
  private onClickOnHandle;
33
34
  private onKeypress;
@@ -6,6 +6,7 @@ import template from './index.vdt';
6
6
  import { sizes } from '../../styles/utils';
7
7
  import { bind } from '../utils';
8
8
  import { useDraggable } from './useDraggable';
9
+ import { useConfigContext } from '../config';
9
10
  var typeDefs = {
10
11
  name: String,
11
12
  on: String,
@@ -47,6 +48,7 @@ export var Switch = /*#__PURE__*/function (_Component) {
47
48
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
48
49
  _this.elementRef = createRef();
49
50
  _this.draggable = useDraggable(_this.elementRef);
51
+ _this.config = useConfigContext();
50
52
  return _this;
51
53
  }
52
54
 
@@ -34,9 +34,8 @@ export default function ($props, $blocks, $__proto__) {
34
34
  dragging = _this$draggable.dragging,
35
35
  barRef = _this$draggable.barRef,
36
36
  barWidth = _this$draggable.barWidth;
37
- var classNameObj = (_classNameObj = {
38
- 'k-switch': true
39
- }, _classNameObj[className] = className, _classNameObj['k-checked'] = value === trueValue, _classNameObj["k-" + size] = true, _classNameObj['k-disabled'] = disabled, _classNameObj['k-dragging'] = dragging.value, _classNameObj[makeStyles()] = true, _classNameObj);
37
+ var k = this.config.k;
38
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-switch"] = true, _classNameObj[className] = className, _classNameObj[k + "-checked"] = value === trueValue, _classNameObj[k + "-" + size] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-dragging"] = dragging.value, _classNameObj[makeStyles(k)] = true, _classNameObj);
40
39
  var onStyle;
41
40
  var offStyle;
42
41
  var barStyle;
@@ -109,7 +108,7 @@ export default function ($props, $blocks, $__proto__) {
109
108
  };
110
109
 
111
110
  return block ? block.call($this, callBlock, data) : callBlock();
112
- }, __$blocks['off'](_$no)), 0, 'k-switch-off', {
111
+ }, __$blocks['off'](_$no)), 0, _$cn(k + "-switch-off"), {
113
112
  'style': offStyle
114
113
  }) : undefined, _$ce(2, 'div', [on || $blocks.on ? _$ce(2, 'div', (_$blocks['on'] = function ($super) {
115
114
  return on;
@@ -121,12 +120,12 @@ export default function ($props, $blocks, $__proto__) {
121
120
  };
122
121
 
123
122
  return block ? block.call($this, callBlock, data) : callBlock();
124
- }, __$blocks['on'](_$no)), 0, 'k-switch-on', {
123
+ }, __$blocks['on'](_$no)), 0, _$cn(k + "-switch-on"), {
125
124
  'style': onStyle
126
- }) : undefined, _$ce(2, 'div', _$ce(2, 'div', _$ce(2, 'img', null, 1, null, _$tmp0), 2, 'k-switch-handle', {
125
+ }) : undefined, _$ce(2, 'div', _$ce(2, 'div', _$ce(2, 'img', null, 1, null, _$tmp0), 2, _$cn(k + "-switch-handle"), {
127
126
  'ev-click': this.onClickOnHandle,
128
127
  'ev-mousedown': start
129
- }), 2, 'k-switch-wrapper')], 0, 'k-switch-bar', {
128
+ }), 2, _$cn(k + "-switch-wrapper"))], 0, _$cn(k + "-switch-bar"), {
130
129
  'style': barStyle
131
130
  }, null, barRef)]);
132
131
  }
@@ -1,2 +1,2 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(): string;
2
+ export declare function makeStyles(k: string): string;
@@ -72,12 +72,12 @@ setDefault(function () {
72
72
  switch: defaults
73
73
  }).switch;
74
74
  });
75
- export function makeStyles() {
76
- return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;transition:background ", kswitch.transition, ";input{opacity:0;position:absolute;}.k-switch-bar,.k-switch-off{box-sizing:border-box;}.k-switch-bar{position:absolute;text-align:right;overflow:hidden;}.k-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.k-switch-bar,.k-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}&:hover{&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.hoverBgColor, ";}}.k-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.k-switch-on,.k-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.k-dragging{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
75
+ export function makeStyles(k) {
76
+ return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;transition:background ", kswitch.transition, ";input{opacity:0;position:absolute;}.", k, "-switch-bar,.", k, "-switch-off{box-sizing:border-box;}.", k, "-switch-bar{position:absolute;text-align:right;overflow:hidden;}.", k, "-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.", k, "-switch-bar,.", k, "-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}&:hover{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.hoverBgColor, ";}}.", k, "-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.", k, "-switch-on,.", k, "-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.", k, "-dragging{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
77
77
  var _kswitch$size = kswitch[size],
78
78
  width = _kswitch$size.width,
79
79
  height = _kswitch$size.height,
80
80
  padding = _kswitch$size.padding;
81
- return /*#__PURE__*/css("&.k-", size, ",&.k-", size, " .k-switch-on,&.k-", size, " .k-switch-off{width:", width, ";height:", height, ";}&.k-", size, "{border-radius:", height, ";.k-switch-bar{width:", height, ";border-radius:", height, ";}.k-switch-wrapper{padding:", padding, ";}.k-switch-on,.k-switch-off{line-height:", height, ";left:0;}.k-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.k-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}}");
82
- }), "&.k-checked{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.bgColor, ";}.k-switch-bar{width:100%;}&:hover{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.hoverBgColor, ";}}}&.k-disabled{&,.k-switch-handle{cursor:not-allowed;}&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.disabledBgColor, ";}&.k-checked{&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.disabledBgColor, ";}}}");
81
+ return /*#__PURE__*/css("&.", k, "-", size, ",&.", k, "-", size, " .", k, "-switch-on,&.", k, "-", size, " .", k, "-switch-off{width:", width, ";height:", height, ";}&.", k, "-", size, "{border-radius:", height, ";.", k, "-switch-bar{width:", height, ";border-radius:", height, ";}.", k, "-switch-wrapper{padding:", padding, ";}.", k, "-switch-on,.", k, "-switch-off{line-height:", height, ";left:0;}.", k, "-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.", k, "-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}}");
82
+ }), "&.", k, "-checked{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";}.", k, "-switch-bar{width:100%;}&:hover{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.hoverBgColor, ";}}}&.", k, "-disabled{&,.", k, "-switch-handle{cursor:not-allowed;}&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.disabledBgColor, ";}&.", k, "-checked{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.disabledBgColor, ";}}}");
83
83
  }
@@ -18,5 +18,6 @@ export interface TableCellProps {
18
18
  }
19
19
  export declare class TableCell extends Component<TableCellProps> {
20
20
  static template: string | import("intact").Template<any>;
21
+ private config;
21
22
  $update(lastVNode: VNodeComponentClass<this>, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[], force: boolean): void;
22
23
  }
@@ -1,11 +1,23 @@
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 './cell.vdt';
5
+ import { useConfigContext } from '../config';
4
6
  export var TableCell = /*#__PURE__*/function (_Component) {
5
7
  _inheritsLoose(TableCell, _Component);
6
8
 
7
9
  function TableCell() {
8
- return _Component.apply(this, arguments) || this;
10
+ var _context;
11
+
12
+ var _this;
13
+
14
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
+ args[_key] = arguments[_key];
16
+ }
17
+
18
+ _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
19
+ _this.config = useConfigContext();
20
+ return _this;
9
21
  }
10
22
 
11
23
  var _proto = TableCell.prototype;
@@ -4,10 +4,6 @@ import { get, noop } from 'intact-shared';
4
4
  import { Button } from '../button';
5
5
  import { Icon } from '../icon';
6
6
  import { getTextByChildren } from '../utils';
7
- var _$tmp0 = {
8
- 'className': 'k-icon-right',
9
- 'size': 'small'
10
- };
11
7
  export default function ($props, $blocks, $__proto__) {
12
8
  $blocks || ($blocks = {});
13
9
  $props || ($props = {});
@@ -27,6 +23,7 @@ export default function ($props, $blocks, $__proto__) {
27
23
  onClickArrow = _this$get.onClickArrow,
28
24
  hasChildren = _this$get.hasChildren;
29
25
 
26
+ var k = this.config.k;
30
27
  var blocks = props.$blocks;
31
28
  var children = get(data, props.key);
32
29
 
@@ -52,9 +49,12 @@ export default function ($props, $blocks, $__proto__) {
52
49
  'icon': true,
53
50
  'circle': true,
54
51
  'size': 'mini',
55
- 'className': 'k-table-arrow',
52
+ 'className': _$cn(k + "-table-arrow"),
56
53
  'ev-click': onClickArrow,
57
- 'children': _$cc(Icon, _$tmp0)
54
+ 'children': _$cc(Icon, {
55
+ 'className': _$cn(k + "-icon-right"),
56
+ 'size': 'small'
57
+ })
58
58
  }) : undefined, children], 0, _$cn(className), {
59
59
  'style': style,
60
60
  'title': getTextByChildren(children),
@@ -32,4 +32,5 @@ export declare class TableColumn<T = any> extends Component<TableColumnProps, Ta
32
32
  static typeDefs: Required<TypeDefs<TableColumnProps>>;
33
33
  elementRef: import("intact").RefObject<HTMLElement>;
34
34
  private group;
35
+ private config;
35
36
  }
@@ -3,6 +3,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
3
3
  import { Component, VNode, createRef } from 'intact-react';
4
4
  import template from './column.vdt';
5
5
  import { useGroup } from './useGroup';
6
+ import { useConfigContext } from '../config';
6
7
  var typeDefs = {
7
8
  key: {
8
9
  type: String,
@@ -39,6 +40,7 @@ export var TableColumn = /*#__PURE__*/function (_Component) {
39
40
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
40
41
  _this.elementRef = createRef();
41
42
  _this.group = useGroup();
43
+ _this.config = useConfigContext();
42
44
  return _this;
43
45
  }
44
46
 
@@ -1,5 +1,5 @@
1
1
  import _sortInstanceProperty from "@babel/runtime-corejs3/core-js/instance/sort";
2
- import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, noop as _$no, className as _$cn, extend as _$ex, EMPTY_OBJ as _$em, map as _$ma } from 'intact-react';
2
+ import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, className as _$cn, noop as _$no, extend as _$ex, EMPTY_OBJ as _$em, map as _$ma } from 'intact-react';
3
3
  import { getClassAndStyleForFixed } from './useFixedColumns';
4
4
  import { Dropdown, DropdownMenu, DropdownItem } from '../dropdown';
5
5
  import { Button } from '../button';
@@ -16,17 +16,6 @@ import { context as FixedColumnsContext } from './useFixedColumns';
16
16
  import { stopPropagation } from '../utils';
17
17
  import { Input } from '../input';
18
18
  import { _$ } from '../../i18n';
19
- var _$tmp0 = {
20
- 'className': 'k-icon-search'
21
- };
22
- var _$tmp1 = {
23
- 'className': 'k-icon-up k-asc',
24
- 'size': 'mini'
25
- };
26
- var _$tmp2 = {
27
- 'className': 'k-icon-down k-desc',
28
- 'size': 'mini'
29
- };
30
19
  export default function ($props, $blocks, $__proto__) {
31
20
  var _this = this;
32
21
 
@@ -57,6 +46,7 @@ export default function ($props, $blocks, $__proto__) {
57
46
  dropdownRef = _this$group.dropdownRef,
58
47
  localGroupValue = _this$group.localGroupValue,
59
48
  isEmptyValue = _this$group.isEmptyValue;
49
+ var k = this.config.k;
60
50
  return _$cc(TableContext.Consumer, {
61
51
  'children': function children(checkType) {
62
52
  return _$cc(GroupContext.Consumer, {
@@ -74,19 +64,17 @@ export default function ($props, $blocks, $__proto__) {
74
64
  onStart = _ref3.onStart;
75
65
  return _$cc(FixedColumnsContext.Consumer, {
76
66
  'children': function children(offsetMap) {
77
- var _classNameObj, _$cn2, _$cn3;
67
+ var _classNameObj, _$cn2, _$cn4;
78
68
 
79
69
  var _getClassAndStyleForF = getClassAndStyleForFixed(_this.get(), offsetMap[key], checkType),
80
70
  className = _getClassAndStyleForF.className,
81
71
  style = _getClassAndStyleForF.style;
82
72
 
83
- var classNameObj = (_classNameObj = {
84
- 'k-column-sortable': sortable
85
- }, _classNameObj[className] = className, _classNameObj);
73
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-column-sortable"] = sortable, _classNameObj[className] = className, _classNameObj);
86
74
  var groupValue = currentGroup && currentGroup[key];
87
75
  var type = sort && sort.key === key && sort.type;
88
76
  var checked;
89
- return _$ce(2, 'th', [resizable && _this.$vNode.props.prevVNode ? _$ce(2, 'div', null, 1, 'k-table-resize', {
77
+ return _$ce(2, 'th', [resizable && _this.$vNode.props.prevVNode ? _$ce(2, 'div', null, 1, _$cn(k + "-table-resize"), {
90
78
  'ev-mousedown': function evMousedown(e) {
91
79
  e._vNode = _this.$vNode;
92
80
  onStart(e);
@@ -101,7 +89,7 @@ export default function ($props, $blocks, $__proto__) {
101
89
  };
102
90
 
103
91
  return block ? block.call($this, callBlock, data) : callBlock();
104
- }, __$blocks['title'](_$no)), 0, 'k-table-title-text c-ellipsis'), group ? _$cc(Dropdown, {
92
+ }, __$blocks['title'](_$no)), 0, _$cn(k + "-table-title-text c-ellipsis")), group ? _$cc(Dropdown, {
105
93
  'position': {
106
94
  my: 'center top',
107
95
  at: 'center bottom+5',
@@ -114,16 +102,14 @@ export default function ($props, $blocks, $__proto__) {
114
102
  },
115
103
  'ref': dropdownRef,
116
104
  'children': [_$cc(Icon, {
117
- 'className': 'k-icon-down-squared k-table-group',
105
+ 'className': _$cn(k + "-icon-down-squared " + k + "-table-group"),
118
106
  'ev-click': function evClick(e) {
119
107
  return e._ignoreSortable = true;
120
108
  },
121
109
  'hoverable': true,
122
110
  'color': isEmptyValue(groupValue) ? null : 'primary'
123
111
  }), _$cc(DropdownMenu, {
124
- 'className': _$cn((_$cn2 = {
125
- "k-table-group-dropdown": true
126
- }, _$cn2[makeGroupMenuStyles()] = true, _$cn2)),
112
+ 'className': _$cn((_$cn2 = {}, _$cn2[k + "-table-group-dropdown"] = true, _$cn2[makeGroupMenuStyles(k)] = true, _$cn2)),
127
113
  'children': [_$ce(2, 'div', _$cc(Input, {
128
114
  'size': 'small',
129
115
  'fluid': true,
@@ -136,7 +122,9 @@ export default function ($props, $blocks, $__proto__) {
136
122
  __$blocks = _$ex({}, $blocks);
137
123
 
138
124
  return (_$blocks['suffix'] = function ($super) {
139
- return _$cc(Icon, _$tmp0);
125
+ return _$cc(Icon, {
126
+ 'className': _$cn(k + "-icon-search")
127
+ });
140
128
  }, __$blocks['suffix'] = function ($super, data) {
141
129
  var block = $blocks['suffix'];
142
130
 
@@ -147,21 +135,21 @@ export default function ($props, $blocks, $__proto__) {
147
135
  return block ? block.call($this, callBlock, data) : callBlock();
148
136
  }), __$blocks;
149
137
  }.call($this, _$em)
150
- }), 2, 'k-table-group-header'), _$ce(2, 'div', _$ma(filteredGroup.value, function ($value, $key) {
138
+ }), 2, _$cn(k + "-table-group-header")), _$ce(2, 'div', _$ma(filteredGroup.value, function ($value, $key) {
139
+ var _$cn3;
140
+
151
141
  return _$cc(DropdownItem, {
152
142
  'ev-select': function evSelect() {
153
143
  return onSelect($value.value, onChange);
154
144
  },
155
145
  'hideOnSelect': !multiple,
156
- 'className': _$cn({
157
- 'k-active': checked = isChecked($value.value)
158
- }),
146
+ 'className': _$cn((_$cn3 = {}, _$cn3[k + "-active"] = checked = isChecked($value.value), _$cn3)),
159
147
  'children': multiple ? _$cc(Checkbox, {
160
148
  'value': checked,
161
149
  'children': $value.label
162
150
  }) : _$ce(2, 'span', $value.label, 0)
163
151
  });
164
- }, $this), 4, 'k-table-group-body'), multiple ? _$ce(2, 'div', [_$cc(Button, {
152
+ }, $this), 4, _$cn(k + "-table-group-body")), multiple ? _$ce(2, 'div', [_$cc(Button, {
165
153
  'size': 'small',
166
154
  'disabled': isEmptyValue(localGroupValue.value),
167
155
  'type': 'secondary',
@@ -176,11 +164,15 @@ export default function ($props, $blocks, $__proto__) {
176
164
  return confirm(onChange);
177
165
  },
178
166
  'children': '确定'
179
- })], 4, 'k-table-group-footer') : undefined]
167
+ })], 4, _$cn(k + "-table-group-footer")) : undefined]
180
168
  })]
181
- }, 'dropdown', dropdownRef) : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, _$tmp1), _$cc(Icon, _$tmp2)], 4, _$cn((_$cn3 = {
182
- 'k-column-sort': true
183
- }, _$cn3["k-" + type] = type, _$cn3))) : undefined], 0, 'k-table-title')], 0, _$cn(classNameObj), {
169
+ }, 'dropdown', dropdownRef) : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, {
170
+ 'className': _$cn(k + "-icon-up " + k + "-asc"),
171
+ 'size': 'mini'
172
+ }), _$cc(Icon, {
173
+ 'className': _$cn(k + "-icon-down " + k + "-desc"),
174
+ 'size': 'mini'
175
+ })], 4, _$cn((_$cn4 = {}, _$cn4[k + "-column-sort"] = true, _$cn4[k + "-" + type] = type, _$cn4))) : undefined], 0, _$cn(k + "-table-title"))], 0, _$cn(classNameObj), {
184
176
  'style': style,
185
177
  'title': isStringOrNumber(title) ? title : null,
186
178
  'ev-click': sortable ? linkEvent(key, onChangeSort) : null,
@@ -1141,7 +1141,7 @@ describe('Table', function () {
1141
1141
  table = instance.refs.table;
1142
1142
  pagination = table.pagination.paginationRef;
1143
1143
  spy = sinon.spy();
1144
- table.on('changePage', spy); // check all
1144
+ table.on('page', spy); // check all
1145
1145
 
1146
1146
  table.checkAll();
1147
1147
  expect(table.getCheckedData()).to.have.length(10); // next page
@@ -33,6 +33,7 @@ export interface TableRowProps {
33
33
  declare type DragCallback = (e: MouseEvent, tableRow: TableRow) => void;
34
34
  export declare class TableRow extends Component<TableRowProps> {
35
35
  static template: string | import("intact").Template<any>;
36
+ private config;
36
37
  $update(lastVNode: VNodeComponentClass<this>, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[], force: boolean): void;
37
38
  onClick(e: MouseEvent): void;
38
39
  onChangeChecked(v: boolean): void;
@@ -1,13 +1,26 @@
1
1
  import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
2
3
  import { __decorate } from "tslib";
3
4
  import { Component } from 'intact-react';
4
5
  import template from './row.vdt';
5
6
  import { bind } from '../utils';
7
+ import { isEqualObject } from '../utils';
8
+ import { useConfigContext } from '../config';
6
9
  export var TableRow = /*#__PURE__*/function (_Component) {
7
10
  _inheritsLoose(TableRow, _Component);
8
11
 
9
12
  function TableRow() {
10
- return _Component.apply(this, arguments) || this;
13
+ var _context;
14
+
15
+ var _this;
16
+
17
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18
+ args[_key] = arguments[_key];
19
+ }
20
+
21
+ _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
22
+ _this.config = useConfigContext();
23
+ return _this;
11
24
  }
12
25
 
13
26
  var _proto = TableRow.prototype;
@@ -21,8 +34,14 @@ export var TableRow = /*#__PURE__*/function (_Component) {
21
34
  for (key in lastProps) {
22
35
  // ignore index
23
36
  if (key === 'index') continue;
37
+ var lastValue = lastProps[key];
38
+ var nextValue = nextProps[key]; // deeply compare for offsetMap
39
+
40
+ if (key === 'offsetMap' && isEqualObject(lastValue, nextValue)) {
41
+ continue;
42
+ }
24
43
 
25
- if (lastProps[key] !== nextProps[key]) {
44
+ if (lastValue !== nextValue) {
26
45
  isSame = false;
27
46
  break;
28
47
  }
@@ -37,15 +37,8 @@ export default function ($props, $blocks, $__proto__) {
37
37
  draggingKey = _this$get.draggingKey,
38
38
  animation = _this$get.animation;
39
39
 
40
- var classNameObj = (_classNameObj = {
41
- 'k-disabled': disabled,
42
- 'k-checked': checked,
43
- 'k-selected': selected,
44
-
45
- /* 'k-hidden': hidden, */
46
- 'k-spreaded': spreaded,
47
- 'k-dragging': draggingKey === key
48
- }, _classNameObj[className] = className, _classNameObj);
40
+ var k = this.config.k;
41
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-checked"] = checked, _classNameObj[k + "-selected"] = selected, _classNameObj[k + "-spreaded"] = spreaded, _classNameObj[k + "-dragging"] = draggingKey === key, _classNameObj[className] = className, _classNameObj);
49
42
 
50
43
  var getGridItem = function getGridItem(columnIndex) {
51
44
  var _grid$rowIndex;
@@ -68,7 +61,7 @@ export default function ($props, $blocks, $__proto__) {
68
61
  'key': '$checktype'
69
62
  }, getClassAndStyleForFixed({
70
63
  fixed: hasFixedLeft ? 'left' : false,
71
- className: 'k-table-check'
64
+ className: [k + "-table-check"]
72
65
  }, 0), spans), children));
73
66
  };
74
67
 
@@ -1,3 +1,3 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(): string;
3
- export declare function makeGroupMenuStyles(): string;
2
+ export declare function makeStyles(k: string): string;
3
+ export declare function makeGroupMenuStyles(k: string): string;