@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
@@ -5,30 +5,6 @@ import { Icon } from '../icon';
5
5
  import { _$ } from '../../i18n';
6
6
  import { makeCalendarStyles } from './styles';
7
7
  import { getNowDate } from './helpers';
8
- var _$tmp0 = {
9
- 'className': 'k-icon-left',
10
- 'size': 'small'
11
- };
12
- var _$tmp1 = {
13
- 'className': 'k-icon-left',
14
- 'size': 'small'
15
- };
16
- var _$tmp2 = {
17
- 'className': 'k-icon-left',
18
- 'size': 'small'
19
- };
20
- var _$tmp3 = {
21
- 'className': 'k-icon-right',
22
- 'size': 'small'
23
- };
24
- var _$tmp4 = {
25
- 'className': 'k-icon-right',
26
- 'size': 'small'
27
- };
28
- var _$tmp5 = {
29
- 'className': 'k-icon-right',
30
- 'size': 'small'
31
- };
32
8
  export default function ($props, $blocks, $__proto__) {
33
9
  var _classNameObj;
34
10
 
@@ -38,9 +14,8 @@ export default function ($props, $blocks, $__proto__) {
38
14
  var type = this.type.value;
39
15
  var isYear = type === 'year';
40
16
  var isYearOrMonth = isYear || type === 'month';
41
- var classNameObj = (_classNameObj = {
42
- 'k-datepicker-calendar': true
43
- }, _classNameObj[makeCalendarStyles()] = true, _classNameObj);
17
+ var k = this.config.k;
18
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-datepicker-calendar"] = true, _classNameObj[makeCalendarStyles(k)] = true, _classNameObj);
44
19
  var now = getNowDate();
45
20
  var _this$datepicker$focu = this.datepicker.focusDate,
46
21
  focusDate = _this$datepicker$focu.focusDate,
@@ -48,15 +23,9 @@ export default function ($props, $blocks, $__proto__) {
48
23
 
49
24
  var getItems = function getItems(data, onClick) {
50
25
  return _$ma(data, function ($value, $key) {
51
- return _$ce(2, 'div', _$ce(2, 'div', $value.label, 0, 'k-value'), 2, _$cn({
52
- "k-calendar-item": true,
53
- "k-exceed": $value.isExceed,
54
- "k-active": $value.isActive,
55
- "k-today": $value.isToday,
56
- "k-disabled": $value.isDisabled,
57
- "k-hover": $value.isHover,
58
- "k-in-range": $value.isInRange
59
- }), {
26
+ var _$cn2;
27
+
28
+ return _$ce(2, 'div', _$ce(2, 'div', $value.label, 0, _$cn(k + "-value")), 2, _$cn((_$cn2 = {}, _$cn2[k + "-calendar-item"] = true, _$cn2[k + "-exceed"] = $value.isExceed, _$cn2[k + "-active"] = $value.isActive, _$cn2[k + "-today"] = $value.isToday, _$cn2[k + "-disabled"] = $value.isDisabled, _$cn2[k + "-hover"] = $value.isHover, _$cn2[k + "-in-range"] = $value.isInRange, _$cn2)), {
60
29
  'ev-click': !$value.isDisabled ? function (e) {
61
30
  e._ignore = true;
62
31
  onClick($value.value);
@@ -83,43 +52,61 @@ export default function ($props, $blocks, $__proto__) {
83
52
  'icon': true,
84
53
  'type': 'none',
85
54
  'size': 'small',
86
- 'className': 'k-prev',
55
+ 'className': _$cn(k + "-prev"),
87
56
  'tagName': 'div',
88
57
  'ev-click': isYear ? prevTenYears : prevYear,
89
- 'children': [_$cc(Icon, _$tmp0), _$cc(Icon, _$tmp1)]
58
+ 'children': [_$cc(Icon, {
59
+ 'className': _$cn(k + "-icon-left"),
60
+ 'size': 'small'
61
+ }), _$cc(Icon, {
62
+ 'className': _$cn(k + "-icon-left"),
63
+ 'size': 'small'
64
+ })]
90
65
  }), !isYearOrMonth ? _$cc(Button, {
91
66
  'icon': true,
92
67
  'type': 'none',
93
68
  'size': 'small',
94
- 'className': 'k-prev',
69
+ 'className': _$cn(k + "-prev"),
95
70
  'tagName': 'div',
96
71
  'ev-click': prevMonth,
97
- 'children': _$cc(Icon, _$tmp2)
98
- }) : undefined], 0, 'k-left-btns'), _$ce(2, 'div', !isYear ? _$ma(getDateLabel(), function ($value, $key) {
99
- return _$ce(2, 'span', $value.value, 0, 'k-month-value', {
72
+ 'children': _$cc(Icon, {
73
+ 'className': _$cn(k + "-icon-left"),
74
+ 'size': 'small'
75
+ })
76
+ }) : undefined], 0, _$cn(k + "-left-btns")), _$ce(2, 'div', !isYear ? _$ma(getDateLabel(), function ($value, $key) {
77
+ return _$ce(2, 'span', $value.value, 0, _$cn(k + "-month-value"), {
100
78
  'ev-click': $value.onClick
101
79
  });
102
- }, $this) : _$ce(2, 'span', this.years.getYearLabel(), 0, 'k-month-value'), 0, 'k-month-values'), _$ce(2, 'div', [!isYearOrMonth ? _$cc(Button, {
80
+ }, $this) : _$ce(2, 'span', this.years.getYearLabel(), 0, _$cn(k + "-month-value")), 0, _$cn(k + "-month-values")), _$ce(2, 'div', [!isYearOrMonth ? _$cc(Button, {
103
81
  'icon': true,
104
82
  'type': 'none',
105
83
  'size': 'small',
106
- 'className': 'k-next',
84
+ 'className': _$cn(k + "-next"),
107
85
  'tagName': 'div',
108
86
  'ev-click': nextMonth,
109
- 'children': _$cc(Icon, _$tmp3)
87
+ 'children': _$cc(Icon, {
88
+ 'className': _$cn(k + "-icon-right"),
89
+ 'size': 'small'
90
+ })
110
91
  }) : undefined, _$cc(Button, {
111
92
  'icon': true,
112
93
  'type': 'none',
113
94
  'size': 'small',
114
- 'className': 'k-next',
95
+ 'className': _$cn(k + "-next"),
115
96
  'tagName': 'div',
116
97
  'ev-click': isYear ? nextTenYears : nextYear,
117
- 'children': [_$cc(Icon, _$tmp4), _$cc(Icon, _$tmp5)]
118
- })], 0, 'k-right-btns')], 4, 'k-datepicker-month'), !isYearOrMonth ? [_$ce(2, 'div', _$ma([_$('日'), _$('一'), _$('二'), _$('三'), _$('四'), _$('五'), _$('六')], function ($value, $key) {
119
- return _$ce(2, 'div', $value, 0, 'k-weekday');
120
- }, $this), 4, 'k-weekdays'), _$ce(2, 'div', getItems(getDays(now), onClickDay), 0, 'k-days', {
98
+ 'children': [_$cc(Icon, {
99
+ 'className': _$cn(k + "-icon-right"),
100
+ 'size': 'small'
101
+ }), _$cc(Icon, {
102
+ 'className': _$cn(k + "-icon-right"),
103
+ 'size': 'small'
104
+ })]
105
+ })], 0, _$cn(k + "-right-btns"))], 4, _$cn(k + "-datepicker-month")), !isYearOrMonth ? [_$ce(2, 'div', _$ma([_$('日'), _$('一'), _$('二'), _$('三'), _$('四'), _$('五'), _$('六')], function ($value, $key) {
106
+ return _$ce(2, 'div', $value, 0, _$cn(k + "-weekday"));
107
+ }, $this), 4, _$cn(k + "-weekdays")), _$ce(2, 'div', getItems(getDays(now), onClickDay), 0, _$cn(k + "-days"), {
121
108
  'ev-mouseleave': resetFocusDate
122
- })] : _$ce(2, 'div', isYear ? getItems(this.years.getYears(now), this.years.onClick) : getItems(this.months.getMonths(now), this.months.onClick), 0, 'k-years', {
109
+ })] : _$ce(2, 'div', isYear ? getItems(this.years.getYears(now), this.years.onClick) : getItems(this.months.getMonths(now), this.months.onClick), 0, _$cn(k + "-years"), {
123
110
  'ev-mouseleave': resetFocusDate
124
111
  })], 0, _$cn(classNameObj));
125
112
  }
@@ -1,5 +1,5 @@
1
1
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
2
- import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, className as _$cn, createTextVNode as _$ct } from 'intact-react';
2
+ import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, createTextVNode as _$ct } from 'intact-react';
3
3
  import { linkEvent } from 'intact';
4
4
  import { DropdownMenu } from '../dropdown';
5
5
  import { DatepickerCalendar } from './calendar';
@@ -11,12 +11,6 @@ import { makePanelStyles } from './styles';
11
11
  import { PanelTypes, PanelFlags } from './usePanel';
12
12
  import { isFunction } from 'intact-shared';
13
13
  import { Tabs, Tab } from '../tabs';
14
- var _$tmp0 = {
15
- 'className': 'k-datepicker'
16
- };
17
- var _$tmp1 = {
18
- 'className': 'k-icon-calendar'
19
- };
20
14
  export default function ($props, $blocks, $__proto__) {
21
15
  var _classNameObj,
22
16
  _this = this;
@@ -39,9 +33,8 @@ export default function ($props, $blocks, $__proto__) {
39
33
  onChangeTime = _this$value.onChangeTime,
40
34
  onChangeDateForRange = _this$value.onChangeDateForRange,
41
35
  getTimeValue = _this$value.getTimeValue;
42
- var classNameObj = (_classNameObj = {
43
- 'k-datepicker-content': true
44
- }, _classNameObj[className] = className, _classNameObj[makePanelStyles()] = true, _classNameObj);
36
+ var k = this.config.k;
37
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-datepicker-content"] = true, _classNameObj[className] = className, _classNameObj[makePanelStyles(k)] = true, _classNameObj);
45
38
  var _this$disabled = this.disabled,
46
39
  isDisabledTime = _this$disabled.isDisabledTime,
47
40
  isDisabledConfirm = _this$disabled.isDisabledConfirm;
@@ -95,10 +88,12 @@ export default function ($props, $blocks, $__proto__) {
95
88
  'format': _this.formats.getValueFormat(),
96
89
  'flag': flag,
97
90
  'isDisabledTime': isDisabledTime
98
- })], 0, 'k-datepicker-calendar-wrapper');
91
+ })], 0, _$cn(k + "-datepicker-calendar-wrapper"));
99
92
  };
100
93
 
101
- return _$su.call($this, _$tmp0, function ($blocks) {
94
+ return _$su.call($this, {
95
+ 'className': _$cn(k + "-datepicker")
96
+ }, function ($blocks) {
102
97
  var _$blocks = {},
103
98
  __$blocks = _$ex({}, $blocks);
104
99
 
@@ -109,17 +104,17 @@ export default function ($props, $blocks, $__proto__) {
109
104
  'className': _$cn(classNameObj),
110
105
  'children': [shortcuts && shortcuts.length ? _$ce(2, 'div', _mapInstanceProperty(shortcuts).call(shortcuts, function ($value) {
111
106
  var label = isFunction($value.label) ? $value.label() : $value.label;
112
- return _$ce(2, 'div', label, 0, 'k-datepicker-shortcut c-ellipsis', {
107
+ return _$ce(2, 'div', label, 0, _$cn(k + "-datepicker-shortcut c-ellipsis"), {
113
108
  'title': label,
114
109
  'ev-click': linkEvent($value, _this2.setByShortcut)
115
110
  });
116
- }), 0, 'k-datepicker-shortcuts') : undefined, _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, 'k-datepicker-calendars'), type === 'datetime' ? _$ce(2, 'div', _$cc(Button, {
111
+ }), 0, _$cn(k + "-datepicker-shortcuts")) : undefined, _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, _$cn(k + "-datepicker-calendars")), type === 'datetime' ? _$ce(2, 'div', _$cc(Button, {
117
112
  'type': 'primary',
118
113
  'size': 'small',
119
114
  'disabled': isDisabledConfirm(),
120
115
  'ev-click': onConfirm,
121
116
  'children': _$('确定')
122
- }), 2, 'k-datepicker-footer') : undefined], 0, 'k-datepicker-wrapper')]
117
+ }), 2, _$cn(k + "-datepicker-footer")) : undefined], 0, _$cn(k + "-datepicker-wrapper"))]
123
118
  });
124
119
  }, __$blocks['base-menu'] = function ($super, data) {
125
120
  var block = $blocks['base-menu'];
@@ -130,7 +125,9 @@ export default function ($props, $blocks, $__proto__) {
130
125
 
131
126
  return block ? block.call($this, callBlock, data) : callBlock();
132
127
  }), (_$blocks['suffix'] = function ($super) {
133
- return _$cc(Icon, _$tmp1);
128
+ return _$cc(Icon, {
129
+ 'className': _$cn(k + "-icon-calendar")
130
+ });
134
131
  }, __$blocks['suffix'] = function ($super, data) {
135
132
  var block = $blocks['suffix'];
136
133
 
@@ -46,6 +46,6 @@ declare const defaults: {
46
46
  };
47
47
  declare let datepicker: typeof defaults;
48
48
  export { datepicker };
49
- export declare function makePanelStyles(): string;
50
- export declare function makeCalendarStyles(): string;
51
- export declare function makeTimeStyles(): string;
49
+ export declare function makePanelStyles(k: string): string;
50
+ export declare function makeCalendarStyles(k: string): string;
51
+ export declare function makeTimeStyles(k: string): string;
@@ -79,12 +79,12 @@ setDefault(function () {
79
79
  }).datepicker;
80
80
  });
81
81
  export { datepicker };
82
- export function makePanelStyles() {
83
- return /*#__PURE__*/css("display:flex;.k-datepicker-shortcuts{width:", datepicker.shortcuts.width, ";padding:", datepicker.shortcuts.padding, ";border-right:", datepicker.border, ";}.k-datepicker-shortcut{height:", datepicker.shortcuts.shortcut.height, ";line-height:", datepicker.shortcuts.shortcut.height, ";padding:", datepicker.shortcuts.shortcut.padding, ";cursor:pointer;&:hover{background:", datepicker.shortcuts.shortcut.hoverBgcolor, ";}}.k-datepicker-calendars{display:flex;}.k-datepicker-calendar-wrapper{&:nth-child(2){border-left:", datepicker.border, ";}.k-tabs{border:none;.k-tabs-wrapper{float:none;}.k-tab{width:50%;}}}.k-datepicker-footer{border-top:", datepicker.border, ";padding:", datepicker.footer.padding, ";text-align:right;}");
82
+ export function makePanelStyles(k) {
83
+ return /*#__PURE__*/css("display:flex;.", k, "-datepicker-shortcuts{width:", datepicker.shortcuts.width, ";padding:", datepicker.shortcuts.padding, ";border-right:", datepicker.border, ";}.", k, "-datepicker-shortcut{height:", datepicker.shortcuts.shortcut.height, ";line-height:", datepicker.shortcuts.shortcut.height, ";padding:", datepicker.shortcuts.shortcut.padding, ";cursor:pointer;&:hover{background:", datepicker.shortcuts.shortcut.hoverBgcolor, ";}}.", k, "-datepicker-calendars{display:flex;}.", k, "-datepicker-calendar-wrapper{&:nth-child(2){border-left:", datepicker.border, ";}.", k, "-tabs{border:none;.", k, "-tabs-wrapper{float:none;}.", k, "-tab{width:50%;}}}.", k, "-datepicker-footer{border-top:", datepicker.border, ";padding:", datepicker.footer.padding, ";text-align:right;}");
84
84
  }
85
- export function makeCalendarStyles() {
86
- return /*#__PURE__*/css("padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-datepicker-month{display:flex;padding:", datepicker.month.padding, ";}.k-prev .k-icon,.k-next .k-icon{margin:0 -5px!important;}.k-month-values{flex:1;font-size:14px;text-align:center;cursor:pointer;overflow:hidden;position:relative;}.k-month-value{margin:0 ", datepicker.month.valueGap, ";line-height:", theme.small.height, ";&:hover{color:", theme.color.primary, ";}},.k-weekdays{display:flex;border-bottom:", datepicker.border, ";padding:", datepicker.weekday.padding, ";}.k-weekday{flex:1;text-align:center;}.k-calendar-item{text-align:center;margin:", datepicker.item.gutter, ";aspect-ratio:1;display:flex;align-items:center;cursor:pointer;position:relative;border-radius:", datepicker.item.borderRadius, ";.k-value{border-radius:", datepicker.item.borderRadius, ";}&.k-hover{background:", datepicker.item.hoverBgColor, ";}&.k-exceed{color:", datepicker.item.exceedColor, ";}&.k-today .k-value{border:", datepicker.item.todayBorder, ";}&.k-active{background:", datepicker.item.active.bgColor, ";color:", datepicker.item.active.color, ";&.k-today .k-value{border-color:", datepicker.item.active.todayBorderColor, ";}}&.k-disabled{color:", datepicker.item.disabled.color, ";cursor:not-allowed;background:", datepicker.item.disabled.hoverBgColor, ";}&.k-in-range:after{content:'';display:block;position:absolute;box-sizing:content-box;background:", datepicker.item.range.bgColor, ";width:100%;height:100%;left:-", datepicker.item.gutter, ";padding:0 ", datepicker.item.gutter, ";z-index:-1;}.k-value{flex:1;display:flex;align-items:center;justify-content:center;height:100%;}}.k-days{display:grid;grid-template-columns:repeat(7, 1fr);}.k-years{display:grid;grid-template-columns:repeat(4, 1fr);}");
85
+ export function makeCalendarStyles(k) {
86
+ return /*#__PURE__*/css("padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.", k, "-datepicker-month{display:flex;padding:", datepicker.month.padding, ";}.", k, "-prev .", k, "-icon,.", k, "-next .", k, "-icon{margin:0 -5px!important;}.", k, "-month-values{flex:1;font-size:14px;text-align:center;cursor:pointer;overflow:hidden;position:relative;}.", k, "-month-value{margin:0 ", datepicker.month.valueGap, ";line-height:", theme.small.height, ";&:hover{color:", theme.color.primary, ";}},.", k, "-weekdays{display:flex;border-bottom:", datepicker.border, ";padding:", datepicker.weekday.padding, ";}.", k, "-weekday{flex:1;text-align:center;}.", k, "-calendar-item{text-align:center;margin:", datepicker.item.gutter, ";aspect-ratio:1;display:flex;align-items:center;cursor:pointer;position:relative;border-radius:", datepicker.item.borderRadius, ";.", k, "-value{border-radius:", datepicker.item.borderRadius, ";}&.", k, "-hover{background:", datepicker.item.hoverBgColor, ";}&.", k, "-exceed{color:", datepicker.item.exceedColor, ";}&.", k, "-today .", k, "-value{border:", datepicker.item.todayBorder, ";}&.", k, "-active{background:", datepicker.item.active.bgColor, ";color:", datepicker.item.active.color, ";&.", k, "-today .", k, "-value{border-color:", datepicker.item.active.todayBorderColor, ";}}&.", k, "-disabled{color:", datepicker.item.disabled.color, ";cursor:not-allowed;background:", datepicker.item.disabled.hoverBgColor, ";}&.", k, "-in-range:after{content:'';display:block;position:absolute;box-sizing:content-box;background:", datepicker.item.range.bgColor, ";width:100%;height:100%;left:-", datepicker.item.gutter, ";padding:0 ", datepicker.item.gutter, ";z-index:-1;}.", k, "-value{flex:1;display:flex;align-items:center;justify-content:center;height:100%;}}.", k, "-days{display:grid;grid-template-columns:repeat(7, 1fr);}.", k, "-years{display:grid;grid-template-columns:repeat(4, 1fr);}");
87
87
  }
88
- export function makeTimeStyles() {
89
- return /*#__PURE__*/css("display:flex;padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-scroll-select{flex:1;height:305px;}");
88
+ export function makeTimeStyles(k) {
89
+ return /*#__PURE__*/css("display:flex;padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.", k, "-scroll-select{flex:1;height:305px;}");
90
90
  }
@@ -21,6 +21,7 @@ export declare class DatepickerTime extends Component<DatepickerTimeProps> {
21
21
  disableHours: import("../../hooks/useState").State<boolean>;
22
22
  disableItem: (v: number, type: keyof Value) => boolean;
23
23
  };
24
+ private config;
24
25
  init(): void;
25
26
  changeHour(v: number): void;
26
27
  changeMinute(v: number): void;
@@ -7,6 +7,7 @@ import template from './time.vdt';
7
7
  import { useState } from '../../hooks/useState';
8
8
  import { bind } from '../utils';
9
9
  import { getNowDate } from './helpers';
10
+ import { useConfigContext } from '../config';
10
11
  var defaultValue = {
11
12
  h: 0,
12
13
  m: 0,
@@ -27,6 +28,7 @@ export var DatepickerTime = /*#__PURE__*/function (_Component) {
27
28
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
28
29
  _this.value = useState(defaultValue);
29
30
  _this.disabled = useDisable(_assertThisInitialized(_this));
31
+ _this.config = useConfigContext();
30
32
  return _this;
31
33
  }
32
34
 
@@ -14,9 +14,8 @@ export default function ($props, $blocks, $__proto__) {
14
14
  disableMinutes = _this$disabled.disableMinutes,
15
15
  disableSeconds = _this$disabled.disableSeconds,
16
16
  disableItem = _this$disabled.disableItem;
17
- var classNameObj = (_classNameObj = {
18
- 'k-datepicker-time': true
19
- }, _classNameObj[makeTimeStyles()] = true, _classNameObj);
17
+ var k = this.config.k;
18
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-datepicker-time"] = true, _classNameObj[makeTimeStyles(k)] = true, _classNameObj);
20
19
  return _$ce(2, 'div', [_$cc(ScrollSelect, {
21
20
  'data': hours,
22
21
  'value': value.h,
@@ -18,6 +18,7 @@ export declare class Diagram extends Component<DiagramProps, DiagramEvents> {
18
18
  private lines;
19
19
  private layouts;
20
20
  private canvasRef;
21
+ private config;
21
22
  private isCellSelectable;
22
23
  private isCellRotatable;
23
24
  private isCellMovable;
@@ -10,6 +10,7 @@ import mx from './mxgraph';
10
10
  import { bind } from '../utils';
11
11
  import { DIAGRAM } from './constants';
12
12
  import { error, isNullOrUndefined } from 'intact-shared';
13
+ import { useConfigContext } from '../config';
13
14
  var mxRubberband = mx.mxRubberband,
14
15
  mxEvent = mx.mxEvent;
15
16
  var events = {
@@ -35,6 +36,7 @@ export var Diagram = /*#__PURE__*/function (_Component) {
35
36
  _this.lines = new _Set();
36
37
  _this.layouts = new _Set();
37
38
  _this.canvasRef = createRef();
39
+ _this.config = useConfigContext();
38
40
  _this.isCellSelectable = void 0;
39
41
  _this.isCellRotatable = void 0;
40
42
  _this.isCellMovable = void 0;
@@ -13,11 +13,10 @@ export default function ($props, $blocks, $__proto__) {
13
13
  className = _this$get.className,
14
14
  children = _this$get.children;
15
15
 
16
- var classNameObj = (_classNameObj = {
17
- 'k-diagram': true
18
- }, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
16
+ var k = this.config.k;
17
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-diagram"] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
19
18
  return _$cv('div', _extends({
20
19
  'className': _$cn(classNameObj)
21
- }, getRestProps(this)), [_$ce(2, 'div', children, 0, 'k-diagram-scheme'), _$ce(2, 'div', null, 1, 'k-diagram-canvas', null, null, this.canvasRef)]);
20
+ }, getRestProps(this)), [_$ce(2, 'div', children, 0, _$cn(k + "-diagram-scheme")), _$ce(2, 'div', null, 1, _$cn(k + "-diagram-canvas"), null, null, this.canvasRef)]);
22
21
  }
23
22
  ;
@@ -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: "ohhwil",
8
8
  styles: "display:inline-block;overflow:auto;.mxRubberband{position:absolute;overflow:hidden;border-style:solid;border-width:1px;border-color:#0000ff;background:#0077ff;}.mxCellEditor{background:url(\"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7\");border-color:transparent;border-style:solid;display:inline-block;position:absolute;overflow:visible;word-wrap:normal;border-width:0;min-width:1px;resize:none;padding:0;margin:0;}.mxPlainTextEditor{padding:0;margin:0;}"
@@ -19,9 +19,8 @@ export default function ($props, $blocks, $__proto__) {
19
19
  iconClassName = _this$get.iconClassName,
20
20
  icon = _this$get.icon;
21
21
 
22
- var classNameObj = (_classNameObj = {
23
- 'k-alert-dialog': true
24
- }, _classNameObj["k-" + type] = true, _classNameObj['k-with-title'] = title, _classNameObj[makeAlertStyles()] = true, _classNameObj);
22
+ var k = this.config.k;
23
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-alert-dialog"] = true, _classNameObj[k + "-" + type] = true, _classNameObj[k + "-with-title"] = title, _classNameObj[makeAlertStyles(k)] = true, _classNameObj);
25
24
  return _$su.call($this, {
26
25
  'className': _$cn(classNameObj)
27
26
  }, function ($blocks) {
@@ -39,15 +38,12 @@ export default function ($props, $blocks, $__proto__) {
39
38
 
40
39
  return block ? block.call($this, callBlock, data) : callBlock();
41
40
  }), (_$blocks['body'] = function ($super) {
41
+ var _ref;
42
+
42
43
  return [_$ce(2, 'div', [!hideIcon && !icon ? _$cc(Icon, {
43
- 'className': _$cn(iconClassName || {
44
- "k-icon-success-fill": type === 'success',
45
- "k-icon-warning-fill": type === 'warning',
46
- "k-icon-error-fill": type === 'error',
47
- "k-icon-question-fill": type === 'confirm'
48
- }),
44
+ 'className': _$cn(iconClassName || (_ref = {}, _ref[k + "-icon-success-fill"] = type === 'success', _ref[k + "-icon-warning-fill"] = type === 'warning', _ref[k + "-icon-error-fill"] = type === 'error', _ref[k + "-icon-question-fill"] = type === 'confirm', _ref)),
49
45
  'color': type === 'error' ? 'danger' : type === 'confirm' ? 'primary' : type
50
- }) : undefined, icon], 0, 'k-dialog-tip-icon'), _$ce(2, 'div', [title ? _$ce(2, 'div', title, 0, 'k-alert-dialog-title') : undefined, content], 0, 'k-alert-dialog-wrapper')];
46
+ }) : undefined, icon], 0, _$cn(k + "-dialog-tip-icon")), _$ce(2, 'div', [title ? _$ce(2, 'div', title, 0, _$cn(k + "-alert-dialog-title")) : undefined, content], 0, _$cn(k + "-alert-dialog-wrapper"))];
51
47
  }, __$blocks['body'] = function ($super, data) {
52
48
  var block = $blocks['body'];
53
49
 
@@ -49,6 +49,10 @@ export declare class BaseDialog<T extends BaseDialogProps = BaseDialogProps, E e
49
49
  private overlayRef;
50
50
  private drag;
51
51
  private mouseOutsidable;
52
+ protected config: {
53
+ cls: (name: string) => string;
54
+ readonly k: string;
55
+ };
52
56
  init(): void;
53
57
  show(props?: T): void;
54
58
  close(): void;
@@ -13,6 +13,7 @@ import { useDraggable } from './useDraggable';
13
13
  import { useEscClosable } from './useEscClosable';
14
14
  import { SHOW, HIDE, DIALOG } from './constants';
15
15
  import { useFixBody, setHooks } from './useFixBody';
16
+ import { useConfigContext } from '../config';
16
17
  var typeDefs = {
17
18
  title: String,
18
19
  value: Boolean,
@@ -74,6 +75,7 @@ export var BaseDialog = /*#__PURE__*/function (_Component) {
74
75
  _this.overlayRef = createRef();
75
76
  _this.drag = useDraggable(_this.dialogRef, _this.overlayRef);
76
77
  _this.mouseOutsidable = useMouseOutsidable(_this.dialogRef, false);
78
+ _this.config = useConfigContext();
77
79
  return _this;
78
80
  }
79
81
 
@@ -1,4 +1,4 @@
1
- import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, noop as _$no, className as _$cn } from 'intact-react';
1
+ import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, className as _$cn, noop as _$no } from 'intact-react';
2
2
  import { Button } from '../button';
3
3
  import { Icon } from '../icon';
4
4
  import { Portal } from '../portal';
@@ -6,9 +6,6 @@ import { _$ } from '../../i18n';
6
6
  import { Transition } from 'intact';
7
7
  import { getRestProps, stopPropagation } from '../utils';
8
8
  import { makeDialogStyles, makeWrapperStyles } from './styles';
9
- var _$tmp0 = {
10
- 'className': 'k-icon-close'
11
- };
12
9
  export default function ($props, $blocks, $__proto__) {
13
10
  var _classNameObj, _$cn2;
14
11
 
@@ -35,10 +32,8 @@ export default function ($props, $blocks, $__proto__) {
35
32
  children = _this$get.children;
36
33
 
37
34
  var isHide = mode === 'hide';
38
- var classNameObj = (_classNameObj = {
39
- 'k-dialog': true,
40
- 'k-dragging': this.drag.dragging.value
41
- }, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj["k-" + size] = size !== 'default', _classNameObj[makeDialogStyles()] = true, _classNameObj);
35
+ var k = this.config.k;
36
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-dialog"] = true, _classNameObj[k + "-dragging"] = this.drag.dragging.value, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[makeDialogStyles(k)] = true, _classNameObj);
42
37
 
43
38
  var dialog = _$cc(Transition, {
44
39
  'show': value,
@@ -47,7 +42,7 @@ export default function ($props, $blocks, $__proto__) {
47
42
  'onAfterLeave': this.onAfterLeave,
48
43
  'children': (isHide ? true : value) ? _$ce(2, 'div', (_$blocks['content'] = function ($super) {
49
44
  return [_$ce(2, 'div', [(_$blocks['header'] = function ($super) {
50
- return _$ce(2, 'span', title, 0, 'k-dialog-title');
45
+ return _$ce(2, 'span', title, 0, _$cn(k + "-dialog-title"));
51
46
  }, __$blocks['header'] = function ($super, data) {
52
47
  var block = $blocks['header'];
53
48
 
@@ -60,11 +55,13 @@ export default function ($props, $blocks, $__proto__) {
60
55
  'type': 'none',
61
56
  'icon': true,
62
57
  'title': _$("关闭"),
63
- 'className': 'k-dialog-close',
58
+ 'className': _$cn(k + "-dialog-close"),
64
59
  'ev-click': this.terminate,
65
60
  'ev-mousedown': stopPropagation,
66
- 'children': _$cc(Icon, _$tmp0)
67
- }) : undefined], 0, 'k-dialog-header', {
61
+ 'children': _$cc(Icon, {
62
+ 'className': _$cn(k + "-icon-close")
63
+ })
64
+ }) : undefined], 0, _$cn(k + "-dialog-header"), {
68
65
  'ev-mousedown': this.drag.start
69
66
  }), _$ce(2, 'div', (_$blocks['body'] = function ($super) {
70
67
  return children;
@@ -76,14 +73,14 @@ export default function ($props, $blocks, $__proto__) {
76
73
  };
77
74
 
78
75
  return block ? block.call($this, callBlock, data) : callBlock();
79
- }, __$blocks['body'](_$no)), 0, 'k-dialog-body'), (_$blocks['footer-wrapper'] = function ($super) {
76
+ }, __$blocks['body'](_$no)), 0, _$cn(k + "-dialog-body")), (_$blocks['footer-wrapper'] = function ($super) {
80
77
  return _$ce(2, 'div', (_$blocks['footer'] = function ($super) {
81
78
  return [_$cc(Button, {
82
- 'className': 'k-dialog-cancel',
79
+ 'className': _$cn(k + "-dialog-cancel"),
83
80
  'ev-click': this.cancel,
84
81
  'children': cancelText
85
82
  }), _$cc(Button, {
86
- 'className': 'k-dialog-ok',
83
+ 'className': _$cn(k + "-dialog-ok"),
87
84
  'type': 'primary',
88
85
  'ev-click': this.ok,
89
86
  'loading': loading,
@@ -98,7 +95,7 @@ export default function ($props, $blocks, $__proto__) {
98
95
  };
99
96
 
100
97
  return block ? block.call($this, callBlock, data) : callBlock();
101
- }, __$blocks['footer'](_$no)), 0, 'k-dialog-footer');
98
+ }, __$blocks['footer'](_$no)), 0, _$cn(k + "-dialog-footer"));
102
99
  }, __$blocks['footer-wrapper'] = function ($super, data) {
103
100
  var block = $blocks['footer-wrapper'];
104
101
 
@@ -131,13 +128,10 @@ export default function ($props, $blocks, $__proto__) {
131
128
  'show': overlay ? value : false,
132
129
  'appear': value,
133
130
  'name': 'k-fade',
134
- 'children': _$ce(2, 'div', null, 1, 'k-dialog-overlay', {
131
+ 'children': _$ce(2, 'div', null, 1, _$cn(k + "-dialog-overlay"), {
135
132
  'ev-click': this.onClickWrapper
136
133
  }, null, this.overlayRef)
137
- }, 'overlay') : undefined, dialog], 0, _$cn((_$cn2 = {
138
- 'k-dialog-wrapper': true,
139
- 'k-open': value
140
- }, _$cn2[makeWrapperStyles()] = true, _$cn2)))
134
+ }, 'overlay') : undefined, dialog], 0, _$cn((_$cn2 = {}, _$cn2[k + "-dialog-wrapper"] = true, _$cn2[k + "-open"] = value, _$cn2[makeWrapperStyles(k)] = true, _$cn2)))
141
135
  });
142
136
  }
143
137
  ;
@@ -7,7 +7,7 @@ export interface DialogEvents extends BaseDialogEvents {
7
7
  }
8
8
  export interface DialogBlocks extends BaseDialogBlocks {
9
9
  }
10
- export declare class BaseDialog<P extends DialogProps = DialogProps, E extends DialogEvents = DialogEvents, B extends DialogBlocks = DialogBlocks> extends _BaseDialog<P, E> {
10
+ export declare class BaseDialog<P extends DialogProps = DialogProps, E extends DialogEvents = DialogEvents, B extends DialogBlocks = DialogBlocks> extends _BaseDialog<P, E, B> {
11
11
  useAsComponent: boolean;
12
12
  constructor(props?: Props<P, BaseDialog> | null | undefined, $vNode?: VNodeComponentClass, $SVG?: boolean, $mountedQueue?: Function[], $senior?: ComponentClass | null);
13
13
  init(): void;
@@ -1,4 +1,4 @@
1
1
  import '../../styles/global';
2
- export declare function makeDialogStyles(): string;
3
- export declare function makeWrapperStyles(): string;
4
- export declare function makeAlertStyles(): string;
2
+ export declare function makeDialogStyles(k: string): string;
3
+ export declare function makeWrapperStyles(k: string): string;
4
+ export declare function makeAlertStyles(k: string): string;
@@ -82,23 +82,23 @@ setDefault(function () {
82
82
  dialog: defaults
83
83
  }).dialog;
84
84
  });
85
- export function makeDialogStyles() {
85
+ export function makeDialogStyles(k) {
86
86
  var _context;
87
87
 
88
- return /*#__PURE__*/css("position:absolute;width:", dialog.width, ";border-radius:", dialog.borderRadius, ";background:", dialog.bgColor, ";font-size:", dialog.fontSize, ";color:", dialog.color, ";box-shadow:", dialog.boxShadow, ";max-width:100%;z-index:", theme.maxZIndex, ";&.k-dragging{cursor:move;user-select:none;}&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:all ", dialog.transition, ";}&.transition-enter-from,&.transition-leave-to,&.transition-appear-from{transform:", dialog.transform, ";opacity:0;}", _mapInstanceProperty(_context = ['large', 'small', 'mini']).call(_context, function (size) {
89
- return /*#__PURE__*/css("&.k-", size, "{width:", dialog[size + "Width"], ";}");
90
- }), ".k-dialog-header{padding:0 ", dialog.padding, ";margin:", dialog.margin, ";border-bottom:", dialog.header.border, ";height:", dialog.header.height, ";line-height:", dialog.header.height, ";font-size:", dialog.header.fontSize, ";color:", dialog.header.color, ";position:relative;font-weight:", dialog.header.fontWeight, ";}.k-dialog-title{display:inline-block;}.k-dialog-close{position:absolute;right:", dialog.header.closeRight, ";top:", dialog.header.closeTop, ";.k-icon{font-size:", dialog.header.closeIconFontSize, ";}}.k-dialog-body{padding:", dialog.body.padding, ";}.k-dialog-footer{text-align:right;padding:", dialog.footer.padding, ";margin:", dialog.margin, ";border-top:", dialog.footer.border, ";.k-btn{margin-left:", dialog.footer.btnGap, ";}}");
88
+ return /*#__PURE__*/css("position:absolute;width:", dialog.width, ";border-radius:", dialog.borderRadius, ";background:", dialog.bgColor, ";font-size:", dialog.fontSize, ";color:", dialog.color, ";box-shadow:", dialog.boxShadow, ";max-width:100%;z-index:", theme.maxZIndex, ";&.", k, "-dragging{cursor:move;user-select:none;}&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:all ", dialog.transition, ";}&.transition-enter-from,&.transition-leave-to,&.transition-appear-from{transform:", dialog.transform, ";opacity:0;}", _mapInstanceProperty(_context = ['large', 'small', 'mini']).call(_context, function (size) {
89
+ return /*#__PURE__*/css("&.", k, "-", size, "{width:", dialog[size + "Width"], ";}");
90
+ }), ".", k, "-dialog-header{padding:0 ", dialog.padding, ";margin:", dialog.margin, ";border-bottom:", dialog.header.border, ";height:", dialog.header.height, ";line-height:", dialog.header.height, ";font-size:", dialog.header.fontSize, ";color:", dialog.header.color, ";position:relative;font-weight:", dialog.header.fontWeight, ";}.", k, "-dialog-title{display:inline-block;}.", k, "-dialog-close{position:absolute;right:", dialog.header.closeRight, ";top:", dialog.header.closeTop, ";.", k, "-icon{font-size:", dialog.header.closeIconFontSize, ";}}.", k, "-dialog-body{padding:", dialog.body.padding, ";}.", k, "-dialog-footer{text-align:right;padding:", dialog.footer.padding, ";margin:", dialog.margin, ";border-top:", dialog.footer.border, ";.", k, "-btn{margin-left:", dialog.footer.btnGap, ";}}");
91
91
  }
92
- export function makeWrapperStyles() {
93
- // k-fade-leave-active will add position absolute to the styles
94
- // so we must set fixed with important to .k-dialog-overlay
95
- return /*#__PURE__*/css("position:absolute;z-index:", theme.maxZIndex, ";top:0;left:0;width:100%;.k-dialog-overlay{position:fixed!important;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, .5);}");
92
+ export function makeWrapperStyles(k) {
93
+ //.${k}-fade-leave-active will add position absolute to the styles
94
+ // so we must set fixed with important to .${k}-dialog-overlay
95
+ return /*#__PURE__*/css("position:absolute;z-index:", theme.maxZIndex, ";top:0;left:0;width:100%;.", k, "-dialog-overlay{position:fixed!important;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, .5);}");
96
96
  }
97
- export function makeAlertStyles() {
97
+ export function makeAlertStyles(k) {
98
98
  var _context2;
99
99
 
100
- return /*#__PURE__*/css("&.k-alert-dialog{.k-dialog-body{margin-top:", dialog.alert.bodyMarginTop, ";padding:", dialog.alert.padding, ";text-align:center;position:relative;z-index:1;}.k-dialog-header,.k-dialog-footer{border:none;}.k-dialog-tip-icon{margin-bottom:", dialog.alert.tipIconMarginBottom, ";.k-icon{font-size:", dialog.alert.tipIconFontSize, ";line-height:", dialog.alert.tipIconLineHeight, ";}}", _mapInstanceProperty(_context2 = ['success', 'warning', 'error', 'confirm']).call(_context2, function (type) {
100
+ return /*#__PURE__*/css("&.", k, "-alert-dialog{.", k, "-dialog-body{margin-top:", dialog.alert.bodyMarginTop, ";padding:", dialog.alert.padding, ";text-align:center;position:relative;z-index:1;}.", k, "-dialog-header,.", k, "-dialog-footer{border:none;}.", k, "-dialog-tip-icon{margin-bottom:", dialog.alert.tipIconMarginBottom, ";.", k, "-icon{font-size:", dialog.alert.tipIconFontSize, ";line-height:", dialog.alert.tipIconLineHeight, ";}}", _mapInstanceProperty(_context2 = ['success', 'warning', 'error', 'confirm']).call(_context2, function (type) {
101
101
  var color = type === 'error' ? theme.color.danger : type === 'confirm' ? theme.color.primary : theme.color[type];
102
- return /*#__PURE__*/css("&.k-", type, "{.k-dialog-tip-icon{color:", color, ";}}");
103
- }), " &:not(.k-confirm){.k-dialog-cancel{display:none;}}&.k-with-title{.k-dialog-body{margin-top:", dialog.alert.titleBodyMarginTop, ";text-align:left;}.k-dialog-tip-icon{float:left;.k-icon{font-size:", dialog.alert.titleTipIconFontSize, ";}}.k-alert-dialog-wrapper{overflow:hidden;padding-left:", dialog.alert.wrapperPaddingLeft, ";}.k-alert-dialog-title{line-height:", dialog.alert.tipIconLineHeight, ";font-size:", dialog.alert.titleFontSize, ";font-weight:", dialog.alert.titleFontWeight, ";}}}");
102
+ return /*#__PURE__*/css("&.", k, "-", type, "{.", k, "-dialog-tip-icon{color:", color, ";}}");
103
+ }), " &:not(.", k, "-confirm){.", k, "-dialog-cancel{display:none;}}&.", k, "-with-title{.", k, "-dialog-body{margin-top:", dialog.alert.titleBodyMarginTop, ";text-align:left;}.", k, "-dialog-tip-icon{float:left;.", k, "-icon{font-size:", dialog.alert.titleTipIconFontSize, ";}}.", k, "-alert-dialog-wrapper{overflow:hidden;padding-left:", dialog.alert.wrapperPaddingLeft, ";}.", k, "-alert-dialog-title{line-height:", dialog.alert.tipIconLineHeight, ";font-size:", dialog.alert.titleFontSize, ";font-weight:", dialog.alert.titleFontWeight, ";}}}");
104
104
  }
@@ -11,9 +11,8 @@ export default function ($props, $blocks, $__proto__) {
11
11
  placement = _this$get.placement,
12
12
  overlay = _this$get.overlay;
13
13
 
14
- var classNameObj = (_classNameObj = {
15
- 'k-drawer': true
16
- }, _classNameObj["k-" + placement] = true, _classNameObj[makeStyles(overlay)] = true, _classNameObj);
14
+ var k = this.config.k;
15
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-drawer"] = true, _classNameObj[k + "-" + placement] = true, _classNameObj[makeStyles(overlay, k)] = true, _classNameObj);
17
16
  return _$su.call($this, {
18
17
  'className': _$cn(classNameObj)
19
18
  }, function ($blocks) {
@@ -21,7 +20,7 @@ export default function ($props, $blocks, $__proto__) {
21
20
  __$blocks = _$ex({}, $blocks);
22
21
 
23
22
  return (_$blocks['content'] = function ($super) {
24
- return _$ce(2, 'div', $super(), 0, 'k-drawer-content');
23
+ return _$ce(2, 'div', $super(), 0, _$cn(k + "-drawer-content"));
25
24
  }, __$blocks['content'] = function ($super, data) {
26
25
  var block = $blocks['content'];
27
26
 
@@ -2,5 +2,5 @@ import '../../styles/global';
2
2
  declare type ValueOf<T extends readonly any[]> = T[number];
3
3
  export declare type Placement = ValueOf<typeof placements>;
4
4
  export declare const placements: readonly ["top", "right", "bottom", "left"];
5
- export declare function makeStyles(overlay: boolean): string;
5
+ export declare function makeStyles(overlay: boolean, k: string): string;
6
6
  export {};