Comparing version 3.0.0-alpha.14 to 3.0.0-alpha.15
# Changelog for osjs-gui | ||
## 3.0.0-alpha.15 | ||
* Updated default entry box styles | ||
* Updated iframe style | ||
* Some improvements to default flexing | ||
## 3.0.0-alpha.14 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@osjs/gui", | ||
"version": "3.0.0-alpha.14", | ||
"version": "3.0.0-alpha.15", | ||
"description": "OS.js v3 GUI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,19 +40,23 @@ /* | ||
const boxStyles = (props, orientation = null) => | ||
Object.assign({}, { | ||
flexDirection: orientation | ||
? orientation === 'vertical' ? 'row' : 'column' | ||
: orientation, | ||
flexGrow: props.grow, | ||
flexShrink: props.shrink, | ||
flexBasis: typeof props.basis === 'number' ? String(props.basis) + 'px' : props.basis, | ||
alignItems: props.align, | ||
justifyContent: props.justify, | ||
margin: typeof props.padding === 'undefined' || props.padding === true ? undefined : '0' | ||
}, props.style || {}); | ||
const flexes = { | ||
vertical: 'row', | ||
horizontal: 'column' | ||
}; | ||
const boxStyles = (props, orientation = null) => Object.assign({}, { | ||
flexDirection: flexes[orientation], | ||
flexGrow: props.grow, | ||
flexShrink: props.shrink, | ||
flexBasis: typeof props.basis === 'number' ? String(props.basis) + 'px' : props.basis, | ||
alignItems: props.align, | ||
justifyContent: props.justify, | ||
margin: typeof props.padding === 'undefined' || props.padding === true ? undefined : '0' | ||
}, props.style || {}); | ||
const boxProps = (name, props, defaultOrientation = 'horizontal') => { | ||
let orientation = props.orientation || defaultOrientation; | ||
if (orientation !== defaultOrientation) { | ||
orientation = defaultOrientation === 'horizontal' ? 'vertical' : 'horizontal'; | ||
if (defaultOrientation !== null) { | ||
if (orientation !== defaultOrientation) { | ||
orientation = defaultOrientation === 'horizontal' ? 'vertical' : 'horizontal'; | ||
} | ||
} | ||
@@ -91,3 +95,2 @@ | ||
const getValue = cbInput || (ev => [ev.target.value]); | ||
const wrapperProps = boxProps('osjs-gui-field', props.box || {}, name); | ||
const fieldProps = Object.assign( | ||
@@ -108,5 +111,8 @@ { | ||
return h('div', wrapperProps, cb(fieldProps)); | ||
return h('div', { | ||
class: className('osjs-gui-' + name, props, 'osjs-gui-field'), | ||
style: boxStyles(props.box || {}) | ||
}, cb(fieldProps)); | ||
}; | ||
export {className, boxProps, boxStyles, filteredProps, fieldWrapper, icon}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96113
1539