mofron-comp-appheader
Advanced tools
Comparing version 0.0.1 to 0.1.0
109
index.js
/** | ||
* @file mofron-comp-header-title/index.js | ||
* @file mofron-comp-apphdr/index.js | ||
* @author simpart | ||
*/ | ||
let mf = require('mofron'); | ||
let Header = require('mofron-comp-titleheader'); | ||
let Header = require('mofron-comp-ttlhdr'); | ||
mf.comp.AppHeader = class extends Header { | ||
mf.comp.Apphdr = class extends Header { | ||
constructor (prm_opt) { | ||
constructor (po) { | ||
try { | ||
super(); | ||
this.name('AppHeader'); | ||
this.prmOpt(prm_opt); | ||
this.name('Apphdr'); | ||
this.prmOpt(po); | ||
} catch (e) { | ||
@@ -24,14 +24,9 @@ console.error(e.stack); | ||
super.initDomConts(prm); | ||
this.addChild(new mf.Component()); | ||
this.addChild( | ||
new mf.Component({ | ||
style : { 'margin-left' : 'auto', | ||
'margin-right' : '40px' }//, | ||
//addChild : new Text({ | ||
// style : { 'margin-right' : '40px' }, | ||
// size : 30, | ||
// text : 'TEST' | ||
//}) | ||
}) | ||
); | ||
this.titleBase().style({ | ||
'position' : 'fixed' | ||
}); | ||
/* set index area */ | ||
this.addChild(this.indexBase()); | ||
} catch (e) { | ||
@@ -43,15 +38,21 @@ console.error(e.stack); | ||
center (chd, disp) { | ||
image (img) { | ||
try { | ||
if (undefined === chd) { | ||
let ttl = this.title(); | ||
if (undefined === img) { | ||
/* getter */ | ||
let center = this.child()[1].child(); | ||
if (null !== center) { | ||
return (1 === center.length) ? center[0] : center; | ||
} else { | ||
return null; | ||
return ( (0 !== ttl.length) || | ||
(true === mf.func.isInclude(ttl[0], 'Image')) ) ? ttl[0] : null; | ||
} | ||
/* setter */ | ||
if (true !== mf.func.isInclude(img, 'Image')) { | ||
throw new Error('invalid parameter'); | ||
} | ||
this.title(img); | ||
if (0 !== ttl.length) { | ||
for (let tidx in ttl) { | ||
ttl[tidx].destroy(); | ||
} | ||
this.addTitle(ttl); | ||
} | ||
/* setter */ | ||
this.child()[1].addChild(chd, disp); | ||
} catch (e) { | ||
@@ -63,15 +64,21 @@ console.error(e.stack); | ||
right (chd, disp) { | ||
indexBase (val) { | ||
try { | ||
if (undefined === chd) { | ||
if (undefined === val) { | ||
/* getter */ | ||
let rgh = this.child()[2].child(); | ||
if (null !== rgh) { | ||
return (1 === rgh.length) ? rgh[0] : rgh; | ||
} else { | ||
return null; | ||
if (undefined === this.m_idxbs) { | ||
this.indexBase(new mf.Component()); | ||
} | ||
return this.m_idxbs; | ||
} | ||
/* setter */ | ||
this.child()[2].addChild(chd, disp); | ||
if (true !== mf.func.isInclude(val, 'Component')) { | ||
throw new Error('invalid parameter'); | ||
} | ||
val.style({ | ||
'display' : 'flex' , | ||
'align-items' : 'center' , | ||
'width' : '100%' | ||
}); | ||
this.m_idxbs = val; | ||
} catch (e) { | ||
@@ -82,3 +89,33 @@ console.error(e.stack); | ||
} | ||
indexConts (val) { | ||
try { | ||
let idxbs = this.indexBase(); | ||
if (undefined === val) { | ||
/* getter */ | ||
return idxcnt.child(); | ||
} | ||
/* setter */ | ||
if (true !== mf.func.isInclude(val, 'Component')) { | ||
throw new Error('invalid parameter'); | ||
} | ||
val.style({ | ||
'margin-right' : '20px', | ||
'margin-left' : 'auto' | ||
}); | ||
if (0 === idxbs.child().length) { | ||
idxbs.addChild(val); | ||
} else { | ||
idxbs.updChild(idxbs.child()[0], val); | ||
} | ||
this.url( | ||
(null === this.url()) ? './' : undefined | ||
); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
} | ||
module.exports = mf.comp.AppHeader; | ||
module.exports = mf.comp.Apphdr; |
{ | ||
"name": "mofron-comp-appheader", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "app header component for mofron", | ||
@@ -9,9 +9,11 @@ "main": "index.js", | ||
}, | ||
"dependencies": { | ||
"mofron-comp-ttlhdr" : "" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/simpart/mofron-comp-appheader.git" | ||
"url": "git+https://github.com/simpart/mofron-comp-apphdr.git" | ||
}, | ||
"keywords": [ | ||
"front", | ||
"end" | ||
"front-end" | ||
], | ||
@@ -21,5 +23,5 @@ "author": "simparts", | ||
"bugs": { | ||
"url": "https://github.com/simpart/mofron-comp-appheader/issues" | ||
"url": "https://github.com/simpart/mofron-comp-apphdr/issues" | ||
}, | ||
"homepage": "https://github.com/simpart/mofron-comp-appheader#readme" | ||
"homepage": "https://github.com/simpart/mofron-comp-apphdr#readme" | ||
} |
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
4914
108
1
2
+ Addedmofron-comp-ttlhdr@
+ Addedmofron-comp-ttlhdr@0.6.3(transitive)
+ Addedmofron-event-click@0.7.1(transitive)
+ Addedmofron-event-common@0.4.1(transitive)