@monoui/vuejs 1.1.11 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoui/vuejs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"description": "This project will contain MonoFor UI Framework",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"repository": "git@gitlab.com:monoui/vuejs.git",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"vee-validate": "^3.0.11",
|
|
34
34
|
"vue": "^2.6.12",
|
|
35
35
|
"vue-cron-2": "^1.0.7",
|
|
36
|
+
"vue-js-toggle-button": "^1.3.3",
|
|
36
37
|
"vue-multiselect": "^2.1.6",
|
|
37
38
|
"vue-server-renderer": "^2.6.12",
|
|
38
39
|
"vue-sweetalert": "^0.1.18",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
'table-responsive': isResponsive,
|
|
6
6
|
'table-relative': isLoading
|
|
7
7
|
}"
|
|
8
|
+
:style="tableStyle"
|
|
8
9
|
>
|
|
9
10
|
<div
|
|
10
11
|
v-if="isLoading && !isEmpty"
|
|
@@ -205,16 +206,23 @@
|
|
|
205
206
|
<b-dropdown-divider
|
|
206
207
|
v-if="
|
|
207
208
|
filteredPerPageValues &&
|
|
208
|
-
filteredPerPageValues.length
|
|
209
|
+
filteredPerPageValues.length &&
|
|
210
|
+
inLimit()
|
|
209
211
|
"
|
|
210
212
|
></b-dropdown-divider>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
|
|
214
|
+
<template>
|
|
215
|
+
<b-dropdown-item
|
|
216
|
+
v-if="inLimit()"
|
|
217
|
+
@click="
|
|
218
|
+
changeItemPerPage(
|
|
219
|
+
settings.totalItemCount
|
|
220
|
+
)
|
|
221
|
+
"
|
|
222
|
+
>
|
|
223
|
+
All ({{ settings.totalItemCount }})
|
|
224
|
+
</b-dropdown-item>
|
|
225
|
+
</template>
|
|
218
226
|
</b-dropdown>
|
|
219
227
|
</div>
|
|
220
228
|
</slot>
|
|
@@ -294,6 +302,11 @@ export default {
|
|
|
294
302
|
required: false,
|
|
295
303
|
default: ""
|
|
296
304
|
},
|
|
305
|
+
tableStyle: {
|
|
306
|
+
type: String,
|
|
307
|
+
required: false,
|
|
308
|
+
default: ""
|
|
309
|
+
},
|
|
297
310
|
isResponsive: {
|
|
298
311
|
type: Boolean,
|
|
299
312
|
required: false,
|
|
@@ -314,7 +327,7 @@ export default {
|
|
|
314
327
|
emptyMessage: {
|
|
315
328
|
type: String,
|
|
316
329
|
required: false,
|
|
317
|
-
default: "No data
|
|
330
|
+
default: "No data available in table"
|
|
318
331
|
},
|
|
319
332
|
autoLoad: {
|
|
320
333
|
type: Boolean,
|
|
@@ -373,7 +386,8 @@ export default {
|
|
|
373
386
|
tableData: [],
|
|
374
387
|
searchWord: null,
|
|
375
388
|
isDataEmpty: false,
|
|
376
|
-
isLoading: false
|
|
389
|
+
isLoading: false,
|
|
390
|
+
limit: 250
|
|
377
391
|
};
|
|
378
392
|
},
|
|
379
393
|
computed: {
|
|
@@ -525,6 +539,9 @@ export default {
|
|
|
525
539
|
}
|
|
526
540
|
|
|
527
541
|
this.getValues();
|
|
542
|
+
},
|
|
543
|
+
inLimit() {
|
|
544
|
+
return this.settings.totalItemCount <= this.limit;
|
|
528
545
|
}
|
|
529
546
|
}
|
|
530
547
|
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<toggle-button v-on="$listeners" v-bind="$props" v-model="toggleValue" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: "mui-toggle-switch",
|
|
8
|
+
props: {
|
|
9
|
+
/**
|
|
10
|
+
*Initial state of the toggle button
|
|
11
|
+
* @type Boolean
|
|
12
|
+
*/
|
|
13
|
+
value: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* If set to true, will be watching changes in value property
|
|
19
|
+
* and overwrite the current state of the button whenever value prop changes
|
|
20
|
+
* @type Boolean
|
|
21
|
+
*/
|
|
22
|
+
sync: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Transition time for the animation
|
|
28
|
+
* @type Number
|
|
29
|
+
*/
|
|
30
|
+
speed: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false,
|
|
33
|
+
default: 300
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Button does not react on mouse events
|
|
37
|
+
* @type Boolean
|
|
38
|
+
*/
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
required: false,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* If String - color of the button when checked
|
|
46
|
+
If Object - colors for the button when checked/unchecked or disabled
|
|
47
|
+
Example: {checked: '#00FF00', unchecked: '#FF0000', disabled: '#CCCCCC'}
|
|
48
|
+
* @type [String, Object]
|
|
49
|
+
*/
|
|
50
|
+
color: {
|
|
51
|
+
type: [String, Object],
|
|
52
|
+
required: false,
|
|
53
|
+
default: "#75C791"
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* If true - deactivates the setting of colors
|
|
57
|
+
* through inline styles in favor of using CSS styling
|
|
58
|
+
* @type Boolean
|
|
59
|
+
*/
|
|
60
|
+
"css-colors": {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
required: false,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* If Boolean - shows/hides default labels ("on" and "off")
|
|
67
|
+
* If Object - sets custom labels for both states.
|
|
68
|
+
* Example: {checked: 'Foo', unchecked: 'Bar'}
|
|
69
|
+
* @type [Boolean, Object]
|
|
70
|
+
*/
|
|
71
|
+
labels: {
|
|
72
|
+
type: [Boolean, Object],
|
|
73
|
+
required: false,
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* If String - color or background property of the switch when checked
|
|
78
|
+
* If Object - colors or background property for the switch when checked/uncheked
|
|
79
|
+
* Example: {checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}
|
|
80
|
+
* @type [String, Object]
|
|
81
|
+
*/
|
|
82
|
+
"switch-color": {
|
|
83
|
+
type: [String, Object],
|
|
84
|
+
required: false,
|
|
85
|
+
default: "#fff"
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Width of the button
|
|
89
|
+
* @type Number
|
|
90
|
+
*/
|
|
91
|
+
width: {
|
|
92
|
+
type: Number,
|
|
93
|
+
required: false,
|
|
94
|
+
default: 50
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Height of the button
|
|
98
|
+
* @type Number
|
|
99
|
+
*/
|
|
100
|
+
height: {
|
|
101
|
+
type: Number,
|
|
102
|
+
required: false,
|
|
103
|
+
default: 22
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Space between the switch and background border
|
|
107
|
+
* @type Number
|
|
108
|
+
*/
|
|
109
|
+
margin: {
|
|
110
|
+
type: Number,
|
|
111
|
+
required: false,
|
|
112
|
+
default: 3
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Font size
|
|
116
|
+
* @type Number
|
|
117
|
+
*/
|
|
118
|
+
"font-size": {
|
|
119
|
+
type: Number,
|
|
120
|
+
required: false,
|
|
121
|
+
default: undefined
|
|
122
|
+
},
|
|
123
|
+
title: {
|
|
124
|
+
type: String,
|
|
125
|
+
required: false
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
data() {
|
|
129
|
+
return {
|
|
130
|
+
toggleValue: false
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
created() {
|
|
134
|
+
this.toggleValue = this.value;
|
|
135
|
+
},
|
|
136
|
+
watch: {
|
|
137
|
+
value(val) {
|
|
138
|
+
this.toggleValue = val;
|
|
139
|
+
},
|
|
140
|
+
toggleValue(val) {
|
|
141
|
+
this.$emit("input", val);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
methods: {
|
|
145
|
+
changeUpdate(event) {
|
|
146
|
+
this.$emit("change", event);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<style></style>
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import Checkbox from "./components/Checkbox";
|
|
|
12
12
|
import Tooltip from "./components/Tooltip";
|
|
13
13
|
import Spinner from "./components/Spinner";
|
|
14
14
|
import Table from "./components/Table";
|
|
15
|
+
import ToggleSwitch from "./components/Toggle-Switch";
|
|
15
16
|
import MultiKeyValue from "./components/MultiKeyValue";
|
|
16
17
|
import {
|
|
17
18
|
Alert,
|
|
@@ -52,6 +53,7 @@ import "@yaireo/tagify/dist/tagify.css";
|
|
|
52
53
|
|
|
53
54
|
import BootstrapVue from "bootstrap-vue";
|
|
54
55
|
import { FontAwesomeIcon } from "./icons";
|
|
56
|
+
import { ToggleButton } from "vue-js-toggle-button";
|
|
55
57
|
import { ValidationObserver, ValidationProvider, extend } from "vee-validate";
|
|
56
58
|
import { min, required, email } from "vee-validate/dist/rules";
|
|
57
59
|
import VueSweetalert2 from "vue-sweetalert2";
|
|
@@ -68,6 +70,10 @@ export default {
|
|
|
68
70
|
Vue.component("font-awesome-icon", FontAwesomeIcon);
|
|
69
71
|
// ***FontAwesome
|
|
70
72
|
|
|
73
|
+
// ** Toggle/Switch
|
|
74
|
+
Vue.component("toggle-button", ToggleButton);
|
|
75
|
+
// ** Toggle/Switch
|
|
76
|
+
|
|
71
77
|
// ***VeeValidate***
|
|
72
78
|
Vue.component("ValidationObserver", ValidationObserver);
|
|
73
79
|
Vue.component("ValidationProvider", ValidationProvider);
|
|
@@ -126,6 +132,7 @@ export default {
|
|
|
126
132
|
Vue.component(KeyValue.name, KeyValue);
|
|
127
133
|
Vue.component(Timeline.name, Timeline);
|
|
128
134
|
Vue.component(TimelineItem.name, TimelineItem);
|
|
135
|
+
Vue.component(ToggleSwitch.name, ToggleSwitch);
|
|
129
136
|
|
|
130
137
|
Vue.use(Notification);
|
|
131
138
|
Vue.use(Alerte);
|