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
|
-
|
|
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 = {}) {
|
package/lib/class/component.js
CHANGED
|
@@ -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.
|
|
@@ -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}`)
|
package/lib/class/widget.js
CHANGED
|
@@ -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
|
|
124
|
+
return get(data ?? this.formData, `_ref.${key}.${labelField}`)
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
getRefName = (field) => {
|
package/package.json
CHANGED