waibu-bootstrap 2.1.3 → 2.1.5

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.
@@ -0,0 +1,5 @@
1
+ async function waibuMpaAfterBuildPage ({ $, theme, req }) {
2
+ if (req.darkMode && theme.name === 'bootstrap') $('body').attr('data-bs-theme', 'dark')
3
+ }
4
+
5
+ export default waibuMpaAfterBuildPage
@@ -13,6 +13,7 @@ async function fieldset () {
13
13
  if (group.grid && !this.params.attr.card && !group.grid.margin) group.grid.margin = 'bottom-3'
14
14
  if (group.grid) this.params.html = await this.component.buildTag({ tag: 'gridRow', attr: group.grid, html: this.params.html })
15
15
  if (group.card) {
16
+ group.card.border = true
16
17
  if (!group.card.margin) group.card.margin = 'bottom-4'
17
18
  let sentence = `
18
19
  <c:card-header>
@@ -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')}\`, { ok: '${id}:post', close: 'y' })
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')}\`, { ok: '${this.params.attr.id}:post', close: 'y' })
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, type = 'modal') {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-bootstrap",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Bootstrap suport for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-01-18
4
+
5
+ - [2.1.5] Darkmode handling
6
+ - [2.1.5] Put border around fieldset if its type is a card
7
+
3
8
  ## 2026-01-17
4
9
 
5
10
  - [2.1.3] Sidebar buttons in inactive state should be transparent
11
+ - [2.1.4] Add capability to set custom theme & iconset through headers
6
12
 
7
13
  ## 2026-01-13
8
14
 
@@ -1,5 +0,0 @@
1
- async function waibuMpaBootstrapAfterBuildPage ({ $, req }) {
2
- if (req.darkMode) $('html').attr('data-bs-theme', 'dark')
3
- }
4
-
5
- export default waibuMpaBootstrapAfterBuildPage