@ramathibodi/nuxt-commons 0.0.8 → 0.0.9
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/README.md +9 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/SplitterPanel.vue +59 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,15 @@ npm run test:watch
|
|
|
67
67
|
npm run release
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
## NPM PUBLISH
|
|
71
|
+
```bash
|
|
72
|
+
1. ตรวจสอบ source code, ตรวจสอบ Branch ว่าเป็น master แล้ว จากนั้นตรวจสอบ version ของ npm ว่ามีการเปลี่ยนและไม่ชนกับ version บน npm
|
|
73
|
+
2. npm run dev:build
|
|
74
|
+
3. npm publish --access public
|
|
75
|
+
4. set token ใน link ที่ npm ให้มา
|
|
76
|
+
5. เสร็จสิ้น
|
|
77
|
+
```
|
|
78
|
+
|
|
70
79
|
<!-- Badges -->
|
|
71
80
|
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
72
81
|
[npm-version-href]: https://npmjs.com/package/my-module
|
package/dist/module.json
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
|
3
|
+
import { VCard } from 'vuetify/components/VCard'
|
|
4
|
+
const isResizing = ref(false);
|
|
5
|
+
const pane1Width = ref('50%');
|
|
6
|
+
interface Props extends /* @vue-ignore */ InstanceType<typeof VCard['$props']>{
|
|
7
|
+
height : number | string
|
|
8
|
+
}
|
|
9
|
+
const props = defineProps<Props>()
|
|
10
|
+
|
|
11
|
+
const startResize = () => {
|
|
12
|
+
isResizing.value = true;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const stopResize = () => {
|
|
16
|
+
isResizing.value = false;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const resize = (event: MouseEvent) => {
|
|
20
|
+
if (isResizing.value) {
|
|
21
|
+
const container = document.querySelector('.split-pane') as HTMLElement;
|
|
22
|
+
const containerRect = container.getBoundingClientRect();
|
|
23
|
+
const newWidth = event.clientX - containerRect.left;
|
|
24
|
+
pane1Width.value = `${(newWidth / containerRect.width) * 100}%`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
document.addEventListener('mousemove', resize);
|
|
30
|
+
document.addEventListener('mouseup', stopResize);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
onUnmounted(() => {
|
|
34
|
+
document.removeEventListener('mousemove', resize);
|
|
35
|
+
document.removeEventListener('mouseup', stopResize);
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<v-card :="$attrs">
|
|
41
|
+
<v-sheet border :height="height">
|
|
42
|
+
<div class="split-pane">
|
|
43
|
+
<div class="pane" :style="{ width: pane1Width }">
|
|
44
|
+
<slot name="left"></slot>
|
|
45
|
+
</div>
|
|
46
|
+
<v-divider :thickness="3" vertical class="cursor-move" @mousedown="startResize"></v-divider>
|
|
47
|
+
<div class="pane" :style="{ width: `calc(100% - ${pane1Width})` }">
|
|
48
|
+
<slot name="right"></slot>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</v-sheet>
|
|
52
|
+
|
|
53
|
+
</v-card>
|
|
54
|
+
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style scoped>
|
|
58
|
+
.split-pane{height:100%;overflow:hidden;width:100%}.pane,.split-pane{display:flex}
|
|
59
|
+
</style>
|