@pocketprep/ui-kit 3.0.2 → 3.0.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.
@@ -63,15 +63,15 @@ export default class Button extends Vue {
63
63
  @Prop({ default: '' }) readonly iconTitle!: string
64
64
  @Prop({ default: false }) isLoading!: boolean
65
65
 
66
- buttonClicked () {
66
+ buttonClicked (event: Event) {
67
67
  if (!this.disabled && !this.isLoading) {
68
- this.emitClick()
68
+ this.emitClick(event)
69
69
  }
70
70
  }
71
71
 
72
72
  @Emit('click')
73
- emitClick () {
74
- return true
73
+ emitClick (event: Event) {
74
+ return event
75
75
  }
76
76
  }
77
77
  </script>
@@ -4,8 +4,8 @@
4
4
  class="uikit-tab"
5
5
  :class="{ 'uikit-tab--disabled': disabled, 'uikit-tab--active': active }"
6
6
  :tabindex="disabled ? -1 : 0"
7
- @click="emitClick()"
8
- @keydown.enter="emitClick()"
7
+ @click="emitClick"
8
+ @keydown.enter="emitClick"
9
9
  @mousedown.prevent
10
10
  >
11
11
  <slot />
@@ -27,8 +27,8 @@ export default class Tab extends Vue {
27
27
  @Prop({ default: false }) isDarkMode!: boolean
28
28
 
29
29
  @Emit('click')
30
- emitClick () {
31
- return true
30
+ emitClick (event: Event) {
31
+ return event
32
32
  }
33
33
  }
34
34
  </script>
@@ -8,7 +8,7 @@
8
8
  }"
9
9
  :tabindex="isClickable ? '0' : '-1'"
10
10
  @mousedown.prevent
11
- @click="isClickable && emitClick()"
11
+ @click="isClickable && emitClick($event)"
12
12
  @keydown="isClickable && emitKeydown($event)"
13
13
  >
14
14
  <div class="uikit-exam-menu-card__icon">
@@ -44,12 +44,14 @@
44
44
  import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
45
45
  import Icon from '../Icons/Icon.vue'
46
46
  import BundleIcon from '../BundleIcons/BundleIcon.vue'
47
+ import PremiumPill from '../Bundles/PremiumPill.vue'
47
48
  import type { Study } from '@pocketprep/types'
48
49
 
49
50
  @Component({
50
51
  components: {
51
52
  BundleIcon,
52
53
  Icon,
54
+ PremiumPill,
53
55
  },
54
56
  })
55
57
  export default class ExamMenuCard extends Vue {
@@ -62,8 +64,8 @@ export default class ExamMenuCard extends Vue {
62
64
  @Prop({ default: true }) isClickable!: boolean
63
65
 
64
66
  @Emit('click')
65
- emitClick () {
66
- return true
67
+ emitClick (event: Event) {
68
+ return event
67
69
  }
68
70
 
69
71
  @Emit('keydown')
@@ -103,7 +103,7 @@ export default class FilterDropdown extends Vue {
103
103
  document.removeEventListener('keydown', this.keydownListener)
104
104
  }
105
105
 
106
- @Watch('checkboxOptions')
106
+ @Watch('checkboxOptions', { deep: true })
107
107
  checkboxOptionsChanged (newVal: TCheckboxOption[], oldVal: TCheckboxOption[]) {
108
108
  const newEnabledFilters = newVal.filter(o => o.enabled)
109
109
  const oldEnabledFilters = oldVal.filter(o => o.enabled)
@@ -111,12 +111,12 @@ export default class FilterDropdown extends Vue {
111
111
  this.emitUpdateModelValue(newVal)
112
112
  }
113
113
  }
114
- @Watch('checkboxEntries')
114
+ @Watch('checkboxEntries', { deep: true })
115
115
  checkboxOptionChanged (newVal: TCheckboxOption[]) {
116
116
  this.checkboxOptions = [ ...newVal ]
117
117
  }
118
118
 
119
- @Watch('radioOptions')
119
+ @Watch('radioOptions', { deep: true })
120
120
  radioOptionsChanged (newVal: TRadioOption[], oldVal: TRadioOption[]) {
121
121
  const newEnabledFilters = newVal
122
122
  const oldEnabledFilters = oldVal
@@ -124,7 +124,7 @@ export default class FilterDropdown extends Vue {
124
124
  this.emitUpdateModelValue(newVal)
125
125
  }
126
126
  }
127
- @Watch('radioEntries')
127
+ @Watch('radioEntries', { deep: true })
128
128
  radioOptionChanged (newVal: TRadioOption[]) {
129
129
  this.radioOptions = [ ...newVal ]
130
130
  }
@@ -156,7 +156,7 @@ export default class FilterOptions extends Vue {
156
156
  document.addEventListener('keydown', this.keydownListener)
157
157
  }
158
158
 
159
- @Watch('checkboxOptions')
159
+ @Watch('checkboxOptions', { deep: true })
160
160
  checkboxOptionsChanged (newVal: TCheckboxOption[], oldVal: TCheckboxOption[]) {
161
161
 
162
162
  const newEnabledFilters = newVal.filter(o => o.enabled)
@@ -165,12 +165,12 @@ export default class FilterOptions extends Vue {
165
165
  this.emitUpdateModelValue(newVal)
166
166
  }
167
167
  }
168
- @Watch('checkboxEntries')
168
+ @Watch('checkboxEntries', { deep: true })
169
169
  checkboxOptionChanged (newVal: TCheckboxOption[]) {
170
170
  this.checkboxOptions = [ ...newVal ]
171
171
  }
172
172
 
173
- @Watch('radioOptions')
173
+ @Watch('radioOptions', { deep: true })
174
174
  radioOptionsChanged (newVal: TRadioOption[], oldVal: TRadioOption[]) {
175
175
  const newEnabledFilters = newVal
176
176
  const oldEnabledFilters = oldVal
@@ -178,7 +178,7 @@ export default class FilterOptions extends Vue {
178
178
  this.emitUpdateModelValue(newVal)
179
179
  }
180
180
  }
181
- @Watch('radioEntries')
181
+ @Watch('radioEntries', { deep: true })
182
182
  radioOptionChanged (newVal: TRadioOption[]) {
183
183
  this.radioOptions = [ ...newVal ]
184
184
  }
@@ -1503,12 +1503,12 @@ export default class Question extends Vue {
1503
1503
  }
1504
1504
  }
1505
1505
 
1506
- @Watch('previousChoices')
1506
+ @Watch('previousChoices', { deep: true })
1507
1507
  previousChoicesChanged (choices: TChoiceKey[]) {
1508
1508
  this.updateSelectedChoices(choices)
1509
1509
  }
1510
1510
 
1511
- @Watch('selectedChoices')
1511
+ @Watch('selectedChoices', { deep: true })
1512
1512
  selectedChoicesChanged () {
1513
1513
  this.emitSelectedChoices({
1514
1514
  isCorrect: this.selectedChoices.length === this.answerKeys.length
@@ -4,8 +4,8 @@
4
4
  class="uikit-pill"
5
5
  :class="{ 'uikit-pill--show-close': showClose }"
6
6
  :tabindex="showClose ? 0 : -1"
7
- @click="showClose && emitClick()"
8
- @keydown.enter="showClose && emitClick()"
7
+ @click="showClose && emitClick($event)"
8
+ @keydown.enter="showClose && emitClick($event)"
9
9
  @mousedown.prevent
10
10
  >
11
11
  <div class="uikit-pill__label">
@@ -33,8 +33,8 @@ export default class Pill extends Vue {
33
33
  @Prop({ default: false }) isDarkMode!: boolean
34
34
 
35
35
  @Emit('click')
36
- emitClick () {
37
- return true
36
+ emitClick (event: Event) {
37
+ return event
38
38
  }
39
39
  }
40
40
  </script>
@@ -238,7 +238,10 @@ export default class Table extends Vue {
238
238
  @Prop() tableCellStyles!: Record<string, string>
239
239
 
240
240
  gridStyles: Record<string, string> = {}
241
- currentSort: ITableSortSettings = { column: null, direction: this.sortToggleOrder?.[0] || -1 }
241
+ currentSort: ITableSortSettings = {
242
+ column: null,
243
+ direction: this.sortToggleOrder?.[0] !== undefined ? this.sortToggleOrder[0] : -1,
244
+ }
242
245
 
243
246
  created () {
244
247
  // Use default sort, if provided
@@ -269,9 +272,10 @@ export default class Table extends Vue {
269
272
  this.currentSort.column = column
270
273
  } else {
271
274
  const currentSortDirIndex = this.sortToggleOrder.indexOf(this.currentSort.direction)
272
- this.currentSort.direction = this.sortToggleOrder[
275
+ const newSortDirection = this.sortToggleOrder[
273
276
  (currentSortDirIndex + 1) % this.sortToggleOrder.length
274
- ] || -1
277
+ ]
278
+ this.currentSort.direction = newSortDirection !== undefined ? newSortDirection : -1
275
279
  }
276
280
  this.emitSort()
277
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {