waibu-maps 2.2.0 → 2.2.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.
- package/extend/bajoTemplate/template/wmaps.js +3 -3
- package/extend/waibuBootstrap/theme/component/widget/control-group.js +2 -1
- package/extend/waibuBootstrap/theme/component/widget/control-image.js +1 -1
- package/extend/waibuBootstrap/theme/component/widget/control-logo.js +1 -1
- package/extend/waibuBootstrap/theme/component/widget/control-mouse-pos.js +2 -1
- package/extend/waibuBootstrap/theme/component/widget/control-search.js +6 -5
- package/extend/waibuBootstrap/theme/component/widget/control-zbp.js +1 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +8 -0
|
@@ -141,9 +141,9 @@ class WaibuMaps { // eslint-disable-line no-unused-vars
|
|
|
141
141
|
this.map.addImage(src.name, image.data)
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
loadIcon = async (icon) => {
|
|
144
|
+
loadIcon = async (icon, prefix) => {
|
|
145
145
|
if (this.map.listImages().includes(icon)) return
|
|
146
|
-
const href = this.iconPrefix + icon.split(':')[1]
|
|
146
|
+
const href = (prefix ?? this.iconPrefix) + icon.split(':')[1]
|
|
147
147
|
const image = await this.map.loadImage(href)
|
|
148
148
|
if (!this.map.listImages().includes(icon)) this.map.addImage(icon, image.data)
|
|
149
149
|
}
|
|
@@ -166,7 +166,7 @@ class WaibuMaps { // eslint-disable-line no-unused-vars
|
|
|
166
166
|
if (options.builder) {
|
|
167
167
|
if (_.isArray(options.builder)) ctrl.panels = options.builder
|
|
168
168
|
else if (_.isString(options.builder)) {
|
|
169
|
-
ctrl.panels = await wmpa.createComponent(options.builder,
|
|
169
|
+
ctrl.panels = await wmpa.createComponent(options.builder, { ...options.opts })
|
|
170
170
|
} else {
|
|
171
171
|
const fn = options.builder.bind(ctrl.scope)
|
|
172
172
|
ctrl.panels = await fn(options.params)
|
|
@@ -55,7 +55,8 @@ async function controlGroup () {
|
|
|
55
55
|
if (!menu) return
|
|
56
56
|
if (menu.children.length > 0) return
|
|
57
57
|
const setting = el.getAttribute('setting') ? ('setting="' + el.getAttribute('setting') + '"') : ''
|
|
58
|
-
|
|
58
|
+
const options = { selector: menu, checkChild: true, theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' }
|
|
59
|
+
await wmpa.addComponent('<c:' + el.getAttribute('component') + ' ' + setting + ' />', options)
|
|
59
60
|
}
|
|
60
61
|
`, `
|
|
61
62
|
async ${prefix}Builder (params) {
|
|
@@ -27,7 +27,7 @@ async function controlImage () {
|
|
|
27
27
|
const body = ['<c:${url ? `a url="${url}"` : 'div'}><c:img ${stringifyAttribs(img)} ']
|
|
28
28
|
body.push('${animate}')
|
|
29
29
|
body.push('/></c:${url ? 'a' : 'div'}>')
|
|
30
|
-
return await wmpa.createComponent(body,
|
|
30
|
+
return await wmpa.createComponent(body, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
|
|
31
31
|
}
|
|
32
32
|
`)
|
|
33
33
|
|
|
@@ -44,7 +44,7 @@ async function controlLogo () {
|
|
|
44
44
|
const body = ['<c:a href="#" @click="wbs.appLauncher(\\'darkmode language\\', \\'${this.params.attr.menu}\\', { theme: \\'${this.component.theme.name}\\', iconset: \\'${this.component.iconset.name}\\' })">']
|
|
45
45
|
body.push('<c:img ${stringifyAttribs(img)} ${animate} />')
|
|
46
46
|
body.push('</c:a>')
|
|
47
|
-
return await wmpa.createComponent(body
|
|
47
|
+
return await wmpa.createComponent(body)
|
|
48
48
|
}
|
|
49
49
|
`)
|
|
50
50
|
|
|
@@ -56,7 +56,8 @@ async function controlMousePos () {
|
|
|
56
56
|
`, `
|
|
57
57
|
async ${prefix}Builder () {
|
|
58
58
|
const body = '<c:div id="${id}" margin="x-2 top-1" text="align:center nowrap"/>'
|
|
59
|
-
|
|
59
|
+
const options = { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' }
|
|
60
|
+
return await wmpa.createComponent(body, options)
|
|
60
61
|
}
|
|
61
62
|
`])
|
|
62
63
|
this.addBlock('run', `
|
|
@@ -34,7 +34,7 @@ async function controlSearch () {
|
|
|
34
34
|
wbs.closeModal('${id}')
|
|
35
35
|
this.$store.mapSearch.recent = ''
|
|
36
36
|
}
|
|
37
|
-
wmpa.replaceWithComponentHtml(val, '#${id} .result div', 'div')
|
|
37
|
+
wmpa.replaceWithComponentHtml(val, { selector: '#${id} .result div', wrapper: 'div' })
|
|
38
38
|
})
|
|
39
39
|
this.$watch('$store.mapSearch.feed', async val => {
|
|
40
40
|
this.$store.mapSearch.recent = ''
|
|
@@ -54,7 +54,7 @@ async function controlSearch () {
|
|
|
54
54
|
'<c:icon name="search" />',
|
|
55
55
|
'</c:button>'
|
|
56
56
|
]
|
|
57
|
-
return [await wmpa.createComponent(body,
|
|
57
|
+
return [await wmpa.createComponent(body, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })]
|
|
58
58
|
}
|
|
59
59
|
`, `
|
|
60
60
|
async ${prefix}Populate () {
|
|
@@ -62,10 +62,11 @@ async function controlSearch () {
|
|
|
62
62
|
feeds.unshift({ code: 'latLng', name: 'gotoLatLng', feed: { id: 'latLng', cmpLabel: 'latLng' } })
|
|
63
63
|
this.$store.mapSearch.feeds = feeds
|
|
64
64
|
const body = feeds.map(feed => '<c:dropdown-item :class="$store.mapSearch.feed === $el.getAttribute(\\'data-code-feedid\\') ? \\'active\\' : \\'\\'" data-code-feedid="' + feed.code + ':' + feed.feed.id + '" t:content="' + feed.feed.cmpLabel + '" @click="$store.mapSearch.feed = \\'' + feed.code + ':' + feed.feed.id + '\\'"/>')
|
|
65
|
-
|
|
65
|
+
const options = { selector: '#${id} .input-group .dropdown-menu', wrapper: 'div', checkChild: true, theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' }
|
|
66
|
+
await wmpa.addComponent(body, options)
|
|
66
67
|
if (!this.$store.mapSearch.feed) this.$store.mapSearch.feed = feeds[0].code + ':' + feeds[0].feed.id
|
|
67
68
|
const html = this.$store.mapSearch.recent ?? ''
|
|
68
|
-
wmpa.replaceWithComponentHtml(html, '#${id} .result div', 'div')
|
|
69
|
+
wmpa.replaceWithComponentHtml(html, { selector: '#${id} .result div', wrapper: 'div' })
|
|
69
70
|
}
|
|
70
71
|
`])
|
|
71
72
|
const ui = await this.component.buildSentence(`
|
|
@@ -84,7 +85,7 @@ async function controlSearch () {
|
|
|
84
85
|
this.$store.mapSearch.value = this.$refs.input.value
|
|
85
86
|
},
|
|
86
87
|
clearHistory () {
|
|
87
|
-
wmpa.replaceWithComponentHtml('', '#${id} .result div', 'div')
|
|
88
|
+
wmpa.replaceWithComponentHtml('', { selector: '#${id} .result div', wrapper: 'div' })
|
|
88
89
|
},
|
|
89
90
|
abort () {
|
|
90
91
|
const endpoint = this.$store.mapSearch.busy
|
|
@@ -54,7 +54,7 @@ async function controlZbp () {
|
|
|
54
54
|
' }',
|
|
55
55
|
'}" />'
|
|
56
56
|
]
|
|
57
|
-
return await wmpa.createComponent(body,
|
|
57
|
+
return await wmpa.createComponent(body, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
|
|
58
58
|
}
|
|
59
59
|
`])
|
|
60
60
|
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED