@explorer-1/vue 1.1.6 → 1.1.7
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
package/package.json
CHANGED
|
@@ -59,6 +59,23 @@ export const DateFilter = {
|
|
|
59
59
|
truncateFilters: true
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
export const RadioInput = {
|
|
64
|
+
name: 'Radio Group',
|
|
65
|
+
args: {
|
|
66
|
+
inputType: 'radio',
|
|
67
|
+
filterBy: [],
|
|
68
|
+
buckets: [
|
|
69
|
+
{ key: 'Solar System', doc_count: 3308 },
|
|
70
|
+
{ key: 'Earth', doc_count: 1179 },
|
|
71
|
+
{ key: 'Stars and Galaxies', doc_count: 979 },
|
|
72
|
+
{ key: 'Technology', doc_count: 480 }
|
|
73
|
+
],
|
|
74
|
+
groupKey: 'topics',
|
|
75
|
+
groupTitle: 'Topic',
|
|
76
|
+
truncateFilters: false
|
|
77
|
+
}
|
|
78
|
+
}
|
|
62
79
|
export const SubFilters = {
|
|
63
80
|
decorators: [
|
|
64
81
|
() => ({
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
: generateId(bucket.key, groupKey)
|
|
37
37
|
"
|
|
38
38
|
v-model="filterByHandler"
|
|
39
|
-
type="
|
|
39
|
+
:type="inputType"
|
|
40
40
|
:value="bucket.key_as_string ? bucket.key_as_string : bucket.key"
|
|
41
41
|
class="text-primary focus:ring-2 focus:ring-primary flex-shrink-0 w-5 h-5 mt-px mr-1 align-middle border rounded-none"
|
|
42
42
|
/>
|
|
@@ -94,9 +94,11 @@
|
|
|
94
94
|
: generateId(bucket.key, groupKey)
|
|
95
95
|
"
|
|
96
96
|
v-model="filterByHandler"
|
|
97
|
-
|
|
97
|
+
:name="inputType === 'radio' ? groupKey : undefined"
|
|
98
|
+
:type="inputType"
|
|
98
99
|
:value="bucket.key_as_string ? bucket.key_as_string : bucket.key"
|
|
99
|
-
class="text-primary focus:ring-2 focus:ring-primary flex-shrink-0 w-5 h-5 mt-px mr-1 align-middle border
|
|
100
|
+
class="text-primary focus:ring-2 focus:ring-primary flex-shrink-0 w-5 h-5 mt-px mr-1 align-middle border"
|
|
101
|
+
:class="inputType === 'radio' ? 'rounded-full' : 'rounded-none'"
|
|
100
102
|
/>
|
|
101
103
|
<!-- 'key_as_string' exists for dates to have a human readable version -->
|
|
102
104
|
<label
|
|
@@ -156,6 +158,11 @@ export default {
|
|
|
156
158
|
SearchFilterGroupAccordionItem
|
|
157
159
|
},
|
|
158
160
|
props: {
|
|
161
|
+
/* Input type */
|
|
162
|
+
inputType: {
|
|
163
|
+
type: String as PropType<'checkbox' | 'radio'>,
|
|
164
|
+
default: 'checkbox'
|
|
165
|
+
},
|
|
159
166
|
filterBy: {
|
|
160
167
|
type: Array,
|
|
161
168
|
default: undefined
|