* @deprecated no one is using this, will be removed in a future release
(node: INode, ref: any)
| 1240 | * @deprecated no one is using this, will be removed in a future release |
| 1241 | */ |
| 1242 | getSuitablePlace(node: INode, ref: any): any { |
| 1243 | const focusNode = this.document?.focusNode; |
| 1244 | // 如果节点是模态框,插入到根节点下 |
| 1245 | if (node?.componentMeta?.isModal) { |
| 1246 | return { container: focusNode, ref }; |
| 1247 | } |
| 1248 | |
| 1249 | if (!ref && focusNode && this.contains(focusNode)) { |
| 1250 | const rootCanDropIn = focusNode.componentMeta?.prototype?.options?.canDropIn; |
| 1251 | if ( |
| 1252 | rootCanDropIn === undefined || |
| 1253 | rootCanDropIn === true || |
| 1254 | (typeof rootCanDropIn === 'function' && rootCanDropIn(node)) |
| 1255 | ) { |
| 1256 | return { container: focusNode }; |
| 1257 | } |
| 1258 | |
| 1259 | return null; |
| 1260 | } |
| 1261 | |
| 1262 | if (this.isRoot() && this.children) { |
| 1263 | const dropElement = this.children.filter((c) => { |
| 1264 | if (!c.isContainerNode) { |
| 1265 | return false; |
| 1266 | } |
| 1267 | const canDropIn = c.componentMeta?.prototype?.options?.canDropIn; |
| 1268 | if ( |
| 1269 | canDropIn === undefined || |
| 1270 | canDropIn === true || |
| 1271 | (typeof canDropIn === 'function' && canDropIn(node)) |
| 1272 | ) { |
| 1273 | return true; |
| 1274 | } |
| 1275 | return false; |
| 1276 | })[0]; |
| 1277 | |
| 1278 | if (dropElement) { |
| 1279 | return { container: dropElement, ref }; |
| 1280 | } |
| 1281 | |
| 1282 | const rootCanDropIn = this.componentMeta?.prototype?.options?.canDropIn; |
| 1283 | if ( |
| 1284 | rootCanDropIn === undefined || |
| 1285 | rootCanDropIn === true || |
| 1286 | (typeof rootCanDropIn === 'function' && rootCanDropIn(node)) |
| 1287 | ) { |
| 1288 | return { container: this, ref }; |
| 1289 | } |
| 1290 | |
| 1291 | return null; |
| 1292 | } |
| 1293 | |
| 1294 | const canDropIn = this.componentMeta?.prototype?.options?.canDropIn; |
| 1295 | if (this.isContainer()) { |
| 1296 | if ( |
| 1297 | canDropIn === undefined || |
| 1298 | (typeof canDropIn === 'boolean' && canDropIn) || |
| 1299 | (typeof canDropIn === 'function' && canDropIn(node)) |
nothing calls this directly
no test coverage detected