@ramathibodi/nuxt-commons 0.1.30 → 0.1.31

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.30",
7
+ "version": "0.1.31",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.3",
10
10
  "unbuild": "2.0.0"
@@ -118,7 +118,8 @@ const computedNoDataText = computed(() => {
118
118
  const computedSortBy = computed(()=>{
119
119
  let sortByField = props.sortBy
120
120
  if (sortByField == 'itemValue') {
121
- return [itemTitleField.value,'itemValue','itemCode']
121
+ if (props.showCode) return ['itemCode']
122
+ else return [itemTitleField.value,'itemValue','itemCode']
122
123
  } else {
123
124
  return [sortByField]
124
125
  }
@@ -88,7 +88,7 @@ async function fuzzySearch() {
88
88
  watchDebounced(searchData, fuzzySearch, { debounce: 1000, maxWait: 5000 })
89
89
 
90
90
  const computedItems = computed(()=>{
91
- let sortByField = props.sortBy || props.itemTitle
91
+ let sortByField = props.sortBy || ((props.showCode) ? props.itemValue : props.itemTitle)
92
92
 
93
93
  if (props.fuzzy && !isEmpty(searchData.value)) {
94
94
  return items.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramathibodi/nuxt-commons",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "Ramathibodi Nuxt modules for common components",
5
5
  "repository": {
6
6
  "type": "git",