@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.
Files changed (150) hide show
  1. package/CHANGELOG.md +26 -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/src/editors/ox-grist-editor-date.d.ts +2 -0
  6. package/dist/src/editors/ox-grist-editor-date.js +3 -8
  7. package/dist/src/editors/ox-grist-editor-date.js.map +1 -1
  8. package/dist/src/editors/ox-grist-editor-month.d.ts +2 -0
  9. package/dist/src/editors/ox-grist-editor-month.js +3 -1
  10. package/dist/src/editors/ox-grist-editor-month.js.map +1 -1
  11. package/dist/src/editors/ox-grist-editor-week.d.ts +2 -0
  12. package/dist/src/editors/ox-grist-editor-week.js +3 -1
  13. package/dist/src/editors/ox-grist-editor-week.js.map +1 -1
  14. package/dist/src/editors/ox-grist-editor.js +2 -1
  15. package/dist/src/editors/ox-grist-editor.js.map +1 -1
  16. package/dist/src/filters/filter-input.d.ts +1 -0
  17. package/dist/src/filters/filter-input.js +20 -0
  18. package/dist/src/filters/filter-input.js.map +1 -1
  19. package/dist/src/filters/filter-range-date.d.ts +7 -0
  20. package/dist/src/filters/filter-range-date.js +53 -0
  21. package/dist/src/filters/filter-range-date.js.map +1 -1
  22. package/dist/src/filters/filter-select-buttons.js +7 -0
  23. package/dist/src/filters/filter-select-buttons.js.map +1 -1
  24. package/dist/src/filters/filter-styles.js +8 -2
  25. package/dist/src/filters/filter-styles.js.map +1 -1
  26. package/dist/src/filters/filters-form.js +38 -14
  27. package/dist/src/filters/filters-form.js.map +1 -1
  28. package/dist/src/filters/pill-choice.d.ts +24 -0
  29. package/dist/src/filters/pill-choice.js +63 -0
  30. package/dist/src/filters/pill-choice.js.map +1 -0
  31. package/dist/test/accessible-name.test.js +324 -0
  32. package/dist/test/accessible-name.test.js.map +1 -0
  33. package/dist/test/accumulator-labels.test.d.ts +1 -0
  34. package/dist/test/accumulator-labels.test.js +32 -0
  35. package/dist/test/accumulator-labels.test.js.map +1 -0
  36. package/dist/test/address-intents.test.js +201 -0
  37. package/dist/test/address-intents.test.js.map +1 -0
  38. package/dist/test/card-selector.test.js +71 -0
  39. package/dist/test/card-selector.test.js.map +1 -0
  40. package/dist/test/card-thumb.test.d.ts +1 -0
  41. package/dist/test/card-thumb.test.js +44 -0
  42. package/dist/test/card-thumb.test.js.map +1 -0
  43. package/dist/test/card-totals-narrow.test.js +103 -0
  44. package/dist/test/card-totals-narrow.test.js.map +1 -0
  45. package/dist/test/cell-button-row-height.test.js +53 -0
  46. package/dist/test/cell-button-row-height.test.js.map +1 -0
  47. package/dist/test/column-resize.test.js +153 -0
  48. package/dist/test/column-resize.test.js.map +1 -0
  49. package/dist/test/control-heights.test.js +25 -0
  50. package/dist/test/control-heights.test.js.map +1 -0
  51. package/dist/test/count-handler.test.js +56 -0
  52. package/dist/test/count-handler.test.js.map +1 -0
  53. package/dist/test/create-paste-policy.test.js +159 -0
  54. package/dist/test/create-paste-policy.test.js.map +1 -0
  55. package/dist/test/data-integrity.test.js +145 -0
  56. package/dist/test/data-integrity.test.js.map +1 -0
  57. package/dist/test/date-fields.test.d.ts +2 -0
  58. package/dist/test/date-fields.test.js +138 -0
  59. package/dist/test/date-fields.test.js.map +1 -0
  60. package/dist/test/destructive-actions.test.js +147 -0
  61. package/dist/test/destructive-actions.test.js.map +1 -0
  62. package/dist/test/edit-lifecycle.test.js +270 -0
  63. package/dist/test/edit-lifecycle.test.js.map +1 -0
  64. package/dist/test/edit-rebase.test.js +185 -0
  65. package/dist/test/edit-rebase.test.js.map +1 -0
  66. package/dist/test/editor-commit.test.js +68 -0
  67. package/dist/test/editor-commit.test.js.map +1 -0
  68. package/dist/test/fetch-failure-state.test.js +129 -0
  69. package/dist/test/fetch-failure-state.test.js.map +1 -0
  70. package/dist/test/field-contains-content.test.js +101 -0
  71. package/dist/test/field-contains-content.test.js.map +1 -0
  72. package/dist/test/field-hint.test.js +54 -0
  73. package/dist/test/field-hint.test.js.map +1 -0
  74. package/dist/test/filter-labels.test.js +140 -0
  75. package/dist/test/filter-labels.test.js.map +1 -0
  76. package/dist/test/filter-ownership.test.js +83 -0
  77. package/dist/test/filter-ownership.test.js.map +1 -0
  78. package/dist/test/filter-select-buttons-count.test.js +36 -0
  79. package/dist/test/filter-select-buttons-count.test.js.map +1 -0
  80. package/dist/test/filter-typing.test.js +66 -0
  81. package/dist/test/filter-typing.test.js.map +1 -0
  82. package/dist/test/filters-phone-width.test.d.ts +1 -0
  83. package/dist/test/filters-phone-width.test.js +33 -0
  84. package/dist/test/filters-phone-width.test.js.map +1 -0
  85. package/dist/test/filters-phone-wrap.test.js +17 -0
  86. package/dist/test/filters-phone-wrap.test.js.map +1 -0
  87. package/dist/test/filters-pills.test.d.ts +2 -0
  88. package/dist/test/filters-pills.test.js +149 -0
  89. package/dist/test/filters-pills.test.js.map +1 -0
  90. package/dist/test/first-click-stays.test.js +77 -0
  91. package/dist/test/first-click-stays.test.js.map +1 -0
  92. package/dist/test/fixed-column-opaque.test.js +134 -0
  93. package/dist/test/fixed-column-opaque.test.js.map +1 -0
  94. package/dist/test/flexible-columns.test.js +134 -0
  95. package/dist/test/flexible-columns.test.js.map +1 -0
  96. package/dist/test/grid-single-scroller.test.js +107 -0
  97. package/dist/test/grid-single-scroller.test.js.map +1 -0
  98. package/dist/test/group-heading.test.js +208 -0
  99. package/dist/test/group-heading.test.js.map +1 -0
  100. package/dist/test/latest-fetch-wins.test.js +91 -0
  101. package/dist/test/latest-fetch-wins.test.js.map +1 -0
  102. package/dist/test/list-defaults.test.js +146 -0
  103. package/dist/test/list-defaults.test.js.map +1 -0
  104. package/dist/test/list-records.test.js +46 -0
  105. package/dist/test/list-records.test.js.map +1 -0
  106. package/dist/test/office-density.test.js +52 -0
  107. package/dist/test/office-density.test.js.map +1 -0
  108. package/dist/test/page-errors.d.ts +1 -0
  109. package/dist/test/page-errors.js +44 -0
  110. package/dist/test/page-errors.js.map +1 -0
  111. package/dist/test/paste-integrity.test.js +163 -0
  112. package/dist/test/paste-integrity.test.js.map +1 -0
  113. package/dist/test/record-card-height.test.js +15 -0
  114. package/dist/test/record-card-height.test.js.map +1 -0
  115. package/dist/test/record-view-popup-editor.test.js +71 -0
  116. package/dist/test/record-view-popup-editor.test.js.map +1 -0
  117. package/dist/test/renderer-date-calendar-day.test.js +48 -0
  118. package/dist/test/renderer-date-calendar-day.test.js.map +1 -0
  119. package/dist/test/request-generation.test.js +153 -0
  120. package/dist/test/request-generation.test.js.map +1 -0
  121. package/dist/test/resubmit.test.js +83 -0
  122. package/dist/test/resubmit.test.js.map +1 -0
  123. package/dist/test/row-hover-visible.test.js +139 -0
  124. package/dist/test/row-hover-visible.test.js.map +1 -0
  125. package/dist/test/search-term.test.js +108 -0
  126. package/dist/test/search-term.test.js.map +1 -0
  127. package/dist/test/searchable-select.test.js +65 -0
  128. package/dist/test/searchable-select.test.js.map +1 -0
  129. package/dist/test/select-empty-value.test.js +61 -0
  130. package/dist/test/select-empty-value.test.js.map +1 -0
  131. package/dist/test/shift-range-select.test.js +100 -0
  132. package/dist/test/shift-range-select.test.js.map +1 -0
  133. package/dist/test/sparkline-renderer.test.js +36 -0
  134. package/dist/test/sparkline-renderer.test.js.map +1 -0
  135. package/dist/test/wheel-one-scroller.test.js +275 -0
  136. package/dist/test/wheel-one-scroller.test.js.map +1 -0
  137. package/dist/tsconfig.tsbuildinfo +1 -1
  138. package/package.json +7 -7
  139. package/test/card-selector.test.ts +18 -4
  140. package/test/date-fields.test.ts +163 -0
  141. package/test/filter-select-buttons-count.test.ts +2 -1
  142. package/test/filters-phone-width.test.ts +35 -0
  143. package/test/filters-pills.test.ts +162 -0
  144. package/test/list-defaults.test.ts +2 -1
  145. package/translations/en.json +8 -1
  146. package/translations/es.json +8 -1
  147. package/translations/ja.json +8 -1
  148. package/translations/ko.json +8 -1
  149. package/translations/ms.json +8 -1
  150. package/translations/zh.json +8 -1
@@ -0,0 +1,208 @@
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
+ * Group headings (rows.groups): the management check reads 「자금 지연」 above its late money, in a table on a wide
8
+ * screen and over the cards on a phone (2026-11-06). A heading stands wherever the group value changes, written by
9
+ * the group column's renderer.
10
+ */
11
+ const NAMES = { funds: 'Late money', books: 'Books' };
12
+ const records = [
13
+ { id: '1', group: 'funds', what: 'Overdue collections', count: 23 },
14
+ { id: '2', group: 'funds', what: 'Unpaid VAT', count: 1 },
15
+ { id: '3', group: 'books', what: 'Lines without an account', count: 4 }
16
+ ];
17
+ const config = (groups) => ({
18
+ columns: [
19
+ { type: 'string', name: 'group', header: 'Group', hidden: true, record: { renderer: (value) => NAMES[value] } },
20
+ { type: 'string', name: 'what', header: 'What' },
21
+ { type: 'integer', name: 'count', header: 'Count' }
22
+ ],
23
+ rows: { appendable: false, editable: false, selectable: false, groups },
24
+ list: { fields: ['what'], details: ['count'] }
25
+ });
26
+ const idle = async (el) => {
27
+ while (!((await el.updateComplete) && (await el.grist.updateComplete)))
28
+ ;
29
+ };
30
+ const mount = async (mode, groups) => {
31
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px" mode=${mode} .config=${config(groups)} .data=${{ records }}></ox-grist>`);
32
+ await idle(el);
33
+ /* The grid draws its rows in ox-grid-body. */
34
+ const root = (mode == 'GRID' ? el.grist.renderRoot.querySelector('ox-grid-body').renderRoot : el.grist.renderRoot);
35
+ return root;
36
+ };
37
+ describe('group headings', () => {
38
+ failOnPageErrors();
39
+ for (const mode of ['GRID', 'CARD']) {
40
+ it(`stand where the group changes, in the group column's words (${mode})`, async () => {
41
+ const root = await mount(mode, [{ column: 'group' }]);
42
+ const headings = Array.from(root.querySelectorAll('[group-heading]'));
43
+ expect(headings.map(one => one.textContent.trim())).to.deep.equal(['Late money', 'Books']);
44
+ /* Each heading stands above the first row of its group and spans the whole row. */
45
+ const rows = Array.from(root.querySelectorAll(mode == 'GRID' ? 'ox-grid-field[role="gridcell"]' : 'ox-record-card'));
46
+ const firstOf = (text) => rows.find((one) => { var _a, _b; return ((_a = one.record) === null || _a === void 0 ? void 0 : _a.what) === text && (mode == 'CARD' || ((_b = one.column) === null || _b === void 0 ? void 0 : _b.name) === 'what'); }).getBoundingClientRect();
47
+ const box = (one) => (mode == 'GRID' ? one.firstElementChild : one).getBoundingClientRect();
48
+ expect(box(headings[0]).bottom).to.be.at.most(firstOf('Overdue collections').top + 0.5);
49
+ expect(box(headings[1]).top).to.be.at.least(firstOf('Unpaid VAT').bottom - 0.5);
50
+ expect(box(headings[1]).bottom).to.be.at.most(firstOf('Lines without an account').top + 0.5);
51
+ expect(box(headings[1]).width, 'the heading does not span the row').to.be.above(600);
52
+ });
53
+ it(`are not drawn when the rows are not grouped (${mode})`, async () => {
54
+ const root = await mount(mode, []);
55
+ expect(root.querySelector('[group-heading]')).to.equal(null);
56
+ });
57
+ }
58
+ });
59
+ describe('a link a renderer returns', () => {
60
+ failOnPageErrors();
61
+ for (const mode of ['GRID', 'CARD']) {
62
+ it(`reads as the text around it, not the browser's blue underline (${mode})`, async () => {
63
+ var _a;
64
+ const linked = {
65
+ ...config([]),
66
+ columns: [
67
+ { type: 'string', name: 'what', header: 'What', record: { renderer: (value) => html `<a href="#open">${value}</a>` } },
68
+ { type: 'integer', name: 'count', header: 'Count' }
69
+ ]
70
+ };
71
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px;color:rgb(10, 20, 30)" mode=${mode} .config=${linked} .data=${{ records }}></ox-grist>`);
72
+ await idle(el);
73
+ const root = (mode == 'GRID' ? el.grist.renderRoot.querySelector('ox-grid-body').renderRoot : el.grist.renderRoot);
74
+ const fields = Array.from(root.querySelectorAll(mode == 'GRID' ? 'ox-grid-field' : 'ox-record-card'));
75
+ const holder = mode == 'GRID' ? fields.find(one => { var _a; return ((_a = one.column) === null || _a === void 0 ? void 0 : _a.name) === 'what'; }) : fields[0].renderRoot.querySelector('ox-card-field');
76
+ const link = holder.renderRoot.querySelector('a');
77
+ const style = getComputedStyle(link);
78
+ expect(style.textDecorationLine).to.equal('none');
79
+ expect(style.color).to.equal(getComputedStyle((_a = link.parentElement) !== null && _a !== void 0 ? _a : holder).color);
80
+ });
81
+ }
82
+ });
83
+ describe('a card field with nothing to show', () => {
84
+ failOnPageErrors();
85
+ it('takes no place - no label stands alone', async () => {
86
+ const labelled = {
87
+ ...config([]),
88
+ columns: [
89
+ { type: 'string', name: 'what', header: 'What' },
90
+ { type: 'integer', name: 'count', header: 'Count', label: { renderer: () => 'Count' }, record: { renderer: (value) => value !== null && value !== void 0 ? value : '' } }
91
+ ]
92
+ };
93
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px" mode="CARD" .config=${labelled} .data=${{ records: [{ id: '1', what: 'Azure' }, { id: '2', what: 'VAT', count: 1 }] }}></ox-grist>`);
94
+ await idle(el);
95
+ const cards = Array.from(el.grist.renderRoot.querySelectorAll('ox-record-card'));
96
+ const countOf = (card) => card.renderRoot.querySelector('[detail] ox-card-field');
97
+ expect(countOf(cards[0]).getBoundingClientRect().width, 'an empty field stands').to.equal(0);
98
+ expect(countOf(cards[1]).getBoundingClientRect().width, 'a field with a value is gone').to.be.above(0);
99
+ });
100
+ });
101
+ describe('the rows under a row (tree.childrenProperty)', () => {
102
+ failOnPageErrors();
103
+ const tree = [
104
+ { id: '1', group: 'funds', what: 'Planned money not seen', count: 3, children: [{ id: '1a', what: 'Azure', count: 7 }, { id: '1b', what: 'Office 365' }] },
105
+ { id: '2', group: 'funds', what: 'Unpaid VAT', count: 1 },
106
+ { id: '3', group: 'books', what: 'Lines without an account', count: 4 }
107
+ ];
108
+ const treeConfig = { ...config([{ column: 'group' }]), tree: { childrenProperty: 'children', expanded: () => true } };
109
+ const mount = async (mode) => {
110
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:500px" mode=${mode} .config=${treeConfig} .data=${{ records: tree }}></ox-grist>`);
111
+ await idle(el);
112
+ return el;
113
+ };
114
+ it('stand inside the parent card on a card list, not as cards of their own', async () => {
115
+ const el = await mount('CARD');
116
+ const cards = Array.from(el.grist.renderRoot.querySelectorAll('ox-record-card'));
117
+ expect(cards.map(card => card.record.what)).to.deep.equal(['Planned money not seen', 'Unpaid VAT', 'Lines without an account']);
118
+ const children = Array.from(cards[0].renderRoot.querySelectorAll('[child]'));
119
+ expect(children.map(child => child.querySelector('ox-card-field').record.what)).to.deep.equal(['Azure', 'Office 365']);
120
+ expect(cards[1].renderRoot.querySelector('[children]'), 'a row with no children shows a children block').to.equal(null);
121
+ /* A child's title takes its own line; its details stand under it. */
122
+ const [title, detail] = Array.from(children[0].querySelectorAll('ox-card-field'));
123
+ const titleBox = title.getBoundingClientRect();
124
+ expect(detail.getBoundingClientRect().top, 'the details stand beside the title').to.be.above(titleBox.top + titleBox.height / 2);
125
+ /* The room between two children is wider than the room between a child's two lines. */
126
+ const between = children[1].getBoundingClientRect().top - children[0].getBoundingClientRect().bottom;
127
+ const within = detail.getBoundingClientRect().top - titleBox.bottom;
128
+ expect(between, 'the children run together').to.be.at.least(within + 8);
129
+ const headings = Array.from(el.grist.renderRoot.querySelectorAll('[group-heading]'));
130
+ expect(headings.map(one => one.textContent.trim())).to.deep.equal(['Late money', 'Books']);
131
+ });
132
+ it('stand as rows under the parent in the grid, and do not open a group again', async () => {
133
+ const el = await mount('GRID');
134
+ const body = el.grist.renderRoot.querySelector('ox-grid-body').renderRoot;
135
+ const whats = Array.from(body.querySelectorAll('ox-grid-field[role="gridcell"]')).filter(one => { var _a; return ((_a = one.column) === null || _a === void 0 ? void 0 : _a.name) === 'what'; }).map(one => one.record.what);
136
+ expect(whats).to.deep.equal(['Planned money not seen', 'Azure', 'Office 365', 'Unpaid VAT', 'Lines without an account']);
137
+ /* A child steps in under its parent at its first column, and only there. */
138
+ const cell = (what, name) => Array.from(body.querySelectorAll('ox-grid-field[role="gridcell"]')).find(one => { var _a; return one.record.what === what && ((_a = one.column) === null || _a === void 0 ? void 0 : _a.name) === name; });
139
+ const pad = (one) => parseFloat(getComputedStyle(one).paddingLeft);
140
+ expect(pad(cell('Azure', 'what')), 'a child does not step in').to.be.above(pad(cell('Planned money not seen', 'what')) + 8);
141
+ expect(pad(cell('Azure', 'count'))).to.equal(pad(cell('Planned money not seen', 'count')));
142
+ const headings = Array.from(body.querySelectorAll('[group-heading]'));
143
+ expect(headings.map(one => one.textContent.trim())).to.deep.equal(['Late money', 'Books']);
144
+ });
145
+ });
146
+ describe('a page button a renderer returns', () => {
147
+ failOnPageErrors();
148
+ for (const mode of ['GRID', 'CARD']) {
149
+ it(`takes the page's quiet look, not the filled gutter button (${mode})`, async () => {
150
+ const acting = {
151
+ ...config([]),
152
+ columns: [
153
+ { type: 'string', name: 'what', header: 'What' },
154
+ { type: 'string', name: 'act', header: '', record: { renderer: () => html `<button quiet small>Open</button>` } }
155
+ ],
156
+ list: { fields: ['what'], details: ['act'] }
157
+ };
158
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px" mode=${mode} .config=${acting} .data=${{ records }}></ox-grist>`);
159
+ await idle(el);
160
+ const root = (mode == 'GRID' ? el.grist.renderRoot.querySelector('ox-grid-body').renderRoot : el.grist.renderRoot);
161
+ const fields = Array.from(root.querySelectorAll(mode == 'GRID' ? 'ox-grid-field' : 'ox-record-card'));
162
+ const holder = mode == 'GRID' ? fields.find(one => { var _a; return ((_a = one.column) === null || _a === void 0 ? void 0 : _a.name) === 'act'; }) : fields[0].renderRoot.querySelector('[detail] ox-card-field');
163
+ const button = holder.renderRoot.querySelector('button');
164
+ expect(getComputedStyle(button).backgroundColor, 'a quiet button is filled').to.be.oneOf(['rgba(0, 0, 0, 0)', 'transparent']);
165
+ });
166
+ }
167
+ });
168
+ describe('an empty text detail on a card', () => {
169
+ failOnPageErrors();
170
+ it('takes no place with the default text renderer', async () => {
171
+ const texts = {
172
+ ...config([]),
173
+ columns: [
174
+ { type: 'string', name: 'what', header: 'What' },
175
+ { type: 'string', name: 'summary', header: 'Summary', label: { renderer: () => 'Summary' } }
176
+ ],
177
+ list: { fields: ['what'], details: ['summary'] }
178
+ };
179
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px" mode="CARD" .config=${texts} .data=${{ records: [{ id: '1', what: 'one' }, { id: '2', what: 'two', summary: 'said' }] }}></ox-grist>`);
180
+ await idle(el);
181
+ const cards = Array.from(el.grist.renderRoot.querySelectorAll('ox-record-card'));
182
+ const summaryOf = (card) => card.renderRoot.querySelector('[detail] ox-card-field');
183
+ expect(summaryOf(cards[0]).getBoundingClientRect().width, 'an empty summary stands').to.equal(0);
184
+ expect(summaryOf(cards[1]).getBoundingClientRect().width).to.be.above(0);
185
+ });
186
+ });
187
+ describe('a gutter button with its title', () => {
188
+ failOnPageErrors();
189
+ it("keeps the gutter's small filled look - the page button look is for a renderer's button", async () => {
190
+ const acting = {
191
+ ...config([]),
192
+ columns: [
193
+ { type: 'gutter', gutterName: 'button', icon: 'play_arrow', title: 'Start', iconOnly: false, width: 72 },
194
+ { type: 'string', name: 'what', header: 'What' }
195
+ ]
196
+ };
197
+ const el = await fixture(html `<ox-grist style="display:flex;width:700px;height:400px" mode="GRID" .config=${acting} .data=${{ records }}></ox-grist>`);
198
+ await idle(el);
199
+ const root = el.grist.renderRoot.querySelector('ox-grid-body').renderRoot;
200
+ const field = Array.from(root.querySelectorAll('ox-grid-field')).find(one => { var _a; return ((_a = one.column) === null || _a === void 0 ? void 0 : _a.gutterName) === 'button'; });
201
+ const button = field.renderRoot.querySelector('button');
202
+ const look = getComputedStyle(button);
203
+ expect(look.fontWeight, 'not the page button weight').to.not.equal('600');
204
+ expect(look.fontSize, "the gutter's 0.8rem").to.equal(`${0.8 * parseFloat(getComputedStyle(document.documentElement).fontSize)}px`);
205
+ expect(look.borderTopWidth, 'no page button border').to.equal('0px');
206
+ });
207
+ });
208
+ //# sourceMappingURL=group-heading.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-heading.test.js","sourceRoot":"","sources":["../../test/group-heading.test.ts"],"names":[],"mappings":"AAAA,kIAAkI;AAClI,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;GAIG;AAEH,MAAM,KAAK,GAA2B,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;AAC7E,MAAM,OAAO,GAAG;IACd,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAE,EAAE;IACnE,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE;IACzD,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,CAAC,EAAE;CACxE,CAAA;AACD,MAAM,MAAM,GAAG,CAAC,MAAa,EAAE,EAAE,CAAC,CAAC;IACjC,OAAO,EAAE;QACP,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE;QACvH,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;QAChD,EAAE,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AI,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACrC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,4BAA4B,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACzE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QACnI,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtE,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 * Group headings (rows.groups): the management check reads 「자금 지연」 above its late money, in a table on a wide\n * screen and over the cards on a phone (2026-11-06). A heading stands wherever the group value changes, written by\n * the group column's renderer.\n */\n\nconst NAMES: Record<string, string> = { funds: 'Late money', books: 'Books' }\nconst records = [\n { id: '1', group: 'funds', what: 'Overdue collections', count: 23 },\n { id: '2', group: 'funds', what: 'Unpaid VAT', count: 1 },\n { id: '3', group: 'books', what: 'Lines without an account', count: 4 }\n]\nconst config = (groups: any[]) => ({\n columns: [\n { type: 'string', name: 'group', header: 'Group', hidden: true, record: { renderer: (value: string) => NAMES[value] } },\n { type: 'string', name: 'what', header: 'What' },\n { type: 'integer', name: 'count', header: 'Count' }\n ],\n rows: { appendable: false, editable: false, selectable: false, groups },\n list: { fields: ['what'], details: ['count'] }\n})\n\nconst idle = async (el: DataGrist) => {\n while (!((await el.updateComplete) && (await el.grist.updateComplete)));\n}\n\nconst mount = async (mode: 'GRID' | 'CARD', groups: any[]) => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:400px\" mode=${mode} .config=${config(groups)} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n /* The grid draws its rows in ox-grid-body. */\n const root = (mode == 'GRID' ? (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot : el.grist.renderRoot) as ShadowRoot\n return root\n}\n\ndescribe('group headings', () => {\n failOnPageErrors()\n\n for (const mode of ['GRID', 'CARD'] as const) {\n it(`stand where the group changes, in the group column's words (${mode})`, async () => {\n const root = await mount(mode, [{ column: 'group' }])\n const headings = Array.from(root.querySelectorAll('[group-heading]')) as HTMLElement[]\n expect(headings.map(one => one.textContent!.trim())).to.deep.equal(['Late money', 'Books'])\n\n /* Each heading stands above the first row of its group and spans the whole row. */\n const rows = Array.from(root.querySelectorAll(mode == 'GRID' ? 'ox-grid-field[role=\"gridcell\"]' : 'ox-record-card')) as HTMLElement[]\n const firstOf = (text: string) =>\n rows.find((one: any) => one.record?.what === text && (mode == 'CARD' || one.column?.name === 'what'))!.getBoundingClientRect()\n const box = (one: HTMLElement) => (mode == 'GRID' ? (one.firstElementChild as HTMLElement) : one).getBoundingClientRect()\n expect(box(headings[0]).bottom).to.be.at.most(firstOf('Overdue collections').top + 0.5)\n expect(box(headings[1]).top).to.be.at.least(firstOf('Unpaid VAT').bottom - 0.5)\n expect(box(headings[1]).bottom).to.be.at.most(firstOf('Lines without an account').top + 0.5)\n expect(box(headings[1]).width, 'the heading does not span the row').to.be.above(600)\n })\n\n it(`are not drawn when the rows are not grouped (${mode})`, async () => {\n const root = await mount(mode, [])\n expect(root.querySelector('[group-heading]')).to.equal(null)\n })\n }\n})\n\ndescribe('a link a renderer returns', () => {\n failOnPageErrors()\n\n for (const mode of ['GRID', 'CARD'] as const) {\n it(`reads as the text around it, not the browser's blue underline (${mode})`, async () => {\n const linked = {\n ...config([]),\n columns: [\n { type: 'string', name: 'what', header: 'What', record: { renderer: (value: string) => html`<a href=\"#open\">${value}</a>` } },\n { type: 'integer', name: 'count', header: 'Count' }\n ]\n }\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:400px;color:rgb(10, 20, 30)\" mode=${mode} .config=${linked} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const root = (mode == 'GRID' ? (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot : el.grist.renderRoot) as ShadowRoot\n const fields = Array.from(root.querySelectorAll(mode == 'GRID' ? 'ox-grid-field' : 'ox-record-card')) as any[]\n const holder = mode == 'GRID' ? fields.find(one => one.column?.name === 'what') : fields[0].renderRoot.querySelector('ox-card-field')\n const link = holder.renderRoot.querySelector('a') as HTMLElement\n const style = getComputedStyle(link)\n expect(style.textDecorationLine).to.equal('none')\n expect(style.color).to.equal(getComputedStyle(link.parentElement ?? holder).color)\n })\n }\n})\n\ndescribe('a card field with nothing to show', () => {\n failOnPageErrors()\n\n it('takes no place - no label stands alone', async () => {\n const labelled = {\n ...config([]),\n columns: [\n { type: 'string', name: 'what', header: 'What' },\n { type: 'integer', name: 'count', header: 'Count', label: { renderer: () => 'Count' }, record: { renderer: (value: any) => value ?? '' } }\n ]\n }\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:400px\" mode=\"CARD\" .config=${labelled} .data=${{ records: [{ id: '1', what: 'Azure' }, { id: '2', what: 'VAT', count: 1 }] }}></ox-grist>`\n )\n await idle(el)\n const cards = Array.from(el.grist.renderRoot.querySelectorAll('ox-record-card')) as any[]\n const countOf = (card: any) => card.renderRoot.querySelector('[detail] ox-card-field') as HTMLElement\n expect(countOf(cards[0]).getBoundingClientRect().width, 'an empty field stands').to.equal(0)\n expect(countOf(cards[1]).getBoundingClientRect().width, 'a field with a value is gone').to.be.above(0)\n })\n})\n\ndescribe('the rows under a row (tree.childrenProperty)', () => {\n failOnPageErrors()\n\n const tree = [\n { id: '1', group: 'funds', what: 'Planned money not seen', count: 3, children: [{ id: '1a', what: 'Azure', count: 7 }, { id: '1b', what: 'Office 365' }] },\n { id: '2', group: 'funds', what: 'Unpaid VAT', count: 1 },\n { id: '3', group: 'books', what: 'Lines without an account', count: 4 }\n ]\n const treeConfig = { ...config([{ column: 'group' }]), tree: { childrenProperty: 'children', expanded: () => true } }\n\n const mount = async (mode: 'GRID' | 'CARD') => {\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:500px\" mode=${mode} .config=${treeConfig} .data=${{ records: tree }}></ox-grist>`\n )\n await idle(el)\n return el\n }\n\n it('stand inside the parent card on a card list, not as cards of their own', async () => {\n const el = await mount('CARD')\n const cards = Array.from(el.grist.renderRoot.querySelectorAll('ox-record-card')) as any[]\n expect(cards.map(card => card.record.what)).to.deep.equal(['Planned money not seen', 'Unpaid VAT', 'Lines without an account'])\n const children = Array.from(cards[0].renderRoot.querySelectorAll('[child]')) as HTMLElement[]\n expect(children.map(child => (child.querySelector('ox-card-field') as any).record.what)).to.deep.equal(['Azure', 'Office 365'])\n expect(cards[1].renderRoot.querySelector('[children]'), 'a row with no children shows a children block').to.equal(null)\n /* A child's title takes its own line; its details stand under it. */\n const [title, detail] = Array.from(children[0].querySelectorAll('ox-card-field')) as HTMLElement[]\n const titleBox = title.getBoundingClientRect()\n expect(detail.getBoundingClientRect().top, 'the details stand beside the title').to.be.above(titleBox.top + titleBox.height / 2)\n /* The room between two children is wider than the room between a child's two lines. */\n const between = children[1].getBoundingClientRect().top - children[0].getBoundingClientRect().bottom\n const within = detail.getBoundingClientRect().top - titleBox.bottom\n expect(between, 'the children run together').to.be.at.least(within + 8)\n const headings = Array.from(el.grist.renderRoot.querySelectorAll('[group-heading]')) as HTMLElement[]\n expect(headings.map(one => one.textContent!.trim())).to.deep.equal(['Late money', 'Books'])\n })\n\n it('stand as rows under the parent in the grid, and do not open a group again', async () => {\n const el = await mount('GRID')\n const body = (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot as ShadowRoot\n const whats = (Array.from(body.querySelectorAll('ox-grid-field[role=\"gridcell\"]')) as any[]).filter(one => one.column?.name === 'what').map(one => one.record.what)\n expect(whats).to.deep.equal(['Planned money not seen', 'Azure', 'Office 365', 'Unpaid VAT', 'Lines without an account'])\n /* A child steps in under its parent at its first column, and only there. */\n const cell = (what: string, name: string) =>\n (Array.from(body.querySelectorAll('ox-grid-field[role=\"gridcell\"]')) as any[]).find(one => one.record.what === what && one.column?.name === name)\n const pad = (one: HTMLElement) => parseFloat(getComputedStyle(one).paddingLeft)\n expect(pad(cell('Azure', 'what')), 'a child does not step in').to.be.above(pad(cell('Planned money not seen', 'what')) + 8)\n expect(pad(cell('Azure', 'count'))).to.equal(pad(cell('Planned money not seen', 'count')))\n const headings = Array.from(body.querySelectorAll('[group-heading]')) as HTMLElement[]\n expect(headings.map(one => one.textContent!.trim())).to.deep.equal(['Late money', 'Books'])\n })\n})\n\ndescribe('a page button a renderer returns', () => {\n failOnPageErrors()\n\n for (const mode of ['GRID', 'CARD'] as const) {\n it(`takes the page's quiet look, not the filled gutter button (${mode})`, async () => {\n const acting = {\n ...config([]),\n columns: [\n { type: 'string', name: 'what', header: 'What' },\n { type: 'string', name: 'act', header: '', record: { renderer: () => html`<button quiet small>Open</button>` } }\n ],\n list: { fields: ['what'], details: ['act'] }\n }\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:400px\" mode=${mode} .config=${acting} .data=${{ records }}></ox-grist>`\n )\n await idle(el)\n const root = (mode == 'GRID' ? (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot : el.grist.renderRoot) as ShadowRoot\n const fields = Array.from(root.querySelectorAll(mode == 'GRID' ? 'ox-grid-field' : 'ox-record-card')) as any[]\n const holder = mode == 'GRID' ? fields.find(one => one.column?.name === 'act') : fields[0].renderRoot.querySelector('[detail] ox-card-field')\n const button = holder.renderRoot.querySelector('button') as HTMLElement\n expect(getComputedStyle(button).backgroundColor, 'a quiet button is filled').to.be.oneOf(['rgba(0, 0, 0, 0)', 'transparent'])\n })\n }\n})\n\ndescribe('an empty text detail on a card', () => {\n failOnPageErrors()\n\n it('takes no place with the default text renderer', async () => {\n const texts = {\n ...config([]),\n columns: [\n { type: 'string', name: 'what', header: 'What' },\n { type: 'string', name: 'summary', header: 'Summary', label: { renderer: () => 'Summary' } }\n ],\n list: { fields: ['what'], details: ['summary'] }\n }\n const el = await fixture<DataGrist>(\n html`<ox-grist style=\"display:flex;width:700px;height:400px\" mode=\"CARD\" .config=${texts} .data=${{ records: [{ id: '1', what: 'one' }, { id: '2', what: 'two', summary: 'said' }] }}></ox-grist>`\n )\n await idle(el)\n const cards = Array.from(el.grist.renderRoot.querySelectorAll('ox-record-card')) as any[]\n const summaryOf = (card: any) => card.renderRoot.querySelector('[detail] ox-card-field') as HTMLElement\n expect(summaryOf(cards[0]).getBoundingClientRect().width, 'an empty summary stands').to.equal(0)\n expect(summaryOf(cards[1]).getBoundingClientRect().width).to.be.above(0)\n })\n})\n\ndescribe('a gutter button with its title', () => {\n failOnPageErrors()\n\n it(\"keeps the gutter's small filled look - the page button look is for a renderer's button\", async () => {\n const acting = {\n ...config([]),\n columns: [\n { type: 'gutter', gutterName: 'button', icon: 'play_arrow', title: 'Start', iconOnly: false, width: 72 },\n { type: 'string', name: 'what', header: 'What' }\n ]\n }\n const el = await fixture<DataGrist>(html`<ox-grist style=\"display:flex;width:700px;height:400px\" mode=\"GRID\" .config=${acting} .data=${{ records }}></ox-grist>`)\n await idle(el)\n const root = (el.grist.renderRoot.querySelector('ox-grid-body') as any).renderRoot as ShadowRoot\n const field = (Array.from(root.querySelectorAll('ox-grid-field')) as any[]).find(one => one.column?.gutterName === 'button')\n const button = field.renderRoot.querySelector('button') as HTMLElement\n const look = getComputedStyle(button)\n expect(look.fontWeight, 'not the page button weight').to.not.equal('600')\n expect(look.fontSize, \"the gutter's 0.8rem\").to.equal(`${0.8 * parseFloat(getComputedStyle(document.documentElement).fontSize)}px`)\n expect(look.borderTopWidth, 'no page button border').to.equal('0px')\n })\n})\n"]}
@@ -0,0 +1,91 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import '../src/data-grist.js';
4
+ /**
5
+ * The last fetch asked is the one the grid shows.
6
+ *
7
+ * A ledger opened from a dashboard card asked twice in a row - once with no conditions as it read its address,
8
+ * then with the month the card named. The grid kept whichever answer arrived first - the read with no conditions -
9
+ * and showed every line under a headroom that said October (2026-10-16).
10
+ */
11
+ const config = {
12
+ columns: [
13
+ { type: 'string', name: 'id', hidden: true },
14
+ { type: 'string', name: 'name', header: 'name' }
15
+ ],
16
+ pagination: { pages: [20] }
17
+ };
18
+ const answer = (total) => ({
19
+ total,
20
+ records: Array.from({ length: Math.min(total, 20) }, (_, i) => ({ id: `${total}-${i}`, name: `row ${i}` }))
21
+ });
22
+ const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
23
+ describe('ox-grist with two fetches out at once', () => {
24
+ /* Resizing inside a fixture trips Chrome's benign ResizeObserver loop error; it says nothing about fetching. */
25
+ const ignoreResizeLoop = (e) => {
26
+ if (String(e.message).includes('ResizeObserver loop')) {
27
+ e.stopImmediatePropagation();
28
+ e.preventDefault();
29
+ }
30
+ };
31
+ let previousOnError = null;
32
+ before(() => {
33
+ window.addEventListener('error', ignoreResizeLoop, true);
34
+ previousOnError = window.onerror;
35
+ window.onerror = (message, ...rest) => String(message).includes('ResizeObserver loop') ? true : previousOnError === null || previousOnError === void 0 ? void 0 : previousOnError.call(window, message, ...rest);
36
+ });
37
+ after(() => {
38
+ window.removeEventListener('error', ignoreResizeLoop, true);
39
+ window.onerror = previousOnError;
40
+ });
41
+ /*
42
+ * The answer depends on the conditions, as on the ledger: the read with none, asked first, comes back first; the
43
+ * month's comes back after it. The grid fetches once by itself when attached; the test starts after that settled.
44
+ */
45
+ const MONTH = [{ name: 'month', operator: 'eq', value: 10 }];
46
+ const byConditions = (failUnfiltered = false) => async ({ filters }) => {
47
+ if (!(filters === null || filters === void 0 ? void 0 : filters.length)) {
48
+ await wait(20);
49
+ if (failUnfiltered)
50
+ throw new Error('the unfiltered read failed');
51
+ return answer(2908);
52
+ }
53
+ await wait(300);
54
+ return answer(4);
55
+ };
56
+ async function attached(handler) {
57
+ const el = (await fixture(html `<ox-grist style="height: 300px" .config=${config} .fetchHandler=${handler}></ox-grist>`));
58
+ await wait(400);
59
+ return el;
60
+ }
61
+ it('shows the answer to the later fetch, though the earlier one came back first', async () => {
62
+ const el = await attached(byConditions());
63
+ el.filters = [];
64
+ const unfiltered = el.fetch();
65
+ el.filters = MONTH;
66
+ const month = el.fetch();
67
+ await Promise.all([unfiltered, month]);
68
+ await el.updateComplete;
69
+ expect(el.data.total).to.equal(4);
70
+ });
71
+ it('does not report the failure of a fetch a later one replaced', async () => {
72
+ const el = await attached(byConditions(true));
73
+ el.filters = [];
74
+ const unfiltered = el.fetch().then(() => 'kept quiet', () => 'reported');
75
+ el.filters = MONTH;
76
+ await el.fetch();
77
+ expect(await unfiltered).to.equal('kept quiet');
78
+ await el.updateComplete;
79
+ expect(el.data.total).to.equal(4);
80
+ /* The grid draws "could not load" from fetchFailed - a replaced read must not make it say so. */
81
+ const body = el.renderRoot.querySelector('#grist');
82
+ expect(!!(body === null || body === void 0 ? void 0 : body.renderRoot.querySelector('ox-empty-note'))).to.equal(false);
83
+ });
84
+ it('still shows a single fetch as before', async () => {
85
+ const el = (await fixture(html `<ox-grist style="height: 300px" .config=${config} .fetchHandler=${async () => answer(7)}></ox-grist>`));
86
+ await el.fetch();
87
+ await el.updateComplete;
88
+ expect(el.data.total).to.equal(7);
89
+ });
90
+ });
91
+ //# sourceMappingURL=latest-fetch-wins.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latest-fetch-wins.test.js","sourceRoot":"","sources":["../../test/latest-fetch-wins.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAA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,CAAC,CAAA;QAC/C,MAAM,EAAE,CAAC,cAAc,CAAA;QACvB,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACjC,iGAAiG;QACjG,MAAM,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAsD,CAAA;QACvG,MAAM,CAAC,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAA,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC3E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAA,2CAA2C,MAAM,kBAAkB,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAU,CAAA;QAC/I,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA;QAChB,MAAM,EAAE,CAAC,cAAc,CAAA;QAEvB,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/data-grist.js'\n\n/**\n * The last fetch asked is the one the grid shows.\n *\n * A ledger opened from a dashboard card asked twice in a row - once with no conditions as it read its address,\n * then with the month the card named. The grid kept whichever answer arrived first - the read with no conditions -\n * and showed every line under a headroom that said October (2026-10-16).\n */\n\nconst config = {\n columns: [\n { type: 'string', name: 'id', hidden: true },\n { type: 'string', name: 'name', header: 'name' }\n ],\n pagination: { pages: [20] }\n}\n\nconst answer = (total: number) => ({\n total,\n records: Array.from({ length: Math.min(total, 20) }, (_, i) => ({ id: `${total}-${i}`, name: `row ${i}` }))\n})\n\nconst wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))\n\ntype Grist = HTMLElement & { fetch(): Promise<void>; data: { total: number }; updateComplete: Promise<unknown> }\n\ndescribe('ox-grist with two fetches out at once', () => {\n /* Resizing inside a fixture trips Chrome's benign ResizeObserver loop error; it says nothing about fetching. */\n const ignoreResizeLoop = (e: ErrorEvent) => {\n if (String(e.message).includes('ResizeObserver loop')) {\n e.stopImmediatePropagation()\n e.preventDefault()\n }\n }\n let previousOnError: OnErrorEventHandler = null\n before(() => {\n window.addEventListener('error', ignoreResizeLoop, 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', ignoreResizeLoop, true)\n window.onerror = previousOnError\n })\n\n /*\n * The answer depends on the conditions, as on the ledger: the read with none, asked first, comes back first; the\n * month's comes back after it. The grid fetches once by itself when attached; the test starts after that settled.\n */\n const MONTH = [{ name: 'month', operator: 'eq', value: 10 }]\n const byConditions = (failUnfiltered = false) => async ({ filters }: { filters?: unknown[] }) => {\n if (!filters?.length) {\n await wait(20)\n if (failUnfiltered) throw new Error('the unfiltered read failed')\n return answer(2908)\n }\n await wait(300)\n return answer(4)\n }\n\n async function attached(handler: any) {\n const el = (await fixture(html`<ox-grist style=\"height: 300px\" .config=${config} .fetchHandler=${handler}></ox-grist>`)) as Grist & {\n filters: unknown[]\n renderRoot: ShadowRoot\n }\n await wait(400)\n return el\n }\n\n it('shows the answer to the later fetch, though the earlier one came back first', async () => {\n const el = await attached(byConditions())\n\n el.filters = []\n const unfiltered = el.fetch()\n el.filters = MONTH\n const month = el.fetch()\n await Promise.all([unfiltered, month])\n await el.updateComplete\n\n expect(el.data.total).to.equal(4)\n })\n\n it('does not report the failure of a fetch a later one replaced', async () => {\n const el = await attached(byConditions(true))\n\n el.filters = []\n const unfiltered = el.fetch().then(\n () => 'kept quiet',\n () => 'reported'\n )\n el.filters = MONTH\n await el.fetch()\n\n expect(await unfiltered).to.equal('kept quiet')\n await el.updateComplete\n expect(el.data.total).to.equal(4)\n /* The grid draws \"could not load\" from fetchFailed - a replaced read must not make it say so. */\n const body = el.renderRoot.querySelector('#grist') as (HTMLElement & { renderRoot: ShadowRoot }) | null\n expect(!!body?.renderRoot.querySelector('ox-empty-note')).to.equal(false)\n })\n\n it('still shows a single fetch as before', async () => {\n const el = (await fixture(html`<ox-grist style=\"height: 300px\" .config=${config} .fetchHandler=${async () => answer(7)}></ox-grist>`)) as Grist\n await el.fetch()\n await el.updateComplete\n\n expect(el.data.total).to.equal(7)\n })\n})\n"]}
@@ -0,0 +1,146 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import { addressController, writeAddress } from '@operato/utils/address.js';
4
+ import '../src/data-grist.js';
5
+ import '../src/filters/filters-form.js';
6
+ /*
7
+ * An address without `filters` means the list's configured defaults, applied and written into the address; an
8
+ * address with `filters=[]` means no conditions. A list operator's value is always an array, also when a default,
9
+ * a link or a form gives one choice as a scalar. (address-centralization-problem-2026-10-19 §7 D7)
10
+ */
11
+ async function until(check, what) {
12
+ for (let i = 0; i < 200; i++) {
13
+ if (check())
14
+ return;
15
+ await new Promise(resolve => setTimeout(resolve, 5));
16
+ }
17
+ throw new Error(`did not settle: ${what}`);
18
+ }
19
+ const filtersInAddress = () => new URLSearchParams(location.search).get('filters');
20
+ describe('list defaults and the shape of list operators', () => {
21
+ let previousOnError;
22
+ const resizeNotice = (event) => {
23
+ if (event.message.includes('ResizeObserver loop')) {
24
+ event.preventDefault();
25
+ event.stopImmediatePropagation();
26
+ }
27
+ };
28
+ before(() => {
29
+ window.addEventListener('error', resizeNotice, true);
30
+ previousOnError = window.onerror;
31
+ window.onerror = (message, ...rest) => String(message).includes('ResizeObserver loop') ? true : previousOnError === null || previousOnError === void 0 ? void 0 : previousOnError.call(window, message, ...rest);
32
+ });
33
+ after(() => {
34
+ window.removeEventListener('error', resizeNotice, true);
35
+ window.onerror = previousOnError;
36
+ });
37
+ let reads = [];
38
+ const typeColumn = { name: 'type', header: 'type', filter: { operator: 'in', value: 'main' } };
39
+ const mount = async (columns = [typeColumn]) => {
40
+ addressController().registerQuery();
41
+ reads = [];
42
+ const grist = await fixture(html `<ox-grist
43
+ style="display:block;width:800px;height:400px"
44
+ .urlParamsSensitive=${true}
45
+ .config=${{
46
+ columns,
47
+ pagination: { limit: 20 }
48
+ }}
49
+ .fetchHandler=${async ({ filters }) => {
50
+ reads.push(filters);
51
+ return { records: [], total: 0 };
52
+ }}
53
+ ></ox-grist>`);
54
+ return grist;
55
+ };
56
+ it('an address without filters reads with the defaults and then says so', async () => {
57
+ await writeAddress('?defaults=start');
58
+ await mount();
59
+ await until(() => reads.length > 0, 'first read');
60
+ expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['main'] }]);
61
+ await until(() => filtersInAddress() !== null, 'defaults written');
62
+ expect(filtersInAddress()).to.equal("[{name:'type',operator:'in',value:['main']}]");
63
+ expect(reads.every(read => read.length === 1)).to.equal(true);
64
+ });
65
+ it('a default whose list holds no choice is no condition: it is neither read nor written', async () => {
66
+ // A board list's state default was `in []`; it reached the server as `state IN ()`, which postgres refuses.
67
+ await writeAddress('?defaults=empty-list');
68
+ await mount([typeColumn, { name: 'state', header: 'state', filter: { operator: 'in', value: [] } }]);
69
+ await until(() => reads.length > 0, 'first read');
70
+ expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['main'] }]);
71
+ await until(() => filtersInAddress() !== null, 'defaults written');
72
+ expect(filtersInAddress()).to.equal("[{name:'type',operator:'in',value:['main']}]");
73
+ });
74
+ it('an address holding a list operator with no choice reads without it', async () => {
75
+ await writeAddress("?filters=[{name:'type',operator:'in',value:['main']},{name:'state',operator:'in',value:[]}]");
76
+ await mount([typeColumn, { name: 'state', header: 'state', filter: { operator: 'in', value: [] } }]);
77
+ await until(() => reads.length > 0, 'first read');
78
+ expect(reads.every(read => read.every((filter) => filter.name !== 'state'))).to.equal(true);
79
+ expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['main'] }]);
80
+ });
81
+ it('a default of false or 0 is a condition', async () => {
82
+ await writeAddress('?defaults=falsy-values');
83
+ await mount([
84
+ { name: 'active', header: 'active', type: 'boolean', filter: { operator: 'eq', value: false } },
85
+ { name: 'count', header: 'count', type: 'integer', filter: { operator: 'eq', value: 0 } }
86
+ ]);
87
+ await until(() => reads.length > 0, 'first read');
88
+ expect(reads[reads.length - 1]).to.deep.equal([
89
+ { name: 'active', operator: 'eq', value: false },
90
+ { name: 'count', operator: 'eq', value: 0 }
91
+ ]);
92
+ });
93
+ it('an address with filters=[] reads with no conditions and keeps it', async () => {
94
+ await writeAddress('?filters=[]');
95
+ await mount();
96
+ await until(() => reads.length > 0, 'first read');
97
+ expect(reads[reads.length - 1]).to.deep.equal([]);
98
+ expect(filtersInAddress()).to.equal('[]');
99
+ });
100
+ it('clearing every condition of a list with defaults writes filters=[]', async () => {
101
+ await writeAddress("?filters=[{name:'type',operator:'in',value:['sub']}]");
102
+ const grist = await mount();
103
+ await until(() => reads.length > 0, 'first read');
104
+ grist.dispatchEvent(new CustomEvent('fetch-params-change', { bubbles: true, composed: true, detail: { filters: [], from: 'filters-form' } }));
105
+ await until(() => filtersInAddress() === '[]', 'empty written');
106
+ await until(() => { var _a; return ((_a = reads[reads.length - 1]) === null || _a === void 0 ? void 0 : _a.length) === 0; }, 'read with none');
107
+ });
108
+ /*
109
+ * The form draws the conditions the list is read with. A select whose default was chosen away (filters=[]) shows no
110
+ * choice - it once drew its default again, so 「진행」 sat above a list of every item.
111
+ */
112
+ it('a filter chosen away shows no choice in the form, its default neither', async () => {
113
+ var _a, _b, _c;
114
+ const stateColumn = { name: 'state', header: 'state', type: 'select', filter: { operator: 'eq', value: 'GOING', options: ['GOING', 'ENDED'] } };
115
+ const shown = async (address) => {
116
+ await writeAddress(address);
117
+ addressController().registerQuery();
118
+ reads = [];
119
+ const grist = await fixture(html `<ox-grist
120
+ style="display:block;width:800px;height:400px"
121
+ .urlParamsSensitive=${true}
122
+ .config=${{ columns: [stateColumn], pagination: { limit: 20 } }}
123
+ .fetchHandler=${async ({ filters }) => {
124
+ reads.push(filters);
125
+ return { records: [], total: 0 };
126
+ }}
127
+ ><div slot="headroom"><ox-filters-form without-search></ox-filters-form></div
128
+ ></ox-grist>`);
129
+ await until(() => reads.length > 0, 'first read');
130
+ const form = grist.querySelector('ox-filters-form');
131
+ await form.updateComplete;
132
+ /* Two choices are chips now (pill-choice); the chooser is read by its name, whatever draws it. */
133
+ return form.renderRoot.querySelector('[name="state"]');
134
+ };
135
+ expect((_a = (await shown('?defaults=select'))) === null || _a === void 0 ? void 0 : _a.value).to.equal('GOING');
136
+ expect((_c = (_b = (await shown('?filters=[]'))) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '').to.equal('');
137
+ expect(reads[reads.length - 1]).to.deep.equal([]);
138
+ });
139
+ it('a single choice given as a scalar is read as a one-element array', async () => {
140
+ await writeAddress("?filters=[{name:'type',operator:'in',value:'sub'}]");
141
+ await mount();
142
+ await until(() => reads.length > 0, 'first read');
143
+ expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['sub'] }]);
144
+ });
145
+ });
146
+ //# sourceMappingURL=list-defaults.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-defaults.test.js","sourceRoot":"","sources":["../../test/list-defaults.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE3E,OAAO,sBAAsB,CAAA;AAC7B,OAAO,gCAA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,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;IACnG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\nimport { addressController, writeAddress } from '@operato/utils/address.js'\nimport type { DataGrist } from '../src/data-grist.js'\nimport '../src/data-grist.js'\nimport '../src/filters/filters-form.js'\n\n/*\n * An address without `filters` means the list's configured defaults, applied and written into the address; an\n * address with `filters=[]` means no conditions. A list operator's value is always an array, also when a default,\n * a link or a form gives one choice as a scalar. (address-centralization-problem-2026-10-19 §7 D7)\n */\n\nasync function until(check: () => boolean, what: string) {\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(`did not settle: ${what}`)\n}\n\nconst filtersInAddress = () => new URLSearchParams(location.search).get('filters')\n\ndescribe('list defaults and the shape of list operators', () => {\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\n let reads: any[][] = []\n const typeColumn = { name: 'type', header: 'type', filter: { operator: 'in', value: 'main' } }\n const mount = async (columns: any[] = [typeColumn]) => {\n addressController().registerQuery()\n reads = []\n const grist = await fixture<DataGrist>(\n html`<ox-grist\n style=\"display:block;width:800px;height:400px\"\n .urlParamsSensitive=${true}\n .config=${{\n columns,\n pagination: { limit: 20 }\n }}\n .fetchHandler=${async ({ filters }: any) => {\n reads.push(filters)\n return { records: [], total: 0 }\n }}\n ></ox-grist>`\n )\n return grist\n }\n\n it('an address without filters reads with the defaults and then says so', async () => {\n await writeAddress('?defaults=start')\n await mount()\n await until(() => reads.length > 0, 'first read')\n expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['main'] }])\n await until(() => filtersInAddress() !== null, 'defaults written')\n expect(filtersInAddress()).to.equal(\"[{name:'type',operator:'in',value:['main']}]\")\n expect(reads.every(read => read.length === 1)).to.equal(true)\n })\n\n it('a default whose list holds no choice is no condition: it is neither read nor written', async () => {\n // A board list's state default was `in []`; it reached the server as `state IN ()`, which postgres refuses.\n await writeAddress('?defaults=empty-list')\n await mount([typeColumn, { name: 'state', header: 'state', filter: { operator: 'in', value: [] } }])\n await until(() => reads.length > 0, 'first read')\n expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['main'] }])\n await until(() => filtersInAddress() !== null, 'defaults written')\n expect(filtersInAddress()).to.equal(\"[{name:'type',operator:'in',value:['main']}]\")\n })\n\n it('an address holding a list operator with no choice reads without it', async () => {\n await writeAddress(\"?filters=[{name:'type',operator:'in',value:['main']},{name:'state',operator:'in',value:[]}]\")\n await mount([typeColumn, { name: 'state', header: 'state', filter: { operator: 'in', value: [] } }])\n await until(() => reads.length > 0, 'first read')\n expect(reads.every(read => read.every((filter: any) => filter.name !== 'state'))).to.equal(true)\n expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['main'] }])\n })\n\n it('a default of false or 0 is a condition', async () => {\n await writeAddress('?defaults=falsy-values')\n await mount([\n { name: 'active', header: 'active', type: 'boolean', filter: { operator: 'eq', value: false } },\n { name: 'count', header: 'count', type: 'integer', filter: { operator: 'eq', value: 0 } }\n ])\n await until(() => reads.length > 0, 'first read')\n expect(reads[reads.length - 1]).to.deep.equal([\n { name: 'active', operator: 'eq', value: false },\n { name: 'count', operator: 'eq', value: 0 }\n ])\n })\n\n it('an address with filters=[] reads with no conditions and keeps it', async () => {\n await writeAddress('?filters=[]')\n await mount()\n await until(() => reads.length > 0, 'first read')\n expect(reads[reads.length - 1]).to.deep.equal([])\n expect(filtersInAddress()).to.equal('[]')\n })\n\n it('clearing every condition of a list with defaults writes filters=[]', async () => {\n await writeAddress(\"?filters=[{name:'type',operator:'in',value:['sub']}]\")\n const grist = await mount()\n await until(() => reads.length > 0, 'first read')\n grist.dispatchEvent(\n new CustomEvent('fetch-params-change', { bubbles: true, composed: true, detail: { filters: [], from: 'filters-form' } })\n )\n await until(() => filtersInAddress() === '[]', 'empty written')\n await until(() => reads[reads.length - 1]?.length === 0, 'read with none')\n })\n\n /*\n * The form draws the conditions the list is read with. A select whose default was chosen away (filters=[]) shows no\n * choice - it once drew its default again, so 「진행」 sat above a list of every item.\n */\n it('a filter chosen away shows no choice in the form, its default neither', async () => {\n const stateColumn = { name: 'state', header: 'state', type: 'select', filter: { operator: 'eq', value: 'GOING', options: ['GOING', 'ENDED'] } }\n const shown = async (address: string) => {\n await writeAddress(address)\n addressController().registerQuery()\n reads = []\n const grist = await fixture<DataGrist>(\n html`<ox-grist\n style=\"display:block;width:800px;height:400px\"\n .urlParamsSensitive=${true}\n .config=${{ columns: [stateColumn], pagination: { limit: 20 } }}\n .fetchHandler=${async ({ filters }: any) => {\n reads.push(filters)\n return { records: [], total: 0 }\n }}\n ><div slot=\"headroom\"><ox-filters-form without-search></ox-filters-form></div\n ></ox-grist>`\n )\n await until(() => reads.length > 0, 'first read')\n const form = grist.querySelector('ox-filters-form') as any\n await form.updateComplete\n /* Two choices are chips now (pill-choice); the chooser is read by its name, whatever draws it. */\n return (form.renderRoot as ShadowRoot).querySelector('[name=\"state\"]') as any\n }\n expect((await shown('?defaults=select'))?.value).to.equal('GOING')\n expect((await shown('?filters=[]'))?.value ?? '').to.equal('')\n expect(reads[reads.length - 1]).to.deep.equal([])\n })\n\n it('a single choice given as a scalar is read as a one-element array', async () => {\n await writeAddress(\"?filters=[{name:'type',operator:'in',value:'sub'}]\")\n await mount()\n await until(() => reads.length > 0, 'first read')\n expect(reads[reads.length - 1]).to.deep.equal([{ name: 'type', operator: 'in', value: ['sub'] }])\n })\n})\n"]}
@@ -0,0 +1,46 @@
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 list or card shows the records of its data, whenever its config arrives. The grist hands the data over at once
8
+ * and the compiled config a render later - and a personal config loads later still - so a list that emptied itself
9
+ * on a config change showed nothing until the next fetch (2026-10-26).
10
+ */
11
+ const records = [
12
+ { id: '1', title: 'one' },
13
+ { id: '2', title: 'two' }
14
+ ];
15
+ const config = (header) => ({
16
+ columns: [{ type: 'string', name: 'title', header, record: { editable: true } }],
17
+ rows: { appendable: false },
18
+ list: { fields: ['title'] }
19
+ });
20
+ /* `updateComplete` resolves false while an update set another one going. */
21
+ const idle = async (el) => {
22
+ while (!((await el.updateComplete) && (await el.grist.updateComplete)))
23
+ ;
24
+ };
25
+ for (const [mode, tag] of [
26
+ ['LIST', 'ox-record-partial'],
27
+ ['CARD', 'ox-record-card']
28
+ ]) {
29
+ describe(`a ${mode} and its config`, () => {
30
+ failOnPageErrors();
31
+ const shown = (el) => Array.from(el.grist.renderRoot.querySelectorAll(tag)).map(item => item.record.title);
32
+ it('shows the records it was given with its config', async () => {
33
+ const el = await fixture(html `<ox-grist style="height:300px" .mode=${mode} .config=${config('title')} .data=${{ records }}></ox-grist>`);
34
+ await idle(el);
35
+ expect(shown(el)).to.eql(['one', 'two']);
36
+ });
37
+ it('keeps its records when the config changes after them', async () => {
38
+ const el = await fixture(html `<ox-grist style="height:300px" .mode=${mode} .config=${config('title')} .data=${{ records }}></ox-grist>`);
39
+ await idle(el);
40
+ el.config = config('renamed');
41
+ await idle(el);
42
+ expect(shown(el)).to.eql(['one', 'two']);
43
+ });
44
+ });
45
+ }
46
+ //# sourceMappingURL=list-records.test.js.map