@byu-oit/vue-decision-processing-components 9.5.3 → 9.5.4

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.
Files changed (2) hide show
  1. package/ByuDateSelector.vue +21 -13
  2. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <byu-control-date-selector
3
3
  ref="selector"
4
- :value="value"
4
+ :value="internalValue"
5
5
  @change="onChange"
6
6
  :date-type="dateType"
7
7
  :prior-terms="priorTerms"
8
8
  :subsequent-terms="subsequentTerms"
9
- ></byu-control-date-selector>
9
+ />
10
10
  </template>
11
11
 
12
12
  <script>
@@ -27,27 +27,35 @@ export default {
27
27
  default: 4
28
28
  }
29
29
  },
30
+ data() {
31
+ return {
32
+ internalValue: this.value
33
+ }
34
+ },
30
35
  watch: {
31
36
  value(newVal) {
32
- const element = this.$refs.selector
33
- if (element && newVal && element.value !== newVal) {
34
- element.value = newVal
35
- element.dispatchEvent(new Event('input', { bubbles: true }))
37
+ if (this.internalValue !== newVal) {
38
+ this.internalValue = newVal
39
+ const el = this.$refs.selector
40
+ if (el && el.value !== newVal) {
41
+ el.value = newVal
42
+ el.dispatchEvent(new Event('input', { bubbles: true }))
43
+ }
36
44
  }
37
45
  }
38
46
  },
39
47
  mounted() {
40
- if (this.value) {
41
- const element = this.$refs.selector
42
- if (element && element.value !== this.value) {
43
- element.value = this.value
44
- element.dispatchEvent(new Event('input', { bubbles: true }))
45
- }
48
+ const el = this.$refs.selector
49
+ if (el && this.internalValue) {
50
+ el.value = this.internalValue
51
+ el.dispatchEvent(new Event('input', { bubbles: true }))
46
52
  }
47
53
  },
48
54
  methods: {
49
55
  onChange(e) {
50
- this.$emit('input', e.target.value)
56
+ const val = e.target.value
57
+ this.internalValue = val
58
+ this.$emit('input', val)
51
59
  }
52
60
  }
53
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "9.5.3",
3
+ "version": "9.5.4",
4
4
  "description": "Vue components shared between decision processing systems for the CES schools.",
5
5
  "dependencies": {
6
6
  "@fortawesome/fontawesome-free": "^5.15.4",