diff --git a/src/components/accordions.js b/src/components/accordions.js index 8a9ca3558..2a480b7be 100644 --- a/src/components/accordions.js +++ b/src/components/accordions.js @@ -58,7 +58,7 @@ export default [ }, { name: 'Design', - fields: ['color', 'bgcolor', 'variant', 'toggle', 'height', 'width', 'designerMode', 'bgcolormodern'], + fields: ['color', 'bgcolor', 'variant', 'variantStyle', 'toggle', 'height', 'width', 'designerMode', 'bgcolormodern'], open: false, }, { diff --git a/src/components/index.js b/src/components/index.js index 5740296da..499708cc7 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -72,6 +72,7 @@ export { validationRulesProperty, toggleStyleProperty, buttonVariantStyleProperty, + linkVariantStyleProperty, defaultValueProperty, buttonTypeEvent, tooltipProperty, diff --git a/src/components/renderer/link-button.vue b/src/components/renderer/link-button.vue index 2c75eb699..efdc07cc9 100644 --- a/src/components/renderer/link-button.vue +++ b/src/components/renderer/link-button.vue @@ -1,6 +1,9 @@ @@ -8,6 +11,7 @@ export default { props: [ "variant", + "variantStyle", "label", "event", "eventData", @@ -18,7 +22,10 @@ export default { ], computed: { classColor() { - return `text-${this.variant}`; + if (this.variantStyle === "link") { + return `text-${this.variant}`; + } + return `btn btn-${this.variant}`; } } }; diff --git a/src/form-builder-controls.js b/src/form-builder-controls.js index fa36cd71e..5d82a8305 100755 --- a/src/form-builder-controls.js +++ b/src/form-builder-controls.js @@ -49,6 +49,8 @@ import { bgcolorModern, bgcolorPropertyRecord, colorPropertyRecord, + linkVariantStyleProperty, + variantStyleProperty } from './form-control-common-properties'; export default [ @@ -1080,7 +1082,9 @@ export default [ label: "New Link", icon: "fas fa-link", variant: "primary", + variantStyle: "link", event: "link", + value: "link" }, inspector: [ { @@ -1088,7 +1092,7 @@ export default [ field: 'label', config: { label: 'Label', - helper: 'The label describes the button\'s text', + helper: 'The label describes the link\'s text', }, }, { @@ -1097,9 +1101,10 @@ export default [ config: { label: 'Link URL', helper: 'Type here the URL link. Mustache syntax is supported.', - }, + }, }, - buttonVariantStyleProperty + variantStyleProperty, + linkVariantStyleProperty ] } }, diff --git a/src/form-control-common-properties.js b/src/form-control-common-properties.js index 1cbd32b32..b3e404111 100644 --- a/src/form-control-common-properties.js +++ b/src/form-control-common-properties.js @@ -284,53 +284,76 @@ export const toggleStyleProperty = { }, }; +const optionsColor = [ + { + value: "primary", + content: "Primary" + }, + { + value: "secondary", + content: "Secondary" + }, + { + value: "success", + content: "Success" + }, + { + value: "danger", + content: "Danger" + }, + { + value: "warning", + content: "Warning" + }, + { + value: "info", + content: "Info" + }, + { + value: "light", + content: "Light" + }, + { + value: "dark", + content: "Dark" + }, + { + value: "link", + content: "Link" + } +]; + export const buttonVariantStyleProperty = { - type: 'FormMultiselect', - field: 'variant', + type: "FormMultiselect", + field: "variant", config: { - label: 'Button Variant Style', - helper: 'The variant determines the appearance of the button', - options: [ - { - value: 'primary', - content: 'Primary', - }, - { - value: 'secondary', - content: 'Secondary', - }, - { - value: 'success', - content: 'Success', - }, - { - value: 'danger', - content: 'Danger', - }, - { - value: 'warning', - content: 'Warning', - }, - { - value: 'info', - content: 'Info', - }, - { - value: 'light', - content: 'Light', - }, + label: "Button Variant Style", + helper: "The variant determines the appearance of the button", + options: optionsColor + } +}; - { - value: 'dark', - content: 'Dark', - }, +export const linkVariantStyleProperty = { + type: "FormMultiselect", + field: "variant", + config: { + label: "Link Variant Style", + helper: "The variant determines the appearance of the link", + options: optionsColor + } +}; - { - value: 'link', - content: 'Link', - }, - ], - }, +export const variantStyleProperty = { + type: "FormMultiselect", + field: "variantStyle", + config: { + label: "Variant Style", + helper: "The variant determines the appearance of the link", + options: [ + { value: "link", content: "Link" }, + { value: "button", content: "Button" } + ] + } }; export const defaultValueProperty = {