Repository: johnleider/vue-materials
Branch: master
Commit: e2f344e58e33
Files: 70
Total size: 53.3 KB
Directory structure:
gitextract_g08_wqlj/
├── .babelrc
├── .gitignore
├── .npmignore
├── README.md
├── build/
│ ├── release.sh
│ ├── webpack.config.js
│ └── webpack.dev.config.js
├── index.html
├── package.json
└── src/
├── components/
│ ├── _index.js
│ ├── badge.vue
│ ├── breadcrumbs.vue
│ ├── button-link.vue
│ ├── button.vue
│ ├── card.vue
│ ├── carousel-item.vue
│ ├── carousel.vue
│ ├── checkbox.vue
│ ├── chip.vue
│ ├── collapsible.vue
│ ├── collection-avatar.vue
│ ├── collection-item.vue
│ ├── collection-link.vue
│ ├── collection.vue
│ ├── date-input.vue
│ ├── fab.vue
│ ├── file-input.vue
│ ├── footer.vue
│ ├── functional/
│ │ ├── _index.js
│ │ ├── collapsible-body.js
│ │ ├── collapsible-header.js
│ │ ├── container.js
│ │ ├── dropdown.js
│ │ ├── grid.js
│ │ └── row.js
│ ├── icon.vue
│ ├── material-box.vue
│ ├── modal.vue
│ ├── nav.vue
│ ├── pagination-item.vue
│ ├── pagination.vue
│ ├── parallax.vue
│ ├── progress-circular.vue
│ ├── progress-linear.vue
│ ├── radio.vue
│ ├── range.vue
│ ├── select.vue
│ ├── side-nav.vue
│ ├── slide.vue
│ ├── slider.vue
│ ├── switch.vue
│ ├── tab.vue
│ ├── tabs.vue
│ ├── text-area.vue
│ └── text-input.vue
├── directives/
│ ├── _index.js
│ ├── dropdown.js
│ ├── modal.js
│ ├── side-nav.js
│ └── tooltip.js
├── index.js
├── mixins/
│ ├── buttons.js
│ ├── collection-item.js
│ ├── counter.js
│ ├── dropdown.js
│ ├── is-loadable.js
│ └── waves.js
└── util/
├── dialog.js
├── load.js
└── scroll-fire.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": ["es2015"]
}
================================================
FILE: .gitignore
================================================
.DS_Store
node_modules/
npm-debug.log
.idea/
dev/
================================================
FILE: .npmignore
================================================
dev/
build/
index.html
================================================
FILE: README.md
================================================
# Docs
https://vuematerials.com
# Deprecated
This project is no longer maintained, please see [Vuetify](https://github.com/vuetifyjs/vuetify)
================================================
FILE: build/release.sh
================================================
set -e
echo "Enter release version: "
read VERSION
read -p "Releasing $VERSION - are you sure (y/n)" -n 1 -r
echo #
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Releasing $VERSION ..."
npm run build
git add -A
git commit -m "[build] $VERSION"
npm version $VERSION --message "[release] $VERSION"
git push
npm publish
fi
================================================
FILE: build/webpack.config.js
================================================
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'vue-materials.min.js',
library: 'VueMaterials',
libraryTarget: 'umd'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file',
query: {
name: '[name].[ext]?[hash]'
}
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=/fonts/[name].[ext]'
}
]
},
devServer: {
historyApiFallback: true,
noInfo: true
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: true
}
})
])
}
================================================
FILE: build/webpack.dev.config.js
================================================
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './dev/index.js',
output: {
path: path.resolve(__dirname, '../dev'),
publicPath: '/dev/',
filename: 'dev.js'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules|dist/
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file',
query: {
name: '[name].[ext]?[hash]'
}
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=/fonts/[name].[ext]'
}
]
},
devServer: {
historyApiFallback: true,
noInfo: true
},
devtool: '#eval-source-map'
}
================================================
FILE: index.html
================================================
vue-materialize
================================================
FILE: package.json
================================================
{
"name": "vue-materials",
"description": "Materialize.css components for Vue JS",
"author": "John Leider ",
"version": "1.0.7-rc.7",
"private": false,
"main": "dist/vue-materials.min.js",
"license": "MIT",
"scripts": {
"dev": "webpack-dev-server --inline --hot --host=0.0.0.0 --port=8082 --config=build/webpack.dev.config.js",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config=build/webpack.config.js"
},
"dependencies": {
"vue": "^2.0.1"
},
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"cross-env": "^1.0.6",
"css-loader": "^0.23.1",
"file-loader": "^0.8.4",
"materialize-css": "^0.97.6",
"node-sass": "^3.8.0",
"rollup": "^0.33.0",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-vue": "^2.0.1",
"sass-loader": "^4.0.0",
"style-loader": "^0.13.1",
"uglify-js": "^2.7.0",
"vue-hot-reload-api": "^2.0.5",
"vue-loader": "^9.1.2",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.12.0"
}
}
================================================
FILE: src/components/_index.js
================================================
import VFooter from './footer.vue'
import VNav from './nav.vue'
import VSideNav from './side-nav.vue'
import VBadge from './badge.vue'
import VBreadcrumbs from './breadcrumbs.vue'
import VBtn from './button.vue'
import VBtnLink from './button-link.vue'
import VCard from './card.vue'
import VCarousel from './carousel.vue'
import VCarouselItem from './carousel-item.vue'
import VCheckbox from './checkbox.vue'
import VChip from './chip.vue'
import VCollapsible from './collapsible.vue'
import VCollection from './collection.vue'
import VCollectionItem from './collection-item.vue'
import VCollectionLink from './collection-link.vue'
import VCollectionAvatar from './collection-avatar.vue'
import VDateInput from './date-input.vue'
import VFileInput from './file-input.vue'
import VIcon from './icon.vue'
import VMaterialBox from './material-box.vue'
import VModal from './modal.vue'
import VFab from './fab.vue'
import VPagination from './pagination.vue'
import VPaginationItem from './pagination-item.vue'
import VParallax from './parallax.vue'
import VProgressLinear from './progress-linear.vue'
import VProgressCircular from './progress-circular.vue'
import VRadio from './radio.vue'
import VRange from './range.vue'
import VSelect from './select.vue'
import VSlider from './slider.vue'
import VSlide from './slide.vue'
import VSwitch from './switch.vue'
import VTab from './tab.vue'
import VTabs from './tabs.vue'
import VTextArea from './text-area.vue'
import VTextInput from './text-input.vue'
export default {
VFooter,
VNav,
VSideNav,
VBadge,
VBreadcrumbs,
VBtn,
VBtnLink,
VCard,
VCarousel,
VCarouselItem,
VChip,
VCollapsible,
VCollection,
VCollectionItem,
VCheckbox,
VCollectionLink,
VCollectionAvatar,
VDateInput,
VFileInput,
VIcon,
VMaterialBox,
VModal,
VFab,
VPagination,
VPaginationItem,
VParallax,
VProgressLinear,
VProgressCircular,
VRadio,
VRange,
VSelect,
VSlider,
VSlide,
VSwitch,
VTab,
VTabs,
VTextArea,
VTextInput
}
================================================
FILE: src/components/badge.vue
================================================
================================================
FILE: src/components/breadcrumbs.vue
================================================
================================================
FILE: src/components/button-link.vue
================================================
================================================
FILE: src/components/button.vue
================================================
================================================
FILE: src/components/card.vue
================================================
================================================
FILE: src/components/carousel-item.vue
================================================
================================================
FILE: src/components/carousel.vue
================================================
================================================
FILE: src/components/checkbox.vue
================================================
================================================
FILE: src/components/chip.vue
================================================
close
================================================
FILE: src/components/collapsible.vue
================================================
================================================
FILE: src/components/collection-avatar.vue
================================================
================================================
FILE: src/components/collection-item.vue
================================================
================================================
FILE: src/components/collection-link.vue
================================================
================================================
FILE: src/components/collection.vue
================================================
================================================
FILE: src/components/date-input.vue
================================================
================================================
FILE: src/components/fab.vue
================================================
{{ icon }}
================================================
FILE: src/components/file-input.vue
================================================
================================================
FILE: src/components/footer.vue
================================================
================================================
FILE: src/components/functional/_index.js
================================================
import VRow from './row'
import VGrid from './grid'
import VContainer from './container'
import VCollapsibleHeader from './collapsible-header'
import VCollapsibleBody from './collapsible-body'
import VDropdown from './dropdown'
export default {
VRow,
VGrid,
VContainer,
VCollapsibleHeader,
VCollapsibleBody,
VDropdown
}
================================================
FILE: src/components/functional/collapsible-body.js
================================================
export default {
functional: true,
render: (h, { data, children }) => {
if (!data.staticClass) {
data.staticClass = ''
}
data.staticClass += ' collapsible-body'
return h('div', data, children)
}
}
================================================
FILE: src/components/functional/collapsible-header.js
================================================
export default {
functional: true,
render: (h, { data, children }) => {
if (!data.staticClass) {
data.staticClass = ''
}
data.staticClass += ' collapsible-header'
return h('div', data, children)
}
}
================================================
FILE: src/components/functional/container.js
================================================
export default {
functional: true,
render: (h, { data, children }) => {
data.staticClass = data.staticClass || ''
data.staticClass += ' container'
return h('div', data, children)
}
}
================================================
FILE: src/components/functional/dropdown.js
================================================
export default {
functional: true,
render: (h, { data, children }) => {
if (!data.staticClass) {
data.staticClass = ''
}
data.staticClass += ' dropdown-content'
return h('ul', data, children)
}
}
================================================
FILE: src/components/functional/grid.js
================================================
export default {
functional: true,
render: (h, { data, children }) => {
let attrs = Object.keys(data.attrs)
attrs.unshift('col')
data.attrs = {}
data.attrs.class = attrs.join(' ')
return h('div', data, children)
}
}
================================================
FILE: src/components/functional/row.js
================================================
export default {
functional: true,
render: (h, { data, children }) => {
data.staticClass = data.staticClass || ''
data.staticClass += ' row'
return h('div', data, children)
}
}
================================================
FILE: src/components/icon.vue
================================================
================================================
FILE: src/components/material-box.vue
================================================
================================================
FILE: src/components/modal.vue
================================================
================================================
FILE: src/components/nav.vue
================================================
================================================
FILE: src/components/pagination-item.vue
================================================
================================================
FILE: src/components/pagination.vue
================================================
================================================
FILE: src/components/parallax.vue
================================================
================================================
FILE: src/components/progress-circular.vue
================================================
================================================
FILE: src/components/progress-linear.vue
================================================
================================================
FILE: src/components/radio.vue
================================================
================================================
FILE: src/components/range.vue
================================================
================================================
FILE: src/components/select.vue
================================================
================================================
FILE: src/components/side-nav.vue
================================================
================================================
FILE: src/components/slide.vue
================================================
================================================
FILE: src/components/slider.vue
================================================
================================================
FILE: src/components/switch.vue
================================================
================================================
FILE: src/components/tab.vue
================================================
================================================
FILE: src/components/tabs.vue
================================================
================================================
FILE: src/components/text-area.vue
================================================
================================================
FILE: src/components/text-input.vue
================================================
================================================
FILE: src/directives/_index.js
================================================
import Dropdown from './dropdown'
import Modal from './modal'
import SideNav from './side-nav'
import Tooltip from './tooltip'
export default {
Dropdown,
Modal,
SideNav,
Tooltip
}
================================================
FILE: src/directives/dropdown.js
================================================
import Load from '../util/load'
export default {
bind (el, binding, vnode) {
Load.call(vnode.context, () => {
const params = binding.value || {}
el.setAttribute('data-activates', binding.arg || params.value)
$(el).dropdown(params)
})
}
}
================================================
FILE: src/directives/modal.js
================================================
import Load from '../util/load'
export default {
bind (el, binding, vnode) {
Load.call(vnode.context, () => {
const params = binding.value || {}
if (el.nodeName === 'button') {
el.setAttribute('data-target', binding.arg || params.value)
} else {
el.setAttribute('href', `#${binding.arg || params.value}`)
}
$(`#${binding.arg || params.value}`).modal()
})
}
}
================================================
FILE: src/directives/side-nav.js
================================================
import Load from '../util/load'
export default {
bind (el, binding, vnode) {
Load.call(vnode.context, () => {
el.setAttribute('data-activates', binding.arg)
$(el).sideNav(binding.value || {})
})
}
}
================================================
FILE: src/directives/tooltip.js
================================================
import Load from '../util/load'
const tooltip = (el, binding, vnode) => {
const delay = typeof binding.modifiers !== 'undefined'
? Object.keys(binding.modifiers)[0]
: 50
el.classList.add('tooltipped')
el.setAttribute('data-position', binding.arg)
el.setAttribute('data-delay', delay)
el.setAttribute('data-tooltip', binding.expression.replace(/\'/g, ''))
Load.call(vnode.context, () => $(el).tooltip())
}
export default {
bind (el, binding, vnode) {
tooltip(el, binding, vnode)
},
postupdate (el, binding, vnode) {
tooltip(el, binding, vnode)
}
}
================================================
FILE: src/index.js
================================================
import Components from './components/_index'
import Directives from './directives/_index'
import Functional from './components/functional/_index'
import Dialog from './util/dialog'
import ScrollFire from './util/scroll-fire'
function plugin(Vue) {
if (plugin.installed) return
for (let key in Components) {
Vue.component(key, Components[key])
}
for (let key in Functional) {
Vue.component(key, Functional[key])
}
for (let key in Directives) {
Vue.directive(key, Directives[key])
}
Vue.dialog = Dialog
Vue.scrollFire = ScrollFire
Object.defineProperties(Vue.prototype, {
$dialog: {
get: () => Vue.dialog.bind(this)
},
$scrollFire: {
get: () => Vue.scrollFire.bind(this)
}
})
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin);
}
export default plugin
================================================
FILE: src/mixins/buttons.js
================================================
export default {
props: {
disabled: {
type: Boolean,
default: false
},
flat: {
type: Boolean,
default: false
},
floating: {
type: Boolean,
default: false
},
large: {
type: Boolean,
default: false
},
modal: {
type: Boolean,
default: false
}
},
computed: {
buttonsMixin () {
return {
'btn': !this.flat,
'btn-floating': this.floating,
'btn-large': this.large,
'btn-flat': this.flat,
'modal-action modal-close': this.modal,
'disabled': this.disabled
}
}
}
}
================================================
FILE: src/mixins/collection-item.js
================================================
export default {
props: {
active: {
type: Boolean,
default: false
},
dismissable: {
type: Boolean,
default: false
},
header: {
type: Boolean,
default: false
}
},
computed: {
collectionsMixin () {
return {
'active': this.active,
'dismissable': this.dismissable,
'collection-item': !this.header,
'collection-header': this.header
}
}
}
}
================================================
FILE: src/mixins/counter.js
================================================
import Load from '../util/load'
export default {
props: {
length: {
type: [Boolean, Number, String],
default: false
}
},
mounted () {
Load.call(this, () => $(this.$el).characterCounter())
},
postupdate () {
Load.call(this, () => $(this.$el).characterCounter())
}
}
================================================
FILE: src/mixins/dropdown.js
================================================
export default {
props: {
induration: {
type: Number,
default: 300
},
outduration: {
type: Number,
default: 225
},
constrainwidth: {
type: Boolean,
default: true
},
hover: {
type: Boolean,
default: false
},
gutter: {
type: Number,
default: 0
},
beloworigin: {
type: Boolean,
default: false
},
alignment: {
type: String,
default: 'left'
}
}
}
================================================
FILE: src/mixins/is-loadable.js
================================================
import Load from '../util/load'
export default {
mounted () {
Load.call(this, () => this.init())
}
}
================================================
FILE: src/mixins/waves.js
================================================
export default {
props: {
wavesCircle: {
type: Boolean,
default: false
},
wavesLight: {
type: Boolean,
default: false
},
wavesOrange: {
type: Boolean,
default: false
},
wavesPurple: {
type: Boolean,
default: false
},
wavesGreen: {
type: Boolean,
default: false
},
wavesTeal: {
type: Boolean,
default: false
},
wavesRed: {
type: Boolean,
default: false
},
wavesYellow: {
type: Boolean,
default: false
}
},
computed: {
wavesMixin () {
return {
'waves-effect waves-light': this.wavesLight,
'waves-effect waves-red': this.wavesRed,
'waves-effect waves-yellow': this.wavesYellow,
'waves-effect waves-orange': this.wavesOrange,
'waves-effect waves-purple': this.wavesPurple,
'waves-effect waves-green': this.wavesGreen,
'waves-effect waves-teal': this.wavesTeal,
'waves-circle': this.wavesCircle
}
}
}
}
================================================
FILE: src/util/dialog.js
================================================
export default function Dialog(message, duration = 4000, rounded, cb) {
if (typeof rounded === 'function') {
cb = rounded
rounded = ''
}
Materialize.toast(message, duration, rounded, cb)
}
================================================
FILE: src/util/load.js
================================================
export default function (cb) {
if (document.readyState !== 'loading') {
this.$nextTick(() => cb())
} else {
document.addEventListener('DOMContentLoaded', () => cb())
}
}
================================================
FILE: src/util/scroll-fire.js
================================================
export default function ScrollFire(options) {
Materialize.scrollFire(options)
}