waibu-bootstrap 1.0.17 → 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.17",
3
+ "version": "1.0.18",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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>`)