@difizen/mana-react
Version:
74 lines (73 loc) • 2.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Layout = void 0;
var _index = require("../resize/index");
var flexDirectionMap = {
'left-to-right': {
direction: 'row',
size: 'width',
domSize: 'clientHeight',
minSize: 'minWidth',
maxSize: 'maxWidth'
},
'right-to-left': {
direction: 'row-reverse',
size: 'width',
domSize: 'clientHeight',
minSize: 'minWidth',
maxSize: 'maxWidth'
},
'top-to-bottom': {
direction: 'column',
size: 'height',
domSize: 'clientWidth',
minSize: 'minHeight',
maxSize: 'maxHeight'
},
'bottom-to-top': {
direction: 'column-reverse',
size: 'height',
domSize: 'clientWidth',
minSize: 'minHeight',
maxSize: 'maxHeight'
}
};
var Layout;
(function (_Layout) {
function getFlexDirection(direction) {
return flexDirectionMap[direction].direction;
}
_Layout.getFlexDirection = getFlexDirection;
function getSizeProperty(direction) {
return flexDirectionMap[direction].size;
}
_Layout.getSizeProperty = getSizeProperty;
function getDomSizeProperty(direction) {
return flexDirectionMap[direction].domSize;
}
_Layout.getDomSizeProperty = getDomSizeProperty;
function getMinSizeProperty(direction) {
return flexDirectionMap[direction].minSize;
}
_Layout.getMinSizeProperty = getMinSizeProperty;
function getMaxSizeProperty(direction) {
return flexDirectionMap[direction].maxSize;
}
_Layout.getMaxSizeProperty = getMaxSizeProperty;
function getResizeHandle(direction) {
if (direction === 'bottom-to-top' || direction === 'top-to-bottom') {
return _index.ResizeHandleVertical;
}
return _index.ResizeHandleHorizontal;
}
_Layout.getResizeHandle = getResizeHandle;
function getTabbarDirection(direction) {
if (direction === 'bottom-to-top' || direction === 'top-to-bottom') {
return 'row';
}
return 'column';
}
_Layout.getTabbarDirection = getTabbarDirection;
})(Layout || (exports.Layout = Layout = {}));