@mekari/pixel-banner
Advanced tools
Comparing version 0.4.22 to 0.4.23
@@ -146,2 +146,15 @@ 'use strict'; | ||
mounted() { | ||
this.validateIconVariant(this.variant); | ||
}, | ||
methods: { | ||
validateIconVariant(iconVariant) { | ||
if (!(iconVariant in getIconVariant)) { | ||
console.warn(`[Pixel]: Banner variant '${iconVariant}' is not valid. Please use one of the following: ${Object.keys(getIconVariant).join(', ')}.`); | ||
} | ||
} | ||
}, | ||
render(h) { | ||
@@ -158,4 +171,4 @@ let iconNodes = []; | ||
const bannerIconProps = getIconVariant[this.variant]; | ||
propsData.name = bannerIconProps.name; | ||
propsData.color = bannerIconProps.color; | ||
propsData.name = bannerIconProps && bannerIconProps.name ? bannerIconProps.name : propsData.name || ''; | ||
propsData.color = bannerIconProps && bannerIconProps.color ? bannerIconProps.color : propsData.color || ''; | ||
iconNodes.push(node); | ||
@@ -162,0 +175,0 @@ } else if (node.componentOptions.tag === 'mp-banner-link') { |
@@ -146,2 +146,15 @@ 'use strict'; | ||
mounted() { | ||
this.validateIconVariant(this.variant); | ||
}, | ||
methods: { | ||
validateIconVariant(iconVariant) { | ||
if (!(iconVariant in getIconVariant)) { | ||
console.warn(`[Pixel]: Banner variant '${iconVariant}' is not valid. Please use one of the following: ${Object.keys(getIconVariant).join(', ')}.`); | ||
} | ||
} | ||
}, | ||
render(h) { | ||
@@ -158,4 +171,4 @@ let iconNodes = []; | ||
const bannerIconProps = getIconVariant[this.variant]; | ||
propsData.name = bannerIconProps.name; | ||
propsData.color = bannerIconProps.color; | ||
propsData.name = bannerIconProps && bannerIconProps.name ? bannerIconProps.name : propsData.name || ''; | ||
propsData.color = bannerIconProps && bannerIconProps.color ? bannerIconProps.color : propsData.color || ''; | ||
iconNodes.push(node); | ||
@@ -162,0 +175,0 @@ } else if (node.componentOptions.tag === 'mp-banner-link') { |
@@ -142,2 +142,15 @@ import { MpBox } from '@mekari/pixel-box'; | ||
mounted() { | ||
this.validateIconVariant(this.variant); | ||
}, | ||
methods: { | ||
validateIconVariant(iconVariant) { | ||
if (!(iconVariant in getIconVariant)) { | ||
console.warn(`[Pixel]: Banner variant '${iconVariant}' is not valid. Please use one of the following: ${Object.keys(getIconVariant).join(', ')}.`); | ||
} | ||
} | ||
}, | ||
render(h) { | ||
@@ -154,4 +167,4 @@ let iconNodes = []; | ||
const bannerIconProps = getIconVariant[this.variant]; | ||
propsData.name = bannerIconProps.name; | ||
propsData.color = bannerIconProps.color; | ||
propsData.name = bannerIconProps && bannerIconProps.name ? bannerIconProps.name : propsData.name || ''; | ||
propsData.color = bannerIconProps && bannerIconProps.color ? bannerIconProps.color : propsData.color || ''; | ||
iconNodes.push(node); | ||
@@ -158,0 +171,0 @@ } else if (node.componentOptions.tag === 'mp-banner-link') { |
{ | ||
"name": "@mekari/pixel-banner", | ||
"description": "Mekari Pixel | Breaks the main user flow to present information component", | ||
"version": "0.4.22", | ||
"version": "0.4.23", | ||
"homepage": "https://mekari.design/", | ||
@@ -28,3 +28,3 @@ "repository": { | ||
"@mekari/pixel-box": "0.2.3", | ||
"@mekari/pixel-icon": "0.12.1", | ||
"@mekari/pixel-icon": "0.12.2", | ||
"@mekari/pixel-pseudo-box": "0.2.3", | ||
@@ -31,0 +31,0 @@ "@mekari/pixel-text": "0.2.3", |
@@ -40,2 +40,16 @@ import { MpBox } from '@mekari/pixel-box' | ||
}, | ||
mounted() { | ||
this.validateIconVariant(this.variant) | ||
}, | ||
methods: { | ||
validateIconVariant(iconVariant) { | ||
if (!(iconVariant in getIconVariant)) { | ||
console.warn( | ||
`[Pixel]: Banner variant '${iconVariant}' is not valid. Please use one of the following: ${Object.keys( | ||
getIconVariant | ||
).join(', ')}.` | ||
) | ||
} | ||
} | ||
}, | ||
render(h) { | ||
@@ -52,4 +66,4 @@ let iconNodes = [] | ||
propsData.name = bannerIconProps.name | ||
propsData.color = bannerIconProps.color | ||
propsData.name = bannerIconProps && bannerIconProps.name ? bannerIconProps.name : propsData.name || '' | ||
propsData.color = bannerIconProps && bannerIconProps.color ? bannerIconProps.color : propsData.color || '' | ||
iconNodes.push(node) | ||
@@ -56,0 +70,0 @@ } else if (node.componentOptions.tag === 'mp-banner-link') { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39355
1457
+ Added@mekari/pixel-icon@0.12.2(transitive)
- Removed@mekari/pixel-icon@0.12.1(transitive)
Updated@mekari/pixel-icon@0.12.2