@operato/data-grist 10.29.77 → 10.29.78

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.
Files changed (104) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/src/data-card/record-card.d.ts +4 -0
  3. package/dist/src/data-card/record-card.js +62 -20
  4. package/dist/src/data-card/record-card.js.map +1 -1
  5. package/dist/test/accessible-name.test.js +324 -0
  6. package/dist/test/accessible-name.test.js.map +1 -0
  7. package/dist/test/accumulator-labels.test.d.ts +1 -0
  8. package/dist/test/accumulator-labels.test.js +32 -0
  9. package/dist/test/accumulator-labels.test.js.map +1 -0
  10. package/dist/test/address-intents.test.js +201 -0
  11. package/dist/test/address-intents.test.js.map +1 -0
  12. package/dist/test/card-selector.test.js +71 -0
  13. package/dist/test/card-selector.test.js.map +1 -0
  14. package/dist/test/card-thumb.test.d.ts +1 -0
  15. package/dist/test/card-thumb.test.js +44 -0
  16. package/dist/test/card-thumb.test.js.map +1 -0
  17. package/dist/test/card-totals-narrow.test.js +103 -0
  18. package/dist/test/card-totals-narrow.test.js.map +1 -0
  19. package/dist/test/cell-button-row-height.test.js +53 -0
  20. package/dist/test/cell-button-row-height.test.js.map +1 -0
  21. package/dist/test/column-resize.test.js +153 -0
  22. package/dist/test/column-resize.test.js.map +1 -0
  23. package/dist/test/control-heights.test.js +25 -0
  24. package/dist/test/control-heights.test.js.map +1 -0
  25. package/dist/test/count-handler.test.js +56 -0
  26. package/dist/test/count-handler.test.js.map +1 -0
  27. package/dist/test/create-paste-policy.test.js +159 -0
  28. package/dist/test/create-paste-policy.test.js.map +1 -0
  29. package/dist/test/data-integrity.test.js +145 -0
  30. package/dist/test/data-integrity.test.js.map +1 -0
  31. package/dist/test/destructive-actions.test.js +147 -0
  32. package/dist/test/destructive-actions.test.js.map +1 -0
  33. package/dist/test/edit-lifecycle.test.js +270 -0
  34. package/dist/test/edit-lifecycle.test.js.map +1 -0
  35. package/dist/test/edit-rebase.test.js +185 -0
  36. package/dist/test/edit-rebase.test.js.map +1 -0
  37. package/dist/test/editor-commit.test.js +68 -0
  38. package/dist/test/editor-commit.test.js.map +1 -0
  39. package/dist/test/fetch-failure-state.test.js +129 -0
  40. package/dist/test/fetch-failure-state.test.js.map +1 -0
  41. package/dist/test/field-contains-content.test.js +101 -0
  42. package/dist/test/field-contains-content.test.js.map +1 -0
  43. package/dist/test/field-hint.test.js +54 -0
  44. package/dist/test/field-hint.test.js.map +1 -0
  45. package/dist/test/filter-labels.test.js +140 -0
  46. package/dist/test/filter-labels.test.js.map +1 -0
  47. package/dist/test/filter-ownership.test.js +83 -0
  48. package/dist/test/filter-ownership.test.js.map +1 -0
  49. package/dist/test/filter-select-buttons-count.test.js +35 -0
  50. package/dist/test/filter-select-buttons-count.test.js.map +1 -0
  51. package/dist/test/filter-typing.test.js +66 -0
  52. package/dist/test/filter-typing.test.js.map +1 -0
  53. package/dist/test/filters-phone-wrap.test.js +17 -0
  54. package/dist/test/filters-phone-wrap.test.js.map +1 -0
  55. package/dist/test/first-click-stays.test.js +77 -0
  56. package/dist/test/first-click-stays.test.js.map +1 -0
  57. package/dist/test/fixed-column-opaque.test.js +134 -0
  58. package/dist/test/fixed-column-opaque.test.js.map +1 -0
  59. package/dist/test/flexible-columns.test.js +134 -0
  60. package/dist/test/flexible-columns.test.js.map +1 -0
  61. package/dist/test/grid-single-scroller.test.js +107 -0
  62. package/dist/test/grid-single-scroller.test.js.map +1 -0
  63. package/dist/test/group-heading.test.js +208 -0
  64. package/dist/test/group-heading.test.js.map +1 -0
  65. package/dist/test/latest-fetch-wins.test.js +91 -0
  66. package/dist/test/latest-fetch-wins.test.js.map +1 -0
  67. package/dist/test/list-defaults.test.js +145 -0
  68. package/dist/test/list-defaults.test.js.map +1 -0
  69. package/dist/test/list-records.test.js +46 -0
  70. package/dist/test/list-records.test.js.map +1 -0
  71. package/dist/test/office-density.test.js +52 -0
  72. package/dist/test/office-density.test.js.map +1 -0
  73. package/dist/test/page-errors.d.ts +1 -0
  74. package/dist/test/page-errors.js +44 -0
  75. package/dist/test/page-errors.js.map +1 -0
  76. package/dist/test/paste-integrity.test.js +163 -0
  77. package/dist/test/paste-integrity.test.js.map +1 -0
  78. package/dist/test/record-card-height.test.js +15 -0
  79. package/dist/test/record-card-height.test.js.map +1 -0
  80. package/dist/test/record-view-popup-editor.test.js +71 -0
  81. package/dist/test/record-view-popup-editor.test.js.map +1 -0
  82. package/dist/test/renderer-date-calendar-day.test.js +48 -0
  83. package/dist/test/renderer-date-calendar-day.test.js.map +1 -0
  84. package/dist/test/request-generation.test.js +153 -0
  85. package/dist/test/request-generation.test.js.map +1 -0
  86. package/dist/test/resubmit.test.js +83 -0
  87. package/dist/test/resubmit.test.js.map +1 -0
  88. package/dist/test/row-hover-visible.test.js +139 -0
  89. package/dist/test/row-hover-visible.test.js.map +1 -0
  90. package/dist/test/search-term.test.js +108 -0
  91. package/dist/test/search-term.test.js.map +1 -0
  92. package/dist/test/searchable-select.test.js +65 -0
  93. package/dist/test/searchable-select.test.js.map +1 -0
  94. package/dist/test/select-empty-value.test.js +61 -0
  95. package/dist/test/select-empty-value.test.js.map +1 -0
  96. package/dist/test/shift-range-select.test.js +100 -0
  97. package/dist/test/shift-range-select.test.js.map +1 -0
  98. package/dist/test/sparkline-renderer.test.js +36 -0
  99. package/dist/test/sparkline-renderer.test.js.map +1 -0
  100. package/dist/test/wheel-one-scroller.test.js +275 -0
  101. package/dist/test/wheel-one-scroller.test.js.map +1 -0
  102. package/dist/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +2 -2
  104. package/test/card-selector.test.ts +18 -4
@@ -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+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CAAC,CAAA;QAC3F,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;QAC3E,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,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,EAAE,GAAG,EAAE,IAAI,EAAE;IAC5B,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE;CACxC,CAAA;AAED,KAAK,UAAU,YAAY,CAAC,MAAc;IACxC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,sBAAsB,MAAM,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IAC3F,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9D,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;AACxB,CAAC;AAED,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvD,EAAE,CAAC,GAAG,MAAM,wCAAwC,EAAE,KAAK,IAAI,EAAE;YAC/D,MAAM,CAAC,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAA;YACpC,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACtD,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,CAAC,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["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"]}
@@ -0,0 +1,201 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import { addressController, writeAddress } from '@operato/utils/address.js';
4
+ import { decodeListQuery, encodeListQuery } from '@operato/utils/list-query.js';
5
+ import '../src/data-grist.js';
6
+ const turn = () => new Promise(resolve => setTimeout(resolve, 0));
7
+ const native = () => window.navigation;
8
+ const filters = (month) => [{ name: 'month', operator: 'eq', value: month }];
9
+ const address = (month) => `?${encodeListQuery({ filters: filters(month) })}`;
10
+ async function until(check) {
11
+ for (let i = 0; i < 200; i++) {
12
+ if (check())
13
+ return;
14
+ await new Promise(resolve => setTimeout(resolve, 5));
15
+ }
16
+ throw new Error('intent sequence did not settle');
17
+ }
18
+ /** Product oracle: only the latest accepted intent changes the query, records, edits or history. */
19
+ class Intended {
20
+ constructor() {
21
+ this.entries = [10];
22
+ this.cursor = 0;
23
+ this.edited = false;
24
+ this.reads = [10];
25
+ }
26
+ get month() {
27
+ return this.entries[this.cursor];
28
+ }
29
+ accept(month) {
30
+ if (month === this.month)
31
+ return;
32
+ this.entries.splice(++this.cursor);
33
+ this.entries.push(month);
34
+ this.edited = false;
35
+ this.reads.push(month);
36
+ }
37
+ back() {
38
+ this.cursor--;
39
+ this.edited = false;
40
+ this.reads.push(this.month);
41
+ }
42
+ }
43
+ describe('overlapping user intents against query and displayed state', () => {
44
+ let previousOnError;
45
+ const resizeNotice = (event) => {
46
+ if (event.message.includes('ResizeObserver loop')) {
47
+ event.preventDefault();
48
+ event.stopImmediatePropagation();
49
+ }
50
+ };
51
+ before(() => {
52
+ window.addEventListener('error', resizeNotice, true);
53
+ previousOnError = window.onerror;
54
+ window.onerror = (message, ...rest) => String(message).includes('ResizeObserver loop') ? true : previousOnError === null || previousOnError === void 0 ? void 0 : previousOnError.call(window, message, ...rest);
55
+ });
56
+ after(() => {
57
+ window.removeEventListener('error', resizeNotice, true);
58
+ window.onerror = previousOnError;
59
+ });
60
+ it('checks every edit, question, refusal, supersession, adoption and browser traversal', async () => {
61
+ const controller = addressController();
62
+ controller.registerQuery();
63
+ const coverage = new Set();
64
+ for (let seed = 1; seed <= 12; seed++) {
65
+ await writeAddress(address(10));
66
+ const floorKey = native().currentEntry.key;
67
+ const reads = [];
68
+ let shown = [];
69
+ const grist = await fixture(html `<ox-grist
70
+ style="display:block;width:800px;height:400px"
71
+ .urlParamsSensitive=${true}
72
+ .config=${{ columns: [{ name: 'month', header: 'month' }], pagination: { limit: 20 } }}
73
+ .fetchHandler=${async ({ filters: list }) => {
74
+ const month = Number(list.find((filter) => filter.name === 'month').value);
75
+ reads.push(month);
76
+ return { records: [{ id: String(month), month }], total: 1 };
77
+ }}
78
+ @list-adopted=${(event) => {
79
+ shown = event.detail.records.map((row) => row.month);
80
+ }}
81
+ ></ox-grist>`);
82
+ await until(() => { var _a, _b, _c; return ((_c = (_b = (_a = grist.data) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.month) === 10; });
83
+ const expected = new Intended();
84
+ // Initial configuration may make the initial read once or more; subsequent intent reads must match exactly.
85
+ reads.splice(0, reads.length, 10);
86
+ let decision;
87
+ let gated = false;
88
+ const stopGuard = controller.guard({
89
+ discards: () => grist.dirtyRecords.length > 0,
90
+ approve: change => {
91
+ if (!grist.dirtyRecords.length)
92
+ return true;
93
+ return new Promise(resolve => {
94
+ const endQuestion = gated ? controller.beginQuestion() : () => { };
95
+ const finish = (answer) => {
96
+ endQuestion();
97
+ resolve(answer);
98
+ };
99
+ decision = finish;
100
+ change.signal.addEventListener('abort', () => finish(false), { once: true });
101
+ });
102
+ },
103
+ committed: () => grist.reset()
104
+ });
105
+ const verify = async (step) => {
106
+ await turn();
107
+ await grist.updateComplete;
108
+ expect(grist.filters, step).to.deep.equal(filters(expected.month));
109
+ expect(grist.data.records.map(row => row.month), step).to.deep.equal([expected.month]);
110
+ expect(shown, step).to.deep.equal([expected.month]);
111
+ expect(grist.dirtyRecords.length > 0, step).to.equal(expected.edited);
112
+ expect(reads, step).to.deep.equal(expected.reads);
113
+ const entries = native().entries();
114
+ const floor = entries.findIndex((entry) => entry.key === floorKey);
115
+ expect(floor, step).to.be.at.least(0);
116
+ expect(entries
117
+ .slice(floor)
118
+ .map((entry) => decodeListQuery(new URL(entry.url).search).filters[0].value), step).to.deep.equal(expected.entries);
119
+ expect(native().currentEntry.index - floor, step).to.equal(expected.cursor);
120
+ };
121
+ let random = seed;
122
+ try {
123
+ for (let step = 0; step < 18; step++) {
124
+ random = (Math.imul(random, 1664525) + 1013904223) >>> 0;
125
+ const action = random % 5;
126
+ coverage.add(action);
127
+ const label = `seed ${seed}, step ${step}, action ${action}`;
128
+ const next = 20 + seed * 100 + step;
129
+ // Real grid edit, independent of the oracle's edit flag.
130
+ grist.dirtyData.records[0].__dirty__ = 'M';
131
+ grist.dirtyData.records[0].memo = label;
132
+ grist.refresh();
133
+ expected.edited = true;
134
+ await verify(label + ' edited');
135
+ decision = undefined;
136
+ gated = action !== 2 && action !== 4;
137
+ const first = writeAddress(address(next));
138
+ await turn();
139
+ await verify(label + ' before decision');
140
+ await until(() => !!decision);
141
+ const answerFirst = decision;
142
+ await verify(label + ' question pending');
143
+ if (action === 0) {
144
+ answerFirst(false);
145
+ expect(await first, label).to.equal(false);
146
+ }
147
+ else if (action === 1) {
148
+ // Requests made under a real modal question are rejected without fetching or changing the view.
149
+ expect(await writeAddress(address(next + 10000)), label).to.equal(false);
150
+ await verify(label + ' outside request refused');
151
+ answerFirst(true);
152
+ expect(await first, label).to.equal(true);
153
+ expected.accept(next);
154
+ }
155
+ else if (action === 2) {
156
+ // An asynchronous owner decision can be superseded before a dialog is installed.
157
+ decision = undefined;
158
+ const second = writeAddress(address(next + 10000));
159
+ await until(() => !!decision);
160
+ decision(true);
161
+ expect(await second, label).to.equal(true);
162
+ expected.accept(next + 10000);
163
+ answerFirst(true);
164
+ expect(await first, label).to.equal(false);
165
+ }
166
+ else if (action === 3) {
167
+ answerFirst(true);
168
+ expect(await first, label).to.equal(true);
169
+ expected.accept(next);
170
+ }
171
+ else {
172
+ if (expected.cursor > 0) {
173
+ // Browser navigation aborts the outstanding application approval; an old yes cannot revive it.
174
+ decision = undefined;
175
+ const movement = native().back();
176
+ movement.finished.catch(() => { });
177
+ await until(() => !!decision);
178
+ decision(true);
179
+ await movement.finished;
180
+ expected.back();
181
+ answerFirst(true);
182
+ expect(await first, label).to.equal(false);
183
+ }
184
+ else {
185
+ answerFirst(false);
186
+ expect(await first, label).to.equal(false);
187
+ }
188
+ }
189
+ await until(() => { var _a; return ((_a = grist.data.records[0]) === null || _a === void 0 ? void 0 : _a.month) === expected.month; });
190
+ await verify(label + ' completed');
191
+ }
192
+ }
193
+ finally {
194
+ stopGuard();
195
+ grist.remove();
196
+ }
197
+ }
198
+ expect([...coverage].sort()).to.deep.equal([0, 1, 2, 3, 4]);
199
+ }).timeout(45000);
200
+ });
201
+ //# sourceMappingURL=address-intents.test.js.map
@@ -0,0 +1 @@
1
+ {"version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,EAAE,CAAC,CAAC,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\nimport { addressController, writeAddress } from '@operato/utils/address.js'\nimport { decodeListQuery, encodeListQuery } from '@operato/utils/list-query.js'\nimport type { DataGrist } from '../src/data-grist.js'\nimport '../src/data-grist.js'\n\nconst turn = () => new Promise(resolve => setTimeout(resolve, 0))\nconst native = () => (window as any).navigation\nconst filters = (month: number) => [{ name: 'month', operator: 'eq', value: month }]\nconst address = (month: number) => `?${encodeListQuery({ filters: filters(month) })}`\nasync function until(check: () => boolean) {\n for (let i = 0; i < 200; i++) {\n if (check()) return\n await new Promise(resolve => setTimeout(resolve, 5))\n }\n throw new Error('intent sequence did not settle')\n}\n\n/** Product oracle: only the latest accepted intent changes the query, records, edits or history. */\nclass Intended {\n entries: number[] = [10]\n cursor = 0\n edited = false\n reads = [10]\n get month() {\n return this.entries[this.cursor]\n }\n accept(month: number) {\n if (month === this.month) return\n this.entries.splice(++this.cursor)\n this.entries.push(month)\n this.edited = false\n this.reads.push(month)\n }\n back() {\n this.cursor--\n this.edited = false\n this.reads.push(this.month)\n }\n}\n\ndescribe('overlapping user intents against query and displayed state', () => {\n let previousOnError: typeof window.onerror\n const resizeNotice = (event: ErrorEvent) => {\n if (event.message.includes('ResizeObserver loop')) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n }\n before(() => {\n window.addEventListener('error', resizeNotice, true)\n previousOnError = window.onerror\n window.onerror = (message, ...rest) =>\n String(message).includes('ResizeObserver loop') ? true : previousOnError?.call(window, message, ...rest)\n })\n after(() => {\n window.removeEventListener('error', resizeNotice, true)\n window.onerror = previousOnError\n })\n it('checks every edit, question, refusal, supersession, adoption and browser traversal', async () => {\n const controller = addressController()\n controller.registerQuery()\n const coverage = new Set<number>()\n for (let seed = 1; seed <= 12; seed++) {\n await writeAddress(address(10))\n const floorKey = native().currentEntry.key\n const reads: number[] = []\n let shown: number[] = []\n const grist = await fixture<DataGrist>(\n html`<ox-grist\n style=\"display:block;width:800px;height:400px\"\n .urlParamsSensitive=${true}\n .config=${{ columns: [{ name: 'month', header: 'month' }], pagination: { limit: 20 } }}\n .fetchHandler=${async ({ filters: list }: any) => {\n const month = Number(list.find((filter: any) => filter.name === 'month').value)\n reads.push(month)\n return { records: [{ id: String(month), month }], total: 1 }\n }}\n @list-adopted=${(event: CustomEvent) => {\n shown = event.detail.records.map((row: any) => row.month)\n }}\n ></ox-grist>`\n )\n await until(() => grist.data?.records?.[0]?.month === 10)\n const expected = new Intended()\n // Initial configuration may make the initial read once or more; subsequent intent reads must match exactly.\n reads.splice(0, reads.length, 10)\n let decision: ((answer: boolean) => void) | undefined\n let gated = false\n const stopGuard = controller.guard({\n discards: () => grist.dirtyRecords.length > 0,\n approve: change => {\n if (!grist.dirtyRecords.length) return true\n return new Promise<boolean>(resolve => {\n const endQuestion = gated ? controller.beginQuestion() : () => {}\n const finish = (answer: boolean) => {\n endQuestion()\n resolve(answer)\n }\n decision = finish\n change.signal.addEventListener('abort', () => finish(false), { once: true })\n })\n },\n committed: () => grist.reset()\n })\n const verify = async (step: string) => {\n await turn()\n await grist.updateComplete\n expect(grist.filters, step).to.deep.equal(filters(expected.month))\n expect(\n grist.data.records.map(row => row.month),\n step\n ).to.deep.equal([expected.month])\n expect(shown, step).to.deep.equal([expected.month])\n expect(grist.dirtyRecords.length > 0, step).to.equal(expected.edited)\n expect(reads, step).to.deep.equal(expected.reads)\n const entries = native().entries()\n const floor = entries.findIndex((entry: any) => entry.key === floorKey)\n expect(floor, step).to.be.at.least(0)\n expect(\n entries\n .slice(floor)\n .map((entry: any) => (decodeListQuery(new URL(entry.url).search).filters as any[])[0].value),\n step\n ).to.deep.equal(expected.entries)\n expect(native().currentEntry.index - floor, step).to.equal(expected.cursor)\n }\n let random = seed\n try {\n for (let step = 0; step < 18; step++) {\n random = (Math.imul(random, 1664525) + 1013904223) >>> 0\n const action = random % 5\n coverage.add(action)\n const label = `seed ${seed}, step ${step}, action ${action}`\n const next = 20 + seed * 100 + step\n // Real grid edit, independent of the oracle's edit flag.\n grist.dirtyData.records[0].__dirty__ = 'M'\n grist.dirtyData.records[0].memo = label\n grist.refresh()\n expected.edited = true\n await verify(label + ' edited')\n decision = undefined\n gated = action !== 2 && action !== 4\n const first = writeAddress(address(next))\n await turn()\n await verify(label + ' before decision')\n await until(() => !!decision)\n const answerFirst = decision!\n await verify(label + ' question pending')\n if (action === 0) {\n answerFirst(false)\n expect(await first, label).to.equal(false)\n } else if (action === 1) {\n // Requests made under a real modal question are rejected without fetching or changing the view.\n expect(await writeAddress(address(next + 10000)), label).to.equal(false)\n await verify(label + ' outside request refused')\n answerFirst(true)\n expect(await first, label).to.equal(true)\n expected.accept(next)\n } else if (action === 2) {\n // An asynchronous owner decision can be superseded before a dialog is installed.\n decision = undefined\n const second = writeAddress(address(next + 10000))\n await until(() => !!decision)\n decision!(true)\n expect(await second, label).to.equal(true)\n expected.accept(next + 10000)\n answerFirst(true)\n expect(await first, label).to.equal(false)\n } else if (action === 3) {\n answerFirst(true)\n expect(await first, label).to.equal(true)\n expected.accept(next)\n } else {\n if (expected.cursor > 0) {\n // Browser navigation aborts the outstanding application approval; an old yes cannot revive it.\n decision = undefined\n const movement = native().back()\n movement.finished.catch(() => {})\n await until(() => !!decision)\n decision!(true)\n await movement.finished\n expected.back()\n answerFirst(true)\n expect(await first, label).to.equal(false)\n } else {\n answerFirst(false)\n expect(await first, label).to.equal(false)\n }\n }\n await until(() => grist.data.records[0]?.month === expected.month)\n await verify(label + ' completed')\n }\n } finally {\n stopGuard()\n grist.remove()\n }\n }\n expect([...coverage].sort()).to.deep.equal([0, 1, 2, 3, 4])\n }).timeout(45000)\n})\n"]}
@@ -0,0 +1,71 @@
1
+ /* Elements are compared by presence, not by value: a failing element comparison makes chai render the DOM and hang the runner. */
2
+ import { expect, fixture } from '@open-wc/testing';
3
+ import { html } from 'lit';
4
+ import '../src/data-grist.js';
5
+ import { failOnPageErrors } from './page-errors.js';
6
+ /*
7
+ * A card's checkbox stands beside the title. It sat in the action row under the text, a line of its own far from
8
+ * what it selects (Office ledgers on a phone, 2026-11-05).
9
+ */
10
+ const records = [{ id: '1', title: 'one', amount: 990000 }];
11
+ const config = (gutters) => ({
12
+ columns: [
13
+ ...gutters,
14
+ { type: 'string', name: 'title', header: 'title' },
15
+ { type: 'integer', name: 'amount', header: 'amount' }
16
+ ],
17
+ rows: { appendable: false, selectable: { multiple: true } },
18
+ list: { fields: ['title'], details: ['amount'] }
19
+ });
20
+ const idle = async (el) => {
21
+ while (!((await el.updateComplete) && (await el.grist.updateComplete)))
22
+ ;
23
+ };
24
+ const cardOf = async (gutters) => {
25
+ const el = await fixture(html `<ox-grist style="width:340px;height:300px" mode="CARD" .config=${config(gutters)} .data=${{ records }}></ox-grist>`);
26
+ await idle(el);
27
+ const card = el.grist.renderRoot.querySelector('ox-record-card');
28
+ await card.updateComplete;
29
+ /* The icons draw after the card, and the card makes room for them when they do. */
30
+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
31
+ return card;
32
+ };
33
+ describe('a card and its checkbox', () => {
34
+ failOnPageErrors();
35
+ it('stands in the top-right corner, on the title line, and takes no row of its own', async () => {
36
+ const card = await cardOf([{ type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true }]);
37
+ const box = card.renderRoot.querySelector('ox-card-gutter');
38
+ const title = card.renderRoot.querySelector('ox-card-field[name]');
39
+ const detail = card.renderRoot.querySelector('[detail]');
40
+ expect(box, 'no checkbox').to.exist;
41
+ const cardBox = card.getBoundingClientRect();
42
+ const boxRect = box.getBoundingClientRect();
43
+ const titleRect = title.getBoundingClientRect();
44
+ expect(boxRect.top, 'the checkbox is not on the title line').to.be.below(titleRect.bottom);
45
+ expect(cardBox.right - boxRect.right, 'the checkbox is not at the right edge').to.be.below(16);
46
+ expect(titleRect.right, 'the title runs under the checkbox').to.be.at.most(boxRect.left);
47
+ expect(cardBox.bottom - detail.getBoundingClientRect().bottom, 'the card keeps a row under its text').to.be.below(16);
48
+ expect(card.renderRoot.querySelector('[gutters]'), 'an empty action row').to.equal(null);
49
+ });
50
+ /* The edit icon took a row of its own under the text, the column under the checkbox empty (2026-11-10). */
51
+ it('stands the other actions under the checkbox, and takes no row under the text', async () => {
52
+ const card = await cardOf([
53
+ { type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true },
54
+ { type: 'gutter', gutterName: 'button', icon: 'edit', forList: true }
55
+ ]);
56
+ const [box, edit] = Array.from(card.renderRoot.querySelectorAll('ox-card-gutter'));
57
+ const title = card.renderRoot.querySelector('ox-card-field[name]');
58
+ const detail = card.renderRoot.querySelector('[detail]');
59
+ expect(edit, 'no edit icon').to.exist;
60
+ const cardBox = card.getBoundingClientRect();
61
+ const boxRect = box.getBoundingClientRect();
62
+ const editRect = edit.getBoundingClientRect();
63
+ expect(editRect.top, 'the edit icon is not under the checkbox').to.be.at.least(boxRect.bottom - 1);
64
+ expect(editRect.top - boxRect.bottom, 'the edit icon stands far from the checkbox').to.be.below(12);
65
+ expect(Math.abs((editRect.left + editRect.right) / 2 - (boxRect.left + boxRect.right) / 2), 'not one column').to.be.below(2);
66
+ expect(title.getBoundingClientRect().right, 'the title runs under the icons').to.be.at.most(editRect.left);
67
+ expect(editRect.bottom, 'the edit icon hangs out of the card').to.be.at.most(cardBox.bottom);
68
+ expect(cardBox.bottom - Math.max(detail.getBoundingClientRect().bottom, editRect.bottom), 'a row left under the text').to.be.below(16);
69
+ });
70
+ });
71
+ //# sourceMappingURL=card-selector.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-selector.test.js","sourceRoot":"","sources":["../../test/card-selector.test.ts"],"names":[],"mappings":"AAAA,kIAAkI;AAClI,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,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E,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACxI,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["/* Elements are compared by presence, not by value: a failing element comparison makes chai render the DOM and hang the runner. */\nimport { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/data-grist.js'\nimport { DataGrist } from '../src/data-grist.js'\nimport { failOnPageErrors } from './page-errors.js'\n\n/*\n * A card's checkbox stands beside the title. It sat in the action row under the text, a line of its own far from\n * what it selects (Office ledgers on a phone, 2026-11-05).\n */\n\nconst records = [{ id: '1', title: 'one', amount: 990000 }]\nconst config = (gutters: any[]) => ({\n columns: [\n ...gutters,\n { type: 'string', name: 'title', header: 'title' },\n { type: 'integer', name: 'amount', header: 'amount' }\n ],\n rows: { appendable: false, selectable: { multiple: true } },\n list: { fields: ['title'], details: ['amount'] }\n})\n\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n}\n\nconst cardOf = async (gutters: any[]) => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"width:340px;height:300px\" mode=\"CARD\" .config=${config(gutters)} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const card = el.grist.renderRoot.querySelector('ox-record-card') as any\n await card.updateComplete\n /* The icons draw after the card, and the card makes room for them when they do. */\n await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))\n return card as HTMLElement & { renderRoot: ShadowRoot }\n}\n\ndescribe('a card and its checkbox', () => {\n failOnPageErrors()\n\n it('stands in the top-right corner, on the title line, and takes no row of its own', async () => {\n const card = await cardOf([{ type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true }])\n const box = card.renderRoot.querySelector('ox-card-gutter') as HTMLElement\n const title = card.renderRoot.querySelector('ox-card-field[name]') as HTMLElement\n const detail = card.renderRoot.querySelector('[detail]') as HTMLElement\n expect(box, 'no checkbox').to.exist\n\n const cardBox = card.getBoundingClientRect()\n const boxRect = box.getBoundingClientRect()\n const titleRect = title.getBoundingClientRect()\n expect(boxRect.top, 'the checkbox is not on the title line').to.be.below(titleRect.bottom)\n expect(cardBox.right - boxRect.right, 'the checkbox is not at the right edge').to.be.below(16)\n expect(titleRect.right, 'the title runs under the checkbox').to.be.at.most(boxRect.left)\n expect(cardBox.bottom - detail.getBoundingClientRect().bottom, 'the card keeps a row under its text').to.be.below(16)\n expect(card.renderRoot.querySelector('[gutters]'), 'an empty action row').to.equal(null)\n })\n\n /* The edit icon took a row of its own under the text, the column under the checkbox empty (2026-11-10). */\n it('stands the other actions under the checkbox, and takes no row under the text', async () => {\n const card = await cardOf([\n { type: 'gutter', gutterName: 'row-selector', multiple: true, forList: true },\n { type: 'gutter', gutterName: 'button', icon: 'edit', forList: true }\n ])\n const [box, edit] = Array.from(card.renderRoot.querySelectorAll('ox-card-gutter')) as HTMLElement[]\n const title = card.renderRoot.querySelector('ox-card-field[name]') as HTMLElement\n const detail = card.renderRoot.querySelector('[detail]') as HTMLElement\n expect(edit, 'no edit icon').to.exist\n\n const cardBox = card.getBoundingClientRect()\n const boxRect = box.getBoundingClientRect()\n const editRect = edit.getBoundingClientRect()\n expect(editRect.top, 'the edit icon is not under the checkbox').to.be.at.least(boxRect.bottom - 1)\n expect(editRect.top - boxRect.bottom, 'the edit icon stands far from the checkbox').to.be.below(12)\n expect(Math.abs((editRect.left + editRect.right) / 2 - (boxRect.left + boxRect.right) / 2), 'not one column').to.be.below(2)\n expect(title.getBoundingClientRect().right, 'the title runs under the icons').to.be.at.most(editRect.left)\n expect(editRect.bottom, 'the edit icon hangs out of the card').to.be.at.most(cardBox.bottom)\n expect(cardBox.bottom - Math.max(detail.getBoundingClientRect().bottom, editRect.bottom), 'a row left under the text').to.be.below(16)\n })\n})\n"]}
@@ -0,0 +1 @@
1
+ import '../src/data-card/ox-card-thumb.js';
@@ -0,0 +1,44 @@
1
+ import { expect, fixture, html } from '@open-wc/testing';
2
+ import '../src/data-card/ox-card-thumb.js';
3
+ /*
4
+ * The one picture cell of a catalog card (ADR-0117 amendment 2026-10-13): the picture whole, an icon when there is
5
+ * none, at most one marker in the top-left corner, and a seam under it.
6
+ */
7
+ describe('ox-card-thumb', () => {
8
+ it('★ shows the picture whole, never cropped, with a seam under it', async () => {
9
+ const thumb = await fixture(html `<ox-card-thumb
10
+ style="--md-sys-color-outline-variant: rgb(200, 200, 200)"
11
+ src="data:image/gif;base64,R0lGODlhAQABAAAAACw="
12
+ alt="a board"
13
+ ></ox-card-thumb>`);
14
+ const img = thumb.shadowRoot.querySelector('img');
15
+ expect(img.getAttribute('alt')).to.equal('a board');
16
+ expect(getComputedStyle(img).objectFit).to.equal('contain');
17
+ expect(getComputedStyle(thumb).borderBottomStyle).to.equal('solid');
18
+ expect(thumb.shadowRoot.querySelector('[empty]')).to.equal(null);
19
+ });
20
+ it('★ draws its icon when there is no picture, or the empty slot when one is given', async () => {
21
+ const bare = await fixture(html `<ox-card-thumb icon="dashboard"></ox-card-thumb>`);
22
+ expect(bare.shadowRoot.querySelector('[empty] md-icon').textContent).to.equal('dashboard');
23
+ const marked = await fixture(html `<ox-card-thumb><span slot="empty" id="mark">no picture</span></ox-card-thumb>`);
24
+ const slot = marked.shadowRoot.querySelector('slot[name="empty"]');
25
+ expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['mark']);
26
+ });
27
+ it('★ says one thing in the corner, in its tone, and nothing when there is nothing to say', async () => {
28
+ const quiet = await fixture(html `<ox-card-thumb></ox-card-thumb>`);
29
+ expect(quiet.shadowRoot.querySelector('[badge]')).to.equal(null);
30
+ const warned = await fixture(html `<ox-card-thumb badge="not latest" tone="warn"></ox-card-thumb>`);
31
+ const badge = warned.shadowRoot.querySelector('[badge]');
32
+ expect(badge.textContent).to.equal('not latest');
33
+ expect(badge.getAttribute('tone')).to.equal('warn');
34
+ expect(getComputedStyle(badge).position).to.equal('absolute');
35
+ expect(getComputedStyle(badge).top).to.equal('6px');
36
+ expect(getComputedStyle(badge).left).to.equal('6px');
37
+ });
38
+ it('lays the default slot over the picture for an action that belongs to it', async () => {
39
+ const thumb = await fixture(html `<ox-card-thumb><button id="del">x</button></ox-card-thumb>`);
40
+ const slot = thumb.shadowRoot.querySelector('slot:not([name])');
41
+ expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['del']);
42
+ });
43
+ });
44
+ //# sourceMappingURL=card-thumb.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-thumb.test.js","sourceRoot":"","sources":["../../test/card-thumb.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAExD,OAAO,mCAAmC,CAAA;AAG1C;;;GAGG;AACH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,KAAK,GAAG,MAAM,OAAO,CAAc,IAAI,CAAA;;;;wBAIzB,CAAC,CAAA;QACrB,MAAM,GAAG,GAAG,KAAK,CAAC,UAAW,CAAC,aAAa,CAAC,KAAK,CAAE,CAAA;QACnD,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QACnD,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC3D,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACnE,MAAM,CAAC,KAAK,CAAC,UAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACnE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gFAAgF,EAAE,KAAK,IAAI,EAAE;QAC9F,MAAM,IAA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CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QAC7D,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yEAAyE,EAAE,KAAK,IAAI,EAAE;QACvF,MAAM,KAAK,GAAG,MAAM,OAAO,CAAc,IAAI,CAAA,4DAA4D,CAAC,CAAA;QAC1G,MAAM,IAAI,GAAG,KAAK,CAAC,UAAW,CAAC,aAAa,CAAC,kBAAkB,CAAoB,CAAA;QACnF,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture, html } from '@open-wc/testing'\n\nimport '../src/data-card/ox-card-thumb.js'\nimport type { OxCardThumb } from '../src/data-card/ox-card-thumb.js'\n\n/*\n * The one picture cell of a catalog card (ADR-0117 amendment 2026-10-13): the picture whole, an icon when there is\n * none, at most one marker in the top-left corner, and a seam under it.\n */\ndescribe('ox-card-thumb', () => {\n it('★ shows the picture whole, never cropped, with a seam under it', async () => {\n const thumb = await fixture<OxCardThumb>(html`<ox-card-thumb\n style=\"--md-sys-color-outline-variant: rgb(200, 200, 200)\"\n src=\"data:image/gif;base64,R0lGODlhAQABAAAAACw=\"\n alt=\"a board\"\n ></ox-card-thumb>`)\n const img = thumb.shadowRoot!.querySelector('img')!\n expect(img.getAttribute('alt')).to.equal('a board')\n expect(getComputedStyle(img).objectFit).to.equal('contain')\n expect(getComputedStyle(thumb).borderBottomStyle).to.equal('solid')\n expect(thumb.shadowRoot!.querySelector('[empty]')).to.equal(null)\n })\n\n it('★ draws its icon when there is no picture, or the empty slot when one is given', async () => {\n const bare = await fixture<OxCardThumb>(html`<ox-card-thumb icon=\"dashboard\"></ox-card-thumb>`)\n expect(bare.shadowRoot!.querySelector('[empty] md-icon')!.textContent).to.equal('dashboard')\n\n const marked = await fixture<OxCardThumb>(html`<ox-card-thumb><span slot=\"empty\" id=\"mark\">no picture</span></ox-card-thumb>`)\n const slot = marked.shadowRoot!.querySelector('slot[name=\"empty\"]') as HTMLSlotElement\n expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['mark'])\n })\n\n it('★ says one thing in the corner, in its tone, and nothing when there is nothing to say', async () => {\n const quiet = await fixture<OxCardThumb>(html`<ox-card-thumb></ox-card-thumb>`)\n expect(quiet.shadowRoot!.querySelector('[badge]')).to.equal(null)\n\n const warned = await fixture<OxCardThumb>(html`<ox-card-thumb badge=\"not latest\" tone=\"warn\"></ox-card-thumb>`)\n const badge = warned.shadowRoot!.querySelector('[badge]') as HTMLElement\n expect(badge.textContent).to.equal('not latest')\n expect(badge.getAttribute('tone')).to.equal('warn')\n expect(getComputedStyle(badge).position).to.equal('absolute')\n expect(getComputedStyle(badge).top).to.equal('6px')\n expect(getComputedStyle(badge).left).to.equal('6px')\n })\n\n it('lays the default slot over the picture for an action that belongs to it', async () => {\n const thumb = await fixture<OxCardThumb>(html`<ox-card-thumb><button id=\"del\">x</button></ox-card-thumb>`)\n const slot = thumb.shadowRoot!.querySelector('slot:not([name])') as HTMLSlotElement\n expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['del'])\n })\n})\n"]}