container: refactor strip using panel as base

This commit is contained in:
jean-emmanuel 2017-06-05 18:43:49 +02:00
parent 1f858cc205
commit 67eae0ef84
11 changed files with 1965 additions and 668 deletions

View file

@ -37,6 +37,8 @@ module.exports = class Modal extends _widgets_base {
_chidlren:'children',
variables:{},
widgets:[],
tabs:[]
}

View file

@ -1,6 +1,6 @@
var _widgets_base = require('../common/_widgets_base')
var Panel = require('./panel')
module.exports = class Strip extends _widgets_base {
module.exports = class Strip extends Panel {
static defaults() {
@ -15,12 +15,18 @@ module.exports = class Strip extends _widgets_base {
top:'auto',
width:'auto',
height:'auto',
horizontal:false,
color:'auto',
css:'',
_strip: 'strip',
horizontal:false,
stretch:false,
_children:'children',
variables:{},
widgets:[]
}
@ -28,18 +34,13 @@ module.exports = class Strip extends _widgets_base {
constructor(options) {
super({...options, html: '<div class="strip"></div>'})
options.props = {...Panel.defaults(), ...options.props}
super(options)
var parsewidgets = require('../../parser').widgets
this.container.addClass(this.getProp('horizontal') ? 'horizontal' : 'vertical')
this.container.addClass(this.getProp('stretch') ? 'stretch' : '')
if (this.getProp('horizontal')) {
this.container.addClass('horizontal')
} else {
this.container.addClass('vertical')
}
parsewidgets(this.props.widgets, this.widget, this)
}

View file

@ -92,6 +92,7 @@
overflow: hidden;
.white {
--color-light-fg: var(--color-white);
height:100%;
.light.active:before {
opacity: .5;
background:var(--color-fg);

View file

@ -70,6 +70,73 @@
}
.strip-container {
@extend .panel-container-base;
width: 100rem;
height: 100%;
&.horizontal {
width: 100%;
height: 130rem;
}
&.vertical {
> .panel {
display: flex;
flex-direction: column;
> .widget {
// flex:1;
max-width: 100%;
width: 100%;
min-height: 0!important;
}
}
}
&.horizontal {
> .panel {
display: flex;
flex-direction: row;
> .widget {
// flex:1;
height: 100%;
max-height: 100%;
min-width: 0!important;
}
left:29rem;
top:-1rem;
}
&.nolabel > .panel {
left:-1rem;
}
> .label {
width:30rem;
line-height: 20rem;
flex-shrink: 0;
height:100%;
border-bottom:0;
border-right:1rem solid var(--color-bg);
max-height: initial;
span {
transform: rotate(180deg);
display: block;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
-webkit-writing-mode:vertical-lr;
writing-mode:vertical-lr;
text-align: center;
}
}
}
&.stretch > .panel > .widget {
flex:1
}
background: var(--color-fg);
}
.modal-container {
@extend .panel-container-base;
@extend .toggle-container;

View file

@ -1,96 +0,0 @@
.strip-container {
width:100rem;
height:100%;
overflow: visible;
> .strip {
height: 100%;
width:100%;
display: flex;
flex-direction: column;
> .widget {
width:auto;
.label {
background-image: none;
}
}
}
&.vertical {
> .strip {
align-items: center;
}
> .strip > .widget {
width: 100%;
min-width: 100%;
margin-left:0;
border-left:0;
margin-left:0rem;
}
&::before {
border-right: 1rem solid var(--color-bg);
}
&.nolabel > .strip > .widget {
&:first-child{
border-top:0;
}
}
}
&.horizontal {
width:100%;
height:200rem;
display: flex;
flex-direction: row;
&::before {
border-bottom: 1rem solid var(--color-bg);
}
> .strip {
flex-direction: row;
flex:1;
> .widget {
flex-shrink: initial;
width: 100%;
min-height: 100%;
margin-top:0;
border-top:0;
margin-left:0rem;
height:100%;
&:last-child {
border-right:0;
}
}
}
> .label {
width:30rem;
line-height: 20rem;
flex-shrink: 0;
height:100%;
border-bottom:0;
max-height: initial;
span {
transform: rotate(180deg);
display: block;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
-webkit-writing-mode:vertical-lr;
writing-mode:vertical-lr;
text-align: center;
}
}
&.nolabel > .strip > .widget {
&:first-child{
border-left:0;
}
}
}
}

View file

@ -1,6 +1,6 @@
.toggle-container {
width:100rem;
min-height: 60rem;
height: 60rem;
flex-shrink: 0;
padding:0!important;
background: var(--color-light-fg);