Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,15 @@ export default {
},
separator: {
type: String,
default: ' > ',
default: undefined,
},
rootPath: {
type: String,
default: null,
default: undefined,
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
10 changes: 3 additions & 7 deletions src/components/ClearRefinements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,17 @@ export default {
createSuitMixin({ name: 'ClearRefinements' }),
],
props: {
// explicitly no default, since included and excluded are incompatible
// eslint-disable-next-line vue/require-default-prop
excludedAttributes: {
type: Array,
default: undefined,
},
// explicitly no default, since included and excluded are incompatible
// eslint-disable-next-line vue/require-default-prop
includedAttributes: {
type: Array,
default: undefined,
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
10 changes: 3 additions & 7 deletions src/components/CurrentRefinements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,17 @@ export default {
}),
],
props: {
// no default because included and excluded are incompatible
// eslint-disable-next-line vue/require-default-prop
includedAttributes: {
type: Array,
default: undefined,
},
// no default because included and excluded are incompatible
// eslint-disable-next-line vue/require-default-prop
excludedAttributes: {
type: Array,
default: undefined,
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
18 changes: 7 additions & 11 deletions src/components/HierarchicalMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,39 +68,35 @@ export default {
},
limit: {
type: Number,
default: 10,
default: undefined,
},
showMoreLimit: {
type: Number,
default: 20,
default: undefined,
},
showMore: {
type: Boolean,
default: false,
},
sortBy: {
type: [Array, Function],
default() {
return ['name:asc'];
},
default: undefined,
},
separator: {
type: String,
default: ' > ',
default: undefined,
},
rootPath: {
type: String,
default: null,
default: undefined,
},
showParentLevel: {
type: Boolean,
default: true,
default: undefined,
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
20 changes: 16 additions & 4 deletions src/components/Highlighter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,22 @@ export default {
type: String,
default: 'mark',
},
suit: { type: Function, required: true },
highlightProperty: { type: String, required: true },
preTag: { type: String, required: true },
postTag: { type: String, required: true },
suit: {
type: Function,
required: true,
},
highlightProperty: {
type: String,
required: true,
},
preTag: {
type: String,
required: true,
},
postTag: {
type: String,
required: true,
},
},
data() {
return {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Hits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ export default {
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
5 changes: 1 addition & 4 deletions src/components/HitsPerPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ export default {
items: {
type: Array,
required: true,
default: () => [],
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
data() {
Expand Down
4 changes: 1 addition & 3 deletions src/components/InfiniteHits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export default {
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
cache: {
type: Object,
Expand Down
14 changes: 7 additions & 7 deletions src/components/InstantSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export default createInstantSearchComponent({
},
insightsClient: {
type: Function,
required: false,
default: undefined,
},
indexName: {
type: String,
required: true,
},
routing: {
default: null,
default: undefined,
validator(value) {
if (
typeof value === 'boolean' ||
Expand All @@ -39,19 +39,19 @@ export default createInstantSearchComponent({
},
stalledSearchDelay: {
type: Number,
default: 200,
default: undefined,
},
searchFunction: {
type: Function,
default: null,
default: undefined,
},
initialUiState: {
type: Object,
required: false,
default: undefined,
},
apiKey: {
type: String,
default: null,
default: undefined,
validator(value) {
if (value) {
warn(oldApiWarning);
Expand All @@ -61,7 +61,7 @@ export default createInstantSearchComponent({
},
appId: {
type: String,
default: null,
default: undefined,
validator(value) {
if (value) {
warn(oldApiWarning);
Expand Down
12 changes: 4 additions & 8 deletions src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,23 @@ export default {
// },
limit: {
type: Number,
default: 10,
default: undefined,
},
showMoreLimit: {
type: Number,
default: 20,
default: undefined,
},
showMore: {
type: Boolean,
default: false,
},
sortBy: {
type: [Array, Function],
default() {
return ['count:desc', 'name:asc'];
},
default: undefined,
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/MenuSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export default {
},
sortBy: {
type: [Array, Function],
default() {
return ['name:asc'];
},
default: undefined,
},
transformItems: {
type: Function,
Expand Down
4 changes: 1 addition & 3 deletions src/components/NumericMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export default {
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default {
props: {
padding: {
type: Number,
default: 3,
default: undefined,
validator(value) {
return value > 0;
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryRuleContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
transformRuleContexts: {
type: Function,
required: false,
default: ruleContexts => ruleContexts,
default: undefined,
},
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryRuleCustomData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
transformItems: {
type: Function,
required: false,
Copy link
Member

@shortcuts shortcuts Jul 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(unrelated) do we need to state it if it's false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really make much difference, so required defaults to true

default: items => items,
default: undefined,
},
},
computed: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/RangeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ export default {
min: {
type: Number,
required: false,
// @major: remove this default
default: -Infinity,
},
max: {
type: Number,
required: false,
// @major: remove this default
default: Infinity,
},
precision: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/RatingMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
},
max: {
type: Number,
default: 5,
default: undefined,
},
},
computed: {
Expand Down
14 changes: 7 additions & 7 deletions src/components/RefinementList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ export default {
},
searchable: {
type: Boolean,
default: false,
default: undefined,
},
searchablePlaceholder: {
default: 'Search here…',
type: String,
required: false,
default: 'Search here…',
},
operator: {
default: 'or',
Expand All @@ -138,28 +138,28 @@ export default {
},
limit: {
type: Number,
default: 10,
required: false,
default: undefined,
},
showMoreLimit: {
type: Number,
default: 20,
required: false,
default: undefined,
},
showMore: {
type: Boolean,
default: false,
required: false,
default: false,
},
sortBy: {
type: [Array, Function],
default: () => ['isRefined', 'count:desc', 'name:asc'],
required: false,
default: undefined,
},
transformItems: {
type: Function,
default: items => items,
required: false,
default: undefined,
},
},
data() {
Expand Down
4 changes: 1 addition & 3 deletions src/components/SortBy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export default {
},
transformItems: {
type: Function,
default(items) {
return items;
},
default: undefined,
},
},
computed: {
Expand Down
Loading