waibu-mpa 2.14.1 → 2.14.3

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.
@@ -3,7 +3,8 @@ export function printScript (script) {
3
3
  const { stringifyAttribs } = this.app.waibuMpa
4
4
  const { isString, omit } = this.app.lib._
5
5
  if (isString(script)) script = { src: script }
6
- return `<script src="${routePath(script.src)}" ${stringifyAttribs(omit(script, ['src']))}></script>`
6
+ const result = `<script src="${routePath(script.src)}" ${stringifyAttribs(omit(script, ['src']))}></script>`
7
+ return result
7
8
  }
8
9
 
9
10
  export async function collectRegular (type, transformer, options = {}) {
@@ -216,7 +216,7 @@ async function componentFactory () {
216
216
  if (!has(params.attr, 'options')) return
217
217
  const items = []
218
218
  let input = params.attr.options
219
- let values = attrToArray(params.attr.value)
219
+ let values = attrToArray(params.attr.dataValue ?? params.attr.value)
220
220
  if (!has(params.attr, 'multiple')) {
221
221
  if (values.length > 0) values = [values[0]]
222
222
  else if (prop.default) values = [prop.default]
@@ -303,14 +303,14 @@ async function componentFactory () {
303
303
  * @param {string} tag - The tag name.
304
304
  * @param {Object} params - The parameters for the tag.
305
305
  */
306
- beforeBuildTag = (tag, params) => {}
306
+ beforeBuildTag = async (tag, params) => {}
307
307
 
308
308
  /**
309
309
  * Hook executed after building a tag.
310
310
  * @param {string} tag - The tag name.
311
311
  * @param {Object} params - The parameters for the tag.
312
312
  */
313
- afterBuildTag = (tag, params) => {}
313
+ afterBuildTag = async (tag, params) => {}
314
314
 
315
315
  /**
316
316
  * Builds a child tag based on a detector attribute.
@@ -7,7 +7,7 @@ async function pageEndFactory () {
7
7
 
8
8
  this.params.tag = 'div'
9
9
  this.params.attr.c = 'page-end'
10
- this.params.id = generateId()
10
+ this.params.id = generateId('alpha')
11
11
  }
12
12
 
13
13
  build = async () => {
@@ -13,7 +13,7 @@ async function pageStartFactory () {
13
13
  const groups = groupAttrs(this.params.attr, ['body'])
14
14
  this.params.attr = groups._
15
15
  this.params.attr.c = 'page-start'
16
- this.params.attr.id = generateId()
16
+ this.params.attr.id = generateId('alpha')
17
17
  const body = `<body ${stringifyAttribs(groups.body)}>`
18
18
  this.params.attr.prepend = escape('<!DOCTYPE html><html><head>')
19
19
  this.params.attr.append = escape(`</head>${body}`)
@@ -121,7 +121,7 @@ async function widgetFactory () {
121
121
  const { ref, key } = this.getRef({ field, refName, returning: 'all' })
122
122
  if (isEmpty(ref)) return undefined
123
123
  labelField = labelField ?? ref.labelField ?? 'id'
124
- return (get(data ?? this.formData, `_ref.${key}.${labelField}`))
124
+ return get(data ?? this.formData, `_ref.${key}.${labelField}`)
125
125
  }
126
126
 
127
127
  getRefName = (field) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-mpa",
3
- "version": "2.14.1",
3
+ "version": "2.14.3",
4
4
  "description": "MPA support for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-21
4
+
5
+ - [2.14.2] Bug fix in ```Component.beforeBuildTag()``` and ```Component.afterBuildTag()```
6
+
3
7
  ## 2026-04-18
4
8
 
5
9
  - [2.14.1] Bug fix in ```getRef()``` in ```MpaWidget```