waibu-bootstrap 1.2.11 → 1.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,9 @@ async function appLauncher () {
9
9
  }
10
10
 
11
11
  build = async () => {
12
- const { groupAttrs, attrToArray } = this.plugin.app.waibuMpa
12
+ const { locals } = this.component
13
+ const { routePath } = this.app.waibu
14
+ const { groupAttrs, attrToArray } = this.app.waibuMpa
13
15
  const menu = this.params.attr.menu ?? 'pages'
14
16
  const group = groupAttrs(this.params.attr, ['trigger'])
15
17
  let launcher = `<c:drawer id="${this.params.attr.id}" t:title="Modules" no-padding style="${menu === 'pages' ? 'width:350px' : ''}">\n`
@@ -18,7 +20,9 @@ async function appLauncher () {
18
20
  if (toolbar.length > 0) {
19
21
  if (menu === 'pages') toolbar.unshift('home')
20
22
  launcher += `<c:div padding="x-3 ${menu === 'home' ? 'bottom-3' : ''}">`
21
- launcher += '<c:navbar padding="y-0">\n<c:nav tag="ul" dim="width:100" flex="justify-content:end">\n'
23
+ launcher += '<c:navbar padding="y-0"><c:nav tag="ul">\n'
24
+ if (locals._meta.isAdmin) launcher += '<c:nav-item text="color:danger" href="' + routePath('waibuAdmin:/') + '" icon="lock" padding="start-0" />\n'
25
+ launcher += '</c:nav>\n<c:nav tag="ul">\n'
22
26
  for (const t of toolbar) {
23
27
  if (t === 'home') launcher += '<c:nav-item href="/" icon="house" padding="end-2" />\n'
24
28
  if (t === 'user' && this.plugin.app.sumba) launcher += '<c:sumba-nav-dropdown-user padding="end-2" />\n'