ui-sdk-table-vue 0.1.2 → 0.1.3
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/docs/agents.md +1 -1
- package/docs/first-table.md +1 -1
- package/docs/formats.md +12 -2
- package/docs/llms.txt +1 -1
- package/docs/rows.md +42 -19
- package/docs/selection-and-keyboard.md +3 -1
- package/docs/sheet-formulas.md +1 -0
- package/docs/sort-filter-and-search.md +13 -12
- package/docs/styling.md +2 -2
- package/package.json +2 -2
package/docs/agents.md
CHANGED
|
@@ -27,7 +27,7 @@ const columns: ColumnDef<Ship>[] = [
|
|
|
27
27
|
|
|
28
28
|
// The agent of UI SDK sees every component of the page that has a name, and its actions.
|
|
29
29
|
const agent = createAgent()
|
|
30
|
-
const answer = shallowRef('')
|
|
30
|
+
const answer = shallowRef('No action yet.')
|
|
31
31
|
|
|
32
32
|
async function act(action: string, args: unknown[]) {
|
|
33
33
|
const result = await agent.act({ steps: [{ ref: 'Ships in port', action, args }] })
|
package/docs/first-table.md
CHANGED
|
@@ -24,7 +24,7 @@ const people: Person[] = [
|
|
|
24
24
|
const columns: ColumnDef<Person>[] = [
|
|
25
25
|
{ id: 'name', header: 'Name', sortable: true },
|
|
26
26
|
{ id: 'team', header: 'Team', sortable: true },
|
|
27
|
-
{ id: 'score', header: 'Score', sortable: true },
|
|
27
|
+
{ id: 'score', header: 'Score', sortable: true, format: 'integer' },
|
|
28
28
|
]
|
|
29
29
|
</script>
|
|
30
30
|
|
package/docs/formats.md
CHANGED
|
@@ -27,8 +27,18 @@ const funds: Fund[] = [
|
|
|
27
27
|
|
|
28
28
|
const columns: ColumnDef<Fund>[] = [
|
|
29
29
|
{ id: 'fund', header: 'Fund' },
|
|
30
|
-
{
|
|
31
|
-
|
|
30
|
+
{
|
|
31
|
+
id: 'fee',
|
|
32
|
+
header: 'Fee',
|
|
33
|
+
format: 'decimal',
|
|
34
|
+
formatOptions: { minimumFractionDigits: 4, maximumFractionDigits: 4 },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'year',
|
|
38
|
+
header: 'One year',
|
|
39
|
+
format: 'percentage',
|
|
40
|
+
formatOptions: { minimumFractionDigits: 1, maximumFractionDigits: 1, showUnit: true },
|
|
41
|
+
},
|
|
32
42
|
]
|
|
33
43
|
|
|
34
44
|
const controller = createTableController()
|
package/docs/llms.txt
CHANGED
|
@@ -138,7 +138,7 @@ const people: Person[] = [
|
|
|
138
138
|
const columns: ColumnDef<Person>[] = [
|
|
139
139
|
{ id: 'name', header: 'Name', sortable: true },
|
|
140
140
|
{ id: 'team', header: 'Team', sortable: true },
|
|
141
|
-
{ id: 'score', header: 'Score', sortable: true },
|
|
141
|
+
{ id: 'score', header: 'Score', sortable: true, format: 'integer' },
|
|
142
142
|
]
|
|
143
143
|
</script>
|
|
144
144
|
|
package/docs/rows.md
CHANGED
|
@@ -149,6 +149,11 @@ const products: Product[] = [
|
|
|
149
149
|
{ id: 'p3', name: 'Green tea', stock: 120 },
|
|
150
150
|
{ id: 'p4', name: 'Dark coffee', stock: 3 },
|
|
151
151
|
{ id: 'p5', name: 'Honey', stock: 27 },
|
|
152
|
+
{ id: 'p6', name: 'Rice', stock: 64 },
|
|
153
|
+
{ id: 'p7', name: 'Lentils', stock: 15 },
|
|
154
|
+
{ id: 'p8', name: 'Olive oil', stock: 22 },
|
|
155
|
+
{ id: 'p9', name: 'Sea salt', stock: 90 },
|
|
156
|
+
{ id: 'p10', name: 'Oats', stock: 37 },
|
|
152
157
|
]
|
|
153
158
|
|
|
154
159
|
const columns: ColumnDef<Product>[] = [
|
|
@@ -161,26 +166,43 @@ const pinning = shallowRef<RowPinning>({ top: ['p4'] })
|
|
|
161
166
|
</script>
|
|
162
167
|
|
|
163
168
|
<template>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
169
|
+
<!-- The frame scrolls. The header and the pinned rows stay at its top. -->
|
|
170
|
+
<div class="frame">
|
|
171
|
+
<Table
|
|
172
|
+
v-model:row-pinning="pinning"
|
|
173
|
+
:rows="products"
|
|
174
|
+
:columns="columns"
|
|
175
|
+
:controller="controller"
|
|
176
|
+
sticky-header
|
|
177
|
+
aria-label="Products, the pinned ones on top"
|
|
178
|
+
>
|
|
179
|
+
<template #col-name="{ row, text, pinned }">
|
|
180
|
+
<button
|
|
181
|
+
type="button"
|
|
182
|
+
:aria-pressed="!!pinned"
|
|
183
|
+
:aria-label="`Pin ${text} to the top`"
|
|
184
|
+
@click="controller.pinRow(row.id, pinned ? null : 'top')"
|
|
185
|
+
>
|
|
186
|
+
{{ pinned ? '★' : '☆' }}
|
|
187
|
+
</button>
|
|
188
|
+
{{ text }}
|
|
189
|
+
</template>
|
|
190
|
+
</Table>
|
|
191
|
+
</div>
|
|
183
192
|
</template>
|
|
193
|
+
|
|
194
|
+
<style scoped>
|
|
195
|
+
.frame {
|
|
196
|
+
max-block-size: 230px;
|
|
197
|
+
overflow: auto;
|
|
198
|
+
border: 1px solid #e4e4e7;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* What sticks needs a background of its own, so the rows that scroll under it do not show through. */
|
|
202
|
+
.frame :deep(tr[data-sticky] > *) {
|
|
203
|
+
background: #fff;
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
184
206
|
```
|
|
185
207
|
|
|
186
208
|
Press the star before Honey to pin it. It moves to the top with Dark coffee, and a sort leaves both there.
|
|
@@ -241,6 +263,7 @@ const controller = createTableController()
|
|
|
241
263
|
.frame {
|
|
242
264
|
block-size: 280px;
|
|
243
265
|
overflow: auto;
|
|
266
|
+
border: 1px solid #e4e4e7;
|
|
244
267
|
}
|
|
245
268
|
|
|
246
269
|
.frame :deep(tr[data-sticky] > *) {
|
|
@@ -60,7 +60,9 @@ const all = computed(() => {
|
|
|
60
60
|
(on) => (on === true ? controller.selectAll() : controller.clearSelection())
|
|
61
61
|
"
|
|
62
62
|
>
|
|
63
|
-
<CheckboxIndicator
|
|
63
|
+
<CheckboxIndicator v-slot="{ state }">{{
|
|
64
|
+
state.indeterminate ? '–' : '✓'
|
|
65
|
+
}}</CheckboxIndicator>
|
|
64
66
|
</Checkbox>
|
|
65
67
|
</template>
|
|
66
68
|
<template #col-pick="{ row, selected: on, toggleSelected }">
|
package/docs/sheet-formulas.md
CHANGED
|
@@ -173,6 +173,7 @@ function cancel() {
|
|
|
173
173
|
<output data-testid="address">{{ bar.address.value || '—' }}</output>
|
|
174
174
|
<input
|
|
175
175
|
aria-label="Formula of the active cell"
|
|
176
|
+
placeholder="Press a cell"
|
|
176
177
|
:value="bar.text.value"
|
|
177
178
|
:disabled="!bar.ready.value"
|
|
178
179
|
:aria-invalid="!!bar.error.value"
|
|
@@ -197,18 +197,19 @@ const lists = computed(() =>
|
|
|
197
197
|
</script>
|
|
198
198
|
|
|
199
199
|
<template>
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
200
|
+
<div v-for="list in lists" :key="list.id">
|
|
201
|
+
<span :id="`facet-${list.id}`" class="control-label">{{ list.label }}</span>
|
|
202
|
+
<ToggleGroup
|
|
203
|
+
multiple
|
|
204
|
+
:aria-labelledby="`facet-${list.id}`"
|
|
205
|
+
:value="list.chosen"
|
|
206
|
+
@value-change="(values) => controller.setColumnFilter(list.id, values)"
|
|
207
|
+
>
|
|
208
|
+
<Toggle v-for="facet in list.values" :key="facet.text" :value="String(facet.value)">
|
|
209
|
+
{{ facet.text }} ({{ facet.count }})
|
|
210
|
+
</Toggle>
|
|
211
|
+
</ToggleGroup>
|
|
212
|
+
</div>
|
|
212
213
|
<Table :rows="shoes" :columns="columns" :controller="controller" aria-label="Running shoes" />
|
|
213
214
|
</template>
|
|
214
215
|
```
|
package/docs/styling.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui-sdk-table-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Vue parts for the ui-sdk-table primitive: slots, v-model and controllers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-grid",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"ui-sdk-table-core": "0.1.
|
|
40
|
+
"ui-sdk-table-core": "0.1.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/jsdom": "^30.0.0",
|