@stonecrop/atable 0.2.55 → 0.2.57

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.2.55",
3
+ "version": "0.2.57",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -37,8 +37,8 @@
37
37
  "@vueuse/components": "^10.11.0",
38
38
  "@vueuse/core": "^11.1.0",
39
39
  "vue": "^3.5.6",
40
- "@stonecrop/themes": "0.2.55",
41
- "@stonecrop/utilities": "0.2.55"
40
+ "@stonecrop/themes": "0.2.57",
41
+ "@stonecrop/utilities": "0.2.57"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-documenter": "^7.25.3",
@@ -14,7 +14,7 @@
14
14
  @input="updateCellData"
15
15
  @click="showModal"
16
16
  @mousedown="showModal"
17
- class="atable__cell"
17
+ class="atable-cell"
18
18
  :class="pinned ? 'sticky-column' : ''">
19
19
  <component
20
20
  v-if="column.cellComponent"
@@ -204,4 +204,41 @@ const getIndent = (colIndex: number, indentLevel?: number) => {
204
204
 
205
205
  <style>
206
206
  @import url('@stonecrop/themes/default.css');
207
+
208
+ .atable-cell {
209
+ border-radius: 0px;
210
+ box-sizing: border-box;
211
+ margin: 0px;
212
+ outline: none;
213
+ box-shadow: none;
214
+ color: var(--sc-cell-text-color);
215
+ overflow: hidden;
216
+ padding-left: 0.5ch !important;
217
+ padding-right: 0.5ch;
218
+ padding-top: var(--sc-atable-row-padding);
219
+ padding-bottom: var(--sc-atable-row-padding);
220
+ border-spacing: 0px;
221
+ border-collapse: collapse;
222
+ overflow: hidden;
223
+ text-overflow: ellipsis;
224
+ order: 1;
225
+ white-space: nowrap;
226
+ max-width: 40ch;
227
+ }
228
+ .atable-cell a {
229
+ color: var(--sc-cell-text-color);
230
+ text-decoration: none;
231
+ }
232
+ .atable-cell:focus,
233
+ .atable-cell:focus-within {
234
+ background-color: var(--sc-focus-cell-background);
235
+ outline-width: var(--sc-atable-cell-border-width);
236
+ outline-style: solid;
237
+ outline-offset: calc(var(--sc-atable-cell-border-width) * -1);
238
+ outline-color: var(--sc-focus-cell-outline);
239
+ box-shadow: none;
240
+ overflow: hidden;
241
+ text-wrap: nowrap;
242
+ box-sizing: border-box;
243
+ }
207
244
  </style>
@@ -62,4 +62,32 @@ if (addNavigation) {
62
62
 
63
63
  <style>
64
64
  @import url('@stonecrop/themes/default.css');
65
+
66
+ .row-index {
67
+ color: var(--sc-header-text-color);
68
+ font-weight: bold;
69
+ text-align: center;
70
+ user-select: none;
71
+ width: 2ch;
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+ }
76
+ .expandable-row {
77
+ border-top: 1px solid var(--sc-row-border-color);
78
+ height: var(--sc-atable-row-height);
79
+ border-left: 4px solid var(--sc-row-border-color);
80
+ display: flex;
81
+ }
82
+
83
+ .expanded-row {
84
+ border-bottom: 1px solid var(--sc-row-border-color);
85
+ border-top: 1px solid var(--sc-row-border-color);
86
+ }
87
+
88
+ .expanded-row-content {
89
+ border-bottom: 1px solid var(--sc-row-border-color);
90
+ border-top: 1px solid var(--sc-row-border-color);
91
+ padding: 1.5rem;
92
+ }
65
93
  </style>
@@ -88,4 +88,34 @@ if (addNavigation) {
88
88
 
89
89
  <style>
90
90
  @import url('@stonecrop/themes/default.css');
91
+
92
+ .table-row {
93
+ border-top: 1px solid var(--sc-row-border-color);
94
+ display: flex;
95
+ background-color: white;
96
+ }
97
+ .list-index {
98
+ color: var(--sc-header-text-color);
99
+ font-weight: bold;
100
+ padding-left: var(--sc-atable-row-padding);
101
+ padding-right: 0.5em;
102
+ text-align: left;
103
+ user-select: none;
104
+ width: 7ch;
105
+ text-overflow: ellipsis;
106
+ overflow: hidden;
107
+ box-sizing: border-box;
108
+ padding-top: var(--sc-atable-row-padding);
109
+ padding-bottom: var(--sc-atable-row-padding);
110
+ }
111
+ .tree-index {
112
+ color: var(--sc-header-text-color);
113
+ font-weight: bold;
114
+ text-align: center;
115
+ user-select: none;
116
+ width: 2ch;
117
+ box-sizing: border-box;
118
+ padding-top: var(--sc-atable-row-padding);
119
+ padding-bottom: var(--sc-atable-row-padding);
120
+ }
91
121
  </style>
@@ -223,6 +223,60 @@ window.addEventListener('keydown', (event: KeyboardEvent) => {
223
223
  })
224
224
  </script>
225
225
 
226
+ <style>
227
+ .sticky-index {
228
+ position: sticky;
229
+ left: 0px;
230
+ z-index: 1;
231
+ order: 0;
232
+ }
233
+
234
+ .sticky-column,
235
+ th.sticky-column,
236
+ td.sticky-column,
237
+ th.sticky-index,
238
+ td.sticky-index {
239
+ position: sticky;
240
+ z-index: 1;
241
+ order: 0;
242
+ background: white;
243
+ }
244
+
245
+ .sticky-column-edge,
246
+ .atable th.sticky-column-edge {
247
+ border-right: 1px solid var(--sc-row-border-color);
248
+ border-right-width: 1px;
249
+ }
250
+ </style>
251
+
226
252
  <style scoped>
227
253
  @import url('@stonecrop/themes/default.css');
254
+ .atable {
255
+ font-family: var(--sc-atable-font-family);
256
+ -webkit-font-smoothing: antialiased;
257
+ -moz-osx-font-smoothing: grayscale;
258
+ font-size: var(--sc-table-font-size);
259
+ border-collapse: collapse;
260
+ box-sizing: border-box;
261
+ table-layout: auto;
262
+ width: auto;
263
+ }
264
+ .atable th {
265
+ border-width: 0px;
266
+ border-style: solid;
267
+ border-radius: 0px;
268
+ padding-left: 0.5ch;
269
+ padding-right: 0.5ch;
270
+ padding-top: var(--sc-atable-row-padding);
271
+ padding-bottom: var(--sc-atable-row-padding);
272
+ color: var(--sc-gray-60);
273
+ height: var(--sc-atable-row-height);
274
+ font-weight: 300;
275
+ letter-spacing: 0.05rem;
276
+ order: 1;
277
+ box-sizing: border-box;
278
+ }
279
+ .atable th:focus {
280
+ outline: none;
281
+ }
228
282
  </style>
@@ -1,7 +1,15 @@
1
1
  <template>
2
2
  <thead id="resizable" v-if="columns.length">
3
3
  <tr class="atable-header-row" tabindex="-1">
4
- <th v-if="tableData.zeroColumn" id="header-index" :class="hasPinnedColumns ? 'sticky-index' : ''" />
4
+ <th
5
+ v-if="tableData.zeroColumn"
6
+ id="header-index"
7
+ :class="[
8
+ hasPinnedColumns ? 'sticky-index' : '',
9
+ tableData.config.view === 'tree' ? 'tree-index' : '',
10
+ tableData.config.view === 'list-expansion' ? 'list-expansion-index' : '',
11
+ ]"
12
+ class="list-index" />
5
13
  <th
6
14
  v-for="(column, colKey) in columns"
7
15
  :key="column.name"
@@ -35,4 +43,30 @@ const getHeaderCellStyle = (column: TableColumn): CSSProperties => ({
35
43
 
36
44
  <style>
37
45
  @import url('@stonecrop/themes/default.css');
46
+
47
+ .atable-header-row {
48
+ display: flex;
49
+ }
50
+ .atable-header-row th {
51
+ padding-left: 0.5ch !important;
52
+ font-weight: 700;
53
+ padding-top: var(--sc-atable-row-padding);
54
+ padding-bottom: var(--sc-atable-row-padding);
55
+ box-sizing: border-box;
56
+ color: var(--sc-header-text-color);
57
+ }
58
+ #header-index {
59
+ padding-left: var(--sc-atable-row-padding);
60
+ box-sizing: border-box;
61
+ }
62
+ .tree-index {
63
+ padding-right: 0;
64
+ }
65
+ th {
66
+ order: 1;
67
+ }
68
+ .list-expansion-index {
69
+ width: 2ch;
70
+ margin-left: 5px;
71
+ }
38
72
  </style>
@@ -32,4 +32,10 @@ const handleInput = (event: Event) => {
32
32
 
33
33
  <style>
34
34
  @import url('@stonecrop/themes/default.css');
35
+
36
+ .amodal {
37
+ position: fixed;
38
+ background-color: var(--sc-row-color-zebra-dark);
39
+ z-index: 100;
40
+ }
35
41
  </style>