Skip to content

Commit

Permalink
[5.x] Add list index fieldtype and fix taggable-fieldtype-index refer…
Browse files Browse the repository at this point in the history
…ence (#10379)
  • Loading branch information
ryanmitchell authored Jul 2, 2024
1 parent dacb506 commit 9d91ca9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions resources/js/bootstrap/fieldtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import IconFieldtype from '../components/fieldtypes/IconFieldtype.vue';
import IntegerFieldtype from '../components/fieldtypes/IntegerFieldtype.vue';
import LinkFieldtype from '../components/fieldtypes/LinkFieldtype.vue';
import ListFieldtype from '../components/fieldtypes/ListFieldtype.vue';
import ListIndexFieldtype from '../components/fieldtypes/ListIndexFieldtype.vue';
import MarkdownFieldtype from '../components/fieldtypes/markdown/MarkdownFieldtype.vue';
import MarkdownButtonsSettingFieldtype from '../components/fieldtypes/markdown/MarkdownButtonsSettingFieldtype.vue';
import RadioFieldtype from '../components/fieldtypes/RadioFieldtype.vue';
Expand Down Expand Up @@ -99,6 +100,7 @@ Vue.component('icon-fieldtype', IconFieldtype);
Vue.component('integer-fieldtype', IntegerFieldtype);
Vue.component('link-fieldtype', LinkFieldtype);
Vue.component('list-fieldtype', ListFieldtype);
Vue.component('list-fieldtype-index', ListIndexFieldtype);
Vue.component('markdown-fieldtype', MarkdownFieldtype);
Vue.component('markdown_buttons_setting-fieldtype', MarkdownButtonsSettingFieldtype);
Vue.component('radio-fieldtype', RadioFieldtype);
Expand All @@ -114,6 +116,7 @@ Vue.component('sets-fieldtype', SetsFieldtype);
Vue.component('table-fieldtype', TableFieldtype);
Vue.component('tags-fieldtype', TagsFieldtype);
Vue.component('tags-fieldtype-index', TagsIndexFieldtype);
Vue.component('taggable-fieldtype-index', TagsIndexFieldtype);
Vue.component('template_folder-fieldtype', TemplateFolderFieldtype);
Vue.component('time-fieldtype', TimeFieldtype);
Vue.component('toggle-fieldtype', ToggleFieldtype);
Expand Down
19 changes: 19 additions & 0 deletions resources/js/components/fieldtypes/ListIndexFieldtype.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<div class="text-ellipsis">{{ formatted }}</div>
</template>

<script>
export default {
mixins: [IndexFieldtype],
computed: {
formatted() {
if (!this.value) {
return null;
}
return this.value.join(', ');
},
},
};
</script>
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/TagsIndexFieldtype.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>{{ formatted }}</div>
<div class="text-ellipsis">{{ formatted }}</div>
</template>

<script>
Expand Down

0 comments on commit 9d91ca9

Please sign in to comment.