Skip to content

Commit

Permalink
New Fieldtype Picker UI and Icons (#4929)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Varga <jason@pixelfear.com>
  • Loading branch information
jackmcdade and jasonvarga committed Dec 17, 2021
1 parent 2c45ce6 commit 202821b
Show file tree
Hide file tree
Showing 82 changed files with 249 additions and 142 deletions.
70 changes: 53 additions & 17 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -76,7 +76,7 @@
"laravel-mix": "^5.0.9",
"sass": "^1.26.2",
"sass-loader": "^8.0.2",
"tailwindcss": "^1.2.0",
"tailwindcss": "^1.9.0",
"vue-template-compiler": "^2.6.11"
},
"jest": {
Expand Down
11 changes: 10 additions & 1 deletion resources/js/components/SvgIcon.vue
Expand Up @@ -2,6 +2,7 @@
export default {
props: {
name: String,
default: String,
inline: {
type: Boolean,
default: true
Expand All @@ -16,7 +17,15 @@ export default {
},
methods: {
getInlineIcon() {
return require(`!!html-loader!./../../svg/${this.name}.svg`);
try {
return require(`!!html-loader!./../../svg/${this.name}.svg`);
} catch (error) {
if (this.default) {
return require(`!!html-loader!./../../svg/${this.default}.svg`);
}
return '';
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/blueprints/RegularField.vue
Expand Up @@ -5,7 +5,7 @@
<div class="blueprint-drag-handle w-4 border-r"></div>
<div class="flex flex-1 items-center justify-between">
<div class="flex items-center flex-1 pr-2 py-1 pl-1">
<svg-icon class="text-grey-70 mr-1 h-4 w-4 flex-none" :name="field.icon" v-tooltip="tooltipText" />
<svg-icon class="text-grey-80 mr-1 h-4 w-4 flex-none" :name="field.icon" v-tooltip="tooltipText" default="generic-field" />
<a class="break-all" v-text="labelText" @click="$emit('edit')" />
<svg-icon name="hyperlink" v-if="isReferenceField" class="text-grey-60 text-3xs ml-1 h-4 w-4" v-tooltip="__('Imported from fieldset') + ': ' + field.field_reference" />
</div>
Expand Down

0 comments on commit 202821b

Please sign in to comment.