waibu-bootstrap 2.1.3 → 2.1.4
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.
|
@@ -88,7 +88,12 @@ async function navDropdownSetting () {
|
|
|
88
88
|
id="${id}"
|
|
89
89
|
x-data="{
|
|
90
90
|
async signout () {
|
|
91
|
-
await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, {
|
|
91
|
+
await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, {
|
|
92
|
+
ok: '${id}:post',
|
|
93
|
+
close: 'y',
|
|
94
|
+
theme: '${this.component.theme.name}',
|
|
95
|
+
iconset: '${this.component.iconset.name}'
|
|
96
|
+
})
|
|
92
97
|
},
|
|
93
98
|
post () {
|
|
94
99
|
wmpa.postForm({}, '${routePath('sumba:/signout')}')
|
|
@@ -8,7 +8,12 @@ async function navItemSignout () {
|
|
|
8
8
|
this.params.attr.href = '#'
|
|
9
9
|
this.params.attr['x-data'] = `{
|
|
10
10
|
async signout () {
|
|
11
|
-
await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, {
|
|
11
|
+
await wbs.confirmation(\`${this.component.req.t('signoutWarning')}\`, {
|
|
12
|
+
ok: '${this.params.attr.id}:post',
|
|
13
|
+
close: 'y',
|
|
14
|
+
theme: '${this.component.theme.name}',
|
|
15
|
+
iconset: '${this.component.iconset.name}'
|
|
16
|
+
})
|
|
12
17
|
},
|
|
13
18
|
post () {
|
|
14
19
|
wmpa.postForm({}, '${routePath('sumba:/signout')}')
|
|
@@ -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, qs = {}) {
|
|
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'), 'body', undefined, undefined, qs)
|
|
114
114
|
const item = new this.engine.Offcanvas(`#${id}`)
|
|
115
115
|
const itemEl = document.getElementById(id)
|
|
116
116
|
if (window.mdb) this.engine.Collapse.getOrCreateInstance(itemEl)
|
|
@@ -156,7 +156,7 @@ class Wbs {
|
|
|
156
156
|
body.push('<c:div flex="justify-content:end" margin="top-3">')
|
|
157
157
|
body.push(...buttons)
|
|
158
158
|
body.push('</c:div></c:modal>')
|
|
159
|
-
await wmpa.addComponent(body.join('\n'), 'body')
|
|
159
|
+
await wmpa.addComponent(body.join('\n'), 'body', undefined, undefined, _.pick(opts, ['theme', 'iconset']))
|
|
160
160
|
const modal = new this.engine.Modal(`#${id}`)
|
|
161
161
|
const modalEl = document.getElementById(id)
|
|
162
162
|
modalEl.addEventListener('hidden.bs.modal', evt => {
|
|
@@ -196,10 +196,11 @@ class Wbs {
|
|
|
196
196
|
else console.error(`Function not found '${name}'`)
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
async openModal (id, body,
|
|
199
|
+
async openModal (id, body, opts = {}) {
|
|
200
|
+
let { type = 'modal' } = opts
|
|
200
201
|
if (_.isArray(body)) body = body.join('\n')
|
|
201
202
|
if (!['modal', 'offcanvas'].includes(type)) type = 'modal'
|
|
202
|
-
await wmpa.addComponent(body)
|
|
203
|
+
await wmpa.addComponent(body, undefined, undefined, undefined, _.pick(opts, ['theme', 'iconset']))
|
|
203
204
|
const item = new this.engine[_.upperFirst(type)](`#${id}`)
|
|
204
205
|
const itemEl = document.getElementById(id)
|
|
205
206
|
itemEl.addEventListener(`hidden.bs.${type}`, evt => {
|
package/package.json
CHANGED