@explorer-1/vue 1.1.7 → 1.1.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @explorer-1/vue
2
2
 
3
+ ## 1.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - a8c2efe: Updating types of SearchFilterGroup to be compatible with radio inputs.
8
+
3
9
  ## 1.1.7
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -64,7 +64,7 @@ export const RadioInput = {
64
64
  name: 'Radio Group',
65
65
  args: {
66
66
  inputType: 'radio',
67
- filterBy: [],
67
+ filterBy: '',
68
68
  buckets: [
69
69
  { key: 'Solar System', doc_count: 3308 },
70
70
  { key: 'Earth', doc_count: 1179 },
@@ -164,8 +164,15 @@ export default {
164
164
  default: 'checkbox'
165
165
  },
166
166
  filterBy: {
167
- type: Array,
168
- default: undefined
167
+ /* array for checkbox, string for radio */
168
+ type: [Array, String] as PropType<string[] | string>,
169
+ required: true,
170
+ validator: (value: string[] | string, props: any) => {
171
+ if (props.inputType === 'radio') {
172
+ return typeof value === 'string'
173
+ }
174
+ return Array.isArray(value)
175
+ }
169
176
  },
170
177
  buckets: {
171
178
  type: Object,
package/src/interfaces.ts CHANGED
@@ -58,7 +58,8 @@ export interface ThumbnailObject {
58
58
  original: string
59
59
  width: number
60
60
  height: number
61
- url: string
61
+ src?: ImageSrcObject
62
+ srcCropped?: ImageSrcObject
62
63
  }
63
64
  export interface ImageObject {
64
65
  title?: string
@@ -23,9 +23,17 @@ export const ExploreAppSitePageData = {
23
23
  displayLabel: 'Explore JPL',
24
24
  showShareLinks: false,
25
25
  thumbnailImage: {
26
- url: 'https://picsum.photos/512/288',
27
- width: 512,
28
- height: 288,
26
+ original: 'https://picsum.photos/512/288',
27
+ src: {
28
+ url: 'https://picsum.photos/512/288',
29
+ width: 512,
30
+ height: 288
31
+ },
32
+ srcCropped: {
33
+ url: 'https://picsum.photos/512/288',
34
+ width: 512,
35
+ height: 288
36
+ },
29
37
  id: 12345
30
38
  },
31
39
  location: 'Cafe 186',
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, reactive } from 'vue'
3
3
  import { useRoute } from 'vue-router'
4
- import type { PageObject } from '../../../interfaces'
4
+ import type { PageObject, ImageObject } from '../../../interfaces'
5
5
  import { useThemeStore } from '../../../store/theme'
6
6
  import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
7
7
  import DetailHeadline from './../../../components/DetailHeadline/DetailHeadline.vue'
@@ -27,22 +27,6 @@ const props = defineProps({
27
27
  })
28
28
  const { data } = reactive(props)
29
29
 
30
- // Convert thumbnailImage data for BlockImageStandard compatibility
31
- const detailImage = computed(() => {
32
- return {
33
- src: {
34
- url: data?.thumbnailImage?.url!,
35
- width: data?.thumbnailImage?.width!,
36
- height: data?.thumbnailImage?.height!
37
- },
38
- srcCropped: {
39
- url: data?.thumbnailImage?.url!,
40
- width: data?.thumbnailImage?.width!,
41
- height: data?.thumbnailImage?.height!
42
- }
43
- }
44
- })
45
-
46
30
  // Handle navigating back to Sites page
47
31
  const previousPath = computed(() => {
48
32
  try {
@@ -113,14 +97,16 @@ const mapPath = computed(() => {
113
97
 
114
98
  <!-- inline hero image -->
115
99
  <LayoutHelper
100
+ v-if="data.thumbnailImage?.src"
116
101
  indent="col-2"
117
102
  class="mt-10 mb-22 hidden lg:block"
118
103
  >
119
- <BlockImageStandard :data="detailImage" />
104
+ <BlockImageStandard :data="data.thumbnailImage as ImageObject" />
120
105
  </LayoutHelper>
121
106
 
122
107
  <BlockImageFullBleed
123
- :data="detailImage"
108
+ v-if="data.thumbnailImage?.src"
109
+ :data="data.thumbnailImage as ImageObject"
124
110
  class="lg:hidden mt-10 mb-10"
125
111
  />
126
112