@tak-ps/vue-tabler 2.1.0 → 2.2.0
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/CHANGELOG.md +12 -0
- package/components/Input.vue +0 -1
- package/components/List.vue +69 -0
- package/components/Loading.vue +1 -1
- package/components/Select.vue +0 -1
- package/components/Toggle.vue +38 -0
- package/lib.js +5 -2
- package/package-lock.json +17989 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
## Version History
|
|
12
12
|
|
|
13
|
+
### v2.2.0
|
|
14
|
+
|
|
15
|
+
- :tada: Add toggle & list components
|
|
16
|
+
|
|
17
|
+
### v2.1.2
|
|
18
|
+
|
|
19
|
+
- :bug: Remove href in TablerSelect
|
|
20
|
+
|
|
21
|
+
### v2.1.1
|
|
22
|
+
|
|
23
|
+
- :bug: Fix directive name
|
|
24
|
+
|
|
13
25
|
### v2.1.0
|
|
14
26
|
|
|
15
27
|
- :rocket: Add `inline` prop to loading mode
|
package/components/Input.vue
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dropdown">
|
|
3
|
+
<label class='form-label' v-text='label'></label>
|
|
4
|
+
<div type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
|
|
5
|
+
<TablerInput :disabled='disabled' placeholder='Name' v-model='filter'/>
|
|
6
|
+
</div>
|
|
7
|
+
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
|
8
|
+
<div class='m-1'>
|
|
9
|
+
<div @click='select(ele)' :key='ele.id' v-for='ele in list[listkey]'>
|
|
10
|
+
<div class="d-flex align-items-center my-1 cursor-pointer" v-text='ele[namekey]'></div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import TablerInput from './Input.vue';
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'UserDropdown',
|
|
22
|
+
props: {
|
|
23
|
+
url: String,
|
|
24
|
+
listkey: String,
|
|
25
|
+
namekey: String,
|
|
26
|
+
label: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
limit: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 10
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
data: function() {
|
|
40
|
+
return {
|
|
41
|
+
filter: '',
|
|
42
|
+
list: {}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
watch: {
|
|
46
|
+
filter: async function() {
|
|
47
|
+
await this.fetchList();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
mounted: async function() {
|
|
51
|
+
await this.fetchList();
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
select: function(ele) {
|
|
55
|
+
this.filter = ele[this.namekey];
|
|
56
|
+
this.$emit("selected", ele)
|
|
57
|
+
},
|
|
58
|
+
fetchList: async function() {
|
|
59
|
+
const url = window.stdurl(this.url);
|
|
60
|
+
url.searchParams.append('filter', this.filter);
|
|
61
|
+
url.searchParams.append('limit', this.limit);
|
|
62
|
+
this.list = await window.std(url);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
components: {
|
|
66
|
+
TablerInput
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
package/components/Loading.vue
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<template v-if='inline'>
|
|
7
7
|
<div class='d-flex'>
|
|
8
8
|
<div class="spinner-border" role="status"></div>
|
|
9
|
-
<div v-
|
|
9
|
+
<div v-if='desc && desc.length' class='mx-3 align-self-center' v-text='desc'></div>
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
12
12
|
<template v-else='inline'>
|
package/components/Select.vue
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class='d-flex align-items-center'>
|
|
4
|
+
<label class='form-label' v-text='label'/>
|
|
5
|
+
<label class="ms-auto form-check form-switch pt-2">
|
|
6
|
+
<input v-model='current' :disabled='disabled' class="form-check-input" type="checkbox">
|
|
7
|
+
</label>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: 'TablerToggle',
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: ''
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
label: String
|
|
25
|
+
},
|
|
26
|
+
data: function() {
|
|
27
|
+
return {
|
|
28
|
+
current: this.modelValue
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
watch: {
|
|
32
|
+
current: function() {
|
|
33
|
+
if (this.current === this.modelValue) return;
|
|
34
|
+
this.$emit('update:modelValue', this.current);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
</script>
|
package/lib.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import TablerError from './components/Err.vue'
|
|
2
2
|
import TablerSelect from './components/Select.vue'
|
|
3
|
+
import TablerList from './components/List.vue'
|
|
3
4
|
import TablerModal from './components/Modal.vue'
|
|
4
5
|
import TablerProgress from './components/Progress.vue'
|
|
5
6
|
import TablerLoading from './components/Loading.vue'
|
|
6
|
-
|
|
7
|
+
import TablerToggle from './components/Toggle.vue'
|
|
7
8
|
import TablerInput from './components/Input.vue'
|
|
8
9
|
|
|
9
10
|
export {
|
|
@@ -12,5 +13,7 @@ export {
|
|
|
12
13
|
TablerLoading,
|
|
13
14
|
TablerModal,
|
|
14
15
|
TablerProgress,
|
|
15
|
-
|
|
16
|
+
TablerToggle,
|
|
17
|
+
TablerInput,
|
|
18
|
+
TablerList
|
|
16
19
|
}
|