@mekari/pixel-input
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -273,21 +273,30 @@ 'use strict'; | ||
* Calculated horizontal padding if have any input addons prefix, | ||
* suffix or both and clear button icon position. | ||
* suffix or both and clear button icon position. | ||
* Only MpText and MpIcon allowed to be assign into MpInputAddon. | ||
*/ | ||
this.$parent.$children.map(node => { | ||
let width = 0; | ||
const withBackground = pixelUtils.isUndef(node.$options.propsData.withBackground); | ||
if (this.$parent.$vnode.parent && this.$parent.$vnode.parent.componentOptions.tag === 'mp-input-group') { | ||
this.$parent.$children.map(parent => { | ||
let width = 0; | ||
const withBackground = pixelUtils.isUndef(parent.$options.propsData.withBackground); | ||
parent.$children.map(child => { | ||
const children = child.$slots.default.filter(e => e.tag); | ||
children.map(subchild => { | ||
if (subchild.componentOptions) { | ||
if (subchild.componentOptions.tag === 'mp-icon' || subchild.componentOptions.tag === 'mp-text') { | ||
width = parseInt(getComputedStyle(subchild.elm).width, 10); | ||
} | ||
} | ||
}); | ||
}); | ||
if (node.$children[0].$children[0]) { | ||
width = parseInt(getComputedStyle(node.$children[0].$children[0].$el).width, 10); | ||
} | ||
if (parent.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12; | ||
} | ||
if (node.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12; | ||
} | ||
if (node.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12; | ||
this.styleRight += withBackground ? width + 1 : width + 12; | ||
} | ||
}); | ||
if (parent.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12; | ||
this.styleRight += withBackground ? width + 1 : width + 12; | ||
} | ||
}); | ||
} | ||
}, | ||
@@ -294,0 +303,0 @@ |
@@ -273,21 +273,30 @@ 'use strict'; | ||
* Calculated horizontal padding if have any input addons prefix, | ||
* suffix or both and clear button icon position. | ||
* suffix or both and clear button icon position. | ||
* Only MpText and MpIcon allowed to be assign into MpInputAddon. | ||
*/ | ||
this.$parent.$children.map(node => { | ||
let width = 0; | ||
const withBackground = pixelUtils.isUndef(node.$options.propsData.withBackground); | ||
if (this.$parent.$vnode.parent && this.$parent.$vnode.parent.componentOptions.tag === 'mp-input-group') { | ||
this.$parent.$children.map(parent => { | ||
let width = 0; | ||
const withBackground = pixelUtils.isUndef(parent.$options.propsData.withBackground); | ||
parent.$children.map(child => { | ||
const children = child.$slots.default.filter(e => e.tag); | ||
children.map(subchild => { | ||
if (subchild.componentOptions) { | ||
if (subchild.componentOptions.tag === 'mp-icon' || subchild.componentOptions.tag === 'mp-text') { | ||
width = parseInt(getComputedStyle(subchild.elm).width, 10); | ||
} | ||
} | ||
}); | ||
}); | ||
if (node.$children[0].$children[0]) { | ||
width = parseInt(getComputedStyle(node.$children[0].$children[0].$el).width, 10); | ||
} | ||
if (parent.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12; | ||
} | ||
if (node.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12; | ||
} | ||
if (node.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12; | ||
this.styleRight += withBackground ? width + 1 : width + 12; | ||
} | ||
}); | ||
if (parent.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12; | ||
this.styleRight += withBackground ? width + 1 : width + 12; | ||
} | ||
}); | ||
} | ||
}, | ||
@@ -294,0 +303,0 @@ |
@@ -269,21 +269,30 @@ import { MpBox } from '@mekari/pixel-box'; | ||
* Calculated horizontal padding if have any input addons prefix, | ||
* suffix or both and clear button icon position. | ||
* suffix or both and clear button icon position. | ||
* Only MpText and MpIcon allowed to be assign into MpInputAddon. | ||
*/ | ||
this.$parent.$children.map(node => { | ||
let width = 0; | ||
const withBackground = isUndef(node.$options.propsData.withBackground); | ||
if (this.$parent.$vnode.parent && this.$parent.$vnode.parent.componentOptions.tag === 'mp-input-group') { | ||
this.$parent.$children.map(parent => { | ||
let width = 0; | ||
const withBackground = isUndef(parent.$options.propsData.withBackground); | ||
parent.$children.map(child => { | ||
const children = child.$slots.default.filter(e => e.tag); | ||
children.map(subchild => { | ||
if (subchild.componentOptions) { | ||
if (subchild.componentOptions.tag === 'mp-icon' || subchild.componentOptions.tag === 'mp-text') { | ||
width = parseInt(getComputedStyle(subchild.elm).width, 10); | ||
} | ||
} | ||
}); | ||
}); | ||
if (node.$children[0].$children[0]) { | ||
width = parseInt(getComputedStyle(node.$children[0].$children[0].$el).width, 10); | ||
} | ||
if (parent.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12; | ||
} | ||
if (node.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12; | ||
} | ||
if (node.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12; | ||
this.styleRight += withBackground ? width + 1 : width + 12; | ||
} | ||
}); | ||
if (parent.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12; | ||
this.styleRight += withBackground ? width + 1 : width + 12; | ||
} | ||
}); | ||
} | ||
}, | ||
@@ -290,0 +299,0 @@ |
{ | ||
"name": "@mekari/pixel-input", | ||
"description": "Mekari Pixel | Input component", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage": "https://mekari.design/", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -78,22 +78,33 @@ import { MpBox } from '@mekari/pixel-box' | ||
* Calculated horizontal padding if have any input addons prefix, | ||
* suffix or both and clear button icon position. | ||
* suffix or both and clear button icon position. | ||
* Only MpText and MpIcon allowed to be assign into MpInputAddon. | ||
*/ | ||
this.$parent.$children.map((node) => { | ||
let width = 0 | ||
const withBackground = isUndef(node.$options.propsData.withBackground) | ||
if (this.$parent.$vnode.parent && this.$parent.$vnode.parent.componentOptions.tag === 'mp-input-group') { | ||
this.$parent.$children.map((parent) => { | ||
let width = 0 | ||
const withBackground = isUndef(parent.$options.propsData.withBackground) | ||
if (node.$children[0].$children[0]) { | ||
width = parseInt(getComputedStyle(node.$children[0].$children[0].$el).width, 10) | ||
} | ||
parent.$children.map((child) => { | ||
const children = child.$slots.default.filter((e) => e.tag) | ||
if (node.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12 | ||
} | ||
children.map((subchild) => { | ||
if (subchild.componentOptions) { | ||
if (subchild.componentOptions.tag === 'mp-icon' || subchild.componentOptions.tag === 'mp-text') { | ||
width = parseInt(getComputedStyle(subchild.elm).width, 10) | ||
} | ||
} | ||
}) | ||
}) | ||
if (node.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12 | ||
this.styleRight += withBackground ? width + 1 : width + 12 | ||
} | ||
}) | ||
if (parent.$refs.inputLeftAddonRef) { | ||
this.stylePaddingLeft += withBackground ? width + 1 : width + 12 | ||
} | ||
if (parent.$refs.inputRightAddonRef) { | ||
this.stylePaddingRight += withBackground ? width + 1 : width + 12 | ||
this.styleRight += withBackground ? width + 1 : width + 12 | ||
} | ||
}) | ||
} | ||
}, | ||
@@ -100,0 +111,0 @@ render(h) { |
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
54692
1954