@operato/data-grist 10.29.77 → 10.29.79
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 +26 -0
- package/dist/src/data-card/record-card.d.ts +4 -0
- package/dist/src/data-card/record-card.js +62 -20
- package/dist/src/data-card/record-card.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-date.d.ts +2 -0
- package/dist/src/editors/ox-grist-editor-date.js +3 -8
- package/dist/src/editors/ox-grist-editor-date.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-month.d.ts +2 -0
- package/dist/src/editors/ox-grist-editor-month.js +3 -1
- package/dist/src/editors/ox-grist-editor-month.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-week.d.ts +2 -0
- package/dist/src/editors/ox-grist-editor-week.js +3 -1
- package/dist/src/editors/ox-grist-editor-week.js.map +1 -1
- package/dist/src/editors/ox-grist-editor.js +2 -1
- package/dist/src/editors/ox-grist-editor.js.map +1 -1
- package/dist/src/filters/filter-input.d.ts +1 -0
- package/dist/src/filters/filter-input.js +20 -0
- package/dist/src/filters/filter-input.js.map +1 -1
- package/dist/src/filters/filter-range-date.d.ts +7 -0
- package/dist/src/filters/filter-range-date.js +53 -0
- package/dist/src/filters/filter-range-date.js.map +1 -1
- package/dist/src/filters/filter-select-buttons.js +7 -0
- package/dist/src/filters/filter-select-buttons.js.map +1 -1
- package/dist/src/filters/filter-styles.js +8 -2
- package/dist/src/filters/filter-styles.js.map +1 -1
- package/dist/src/filters/filters-form.js +38 -14
- package/dist/src/filters/filters-form.js.map +1 -1
- package/dist/src/filters/pill-choice.d.ts +24 -0
- package/dist/src/filters/pill-choice.js +63 -0
- package/dist/src/filters/pill-choice.js.map +1 -0
- package/dist/test/accessible-name.test.js +324 -0
- package/dist/test/accessible-name.test.js.map +1 -0
- package/dist/test/accumulator-labels.test.d.ts +1 -0
- package/dist/test/accumulator-labels.test.js +32 -0
- package/dist/test/accumulator-labels.test.js.map +1 -0
- package/dist/test/address-intents.test.js +201 -0
- package/dist/test/address-intents.test.js.map +1 -0
- package/dist/test/card-selector.test.js +71 -0
- package/dist/test/card-selector.test.js.map +1 -0
- package/dist/test/card-thumb.test.d.ts +1 -0
- package/dist/test/card-thumb.test.js +44 -0
- package/dist/test/card-thumb.test.js.map +1 -0
- package/dist/test/card-totals-narrow.test.js +103 -0
- package/dist/test/card-totals-narrow.test.js.map +1 -0
- package/dist/test/cell-button-row-height.test.js +53 -0
- package/dist/test/cell-button-row-height.test.js.map +1 -0
- package/dist/test/column-resize.test.js +153 -0
- package/dist/test/column-resize.test.js.map +1 -0
- package/dist/test/control-heights.test.js +25 -0
- package/dist/test/control-heights.test.js.map +1 -0
- package/dist/test/count-handler.test.js +56 -0
- package/dist/test/count-handler.test.js.map +1 -0
- package/dist/test/create-paste-policy.test.js +159 -0
- package/dist/test/create-paste-policy.test.js.map +1 -0
- package/dist/test/data-integrity.test.js +145 -0
- package/dist/test/data-integrity.test.js.map +1 -0
- package/dist/test/date-fields.test.d.ts +2 -0
- package/dist/test/date-fields.test.js +138 -0
- package/dist/test/date-fields.test.js.map +1 -0
- package/dist/test/destructive-actions.test.js +147 -0
- package/dist/test/destructive-actions.test.js.map +1 -0
- package/dist/test/edit-lifecycle.test.js +270 -0
- package/dist/test/edit-lifecycle.test.js.map +1 -0
- package/dist/test/edit-rebase.test.js +185 -0
- package/dist/test/edit-rebase.test.js.map +1 -0
- package/dist/test/editor-commit.test.js +68 -0
- package/dist/test/editor-commit.test.js.map +1 -0
- package/dist/test/fetch-failure-state.test.js +129 -0
- package/dist/test/fetch-failure-state.test.js.map +1 -0
- package/dist/test/field-contains-content.test.js +101 -0
- package/dist/test/field-contains-content.test.js.map +1 -0
- package/dist/test/field-hint.test.js +54 -0
- package/dist/test/field-hint.test.js.map +1 -0
- package/dist/test/filter-labels.test.js +140 -0
- package/dist/test/filter-labels.test.js.map +1 -0
- package/dist/test/filter-ownership.test.js +83 -0
- package/dist/test/filter-ownership.test.js.map +1 -0
- package/dist/test/filter-select-buttons-count.test.js +36 -0
- package/dist/test/filter-select-buttons-count.test.js.map +1 -0
- package/dist/test/filter-typing.test.js +66 -0
- package/dist/test/filter-typing.test.js.map +1 -0
- package/dist/test/filters-phone-width.test.d.ts +1 -0
- package/dist/test/filters-phone-width.test.js +33 -0
- package/dist/test/filters-phone-width.test.js.map +1 -0
- package/dist/test/filters-phone-wrap.test.js +17 -0
- package/dist/test/filters-phone-wrap.test.js.map +1 -0
- package/dist/test/filters-pills.test.d.ts +2 -0
- package/dist/test/filters-pills.test.js +149 -0
- package/dist/test/filters-pills.test.js.map +1 -0
- package/dist/test/first-click-stays.test.js +77 -0
- package/dist/test/first-click-stays.test.js.map +1 -0
- package/dist/test/fixed-column-opaque.test.js +134 -0
- package/dist/test/fixed-column-opaque.test.js.map +1 -0
- package/dist/test/flexible-columns.test.js +134 -0
- package/dist/test/flexible-columns.test.js.map +1 -0
- package/dist/test/grid-single-scroller.test.js +107 -0
- package/dist/test/grid-single-scroller.test.js.map +1 -0
- package/dist/test/group-heading.test.js +208 -0
- package/dist/test/group-heading.test.js.map +1 -0
- package/dist/test/latest-fetch-wins.test.js +91 -0
- package/dist/test/latest-fetch-wins.test.js.map +1 -0
- package/dist/test/list-defaults.test.js +146 -0
- package/dist/test/list-defaults.test.js.map +1 -0
- package/dist/test/list-records.test.js +46 -0
- package/dist/test/list-records.test.js.map +1 -0
- package/dist/test/office-density.test.js +52 -0
- package/dist/test/office-density.test.js.map +1 -0
- package/dist/test/page-errors.d.ts +1 -0
- package/dist/test/page-errors.js +44 -0
- package/dist/test/page-errors.js.map +1 -0
- package/dist/test/paste-integrity.test.js +163 -0
- package/dist/test/paste-integrity.test.js.map +1 -0
- package/dist/test/record-card-height.test.js +15 -0
- package/dist/test/record-card-height.test.js.map +1 -0
- package/dist/test/record-view-popup-editor.test.js +71 -0
- package/dist/test/record-view-popup-editor.test.js.map +1 -0
- package/dist/test/renderer-date-calendar-day.test.js +48 -0
- package/dist/test/renderer-date-calendar-day.test.js.map +1 -0
- package/dist/test/request-generation.test.js +153 -0
- package/dist/test/request-generation.test.js.map +1 -0
- package/dist/test/resubmit.test.js +83 -0
- package/dist/test/resubmit.test.js.map +1 -0
- package/dist/test/row-hover-visible.test.js +139 -0
- package/dist/test/row-hover-visible.test.js.map +1 -0
- package/dist/test/search-term.test.js +108 -0
- package/dist/test/search-term.test.js.map +1 -0
- package/dist/test/searchable-select.test.js +65 -0
- package/dist/test/searchable-select.test.js.map +1 -0
- package/dist/test/select-empty-value.test.js +61 -0
- package/dist/test/select-empty-value.test.js.map +1 -0
- package/dist/test/shift-range-select.test.js +100 -0
- package/dist/test/shift-range-select.test.js.map +1 -0
- package/dist/test/sparkline-renderer.test.js +36 -0
- package/dist/test/sparkline-renderer.test.js.map +1 -0
- package/dist/test/wheel-one-scroller.test.js +275 -0
- package/dist/test/wheel-one-scroller.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/test/card-selector.test.ts +18 -4
- package/test/date-fields.test.ts +163 -0
- package/test/filter-select-buttons-count.test.ts +2 -1
- package/test/filters-phone-width.test.ts +35 -0
- package/test/filters-pills.test.ts +162 -0
- package/test/list-defaults.test.ts +2 -1
- package/translations/en.json +8 -1
- package/translations/es.json +8 -1
- package/translations/ja.json +8 -1
- package/translations/ko.json +8 -1
- package/translations/ms.json +8 -1
- package/translations/zh.json +8 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* When a filter of a few fixed choices is drawn as chips (pills) - one press, where a select takes two - and whether it
|
|
3
|
+
* has a first 「전체」 chip (2026-11-10, the inquiry list).
|
|
4
|
+
*
|
|
5
|
+
* Chips stand on one line of a phone (about 300px of a 366px filter line) with the filter's name beside them, measured
|
|
6
|
+
* at :4700: three choices and the 「전체」 chip fit; six took two lines and doubled the filter area. So a select becomes
|
|
7
|
+
* chips only for two or three choices whose words are short, each and together. Words are counted in widths: a wide
|
|
8
|
+
* (Hangul, CJK, full-width) character is 2, any other 1 - one chip of 12 is 「내가 보낸 것」 or "Bug reports".
|
|
9
|
+
*/
|
|
10
|
+
export const PILL_MAX_CHOICES = 3;
|
|
11
|
+
export const PILL_MAX_WORD_WIDTH = 12;
|
|
12
|
+
export const PILL_MAX_ROW_WIDTH = 30;
|
|
13
|
+
const WIDE = /[ᄀ-ᅟ⺀-가-힣豈-︰-﹏-⦆¢-₩]/;
|
|
14
|
+
/** How wide a chip's words are: a wide character 2, any other 1. */
|
|
15
|
+
export function wordWidth(text) {
|
|
16
|
+
return [...String(text !== null && text !== void 0 ? text : '')].reduce((sum, char) => sum + (WIDE.test(char) ? 2 : 1), 0);
|
|
17
|
+
}
|
|
18
|
+
function valueOf(option) {
|
|
19
|
+
return typeof option === 'object' && option ? option.value : option;
|
|
20
|
+
}
|
|
21
|
+
function wordsOf(option) {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
return typeof option === 'object' && option ? String((_c = (_b = (_a = option.display) !== null && _a !== void 0 ? _a : option.name) !== null && _b !== void 0 ? _b : option.value) !== null && _c !== void 0 ? _c : '') : String(option !== null && option !== void 0 ? option : '');
|
|
24
|
+
}
|
|
25
|
+
/** The choice that means no condition - a select's empty first line. */
|
|
26
|
+
export function isNoChoice(option) {
|
|
27
|
+
const value = valueOf(option);
|
|
28
|
+
return value === '' || value === undefined || value === null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether the chips have a first 「전체」 chip. Several at once, or a single choice with an empty line, can choose
|
|
32
|
+
* nothing - every row - and the 「전체」 chip is that choice, seen. A single choice with no empty line and a value it
|
|
33
|
+
* opens with must always have one (the inquiry list's old 「보기」, the audit period) and has none. A lone chip is a
|
|
34
|
+
* switch - 「취소된 발행」 shows only those - and has none either.
|
|
35
|
+
*/
|
|
36
|
+
export function hasAllChip(filter, options) {
|
|
37
|
+
const choices = options.filter(option => !isNoChoice(option));
|
|
38
|
+
if (!choices.length)
|
|
39
|
+
return false;
|
|
40
|
+
/* A single choice with an empty line: 「전체」 and the one choice are a pair - 「전체」·「내가 보낸 것」. */
|
|
41
|
+
if (filter.operator !== 'in' && options.some(isNoChoice))
|
|
42
|
+
return true;
|
|
43
|
+
if (choices.length < 2)
|
|
44
|
+
return false;
|
|
45
|
+
if (filter.operator === 'in')
|
|
46
|
+
return true;
|
|
47
|
+
return filter.value === undefined || filter.value === null || filter.value === '';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether a select of these fixed choices is drawn as chips: at most three choices, two chips at least with 「전체」,
|
|
51
|
+
* the words short each and together with 「전체」.
|
|
52
|
+
*/
|
|
53
|
+
export function fitsAsPills(filter, options, allLabel) {
|
|
54
|
+
const choices = options.filter(option => !isNoChoice(option));
|
|
55
|
+
const withAll = hasAllChip(filter, options);
|
|
56
|
+
if (choices.length > PILL_MAX_CHOICES || choices.length + (withAll ? 1 : 0) < 2)
|
|
57
|
+
return false;
|
|
58
|
+
const widths = choices.map(option => wordWidth(wordsOf(option)));
|
|
59
|
+
if (widths.some(width => width > PILL_MAX_WORD_WIDTH))
|
|
60
|
+
return false;
|
|
61
|
+
return widths.reduce((sum, width) => sum + width, withAll ? wordWidth(allLabel) : 0) <= PILL_MAX_ROW_WIDTH;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=pill-choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pill-choice.js","sourceRoot":"","sources":["../../../src/filters/pill-choice.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA;AACjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC,MAAM,IAAI,GAAG,yBAAyB,CAAA;AAEtC,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,CAAC,GAAG,M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CAAC","sourcesContent":["import { FilterConfigObject, SelectOption } from '../types.js'\n\n/*\n * When a filter of a few fixed choices is drawn as chips (pills) - one press, where a select takes two - and whether it\n * has a first 「전체」 chip (2026-11-10, the inquiry list).\n *\n * Chips stand on one line of a phone (about 300px of a 366px filter line) with the filter's name beside them, measured\n * at :4700: three choices and the 「전체」 chip fit; six took two lines and doubled the filter area. So a select becomes\n * chips only for two or three choices whose words are short, each and together. Words are counted in widths: a wide\n * (Hangul, CJK, full-width) character is 2, any other 1 - one chip of 12 is 「내가 보낸 것」 or \"Bug reports\".\n */\nexport const PILL_MAX_CHOICES = 3\nexport const PILL_MAX_WORD_WIDTH = 12\nexport const PILL_MAX_ROW_WIDTH = 30\n\nconst WIDE = /[ᄀ-ᅟ⺀-가-힣豈-︰-﹏-⦆¢-₩]/\n\n/** How wide a chip's words are: a wide character 2, any other 1. */\nexport function wordWidth(text: string): number {\n return [...String(text ?? '')].reduce((sum, char) => sum + (WIDE.test(char) ? 2 : 1), 0)\n}\n\nfunction valueOf(option: SelectOption): any {\n return typeof option === 'object' && option ? option.value : option\n}\n\nfunction wordsOf(option: SelectOption): string {\n return typeof option === 'object' && option ? String(option.display ?? option.name ?? option.value ?? '') : String(option ?? '')\n}\n\n/** The choice that means no condition - a select's empty first line. */\nexport function isNoChoice(option: SelectOption): boolean {\n const value = valueOf(option)\n return value === '' || value === undefined || value === null\n}\n\n/**\n * Whether the chips have a first 「전체」 chip. Several at once, or a single choice with an empty line, can choose\n * nothing - every row - and the 「전체」 chip is that choice, seen. A single choice with no empty line and a value it\n * opens with must always have one (the inquiry list's old 「보기」, the audit period) and has none. A lone chip is a\n * switch - 「취소된 발행」 shows only those - and has none either.\n */\nexport function hasAllChip(filter: FilterConfigObject & { value?: any }, options: SelectOption[]): boolean {\n const choices = options.filter(option => !isNoChoice(option))\n if (!choices.length) return false\n /* A single choice with an empty line: 「전체」 and the one choice are a pair - 「전체」·「내가 보낸 것」. */\n if (filter.operator !== 'in' && options.some(isNoChoice)) return true\n if (choices.length < 2) return false\n if (filter.operator === 'in') return true\n return filter.value === undefined || filter.value === null || filter.value === ''\n}\n\n/**\n * Whether a select of these fixed choices is drawn as chips: at most three choices, two chips at least with 「전체」,\n * the words short each and together with 「전체」.\n */\nexport function fitsAsPills(filter: FilterConfigObject & { value?: any }, options: SelectOption[], allLabel: string): boolean {\n const choices = options.filter(option => !isNoChoice(option))\n const withAll = hasAllChip(filter, options)\n if (choices.length > PILL_MAX_CHOICES || choices.length + (withAll ? 1 : 0) < 2) return false\n const widths = choices.map(option => wordWidth(wordsOf(option)))\n if (widths.some(width => width > PILL_MAX_WORD_WIDTH)) return false\n return widths.reduce((sum, width) => sum + width, withAll ? wordWidth(allLabel) : 0) <= PILL_MAX_ROW_WIDTH\n}\n"]}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import '../src/data-grid/data-grid.js';
|
|
4
|
+
import '../src/data-grid/data-grid-body.js';
|
|
5
|
+
import { buildColumn } from '../src/configure/column-builder.js';
|
|
6
|
+
import { columnText } from '../src/utils/column-text.js';
|
|
7
|
+
import { ZERO_CONFIG, ZERO_DATA } from '../src/configure/zero-config.js';
|
|
8
|
+
/**
|
|
9
|
+
* Accessible names on the inputs inside the grid.
|
|
10
|
+
*
|
|
11
|
+
* ## Why this is tested
|
|
12
|
+
*
|
|
13
|
+
* Several inputs here had no name: the row-select checkboxes, the header filter boxes, and the IME
|
|
14
|
+
* buffer that holds focus. Position carries the meaning for a sighted reader — a narrow leftmost
|
|
15
|
+
* column means row select, a box under a header name filters that column — but position is a
|
|
16
|
+
* picture, not a relationship, so nothing of it reaches a screen reader.
|
|
17
|
+
*
|
|
18
|
+
* ## What has to hold
|
|
19
|
+
*
|
|
20
|
+
* The name has one source. Editing `header` must change what is announced, which means callers
|
|
21
|
+
* cannot spell the name out again. `columnText()` is that source.
|
|
22
|
+
*
|
|
23
|
+
* `buildColumn` turns a string header into `() => header`, and that function returns a lit template
|
|
24
|
+
* the name cannot be read back out of. The name was disappearing right there.
|
|
25
|
+
*/
|
|
26
|
+
describe('column name has one source', () => {
|
|
27
|
+
it('keeps the plain text after a string header becomes a function', () => {
|
|
28
|
+
const column = buildColumn({ type: 'string', name: 'palletId', header: '파렛트 번호' });
|
|
29
|
+
expect(columnText(column)).to.equal('파렛트 번호');
|
|
30
|
+
});
|
|
31
|
+
it('keeps it when the string arrives as header.renderer', () => {
|
|
32
|
+
const column = buildColumn({ type: 'string', name: 'palletId', header: { renderer: '파렛트 번호' } });
|
|
33
|
+
expect(columnText(column)).to.equal('파렛트 번호');
|
|
34
|
+
});
|
|
35
|
+
it('lets label: true inherit the header name', () => {
|
|
36
|
+
const column = buildColumn({ type: 'string', name: 'palletId', header: '파렛트 번호', label: true });
|
|
37
|
+
expect(columnText(column)).to.equal('파렛트 번호');
|
|
38
|
+
});
|
|
39
|
+
it('falls back to column.name when the header is drawn by a function', () => {
|
|
40
|
+
const column = buildColumn({ type: 'string', name: 'palletId', header: { renderer: () => html `<i>x</i>` } });
|
|
41
|
+
expect(columnText(column)).to.equal('palletId');
|
|
42
|
+
});
|
|
43
|
+
it('invents no name when there is no column', () => {
|
|
44
|
+
expect(columnText(undefined)).to.equal('');
|
|
45
|
+
expect(columnText(null)).to.equal('');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('row-select boxes are named', () => {
|
|
49
|
+
const columns = [
|
|
50
|
+
{ type: 'gutter', gutterName: 'row-selector', name: '__selected__', multiple: true },
|
|
51
|
+
{ type: 'string', name: 'palletId', header: '파렛트 번호' }
|
|
52
|
+
].map(buildColumn);
|
|
53
|
+
it('says which row each checkbox selects', async () => {
|
|
54
|
+
const body = await fixture(html `
|
|
55
|
+
<ox-grid-body
|
|
56
|
+
.config=${{ ...ZERO_CONFIG, columns }}
|
|
57
|
+
.columns=${columns}
|
|
58
|
+
.data=${{ ...ZERO_DATA, records: [{ palletId: 'P-0001' }, { palletId: 'P-0002' }] }}
|
|
59
|
+
></ox-grid-body>
|
|
60
|
+
`);
|
|
61
|
+
await body.updateComplete;
|
|
62
|
+
/* The checkboxes live one shadow root deeper, inside each ox-grid-field. */
|
|
63
|
+
const fields = Array.from(body.renderRoot.querySelectorAll('ox-grid-field'));
|
|
64
|
+
await Promise.all(fields.map(field => field.updateComplete));
|
|
65
|
+
const boxes = fields.flatMap(field => { var _a; return Array.from(((_a = field.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('input[type=checkbox], input[type=radio]')) || []); });
|
|
66
|
+
expect(boxes.length, 'found no row-select box').to.be.greaterThan(0);
|
|
67
|
+
boxes.forEach(box => expect(box.getAttribute('aria-label'), 'an unnamed checkbox is left').to.be.a('string').and.not.equal(''));
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
describe('IME buffer names the cell it stands in for', () => {
|
|
71
|
+
const columns = [
|
|
72
|
+
{ type: 'string', name: 'palletId', header: '파렛트 번호' },
|
|
73
|
+
{ type: 'string', name: 'location', header: '보관 위치' }
|
|
74
|
+
].map(buildColumn);
|
|
75
|
+
async function bodyFocusedAt(column) {
|
|
76
|
+
const body = await fixture(html `
|
|
77
|
+
<ox-grid-body
|
|
78
|
+
.config=${{ ...ZERO_CONFIG, columns }}
|
|
79
|
+
.columns=${columns}
|
|
80
|
+
.data=${{ ...ZERO_DATA, records: [{ palletId: 'P-0001', location: 'A-01' }] }}
|
|
81
|
+
.focused=${{ row: 0, column }}
|
|
82
|
+
></ox-grid-body>
|
|
83
|
+
`);
|
|
84
|
+
await body.updateComplete;
|
|
85
|
+
return body.renderRoot.querySelector('#ime-buffer');
|
|
86
|
+
}
|
|
87
|
+
it('reads the first column while focus sits there', async () => {
|
|
88
|
+
expect((await bodyFocusedAt(0)).getAttribute('aria-label')).to.contain('파렛트 번호');
|
|
89
|
+
});
|
|
90
|
+
it('changes what it reads when focus moves a column over', async () => {
|
|
91
|
+
expect((await bodyFocusedAt(1)).getAttribute('aria-label')).to.contain('보관 위치');
|
|
92
|
+
});
|
|
93
|
+
it('stays visible to assistive tech — it is where focus lands', async () => {
|
|
94
|
+
expect((await bodyFocusedAt(0)).getAttribute('aria-hidden')).to.be.null;
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* Table semantics.
|
|
99
|
+
*
|
|
100
|
+
* ## Why this is tested
|
|
101
|
+
*
|
|
102
|
+
* The grid is drawn with CSS grid: cells sit flat and there is no row element. Rows are a picture
|
|
103
|
+
* made of equal offsetTop, so a screen reader saw a pile of inputs rather than a table — no "this
|
|
104
|
+
* is a table", no "row 3 column 3", no "40 rows in all".
|
|
105
|
+
*
|
|
106
|
+
* Adding row wrappers can break two things at once:
|
|
107
|
+
*
|
|
108
|
+
* ```
|
|
109
|
+
* semantics grid / row / columnheader / gridcell have to nest correctly
|
|
110
|
+
* layout display: contents must generate no box; if it does, the columns collapse
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* The second one is why geometry is asserted: cells in a row must step right, and rows must step
|
|
114
|
+
* down.
|
|
115
|
+
*/
|
|
116
|
+
describe('grid declares itself a grid', () => {
|
|
117
|
+
/* ox-grid takes already-compiled columns; compiling them is ox-grist's job. */
|
|
118
|
+
const columns = [
|
|
119
|
+
{ type: 'gutter', gutterName: 'row-selector', name: '__selected__', multiple: true },
|
|
120
|
+
{ type: 'string', name: 'palletId', header: '파렛트 번호', sortable: true },
|
|
121
|
+
{ type: 'string', name: 'location', header: '보관 위치', sortable: true }
|
|
122
|
+
].map(buildColumn);
|
|
123
|
+
async function grid(overrides = {}) {
|
|
124
|
+
const el = await fixture(html `
|
|
125
|
+
<ox-grid
|
|
126
|
+
aria-label="입고 대기 목록"
|
|
127
|
+
.config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}
|
|
128
|
+
.data=${{
|
|
129
|
+
page: 1,
|
|
130
|
+
limit: 20,
|
|
131
|
+
total: 40,
|
|
132
|
+
records: [
|
|
133
|
+
{ palletId: 'P-0001', location: 'A-01' },
|
|
134
|
+
{ palletId: 'P-0002', location: 'A-02' }
|
|
135
|
+
],
|
|
136
|
+
...overrides
|
|
137
|
+
}}
|
|
138
|
+
></ox-grid>
|
|
139
|
+
`);
|
|
140
|
+
await el.updateComplete;
|
|
141
|
+
const header = el.renderRoot.querySelector('ox-grid-header');
|
|
142
|
+
const body = el.renderRoot.querySelector('ox-grid-body');
|
|
143
|
+
await (header === null || header === void 0 ? void 0 : header.updateComplete);
|
|
144
|
+
await (body === null || body === void 0 ? void 0 : body.updateComplete);
|
|
145
|
+
return { el, header, body };
|
|
146
|
+
}
|
|
147
|
+
it('nests grid, row and cell', async () => {
|
|
148
|
+
const { el, header, body } = await grid();
|
|
149
|
+
const grid_ = el.renderRoot.querySelector('[role=grid]');
|
|
150
|
+
expect(grid_, 'no role=grid').to.exist;
|
|
151
|
+
expect(header.getAttribute('role')).to.equal('rowgroup');
|
|
152
|
+
expect(body.getAttribute('role')).to.equal('rowgroup');
|
|
153
|
+
expect(header.renderRoot.querySelectorAll('[role=row]').length).to.equal(1);
|
|
154
|
+
expect(body.renderRoot.querySelectorAll('[role=row]').length).to.equal(2);
|
|
155
|
+
expect(header.renderRoot.querySelectorAll('[role=columnheader]').length).to.equal(3);
|
|
156
|
+
});
|
|
157
|
+
it('counts the whole table, not the page on screen', async () => {
|
|
158
|
+
const { el } = await grid();
|
|
159
|
+
const grid_ = el.renderRoot.querySelector('[role=grid]');
|
|
160
|
+
/* One header row plus 40 records. Two rows drawn is still a 40-row table. */
|
|
161
|
+
expect(grid_.getAttribute('aria-rowcount')).to.equal('41');
|
|
162
|
+
expect(grid_.getAttribute('aria-colcount')).to.equal('3');
|
|
163
|
+
expect(grid_.getAttribute('aria-label')).to.equal('입고 대기 목록');
|
|
164
|
+
});
|
|
165
|
+
it('numbers page 2 from row 22, not back at 1', async () => {
|
|
166
|
+
const { body } = await grid({ page: 2 });
|
|
167
|
+
const rows = Array.from(body.renderRoot.querySelectorAll('[role=row]'));
|
|
168
|
+
/* One header row plus 20 records on page 1. */
|
|
169
|
+
expect(rows[0].getAttribute('aria-rowindex')).to.equal('22');
|
|
170
|
+
expect(rows[1].getAttribute('aria-rowindex')).to.equal('23');
|
|
171
|
+
});
|
|
172
|
+
it('numbers columns and leaves the width filler uncounted', async () => {
|
|
173
|
+
const { body } = await grid();
|
|
174
|
+
const row = body.renderRoot.querySelector('[role=row]');
|
|
175
|
+
const cells = Array.from(row.querySelectorAll('[role=gridcell]'));
|
|
176
|
+
expect(cells.map(cell => cell.getAttribute('aria-colindex'))).to.deep.equal(['1', '2', '3']);
|
|
177
|
+
expect(row.querySelectorAll('[role=presentation]').length, 'the filler was counted as a cell').to.equal(1);
|
|
178
|
+
});
|
|
179
|
+
it('states sort direction in text, not only as an arrow', async () => {
|
|
180
|
+
const el = await fixture(html `
|
|
181
|
+
<ox-grid
|
|
182
|
+
.config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}
|
|
183
|
+
.sorters=${[{ name: 'palletId', desc: true }]}
|
|
184
|
+
.data=${{ records: [{ palletId: 'P-0001', location: 'A-01' }] }}
|
|
185
|
+
></ox-grid>
|
|
186
|
+
`);
|
|
187
|
+
await el.updateComplete;
|
|
188
|
+
const header = el.renderRoot.querySelector('ox-grid-header');
|
|
189
|
+
await header.updateComplete;
|
|
190
|
+
const headers = Array.from(header.renderRoot.querySelectorAll('[role=columnheader]'));
|
|
191
|
+
const sorts = headers.map(cell => cell.getAttribute('aria-sort'));
|
|
192
|
+
/* A gutter cannot be sorted; claiming otherwise announces a control that is not there. */
|
|
193
|
+
expect(sorts[0]).to.be.null;
|
|
194
|
+
expect(sorts[1], 'sorted descending').to.equal('descending');
|
|
195
|
+
expect(sorts[2], 'sortable but not currently sorted').to.equal('none');
|
|
196
|
+
});
|
|
197
|
+
it('keeps the layout — a row wrapper that generates a box collapses the grid', async () => {
|
|
198
|
+
const { body } = await grid();
|
|
199
|
+
const rows = Array.from(body.renderRoot.querySelectorAll('[role=row]'));
|
|
200
|
+
const first = Array.from(rows[0].children);
|
|
201
|
+
expect(getComputedStyle(rows[0]).display).to.equal('contents');
|
|
202
|
+
/* Cells step right; stacked at one x means the columns are gone. */
|
|
203
|
+
const lefts = first.map(cell => cell.offsetLeft);
|
|
204
|
+
expect(new Set(lefts).size, 'cells stacked at the same x').to.be.greaterThan(1);
|
|
205
|
+
lefts.slice(1).forEach((left, index) => expect(left).to.be.greaterThan(lefts[index]));
|
|
206
|
+
/* Rows step down. */
|
|
207
|
+
const firstTop = rows[0].children[0].offsetTop;
|
|
208
|
+
const secondTop = rows[1].children[0].offsetTop;
|
|
209
|
+
expect(secondTop, 'two rows at the same y').to.be.greaterThan(firstTop);
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* Grouped headers.
|
|
214
|
+
*
|
|
215
|
+
* The header becomes two rows and ungrouped columns span both (`.span-both`). Placement runs
|
|
216
|
+
* through CSS `grid-row` / `grid-column`, which makes this the riskiest spot for a row wrapper.
|
|
217
|
+
*/
|
|
218
|
+
describe('grouped header spans two rows', () => {
|
|
219
|
+
const columns = [
|
|
220
|
+
{ type: 'string', name: 'palletId', header: '파렛트 번호' },
|
|
221
|
+
{ type: 'string', name: 'width', header: { renderer: '폭', group: '치수' } },
|
|
222
|
+
{ type: 'string', name: 'height', header: { renderer: '높이', group: '치수' } }
|
|
223
|
+
].map(buildColumn);
|
|
224
|
+
async function grouped() {
|
|
225
|
+
const el = await fixture(html `
|
|
226
|
+
<ox-grid
|
|
227
|
+
.config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}
|
|
228
|
+
.data=${{ total: 1, records: [{ palletId: 'P-0001', width: '1200', height: '900' }] }}
|
|
229
|
+
></ox-grid>
|
|
230
|
+
`);
|
|
231
|
+
await el.updateComplete;
|
|
232
|
+
const header = el.renderRoot.querySelector('ox-grid-header');
|
|
233
|
+
const body = el.renderRoot.querySelector('ox-grid-body');
|
|
234
|
+
await header.updateComplete;
|
|
235
|
+
await body.updateComplete;
|
|
236
|
+
return { el, header, body };
|
|
237
|
+
}
|
|
238
|
+
it('counts two header rows so the body starts at row 3', async () => {
|
|
239
|
+
const { el, header, body } = await grouped();
|
|
240
|
+
expect(header.renderRoot.querySelectorAll('[role=row]').length).to.equal(2);
|
|
241
|
+
/* Two header rows plus one record. */
|
|
242
|
+
expect(el.renderRoot.querySelector('[role=grid]').getAttribute('aria-rowcount')).to.equal('3');
|
|
243
|
+
const rows = Array.from(body.renderRoot.querySelectorAll('[role=row]'));
|
|
244
|
+
expect(rows[0].getAttribute('aria-rowindex')).to.equal('3');
|
|
245
|
+
});
|
|
246
|
+
it('says how many columns a group covers', async () => {
|
|
247
|
+
const { header } = await grouped();
|
|
248
|
+
const cells = Array.from(header.renderRoot.querySelectorAll('[role=columnheader]'));
|
|
249
|
+
const first = cells[0];
|
|
250
|
+
const group = cells.find(cell => cell.getAttribute('aria-colspan'));
|
|
251
|
+
/* An ungrouped column spans both header rows. */
|
|
252
|
+
expect(first.getAttribute('aria-rowspan')).to.equal('2');
|
|
253
|
+
expect(first.getAttribute('aria-colindex')).to.equal('1');
|
|
254
|
+
/* The group header covers columns 2 and 3. */
|
|
255
|
+
expect(group, 'found no group header').to.exist;
|
|
256
|
+
expect(group.getAttribute('aria-colindex')).to.equal('2');
|
|
257
|
+
expect(group.getAttribute('aria-colspan')).to.equal('2');
|
|
258
|
+
});
|
|
259
|
+
it('keeps two-row header placement — group sits above its leaf columns', async () => {
|
|
260
|
+
const { header } = await grouped();
|
|
261
|
+
const cells = Array.from(header.renderRoot.querySelectorAll('[role=columnheader]'));
|
|
262
|
+
const group = cells.find(cell => cell.getAttribute('aria-colspan'));
|
|
263
|
+
const leaf = cells.find(cell => !cell.getAttribute('aria-colspan') && cell !== cells[0]);
|
|
264
|
+
expect(leaf.offsetTop, 'group header and its leaf column at the same height').to.be.greaterThan(group.offsetTop);
|
|
265
|
+
expect(group.offsetWidth, 'group header does not cover two columns').to.be.greaterThan(leaf.offsetWidth);
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
/**
|
|
269
|
+
* The grid wrapper must not disturb the surrounding layout.
|
|
270
|
+
*
|
|
271
|
+
* `role=grid` admits only rows, so the settings-button slot and the pager moved outside the
|
|
272
|
+
* wrapper. Two things then depend on this structure:
|
|
273
|
+
*
|
|
274
|
+
* ```
|
|
275
|
+
* column layout the host is a flex column. The wrapper is itself a flex column (it is the one
|
|
276
|
+
* scroller that header and body share), so the body still takes the height
|
|
277
|
+
* left under the header
|
|
278
|
+
* sibling selector "show the settings button on header hover" is an adjacent-sibling rule, so
|
|
279
|
+
* the button has to sit directly after the wrapper
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
describe('grid wrapper stays out of the layout', () => {
|
|
283
|
+
const columns = [
|
|
284
|
+
{ type: 'string', name: 'palletId', header: '파렛트 번호' },
|
|
285
|
+
{ type: 'string', name: 'location', header: '보관 위치' }
|
|
286
|
+
].map(buildColumn);
|
|
287
|
+
it('places the settings button after the grid, not inside it', async () => {
|
|
288
|
+
const el = await fixture(html `
|
|
289
|
+
<ox-grid
|
|
290
|
+
.config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}
|
|
291
|
+
.data=${{ total: 1, records: [{ palletId: 'P-0001', location: 'A-01' }] }}
|
|
292
|
+
></ox-grid>
|
|
293
|
+
`);
|
|
294
|
+
await el.updateComplete;
|
|
295
|
+
const grid = el.renderRoot.querySelector('[role=grid]');
|
|
296
|
+
const setting = el.renderRoot.querySelector('div[setting]');
|
|
297
|
+
expect(setting, 'no settings slot').to.exist;
|
|
298
|
+
expect(grid.contains(setting), 'settings button inside the grid breaks table reading').to.be.false;
|
|
299
|
+
expect(grid.nextElementSibling, 'adjacent-sibling rule no longer holds').to.equal(setting);
|
|
300
|
+
});
|
|
301
|
+
it('lays header and body out as a column that fills the host', async () => {
|
|
302
|
+
const el = await fixture(html `
|
|
303
|
+
<div style="height: 300px; display: flex">
|
|
304
|
+
<ox-grid
|
|
305
|
+
style="flex: 1"
|
|
306
|
+
.config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}
|
|
307
|
+
.data=${{ total: 1, records: [{ palletId: 'P-0001', location: 'A-01' }] }}
|
|
308
|
+
></ox-grid>
|
|
309
|
+
</div>
|
|
310
|
+
`);
|
|
311
|
+
const grid = el.querySelector('ox-grid');
|
|
312
|
+
await grid.updateComplete;
|
|
313
|
+
const wrapper = grid.renderRoot.querySelector('[role=grid]');
|
|
314
|
+
const header = grid.renderRoot.querySelector('ox-grid-header');
|
|
315
|
+
const body = grid.renderRoot.querySelector('ox-grid-body');
|
|
316
|
+
expect(getComputedStyle(wrapper).display).to.equal('flex');
|
|
317
|
+
expect(getComputedStyle(wrapper).flexDirection).to.equal('column');
|
|
318
|
+
/* The body takes the remaining height; a wrapper with a box shrinks it to header height. */
|
|
319
|
+
expect(body.offsetHeight, 'body does not take the remaining height').to.be.greaterThan(100);
|
|
320
|
+
expect(body.offsetTop, 'body is not below the header').to.be.greaterThan(0);
|
|
321
|
+
expect(header.offsetTop).to.equal(0);
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
//# sourceMappingURL=accessible-name.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessible-name.test.js","sourceRoot":"","sources":["../../test/accessible-name.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,+BAA+B,CAAA;AACtC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAA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E,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/data-grid/data-grid.js'\nimport '../src/data-grid/data-grid-body.js'\nimport { buildColumn } from '../src/configure/column-builder.js'\nimport { columnText } from '../src/utils/column-text.js'\nimport { ZERO_CONFIG, ZERO_DATA } from '../src/configure/zero-config.js'\n\n/**\n * Accessible names on the inputs inside the grid.\n *\n * ## Why this is tested\n *\n * Several inputs here had no name: the row-select checkboxes, the header filter boxes, and the IME\n * buffer that holds focus. Position carries the meaning for a sighted reader — a narrow leftmost\n * column means row select, a box under a header name filters that column — but position is a\n * picture, not a relationship, so nothing of it reaches a screen reader.\n *\n * ## What has to hold\n *\n * The name has one source. Editing `header` must change what is announced, which means callers\n * cannot spell the name out again. `columnText()` is that source.\n *\n * `buildColumn` turns a string header into `() => header`, and that function returns a lit template\n * the name cannot be read back out of. The name was disappearing right there.\n */\n\ndescribe('column name has one source', () => {\n it('keeps the plain text after a string header becomes a function', () => {\n const column = buildColumn({ type: 'string', name: 'palletId', header: '파렛트 번호' })\n\n expect(columnText(column)).to.equal('파렛트 번호')\n })\n\n it('keeps it when the string arrives as header.renderer', () => {\n const column = buildColumn({ type: 'string', name: 'palletId', header: { renderer: '파렛트 번호' } })\n\n expect(columnText(column)).to.equal('파렛트 번호')\n })\n\n it('lets label: true inherit the header name', () => {\n const column = buildColumn({ type: 'string', name: 'palletId', header: '파렛트 번호', label: true })\n\n expect(columnText(column)).to.equal('파렛트 번호')\n })\n\n it('falls back to column.name when the header is drawn by a function', () => {\n const column = buildColumn({ type: 'string', name: 'palletId', header: { renderer: () => html`<i>x</i>` } })\n\n expect(columnText(column)).to.equal('palletId')\n })\n\n it('invents no name when there is no column', () => {\n expect(columnText(undefined)).to.equal('')\n expect(columnText(null)).to.equal('')\n })\n})\n\ndescribe('row-select boxes are named', () => {\n const columns = [\n { type: 'gutter', gutterName: 'row-selector', name: '__selected__', multiple: true },\n { type: 'string', name: 'palletId', header: '파렛트 번호' }\n ].map(buildColumn)\n\n it('says which row each checkbox selects', async () => {\n const body: any = await fixture(html`\n <ox-grid-body\n .config=${{ ...ZERO_CONFIG, columns }}\n .columns=${columns}\n .data=${{ ...ZERO_DATA, records: [{ palletId: 'P-0001' }, { palletId: 'P-0002' }] }}\n ></ox-grid-body>\n `)\n\n await body.updateComplete\n\n /* The checkboxes live one shadow root deeper, inside each ox-grid-field. */\n const fields = Array.from(body.renderRoot.querySelectorAll('ox-grid-field')) as any[]\n\n await Promise.all(fields.map(field => field.updateComplete))\n\n const boxes = fields.flatMap(field =>\n Array.from(field.renderRoot?.querySelectorAll('input[type=checkbox], input[type=radio]') || [])\n ) as HTMLInputElement[]\n\n expect(boxes.length, 'found no row-select box').to.be.greaterThan(0)\n boxes.forEach(box =>\n expect(box.getAttribute('aria-label'), 'an unnamed checkbox is left').to.be.a('string').and.not.equal('')\n )\n })\n})\n\ndescribe('IME buffer names the cell it stands in for', () => {\n const columns = [\n { type: 'string', name: 'palletId', header: '파렛트 번호' },\n { type: 'string', name: 'location', header: '보관 위치' }\n ].map(buildColumn)\n\n async function bodyFocusedAt(column: number) {\n const body: any = await fixture(html`\n <ox-grid-body\n .config=${{ ...ZERO_CONFIG, columns }}\n .columns=${columns}\n .data=${{ ...ZERO_DATA, records: [{ palletId: 'P-0001', location: 'A-01' }] }}\n .focused=${{ row: 0, column }}\n ></ox-grid-body>\n `)\n\n await body.updateComplete\n\n return body.renderRoot.querySelector('#ime-buffer') as HTMLInputElement\n }\n\n it('reads the first column while focus sits there', async () => {\n expect((await bodyFocusedAt(0)).getAttribute('aria-label')).to.contain('파렛트 번호')\n })\n\n it('changes what it reads when focus moves a column over', async () => {\n expect((await bodyFocusedAt(1)).getAttribute('aria-label')).to.contain('보관 위치')\n })\n\n it('stays visible to assistive tech — it is where focus lands', async () => {\n expect((await bodyFocusedAt(0)).getAttribute('aria-hidden')).to.be.null\n })\n})\n\n/**\n * Table semantics.\n *\n * ## Why this is tested\n *\n * The grid is drawn with CSS grid: cells sit flat and there is no row element. Rows are a picture\n * made of equal offsetTop, so a screen reader saw a pile of inputs rather than a table — no \"this\n * is a table\", no \"row 3 column 3\", no \"40 rows in all\".\n *\n * Adding row wrappers can break two things at once:\n *\n * ```\n * semantics grid / row / columnheader / gridcell have to nest correctly\n * layout display: contents must generate no box; if it does, the columns collapse\n * ```\n *\n * The second one is why geometry is asserted: cells in a row must step right, and rows must step\n * down.\n */\ndescribe('grid declares itself a grid', () => {\n /* ox-grid takes already-compiled columns; compiling them is ox-grist's job. */\n const columns = [\n { type: 'gutter', gutterName: 'row-selector', name: '__selected__', multiple: true },\n { type: 'string', name: 'palletId', header: '파렛트 번호', sortable: true },\n { type: 'string', name: 'location', header: '보관 위치', sortable: true }\n ].map(buildColumn)\n\n async function grid(overrides: any = {}) {\n const el: any = await fixture(html`\n <ox-grid\n aria-label=\"입고 대기 목록\"\n .config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}\n .data=${{\n page: 1,\n limit: 20,\n total: 40,\n records: [\n { palletId: 'P-0001', location: 'A-01' },\n { palletId: 'P-0002', location: 'A-02' }\n ],\n ...overrides\n }}\n ></ox-grid>\n `)\n\n await el.updateComplete\n\n const header = el.renderRoot.querySelector('ox-grid-header')\n const body = el.renderRoot.querySelector('ox-grid-body')\n\n await header?.updateComplete\n await body?.updateComplete\n\n return { el, header, body }\n }\n\n it('nests grid, row and cell', async () => {\n const { el, header, body } = await grid()\n\n const grid_ = el.renderRoot.querySelector('[role=grid]')\n\n expect(grid_, 'no role=grid').to.exist\n expect(header.getAttribute('role')).to.equal('rowgroup')\n expect(body.getAttribute('role')).to.equal('rowgroup')\n\n expect(header.renderRoot.querySelectorAll('[role=row]').length).to.equal(1)\n expect(body.renderRoot.querySelectorAll('[role=row]').length).to.equal(2)\n expect(header.renderRoot.querySelectorAll('[role=columnheader]').length).to.equal(3)\n })\n\n it('counts the whole table, not the page on screen', async () => {\n const { el } = await grid()\n\n const grid_ = el.renderRoot.querySelector('[role=grid]')\n\n /* One header row plus 40 records. Two rows drawn is still a 40-row table. */\n expect(grid_.getAttribute('aria-rowcount')).to.equal('41')\n expect(grid_.getAttribute('aria-colcount')).to.equal('3')\n expect(grid_.getAttribute('aria-label')).to.equal('입고 대기 목록')\n })\n\n it('numbers page 2 from row 22, not back at 1', async () => {\n const { body } = await grid({ page: 2 })\n\n const rows = Array.from(body.renderRoot.querySelectorAll('[role=row]')) as HTMLElement[]\n\n /* One header row plus 20 records on page 1. */\n expect(rows[0].getAttribute('aria-rowindex')).to.equal('22')\n expect(rows[1].getAttribute('aria-rowindex')).to.equal('23')\n })\n\n it('numbers columns and leaves the width filler uncounted', async () => {\n const { body } = await grid()\n\n const row = body.renderRoot.querySelector('[role=row]') as HTMLElement\n const cells = Array.from(row.querySelectorAll('[role=gridcell]')) as HTMLElement[]\n\n expect(cells.map(cell => cell.getAttribute('aria-colindex'))).to.deep.equal(['1', '2', '3'])\n expect(row.querySelectorAll('[role=presentation]').length, 'the filler was counted as a cell').to.equal(1)\n })\n\n it('states sort direction in text, not only as an arrow', async () => {\n const el: any = await fixture(html`\n <ox-grid\n .config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}\n .sorters=${[{ name: 'palletId', desc: true }]}\n .data=${{ records: [{ palletId: 'P-0001', location: 'A-01' }] }}\n ></ox-grid>\n `)\n\n await el.updateComplete\n\n const header = el.renderRoot.querySelector('ox-grid-header')\n await header.updateComplete\n\n const headers = Array.from(header.renderRoot.querySelectorAll('[role=columnheader]')) as HTMLElement[]\n const sorts = headers.map(cell => cell.getAttribute('aria-sort'))\n\n /* A gutter cannot be sorted; claiming otherwise announces a control that is not there. */\n expect(sorts[0]).to.be.null\n expect(sorts[1], 'sorted descending').to.equal('descending')\n expect(sorts[2], 'sortable but not currently sorted').to.equal('none')\n })\n\n it('keeps the layout — a row wrapper that generates a box collapses the grid', async () => {\n const { body } = await grid()\n\n const rows = Array.from(body.renderRoot.querySelectorAll('[role=row]')) as HTMLElement[]\n const first = Array.from(rows[0].children) as HTMLElement[]\n\n expect(getComputedStyle(rows[0]).display).to.equal('contents')\n\n /* Cells step right; stacked at one x means the columns are gone. */\n const lefts = first.map(cell => cell.offsetLeft)\n expect(new Set(lefts).size, 'cells stacked at the same x').to.be.greaterThan(1)\n lefts.slice(1).forEach((left, index) => expect(left).to.be.greaterThan(lefts[index]))\n\n /* Rows step down. */\n const firstTop = (rows[0].children[0] as HTMLElement).offsetTop\n const secondTop = (rows[1].children[0] as HTMLElement).offsetTop\n expect(secondTop, 'two rows at the same y').to.be.greaterThan(firstTop)\n })\n})\n\n/**\n * Grouped headers.\n *\n * The header becomes two rows and ungrouped columns span both (`.span-both`). Placement runs\n * through CSS `grid-row` / `grid-column`, which makes this the riskiest spot for a row wrapper.\n */\ndescribe('grouped header spans two rows', () => {\n const columns = [\n { type: 'string', name: 'palletId', header: '파렛트 번호' },\n { type: 'string', name: 'width', header: { renderer: '폭', group: '치수' } },\n { type: 'string', name: 'height', header: { renderer: '높이', group: '치수' } }\n ].map(buildColumn)\n\n async function grouped() {\n const el: any = await fixture(html`\n <ox-grid\n .config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}\n .data=${{ total: 1, records: [{ palletId: 'P-0001', width: '1200', height: '900' }] }}\n ></ox-grid>\n `)\n\n await el.updateComplete\n\n const header = el.renderRoot.querySelector('ox-grid-header')\n const body = el.renderRoot.querySelector('ox-grid-body')\n\n await header.updateComplete\n await body.updateComplete\n\n return { el, header, body }\n }\n\n it('counts two header rows so the body starts at row 3', async () => {\n const { el, header, body } = await grouped()\n\n expect(header.renderRoot.querySelectorAll('[role=row]').length).to.equal(2)\n\n /* Two header rows plus one record. */\n expect(el.renderRoot.querySelector('[role=grid]').getAttribute('aria-rowcount')).to.equal('3')\n\n const rows = Array.from(body.renderRoot.querySelectorAll('[role=row]')) as HTMLElement[]\n expect(rows[0].getAttribute('aria-rowindex')).to.equal('3')\n })\n\n it('says how many columns a group covers', async () => {\n const { header } = await grouped()\n\n const cells = Array.from(header.renderRoot.querySelectorAll('[role=columnheader]')) as HTMLElement[]\n const first = cells[0]\n const group = cells.find(cell => cell.getAttribute('aria-colspan'))\n\n /* An ungrouped column spans both header rows. */\n expect(first.getAttribute('aria-rowspan')).to.equal('2')\n expect(first.getAttribute('aria-colindex')).to.equal('1')\n\n /* The group header covers columns 2 and 3. */\n expect(group, 'found no group header').to.exist\n expect(group!.getAttribute('aria-colindex')).to.equal('2')\n expect(group!.getAttribute('aria-colspan')).to.equal('2')\n })\n\n it('keeps two-row header placement — group sits above its leaf columns', async () => {\n const { header } = await grouped()\n\n const cells = Array.from(header.renderRoot.querySelectorAll('[role=columnheader]')) as HTMLElement[]\n const group = cells.find(cell => cell.getAttribute('aria-colspan'))!\n const leaf = cells.find(cell => !cell.getAttribute('aria-colspan') && cell !== cells[0])!\n\n expect(leaf.offsetTop, 'group header and its leaf column at the same height').to.be.greaterThan(group.offsetTop)\n expect(group.offsetWidth, 'group header does not cover two columns').to.be.greaterThan(leaf.offsetWidth)\n })\n})\n\n/**\n * The grid wrapper must not disturb the surrounding layout.\n *\n * `role=grid` admits only rows, so the settings-button slot and the pager moved outside the\n * wrapper. Two things then depend on this structure:\n *\n * ```\n * column layout the host is a flex column. The wrapper is itself a flex column (it is the one\n * scroller that header and body share), so the body still takes the height\n * left under the header\n * sibling selector \"show the settings button on header hover\" is an adjacent-sibling rule, so\n * the button has to sit directly after the wrapper\n * ```\n */\ndescribe('grid wrapper stays out of the layout', () => {\n const columns = [\n { type: 'string', name: 'palletId', header: '파렛트 번호' },\n { type: 'string', name: 'location', header: '보관 위치' }\n ].map(buildColumn)\n\n it('places the settings button after the grid, not inside it', async () => {\n const el: any = await fixture(html`\n <ox-grid\n .config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}\n .data=${{ total: 1, records: [{ palletId: 'P-0001', location: 'A-01' }] }}\n ></ox-grid>\n `)\n\n await el.updateComplete\n\n const grid = el.renderRoot.querySelector('[role=grid]') as HTMLElement\n const setting = el.renderRoot.querySelector('div[setting]') as HTMLElement\n\n expect(setting, 'no settings slot').to.exist\n expect(grid.contains(setting), 'settings button inside the grid breaks table reading').to.be.false\n expect(grid.nextElementSibling, 'adjacent-sibling rule no longer holds').to.equal(setting)\n })\n\n it('lays header and body out as a column that fills the host', async () => {\n const el: any = await fixture(html`\n <div style=\"height: 300px; display: flex\">\n <ox-grid\n style=\"flex: 1\"\n .config=${{ ...ZERO_CONFIG, columns, rows: { ...ZERO_CONFIG.rows } }}\n .data=${{ total: 1, records: [{ palletId: 'P-0001', location: 'A-01' }] }}\n ></ox-grid>\n </div>\n `)\n\n const grid = el.querySelector('ox-grid') as any\n await grid.updateComplete\n\n const wrapper = grid.renderRoot.querySelector('[role=grid]') as HTMLElement\n const header = grid.renderRoot.querySelector('ox-grid-header') as HTMLElement\n const body = grid.renderRoot.querySelector('ox-grid-body') as HTMLElement\n\n expect(getComputedStyle(wrapper).display).to.equal('flex')\n expect(getComputedStyle(wrapper).flexDirection).to.equal('column')\n\n /* The body takes the remaining height; a wrapper with a box shrinks it to header height. */\n expect(body.offsetHeight, 'body does not take the remaining height').to.be.greaterThan(100)\n expect(body.offsetTop, 'body is not below the header').to.be.greaterThan(0)\n expect(header.offsetTop).to.equal(0)\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
/**
|
|
3
|
+
* The summary row tags a column with its accumulator's name - `label.accumulator_${type}`.
|
|
4
|
+
*
|
|
5
|
+
* max and min were swapped in all five locales: a column summed with `max` (Math.max) was tagged
|
|
6
|
+
* "min" / 「최소」. The words are written out here per locale, so a swap in any one of them fails.
|
|
7
|
+
*/
|
|
8
|
+
const EXPECTED = {
|
|
9
|
+
en: { max: 'max', min: 'min' },
|
|
10
|
+
ko: { max: '최대', min: '최소' },
|
|
11
|
+
ja: { max: '最大', min: '最小' },
|
|
12
|
+
zh: { max: '最大', min: '最小' },
|
|
13
|
+
ms: { max: 'Maksimum', min: 'Minimum' }
|
|
14
|
+
};
|
|
15
|
+
async function translations(locale) {
|
|
16
|
+
const response = await fetch(new URL(`../../translations/${locale}.json`, import.meta.url));
|
|
17
|
+
expect(response.ok, `${locale}.json is served`).to.equal(true);
|
|
18
|
+
return response.json();
|
|
19
|
+
}
|
|
20
|
+
describe('accumulator labels', () => {
|
|
21
|
+
for (const [locale, words] of Object.entries(EXPECTED)) {
|
|
22
|
+
it(`${locale}: max is the largest, min the smallest`, async () => {
|
|
23
|
+
const t = await translations(locale);
|
|
24
|
+
expect(t['label.accumulator_max']).to.equal(words.max);
|
|
25
|
+
expect(t['label.accumulator_min']).to.equal(words.min);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
it('ko: count is 개수', async () => {
|
|
29
|
+
expect((await translations('ko'))['label.accumulator_count']).to.equal('개수');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=accumulator-labels.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accumulator-labels.test.js","sourceRoot":"","sources":["../../test/accumulator-labels.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC;;;;;GAKG;AAEH,MAAM,QAAQ,GAAiD;IAC7D,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE;IAC9B,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IAC5B,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IAC5B,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI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Content":["import { expect } from '@open-wc/testing'\n\n/**\n * The summary row tags a column with its accumulator's name - `label.accumulator_${type}`.\n *\n * max and min were swapped in all five locales: a column summed with `max` (Math.max) was tagged\n * \"min\" / 「최소」. The words are written out here per locale, so a swap in any one of them fails.\n */\n\nconst EXPECTED: Record<string, { max: string; min: string }> = {\n en: { max: 'max', min: 'min' },\n ko: { max: '최대', min: '최소' },\n ja: { max: '最大', min: '最小' },\n zh: { max: '最大', min: '最小' },\n ms: { max: 'Maksimum', min: 'Minimum' }\n}\n\nasync function translations(locale: string): Promise<Record<string, string>> {\n const response = await fetch(new URL(`../../translations/${locale}.json`, import.meta.url))\n expect(response.ok, `${locale}.json is served`).to.equal(true)\n return response.json()\n}\n\ndescribe('accumulator labels', () => {\n for (const [locale, words] of Object.entries(EXPECTED)) {\n it(`${locale}: max is the largest, min the smallest`, async () => {\n const t = await translations(locale)\n expect(t['label.accumulator_max']).to.equal(words.max)\n expect(t['label.accumulator_min']).to.equal(words.min)\n })\n }\n\n it('ko: count is 개수', async () => {\n expect((await translations('ko'))['label.accumulator_count']).to.equal('개수')\n })\n})\n"]}
|