This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateClassName (amountOfLettersInClassName) { | |
amountOfLettersInClassName = amountOfLettersInClassName || 9; | |
var className = []; | |
for (var i = 0; i < amountOfLettersInClassName; i++) { | |
var charCodeOffset = 65; | |
var numeral = Math.round(Math.random() * 25) + charCodeOffset; | |
var letter = String.fromCharCode(numeral); | |
className.push(letter); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div :class="[namespace]"> | |
</div> | |
</template> | |
<script> | |
// Abstract | |
import Component from '@/components/component' | |
// Components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div :class="[namespace.kebab]" v-if="show"> | |
<div class="overlay"></div> | |
<div class="window"> | |
<button class="close" @click="close" v-if="withClose" /> | |
<slot v-bind="api" /> | |
</div> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div :class="[namespace.kebab]"> | |
<h2 class="title" v-if="$slots.title"> | |
<slot name="title" /> | |
</h2> | |
<div class="body"> | |
<slot name="body" /> | |
</div> | |
<slot name="button"> | |
<w-modal-button @click="$props.close">אישור</w-modal-button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<w-modal :show.sync="show"> | |
<template scope="api"> | |
<w-modal-content v-bind="api"> | |
<template slot="title"> | |
{{shortLorem}} | |
</template> | |
<template slot="body"> | |
{{lorem}} | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/23757345/android-does-not-correctly-scroll-on-input-focus-if-not-body-element | |
export const androidScrollOnInputFocusPolyfill = () => { | |
if (document.activeElement.tagName === 'INPUT') { | |
window.setTimeout(function () { | |
document.activeElement.scrollIntoViewIfNeeded() | |
}, 0) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
install(Vue, options) { | |
Vue.prototype.$state = options.store.state | |
Vue.prototype.$getters = options.store.getters | |
Vue.prototype.$commit = options.store.commit | |
Vue.prototype.$dispatch = options.store.dispatch | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
install(Vue, options) { | |
Vue.prototype.$bus = options.EventBus | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isValidIsraeliId: value => { | |
let extrapolationA = 0 | |
const extrapolationB = parseInt(value.charAt(8), 10) | |
for (let i = 0; i < 8; i++) { | |
let extrapolatedDigit = (i % 2 + 1) * value.charAt(i) | |
if (extrapolatedDigit > 9) { | |
const extrapolatedDigitString = extrapolatedDigit.toString() | |
extrapolatedDigit = parseInt(extrapolatedDigitString.charAt(0), 10) | |
extrapolatedDigit += parseInt(extrapolatedDigitString.charAt(1), 10) | |
} |