waibu-mpa 2.13.1 → 2.13.2

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.
@@ -309,7 +309,8 @@ class Wmpa {
309
309
 
310
310
  parseValue = (value, type) => {
311
311
  try {
312
- if (['integer', 'smallint'].includes(type)) value = parseInt(value)
312
+ if (type === 'boolean') value = value === 'true'
313
+ else if (['integer', 'smallint'].includes(type)) value = parseInt(value)
313
314
  else if (['float', 'double'].includes(type)) value = parseFloat(value)
314
315
  else if (['datetime', 'date', 'time'].includes(type)) value = new Date(Date.parse(value))
315
316
  else if (['array', 'object'].includes(type)) value = JSON.parse(value)
@@ -27,11 +27,11 @@ async function meta (options) {
27
27
  await runHook(`${this.ns}.${theme.name}:afterInjectMeta`, { meta: theme.meta, items, req })
28
28
  }
29
29
  // title
30
- const formatter = get(this, 'app.waibuMpa.pageTitleFormat', '%s : %s')
30
+ const format = get(this, 'app.waibuMpa.pageTitleFormat', '%s : %s')
31
31
  const title = page.fullTitle ?? page.title
32
32
  let pageTitle
33
- if (isFunction(formatter)) pageTitle = await formatter.call(this, locals)
34
- else pageTitle = sprintf(formatter, title, this.app.waibuMpa.getAppTitle(req))
33
+ if (isFunction(format)) pageTitle = await format.call(this, locals)
34
+ else pageTitle = sprintf(format, title, this.app.waibuMpa.getAppTitle(req))
35
35
  $('head').append(`<title>${pageTitle}</title>`)
36
36
  // favicon
37
37
  const favicon = this.app.waibuMpa.config.favicon
@@ -1,6 +1,7 @@
1
1
  import path from 'path'
2
2
 
3
3
  async function widgetFactory () {
4
+ const { kebabCase } = this.app.lib._
4
5
  class MpaWidget extends this.app.baseClass.MpaTools {
5
6
  static scripts = []
6
7
  static css = []
@@ -10,6 +11,12 @@ async function widgetFactory () {
10
11
 
11
12
  constructor ({ component = {}, params = {} } = {}) {
12
13
  super(component.plugin)
14
+ const names = kebabCase(this.constructor.name).split('-')
15
+ const alias = names.length > 1 ? names[0] : 'wbs'
16
+ let plugin = this.app.bajo.getPlugin(alias, true)
17
+ if (!plugin) plugin = this.app.waibuBootstrap
18
+ this.plugin = plugin
19
+ this.app = plugin.app
13
20
  this.component = component
14
21
  this.params = params
15
22
  this.block = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-mpa",
3
- "version": "2.13.1",
3
+ "version": "2.13.2",
4
4
  "description": "MPA support for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-11
4
+
5
+ - [2.13.2] Bug fix in ```Wmpa.parseValue()```
6
+ - [2.13.2] Bug fix in ```Widget.plugin``` now match the right plugin
7
+
3
8
  ## 2026-04-07
4
9
 
5
10
  - [2.13.0] Bug fix in ```component.buildOptions()```