@tak-ps/vue-tabler 2.11.0 → 3.0.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 +8 -0
- package/components/Delete.vue +49 -0
- package/components/Err.vue +12 -12
- package/components/Select.vue +21 -11
- package/lib.js +15 -31
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div @click='modal = true' class="btn btn-outline-danger">
|
|
4
|
+
<span v-text='label'/>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<TablerModal v-if='modal'>
|
|
8
|
+
<button type="button" class="btn-close" @click='modal = false' aria-label="Close"></button>
|
|
9
|
+
<div class="modal-status bg-red"></div>
|
|
10
|
+
<div class="modal-header text-center py-4">
|
|
11
|
+
Deletion Confirmation
|
|
12
|
+
</div>
|
|
13
|
+
<div class="modal-body text-center py-4">
|
|
14
|
+
Are you sure you wish to perform this deletion?
|
|
15
|
+
</div>
|
|
16
|
+
<div class="modal-footer">
|
|
17
|
+
<div @click='$emit("delete")' class="btn btn-danger">
|
|
18
|
+
<TrashIcon/><span class='mx-2' v-text='label'/>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</TablerModal>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import TablerModal from './Modal.vue';
|
|
27
|
+
import {
|
|
28
|
+
TrashIcon
|
|
29
|
+
} from 'vue-tabler-icons';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'TablerDelete',
|
|
33
|
+
props: {
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'Delete'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
data: function() {
|
|
40
|
+
return {
|
|
41
|
+
modal: false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
components: {
|
|
45
|
+
TrashIcon,
|
|
46
|
+
TablerModal
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
package/components/Err.vue
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Modal>
|
|
3
3
|
<button type="button" class="btn-close" @click='close' aria-label="Close"></button>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</div>
|
|
4
|
+
<div class="modal-status bg-yellow"></div>
|
|
5
|
+
<div class="modal-body text-center py-4">
|
|
6
|
+
<AlertCircleIcon/>
|
|
7
|
+
<h3>Website Error</h3>
|
|
8
|
+
<div class="text-muted" v-text='err.message'></div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="modal-footer">
|
|
11
|
+
<div class="w-100">
|
|
12
|
+
<div class="row">
|
|
13
|
+
<div class="col"><a @click='close' class="cursor-pointer btn w-100">OK</a></div>
|
|
15
14
|
</div>
|
|
16
|
-
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
17
|
</Modal>
|
|
18
18
|
</template>
|
|
19
19
|
|
package/components/Select.vue
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
<a class="dropdown-toggle text-muted" href="#" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-text='current'></a>
|
|
4
4
|
<div class="dropdown-menu dropdown-menu-end">
|
|
5
5
|
<a
|
|
6
|
-
:key='
|
|
7
|
-
v-for='
|
|
8
|
-
@click='current =
|
|
6
|
+
:key='option'
|
|
7
|
+
v-for='option in options'
|
|
8
|
+
@click='current = option'
|
|
9
9
|
class="dropdown-item"
|
|
10
10
|
:class='{
|
|
11
|
-
active:
|
|
11
|
+
active: option === current
|
|
12
12
|
}'
|
|
13
|
-
v-text='
|
|
13
|
+
v-text='option'
|
|
14
14
|
></a>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
@@ -20,8 +20,18 @@
|
|
|
20
20
|
export default {
|
|
21
21
|
name: 'TablerSelect',
|
|
22
22
|
props: {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
default: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: false
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
type: Array,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
25
35
|
},
|
|
26
36
|
data: function() {
|
|
27
37
|
return {
|
|
@@ -30,17 +40,17 @@ export default {
|
|
|
30
40
|
},
|
|
31
41
|
watch: {
|
|
32
42
|
current: function() {
|
|
33
|
-
this
|
|
43
|
+
if (this.modelValue !== this.current) {
|
|
44
|
+
this.$emit('update:modelValue', this.current);
|
|
45
|
+
}
|
|
34
46
|
}
|
|
35
47
|
},
|
|
36
48
|
mounted: function() {
|
|
37
49
|
if (!this.default) {
|
|
38
|
-
this.current = this.
|
|
50
|
+
this.current = this.options[0];
|
|
39
51
|
} else {
|
|
40
52
|
this.current = this.default;
|
|
41
53
|
}
|
|
42
54
|
},
|
|
43
|
-
methods: {
|
|
44
|
-
},
|
|
45
55
|
}
|
|
46
56
|
</script>
|
package/lib.js
CHANGED
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
TablerEnum,
|
|
18
|
-
TablerBytes,
|
|
19
|
-
TablerEpoch,
|
|
20
|
-
TablerMarkdown,
|
|
21
|
-
TablerEpochRange,
|
|
22
|
-
TablerBreadCrumb,
|
|
23
|
-
TablerError,
|
|
24
|
-
TablerSelect,
|
|
25
|
-
TablerLoading,
|
|
26
|
-
TablerModal,
|
|
27
|
-
TablerProgress,
|
|
28
|
-
TablerToggle,
|
|
29
|
-
TablerInput,
|
|
30
|
-
TablerList,
|
|
31
|
-
}
|
|
1
|
+
export { default as TablerError } from './components/Err.vue'
|
|
2
|
+
export { default as TablerList } from './components/List.vue'
|
|
3
|
+
export { default as TablerSelect } from './components/Select.vue'
|
|
4
|
+
export { default as TablerModal } from './components/Modal.vue'
|
|
5
|
+
export { default as TablerProgress } from './components/Progress.vue'
|
|
6
|
+
export { default as TablerLoading } from './components/Loading.vue'
|
|
7
|
+
export { default as TablerToggle } from './components/Toggle.vue'
|
|
8
|
+
export { default as TablerInput } from './components/Input.vue'
|
|
9
|
+
export { default as TablerBreadCrumb } from './components/BreadCrumb.vue';
|
|
10
|
+
export { default as TablerBytes } from './components/Bytes.vue';
|
|
11
|
+
export { default as TablerEnum } from './components/Enum.vue';
|
|
12
|
+
export { default as TablerEpoch } from './components/Epoch.vue';
|
|
13
|
+
export { default as TablerEpochRange } from './components/EpochRange.vue';
|
|
14
|
+
export { default as TablerMarkdown } from './components/Markdown.vue';
|
|
15
|
+
export { default as TablerDelete } from './components/Delete.vue';
|