@stonecrop/atable 0.3.0 → 0.3.1

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": "@stonecrop/atable",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -34,12 +34,12 @@
34
34
  "**/*.css"
35
35
  ],
36
36
  "dependencies": {
37
- "@vueuse/components": "^10.11.0",
38
- "@vueuse/core": "^11.1.0",
37
+ "@vueuse/components": "^12.0.0",
38
+ "@vueuse/core": "^12.0.0",
39
39
  "pinia": "^2.3.0",
40
40
  "vue": "^3.5.11",
41
- "@stonecrop/themes": "0.3.0",
42
- "@stonecrop/utilities": "0.3.0"
41
+ "@stonecrop/themes": "0.3.1",
42
+ "@stonecrop/utilities": "0.3.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@microsoft/api-documenter": "^7.26.2",
@@ -14,8 +14,7 @@
14
14
  @input="updateCellData"
15
15
  @click="showModal"
16
16
  class="atable-cell"
17
- :class="pinned ? 'sticky-column' : ''"
18
- v-on-click-outside="store.closeModal">
17
+ :class="pinned ? 'sticky-column' : ''">
19
18
  <component
20
19
  v-if="column.cellComponent"
21
20
  :is="column.cellComponent"
@@ -28,7 +27,6 @@
28
27
 
29
28
  <script setup lang="ts">
30
29
  import { KeypressHandlers, defaultKeypressHandlers, useKeyboardNav } from '@stonecrop/utilities'
31
- import { vOnClickOutside } from '@vueuse/components'
32
30
  import { useElementBounding } from '@vueuse/core'
33
31
  import { computed, CSSProperties, ref, useTemplateRef } from 'vue'
34
32
 
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <table ref="table" class="atable" :style="{ width: store.config.fullWidth ? '100%' : 'auto' }">
2
+ <table
3
+ ref="table"
4
+ class="atable"
5
+ :style="{ width: store.config.fullWidth ? '100%' : 'auto' }"
6
+ v-on-click-outside="store.closeModal">
3
7
  <slot name="header" :data="store">
4
8
  <ATableHeader :columns="store.columns" :store="store" />
5
9
  </slot>
@@ -53,6 +57,7 @@
53
57
  </template>
54
58
 
55
59
  <script setup lang="ts">
60
+ import { vOnClickOutside } from '@vueuse/components'
56
61
  import { useMutationObserver } from '@vueuse/core'
57
62
  import { nextTick, watch, onMounted, useTemplateRef } from 'vue'
58
63
 
@@ -121,7 +126,7 @@ const assignStickyCellWidths = () => {
121
126
  const firstDataRow = table.rows[1]
122
127
  const headerCells = headerRow ? Array.from(headerRow.cells) : []
123
128
  for (const [index, headerCell] of headerCells.entries()) {
124
- const rowCell = firstDataRow.cells[index]
129
+ const rowCell = firstDataRow?.cells[index]
125
130
  if (rowCell) {
126
131
  headerCell.style.width = `${rowCell.offsetWidth}px`
127
132
  }