@ramathibodi/nuxt-commons 0.0.9 → 0.0.10

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 CHANGED
@@ -67,6 +67,12 @@ npm run test:watch
67
67
  npm run release
68
68
  ```
69
69
 
70
+ ## NPM Login
71
+ ```bash
72
+ npm login
73
+ ```
74
+ - จะส่ง link url มาให้เข้าไปที่ url login npm
75
+
70
76
  ## NPM PUBLISH
71
77
  ```bash
72
78
  1. ตรวจสอบ source code, ตรวจสอบ Branch ว่าเป็น master แล้ว จากนั้นตรวจสอบ version ของ npm ว่ามีการเปลี่ยนและไม่ชนกับ version บน npm
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.0.9"
7
+ "version": "0.0.10"
8
8
  }
@@ -1,10 +1,11 @@
1
1
  <script setup lang="ts">
2
- import { ref, onMounted, onUnmounted } from 'vue';
2
+ import { ref } from 'vue';
3
3
  import { VCard } from 'vuetify/components/VCard'
4
4
  const isResizing = ref(false);
5
5
  const pane1Width = ref('50%');
6
+ const containerRef = ref<HTMLElement>()
6
7
  interface Props extends /* @vue-ignore */ InstanceType<typeof VCard['$props']>{
7
- height : number | string
8
+ height? : number | string
8
9
  }
9
10
  const props = defineProps<Props>()
10
11
 
@@ -17,36 +18,25 @@ const stopResize = () => {
17
18
  };
18
19
 
19
20
  const resize = (event: MouseEvent) => {
20
- if (isResizing.value) {
21
- const container = document.querySelector('.split-pane') as HTMLElement;
22
- const containerRect = container.getBoundingClientRect();
21
+ if (isResizing.value && containerRef.value) {
22
+ const containerRect = containerRef.value.getBoundingClientRect();
23
23
  const newWidth = event.clientX - containerRect.left;
24
24
  pane1Width.value = `${(newWidth / containerRect.width) * 100}%`;
25
25
  }
26
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
27
  </script>
38
28
 
39
29
  <template>
40
30
  <v-card :="$attrs">
41
31
  <v-sheet border :height="height">
42
- <div class="split-pane">
43
- <div class="pane" :style="{ width: pane1Width }">
32
+ <div class="d-flex" ref="containerRef" @mouseup="stopResize" @mousemove="resize" >
33
+ <v-sheet :width = "pane1Width">
44
34
  <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})` }">
35
+ </v-sheet>
36
+ <v-divider :thickness="3" vertical class="cursor-move" @mousedown="startResize" ></v-divider>
37
+ <v-sheet :width = "`calc(100% - ${pane1Width})`" >
48
38
  <slot name="right"></slot>
49
- </div>
39
+ </v-sheet>
50
40
  </div>
51
41
  </v-sheet>
52
42
 
@@ -55,5 +45,5 @@ onUnmounted(() => {
55
45
  </template>
56
46
 
57
47
  <style scoped>
58
- .split-pane{height:100%;overflow:hidden;width:100%}.pane,.split-pane{display:flex}
48
+
59
49
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramathibodi/nuxt-commons",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Ramathibodi Nuxt modules for common components",
5
5
  "repository": {
6
6
  "type": "git",