src/overlay/utils/position.js
// According to the location of the overflow to calculate the desired positioning
According to the location of the overflow to calculate the desired positioning
According to the location of the overflow to calculate the desired positioning
_getExpectedAlign() {
        const align = this.isRtl ? this._replaceAlignDir(this.align, /l|r/g, { l: 'r', r: 'l' }) : this.align;
        const expectedAlign = [align];
        if (this.needAdjust) {
            if (/t|b/g.test(align)) {
                expectedAlign.push(this._replaceAlignDir(align, /t|b/g, { t: 'b', b: 't' }));
            }
            if (/l|r/g.test(align)) {
                expectedAlign.push(this._replaceAlignDir(align, /l|r/g, { l: 'r', r: 'l' }));
            }
            if (/c/g.test(align)) {
                expectedAlign.push(this._replaceAlignDir(align, /c(?= |$)/g, { c: 'l' }));
                expectedAlign.push(this._replaceAlignDir(align, /c(?= |$)/g, { c: 'r' }));
            }
            expectedAlign.push(
                this._replaceAlignDir(align, /l|r|t|b/g, {
                    l: 'r',
                    r: 'l',
                    t: 'b',
                    b: 't',
                })
            );
        }
        return expectedAlign;
    }
_getExpectedAlign ( ) { const align = this . isRtl ? this . _replaceAlignDir ( this . align , / l|r / g , { l : 'r' , r : 'l' } ) : this . align ; const expectedAlign = [ align ] ; if ( this . needAdjust ) { if ( / t|b / g . test ( align ) ) { expectedAlign . push ( this . _replaceAlignDir ( align , / t|b / g , { t : 'b' , b : 't' } ) ) ; } if ( / l|r / g . test ( align ) ) { expectedAlign . push ( this . _replaceAlignDir ( align , / l|r / g , { l : 'r' , r : 'l' } ) ) ; } if ( / c / g . test ( align ) ) { expectedAlign . push ( this . _replaceAlignDir ( align , / c(?= |$) / g , { c : 'l' } ) ) ; expectedAlign . push ( this . _replaceAlignDir ( align , / c(?= |$) / g , { c : 'r' } ) ) ; } expectedAlign . push ( this . _replaceAlignDir ( align , / l|r|t|b / g , { l : 'r' , r : 'l' , t : 'b' , b : 't' , } ) ) ; } return expectedAlign ; }
According to the location of the overflow to calculate the desired positioning
According to the location of the overflow to calculate the desired positioning