mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-05 01:37:17 +00:00
fix: 修复兼容报错
This commit is contained in:
parent
77fc3f2db2
commit
080102db5b
@ -1,3 +1,4 @@
|
||||
import { IPublicModelNode } from './../../../types/src/shell/model/node';
|
||||
import { Editor, globalContext } from '@alilc/lowcode-editor-core';
|
||||
import { isFormEvent } from '@alilc/lowcode-utils';
|
||||
import {
|
||||
@ -24,16 +25,16 @@ export function isInLiveEditing() {
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function getNextForSelect(next: any, head?: any, parent?: any): any {
|
||||
function getNextForSelect(next: IPublicModelNode | null, head?: any, parent?: IPublicModelNode | null): any {
|
||||
if (next) {
|
||||
if (!head) {
|
||||
return next;
|
||||
}
|
||||
|
||||
let ret;
|
||||
if (next.isContainer()) {
|
||||
const children = next.getChildren() || [];
|
||||
if (children && !children.isEmpty()) {
|
||||
if (next.isContainer) {
|
||||
const children = next.children;
|
||||
if (children && !children.isEmpty) {
|
||||
ret = getNextForSelect(children.get(0));
|
||||
if (ret) {
|
||||
return ret;
|
||||
@ -48,19 +49,19 @@ function getNextForSelect(next: any, head?: any, parent?: any): any {
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
return getNextForSelect(parent.nextSibling, false, parent.getParent());
|
||||
return getNextForSelect(parent.nextSibling, false, parent?.parent);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function getPrevForSelect(prev: any, head?: any, parent?: any): any {
|
||||
function getPrevForSelect(prev: IPublicModelNode | null, head?: any, parent?: IPublicModelNode | null): any {
|
||||
if (prev) {
|
||||
let ret;
|
||||
if (!head && prev.isContainer()) {
|
||||
const children = prev.getChildren() || [];
|
||||
const lastChild = children && !children.isEmpty() ? children.get(children.size - 1) : null;
|
||||
if (!head && prev.isContainer) {
|
||||
const children = prev.children;
|
||||
const lastChild = children && !children.isEmpty ? children.get(children.size - 1) : null;
|
||||
|
||||
ret = getPrevForSelect(lastChild);
|
||||
if (ret) {
|
||||
|
||||
@ -10,11 +10,11 @@ export default class NodeChildren implements IPublicModelNodeChildren {
|
||||
this[nodeChildrenSymbol] = nodeChildren;
|
||||
}
|
||||
|
||||
static create(nodeChldren: InnerNodeChildren | null): IPublicModelNodeChildren | null {
|
||||
if (!nodeChldren) {
|
||||
static create(nodeChildren: InnerNodeChildren | null): IPublicModelNodeChildren | null {
|
||||
if (!nodeChildren) {
|
||||
return null;
|
||||
}
|
||||
return new NodeChildren(nodeChldren);
|
||||
return new NodeChildren(nodeChildren);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user