waibu-bootstrap 1.0.16 → 1.0.18

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/bajo/config.json CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "waibu": {
3
3
  "prefix": "bootstrap"
4
+ },
5
+ "siteSetting": {
6
+ "toastAutohideDelayDur": "5s"
4
7
  }
5
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@ async function form () {
27
27
  for (const _attr of attrs) {
28
28
  const [type, val] = _attr.split(':')
29
29
  const [label, color] = (val ?? '').split('-')
30
- if (!['submit', 'reset', 'button'].includes(type)) continue
30
+ if (!['submit', 'reset', 'button', 'a'].includes(type)) continue
31
31
  const attr = { type, color: color ?? 'secondary', margin: 'start-2' }
32
32
  const html = this.component.req.t(isEmpty(label) ? pascalCase(type) : label)
33
33
  rBtns.push(await this.component.buildTag({ tag: 'btn', attr, html }))
@@ -9,8 +9,12 @@ async function toast () {
9
9
  }
10
10
 
11
11
  async build () {
12
- const { isString, omit } = this.plugin.app.bajo.lib._
12
+ const { isString, omit, has, get } = this.plugin.app.bajo.lib._
13
13
  const header = []
14
+ if (this.params.attr.noHide) this.params.attr.dataBsAutohide = 'false'
15
+ let delay = get(this, 'component.req.site.setting.waibuBootstrap.toastAutohideDelayDur', 5000)
16
+ if (has(this.params.attr, 'autohideDelay')) delay = Number(this.params.attr.autohideDelay) || delay
17
+ this.params.attr.dataBsDelay = delay
14
18
  if (isString(this.params.attr.title)) {
15
19
  header.push('<div class="toast-header">')
16
20
  header.push(`<strong class="me-auto">${this.params.attr.title}</strong>`)