@ember-joinery/data-table 0.0.0-stage → 1.1.0
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/CHANGELOG.md +162 -0
- package/LICENSE.md +9 -0
- package/NOTICE +532 -0
- package/README.md +79 -2
- package/addon-main.cjs +4 -0
- package/declarations/-private/bound-methods.d.ts +23 -0
- package/declarations/-private/bound-methods.d.ts.map +1 -0
- package/declarations/-private/reactivity.d.ts +9 -0
- package/declarations/-private/reactivity.d.ts.map +1 -0
- package/declarations/components/data-table.d.ts +77 -0
- package/declarations/components/data-table.d.ts.map +1 -0
- package/declarations/components/flex-render.d.ts +103 -0
- package/declarations/components/flex-render.d.ts.map +1 -0
- package/declarations/index.d.ts +7 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/table-core.d.ts +7 -0
- package/declarations/table-core.d.ts.map +1 -0
- package/declarations/table.d.ts +65 -0
- package/declarations/table.d.ts.map +1 -0
- package/declarations/test-support/data-table.d.ts +111 -0
- package/declarations/test-support/data-table.d.ts.map +1 -0
- package/declarations/test-support/index.d.ts +2 -0
- package/declarations/test-support/index.d.ts.map +1 -0
- package/declarations/test-support.d.ts +2 -0
- package/dist/components/data-table.js +107 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/flex-render.js +104 -0
- package/dist/components/flex-render.js.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/table-core.js +2 -0
- package/dist/table-core.js.map +1 -0
- package/dist/table.js +300 -0
- package/dist/table.js.map +1 -0
- package/dist/test-support.js +304 -0
- package/dist/test-support.js.map +1 -0
- package/package.json +116 -3
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { isNumber } from '@sindresorhus/is';
|
|
2
|
+
import { click, fillIn } from '@ember/test-helpers';
|
|
3
|
+
import { Harness, TableHarness, CheckboxHarness, DropdownMenuHarness } from '@ember-joinery/test-support';
|
|
4
|
+
|
|
5
|
+
const collapse = value => (value ?? '').replace(/\s+/g, ' ').trim();
|
|
6
|
+
|
|
7
|
+
/** Whether a button can be used: not `disabled`, and not `aria-disabled`. */
|
|
8
|
+
const usable = element => Boolean(element) && !element.disabled && element.getAttribute('aria-disabled') !== 'true';
|
|
9
|
+
|
|
10
|
+
/** A column, as the harness's members take it: its id, its header's text, or its position. */
|
|
11
|
+
|
|
12
|
+
/** A column's sort, as its header cell's `aria-sort` says it. */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Drives a data table: the parts inside a `<DataTable>` from `@ember-joinery/data-table`, which
|
|
16
|
+
* its modifiers mark. It reads the rows and columns the table shows, each column's sort (from
|
|
17
|
+
* the header cell's `aria-sort`), which rows are selected (from each row's checkbox), and the
|
|
18
|
+
* filter and pages, and works them as a user does: with the sort buttons in the headers, the
|
|
19
|
+
* filter input, the row checkboxes, the page buttons and the column menu.
|
|
20
|
+
*
|
|
21
|
+
* const payments = new DataTableHarness('payments') // <DataTable @name="payments">
|
|
22
|
+
* await payments.filter('ken')
|
|
23
|
+
* assert.deepEqual(payments.column('email'), ['ken99@example.com'])
|
|
24
|
+
* await payments.sort('email')
|
|
25
|
+
* assert.strictEqual(payments.sortOf('email'), 'ascending')
|
|
26
|
+
* await payments.toggleRow(0)
|
|
27
|
+
* assert.deepEqual(payments.selectedRows, [0])
|
|
28
|
+
* await payments.nextPage()
|
|
29
|
+
*
|
|
30
|
+
* A column is its id (the header cell's `data-test-jn-value`), its header's text, or its
|
|
31
|
+
* position among the columns shown.
|
|
32
|
+
*/
|
|
33
|
+
class DataTableHarness extends Harness {
|
|
34
|
+
static component = 'data-table';
|
|
35
|
+
|
|
36
|
+
/** The table inside it. */
|
|
37
|
+
get table() {
|
|
38
|
+
return this.child(TableHarness);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ----- Columns -------------------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
/** Every header cell (`dt.head`), in every header row. */
|
|
44
|
+
get headElements() {
|
|
45
|
+
return this.parts('head');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The header cells of the columns shown: those in the header's last row. */
|
|
49
|
+
get columnHeads() {
|
|
50
|
+
const rows = this.table.table.tHead?.rows;
|
|
51
|
+
const last = rows?.[rows.length - 1];
|
|
52
|
+
return this.headElements.filter(head => head.parentElement === last);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The ids of the columns shown, in order. */
|
|
56
|
+
get columnIds() {
|
|
57
|
+
return this.columnHeads.map(head => head.getAttribute('data-test-jn-value') ?? '');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** The text of each column's header, in order (`''` for one with no text, as a checkbox's). */
|
|
61
|
+
get columns() {
|
|
62
|
+
return this.columnHeads.map(head => collapse(head.textContent));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Whether the column is shown, by its id. */
|
|
66
|
+
isColumnShown(id) {
|
|
67
|
+
return this.columnIds.includes(id);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The header cell of a column. Throws when the table doesn't show it. */
|
|
71
|
+
head(column) {
|
|
72
|
+
const head = this.columnHeads[this.#position(column)];
|
|
73
|
+
if (!head) throw new Error(`Joinery harness: no column ${String(column)} in ${this}`);
|
|
74
|
+
return head;
|
|
75
|
+
}
|
|
76
|
+
#position(column) {
|
|
77
|
+
if (isNumber(column)) return column;
|
|
78
|
+
const byId = this.columnIds.indexOf(column);
|
|
79
|
+
if (byId !== -1) return byId;
|
|
80
|
+
const byText = this.columns.indexOf(column);
|
|
81
|
+
if (byText !== -1) return byText;
|
|
82
|
+
throw new Error(`Joinery harness: no column "${column}" in ${this} (it shows ${this.columnIds.map(id => `"${id}"`).join(', ')})`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ----- Rows ----------------------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
/** The body's rows (`dt.row`), as the table shows them: this page, filtered and sorted. */
|
|
88
|
+
get rowElements() {
|
|
89
|
+
return this.parts('row');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Each row's id (table-core's `row.id`), in order. */
|
|
93
|
+
get rowIds() {
|
|
94
|
+
return this.values('row');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** How many rows it shows. */
|
|
98
|
+
get rowCount() {
|
|
99
|
+
return this.rowElements.length;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The text of each row's cells, row by row. */
|
|
103
|
+
get rows() {
|
|
104
|
+
return this.rowElements.map(row => [...row.cells].map(cell => collapse(cell.textContent)));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Whether it shows no rows (its body shows `emptyText` instead). */
|
|
108
|
+
get isEmpty() {
|
|
109
|
+
return this.rowCount === 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The body's text while it shows no rows (upstream's `No results.`), or `null`. */
|
|
113
|
+
get emptyText() {
|
|
114
|
+
if (!this.isEmpty) return null;
|
|
115
|
+
return collapse([...this.table.table.tBodies].map(body => body.textContent).join(' '));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** The row at `index`, counting from 0. Throws when there is none. */
|
|
119
|
+
row(index) {
|
|
120
|
+
const row = this.rowElements[index];
|
|
121
|
+
if (!row) throw new Error(`Joinery harness: no row ${index} in ${this} (it has ${this.rowCount})`);
|
|
122
|
+
return row;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The cell of row `index` in a column. */
|
|
126
|
+
cell(index, column) {
|
|
127
|
+
const position = this.#position(column);
|
|
128
|
+
const cell = this.row(index).cells[position];
|
|
129
|
+
if (!cell) throw new Error(`Joinery harness: no cell ${position} in row ${index} of ${this}`);
|
|
130
|
+
return cell;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** The text of every row's cell in a column. */
|
|
134
|
+
column(column) {
|
|
135
|
+
const position = this.#position(column);
|
|
136
|
+
return this.rowElements.map(row => collapse(row.cells[position]?.textContent));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ----- Sorting -------------------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
/** A column's sort, from its header cell's `aria-sort` (`none` without one). */
|
|
142
|
+
sortOf(column) {
|
|
143
|
+
const sort = this.head(column).getAttribute('aria-sort');
|
|
144
|
+
return sort === 'ascending' || sort === 'descending' ? sort : 'none';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** The column the rows are sorted by, and which way, or `null` while they aren't. */
|
|
148
|
+
get sortedBy() {
|
|
149
|
+
for (const [index, id] of this.columnIds.entries()) {
|
|
150
|
+
const direction = this.sortOf(index);
|
|
151
|
+
if (direction !== 'none') return {
|
|
152
|
+
column: id,
|
|
153
|
+
direction
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** The button in a column's header that sorts by it. Throws when it has none. */
|
|
160
|
+
sortButton(column) {
|
|
161
|
+
const button = this.head(column).querySelector('button');
|
|
162
|
+
if (!button) throw new Error(`Joinery harness: column ${String(column)} of ${this} has no sort button`);
|
|
163
|
+
return button;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Clicks the sort button in a column's header. */
|
|
167
|
+
async sort(column) {
|
|
168
|
+
await click(this.sortButton(column));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// ----- Filtering -----------------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
/** The input that filters a column (`dt.filter`), or the first filter without a column. */
|
|
174
|
+
filterInput(column) {
|
|
175
|
+
const input = this.queryPart('filter', column) ?? undefined;
|
|
176
|
+
if (!input) {
|
|
177
|
+
const which = column === undefined ? 'filter' : `filter for "${column}"`;
|
|
178
|
+
throw new Error(`Joinery harness: no ${which} in ${this}`);
|
|
179
|
+
}
|
|
180
|
+
return input;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** What a filter holds. */
|
|
184
|
+
filterValue(column) {
|
|
185
|
+
return this.filterInput(column).value;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Types `value` into a filter, as a user does, replacing what it held. */
|
|
189
|
+
async filter(value, column) {
|
|
190
|
+
await fillIn(this.filterInput(column), value);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// ----- Pagination ----------------------------------------------------------------------------
|
|
194
|
+
|
|
195
|
+
/** The button that goes back a page (`dt.previousPage`), or `null`. */
|
|
196
|
+
get previousPageButton() {
|
|
197
|
+
return this.queryPart('previous-page');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** The button that goes on a page (`dt.nextPage`), or `null`. */
|
|
201
|
+
get nextPageButton() {
|
|
202
|
+
return this.queryPart('next-page');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Whether there is a page before this one: the previous button can be used. */
|
|
206
|
+
get canPreviousPage() {
|
|
207
|
+
return usable(this.previousPageButton);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Whether there is a page after this one: the next button can be used. */
|
|
211
|
+
get canNextPage() {
|
|
212
|
+
return usable(this.nextPageButton);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Clicks the previous page button. */
|
|
216
|
+
async previousPage() {
|
|
217
|
+
await click(this.#button(this.previousPageButton, 'previous page'));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Clicks the next page button. */
|
|
221
|
+
async nextPage() {
|
|
222
|
+
await click(this.#button(this.nextPageButton, 'next page'));
|
|
223
|
+
}
|
|
224
|
+
#button(button, name) {
|
|
225
|
+
if (!button) throw new Error(`Joinery harness: no ${name} button in ${this}`);
|
|
226
|
+
return button;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ----- Selection -----------------------------------------------------------------------------
|
|
230
|
+
|
|
231
|
+
/** The checkbox that selects a row, or `null` when the row has none. */
|
|
232
|
+
rowCheckbox(index) {
|
|
233
|
+
const checkbox = new CheckboxHarness({
|
|
234
|
+
within: this.row(index)
|
|
235
|
+
});
|
|
236
|
+
return checkbox.exists ? checkbox : null;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** The checkbox in a header cell that selects every row on the page, or `null`. */
|
|
240
|
+
get selectAll() {
|
|
241
|
+
for (const head of this.headElements) {
|
|
242
|
+
const checkbox = new CheckboxHarness({
|
|
243
|
+
within: head
|
|
244
|
+
});
|
|
245
|
+
if (checkbox.exists) return checkbox;
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Whether row `index` is selected: its checkbox is checked, or, in a table without them, the
|
|
252
|
+
* row is marked `data-state="selected"`.
|
|
253
|
+
*/
|
|
254
|
+
isSelected(index) {
|
|
255
|
+
const checkbox = this.rowCheckbox(index);
|
|
256
|
+
if (checkbox) return checkbox.isChecked;
|
|
257
|
+
return this.row(index).getAttribute('data-state') === 'selected';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** The rows selected, by index on this page. */
|
|
261
|
+
get selectedRows() {
|
|
262
|
+
return this.rowElements.flatMap((_, index) => this.isSelected(index) ? [index] : []);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Clicks row `index`'s checkbox, which selects or deselects it. */
|
|
266
|
+
async toggleRow(index) {
|
|
267
|
+
const checkbox = this.rowCheckbox(index);
|
|
268
|
+
if (!checkbox) throw new Error(`Joinery harness: row ${index} of ${this} has no checkbox`);
|
|
269
|
+
await checkbox.toggle();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** Clicks the header's checkbox, which selects (or deselects) every row on the page. */
|
|
273
|
+
async toggleAll() {
|
|
274
|
+
const checkbox = this.selectAll;
|
|
275
|
+
if (!checkbox) throw new Error(`Joinery harness: ${this} has no select-all checkbox`);
|
|
276
|
+
await checkbox.toggle();
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// ----- Column visibility ---------------------------------------------------------------------
|
|
280
|
+
|
|
281
|
+
/** The menu that shows and hides columns (`dt.viewOptions`). Throws when there is none. */
|
|
282
|
+
get viewOptions() {
|
|
283
|
+
const root = this.queryPart('view-options');
|
|
284
|
+
const menu = root && this.findAll(DropdownMenuHarness).find(each => each.element === root);
|
|
285
|
+
if (!menu) throw new Error(`Joinery harness: no column menu in ${this}`);
|
|
286
|
+
return menu;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** The columns the menu offers, by their items' text (it opens the menu to read them). */
|
|
290
|
+
async columnOptions() {
|
|
291
|
+
await this.viewOptions.open();
|
|
292
|
+
return this.viewOptions.items;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Opens the column menu and toggles the column whose item reads `label`. */
|
|
296
|
+
async toggleColumn(label) {
|
|
297
|
+
const menu = this.viewOptions;
|
|
298
|
+
await menu.open();
|
|
299
|
+
await menu.select(label);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export { DataTableHarness };
|
|
304
|
+
//# sourceMappingURL=test-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-support.js","sources":["../src/test-support/data-table.ts"],"sourcesContent":["import { isNumber } from '@sindresorhus/is'\nimport { click, fillIn } from '@ember/test-helpers'\nimport {\n CheckboxHarness,\n DropdownMenuHarness,\n Harness,\n TableHarness,\n} from '@ember-joinery/test-support'\n\nconst collapse = (value: string | null | undefined): string =>\n (value ?? '').replace(/\\s+/g, ' ').trim()\n\n/** Whether a button can be used: not `disabled`, and not `aria-disabled`. */\nconst usable = (element: Element | null): boolean =>\n Boolean(element) &&\n !(element as HTMLButtonElement).disabled &&\n element!.getAttribute('aria-disabled') !== 'true'\n\n/** A column, as the harness's members take it: its id, its header's text, or its position. */\nexport type DataTableColumn = string | number\n\n/** A column's sort, as its header cell's `aria-sort` says it. */\nexport type DataTableSort = 'ascending' | 'descending' | 'none'\n\n/**\n * Drives a data table: the parts inside a `<DataTable>` from `@ember-joinery/data-table`, which\n * its modifiers mark. It reads the rows and columns the table shows, each column's sort (from\n * the header cell's `aria-sort`), which rows are selected (from each row's checkbox), and the\n * filter and pages, and works them as a user does: with the sort buttons in the headers, the\n * filter input, the row checkboxes, the page buttons and the column menu.\n *\n * const payments = new DataTableHarness('payments') // <DataTable @name=\"payments\">\n * await payments.filter('ken')\n * assert.deepEqual(payments.column('email'), ['ken99@example.com'])\n * await payments.sort('email')\n * assert.strictEqual(payments.sortOf('email'), 'ascending')\n * await payments.toggleRow(0)\n * assert.deepEqual(payments.selectedRows, [0])\n * await payments.nextPage()\n *\n * A column is its id (the header cell's `data-test-jn-value`), its header's text, or its\n * position among the columns shown.\n */\nexport class DataTableHarness extends Harness {\n static override component = 'data-table'\n\n /** The table inside it. */\n get table(): TableHarness {\n return this.child(TableHarness)\n }\n\n // ----- Columns -------------------------------------------------------------------------------\n\n /** Every header cell (`dt.head`), in every header row. */\n get headElements(): HTMLTableCellElement[] {\n return this.parts<HTMLTableCellElement>('head')\n }\n\n /** The header cells of the columns shown: those in the header's last row. */\n get columnHeads(): HTMLTableCellElement[] {\n const rows = this.table.table.tHead?.rows\n const last = rows?.[rows.length - 1]\n return this.headElements.filter(head => head.parentElement === last)\n }\n\n /** The ids of the columns shown, in order. */\n get columnIds(): string[] {\n return this.columnHeads.map(head => head.getAttribute('data-test-jn-value') ?? '')\n }\n\n /** The text of each column's header, in order (`''` for one with no text, as a checkbox's). */\n get columns(): string[] {\n return this.columnHeads.map(head => collapse(head.textContent))\n }\n\n /** Whether the column is shown, by its id. */\n isColumnShown(id: string): boolean {\n return this.columnIds.includes(id)\n }\n\n /** The header cell of a column. Throws when the table doesn't show it. */\n head(column: DataTableColumn): HTMLTableCellElement {\n const head = this.columnHeads[this.#position(column)]\n if (!head) throw new Error(`Joinery harness: no column ${String(column)} in ${this}`)\n return head\n }\n\n #position(column: DataTableColumn): number {\n if (isNumber(column)) return column\n const byId = this.columnIds.indexOf(column)\n if (byId !== -1) return byId\n const byText = this.columns.indexOf(column)\n if (byText !== -1) return byText\n throw new Error(\n `Joinery harness: no column \"${column}\" in ${this} (it shows ${this.columnIds.map(id => `\"${id}\"`).join(', ')})`,\n )\n }\n\n // ----- Rows ----------------------------------------------------------------------------------\n\n /** The body's rows (`dt.row`), as the table shows them: this page, filtered and sorted. */\n get rowElements(): HTMLTableRowElement[] {\n return this.parts<HTMLTableRowElement>('row')\n }\n\n /** Each row's id (table-core's `row.id`), in order. */\n get rowIds(): string[] {\n return this.values('row')\n }\n\n /** How many rows it shows. */\n get rowCount(): number {\n return this.rowElements.length\n }\n\n /** The text of each row's cells, row by row. */\n get rows(): string[][] {\n return this.rowElements.map(row => [...row.cells].map(cell => collapse(cell.textContent)))\n }\n\n /** Whether it shows no rows (its body shows `emptyText` instead). */\n get isEmpty(): boolean {\n return this.rowCount === 0\n }\n\n /** The body's text while it shows no rows (upstream's `No results.`), or `null`. */\n get emptyText(): string | null {\n if (!this.isEmpty) return null\n return collapse([...this.table.table.tBodies].map(body => body.textContent).join(' '))\n }\n\n /** The row at `index`, counting from 0. Throws when there is none. */\n row(index: number): HTMLTableRowElement {\n const row = this.rowElements[index]\n if (!row)\n throw new Error(`Joinery harness: no row ${index} in ${this} (it has ${this.rowCount})`)\n return row\n }\n\n /** The cell of row `index` in a column. */\n cell(index: number, column: DataTableColumn): HTMLTableCellElement {\n const position = this.#position(column)\n const cell = this.row(index).cells[position]\n if (!cell) throw new Error(`Joinery harness: no cell ${position} in row ${index} of ${this}`)\n return cell\n }\n\n /** The text of every row's cell in a column. */\n column(column: DataTableColumn): string[] {\n const position = this.#position(column)\n return this.rowElements.map(row => collapse(row.cells[position]?.textContent))\n }\n\n // ----- Sorting -------------------------------------------------------------------------------\n\n /** A column's sort, from its header cell's `aria-sort` (`none` without one). */\n sortOf(column: DataTableColumn): DataTableSort {\n const sort = this.head(column).getAttribute('aria-sort')\n return sort === 'ascending' || sort === 'descending' ? sort : 'none'\n }\n\n /** The column the rows are sorted by, and which way, or `null` while they aren't. */\n get sortedBy(): { column: string; direction: 'ascending' | 'descending' } | null {\n for (const [index, id] of this.columnIds.entries()) {\n const direction = this.sortOf(index)\n if (direction !== 'none') return { column: id, direction }\n }\n return null\n }\n\n /** The button in a column's header that sorts by it. Throws when it has none. */\n sortButton(column: DataTableColumn): HTMLButtonElement {\n const button = this.head(column).querySelector<HTMLButtonElement>('button')\n if (!button)\n throw new Error(`Joinery harness: column ${String(column)} of ${this} has no sort button`)\n return button\n }\n\n /** Clicks the sort button in a column's header. */\n async sort(column: DataTableColumn): Promise<void> {\n await click(this.sortButton(column))\n }\n\n // ----- Filtering -----------------------------------------------------------------------------\n\n /** The input that filters a column (`dt.filter`), or the first filter without a column. */\n filterInput(column?: string): HTMLInputElement {\n const input = this.queryPart<HTMLInputElement>('filter', column) ?? undefined\n if (!input) {\n const which = column === undefined ? 'filter' : `filter for \"${column}\"`\n throw new Error(`Joinery harness: no ${which} in ${this}`)\n }\n return input\n }\n\n /** What a filter holds. */\n filterValue(column?: string): string {\n return this.filterInput(column).value\n }\n\n /** Types `value` into a filter, as a user does, replacing what it held. */\n async filter(value: string, column?: string): Promise<void> {\n await fillIn(this.filterInput(column), value)\n }\n\n // ----- Pagination ----------------------------------------------------------------------------\n\n /** The button that goes back a page (`dt.previousPage`), or `null`. */\n get previousPageButton(): HTMLElement | null {\n return this.queryPart('previous-page')\n }\n\n /** The button that goes on a page (`dt.nextPage`), or `null`. */\n get nextPageButton(): HTMLElement | null {\n return this.queryPart('next-page')\n }\n\n /** Whether there is a page before this one: the previous button can be used. */\n get canPreviousPage(): boolean {\n return usable(this.previousPageButton)\n }\n\n /** Whether there is a page after this one: the next button can be used. */\n get canNextPage(): boolean {\n return usable(this.nextPageButton)\n }\n\n /** Clicks the previous page button. */\n async previousPage(): Promise<void> {\n await click(this.#button(this.previousPageButton, 'previous page'))\n }\n\n /** Clicks the next page button. */\n async nextPage(): Promise<void> {\n await click(this.#button(this.nextPageButton, 'next page'))\n }\n\n #button(button: HTMLElement | null, name: string): HTMLElement {\n if (!button) throw new Error(`Joinery harness: no ${name} button in ${this}`)\n return button\n }\n\n // ----- Selection -----------------------------------------------------------------------------\n\n /** The checkbox that selects a row, or `null` when the row has none. */\n rowCheckbox(index: number): CheckboxHarness | null {\n const checkbox = new CheckboxHarness({ within: this.row(index) })\n return checkbox.exists ? checkbox : null\n }\n\n /** The checkbox in a header cell that selects every row on the page, or `null`. */\n get selectAll(): CheckboxHarness | null {\n for (const head of this.headElements) {\n const checkbox = new CheckboxHarness({ within: head })\n if (checkbox.exists) return checkbox\n }\n return null\n }\n\n /**\n * Whether row `index` is selected: its checkbox is checked, or, in a table without them, the\n * row is marked `data-state=\"selected\"`.\n */\n isSelected(index: number): boolean {\n const checkbox = this.rowCheckbox(index)\n if (checkbox) return checkbox.isChecked\n return this.row(index).getAttribute('data-state') === 'selected'\n }\n\n /** The rows selected, by index on this page. */\n get selectedRows(): number[] {\n return this.rowElements.flatMap((_, index) => (this.isSelected(index) ? [index] : []))\n }\n\n /** Clicks row `index`'s checkbox, which selects or deselects it. */\n async toggleRow(index: number): Promise<void> {\n const checkbox = this.rowCheckbox(index)\n if (!checkbox) throw new Error(`Joinery harness: row ${index} of ${this} has no checkbox`)\n await checkbox.toggle()\n }\n\n /** Clicks the header's checkbox, which selects (or deselects) every row on the page. */\n async toggleAll(): Promise<void> {\n const checkbox = this.selectAll\n if (!checkbox) throw new Error(`Joinery harness: ${this} has no select-all checkbox`)\n await checkbox.toggle()\n }\n\n // ----- Column visibility ---------------------------------------------------------------------\n\n /** The menu that shows and hides columns (`dt.viewOptions`). Throws when there is none. */\n get viewOptions(): DropdownMenuHarness {\n const root = this.queryPart('view-options')\n const menu = root && this.findAll(DropdownMenuHarness).find(each => each.element === root)\n if (!menu) throw new Error(`Joinery harness: no column menu in ${this}`)\n return menu\n }\n\n /** The columns the menu offers, by their items' text (it opens the menu to read them). */\n async columnOptions(): Promise<string[]> {\n await this.viewOptions.open()\n return this.viewOptions.items\n }\n\n /** Opens the column menu and toggles the column whose item reads `label`. */\n async toggleColumn(label: string): Promise<void> {\n const menu = this.viewOptions\n await menu.open()\n await menu.select(label)\n }\n}\n"],"names":["collapse","value","replace","trim","usable","element","Boolean","disabled","getAttribute","DataTableHarness","Harness","component","table","child","TableHarness","headElements","parts","columnHeads","rows","tHead","last","length","filter","head","parentElement","columnIds","map","columns","textContent","isColumnShown","id","includes","column","Error","String","#position","isNumber","byId","indexOf","byText","join","rowElements","rowIds","values","rowCount","row","cells","cell","isEmpty","emptyText","tBodies","body","index","position","sortOf","sort","sortedBy","entries","direction","sortButton","button","querySelector","click","filterInput","input","queryPart","undefined","which","filterValue","fillIn","previousPageButton","nextPageButton","canPreviousPage","canNextPage","previousPage","nextPage","#button","name","rowCheckbox","checkbox","CheckboxHarness","within","exists","selectAll","isSelected","isChecked","selectedRows","flatMap","_","toggleRow","toggle","toggleAll","viewOptions","root","menu","findAll","DropdownMenuHarness","find","each","columnOptions","open","items","toggleColumn","label","select"],"mappings":";;;;AASA,MAAMA,QAAQ,GAAIC,KAAgC,IAChD,CAACA,KAAK,IAAI,EAAE,EAAEC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACC,IAAI,EAAE;;AAE3C;AACA,MAAMC,MAAM,GAAIC,OAAuB,IACrCC,OAAO,CAACD,OAAO,CAAC,IAChB,CAAEA,OAAO,CAAuBE,QAAQ,IACxCF,OAAO,CAAEG,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;;AAEnD;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,SAASC,OAAO,CAAC;EAC5C,OAAgBC,SAAS,GAAG,YAAY;;AAExC;EACA,IAAIC,KAAKA,GAAiB;AACxB,IAAA,OAAO,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC;AACjC,EAAA;;AAEA;;AAEA;EACA,IAAIC,YAAYA,GAA2B;AACzC,IAAA,OAAO,IAAI,CAACC,KAAK,CAAuB,MAAM,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C,IAAA,MAAMT,IAAI,GAAG,IAAI,CAACF,WAAW;AAC7B,IAAA,MAAME,IAAI,CAACM,IAAI,EAAE;AACjB,IAAA,MAAMN,IAAI,CAACU,MAAM,CAACD,KAAK,CAAC;AAC1B,EAAA;AACF;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,119 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-joinery/data-table",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "shadcn/ui's Data Table for Ember: sorting, filtering, pagination, row selection and column visibility, on TanStack Table's framework-agnostic core.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ember-addon",
|
|
7
|
+
"ember",
|
|
8
|
+
"shadcn",
|
|
9
|
+
"data-table",
|
|
10
|
+
"datagrid",
|
|
11
|
+
"table",
|
|
12
|
+
"tanstack-table"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Joe Gaudet <joe@joegaudet.com>",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/joegaudet/ember-joinery.git",
|
|
19
|
+
"directory": "packages/data-table"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://joegaudet.com/ember-joinery/",
|
|
22
|
+
"bugs": "https://github.com/joegaudet/ember-joinery/issues",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./declarations/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./*": {
|
|
29
|
+
"types": "./declarations/*.d.ts",
|
|
30
|
+
"default": "./dist/*.js"
|
|
31
|
+
},
|
|
32
|
+
"./addon-main.js": "./addon-main.cjs"
|
|
33
|
+
},
|
|
34
|
+
"typesVersions": {
|
|
35
|
+
"*": {
|
|
36
|
+
"*": [
|
|
37
|
+
"declarations/*"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"addon-main.cjs",
|
|
43
|
+
"declarations",
|
|
44
|
+
"dist",
|
|
45
|
+
"README.md",
|
|
46
|
+
"CHANGELOG.md",
|
|
47
|
+
"LICENSE.md",
|
|
48
|
+
"NOTICE"
|
|
49
|
+
],
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ember/test-waiters": "^4.1.2",
|
|
52
|
+
"@embroider/addon-shim": "^1.10.3",
|
|
53
|
+
"@sindresorhus/is": "^8.1.0",
|
|
54
|
+
"@tanstack/table-core": "9.3.1",
|
|
55
|
+
"decorator-transforms": "^2.4.0",
|
|
56
|
+
"ember-modifier": "^4.3.0",
|
|
57
|
+
"lucide": "^0.474.0",
|
|
58
|
+
"@ember-joinery/primitives": "1.1.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@ember/test-helpers": ">= 5.0.0",
|
|
62
|
+
"@glimmer/component": ">= 2.0.0",
|
|
63
|
+
"ember-source": ">= 6.12.0",
|
|
64
|
+
"@ember-joinery/ember": "^1.1.0",
|
|
65
|
+
"@ember-joinery/test-support": "^1.1.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@ember-joinery/test-support": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"@ember/test-helpers": {
|
|
72
|
+
"optional": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@babel/core": "^7.29.7",
|
|
77
|
+
"@babel/plugin-transform-typescript": "^7.29.7",
|
|
78
|
+
"@babel/runtime": "^7.29.7",
|
|
79
|
+
"@ember/library-tsconfig": "^3.0.0",
|
|
80
|
+
"@ember/test-helpers": "^5.7.0",
|
|
81
|
+
"@embroider/addon-dev": "^8.4.2",
|
|
82
|
+
"@glimmer/component": "^2.2.1",
|
|
83
|
+
"@glimmer/tracking": "^1.1.2",
|
|
84
|
+
"@glint/ember-tsc": "^1.14.2",
|
|
85
|
+
"@glint/template": "^1.9.0",
|
|
86
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
87
|
+
"babel-plugin-ember-template-compilation": "^4.0.1",
|
|
88
|
+
"ember-source": "~7.3.0",
|
|
89
|
+
"rollup": "^4.64.6",
|
|
90
|
+
"typescript": "~6.0.3",
|
|
91
|
+
"@ember-joinery/ember": "1.1.0",
|
|
92
|
+
"@ember-joinery/test-support": "1.1.0"
|
|
93
|
+
},
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public"
|
|
96
|
+
},
|
|
97
|
+
"engines": {
|
|
98
|
+
"node": ">=22.12.0"
|
|
99
|
+
},
|
|
100
|
+
"ember": {
|
|
101
|
+
"edition": "octane"
|
|
102
|
+
},
|
|
103
|
+
"ember-addon": {
|
|
104
|
+
"version": 2,
|
|
105
|
+
"type": "addon",
|
|
106
|
+
"main": "addon-main.cjs"
|
|
107
|
+
},
|
|
108
|
+
"joinery": {
|
|
109
|
+
"barrels": [
|
|
110
|
+
"src",
|
|
111
|
+
"src/test-support"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"scripts": {
|
|
115
|
+
"build": "node ../../scripts/gen-barrels.mjs . && rm -rf declarations && rollup --config",
|
|
116
|
+
"start": "node ../../scripts/gen-barrels.mjs . && rm -rf declarations && rollup --config --watch",
|
|
117
|
+
"typecheck": "node ../../scripts/gen-barrels.mjs . && ember-tsc --noEmit"
|
|
118
|
+
}
|
|
6
119
|
}
|