forked from CroudTech/vue-semantic
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue-semantic.js
116 lines (102 loc) · 3.72 KB
/
vue-semantic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
var Accordion = require('./src/Accordion.vue'),
Checkbox = require('./src/Checkbox.vue'),
Column = require('./src/Column.vue'),
Divider = require('./src/Divider.vue'),
Dropdown = require('./src/Dropdown.vue'),
FormDropdown = require('./src/FormDropdown.vue'),
Icon = require('./src/elements/Icon.vue'),
Label = require('./src/Label.vue'),
Loading = require('./src/Loading.vue'),
Message = require('./src/Message.vue'),
Modal = require('./src/Modal.vue'),
Popup = require('./src/Popup.vue'),
Radiobutton = require('./src/Radiobutton.vue'),
Rail = require('./src/elements/Rail.vue'),
Reveal = require('./src/Reveal.vue'),
Search = require('./src/Search.vue'),
Statistic = require('./src/Statistic.vue');
module.exports = {
install: function (Vue, options) {
Vue.component('semantic-accordion', Accordion);
Vue.component('semantic-checkbox', Checkbox);
Vue.component('semantic-column', Column);
Vue.component('semantic-divider', Divider);
Vue.component('semantic-dropdown', Dropdown);
Vue.component('semantic-form-dropdown', FormDropdown);
Vue.component('semantic-icon', Icon);
Vue.component('semantic-label', Label);
Vue.component('semantic-loader', Loading);
Vue.component('semantic-message', Message);
Vue.component('semantic-modal', Modal);
Vue.component('semantic-popup', Popup);
Vue.component('semantic-radio', Radiobutton);
Vue.component('semantic-rail', Rail);
Vue.component('semantic-reveal', Reveal);
Vue.component('semantic-search', Search);
Vue.component('semantic-statistic', Statistic);
if (!$.fn.transition) return;
var emphasis = [
'flash',
'shake',
'pulse',
'tada',
'bounce',
'jiggle',
]
var appearance = [
'slide up',
'slide down',
'vertical flip',
'horizontal flip',
'fade',
'fade up',
'fade down',
'scale',
'drop',
'browse',
]
emphasis.forEach(function (animation) {
var definition = {
enter: function (el, done) {
$(el)
.transition('reset')
.transition(animation + ' in', 700, done)
return function() {
$(el).transition('stop')
}
},
leave: function (el, done) {
$(el)
.transition('reset')
.transition(animation + ' out', 700, done)
return function() {
$(el).transition('stop')
}
}
}
Vue.transition(animation, definition)
})
appearance.forEach(function (animation) {
var definition = {
enter: function (el, done) {
$(el)
.transition('reset')
.transition(animation + ' in', 700, done)
return function() {
$(el).transition('stop')
}
},
leave: function (el, done) {
$(el)
.transition('reset')
.transition(animation + ' out', 700, done)
return function() {
$(el).transition('stop')
}
}
}
var id = animation.split(' ').join('-')
Vue.transition(id, definition)
})
},
}