MCPcopy
hub / github.com/tdewolff/minify / Tree

Function Tree

_benchmarks/sample_antd.js:118012–118920  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118010 var _super = Object(_babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(Tree);
118011
118012 function Tree() {
118013 var _this;
118014
118015 Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this, Tree);
118016
118017 _this = _super.apply(this, arguments);
118018 _this.destroyed = false;
118019 _this.state = {
118020 keyEntities: {},
118021 indent: null,
118022 selectedKeys: [],
118023 checkedKeys: [],
118024 halfCheckedKeys: [],
118025 loadedKeys: [],
118026 loadingKeys: [],
118027 expandedKeys: [],
118028 dragging: false,
118029 dragChildrenKeys: [],
118030 // dropTargetKey is the key of abstract-drop-node
118031 // the abstract-drop-node is the real drop node when drag and drop
118032 // not the DOM drag over node
118033 dropTargetKey: null,
118034 dropPosition: null,
118035 dropContainerKey: null,
118036 dropLevelOffset: null,
118037 dropTargetPos: null,
118038 dropAllowed: true,
118039 // the abstract-drag-over-node
118040 // if mouse is on the bottom of top dom node or no the top of the bottom dom node
118041 // abstract-drag-over-node is the top node
118042 dragOverNodeKey: null,
118043 treeData: [],
118044 flattenNodes: [],
118045 focused: false,
118046 activeKey: null,
118047 listChanging: false,
118048 prevProps: null
118049 };
118050 _this.dragStartMousePosition = null;
118051 _this.listRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9__["createRef"]();
118052
118053 _this.onNodeDragStart = function (event, node) {
118054 var _this$state = _this.state,
118055 expandedKeys = _this$state.expandedKeys,
118056 keyEntities = _this$state.keyEntities;
118057 var onDragStart = _this.props.onDragStart;
118058 var eventKey = node.props.eventKey;
118059 _this.dragNode = node;
118060 _this.dragStartMousePosition = {
118061 x: event.clientX,
118062 y: event.clientY
118063 };
118064 var newExpandedKeys = Object(_util__WEBPACK_IMPORTED_MODULE_14__[/* arrDel */ "b"])(expandedKeys, eventKey);
118065
118066 _this.setState({
118067 dragging: true,
118068 dragChildrenKeys: Object(_util__WEBPACK_IMPORTED_MODULE_14__[/* getDragChildrenKeys */ "g"])(eventKey, keyEntities),
118069 indent: _this.listRef.current.getIndentWidth()

Callers

nothing calls this directly

Calls 8

onExpandFunction · 0.85
NumberFunction · 0.85
onClickFunction · 0.85
onDoubleClickFunction · 0.85
onKeyDownFunction · 0.85
onSelectFunction · 0.70
onLoadFunction · 0.70
resolveFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…