props.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. import PropTypes from '../_util/vue-types';
  2. export var treeNodeProps = {
  3. eventKey: [String, Number],
  4. prefixCls: String,
  5. // By parent
  6. // expanded: { type: Boolean, default: undefined },
  7. // selected: { type: Boolean, default: undefined },
  8. // checked: { type: Boolean, default: undefined },
  9. // loaded: { type: Boolean, default: undefined },
  10. // loading: { type: Boolean, default: undefined },
  11. // halfChecked: { type: Boolean, default: undefined },
  12. // dragOver: { type: Boolean, default: undefined },
  13. // dragOverGapTop: { type: Boolean, default: undefined },
  14. // dragOverGapBottom: { type: Boolean, default: undefined },
  15. // pos: String,
  16. title: PropTypes.any,
  17. /** New added in Tree for easy data access */
  18. data: {
  19. type: Object,
  20. default: undefined
  21. },
  22. parent: {
  23. type: Object,
  24. default: undefined
  25. },
  26. isStart: {
  27. type: Array
  28. },
  29. isEnd: {
  30. type: Array
  31. },
  32. active: {
  33. type: Boolean,
  34. default: undefined
  35. },
  36. onMousemove: {
  37. type: Function
  38. },
  39. // By user
  40. isLeaf: {
  41. type: Boolean,
  42. default: undefined
  43. },
  44. checkable: {
  45. type: Boolean,
  46. default: undefined
  47. },
  48. selectable: {
  49. type: Boolean,
  50. default: undefined
  51. },
  52. disabled: {
  53. type: Boolean,
  54. default: undefined
  55. },
  56. disableCheckbox: {
  57. type: Boolean,
  58. default: undefined
  59. },
  60. icon: PropTypes.any,
  61. switcherIcon: PropTypes.any,
  62. domRef: {
  63. type: Function
  64. }
  65. };
  66. export var nodeListProps = {
  67. prefixCls: {
  68. type: String
  69. },
  70. // data: { type: Array as PropType<FlattenNode[]> },
  71. motion: {
  72. type: Object
  73. },
  74. focusable: {
  75. type: Boolean
  76. },
  77. activeItem: {
  78. type: Object
  79. },
  80. focused: {
  81. type: Boolean
  82. },
  83. tabindex: {
  84. type: Number
  85. },
  86. checkable: {
  87. type: Boolean
  88. },
  89. selectable: {
  90. type: Boolean
  91. },
  92. disabled: {
  93. type: Boolean
  94. },
  95. // expandedKeys: { type: Array as PropType<Key[]> },
  96. // selectedKeys: { type: Array as PropType<Key[]> },
  97. // checkedKeys: { type: Array as PropType<Key[]> },
  98. // loadedKeys: { type: Array as PropType<Key[]> },
  99. // loadingKeys: { type: Array as PropType<Key[]> },
  100. // halfCheckedKeys: { type: Array as PropType<Key[]> },
  101. // keyEntities: { type: Object as PropType<Record<Key, DataEntity<DataNode>>> },
  102. // dragging: { type: Boolean as PropType<boolean> },
  103. // dragOverNodeKey: { type: [String, Number] as PropType<Key> },
  104. // dropPosition: { type: Number as PropType<number> },
  105. // Virtual list
  106. height: {
  107. type: Number
  108. },
  109. itemHeight: {
  110. type: Number
  111. },
  112. virtual: {
  113. type: Boolean
  114. },
  115. onScroll: {
  116. type: Function
  117. },
  118. onKeydown: {
  119. type: Function
  120. },
  121. onFocus: {
  122. type: Function
  123. },
  124. onBlur: {
  125. type: Function
  126. },
  127. onActiveChange: {
  128. type: Function
  129. },
  130. onContextmenu: {
  131. type: Function
  132. },
  133. onListChangeStart: {
  134. type: Function
  135. },
  136. onListChangeEnd: {
  137. type: Function
  138. }
  139. };
  140. export var treeProps = function treeProps() {
  141. return {
  142. prefixCls: String,
  143. focusable: {
  144. type: Boolean,
  145. default: undefined
  146. },
  147. activeKey: [Number, String],
  148. tabindex: Number,
  149. children: PropTypes.any,
  150. treeData: {
  151. type: Array
  152. },
  153. fieldNames: {
  154. type: Object
  155. },
  156. showLine: {
  157. type: [Boolean, Object],
  158. default: undefined
  159. },
  160. showIcon: {
  161. type: Boolean,
  162. default: undefined
  163. },
  164. icon: PropTypes.any,
  165. selectable: {
  166. type: Boolean,
  167. default: undefined
  168. },
  169. disabled: {
  170. type: Boolean,
  171. default: undefined
  172. },
  173. multiple: {
  174. type: Boolean,
  175. default: undefined
  176. },
  177. checkable: {
  178. type: Boolean,
  179. default: undefined
  180. },
  181. checkStrictly: {
  182. type: Boolean,
  183. default: undefined
  184. },
  185. draggable: {
  186. type: [Function, Boolean]
  187. },
  188. defaultExpandParent: {
  189. type: Boolean,
  190. default: undefined
  191. },
  192. autoExpandParent: {
  193. type: Boolean,
  194. default: undefined
  195. },
  196. defaultExpandAll: {
  197. type: Boolean,
  198. default: undefined
  199. },
  200. defaultExpandedKeys: {
  201. type: Array
  202. },
  203. expandedKeys: {
  204. type: Array
  205. },
  206. defaultCheckedKeys: {
  207. type: Array
  208. },
  209. checkedKeys: {
  210. type: [Object, Array]
  211. },
  212. defaultSelectedKeys: {
  213. type: Array
  214. },
  215. selectedKeys: {
  216. type: Array
  217. },
  218. allowDrop: {
  219. type: Function
  220. },
  221. dropIndicatorRender: {
  222. type: Function
  223. },
  224. onFocus: {
  225. type: Function
  226. },
  227. onBlur: {
  228. type: Function
  229. },
  230. onKeydown: {
  231. type: Function
  232. },
  233. onContextmenu: {
  234. type: Function
  235. },
  236. onClick: {
  237. type: Function
  238. },
  239. onDblclick: {
  240. type: Function
  241. },
  242. onScroll: {
  243. type: Function
  244. },
  245. onExpand: {
  246. type: Function
  247. },
  248. onCheck: {
  249. type: Function
  250. },
  251. onSelect: {
  252. type: Function
  253. },
  254. onLoad: {
  255. type: Function
  256. },
  257. loadData: {
  258. type: Function
  259. },
  260. loadedKeys: {
  261. type: Array
  262. },
  263. onMouseenter: {
  264. type: Function
  265. },
  266. onMouseleave: {
  267. type: Function
  268. },
  269. onRightClick: {
  270. type: Function
  271. },
  272. onDragstart: {
  273. type: Function
  274. },
  275. onDragenter: {
  276. type: Function
  277. },
  278. onDragover: {
  279. type: Function
  280. },
  281. onDragleave: {
  282. type: Function
  283. },
  284. onDragend: {
  285. type: Function
  286. },
  287. onDrop: {
  288. type: Function
  289. },
  290. /**
  291. * Used for `rc-tree-select` only.
  292. * Do not use in your production code directly since this will be refactor.
  293. */
  294. onActiveChange: {
  295. type: Function
  296. },
  297. filterTreeNode: {
  298. type: Function
  299. },
  300. motion: PropTypes.any,
  301. switcherIcon: PropTypes.any,
  302. // Virtual List
  303. height: Number,
  304. itemHeight: Number,
  305. virtual: {
  306. type: Boolean,
  307. default: undefined
  308. },
  309. // direction for drag logic
  310. direction: {
  311. type: String
  312. }
  313. };
  314. };