js-kompo-utils 1.0.23 → 1.0.24

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.
@@ -85,7 +85,7 @@ export default {
85
85
  return this.panelStyle
86
86
  },
87
87
  useNativeMobile() {
88
- if (this.$_config('disableNativeMobile')) return false
88
+ if (!this.$_config('native_on_mobile')) return false
89
89
  return this.isTouchDevice && !this.$_multiple && !this.ajaxOptions
90
90
  },
91
91
  nativeValue() {
@@ -141,9 +141,18 @@ export default {
141
141
  },
142
142
  nativeLabel(opt) {
143
143
  const l = opt.label
144
- if (typeof l === 'string') return l
145
- if (l && typeof l === 'object') return l.label || l.text || l.search || ''
146
- return String(opt.value ?? '')
144
+ let raw = ''
145
+ if (typeof l === 'string') raw = l
146
+ else if (l && typeof l === 'object') raw = l.label || l.text || l.search || ''
147
+ else raw = String(opt.value ?? '')
148
+ return this.stripHtml(raw)
149
+ },
150
+ stripHtml(str) {
151
+ if (!str || typeof str !== 'string') return ''
152
+ if (str.indexOf('<') === -1) return str
153
+ const tmp = document.createElement('div')
154
+ tmp.innerHTML = str
155
+ return (tmp.textContent || tmp.innerText || '').trim()
147
156
  },
148
157
  teleportOptions() {
149
158
  const opts = this.$refs.selectOptions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-kompo-utils",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "app.js",
6
6
  "scripts": {