TreeNode.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
  2. import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
  3. import _extends from "@babel/runtime/helpers/esm/extends";
  4. import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
  5. var _excluded = ["eventKey", "isLeaf", "isStart", "isEnd", "domRef", "active", "data", "onMousemove", "selectable"];
  6. import { createVNode as _createVNode } from "vue";
  7. import { useInjectKeysState, useInjectTreeContext } from './contextTypes';
  8. import Indent from './Indent';
  9. import { convertNodePropsToEventData, getTreeNodeProps } from './utils/treeUtil';
  10. import { computed, defineComponent, getCurrentInstance, onMounted, onUpdated, reactive, ref } from 'vue';
  11. import { treeNodeProps } from './props';
  12. import classNames from '../_util/classNames';
  13. import { warning } from '../vc-util/warning';
  14. import pickAttrs from '../_util/pickAttrs';
  15. import eagerComputed from '../_util/eagerComputed';
  16. var ICON_OPEN = 'open';
  17. var ICON_CLOSE = 'close';
  18. var defaultTitle = '---';
  19. export default defineComponent({
  20. compatConfig: {
  21. MODE: 3
  22. },
  23. name: 'ATreeNode',
  24. inheritAttrs: false,
  25. props: treeNodeProps,
  26. isTreeNode: 1,
  27. slots: ['title', 'icon', 'switcherIcon'],
  28. setup: function setup(props, _ref) {
  29. var attrs = _ref.attrs,
  30. slots = _ref.slots,
  31. expose = _ref.expose;
  32. warning(!('slots' in props.data), "treeData slots is deprecated, please use ".concat(Object.keys(props.data.slots || {}).map(function (key) {
  33. return '`v-slot:' + key + '` ';
  34. }), "instead"));
  35. var dragNodeHighlight = ref(false);
  36. var context = useInjectTreeContext();
  37. var _useInjectKeysState = useInjectKeysState(),
  38. expandedKeysSet = _useInjectKeysState.expandedKeysSet,
  39. selectedKeysSet = _useInjectKeysState.selectedKeysSet,
  40. loadedKeysSet = _useInjectKeysState.loadedKeysSet,
  41. loadingKeysSet = _useInjectKeysState.loadingKeysSet,
  42. checkedKeysSet = _useInjectKeysState.checkedKeysSet,
  43. halfCheckedKeysSet = _useInjectKeysState.halfCheckedKeysSet;
  44. var _context$value = context.value,
  45. dragOverNodeKey = _context$value.dragOverNodeKey,
  46. dropPosition = _context$value.dropPosition,
  47. keyEntities = _context$value.keyEntities;
  48. var mergedTreeNodeProps = computed(function () {
  49. return getTreeNodeProps(props.eventKey, {
  50. expandedKeysSet: expandedKeysSet.value,
  51. selectedKeysSet: selectedKeysSet.value,
  52. loadedKeysSet: loadedKeysSet.value,
  53. loadingKeysSet: loadingKeysSet.value,
  54. checkedKeysSet: checkedKeysSet.value,
  55. halfCheckedKeysSet: halfCheckedKeysSet.value,
  56. dragOverNodeKey: dragOverNodeKey,
  57. dropPosition: dropPosition,
  58. keyEntities: keyEntities
  59. });
  60. });
  61. var expanded = eagerComputed(function () {
  62. return mergedTreeNodeProps.value.expanded;
  63. });
  64. var selected = eagerComputed(function () {
  65. return mergedTreeNodeProps.value.selected;
  66. });
  67. var checked = eagerComputed(function () {
  68. return mergedTreeNodeProps.value.checked;
  69. });
  70. var loaded = eagerComputed(function () {
  71. return mergedTreeNodeProps.value.loaded;
  72. });
  73. var loading = eagerComputed(function () {
  74. return mergedTreeNodeProps.value.loading;
  75. });
  76. var halfChecked = eagerComputed(function () {
  77. return mergedTreeNodeProps.value.halfChecked;
  78. });
  79. var dragOver = eagerComputed(function () {
  80. return mergedTreeNodeProps.value.dragOver;
  81. });
  82. var dragOverGapTop = eagerComputed(function () {
  83. return mergedTreeNodeProps.value.dragOverGapTop;
  84. });
  85. var dragOverGapBottom = eagerComputed(function () {
  86. return mergedTreeNodeProps.value.dragOverGapBottom;
  87. });
  88. var pos = eagerComputed(function () {
  89. return mergedTreeNodeProps.value.pos;
  90. });
  91. var selectHandle = ref();
  92. var hasChildren = computed(function () {
  93. var eventKey = props.eventKey;
  94. var keyEntities = context.value.keyEntities;
  95. var _ref2 = keyEntities[eventKey] || {},
  96. children = _ref2.children;
  97. return !!(children || []).length;
  98. });
  99. var isLeaf = computed(function () {
  100. var isLeaf = props.isLeaf;
  101. var loadData = context.value.loadData;
  102. var has = hasChildren.value;
  103. if (isLeaf === false) {
  104. return false;
  105. }
  106. return isLeaf || !loadData && !has || loadData && loaded.value && !has;
  107. });
  108. var nodeState = computed(function () {
  109. if (isLeaf.value) {
  110. return null;
  111. }
  112. return expanded.value ? ICON_OPEN : ICON_CLOSE;
  113. });
  114. var isDisabled = computed(function () {
  115. var disabled = props.disabled;
  116. var treeDisabled = context.value.disabled;
  117. return !!(treeDisabled || disabled);
  118. });
  119. var isCheckable = computed(function () {
  120. var checkable = props.checkable;
  121. var treeCheckable = context.value.checkable;
  122. // Return false if tree or treeNode is not checkable
  123. if (!treeCheckable || checkable === false) return false;
  124. return treeCheckable;
  125. });
  126. var isSelectable = computed(function () {
  127. var selectable = props.selectable;
  128. var treeSelectable = context.value.selectable;
  129. // Ignore when selectable is undefined or null
  130. if (typeof selectable === 'boolean') {
  131. return selectable;
  132. }
  133. return treeSelectable;
  134. });
  135. var renderArgsData = computed(function () {
  136. var data = props.data,
  137. active = props.active,
  138. checkable = props.checkable,
  139. disableCheckbox = props.disableCheckbox,
  140. disabled = props.disabled,
  141. selectable = props.selectable;
  142. return _objectSpread(_objectSpread({
  143. active: active,
  144. checkable: checkable,
  145. disableCheckbox: disableCheckbox,
  146. disabled: disabled,
  147. selectable: selectable
  148. }, data), {}, {
  149. dataRef: data,
  150. data: data,
  151. isLeaf: isLeaf.value,
  152. checked: checked.value,
  153. expanded: expanded.value,
  154. loading: loading.value,
  155. selected: selected.value,
  156. halfChecked: halfChecked.value
  157. });
  158. });
  159. var instance = getCurrentInstance();
  160. var eventData = computed(function () {
  161. var eventKey = props.eventKey;
  162. var keyEntities = context.value.keyEntities;
  163. var _ref3 = keyEntities[eventKey] || {},
  164. parent = _ref3.parent;
  165. return _objectSpread(_objectSpread({}, convertNodePropsToEventData(_extends({}, props, mergedTreeNodeProps.value))), {}, {
  166. parent: parent
  167. });
  168. });
  169. var dragNodeEvent = reactive({
  170. eventData: eventData,
  171. eventKey: computed(function () {
  172. return props.eventKey;
  173. }),
  174. selectHandle: selectHandle,
  175. pos: pos,
  176. key: instance.vnode.key
  177. });
  178. expose(dragNodeEvent);
  179. var onSelectorDoubleClick = function onSelectorDoubleClick(e) {
  180. var onNodeDoubleClick = context.value.onNodeDoubleClick;
  181. onNodeDoubleClick(e, eventData.value);
  182. };
  183. var onSelect = function onSelect(e) {
  184. if (isDisabled.value) return;
  185. var onNodeSelect = context.value.onNodeSelect;
  186. e.preventDefault();
  187. onNodeSelect(e, eventData.value);
  188. };
  189. var onCheck = function onCheck(e) {
  190. if (isDisabled.value) return;
  191. var disableCheckbox = props.disableCheckbox;
  192. var onNodeCheck = context.value.onNodeCheck;
  193. if (!isCheckable.value || disableCheckbox) return;
  194. e.preventDefault();
  195. var targetChecked = !checked.value;
  196. onNodeCheck(e, eventData.value, targetChecked);
  197. };
  198. var onSelectorClick = function onSelectorClick(e) {
  199. // Click trigger before select/check operation
  200. var onNodeClick = context.value.onNodeClick;
  201. onNodeClick(e, eventData.value);
  202. if (isSelectable.value) {
  203. onSelect(e);
  204. } else {
  205. onCheck(e);
  206. }
  207. };
  208. var onMouseEnter = function onMouseEnter(e) {
  209. var onNodeMouseEnter = context.value.onNodeMouseEnter;
  210. onNodeMouseEnter(e, eventData.value);
  211. };
  212. var onMouseLeave = function onMouseLeave(e) {
  213. var onNodeMouseLeave = context.value.onNodeMouseLeave;
  214. onNodeMouseLeave(e, eventData.value);
  215. };
  216. var onContextmenu = function onContextmenu(e) {
  217. var onNodeContextMenu = context.value.onNodeContextMenu;
  218. onNodeContextMenu(e, eventData.value);
  219. };
  220. var onDragStart = function onDragStart(e) {
  221. var onNodeDragStart = context.value.onNodeDragStart;
  222. e.stopPropagation();
  223. dragNodeHighlight.value = true;
  224. onNodeDragStart(e, dragNodeEvent);
  225. try {
  226. // ie throw error
  227. // firefox-need-it
  228. e.dataTransfer.setData('text/plain', '');
  229. } catch (error) {
  230. // empty
  231. }
  232. };
  233. var onDragEnter = function onDragEnter(e) {
  234. var onNodeDragEnter = context.value.onNodeDragEnter;
  235. e.preventDefault();
  236. e.stopPropagation();
  237. onNodeDragEnter(e, dragNodeEvent);
  238. };
  239. var onDragOver = function onDragOver(e) {
  240. var onNodeDragOver = context.value.onNodeDragOver;
  241. e.preventDefault();
  242. e.stopPropagation();
  243. onNodeDragOver(e, dragNodeEvent);
  244. };
  245. var onDragLeave = function onDragLeave(e) {
  246. var onNodeDragLeave = context.value.onNodeDragLeave;
  247. e.stopPropagation();
  248. onNodeDragLeave(e, dragNodeEvent);
  249. };
  250. var onDragEnd = function onDragEnd(e) {
  251. var onNodeDragEnd = context.value.onNodeDragEnd;
  252. e.stopPropagation();
  253. dragNodeHighlight.value = false;
  254. onNodeDragEnd(e, dragNodeEvent);
  255. };
  256. var onDrop = function onDrop(e) {
  257. var onNodeDrop = context.value.onNodeDrop;
  258. e.preventDefault();
  259. e.stopPropagation();
  260. dragNodeHighlight.value = false;
  261. onNodeDrop(e, dragNodeEvent);
  262. };
  263. // Disabled item still can be switch
  264. var onExpand = function onExpand(e) {
  265. var onNodeExpand = context.value.onNodeExpand;
  266. if (loading.value) return;
  267. onNodeExpand(e, eventData.value);
  268. };
  269. var isDraggable = function isDraggable() {
  270. var data = props.data;
  271. var draggable = context.value.draggable;
  272. return !!(draggable && (!draggable.nodeDraggable || draggable.nodeDraggable(data)));
  273. };
  274. // ==================== Render: Drag Handler ====================
  275. var renderDragHandler = function renderDragHandler() {
  276. var _context$value2 = context.value,
  277. draggable = _context$value2.draggable,
  278. prefixCls = _context$value2.prefixCls;
  279. return draggable && draggable !== null && draggable !== void 0 && draggable.icon ? _createVNode("span", {
  280. "class": "".concat(prefixCls, "-draggable-icon")
  281. }, [draggable.icon]) : null;
  282. };
  283. var renderSwitcherIconDom = function renderSwitcherIconDom() {
  284. var _context$value$slots, _props$data, _props$data$slots;
  285. var _props$switcherIcon = props.switcherIcon,
  286. switcherIconFromProps = _props$switcherIcon === void 0 ? slots.switcherIcon || ((_context$value$slots = context.value.slots) === null || _context$value$slots === void 0 ? void 0 : _context$value$slots[(_props$data = props.data) === null || _props$data === void 0 ? void 0 : (_props$data$slots = _props$data.slots) === null || _props$data$slots === void 0 ? void 0 : _props$data$slots.switcherIcon]) : _props$switcherIcon;
  287. var switcherIconFromCtx = context.value.switcherIcon;
  288. var switcherIcon = switcherIconFromProps || switcherIconFromCtx;
  289. // if switcherIconDom is null, no render switcher span
  290. if (typeof switcherIcon === 'function') {
  291. return switcherIcon(renderArgsData.value);
  292. }
  293. return switcherIcon;
  294. };
  295. // Load data to avoid default expanded tree without data
  296. var syncLoadData = function syncLoadData() {
  297. //const { expanded, loading, loaded } = props;
  298. var _context$value3 = context.value,
  299. loadData = _context$value3.loadData,
  300. onNodeLoad = _context$value3.onNodeLoad;
  301. if (loading.value) {
  302. return;
  303. }
  304. // read from state to avoid loadData at same time
  305. if (loadData && expanded.value && !isLeaf.value) {
  306. // We needn't reload data when has children in sync logic
  307. // It's only needed in node expanded
  308. if (!hasChildren.value && !loaded.value) {
  309. onNodeLoad(eventData.value);
  310. }
  311. }
  312. };
  313. onMounted(function () {
  314. syncLoadData();
  315. });
  316. onUpdated(function () {
  317. // https://github.com/vueComponent/ant-design-vue/issues/4835
  318. syncLoadData();
  319. });
  320. // Switcher
  321. var renderSwitcher = function renderSwitcher() {
  322. var prefixCls = context.value.prefixCls;
  323. // if switcherIconDom is null, no render switcher span
  324. var switcherIconDom = renderSwitcherIconDom();
  325. if (isLeaf.value) {
  326. return switcherIconDom !== false ? _createVNode("span", {
  327. "class": classNames("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher-noop"))
  328. }, [switcherIconDom]) : null;
  329. }
  330. var switcherCls = classNames("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher_").concat(expanded.value ? ICON_OPEN : ICON_CLOSE));
  331. return switcherIconDom !== false ? _createVNode("span", {
  332. "onClick": onExpand,
  333. "class": switcherCls
  334. }, [switcherIconDom]) : null;
  335. };
  336. // Checkbox
  337. var renderCheckbox = function renderCheckbox() {
  338. var _context$value$custom, _context$value4;
  339. var disableCheckbox = props.disableCheckbox;
  340. var prefixCls = context.value.prefixCls;
  341. var disabled = isDisabled.value;
  342. var checkable = isCheckable.value;
  343. if (!checkable) return null;
  344. return _createVNode("span", {
  345. "class": classNames("".concat(prefixCls, "-checkbox"), checked.value && "".concat(prefixCls, "-checkbox-checked"), !checked.value && halfChecked.value && "".concat(prefixCls, "-checkbox-indeterminate"), (disabled || disableCheckbox) && "".concat(prefixCls, "-checkbox-disabled")),
  346. "onClick": onCheck
  347. }, [(_context$value$custom = (_context$value4 = context.value).customCheckable) === null || _context$value$custom === void 0 ? void 0 : _context$value$custom.call(_context$value4)]);
  348. };
  349. var renderIcon = function renderIcon() {
  350. var prefixCls = context.value.prefixCls;
  351. return _createVNode("span", {
  352. "class": classNames("".concat(prefixCls, "-iconEle"), "".concat(prefixCls, "-icon__").concat(nodeState.value || 'docu'), loading.value && "".concat(prefixCls, "-icon_loading"))
  353. }, null);
  354. };
  355. var renderDropIndicator = function renderDropIndicator() {
  356. var disabled = props.disabled,
  357. eventKey = props.eventKey;
  358. var _context$value5 = context.value,
  359. draggable = _context$value5.draggable,
  360. dropLevelOffset = _context$value5.dropLevelOffset,
  361. dropPosition = _context$value5.dropPosition,
  362. prefixCls = _context$value5.prefixCls,
  363. indent = _context$value5.indent,
  364. dropIndicatorRender = _context$value5.dropIndicatorRender,
  365. dragOverNodeKey = _context$value5.dragOverNodeKey,
  366. direction = _context$value5.direction;
  367. var rootDraggable = draggable !== false;
  368. // allowDrop is calculated in Tree.tsx, there is no need for calc it here
  369. var showIndicator = !disabled && rootDraggable && dragOverNodeKey === eventKey;
  370. return showIndicator ? dropIndicatorRender({
  371. dropPosition: dropPosition,
  372. dropLevelOffset: dropLevelOffset,
  373. indent: indent,
  374. prefixCls: prefixCls,
  375. direction: direction
  376. }) : null;
  377. };
  378. // Icon + Title
  379. var renderSelector = function renderSelector() {
  380. var _context$value$slots2, _props$data2, _props$data2$slots, _context$value$slots3;
  381. var _props$icon = props.icon,
  382. icon = _props$icon === void 0 ? slots.icon : _props$icon,
  383. data = props.data;
  384. var title = slots.title || ((_context$value$slots2 = context.value.slots) === null || _context$value$slots2 === void 0 ? void 0 : _context$value$slots2[(_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : (_props$data2$slots = _props$data2.slots) === null || _props$data2$slots === void 0 ? void 0 : _props$data2$slots.title]) || ((_context$value$slots3 = context.value.slots) === null || _context$value$slots3 === void 0 ? void 0 : _context$value$slots3.title) || props.title;
  385. var _context$value6 = context.value,
  386. prefixCls = _context$value6.prefixCls,
  387. showIcon = _context$value6.showIcon,
  388. treeIcon = _context$value6.icon,
  389. loadData = _context$value6.loadData;
  390. var disabled = isDisabled.value;
  391. var wrapClass = "".concat(prefixCls, "-node-content-wrapper");
  392. // Icon - Still show loading icon when loading without showIcon
  393. var $icon;
  394. if (showIcon) {
  395. var _context$value$slots4, _data$slots;
  396. var currentIcon = icon || ((_context$value$slots4 = context.value.slots) === null || _context$value$slots4 === void 0 ? void 0 : _context$value$slots4[data === null || data === void 0 ? void 0 : (_data$slots = data.slots) === null || _data$slots === void 0 ? void 0 : _data$slots.icon]) || treeIcon;
  397. $icon = currentIcon ? _createVNode("span", {
  398. "class": classNames("".concat(prefixCls, "-iconEle"), "".concat(prefixCls, "-icon__customize"))
  399. }, [typeof currentIcon === 'function' ? currentIcon(renderArgsData.value) : currentIcon]) : renderIcon();
  400. } else if (loadData && loading.value) {
  401. $icon = renderIcon();
  402. }
  403. // Title
  404. var titleNode;
  405. if (typeof title === 'function') {
  406. titleNode = title(renderArgsData.value);
  407. // } else if (contextSlots.titleRender) {
  408. // titleNode = contextSlots.titleRender(renderArgsData.value);
  409. } else {
  410. titleNode = title;
  411. }
  412. titleNode = titleNode === undefined ? defaultTitle : titleNode;
  413. var $title = _createVNode("span", {
  414. "class": "".concat(prefixCls, "-title")
  415. }, [titleNode]);
  416. return _createVNode("span", {
  417. "ref": selectHandle,
  418. "title": typeof title === 'string' ? title : '',
  419. "class": classNames("".concat(wrapClass), "".concat(wrapClass, "-").concat(nodeState.value || 'normal'), !disabled && (selected.value || dragNodeHighlight.value) && "".concat(prefixCls, "-node-selected")),
  420. "onMouseenter": onMouseEnter,
  421. "onMouseleave": onMouseLeave,
  422. "onContextmenu": onContextmenu,
  423. "onClick": onSelectorClick,
  424. "onDblclick": onSelectorDoubleClick
  425. }, [$icon, $title, renderDropIndicator()]);
  426. };
  427. return function () {
  428. var _classNames;
  429. var _props$attrs = _objectSpread(_objectSpread({}, props), attrs),
  430. eventKey = _props$attrs.eventKey,
  431. isLeaf = _props$attrs.isLeaf,
  432. isStart = _props$attrs.isStart,
  433. isEnd = _props$attrs.isEnd,
  434. domRef = _props$attrs.domRef,
  435. active = _props$attrs.active,
  436. data = _props$attrs.data,
  437. onMousemove = _props$attrs.onMousemove,
  438. selectable = _props$attrs.selectable,
  439. otherProps = _objectWithoutProperties(_props$attrs, _excluded);
  440. var _context$value7 = context.value,
  441. prefixCls = _context$value7.prefixCls,
  442. filterTreeNode = _context$value7.filterTreeNode,
  443. keyEntities = _context$value7.keyEntities,
  444. dropContainerKey = _context$value7.dropContainerKey,
  445. dropTargetKey = _context$value7.dropTargetKey,
  446. draggingNodeKey = _context$value7.draggingNodeKey;
  447. var disabled = isDisabled.value;
  448. var dataOrAriaAttributeProps = pickAttrs(otherProps, {
  449. aria: true,
  450. data: true
  451. });
  452. var _ref4 = keyEntities[eventKey] || {},
  453. level = _ref4.level;
  454. var isEndNode = isEnd[isEnd.length - 1];
  455. var mergedDraggable = isDraggable();
  456. var draggableWithoutDisabled = !disabled && mergedDraggable;
  457. var dragging = draggingNodeKey === eventKey;
  458. var ariaSelected = selectable !== undefined ? {
  459. 'aria-selected': !!selectable
  460. } : undefined;
  461. // console.log(1);
  462. return _createVNode("div", _objectSpread(_objectSpread({
  463. "ref": domRef,
  464. "class": classNames(attrs.class, "".concat(prefixCls, "-treenode"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-treenode-disabled"), disabled), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-switcher-").concat(expanded.value ? 'open' : 'close'), !isLeaf), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-checkbox-checked"), checked.value), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-checkbox-indeterminate"), halfChecked.value), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-selected"), selected.value), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-loading"), loading.value), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-active"), active), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-leaf-last"), isEndNode), _defineProperty(_classNames, "".concat(prefixCls, "-treenode-draggable"), draggableWithoutDisabled), _defineProperty(_classNames, "dragging", dragging), _defineProperty(_classNames, 'drop-target', dropTargetKey === eventKey), _defineProperty(_classNames, 'drop-container', dropContainerKey === eventKey), _defineProperty(_classNames, 'drag-over', !disabled && dragOver.value), _defineProperty(_classNames, 'drag-over-gap-top', !disabled && dragOverGapTop.value), _defineProperty(_classNames, 'drag-over-gap-bottom', !disabled && dragOverGapBottom.value), _defineProperty(_classNames, 'filter-node', filterTreeNode && filterTreeNode(eventData.value)), _classNames)),
  465. "style": attrs.style,
  466. "draggable": draggableWithoutDisabled,
  467. "aria-grabbed": dragging,
  468. "onDragstart": draggableWithoutDisabled ? onDragStart : undefined,
  469. "onDragenter": mergedDraggable ? onDragEnter : undefined,
  470. "onDragover": mergedDraggable ? onDragOver : undefined,
  471. "onDragleave": mergedDraggable ? onDragLeave : undefined,
  472. "onDrop": mergedDraggable ? onDrop : undefined,
  473. "onDragend": mergedDraggable ? onDragEnd : undefined,
  474. "onMousemove": onMousemove
  475. }, ariaSelected), dataOrAriaAttributeProps), [_createVNode(Indent, {
  476. "prefixCls": prefixCls,
  477. "level": level,
  478. "isStart": isStart,
  479. "isEnd": isEnd
  480. }, null), renderDragHandler(), renderSwitcher(), renderCheckbox(), renderSelector()]);
  481. };
  482. }
  483. });