@progress/kendo-react-common 6.1.1 → 7.0.0-develop.2

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 (342) hide show
  1. package/{dist/npm/Draggable.d.ts → Draggable.d.ts} +5 -1
  2. package/{dist/npm/Droppable.d.ts → Droppable.d.ts} +5 -1
  3. package/{dist/es/FormComponent.d.ts → FormComponent.d.ts} +4 -0
  4. package/LICENSE.md +1 -1
  5. package/browser-support.service.d.ts +11 -0
  6. package/canUseDOM.d.ts +8 -0
  7. package/canUseRef.d.ts +9 -0
  8. package/classNames.d.ts +8 -0
  9. package/{dist/npm/clone.d.ts → clone.d.ts} +4 -0
  10. package/constants/index.d.ts +8 -0
  11. package/contexts/ZIndexContext.d.ts +11 -0
  12. package/dist/cdn/js/kendo-react-common.js +8 -1
  13. package/{dist/npm/drag-n-drop → drag-n-drop}/context/index.d.ts +6 -2
  14. package/{dist/es/drag-n-drop → drag-n-drop}/index.d.ts +6 -2
  15. package/events/BaseEvent.d.ts +22 -0
  16. package/{dist/npm/events → events}/dispatchEvent.d.ts +4 -1
  17. package/fieldList.d.ts +8 -0
  18. package/focus.d.ts +8 -0
  19. package/getActiveElement.d.ts +12 -0
  20. package/getTabIndex.d.ts +8 -0
  21. package/{dist/es/getter.d.ts → getter.d.ts} +4 -0
  22. package/guid.d.ts +8 -0
  23. package/hasRelativeStackingContext.d.ts +6 -0
  24. package/{dist/npm/hocs → hocs}/AsyncFocusBlur.d.ts +5 -1
  25. package/{dist/npm/hocs → hocs}/withPropsContext.d.ts +4 -0
  26. package/{dist/npm/hooks → hooks}/index.d.ts +4 -0
  27. package/{dist/npm/hooks → hooks}/useAsyncFocusBlur.d.ts +5 -1
  28. package/hooks/useCollection.d.ts +18 -0
  29. package/hooks/useControlledState.d.ts +11 -0
  30. package/hooks/useCustomComponent.d.ts +17 -0
  31. package/hooks/useDir.d.ts +9 -0
  32. package/hooks/useDocument.d.ts +11 -0
  33. package/{dist/es/hooks → hooks}/useDraggable.d.ts +4 -0
  34. package/{dist/es/hooks → hooks}/useDroppable.d.ts +4 -0
  35. package/hooks/useInheritedState.d.ts +17 -0
  36. package/{dist/es/hooks → hooks}/useMouse.d.ts +5 -1
  37. package/hooks/usePropsContext.d.ts +7 -0
  38. package/hooks/useRtl.d.ts +9 -0
  39. package/hooks/useWindow.d.ts +11 -0
  40. package/{dist/npm/icons → icons}/BaseIconProps.d.ts +4 -1
  41. package/{dist/es/icons → icons}/Icon.d.ts +4 -0
  42. package/icons/IconWrap.d.ts +11 -0
  43. package/{dist/es/icons → icons}/IconsContext.d.ts +4 -0
  44. package/{dist/es/icons → icons}/SvgIcon.d.ts +4 -0
  45. package/icons/constants.d.ts +17 -0
  46. package/icons/models/flip.d.ts +15 -0
  47. package/{dist/npm/icons → icons}/models/size.d.ts +5 -1
  48. package/{dist/es/icons → icons}/models/theme-color.d.ts +5 -1
  49. package/{dist/es/icons → icons}/utils.d.ts +4 -0
  50. package/{dist/es/main.d.ts → index.d.ts} +4 -0
  51. package/index.js +8 -0
  52. package/index.mjs +1787 -0
  53. package/keys.d.ts +24 -0
  54. package/memoize.d.ts +14 -0
  55. package/{dist/es/models → models}/auto-scroll-options.d.ts +4 -1
  56. package/models/index.d.ts +9 -0
  57. package/{dist/npm/models → models}/kendoReactComponentBaseProps.d.ts +4 -1
  58. package/{dist/npm/models → models}/mouse.d.ts +4 -0
  59. package/{dist/npm/models → models}/pointer.d.ts +4 -0
  60. package/{dist/es/models → models}/touch.d.ts +4 -0
  61. package/{dist/npm/navigation.d.ts → navigation.d.ts} +4 -1
  62. package/noop.d.ts +8 -0
  63. package/package.json +26 -45
  64. package/scrollbarWidth.d.ts +12 -0
  65. package/{dist/npm/setter.d.ts → setter.d.ts} +4 -0
  66. package/theme.d.ts +12 -0
  67. package/{dist/es/tree-utils → tree-utils}/FieldsService.d.ts +4 -0
  68. package/tree-utils/SortedPublicItemIds.d.ts +12 -0
  69. package/{dist/es/tree-utils → tree-utils}/itemIdUtils.d.ts +4 -0
  70. package/{dist/es/tree-utils → tree-utils}/itemUtils.d.ts +4 -0
  71. package/tree-utils/misc.d.ts +12 -0
  72. package/{dist/es/treeDataOperations.d.ts → treeDataOperations.d.ts} +4 -0
  73. package/{dist/npm/typography → typography}/Typography.d.ts +4 -0
  74. package/{dist/es/typography → typography}/TypographyProps.d.ts +4 -1
  75. package/{dist/npm/typography → typography}/constants.d.ts +4 -0
  76. package/{dist/es/typography → typography}/models/margin.d.ts +5 -1
  77. package/validate-package.d.ts +12 -0
  78. package/watermark/WatermarkOverlay.d.ts +9 -0
  79. package/about.md +0 -3
  80. package/dist/es/Draggable.d.ts +0 -86
  81. package/dist/es/Draggable.js +0 -84
  82. package/dist/es/Droppable.d.ts +0 -77
  83. package/dist/es/Droppable.js +0 -68
  84. package/dist/es/FormComponent.js +0 -9
  85. package/dist/es/browser-support.service.d.ts +0 -7
  86. package/dist/es/browser-support.service.js +0 -30
  87. package/dist/es/canUseDOM.d.ts +0 -4
  88. package/dist/es/canUseDOM.js +0 -8
  89. package/dist/es/canUseRef.d.ts +0 -5
  90. package/dist/es/canUseRef.js +0 -12
  91. package/dist/es/classNames.d.ts +0 -4
  92. package/dist/es/classNames.js +0 -30
  93. package/dist/es/clone.d.ts +0 -20
  94. package/dist/es/clone.js +0 -52
  95. package/dist/es/constants/index.d.ts +0 -4
  96. package/dist/es/constants/index.js +0 -4
  97. package/dist/es/contexts/ZIndexContext.d.ts +0 -7
  98. package/dist/es/contexts/ZIndexContext.js +0 -6
  99. package/dist/es/drag-n-drop/context/index.d.ts +0 -19
  100. package/dist/es/drag-n-drop/context/index.js +0 -24
  101. package/dist/es/drag-n-drop/index.js +0 -44
  102. package/dist/es/events/BaseEvent.d.ts +0 -18
  103. package/dist/es/events/BaseEvent.js +0 -1
  104. package/dist/es/events/dispatchEvent.d.ts +0 -15
  105. package/dist/es/events/dispatchEvent.js +0 -22
  106. package/dist/es/fieldList.d.ts +0 -4
  107. package/dist/es/fieldList.js +0 -11
  108. package/dist/es/focus.d.ts +0 -4
  109. package/dist/es/focus.js +0 -15
  110. package/dist/es/getActiveElement.d.ts +0 -8
  111. package/dist/es/getActiveElement.js +0 -23
  112. package/dist/es/getTabIndex.d.ts +0 -4
  113. package/dist/es/getTabIndex.js +0 -23
  114. package/dist/es/getter.js +0 -30
  115. package/dist/es/guid.d.ts +0 -4
  116. package/dist/es/guid.js +0 -17
  117. package/dist/es/hasRelativeStackingContext.d.ts +0 -2
  118. package/dist/es/hasRelativeStackingContext.js +0 -25
  119. package/dist/es/hocs/AsyncFocusBlur.d.ts +0 -13
  120. package/dist/es/hocs/AsyncFocusBlur.js +0 -26
  121. package/dist/es/hocs/withPropsContext.d.ts +0 -5
  122. package/dist/es/hocs/withPropsContext.js +0 -22
  123. package/dist/es/hooks/index.d.ts +0 -12
  124. package/dist/es/hooks/index.js +0 -12
  125. package/dist/es/hooks/useAsyncFocusBlur.d.ts +0 -25
  126. package/dist/es/hooks/useAsyncFocusBlur.js +0 -72
  127. package/dist/es/hooks/useCollection.d.ts +0 -14
  128. package/dist/es/hooks/useCollection.js +0 -26
  129. package/dist/es/hooks/useControlledState.d.ts +0 -7
  130. package/dist/es/hooks/useControlledState.js +0 -23
  131. package/dist/es/hooks/useCustomComponent.d.ts +0 -13
  132. package/dist/es/hooks/useCustomComponent.js +0 -9
  133. package/dist/es/hooks/useDir.d.ts +0 -5
  134. package/dist/es/hooks/useDir.js +0 -19
  135. package/dist/es/hooks/useDocument.d.ts +0 -7
  136. package/dist/es/hooks/useDocument.js +0 -14
  137. package/dist/es/hooks/useDraggable.js +0 -336
  138. package/dist/es/hooks/useDroppable.js +0 -59
  139. package/dist/es/hooks/useInheritedState.d.ts +0 -13
  140. package/dist/es/hooks/useInheritedState.js +0 -21
  141. package/dist/es/hooks/useMouse.js +0 -117
  142. package/dist/es/hooks/usePointer.d.ts +0 -21
  143. package/dist/es/hooks/usePointer.js +0 -29
  144. package/dist/es/hooks/usePropsContext.d.ts +0 -3
  145. package/dist/es/hooks/usePropsContext.js +0 -7
  146. package/dist/es/hooks/useRtl.d.ts +0 -5
  147. package/dist/es/hooks/useRtl.js +0 -22
  148. package/dist/es/hooks/useTouch.d.ts +0 -15
  149. package/dist/es/hooks/useTouch.js +0 -29
  150. package/dist/es/hooks/useWindow.d.ts +0 -7
  151. package/dist/es/hooks/useWindow.js +0 -15
  152. package/dist/es/icons/BaseIconProps.d.ts +0 -73
  153. package/dist/es/icons/BaseIconProps.js +0 -1
  154. package/dist/es/icons/Icon.js +0 -78
  155. package/dist/es/icons/IconWrap.d.ts +0 -7
  156. package/dist/es/icons/IconWrap.js +0 -41
  157. package/dist/es/icons/IconsContext.js +0 -7
  158. package/dist/es/icons/SvgIcon.js +0 -96
  159. package/dist/es/icons/constants.d.ts +0 -13
  160. package/dist/es/icons/constants.js +0 -13
  161. package/dist/es/icons/models/flip.d.ts +0 -11
  162. package/dist/es/icons/models/flip.js +0 -1
  163. package/dist/es/icons/models/size.d.ts +0 -15
  164. package/dist/es/icons/models/size.js +0 -1
  165. package/dist/es/icons/models/theme-color.js +0 -1
  166. package/dist/es/icons/utils.js +0 -17
  167. package/dist/es/keys.d.ts +0 -20
  168. package/dist/es/keys.js +0 -20
  169. package/dist/es/main.js +0 -59
  170. package/dist/es/memoize.d.ts +0 -10
  171. package/dist/es/memoize.js +0 -41
  172. package/dist/es/models/auto-scroll-options.js +0 -1
  173. package/dist/es/models/index.d.ts +0 -5
  174. package/dist/es/models/index.js +0 -5
  175. package/dist/es/models/kendoReactComponentBaseProps.d.ts +0 -24
  176. package/dist/es/models/kendoReactComponentBaseProps.js +0 -1
  177. package/dist/es/models/mouse.d.ts +0 -16
  178. package/dist/es/models/mouse.js +0 -1
  179. package/dist/es/models/pointer.d.ts +0 -23
  180. package/dist/es/models/pointer.js +0 -1
  181. package/dist/es/models/touch.js +0 -1
  182. package/dist/es/navigation.d.ts +0 -128
  183. package/dist/es/navigation.js +0 -144
  184. package/dist/es/noop.d.ts +0 -4
  185. package/dist/es/noop.js +0 -4
  186. package/dist/es/scrollbarWidth.d.ts +0 -8
  187. package/dist/es/scrollbarWidth.js +0 -22
  188. package/dist/es/setter.d.ts +0 -16
  189. package/dist/es/setter.js +0 -36
  190. package/dist/es/theme.d.ts +0 -8
  191. package/dist/es/theme.js +0 -17
  192. package/dist/es/tree-utils/FieldsService.js +0 -50
  193. package/dist/es/tree-utils/SortedPublicItemIds.d.ts +0 -8
  194. package/dist/es/tree-utils/SortedPublicItemIds.js +0 -26
  195. package/dist/es/tree-utils/itemIdUtils.js +0 -117
  196. package/dist/es/tree-utils/itemUtils.js +0 -191
  197. package/dist/es/tree-utils/misc.d.ts +0 -8
  198. package/dist/es/tree-utils/misc.js +0 -17
  199. package/dist/es/treeDataOperations.js +0 -105
  200. package/dist/es/typography/Typography.d.ts +0 -35
  201. package/dist/es/typography/Typography.js +0 -266
  202. package/dist/es/typography/TypographyProps.js +0 -1
  203. package/dist/es/typography/constants.d.ts +0 -84
  204. package/dist/es/typography/constants.js +0 -84
  205. package/dist/es/typography/models/margin.js +0 -1
  206. package/dist/es/validate-package.d.ts +0 -8
  207. package/dist/es/validate-package.js +0 -23
  208. package/dist/es/watermark/WatermarkOverlay.d.ts +0 -6
  209. package/dist/es/watermark/WatermarkOverlay.js +0 -86
  210. package/dist/npm/Draggable.js +0 -87
  211. package/dist/npm/Droppable.js +0 -71
  212. package/dist/npm/FormComponent.d.ts +0 -98
  213. package/dist/npm/FormComponent.js +0 -12
  214. package/dist/npm/browser-support.service.d.ts +0 -7
  215. package/dist/npm/browser-support.service.js +0 -33
  216. package/dist/npm/canUseDOM.d.ts +0 -4
  217. package/dist/npm/canUseDOM.js +0 -11
  218. package/dist/npm/canUseRef.d.ts +0 -5
  219. package/dist/npm/canUseRef.js +0 -16
  220. package/dist/npm/classNames.d.ts +0 -4
  221. package/dist/npm/classNames.js +0 -34
  222. package/dist/npm/clone.js +0 -60
  223. package/dist/npm/constants/index.d.ts +0 -4
  224. package/dist/npm/constants/index.js +0 -7
  225. package/dist/npm/contexts/ZIndexContext.d.ts +0 -7
  226. package/dist/npm/contexts/ZIndexContext.js +0 -10
  227. package/dist/npm/drag-n-drop/context/index.js +0 -27
  228. package/dist/npm/drag-n-drop/index.d.ts +0 -21
  229. package/dist/npm/drag-n-drop/index.js +0 -48
  230. package/dist/npm/events/BaseEvent.d.ts +0 -18
  231. package/dist/npm/events/BaseEvent.js +0 -2
  232. package/dist/npm/events/dispatchEvent.js +0 -26
  233. package/dist/npm/fieldList.d.ts +0 -4
  234. package/dist/npm/fieldList.js +0 -15
  235. package/dist/npm/focus.d.ts +0 -4
  236. package/dist/npm/focus.js +0 -19
  237. package/dist/npm/getActiveElement.d.ts +0 -8
  238. package/dist/npm/getActiveElement.js +0 -28
  239. package/dist/npm/getTabIndex.d.ts +0 -4
  240. package/dist/npm/getTabIndex.js +0 -27
  241. package/dist/npm/getter.d.ts +0 -14
  242. package/dist/npm/getter.js +0 -34
  243. package/dist/npm/guid.d.ts +0 -4
  244. package/dist/npm/guid.js +0 -21
  245. package/dist/npm/hasRelativeStackingContext.d.ts +0 -2
  246. package/dist/npm/hasRelativeStackingContext.js +0 -29
  247. package/dist/npm/hocs/AsyncFocusBlur.js +0 -30
  248. package/dist/npm/hocs/withPropsContext.js +0 -27
  249. package/dist/npm/hooks/index.js +0 -28
  250. package/dist/npm/hooks/useAsyncFocusBlur.js +0 -76
  251. package/dist/npm/hooks/useCollection.d.ts +0 -14
  252. package/dist/npm/hooks/useCollection.js +0 -30
  253. package/dist/npm/hooks/useControlledState.d.ts +0 -7
  254. package/dist/npm/hooks/useControlledState.js +0 -27
  255. package/dist/npm/hooks/useCustomComponent.d.ts +0 -13
  256. package/dist/npm/hooks/useCustomComponent.js +0 -13
  257. package/dist/npm/hooks/useDir.d.ts +0 -5
  258. package/dist/npm/hooks/useDir.js +0 -23
  259. package/dist/npm/hooks/useDocument.d.ts +0 -7
  260. package/dist/npm/hooks/useDocument.js +0 -18
  261. package/dist/npm/hooks/useDraggable.d.ts +0 -63
  262. package/dist/npm/hooks/useDraggable.js +0 -340
  263. package/dist/npm/hooks/useDroppable.d.ts +0 -28
  264. package/dist/npm/hooks/useDroppable.js +0 -63
  265. package/dist/npm/hooks/useInheritedState.d.ts +0 -13
  266. package/dist/npm/hooks/useInheritedState.js +0 -25
  267. package/dist/npm/hooks/useMouse.d.ts +0 -20
  268. package/dist/npm/hooks/useMouse.js +0 -121
  269. package/dist/npm/hooks/usePointer.d.ts +0 -21
  270. package/dist/npm/hooks/usePointer.js +0 -33
  271. package/dist/npm/hooks/usePropsContext.d.ts +0 -3
  272. package/dist/npm/hooks/usePropsContext.js +0 -11
  273. package/dist/npm/hooks/useRtl.d.ts +0 -5
  274. package/dist/npm/hooks/useRtl.js +0 -26
  275. package/dist/npm/hooks/useTouch.d.ts +0 -15
  276. package/dist/npm/hooks/useTouch.js +0 -33
  277. package/dist/npm/hooks/useWindow.d.ts +0 -7
  278. package/dist/npm/hooks/useWindow.js +0 -19
  279. package/dist/npm/icons/BaseIconProps.js +0 -2
  280. package/dist/npm/icons/Icon.d.ts +0 -35
  281. package/dist/npm/icons/Icon.js +0 -81
  282. package/dist/npm/icons/IconWrap.d.ts +0 -7
  283. package/dist/npm/icons/IconWrap.js +0 -44
  284. package/dist/npm/icons/IconsContext.d.ts +0 -21
  285. package/dist/npm/icons/IconsContext.js +0 -10
  286. package/dist/npm/icons/SvgIcon.d.ts +0 -71
  287. package/dist/npm/icons/SvgIcon.js +0 -99
  288. package/dist/npm/icons/constants.d.ts +0 -13
  289. package/dist/npm/icons/constants.js +0 -16
  290. package/dist/npm/icons/models/flip.d.ts +0 -11
  291. package/dist/npm/icons/models/flip.js +0 -2
  292. package/dist/npm/icons/models/size.js +0 -2
  293. package/dist/npm/icons/models/theme-color.d.ts +0 -21
  294. package/dist/npm/icons/models/theme-color.js +0 -2
  295. package/dist/npm/icons/utils.d.ts +0 -17
  296. package/dist/npm/icons/utils.js +0 -22
  297. package/dist/npm/keys.d.ts +0 -20
  298. package/dist/npm/keys.js +0 -23
  299. package/dist/npm/main.d.ts +0 -58
  300. package/dist/npm/main.js +0 -75
  301. package/dist/npm/memoize.d.ts +0 -10
  302. package/dist/npm/memoize.js +0 -45
  303. package/dist/npm/models/auto-scroll-options.d.ts +0 -23
  304. package/dist/npm/models/auto-scroll-options.js +0 -2
  305. package/dist/npm/models/index.d.ts +0 -5
  306. package/dist/npm/models/index.js +0 -21
  307. package/dist/npm/models/kendoReactComponentBaseProps.js +0 -2
  308. package/dist/npm/models/mouse.js +0 -2
  309. package/dist/npm/models/pointer.js +0 -2
  310. package/dist/npm/models/touch.d.ts +0 -17
  311. package/dist/npm/models/touch.js +0 -2
  312. package/dist/npm/navigation.js +0 -147
  313. package/dist/npm/noop.d.ts +0 -4
  314. package/dist/npm/noop.js +0 -8
  315. package/dist/npm/scrollbarWidth.d.ts +0 -8
  316. package/dist/npm/scrollbarWidth.js +0 -27
  317. package/dist/npm/setter.js +0 -40
  318. package/dist/npm/theme.d.ts +0 -8
  319. package/dist/npm/theme.js +0 -20
  320. package/dist/npm/tree-utils/FieldsService.d.ts +0 -25
  321. package/dist/npm/tree-utils/FieldsService.js +0 -53
  322. package/dist/npm/tree-utils/SortedPublicItemIds.d.ts +0 -8
  323. package/dist/npm/tree-utils/SortedPublicItemIds.js +0 -29
  324. package/dist/npm/tree-utils/itemIdUtils.d.ts +0 -60
  325. package/dist/npm/tree-utils/itemIdUtils.js +0 -132
  326. package/dist/npm/tree-utils/itemUtils.d.ts +0 -45
  327. package/dist/npm/tree-utils/itemUtils.js +0 -205
  328. package/dist/npm/tree-utils/misc.d.ts +0 -8
  329. package/dist/npm/tree-utils/misc.js +0 -22
  330. package/dist/npm/treeDataOperations.d.ts +0 -39
  331. package/dist/npm/treeDataOperations.js +0 -112
  332. package/dist/npm/typography/Typography.js +0 -269
  333. package/dist/npm/typography/TypographyProps.d.ts +0 -121
  334. package/dist/npm/typography/TypographyProps.js +0 -2
  335. package/dist/npm/typography/constants.js +0 -87
  336. package/dist/npm/typography/models/margin.d.ts +0 -23
  337. package/dist/npm/typography/models/margin.js +0 -2
  338. package/dist/npm/validate-package.d.ts +0 -8
  339. package/dist/npm/validate-package.js +0 -28
  340. package/dist/npm/watermark/WatermarkOverlay.d.ts +0 -6
  341. package/dist/npm/watermark/WatermarkOverlay.js +0 -90
  342. package/dist/systemjs/kendo-react-common.js +0 -1
@@ -1,59 +0,0 @@
1
- import * as React from 'react';
2
- import { noop } from '../noop';
3
- import { useInheritedState } from '../hooks/useInheritedState';
4
- import { DropContext, DropsContext } from '../drag-n-drop/context';
5
- /**
6
- * Represents the KendoReact `useDroppable` hook.
7
- * Use it to attach `drop` events to a native HTML DOM elements, or custom React Components.
8
- *
9
- * For more information, refer to the [KendoReact Droppable]({% slug droppable_drag-and-drop %}) article.
10
- *
11
- * @param ref - The `ref` of the HTML Element or React Component which will enable the `droppable` functionality.
12
- * @param callbacks - A collection of callbacks, called by the `useDroppable` hook when a specific action occurs.
13
- */
14
- export function useDroppable(ref, callbacks) {
15
- if (callbacks === void 0) { callbacks = {
16
- onDragEnter: noop,
17
- onDragOver: noop,
18
- onDragLeave: noop,
19
- onDrop: noop
20
- }; }
21
- var _a = callbacks.onDragEnter, onDragEnter = _a === void 0 ? noop : _a, _b = callbacks.onDragOver, onDragOver = _b === void 0 ? noop : _b, _c = callbacks.onDragLeave, onDragLeave = _c === void 0 ? noop : _c, _d = callbacks.onDrop, onDrop = _d === void 0 ? noop : _d;
22
- var _e = useInheritedState(DropContext), setDrop = _e[1];
23
- var _f = React.useContext(DropsContext), registerDrop = _f[1], deregisterDrop = _f[2];
24
- var getElement = React.useCallback(function () { return ref.current && ref.current.element
25
- ? ref.current.element
26
- : ref.current; }, [ref]);
27
- var target = React.useRef(null);
28
- React.useImperativeHandle(target, function () { return ({
29
- element: getElement(),
30
- onDragEnter: handleDragEnter,
31
- onDragOver: handleDragOver,
32
- onDragLeave: handleDragLeave,
33
- onDrop: handleDrop,
34
- data: ref.current
35
- }); });
36
- var handleDragEnter = React.useCallback(function (event) {
37
- setDrop(target, { target: ref.current, event: event });
38
- onDragEnter(event);
39
- }, [setDrop, ref, onDragEnter]);
40
- var handleDragOver = React.useCallback(function (event) {
41
- onDragOver(event);
42
- }, [onDragOver]);
43
- var handleDragLeave = React.useCallback(function (event) {
44
- setDrop(null, { target: ref.current, event: event });
45
- onDragLeave(event);
46
- }, [setDrop, ref, onDragLeave]);
47
- var handleDrop = React.useCallback(function (event) {
48
- setDrop(null, { target: ref.current, event: event });
49
- onDrop(event);
50
- }, [setDrop, ref, onDrop]);
51
- var register = React.useCallback(function () {
52
- registerDrop(target);
53
- return function () {
54
- deregisterDrop(target);
55
- };
56
- }, [deregisterDrop, registerDrop]);
57
- React.useLayoutEffect(register, [register]);
58
- }
59
- ;
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * @hidden
4
- */
5
- interface Setter<T> extends Array<any> {
6
- 0?: T;
7
- [index: number]: any;
8
- }
9
- /**
10
- * @hidden
11
- */
12
- export declare const useInheritedState: <T>(context: React.Context<[T | undefined, (...event: Setter<T>) => void]>, defaultValue?: any) => [T, (...event: Setter<T>) => void];
13
- export {};
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * @hidden
4
- */
5
- export var useInheritedState = function (context, defaultValue) {
6
- var _a = React.useContext(context), contextValue = _a[0], contextSetter = _a[1];
7
- var _b = React.useState(defaultValue), localValue = _b[0], localSetter = _b[1];
8
- var value = contextValue !== undefined ? contextValue : localValue;
9
- var handleValueChange = function () {
10
- var args = [];
11
- for (var _i = 0; _i < arguments.length; _i++) {
12
- args[_i] = arguments[_i];
13
- }
14
- contextValue !== undefined
15
- ? contextSetter.apply(void 0, args) : localSetter(args[0]);
16
- };
17
- return [
18
- value,
19
- handleValueChange
20
- ];
21
- };
@@ -1,117 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * @hidden
4
- */
5
- export var useMouse = function (props, target, extend) {
6
- if (extend === void 0) { extend = {}; }
7
- var handleMouseDown = React.useCallback(function (event) {
8
- if (extend.onMouseDown) {
9
- extend.onMouseDown.call(undefined, event);
10
- }
11
- if (props.onMouseDown) {
12
- props.onMouseDown.call(undefined, {
13
- target: target.current,
14
- syntheticEvent: event
15
- });
16
- }
17
- }, [extend.onMouseDown, props.onMouseDown, target]);
18
- var handleMouseUp = React.useCallback(function (event) {
19
- if (extend.onMouseUp) {
20
- extend.onMouseUp.call(undefined, event);
21
- }
22
- if (props.onMouseUp) {
23
- props.onMouseUp.call(undefined, {
24
- target: target.current,
25
- syntheticEvent: event
26
- });
27
- }
28
- }, [extend.onMouseUp, props.onMouseUp, target]);
29
- var handleClick = React.useCallback(function (event) {
30
- if (extend.onClick) {
31
- extend.onClick.call(undefined, event);
32
- }
33
- if (props.onClick) {
34
- props.onClick.call(undefined, {
35
- target: target.current,
36
- syntheticEvent: event
37
- });
38
- }
39
- }, [extend.onClick, props.onClick, target]);
40
- var handleDoubleClick = React.useCallback(function (event) {
41
- if (extend.onDoubleClick) {
42
- extend.onDoubleClick.call(undefined, event);
43
- }
44
- if (props.onDoubleClick) {
45
- props.onDoubleClick.call(undefined, {
46
- target: target.current,
47
- syntheticEvent: event
48
- });
49
- }
50
- }, [extend.onDoubleClick, props.onDoubleClick, target]);
51
- var handleMouseEnter = React.useCallback(function (event) {
52
- if (extend.onMouseEnter) {
53
- extend.onMouseEnter.call(undefined, event);
54
- }
55
- if (props.onMouseEnter) {
56
- props.onMouseEnter.call(undefined, {
57
- target: target.current,
58
- syntheticEvent: event
59
- });
60
- }
61
- }, [extend.onMouseEnter, props.onMouseEnter, target]);
62
- var handleMouseLeave = React.useCallback(function (event) {
63
- if (extend.onMouseLeave) {
64
- extend.onMouseLeave.call(undefined, event);
65
- }
66
- if (props.onMouseLeave) {
67
- props.onMouseLeave.call(undefined, {
68
- target: target.current,
69
- syntheticEvent: event
70
- });
71
- }
72
- }, [extend.onMouseLeave, props.onMouseLeave, target]);
73
- var handelMouseMove = React.useCallback(function (event) {
74
- if (extend.onMouseMove) {
75
- extend.onMouseMove.call(undefined, event);
76
- }
77
- if (props.onMouseMove) {
78
- props.onMouseMove.call(undefined, {
79
- target: target.current,
80
- syntheticEvent: event
81
- });
82
- }
83
- }, [extend.onMouseMove, props.onMouseMove, target]);
84
- var handleMouseOut = React.useCallback(function (event) {
85
- if (extend.onMouseOut) {
86
- extend.onMouseOut.call(undefined, event);
87
- }
88
- if (props.onMouseOut) {
89
- props.onMouseOut.call(undefined, {
90
- target: target.current,
91
- syntheticEvent: event
92
- });
93
- }
94
- }, [extend.onMouseOut, props.onMouseOut, target]);
95
- var handleMouseOver = React.useCallback(function (event) {
96
- if (extend.onMouseOver) {
97
- extend.onMouseOver.call(undefined, event);
98
- }
99
- if (props.onMouseOver) {
100
- props.onMouseOver.call(undefined, {
101
- target: target.current,
102
- syntheticEvent: event
103
- });
104
- }
105
- }, [extend.onMouseOver, props.onMouseOver, target]);
106
- return {
107
- onClick: handleClick,
108
- onMouseUp: handleMouseUp,
109
- onMouseDown: handleMouseDown,
110
- onDoubleClick: handleDoubleClick,
111
- onMouseEnter: handleMouseEnter,
112
- onMouseLeave: handleMouseLeave,
113
- onMouseMove: handelMouseMove,
114
- onMouseOut: handleMouseOut,
115
- onMouseOver: handleMouseOver
116
- };
117
- };
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
- import { KendoPointer } from '../models';
3
- declare type ElementPointer = {
4
- [P in keyof KendoPointer<any, any>]: (event: React.PointerEvent<any>) => void;
5
- };
6
- /**
7
- * @hidden
8
- */
9
- export declare const usePointer: <E extends HTMLElement | null, P extends KendoPointer<any, any>, R extends {}>(props: P, target: React.RefObject<R>, extend?: {
10
- onPointerDown?: ((args: React.PointerEvent<E>) => void) | undefined;
11
- onPointerMove?: ((args: React.PointerEvent<E>) => void) | undefined;
12
- onPointerUp?: ((args: React.PointerEvent<E>) => void) | undefined;
13
- onPointerCancel?: ((args: React.PointerEvent<E>) => void) | undefined;
14
- onGotPointerCapture?: ((args: React.PointerEvent<E>) => void) | undefined;
15
- onLostPointerCapture?: ((args: React.PointerEvent<E>) => void) | undefined;
16
- onPointerEnter?: ((args: React.PointerEvent<E>) => void) | undefined;
17
- onPointerOver?: ((args: React.PointerEvent<E>) => void) | undefined;
18
- onPointerLeave?: ((args: React.PointerEvent<E>) => void) | undefined;
19
- onPointerOut?: ((args: React.PointerEvent<E>) => void) | undefined;
20
- }) => ElementPointer;
21
- export {};
@@ -1,29 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- /**
14
- * @hidden
15
- */
16
- export var usePointer = function (props, target, extend) {
17
- if (extend === void 0) { extend = {}; }
18
- return Object.keys(extend).reduce(function (acc, key) {
19
- var _a;
20
- return (__assign(__assign({}, acc), (_a = {}, _a[key] = React.useCallback(function (syntheticEvent) {
21
- if (extend[key]) {
22
- extend[key](syntheticEvent);
23
- }
24
- if (props[key]) {
25
- props[key]({ target: target.current, syntheticEvent: syntheticEvent });
26
- }
27
- }, [props[key], extend[key], target]), _a)));
28
- }, {});
29
- };
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- /** @hidden */
3
- export declare const usePropsContext: <T extends unknown>(context: React.Context<(p: T) => T>, props: T) => T;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- /** @hidden */
3
- export var usePropsContext = function (context, props) {
4
- var contextPropsCallback = React.useContext(context);
5
- var contextProps = contextPropsCallback(props);
6
- return contextProps;
7
- };
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * @hidden
4
- */
5
- export declare function useRtl(elementRef: React.RefObject<HTMLElement | null>, initialDir?: string, args?: any): string | undefined;
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- // Same as 'useDir'. Export to avoid breaking change.
3
- // 'useRtl' is incorrect naming, since applies that the returned value is `true` or `false`.
4
- // but instead, it is returning `ltr` or `rtl`.
5
- /**
6
- * @hidden
7
- */
8
- export function useRtl(elementRef, initialDir, args) {
9
- // Dir prop is read only on initial rendering due to specifics of getComputedStyles - see below
10
- var _a = React.useState(initialDir), dir = _a[0], setDir = _a[1];
11
- React.useEffect(function () {
12
- if (!dir && window && elementRef.current) {
13
- // Note: getComputedStyle forces reflow
14
- var rtlCandidate = window.getComputedStyle(elementRef.current).direction;
15
- if (rtlCandidate) {
16
- // rerender is needed as DOM is read after first render
17
- setDir(rtlCandidate);
18
- }
19
- }
20
- }, args);
21
- return dir;
22
- }
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { KendoTouch } from '../models';
3
- declare type ElementTouch = {
4
- [P in keyof KendoTouch<any, any>]: (event: React.TouchEvent<any>) => void;
5
- };
6
- /**
7
- * @hidden
8
- */
9
- export declare const useMouse: <E extends HTMLElement | null, P extends KendoTouch<any, any>, R extends {}>(props: P, target: React.RefObject<R>, extend?: {
10
- onTouchStart?: ((args: React.TouchEvent<E>) => void) | undefined;
11
- onTouchMove?: ((args: React.TouchEvent<E>) => void) | undefined;
12
- onTouchEnd?: ((args: React.TouchEvent<E>) => void) | undefined;
13
- onTouchCancel?: ((args: React.TouchEvent<E>) => void) | undefined;
14
- }) => ElementTouch;
15
- export {};
@@ -1,29 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- /**
14
- * @hidden
15
- */
16
- export var useMouse = function (props, target, extend) {
17
- if (extend === void 0) { extend = {}; }
18
- return Object.keys(extend).reduce(function (acc, key) {
19
- var _a;
20
- return (__assign(__assign({}, acc), (_a = {}, _a[key] = React.useCallback(function (syntheticEvent) {
21
- if (extend[key]) {
22
- extend[key](syntheticEvent);
23
- }
24
- if (props[key]) {
25
- props[key]({ target: target.current, syntheticEvent: syntheticEvent });
26
- }
27
- }, [props[key], extend[key], target]), _a)));
28
- }, {});
29
- };
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * Returns a function, which gets the `defaultView` based on the `ownerDocument` of the element.
4
- */
5
- export declare const useWindow: (ref: React.RefObject<HTMLElement | null | {
6
- element: HTMLElement | null;
7
- }>) => () => Window;
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { useDocument } from './useDocument';
3
- /**
4
- * Returns a function, which gets the `defaultView` based on the `ownerDocument` of the element.
5
- */
6
- export var useWindow = function (ref) {
7
- var getDocument = useDocument(ref);
8
- var getWindow = React.useCallback(function () {
9
- var document = getDocument();
10
- return document
11
- ? document.defaultView || window
12
- : window;
13
- }, [getDocument]);
14
- return getWindow;
15
- };
@@ -1,73 +0,0 @@
1
- /// <reference types="react" />
2
- import { IconThemeColor } from './models/theme-color';
3
- import { IconSize } from './models/size';
4
- import { IconFlip } from './models/flip';
5
- /**
6
- * @hidden
7
- */
8
- export interface BaseIconProps {
9
- /**
10
- * Sets the `tabIndex` of the icon element.
11
- */
12
- tabIndex?: number;
13
- /**
14
- * Sets the `id` of the icon element.
15
- */
16
- id?: string;
17
- /**
18
- * Sets additional CSS styles to the icon.
19
- */
20
- style?: React.CSSProperties;
21
- /**
22
- * Specifies a list of CSS classes that will be added to the root DOM element.
23
- */
24
- className?: string;
25
- /**
26
- * Specifies the theme color of the Icon.
27
- *
28
- * The possible values are:
29
- * * `inherit` (Default)&mdash;Applies coloring based on the current color.
30
- * * `primary` &mdash;Applies coloring based on primary theme color.
31
- * * `secondary`&mdash;Applies coloring based on secondary theme color.
32
- * * `tertiary`&mdash; Applies coloring based on tertiary theme color.
33
- * * `info`&mdash;Applies coloring based on info theme color.
34
- * * `success`&mdash; Applies coloring based on success theme color.
35
- * * `warning`&mdash; Applies coloring based on warning theme color.
36
- * * `error`&mdash; Applies coloring based on error theme color.
37
- * * `dark`&mdash; Applies coloring based on dark theme color.
38
- * * `light`&mdash; Applies coloring based on light theme color.
39
- * * `inverse`&mdash; Applies coloring based on inverse theme color.
40
- *
41
- * If the property is not set, the icon inherits the color from its parent.
42
- *
43
- * You can use the `style` prop to apply custom color related properties to the icon.
44
- */
45
- themeColor?: IconThemeColor;
46
- /**
47
- * Specifies the size of the icon.
48
- *
49
- * The possible values are:
50
- * * `default` (Default)&mdash;Font-size: 16px; Width: 16px; Height: 16px.
51
- * * `xsmall`&mdash;Font-size: 12px; Width: 12px; Height: 12px.
52
- * * `small`&mdash;Font-size: 14px; Width: 14px; Height: 14px.
53
- * * `medium`&mdash;Font-size: 16px; Width: 16px; Height: 16px.
54
- * * `large`&mdash;Font-size: 20px; Width: 20px; Height: 20px.
55
- * * `xlarge`&mdash;Font-size: 24px; Width: 24px; Height: 24px.
56
- * * `xxlarge`&mdash;Font-size: 32px; Width: 32px; Height: 32px.
57
- * * `xxxlarge`&mdash;Font-size: 48px; Width: 48px; Height: 48px.
58
- *
59
- * You can use the `style` prop to apply custom font size to the icon.
60
- */
61
- size?: IconSize;
62
- /**
63
- * Specifies the icon flip direction.
64
- *
65
- * The possible values are:
66
- * * `default` (Default)&mdash;No flipping applied.
67
- * * `horizontal`&mdash;Flips the icon in horizontal direction.
68
- * * `vertical`&mdash;Flips the icon in vertical direction.
69
- * * `both`&mdash;Flips the icon in both horizontal and vertical directions.
70
- *
71
- */
72
- flip?: IconFlip;
73
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,78 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import * as React from 'react';
24
- import * as PropTypes from 'prop-types';
25
- import { classNames } from '../classNames';
26
- import { SIZE_CLASSES } from './constants';
27
- import { toIconClass, useMouse } from '../main';
28
- /**
29
- * Represents the [KendoReact Icon component]({% slug overview_icon %}).
30
- *
31
- * @example
32
- * ```jsx
33
- * const App = () => {
34
- * return (
35
- * <Icon name="home"/>
36
- * );
37
- * };
38
- * ReactDOM.render(<App />, document.querySelector('my-app'));
39
- * ```
40
- */
41
- export var Icon = React.forwardRef(function (props, ref) {
42
- var className = props.className, name = props.name, themeColor = props.themeColor, size = props.size, flip = props.flip, style = props.style, id = props.id, tabIndex = props.tabIndex, others = __rest(props, ["className", "name", "themeColor", "size", "flip", "style", "id", "tabIndex"]);
43
- var target = React.useRef(null);
44
- var elementRef = React.useRef(null);
45
- React.useImperativeHandle(target, function () { return ({
46
- element: elementRef.current
47
- }); });
48
- React.useImperativeHandle(ref, function () { return target.current; });
49
- var sizeProp = React.useMemo(function () { return size || defaultProps.size; }, [size]);
50
- var flipProp = React.useMemo(function () { return flip || defaultProps.flip; }, [flip]);
51
- var fontClassNames = React.useMemo(function () {
52
- var _a;
53
- return classNames('k-icon', 'k-font-icon', name && toIconClass(name), (_a = {},
54
- _a["k-color-".concat(themeColor)] = themeColor,
55
- _a['k-flip-h'] = flipProp === 'horizontal' || flipProp === 'both',
56
- _a['k-flip-v'] = flipProp === 'vertical' || flipProp === 'both',
57
- _a), SIZE_CLASSES[sizeProp], className);
58
- }, [name, themeColor, sizeProp, flipProp, className]);
59
- var mouseProps = useMouse(props, target);
60
- return (React.createElement("span", __assign({ ref: elementRef }, others, mouseProps, { className: fontClassNames, id: id, tabIndex: tabIndex, style: style, role: "presentation" })));
61
- });
62
- Icon.propTypes = {
63
- style: PropTypes.object,
64
- classNames: PropTypes.string,
65
- name: PropTypes.string,
66
- themeColor: PropTypes.oneOf([
67
- 'inherit', 'primary', 'secondary', 'tertiary',
68
- 'info', 'success', 'error', 'warning',
69
- 'dark', 'light', 'inverse'
70
- ]),
71
- size: PropTypes.oneOf(['default', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'xxxlarge']),
72
- flip: PropTypes.oneOf(['default', 'horizontal', 'vertical', 'both'])
73
- };
74
- var defaultProps = {
75
- size: 'default',
76
- flip: 'default'
77
- };
78
- Icon.displayName = 'KendoIcon';
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import { IconProps, IconHandle } from './Icon';
3
- import { SvgIconProps, SvgIconHandle } from './SvgIcon';
4
- /**
5
- * @hidden
6
- */
7
- export declare const IconWrap: React.ForwardRefExoticComponent<IconProps & SvgIconProps & React.RefAttributes<(IconHandle & SvgIconHandle) | null>>;
@@ -1,41 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import * as React from 'react';
24
- import { Icon } from './Icon';
25
- import { SvgIcon } from './SvgIcon';
26
- import { IconsContext } from './IconsContext';
27
- /**
28
- * @hidden
29
- */
30
- export var IconWrap = React.forwardRef(function (props, ref) {
31
- var _a, _b;
32
- var _c = React.useContext(IconsContext), type = _c.type, icons = _c.icons;
33
- var icon = props.icon, fontIconProps = __rest(props, ["icon"]);
34
- var name = type === 'svg' ? (((_a = props.icon) === null || _a === void 0 ? void 0 : _a.name) || props.name) : (props.name || ((_b = props.icon) === null || _b === void 0 ? void 0 : _b.name));
35
- name = (name && icons && icons[name] && typeof icons[name] === 'string') ? icons[name] : name;
36
- var svg = (name && icons && icons[name] && typeof icons[name] !== 'string') ? icons[name] : icon;
37
- return (type === 'svg' && svg) ?
38
- React.createElement(SvgIcon, __assign({}, props, { icon: svg, ref: ref })) :
39
- React.createElement(Icon, __assign({}, fontIconProps, { name: name, ref: ref }));
40
- });
41
- IconWrap.displayName = 'KendoIconWrap';
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- ;
3
- /**
4
- * Represents a React Context which provides you with the option to configure the KendoReact components icons.
5
- */
6
- export var IconsContext = React.createContext({ type: 'svg' });
7
- IconsContext.displayName = 'KendoReactIconsContext';