waibu-bootstrap 1.0.15 → 1.0.16

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.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,7 +19,7 @@ async function form () {
19
19
  const group = groupAttrs(this.params.attr, ['grid'])
20
20
  this.params.attr = group._
21
21
  if (group.grid) this.params.html = await this.component.buildTag({ tag: 'gridRow', attr: group.grid, html: this.params.html })
22
- if (this.params.attr.button === true) this.params.attr.button = 'reset:Reset-link submit:Submit-primary'
22
+ if (this.params.attr.button === true) this.params.attr.button = 'reset:reset-link submit:submit-primary'
23
23
  if (this.params.attr.button) {
24
24
  const rBtns = []
25
25
  const lBtns = []
@@ -13,8 +13,8 @@ async function navDropdownDarkmode () {
13
13
  content
14
14
  }
15
15
  const html = [
16
- await this.component.buildTag({ tag: 'dropdownItem', attr: { href: this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'false') }), active: !this.component.req.darkMode }, html: this.component.req.t('Bright Mode') }),
17
- await this.component.buildTag({ tag: 'dropdownItem', attr: { href: this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'true') }), active: this.component.req.darkMode }, html: this.component.req.t('Dark Mode') })
16
+ await this.component.buildTag({ tag: 'dropdownItem', attr: { href: this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'false') }), active: !this.component.req.darkMode }, html: this.component.req.t('brightMode') }),
17
+ await this.component.buildTag({ tag: 'dropdownItem', attr: { href: this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'true') }), active: this.component.req.darkMode }, html: this.component.req.t('darkMode') })
18
18
  ].join('\n')
19
19
  this.params.noTag = true
20
20
  this.params.html = await this.component.buildTag({ tag: 'navItem', attr, html })
@@ -2,7 +2,7 @@ async function navDropdownLanguage () {
2
2
  return class NavDropdownLanguage extends this.baseFactory {
3
3
  async build () {
4
4
  const { camelCase } = this.plugin.app.bajo.lib._
5
- const { supportedLngs } = this.plugin.app.bajoI18N.config
5
+ const { supported } = this.plugin.app.bajo.config.intl
6
6
  const lang = this.component.req.lang
7
7
  const attr = {
8
8
  dropdown: true,
@@ -11,7 +11,7 @@ async function navDropdownLanguage () {
11
11
  content: lang.toUpperCase()
12
12
  }
13
13
  const html = []
14
- for (const s of supportedLngs) {
14
+ for (const s of supported) {
15
15
  html.push(await this.component.buildTag({
16
16
  tag: 'dropdownItem',
17
17
  attr: { href: this.component.buildUrl({ params: { lang: s } }), active: lang === s },
@@ -2,7 +2,7 @@ async function navDropdownSetting () {
2
2
  return class NavDropdownSetting extends this.baseFactory {
3
3
  async build () {
4
4
  const { set, camelCase } = this.plugin.app.bajo.lib._
5
- const { supportedLngs } = this.plugin.app.bajoI18N.config
5
+ const { supported } = this.plugin.app.bajo.config.intl
6
6
  const { groupAttrs } = this.plugin.app.waibuMpa
7
7
  const { generateId } = this.plugin.app.bajo
8
8
  const { routePath } = this.plugin.app.waibu
@@ -18,28 +18,28 @@ async function navDropdownSetting () {
18
18
  <c:dropdown-item href="${this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'false') })}" ${this.component.req.darkMode ? '' : 'active'} t:content="Bright" />
19
19
  <c:dropdown-item href="${this.component.buildUrl({ params: set({}, cfgWmpa.darkMode.qsKey, 'true') })}" ${!this.component.req.darkMode ? '' : 'active'} t:content="Dark" />
20
20
  `
21
- if (supportedLngs.length > 0) {
21
+ if (supported.length > 0) {
22
22
  html += `
23
23
  <c:dropdown-item divider />
24
24
  <c:dropdown-item header t:content="Language" />
25
25
  `
26
- for (const s of supportedLngs) {
26
+ for (const s of supported) {
27
27
  html += `<c:dropdown-item href="${this.component.buildUrl({ params: { lang: s } })}" ${this.component.req.lang === s ? 'active' : ''} t:content="${camelCase('lang ' + s)}" />`
28
28
  }
29
29
  }
30
30
  html += `
31
31
  <c:dropdown-item divider />
32
- <c:dropdown-item t:content="Fullscreen"
32
+ <c:dropdown-item t:content="fullscreen"
33
33
  x-data="{
34
- inText: '${this.component.req.t('Fullscreen')}',
35
- outText: '${this.component.req.t('Exit Fullscreen')}',
34
+ inText: '${this.component.req.t('fullscreen')}',
35
+ outText: '${this.component.req.t('exitFullscreen')}',
36
36
  async toggle () {
37
37
  const el = document.querySelector('body')
38
38
  if (!document.fullscreenElement) {
39
39
  try {
40
40
  await el.requestFullscreen()
41
41
  } catch (err) {
42
- await wbs.notify('Can\\'t go fullscreen, sorry!', { type: 'danger' })
42
+ await wbs.notify('cantGoFullscreen', { type: 'danger' })
43
43
  }
44
44
  } else {
45
45
  document.exitFullscreen()
@@ -61,7 +61,7 @@ async function navDropdownSetting () {
61
61
  if (this.component.req.user) {
62
62
  const id = generateId('alpha')
63
63
  html += `
64
- <c:dropdown-item t:content="Signout"
64
+ <c:dropdown-item t:content="signout"
65
65
  id="${id}"
66
66
  x-data="{
67
67
  async signout () {
@@ -3,7 +3,7 @@ async function navDropdownUser () {
3
3
  async build () {
4
4
  const { routePath } = this.plugin.app.waibu
5
5
  const icon = this.component.req.iconset ? await this.component.buildTag({ tag: 'icon', attr: { name: 'person' } }) : ''
6
- let text = this.component.req.user ? `${this.component.req.user.firstName} ${this.component.req.user.lastName}` : this.component.req.t('Guest')
6
+ let text = this.component.req.user ? `${this.component.req.user.firstName} ${this.component.req.user.lastName}` : this.component.req.t('guest')
7
7
  if (this.params.attr.noText) text = ''
8
8
  const html = []
9
9
  const attr = {
@@ -18,15 +18,15 @@ async function navDropdownUser () {
18
18
  attr.href = routePath(this.component.req.user ? 'sumba:/my-stuff/profile' : 'sumba:/signin')
19
19
  } else {
20
20
  if (this.component.req.user) {
21
- html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/profile') }, html: this.component.req.t('Your Profile') }))
22
- html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/change-password') }, html: this.component.req.t('Change Password') }))
21
+ html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/profile') }, html: this.component.req.t('yourProfile') }))
22
+ html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/my-stuff/change-password') }, html: this.component.req.t('changePassword') }))
23
23
  html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { divider: true } }))
24
- html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signout') }, html: this.component.req.t('Signout') }))
24
+ html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signout') }, html: this.component.req.t('signout') }))
25
25
  } else {
26
- html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signin') }, html: this.component.req.t('Signin') }))
26
+ html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/signin') }, html: this.component.req.t('signin') }))
27
27
  html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { divider: true } }))
28
- html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/user/signup') }, html: this.component.req.t('Signup') }))
29
- html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/user/forgot-password') }, html: this.component.req.t('Forgot Password') }))
28
+ html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/user/signup') }, html: this.component.req.t('signup') }))
29
+ html.push(await this.component.buildTag({ tag: 'dropdownItem', attr: { href: routePath('sumba:/user/forgot-password') }, html: this.component.req.t('forgotPassword') }))
30
30
  }
31
31
  }
32
32
  this.params.noTag = true
File without changes