waibu-bootstrap 2.6.0 → 2.6.1
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.
|
@@ -25,7 +25,7 @@ class Wbs {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
notifyHtml (id, html) {
|
|
28
|
-
wmpa.addComponentHtml(html, '.toast-container')
|
|
28
|
+
wmpa.addComponentHtml(html, { selector: '.toast-container' })
|
|
29
29
|
const el = document.getElementById(id)
|
|
30
30
|
if (!el) return
|
|
31
31
|
el.addEventListener('hidden.bs.toast', () => {
|
|
@@ -43,7 +43,7 @@ class Wbs {
|
|
|
43
43
|
if (title) body += `title="${title}" `
|
|
44
44
|
if (caption) body += `caption="${caption}" `
|
|
45
45
|
body += `><c:t value="${transValue}">${msg}</c:t></c:toast>`
|
|
46
|
-
await wmpa.addComponent(body, '.toast-container')
|
|
46
|
+
await wmpa.addComponent(body, { selector: '.toast-container' })
|
|
47
47
|
const el = document.getElementById(id)
|
|
48
48
|
if (!el) return
|
|
49
49
|
el.addEventListener('hidden.bs.toast', () => {
|
|
@@ -104,13 +104,13 @@ class Wbs {
|
|
|
104
104
|
return await this.alert(msg, opts.title ?? 'Prompt', opts)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
async appLauncher (params, menu,
|
|
107
|
+
async appLauncher (params, menu, opts = {}) {
|
|
108
108
|
document.body.click()
|
|
109
109
|
const id = wmpa.randomId()
|
|
110
110
|
const toolbar = params ? `toolbar="${params}"` : ''
|
|
111
111
|
const menuId = menu ? `menu="${menu}"` : ''
|
|
112
112
|
const body = [`<c:app-launcher id="${id}" ${toolbar} ${menuId} />`]
|
|
113
|
-
await wmpa.addComponent(body.join('\n'), 'body',
|
|
113
|
+
await wmpa.addComponent(body.join('\n'), { selector: 'body', ...opts })
|
|
114
114
|
const item = new this.engine.Offcanvas(`#${id}`)
|
|
115
115
|
const itemEl = document.getElementById(id)
|
|
116
116
|
itemEl.addEventListener('hidden.bs.offcanvas', evt => {
|
|
@@ -155,7 +155,8 @@ class Wbs {
|
|
|
155
155
|
body.push('<c:div flex="justify-content:end" margin="top-3">')
|
|
156
156
|
body.push(...buttons)
|
|
157
157
|
body.push('</c:div></c:modal>')
|
|
158
|
-
|
|
158
|
+
const options = _.pick(opts, ['theme', 'iconset'])
|
|
159
|
+
await wmpa.addComponent(body.join('\n'), { selector: 'body', ...options })
|
|
159
160
|
const modal = new this.engine.Modal(`#${id}`)
|
|
160
161
|
const modalEl = document.getElementById(id)
|
|
161
162
|
modalEl.addEventListener('hidden.bs.modal', evt => {
|
|
@@ -199,7 +200,8 @@ class Wbs {
|
|
|
199
200
|
let { type = 'modal' } = opts
|
|
200
201
|
if (_.isArray(body)) body = body.join('\n')
|
|
201
202
|
if (!['modal', 'offcanvas'].includes(type)) type = 'modal'
|
|
202
|
-
|
|
203
|
+
const options = _.pick(opts, ['theme', 'iconset'])
|
|
204
|
+
await wmpa.addComponent(body, { ...options })
|
|
203
205
|
const item = new this.engine[_.upperFirst(type)](`#${id}`)
|
|
204
206
|
const itemEl = document.getElementById(id)
|
|
205
207
|
itemEl.addEventListener(`hidden.bs.${type}`, evt => {
|
package/package.json
CHANGED