waibu-maps 2.1.5 → 2.2.0

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.
@@ -59,9 +59,9 @@ async function controlSearch () {
59
59
  `, `
60
60
  async ${prefix}Populate () {
61
61
  const feeds = await ${this.params.attr.feed}() ?? []
62
- feeds.unshift({ code: 'latLng', name: 'gotoLatLng', feed: { id: 'latLng', label: 'latLng' } })
62
+ feeds.unshift({ code: 'latLng', name: 'gotoLatLng', feed: { id: 'latLng', cmpLabel: 'latLng' } })
63
63
  this.$store.mapSearch.feeds = feeds
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="' + _.camelCase(feed.code) + '" @click="$store.mapSearch.feed = \\'' + feed.code + ':' + feed.feed.id + '\\'"/>')
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
  await wmpa.addComponent(body, '#${id} .input-group .dropdown-menu', 'div', true, { theme: '${this.component.theme.name}', iconset: '${this.component.iconset.name}' })
66
66
  if (!this.$store.mapSearch.feed) this.$store.mapSearch.feed = feeds[0].code + ':' + feeds[0].feed.id
67
67
  const html = this.$store.mapSearch.recent ?? ''
@@ -78,7 +78,7 @@ async function controlSearch () {
78
78
  get feedName () {
79
79
  const [code, feedId] = (this.$store.mapSearch.feed ?? '').split(':')
80
80
  const item = _.find(this.$store.mapSearch.feeds, f => f.code === code && f.feed.id === feedId)
81
- return _.camelCase(item ? item.code : code)
81
+ return item ? item.feed.cmpLabel : code
82
82
  },
83
83
  search () {
84
84
  this.$store.mapSearch.value = this.$refs.input.value
@@ -2,8 +2,8 @@ import wmapsBase from '../wmaps-base.js'
2
2
 
3
3
  export function buildLayers (params) {
4
4
  const { isString, map } = this.app.lib._
5
- const { routePath } = this.app.waibu
6
- const { attrToArray, jsonStringify } = this.app.waibuMpa
5
+ const { routePath, attrToArray } = this.app.waibu
6
+ const { jsonStringify } = this.app.waibuMpa
7
7
 
8
8
  if (!isString(params.attr.layer)) return ''
9
9
  const items = map(attrToArray(params.attr.layer), item => routePath(item))
@@ -18,8 +18,8 @@ export function buildLayers (params) {
18
18
 
19
19
  export function buildImage (params) {
20
20
  const { isString, map } = this.app.lib._
21
- const { routePath } = this.app.waibu
22
- const { attrToArray, jsonStringify } = this.app.waibuMpa
21
+ const { routePath, attrToArray } = this.app.waibu
22
+ const { jsonStringify } = this.app.waibuMpa
23
23
 
24
24
  if (!isString(params.attr.image)) return ''
25
25
  const items = map(attrToArray(params.attr.image), item => routePath(item))
@@ -65,8 +65,8 @@ async function layerHtmlCluster () {
65
65
 
66
66
  build = async () => {
67
67
  const { generateId } = this.app.lib.aneka
68
- const { attrToArray, jsonStringify } = this.app.waibuMpa
69
- const { fetch, routePath } = this.app.waibu
68
+ const { jsonStringify } = this.app.waibuMpa
69
+ const { fetch, routePath, attrToArray } = this.app.waibu
70
70
  const { isString } = this.app.lib._
71
71
  if (!this.params.attr.src) return
72
72
  this.params.attr.name = this.params.attr.name ?? generateId('alpha')
@@ -11,7 +11,7 @@ export const opts = {
11
11
 
12
12
  async function options (params = {}) {
13
13
  const { camelCase, isString } = this.app.lib._
14
- const { attrToArray } = this.app.waibuMpa
14
+ const { attrToArray } = this.app.waibu
15
15
  const { routePath } = this.app.waibu
16
16
  const mapOpts = this.app.waibuMaps.getConfig().mapOptions
17
17
  mapOpts.container = params.attr.id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-maps",
3
- "version": "2.1.5",
3
+ "version": "2.2.0",
4
4
  "description": "Maps for Waibu MPA",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-18
4
+
5
+ - [2.2.0] Update attribute functions from ```waibu```
6
+
7
+ ## 2026-02-15
8
+
9
+ - [2.1.6] Bug fix on ```<:wmaps-control-search />``` feed labeling
10
+
3
11
  ## 2026-01-20
4
12
 
5
13
  - [2.1.4] Bug fix on ```wmaps.createControl()```