Skip to content

Commit

Permalink
Initial working copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Aug 15, 2022
1 parent c86c22a commit ceb2e45
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<PanelItem :index="index" :field="field">
<template #value>
<Excerpt :content="field.value" :plain-text="true" :should-show="field.shouldShow" class="o1-tooltip-detail" />
<Excerpt :content="field.content" :plain-text="true" :should-show="field.shouldShow" class="o1-tooltip-detail" />
</template>
</PanelItem>
</template>
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<DefaultField :field="field" :errors="errors" :show-help-text="showHelpText">
<template #field> </template>
<template #field>
<Excerpt :content="field.content" :plain-text="true" :should-show="field.shouldShow" class="o1-tooltip-detail" />
</template>
</DefaultField>
</template>

Expand Down
13 changes: 9 additions & 4 deletions resources/js/components/Tooltip.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<template>
<VueTippy class="o1-cursor-pointer o1-items-center o1-flex o1-justify-center o1-text-90 hover:o1-text-primary">
<Tippy
:content="field.content"
:allowHTML="field.allowHtml"
class="o1-cursor-pointer o1-items-center o1-flex o1-justify-center o1-text-90 hover:o1-text-primary"
>
<span class="o1-mr-2" v-if="field.text && field.iconPosition === 'right'">{{ field.text }}</span>
<img v-if="field.iconUrl" :width="field.size || 25" :src="field.iconUrl" />
<span class="o1-inline-flex o1-text-70" v-if="field.iconPath" v-html="field.iconPath"></span>
<span class="o1-ml-2" v-if="field.text && field.iconPosition === 'left'">{{ field.text }}</span>
</VueTippy>
</Tippy>
</template>

<script>
import VueTippy from 'vue-tippy';
import { Tippy } from 'vue-tippy';
import 'tippy.js/dist/tippy.css';
export default {
props: ['field'],
components: { VueTippy },
components: { Tippy },
};
</script>
4 changes: 2 additions & 2 deletions src/Tooltip.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function placement($placement)
return $this->withMeta(['placement' => $placement]);
}

public function tippyOptions($tippyOptions)
public function allowTooltipHTML($allowHtml = true)
{
return $this->withMeta(['tippyOptions' => $tippyOptions]);
return $this->withMeta(['allowHtml' => $allowHtml]);
}

public function resolve($resource, $attribute = null)
Expand Down

0 comments on commit ceb2e45

Please sign in to comment.