waibu-mpa 2.14.2 → 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]
@@ -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.2",
3
+ "version": "2.14.3",
4
4
  "description": "MPA support for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {