waibu-maps 2.2.1 → 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.
@@ -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, undefined, options.opts)
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
- await wmpa.addComponent('<c:' + el.getAttribute('component') + ' ' + setting + ' />', menu, null, true, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
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, null, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
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, null)
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
- return await wmpa.createComponent(body, null, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
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, null, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })]
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
- await wmpa.addComponent(body, '#${id} .input-group .dropdown-menu', 'div', true, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
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, null, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-maps",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Maps for Waibu MPA",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-03-05
4
+
5
+ - [2.2.2] Bug fix on ```wmpa``` component function parameters
6
+
3
7
  ## 2026-02-25
4
8
 
5
9
  - [2.2.1] Bug fix on ```wmaps.loadIcon()```