Skip to content

Commit

Permalink
Add truncate to fieldtype select display
Browse files Browse the repository at this point in the history
  • Loading branch information
martyf committed Mar 23, 2023
1 parent 8118815 commit 3371c5e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/js/iconamic.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"laravel-mix": "^6.0.43"
},
"devDependencies": {
"vue-loader": "^15.9.8"
"vue-loader": "^15.10.1",
"vue-template-compiler": "^2.7.14"
}
}
14 changes: 7 additions & 7 deletions resources/js/fieldtypes/iconamic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
<div class="flex">
<v-select
ref="input"
class="flex-1"
:name="name"
:clearable="config.clearable"
:close-on-select="true"
:create-option="(value) => ({ value, label: value })"
:disabled="config.disabled || isReadOnly"
:multiple="false"
:name="name"
:options="options"
:placeholder="config.placeholder"
:searchable="true"
:multiple="false"
:close-on-select="true"
:value="this.value"
:create-option="(value) => ({ value, label: value })"
class="flex-1"
@input="vueSelectUpdated"
@search:focus="$emit('focus')"
@search:blur="$emit('blur')">
<template slot="option" slot-scope="option">
<span class="flex items-center">
<span class="flex-none iconamic-is-svg block w-4 h-4" v-html="option.svg"></span>
<span class="ml-2">{{ option.label }}</span>
<span class="ml-2 truncate">{{ option.label }}</span>
</span>
</template>
<template slot="selected-option" slot-scope="option">
<span class="flex items-center">
<span class="flex-none iconamic-is-svg block w-4 h-4" v-html="meta.icons[option.label]"></span>
<span class="ml-2">{{ option.label }}</span>
<span class="ml-2 truncate">{{ option.label }}</span>
</span>
</template>
</v-select>
Expand Down

0 comments on commit 3371c5e

Please sign in to comment.