@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
@@ -1,6 +1,7 @@
1
1
  export declare const context: {
2
2
  Provider: import('intact-react').ComponentConstructor<import("intact").Component<import("../context").ProviderProps<number>, {}, {}, {}>>;
3
3
  Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<number>, {}, {}, {}>>;
4
+ useContext: () => import("intact").RefObject<number | undefined>;
4
5
  };
5
6
  export declare function useGutter(): {
6
7
  getGutter: () => import("./constants").PrimitiveValue | null | undefined;
@@ -13,4 +13,5 @@ export declare class Icon extends Component<IconProps> {
13
13
  static typeDefs: Required<TypeDefs<IconProps>>;
14
14
  static defaults: () => Partial<IconProps>;
15
15
  private colors;
16
+ private config;
16
17
  }
@@ -6,6 +6,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
6
6
  import { Component } from 'intact-react';
7
7
  import template from './index.vdt';
8
8
  import { colors, sizes } from './styles';
9
+ import { useConfigContext } from '../config';
9
10
  var typeDefs = {
10
11
  size: _concatInstanceProperty(_context = []).call(_context, sizes, ['default', String, Number]),
11
12
  color: String,
@@ -36,6 +37,7 @@ export var Icon = /*#__PURE__*/function (_Component) {
36
37
 
37
38
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context3 = [this]).call(_context3, args)) || this;
38
39
  _this.colors = defaultColors;
40
+ _this.config = useConfigContext();
39
41
  return _this;
40
42
  }
41
43
 
@@ -19,28 +19,24 @@ export default function ($props, $blocks, $__proto__) {
19
19
  children = _this$get.children,
20
20
  disabled = _this$get.disabled;
21
21
 
22
- var classNameObj = (_classNameObj = {
23
- 'k-icon': true,
24
- 'k-rotate': rotate,
25
- 'k-hoverable': !disabled && hoverable,
26
- 'k-disabled': disabled
27
- }, _classNameObj[className] = className, _classNameObj);
22
+ var k = this.config.k;
23
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-icon"] = true, _classNameObj[k + "-rotate"] = rotate, _classNameObj[k + "-hoverable"] = !disabled && hoverable, _classNameObj[k + "-disabled"] = disabled, _classNameObj[className] = className, _classNameObj);
28
24
  var _style = {};
29
25
 
30
26
  if (/^\d+$/.test(size)) {
31
27
  _style.fontSize = size + 'px';
32
28
  } else if (size !== 'default') {
33
- classNameObj["k-" + size] = true;
29
+ classNameObj[k + "-" + size] = true;
34
30
  }
35
31
 
36
32
  if (this.colors.indexOf(color) > -1) {
37
- classNameObj["k-" + color] = color !== 'default';
38
- classNameObj[makeStyles()] = true;
33
+ classNameObj[k + "-" + color] = color !== 'default';
34
+ classNameObj[makeStyles(k)] = true;
39
35
  } else if (color) {
40
36
  _style.color = color;
41
- classNameObj[makeStyles(color)] = true;
37
+ classNameObj[makeStyles(k, color)] = true;
42
38
  } else {
43
- classNameObj[makeStyles()] = true;
39
+ classNameObj[makeStyles(k)] = true;
44
40
  }
45
41
 
46
42
  return _$cv('i', _extends({
@@ -1,6 +1,5 @@
1
- import '../../styles/fonts/iconfont';
2
1
  import '../../styles/fonts/ionicons';
3
2
  import '../../styles/global';
4
3
  export declare const colors: readonly ["primary", "warning", "danger", "success"];
5
4
  export declare const sizes: readonly ["large", "small", "mini"];
6
- export default function makeStyles(color?: string): string;
5
+ export default function makeStyles(k: string, color?: string): string;
@@ -3,7 +3,7 @@ import { css } from '@emotion/css';
3
3
  import { theme, setDefault } from '../../styles/theme';
4
4
  import { deepDefaults, palette } from '../../styles/utils';
5
5
  import { rotate } from '../../styles/keyframes';
6
- import '../../styles/fonts/iconfont';
6
+ import { makeIconStyles } from '../../styles/fonts/iconfont';
7
7
  import '../../styles/fonts/ionicons';
8
8
  import '../../styles/global';
9
9
  var defaults = {
@@ -34,12 +34,14 @@ setDefault(function () {
34
34
  });
35
35
  export var colors = ['primary', 'warning', 'danger', 'success'];
36
36
  export var sizes = ['large', 'small', 'mini'];
37
- export default function makeStyles(color) {
37
+ export default function makeStyles(k, color) {
38
+ // create the global icon styles
39
+ makeIconStyles(k);
38
40
  return /*#__PURE__*/css("color:", icon.color, ";font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
39
41
  var fontSize = icon.fontSize[size];
40
- return /*#__PURE__*/css("&.k-", size, "{font-size:", fontSize, ";}");
42
+ return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", fontSize, ";}");
41
43
  }), " ", _mapInstanceProperty(colors).call(colors, function (color) {
42
44
  var _color = theme.color[color];
43
- return /*#__PURE__*/css("&.k-", color, "{color:", _color, ";&.k-hoverable:hover{color:", palette(_color, -2), ";}}");
44
- }), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{font-size:inherit;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "\n &:hover {\n color: " + palette(color, -2) + " !important;\n }\n ", ";&:hover{color:", theme.color.primary, ";}}&.k-disabled{cursor:not-allowed;color:", icon.disabledColor, "!important;}");
45
+ return /*#__PURE__*/css("&.", k, "-", color, "{color:", _color, ";&.", k, "-hoverable:hover{color:", palette(_color, -2), ";}}");
46
+ }), " &.", k, "-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{font-size:inherit;}&.", k, "-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && /*#__PURE__*/css("&:hover{color:", palette(color, -2), "!important;}"), ";&:hover{color:", theme.color.primary, ";}}&.", k, "-disabled{cursor:not-allowed;color:", icon.disabledColor, "!important;}");
45
47
  }
@@ -60,6 +60,7 @@ export declare class Input<V extends Value = Value> extends Component<InputProps
60
60
  private autoRows;
61
61
  private showPassword;
62
62
  private focusHook;
63
+ private config;
63
64
  focus(): void;
64
65
  blur(): void;
65
66
  select(): void;
@@ -10,6 +10,7 @@ import { useFrozen } from './useFrozen';
10
10
  import { useAutoRows } from './useAutoRows';
11
11
  import { useShowPassword } from './useShowPassword';
12
12
  import { useFocus } from './useFocus';
13
+ import { useConfigContext } from '../config';
13
14
  export * from './search';
14
15
  var typeDefs = {
15
16
  type: String,
@@ -68,6 +69,7 @@ export var Input = /*#__PURE__*/function (_Component) {
68
69
  _this.autoRows = useAutoRows(_this.inputRef);
69
70
  _this.showPassword = useShowPassword();
70
71
  _this.focusHook = useFocus();
72
+ _this.config = useConfigContext();
71
73
  return _this;
72
74
  }
73
75
 
@@ -11,8 +11,10 @@ import { Wave } from '../wave';
11
11
  import { context as ErrorContext } from '../form/useError';
12
12
  export default function ($props, $blocks, $__proto__) {
13
13
  var _classNameObj,
14
+ _$cn2,
14
15
  children,
15
16
  _this = this,
17
+ _$cn5,
16
18
  _children;
17
19
 
18
20
  $blocks || ($blocks = {});
@@ -59,9 +61,8 @@ export default function ($props, $blocks, $__proto__) {
59
61
  isFocus = _this$focusHook.isFocus,
60
62
  focusInputOnClick = _this$focusHook.focusInputOnClick;
61
63
  var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
62
- var classNameObj = (_classNameObj = {
63
- 'k-input': true
64
- }, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj['k-flat'] = flat, _classNameObj['k-type-textarea'] = type === 'textarea', _classNameObj['k-focus'] = isFocus.value, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
64
+ var k = this.config.k;
65
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-input"] = true, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-group"] = $blocks.prepend || $blocks.append, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-clearable"] = clearable, _classNameObj[k + "-auto-width"] = autoWidth, _classNameObj[k + "-fluid"] = fluid, _classNameObj[k + "-stack-clear"] = stackClearIcon, _classNameObj[k + "-inline"] = inline, _classNameObj[k + "-flat"] = flat, _classNameObj[k + "-type-textarea"] = type === 'textarea', _classNameObj[k + "-focus"] = isFocus.value, _classNameObj[k + "-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj[k + "-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
65
66
  var _this$showPassword = this.showPassword,
66
67
  isShowPassword = _this$showPassword.isShow,
67
68
  toggleShowPassword = _this$showPassword.toggleShow,
@@ -96,12 +97,11 @@ export default function ($props, $blocks, $__proto__) {
96
97
  inputProps.value = inputValue;
97
98
  }
98
99
 
99
- return _$ce(2, 'div', [$blocks.prepend ? (children = $blocks.prepend(noop), _$ce(2, 'div', children, 0, _$cn({
100
- "k-input-prepend": true,
101
- "k-input-padding": isTextBlock(children)
102
- }))) : void 0, _$cc(ErrorContext.Consumer, {
100
+ return _$ce(2, 'div', [$blocks.prepend ? (children = $blocks.prepend(noop), _$ce(2, 'div', children, 0, _$cn((_$cn2 = {}, _$cn2[k + "-input-prepend"] = true, _$cn2[k + "-input-padding"] = isTextBlock(children), _$cn2)))) : void 0, _$cc(ErrorContext.Consumer, {
103
101
  'defaultValue': false,
104
102
  'children': function children(isInvalid) {
103
+ var _$cn3, _$cn4;
104
+
105
105
  return _$cc(Wave, {
106
106
  'disabled': waveDisabled || disabled || isInvalid,
107
107
  'inset': '-2px',
@@ -115,31 +115,24 @@ export default function ($props, $blocks, $__proto__) {
115
115
  };
116
116
 
117
117
  return block ? block.call($this, callBlock, data) : callBlock();
118
- }, __$blocks['prefix'](_$no)), 0, 'k-input-prefix') : undefined, type !== 'textarea' ? _$cv('input', _extends({}, inputProps, {
119
- 'className': 'k-input-inner',
118
+ }, __$blocks['prefix'](_$no)), 0, _$cn(k + "-input-prefix")) : undefined, type !== 'textarea' ? _$cv('input', _extends({}, inputProps, {
119
+ 'className': _$cn(k + "-input-inner"),
120
120
  'type': showPasswordType.value
121
121
  })) : _$cv('textarea', _extends({}, inputProps, {
122
- 'className': 'k-input-inner k-textarea',
122
+ 'className': _$cn(k + "-input-inner " + k + "-textarea"),
123
123
  'rows': isNotAutoRows ? rows : 1,
124
124
  'style': height.value ? addStyle(inputProps.style, {
125
125
  height: height.value + 'px'
126
126
  }) : inputProps.style
127
127
  })), $blocks.suffix || clearable && !disabled || showPasswordIcon.value || showCount ? _$ce(2, 'div', [showPasswordIcon.value ? [_$cc(Icon, {
128
128
  'hoverable': true,
129
- 'className': _$cn({
130
- "k-input-show-password": true,
131
- "k-icon-hidden": !isShowPassword.value,
132
- "k-icon-visible": isShowPassword.value
133
- }),
129
+ 'className': _$cn((_$cn3 = {}, _$cn3[k + "-input-show-password"] = true, _$cn3[k + "-icon-hidden"] = !isShowPassword.value, _$cn3[k + "-icon-visible"] = isShowPassword.value, _$cn3)),
134
130
  'ev-click': toggleShowPassword
135
131
  }), ' '] : undefined, clearable && !disabled ? _$cc(Icon, {
136
- 'className': _$cn({
137
- "k-input-clear k-icon-error-fill": true,
138
- "k-input-show": hasValue
139
- }),
132
+ 'className': _$cn((_$cn4 = {}, _$cn4[k + "-input-clear " + k + "-icon-error-fill"] = true, _$cn4[k + "-input-show"] = hasValue, _$cn4)),
140
133
  'ev-click': _this.clear,
141
134
  'hoverable': true
142
- }) : undefined, ' ', showCount ? _$ce(2, 'span', [hasValue ? value.length : 0, maxlength ? _$ce(2, 'span', [_$ct(' / '), maxlength], 0) : undefined], 0, 'k-input-count') : undefined, (_$blocks['suffix'] = function ($super) {
135
+ }) : undefined, ' ', showCount ? _$ce(2, 'span', [hasValue ? value.length : 0, maxlength ? _$ce(2, 'span', [_$ct(' / '), maxlength], 0) : undefined], 0, _$cn(k + "-input-count")) : undefined, (_$blocks['suffix'] = function ($super) {
143
136
  return null;
144
137
  }, __$blocks['suffix'] = function ($super, data) {
145
138
  var block = $blocks['suffix'];
@@ -149,17 +142,14 @@ export default function ($props, $blocks, $__proto__) {
149
142
  };
150
143
 
151
144
  return block ? block.call($this, callBlock, data) : callBlock();
152
- }, __$blocks['suffix'](_$no))], 0, 'k-input-suffix', {
145
+ }, __$blocks['suffix'](_$no))], 0, _$cn(k + "-input-suffix"), {
153
146
  'ev-click': stopPropagation
154
- }) : undefined, autoWidth ? _$ce(2, 'div', _$ce(2, 'span', !hasValue ? placeholder : inputValue, 0, null, null, null, fakeRef), 2, 'k-input-fake') : undefined], 0, 'k-input-wrapper', {
147
+ }) : undefined, autoWidth ? _$ce(2, 'div', _$ce(2, 'span', !hasValue ? placeholder : inputValue, 0, null, null, null, fakeRef), 2, _$cn(k + "-input-fake")) : undefined], 0, _$cn(k + "-input-wrapper"), {
155
148
  'ev-click': focusInputOnClick
156
149
  })
157
150
  });
158
151
  }
159
- }), $blocks.append ? (_children = $blocks.append(noop), _$ce(2, 'div', _children, 0, _$cn({
160
- "k-input-append": true,
161
- "k-input-padding": isTextBlock(_children)
162
- }))) : void 0], 0, _$cn(classNameObj), {
152
+ }), $blocks.append ? (_children = $blocks.append(noop), _$ce(2, 'div', _children, 0, _$cn((_$cn5 = {}, _$cn5[k + "-input-append"] = true, _$cn5[k + "-input-padding"] = isTextBlock(_children), _$cn5)))) : void 0], 0, _$cn(classNameObj), {
163
153
  'style': width != null ? addStyle(style, {
164
154
  width: width + "px"
165
155
  }) : style,
@@ -16,6 +16,7 @@ export declare class Search extends Component<SearchProps, SearchEvents> {
16
16
  static defaults: () => Partial<SearchProps>;
17
17
  private elementRef;
18
18
  private inputRef;
19
+ private config;
19
20
  init(): void;
20
21
  open(): void;
21
22
  hide(): void;
@@ -8,6 +8,7 @@ import { sizes } from '../../styles/utils';
8
8
  import { _$ } from '../../i18n';
9
9
  import { bind } from '../utils';
10
10
  import { useDocumentClick } from '../../hooks/useDocumentClick';
11
+ import { useConfigContext } from '../config';
11
12
  var typeDefs = {
12
13
  placeholder: String,
13
14
  value: String,
@@ -44,6 +45,7 @@ export var Search = /*#__PURE__*/function (_Component) {
44
45
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
45
46
  _this.elementRef = createRef();
46
47
  _this.inputRef = createRef();
48
+ _this.config = useConfigContext();
47
49
  return _this;
48
50
  }
49
51
 
@@ -5,9 +5,6 @@ import { Icon } from '../icon';
5
5
  import { Button } from '../button';
6
6
  import { getRestProps } from '../utils';
7
7
  import { makeSearchStyles } from './styles';
8
- var _$tmp0 = {
9
- 'className': 'k-icon-search k-search-icon'
10
- };
11
8
  export default function ($props, $blocks, $__proto__) {
12
9
  var _classNameObj;
13
10
 
@@ -23,9 +20,8 @@ export default function ($props, $blocks, $__proto__) {
23
20
  size = _this$get.size,
24
21
  open = _this$get.open;
25
22
 
26
- var classNameObj = (_classNameObj = {
27
- 'k-search': true
28
- }, _classNameObj[className] = className, _classNameObj['k-open'] = open, _classNameObj['k-hide'] = !open, _classNameObj["k-" + type] = type, _classNameObj[makeSearchStyles()] = true, _classNameObj);
23
+ var k = this.config.k;
24
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-search"] = true, _classNameObj[className] = className, _classNameObj[k + "-open"] = open, _classNameObj[k + "-hide"] = !open, _classNameObj[k + "-" + type] = type, _classNameObj[makeSearchStyles(k)] = true, _classNameObj);
29
25
  return _$cv('form', _extends({}, getRestProps(this), {
30
26
  'className': _$cn(classNameObj),
31
27
  'ev-submit': this.onSubmit,
@@ -44,7 +40,9 @@ export default function ($props, $blocks, $__proto__) {
44
40
  'type': 'none',
45
41
  'ev-click': this.onClickBtn,
46
42
  'size': size,
47
- 'children': _$cc(Icon, _$tmp0)
43
+ 'children': _$cc(Icon, {
44
+ 'className': _$cn(k + "-icon-search " + k + "-search-icon")
45
+ })
48
46
  })]);
49
47
  }
50
48
  ;
@@ -1,3 +1,3 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(): string;
3
- export declare function makeSearchStyles(): string;
2
+ export declare function makeStyles(k: string): string;
3
+ export declare function makeSearchStyles(k: string): string;
@@ -129,21 +129,21 @@ setDefault(function () {
129
129
  input: defaults
130
130
  }).input;
131
131
  });
132
- export function makeStyles() {
132
+ export function makeStyles(k) {
133
133
  var _context;
134
134
 
135
- return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.k-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.k-focus .k-input-wrapper{border:", input.focusBorder, ";z-index:1;}.k-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.k-input-prefix{margin-right:", input.clearIconGap, ";}.k-input-suffix{margin-left:", input.clearIconGap, ";}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .k-input-clear.k-input-show{opacity:1;pointer-events:all;}.k-input-show-password{color:", input.clearIconColor, ";}&.k-stack-clear{.k-input-clear{position:absolute;z-index:1;right:0;&.k-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+*{opacity:0;}}}&.k-group{display:inline-flex;.k-input-wrapper{border-radius:0;}.k-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.k-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-prepend,.k-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.k-btn{margin:-1px;border:none;&.k-none:hover{background:transparent;}}.k-select{margin:-1px;text-align:left;}}.k-input-prepend{&,.k-btn,.k-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-append{&,.k-btn,.k-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-padding{padding:0 ", input.groupPaddingGap, ";}.k-input-prepend{border-right:none;}.k-input-append{border-left:none;}&.k-flat{color:", _flatInstanceProperty(input).color, ";.k-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.k-disabled{color:", input.disabledColor, ";cursor:not-allowed;.k-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.k-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
135
+ return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.", k, "-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.", k, "-focus .", k, "-input-wrapper{border:", input.focusBorder, ";z-index:1;}.", k, "-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;&::placeholder{color:", input.placeholderColor, ";}}&.", k, "-fluid{width:100%;}.", k, "-input-prefix,.", k, "-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.", k, "-input-prefix{margin-right:", input.clearIconGap, ";}.", k, "-input-suffix{margin-left:", input.clearIconGap, ";}.", k, "-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .", k, "-input-clear.", k, "-input-show{opacity:1;pointer-events:all;}.", k, "-input-show-password{color:", input.clearIconColor, ";}&.", k, "-stack-clear{.", k, "-input-clear{position:absolute;z-index:1;right:0;&.", k, "-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.", k, "-input-clear.", k, "-input-show+*{opacity:0;}}}&.", k, "-group{display:inline-flex;.", k, "-input-wrapper{border-radius:0;}.", k, "-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.", k, "-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-prepend,.", k, "-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.", k, "-btn{margin:-1px;border:none;&.", k, "-none:hover{background:transparent;}}.", k, "-select{margin:-1px;text-align:left;}}.", k, "-input-prepend{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.", k, "-input-append{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-padding{padding:0 ", input.groupPaddingGap, ";}.", k, "-input-prepend{border-right:none;}.", k, "-input-append{border-left:none;}&.", k, "-flat{color:", _flatInstanceProperty(input).color, ";.", k, "-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.", k, "-disabled{color:", input.disabledColor, ";cursor:not-allowed;.", k, "-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.", k, "-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
136
136
  var styles = input[size];
137
- var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.k-input-wrapper{height:", styles.height, ";padding:0 ", styles.paddingGap, ";}");
137
+ var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.", k, "-input-wrapper{height:", styles.height, ";padding:0 ", styles.paddingGap, ";}");
138
138
  if (size === 'default') return sizeClassName;
139
- return /*#__PURE__*/css("&.k-", size, "{", sizeClassName, ";}");
140
- }), "&.k-inline{.k-input-wrapper{height:auto;border:none;border-radius:0;padding:0;}}&.k-type-textarea{.k-input-wrapper{display:inline-block;padding:0;height:auto;}.k-textarea{width:100%;padding:", input.textareaPadding, ";line-height:1.5;vertical-align:top;}.k-input-suffix{margin:0;justify-content:flex-end;}}", _mapInstanceProperty(_context = Input.typeDefs.resize).call(_context, function (type) {
141
- return /*#__PURE__*/css("&.k-resize-", type, "{.k-textarea{resize:", type, ";}}");
142
- }), ".k-input-fake{left:0;top:0;right:0;position:absolute;overflow:hidden;width:100%;visibility:hidden;white-space:nowrap;}&.k-auto-width{width:auto;max-width:100%;}.k-input-count{color:", input.count.color, ";}");
139
+ return /*#__PURE__*/css("&.", k, "-", size, "{", sizeClassName, ";}");
140
+ }), "&.", k, "-inline{.", k, "-input-wrapper{height:auto;border:none;border-radius:0;padding:0;}}&.", k, "-type-textarea{.", k, "-input-wrapper{display:inline-block;padding:0;height:auto;}.", k, "-textarea{width:100%;padding:", input.textareaPadding, ";line-height:1.5;vertical-align:top;}.", k, "-input-suffix{margin:0;justify-content:flex-end;}}", _mapInstanceProperty(_context = Input.typeDefs.resize).call(_context, function (type) {
141
+ return /*#__PURE__*/css("&.", k, "-resize-", type, "{.", k, "-textarea{resize:", type, ";}}");
142
+ }), ".", k, "-input-fake{left:0;top:0;right:0;position:absolute;overflow:hidden;width:100%;visibility:hidden;white-space:nowrap;}&.", k, "-auto-width{width:auto;max-width:100%;}.", k, "-input-count{color:", input.count.color, ";}");
143
143
  }
144
- export function makeSearchStyles() {
145
- return /*#__PURE__*/css("position:relative;display:inline-block;.k-input{transition:width ", input.transition, ";}.k-btn{position:absolute;top:0;right:0;z-index:1;}&.k-default .k-btn:hover{background:transparent;}.k-input-suffix{margin-right:", input.search.suffixMarginRight, ";}&.k-hide{", _mapInstanceProperty(sizes).call(sizes, function (size) {
144
+ export function makeSearchStyles(k) {
145
+ return /*#__PURE__*/css("position:relative;display:inline-block;.", k, "-input{transition:width ", input.transition, ";}.", k, "-btn{position:absolute;top:0;right:0;z-index:1;}&.", k, "-default .", k, "-btn:hover{background:transparent;}.", k, "-input-suffix{margin-right:", input.search.suffixMarginRight, ";}&.", k, "-hide{", _mapInstanceProperty(sizes).call(sizes, function (size) {
146
146
  if (size == 'default') return;
147
- return /*#__PURE__*/css(".k-input.k-", size, "{width:", input[size].height, ";}");
148
- }), ";.k-input{width:", input.default.height, ";}.k-input-inner{padding:0!important;}}&.k-line{.k-input-wrapper{border-width:0;}&.k-open{.k-input-wrapper{border-bottom-width:1px;}.k-btn:hover{background:transparent;}}}");
147
+ return /*#__PURE__*/css(".", k, "-input.", k, "-", size, "{width:", input[size].height, ";}");
148
+ }), ";.", k, "-input{width:", input.default.height, ";}.", k, "-input-inner{padding:0!important;}}&.", k, "-line{.", k, "-input-wrapper{border-width:0;}&.", k, "-open{.", k, "-input-wrapper{border-bottom-width:1px;}.", k, "-btn:hover{background:transparent;}}}");
149
149
  }
@@ -11,5 +11,6 @@ export declare class Aside extends Component<AsideProps> {
11
11
  static typeDefs: Required<TypeDefs<AsideProps>>;
12
12
  static defaults: () => Partial<AsideProps>;
13
13
  private rootLayout;
14
+ private config;
14
15
  private getStyles;
15
16
  }
@@ -5,6 +5,7 @@ import { themes, getCollapseWidth } from './styles';
5
5
  import template from './aside.vdt';
6
6
  import { ROOT_LAYOUT, getStyle, defaultWidth } from './helpers';
7
7
  import { addStyle } from '../utils';
8
+ import { useConfigContext } from '../config';
8
9
  var typeDefs = {
9
10
  collapse: Boolean,
10
11
  fixed: Boolean,
@@ -33,6 +34,7 @@ export var Aside = /*#__PURE__*/function (_Component) {
33
34
 
34
35
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
35
36
  _this.rootLayout = inject(ROOT_LAYOUT);
37
+ _this.config = useConfigContext();
36
38
  return _this;
37
39
  }
38
40
 
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
- import { createElementVNode as _$ce, createVNode as _$cv, className as _$cn } from 'intact-react';
2
+ import { createElementVNode as _$ce, className as _$cn, createVNode as _$cv } from 'intact-react';
3
3
  import { directClone } from 'intact';
4
4
  import { mapChildren, getRestProps } from '../utils';
5
5
  import { Menu } from '../menu';
@@ -18,25 +18,22 @@ export default function ($props, $blocks, $__proto__) {
18
18
  fixed = _this$get.fixed,
19
19
  theme = _this$get.theme;
20
20
 
21
+ var k = this.config.k;
21
22
  var vNodes = mapChildren(children, function (vNode) {
22
23
  if (vNode.tag === Menu) {
23
24
  var vNodeClone = directClone(vNode);
24
25
  vNodeClone.props = _extends({}, vNode.props, {
25
26
  collapse: collapse
26
27
  });
27
- return _$ce(2, 'div', vNodeClone, 0, 'k-layout-wrapper');
28
+ return _$ce(2, 'div', vNodeClone, 0, _$cn(k + "-layout-wrapper"));
28
29
  }
29
30
 
30
31
  return vNode;
31
32
  });
32
- var classNameObj = (_classNameObj = {
33
- 'k-layout-aside': true,
34
- 'k-collapsed': collapse,
35
- 'k-fixed': fixed
36
- }, _classNameObj["k-" + theme] = true, _classNameObj[className] = className, _classNameObj[makeAsideStyles()] = true, _classNameObj);
33
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-layout-aside"] = true, _classNameObj[k + "-collapsed"] = collapse, _classNameObj[k + "-fixed"] = fixed, _classNameObj[k + "-" + theme] = true, _classNameObj[className] = className, _classNameObj[makeAsideStyles(k)] = true, _classNameObj);
37
34
  return _$cv('div', _extends({}, getRestProps(this), {
38
35
  'className': _$cn(classNameObj),
39
- 'style': this.getStyles()
36
+ 'style': this.getStyles(k)
40
37
  }), vNodes);
41
38
  }
42
39
  ;
@@ -2,6 +2,8 @@ import { Component } from 'intact-react';
2
2
  export declare class Body extends Component {
3
3
  static template: string | import("intact").Template<any>;
4
4
  private layout;
5
+ private config;
6
+ init(): void;
5
7
  private getClassNames;
6
8
  private getStyles;
7
9
  }
@@ -1,9 +1,10 @@
1
1
  import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
2
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
- import { Component, inject } from 'intact-react';
3
+ import { Component, inject, provide } from 'intact-react';
4
4
  import template from './template.vdt';
5
- import { LAYOUT, getStyle } from './helpers';
5
+ import { LAYOUT, getStyle, BODY } from './helpers';
6
6
  import { addStyle } from '../utils';
7
+ import { useConfigContext } from '../config';
7
8
  export var Body = /*#__PURE__*/function (_Component) {
8
9
  _inheritsLoose(Body, _Component);
9
10
 
@@ -18,20 +19,24 @@ export var Body = /*#__PURE__*/function (_Component) {
18
19
 
19
20
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
20
21
  _this.layout = inject(LAYOUT);
22
+ _this.config = useConfigContext();
21
23
  return _this;
22
24
  }
23
25
 
24
26
  var _proto = Body.prototype;
25
27
 
28
+ _proto.init = function init() {
29
+ provide(BODY, this);
30
+ };
31
+
26
32
  _proto.getClassNames = function getClassNames() {
27
33
  var _ref;
28
34
 
29
35
  var _this$get = this.get(),
30
36
  className = _this$get.className;
31
37
 
32
- return _ref = {
33
- 'k-layout-body': true
34
- }, _ref[className] = className, _ref;
38
+ var k = this.config.k;
39
+ return _ref = {}, _ref[k + "-layout-body"] = true, _ref[className] = className, _ref;
35
40
  };
36
41
 
37
42
  _proto.getStyles = function getStyles() {
@@ -45,6 +50,7 @@ export var Body = /*#__PURE__*/function (_Component) {
45
50
 
46
51
  if (!hasFixedAside && !hasFixedHeader) return style;
47
52
  return addStyle(style, {
53
+ // FIXME: we must use padding instead of margin, otherwise the table's width is wired
48
54
  paddingLeft: hasFixedAside ? getStyle(asideWidth) : null,
49
55
  marginTop: hasFixedHeader ? getStyle(headerHeight) : null
50
56
  });
@@ -1,5 +1,6 @@
1
1
  import { Component } from 'intact-react';
2
2
  export declare class Footer extends Component {
3
3
  static template: string | import("intact").Template<any>;
4
+ private config;
4
5
  private getClassNames;
5
6
  }
@@ -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 './template.vdt';
5
+ import { useConfigContext } from '../config';
4
6
  export var Footer = /*#__PURE__*/function (_Component) {
5
7
  _inheritsLoose(Footer, _Component);
6
8
 
7
9
  function Footer() {
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 = Footer.prototype;
@@ -16,9 +28,8 @@ export var Footer = /*#__PURE__*/function (_Component) {
16
28
  var _this$get = this.get(),
17
29
  className = _this$get.className;
18
30
 
19
- return _ref = {
20
- 'k-layout-footer': true
21
- }, _ref[className] = className, _ref;
31
+ var k = this.config.k;
32
+ return _ref = {}, _ref[k + "-layout-footer"] = true, _ref[className] = className, _ref;
22
33
  };
23
34
 
24
35
  return Footer;
@@ -5,12 +5,15 @@ export interface HeaderProps {
5
5
  height?: number | string;
6
6
  style?: string | Record<string, string>;
7
7
  theme?: MenuProps['theme'];
8
+ blur?: boolean;
9
+ boxShadow?: boolean;
8
10
  }
9
11
  export declare class Header extends Component<HeaderProps> {
10
12
  static template: string | import("intact").Template<any>;
11
13
  static typeDefs: Required<TypeDefs<HeaderProps>>;
12
14
  static defaults: () => Partial<HeaderProps>;
13
15
  private rootLayout;
16
+ private config;
14
17
  private getClassNames;
15
18
  private getStyles;
16
19
  }
@@ -5,11 +5,14 @@ import template from './template.vdt';
5
5
  import { addStyle } from '../utils';
6
6
  import { makeHeaderStyles, themes } from './styles';
7
7
  import { defaultHeight, ROOT_LAYOUT, getStyle } from './helpers';
8
+ import { useConfigContext } from '../config';
8
9
  var typeDefs = {
9
10
  fixed: Boolean,
10
11
  height: [Number, String],
11
12
  style: [String, Object],
12
- theme: themes
13
+ theme: themes,
14
+ blur: Boolean,
15
+ boxShadow: Boolean
13
16
  };
14
17
 
15
18
  var defaults = function defaults() {
@@ -33,6 +36,7 @@ export var Header = /*#__PURE__*/function (_Component) {
33
36
 
34
37
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
35
38
  _this.rootLayout = inject(ROOT_LAYOUT);
39
+ _this.config = useConfigContext();
36
40
  return _this;
37
41
  }
38
42
 
@@ -44,12 +48,12 @@ export var Header = /*#__PURE__*/function (_Component) {
44
48
  var _this$get = this.get(),
45
49
  className = _this$get.className,
46
50
  fixed = _this$get.fixed,
47
- theme = _this$get.theme;
51
+ theme = _this$get.theme,
52
+ blur = _this$get.blur,
53
+ boxShadow = _this$get.boxShadow;
48
54
 
49
- return _ref = {
50
- 'k-layout-header': true,
51
- 'k-fixed': fixed
52
- }, _ref["k-" + theme] = true, _ref[className] = className, _ref[makeHeaderStyles()] = true, _ref;
55
+ var k = this.config.k;
56
+ return _ref = {}, _ref[k + "-layout-header"] = true, _ref[k + "-fixed"] = fixed, _ref[k + "-blur"] = blur, _ref[k + "-box-shadow"] = boxShadow, _ref[k + "-" + theme] = true, _ref[className] = className, _ref[makeHeaderStyles(k)] = true, _ref;
53
57
  };
54
58
 
55
59
  _proto.getStyles = function getStyles() {
@@ -1,5 +1,6 @@
1
1
  export declare const ROOT_LAYOUT = "RootLayout";
2
2
  export declare const LAYOUT = "Layout";
3
+ export declare const BODY = "LayoutBody";
3
4
  export declare const defaultHeight = "64px";
4
5
  export declare const defaultWidth = "200px";
5
6
  export declare function getStyle(height: number | string): string;
@@ -1,6 +1,7 @@
1
1
  import { isNumber } from 'intact-shared';
2
2
  export var ROOT_LAYOUT = 'RootLayout';
3
3
  export var LAYOUT = 'Layout';
4
+ export var BODY = 'LayoutBody';
4
5
  export var defaultHeight = "64px";
5
6
  export var defaultWidth = "200px";
6
7
  export function getStyle(height) {
@@ -0,0 +1 @@
1
+ export {};