0.3.13 • Published 6 years ago

vue-nani-kore v0.3.13

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

vue-nani-kore

A bucket of magnificent VUE components.

Components can be rendered as standalone one with no CSS dependencies. But most of them are (will be) based on Bootstrap 3.x (and 4.x in the future). By the way jQuery dependencies have been removed. But as Uploader is based on DropZone I use a modified (internal) version of DropZone who does not have a dependency on jQuery (that's why it's included in the dist package - it's a little bit bigger)

Software License Latest Version on NPM npm

Working samples

https://goto10hq.github.io/vue-nani-kore/

Usage

Alert

<alert :closable="true" type="info" :duration="3000" @close="open = false">Hello world.</alert>
ParameterTypeDefault valueNote
class-namestringnullcss class (overwriting autogenerated class by type)
closablebooleanfalserender closing button
durationint (ms)0when set to number > 0 then alert is auto closed after a given time
errorsobjectnullspecial case for displaying errors (internal usage)
idstringalert-id-{uid}id of element
typestringsuccessBootstrap alert type, CSS class is auto generated as alert alert-{type}
EventNote
closewhen alert is closed (manually or by timer)
SlotNote
closeclose button

Checkbox

<checkbox v-model="result">Are you sure?</checkbox>
ParameterTypeDefault valueNote
border-colorstringnullborder color
checkedbooleanfalsechecked flag
class-namestringnk-checkboxcss class
disabledbooleanfalsedisabled flag
fill-colorstringnullfill color (checked state)
idstringcheckbox-id-{uid}id of element
namestringnullname attribute
v-modelstring or arrayundefinedmodel value
valuestringnullvalue

CheckboxSwitch

<checkbox-switch v-model="food" value="banana">Banana?</checkbox-switch>               
ParameterTypeDefault valueNote
checkedbooleanfalsechecked flag
class-namestringnk-checkbox-switchcss class
disabledbooleanfalsedisabled flag
idstringcheckbox-switch-id-{uid}id of element
namestringnullname attribute
v-modelstring or arrayundefinedmodel value
valuestringnullvalue

Loading

<loading size="80px" :fullscreen="true" :active="true" type="rotating-box"></loading> 
<loading :active="true">
    <table>...</table>
</loading> 
ParameterTypeDefault valueNote
activebooleantrueshow or hide loading
fill-colorstring#000000fill color
fullscreenbooleanfalsefullscreen mode
idstringloading-id-{uid}id of element
sizestring40pxsize of loading
typestringdouble-bouncetype of loading

Loading types:

  • double-bounce
  • jumping-square
  • rotating-square

Notify

<notify type="info" :event-bus="bus">
    <template slot="content" slot-scope="{data}">
        <div>              
        <h4>{{ data.title }}</h4>
        <p>{{ data.text }}</p>                
        </div>
    </template>
</notify>
ParameterTypeDefault valueNote
class-namestringnullcss class (overwriting autogenerated class by type)
closablebooleanfalserender closing button
durationint (ms)0when set to number > 0 then alert is auto closed after a given time
event-busobjectnullinstance of event bus
event-hidestringshow-notificationname of event for showing one notification
event-showstringhide-notificationsname of event for hiding all notifications
idstringnotify-id-{uid}id of element (container)
methodstringfirstmethod of adding new notifications (first, last)
positionstringtop-centerposition of notifications (top-left, top-center, top-right, bottom-left, bottom-center, bottom-right)
typestringsuccessBootstrap alert type, CSS class is auto generated as alert alert-{type}
widthint (px)350width of one notification
SlotNote
contentcontent of one notification

Radio

<radio v-model="question" name="question" value="answer-1">1</radio>
ParameterTypeDefault valueNote
border-colorstringnullborder color
checkedbooleanfalsechecked flag
class-namestringnk-radiocss class
disabledbooleanfalsedisabled flag
fill-colorstringnullfill color (checked state)
idstringradio-id-{uid}id of element
namestringnullname attribute
v-modelstring or arrayundefinedmodel value
valuestringnullvalue

Uploader

<uploader url='https://nani.kore/api/upload-image' v-model="[]" @error="uploaderError" @files-order-changed="uploaderFilesOrderChanged" :sortable="true">   
    <template slot="file" slot-scope="{data}">                        
        <div class="col-md-3">
            <div class="thumbnail">                
                <img :src="data.server + data.file" class="img-responsive img-rounded" :alt="data.size">                                    
            </div>
            <a href="#" class="btn btn-xs btn-danger" @click.prevent="deleteFile(data.id)">Delete</a>                
        </div>
    </template>                
</uploader>
ParameterTypeDefault valueNote
class-namestringnk-uploadercss class
file-parameterstringfileposted file parameter name for endpoint
idstringuploader-id-{uid}id of element
max-filesint0max files to upload (0 = unlimited)
parallel-uploadsint1number of parallel uploads
sortablebooleanfalseresult can be sorted by drag'n'drop
textstringDrop files here or click to uploaddefault info text message
urlurlnullupload endpoint
EventNote
errorerror uploading file
file-uploadedfile uploaded
files-order-changedfiles order changed
max-files-exceededmax files exceeded
upload-progressupload progress
SlotNote
filecontent of one file

Install

npm

npm install vue-nani-kore --save

Setup

Register the plugin

import NaniKore from 'vue-nani-kore';
Vue.use(NaniKore);

Or register particular components manually

import {CheckboxSwitch} from 'vue-nani-kore';
Vue.component('checkbox-switch', CheckboxSwitch);

TODO

  • Id prop is not rendered in alert
  • Add a couple of loading types for fun
  • Uploader glitches if we user lazy-loading and set a sortable flag to true (check it again - new lazy-loading is up)
  • Notify with Vuex support
  • Highlight options typeahead (tags: before + after)
  • Better sample for typeahed
  • Docs for typeahead

License

MIT © frohikey

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago