Skip to content

Commit

Permalink
Release/1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
garygarside committed Nov 6, 2024
1 parent 9c759ca commit d202d7e
Show file tree
Hide file tree
Showing 5 changed files with 5,790 additions and 9,552 deletions.
29 changes: 15 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:vue/essential"
],
"globals": {
"Nova": true,
"store": true,
},
rules: {
root: true,
extends: [
"eslint:recommended",
"plugin:vue/essential"
],
"globals": {
"Nova": true,
"store": true,
},
rules: {
// override/add rules settings here...
"indent": ["error", "tab"]
},
env: {
node: true,
},
"indent": ["error", "tab"]
},
env: {
node: true,
},
}
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 1.2.2 - 2024-11-06

- Fix to vue-select 3.x returning an instance of the event, rather than the updated value

## 1.2.1 - 2024-11-05

- Remove Nova secrets from being required in the CI runner action during Composer setup
Expand Down
23 changes: 19 additions & 4 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ export default {
},
},
mounted() {
mounted () {
this.parseInitialValue();
if (this.parentComponent) {
this.parentComponent.$watch('value', (value) => {
this.parentVal = value;
Expand Down Expand Up @@ -146,8 +147,10 @@ export default {
this.selectedOptions.push(option);
}
})
return;
}
if (this.value == option.value) {
this.selectedOptions.push(option);
}
Expand All @@ -161,7 +164,9 @@ export default {
* Dynamic search with the input value
*/
search: window._.debounce((loading, searchVal, vm) => {
let url = vm.buildParamString(searchVal)
loading(true);
let url = vm.buildParamString(searchVal);
window.Nova.request().get(url).then(({ data }) => {
vm.options = data;
vm.cacheOptions(data);
Expand All @@ -187,13 +192,13 @@ export default {
if (input.length < 3 && !/^\d+$/.test(input)) {
return;
}
loading(true);
this.search(loading, input, this);
},
reduceOption(option) {
const valueKey = this.field.valueKey || 'value';
return option ? option[valueKey] : null;
},
Expand All @@ -220,10 +225,12 @@ export default {
parseInitialValue() {
let value = this.field.value ? this.field.value : null;
if (!value) {
this.value = value;
return;
}
if (!this.field.multiple) {
value = this._parseValue(value);
} else {
Expand All @@ -232,36 +239,44 @@ export default {
}
!value[0] ? value = [] : value = value.map(this._parseValue);
}
this.value = value;
},
_parseValue(value) {
if (this.field.type === 'int') {
value = parseInt(value);
}
if (this.field.type === 'float') {
value = parseFloat(value);
}
return value;
},
inputSelected(value) {
inputSelected () {
const value = this.value;
if (!value) {
return;
}
if (Array.isArray(value)) {
value.forEach(v => {
if (!v) {
return;
}
const selectedOption = this.optionsCache.find(option => option.value === v);
if (selectedOption) {
this.selectedOptions.push(selectedOption);
}
});
} else {
const selectedOption = this.optionsCache.find(option => option.value === value);
if (selectedOption) {
this.selectedOptions.push(selectedOption);
}
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.2.2
Loading

0 comments on commit d202d7e

Please sign in to comment.