TreeNode.js 23 KB

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