jobdone-shared-files 1.0.10 → 1.0.12

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.
@@ -9,8 +9,8 @@
9
9
  <input class='form-control autocomplete-select-component-keyword-filter-input' :class="[triggerClass, searchInput]"
10
10
  type="text" ref="keywordFilterInput" v-model="keyword"
11
11
  :placeholder="searchPlaceholder == '' ? selectedPreviewText : searchPlaceholder" maxlength="50"
12
- @keydown.enter="keyboardSelectConfirm($event)" @keydown.up="keyboardSwitch(-1)"
13
- @keydown.down="keyboardSwitch(1)" @change="keyboardSwitchIndexReset()">
12
+ @keydown.enter="keyboardSelectConfirm($event)" @keydown.up="keyboardSwitch($event, -1)"
13
+ @keydown.down="keyboardSwitch($event, 1)" @change="keyboardSwitchIndexReset()">
14
14
  <Teleport :to="listPut">
15
15
  <div class="autocomplete-select-component-selector-content" :class="{ 'active': active }"
16
16
  ref="componentContentList" :style="positionStyle">
@@ -234,7 +234,6 @@ const selectedItem = computed(() => {
234
234
  function previewAdjust(itemObj) {
235
235
  if (props.previewKey !== '') {
236
236
  let strAry = props.previewKey.split('+')
237
- let obj = toRaw(itemObj)
238
237
  let isUndefined = false
239
238
 
240
239
  let finalStr = strAry.reduce((acc, cur) => {
@@ -242,10 +241,10 @@ function previewAdjust(itemObj) {
242
241
  if (v.match(/'[^']+'/g)) {
243
242
  return acc + v.substring(1, v.length - 1)
244
243
  } else {
245
- if (obj[v] === undefined) {
244
+ if (itemObj[v] === undefined) {
246
245
  isUndefined = true
247
246
  }
248
- return acc + obj[v]
247
+ return acc + itemObj[v]
249
248
  }
250
249
  }, '')
251
250
  if (isUndefined) {
@@ -256,16 +255,10 @@ function previewAdjust(itemObj) {
256
255
  return itemObj
257
256
  }
258
257
 
259
- // 強制更新selectedPreviewText
260
- const selectedPreviewTextUpdateCount = ref(0)
261
- function selectedPreviewTextUpdate() {
262
- selectedPreviewTextUpdateCount.value++
263
- }
264
258
 
265
259
  // 選中的值的顯示
266
260
  const selectedPreviewText = computed(() => {
267
261
 
268
- let updateComputed = selectedPreviewTextUpdateCount.value + 1 // 讓外部可以強制更新這個computed,不要刪除
269
262
 
270
263
  if (!selectedItem.value || Object.keys(selectedItem.value).length === 0) {
271
264
  return props.placeholder
@@ -275,7 +268,6 @@ const selectedPreviewText = computed(() => {
275
268
 
276
269
  // 清除選擇內容
277
270
  function clearSelected() {
278
- selectedPreviewTextUpdateCount.value = 0
279
271
  emit('select', props.resetValue)
280
272
  leave()
281
273
  }
@@ -285,7 +277,6 @@ function selectConfirm(v) {
285
277
  if (!v) {
286
278
  return
287
279
  }
288
- selectedPreviewTextUpdate()
289
280
  emit('select', JSON.parse(JSON.stringify(v)))
290
281
  leave()
291
282
  keyboardSwitchIndexReset()
@@ -298,13 +289,15 @@ function keyboardSelectConfirm(event) {
298
289
  }
299
290
  if (filterList.value?.length) {
300
291
  selectConfirm(filterList.value[keyboardSwitchIndex.value])
301
- selectedPreviewTextUpdate()
302
292
  }
303
293
  }
304
294
 
305
295
  // 鍵盤挑選
306
296
  const keyboardSwitchIndex = ref(0)
307
- function keyboardSwitch(v) {
297
+ function keyboardSwitch(event, v) {
298
+ if (event.isComposing) {
299
+ return
300
+ }
308
301
  if (filterList.value?.length < 1) {
309
302
  keyboardSwitchIndexReset()
310
303
  return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jobdone-shared-files",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Shared JS and SCSS for Jobdone Enterprise.",
5
5
  "main": "index.js",
6
6
  "scripts": {