Skip to content

Commit

Permalink
FEAT: Display: add option to hide field value
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic-Marcelino committed Jun 22, 2023
1 parent 16e77b2 commit da21d2f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/display/display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<value-null v-if="!value" />
<span v-else class="action-display">
<component
v-if="!hideFieldValue"
:is="(clickAction === 'link') ? 'a' : 'span'"
class="dynamic-wrapper"
:href="computedLink"
Expand Down Expand Up @@ -79,6 +80,10 @@ const props = defineProps({
type: Object,
default: {}, // TODO: type to options!
},
hideFieldValue: {
type: Boolean,
default: false,
},
clickAction: {
type: String,
default: 'default',
Expand Down
13 changes: 13 additions & 0 deletions src/display/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ export default defineDisplay({
const sharedOptions = getSharedConfigOptions(isString);

const customOptionsBeforeShared = [
{
field: 'hideFieldValue',
name: 'Hide field value',
type: 'boolean',
meta: {
width: 'full',
interface: 'v-checkbox',
note: 'When enabled the field value will be hidden. Can be used to only show the actions',
},
schema: {
default_value: false,
},
},
{
field: 'clickAction',
name: 'Click Action (when clicking on the value)',
Expand Down

0 comments on commit da21d2f

Please sign in to comment.