@operato/data-grist 10.29.27 → 10.29.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +896 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/webpack/bootstrap.html +118 -0
- package/coverage/lcov-report/webpack/index.html +116 -0
- package/coverage/lcov-report/webpack/runtime/define property getters.html +118 -0
- package/coverage/lcov-report/webpack/runtime/global.html +118 -0
- package/coverage/lcov-report/webpack/runtime/hasOwnProperty shorthand.html +118 -0
- package/coverage/lcov-report/webpack/runtime/index.html +161 -0
- package/coverage/lcov-report/webpack/runtime/make namespace object.html +118 -0
- package/coverage/lcov.info +59434 -0
- package/dist/src/data-card/record-card.js +5 -1
- package/dist/src/data-card/record-card.js.map +1 -1
- package/dist/src/data-grid/data-grid.js +7 -1
- package/dist/src/data-grid/data-grid.js.map +1 -1
- package/dist/test/fetch-failure-state.test.js +24 -6
- package/dist/test/fetch-failure-state.test.js.map +1 -1
- package/dist/test/record-card-height.test.d.ts +1 -0
- package/dist/test/record-card-height.test.js +15 -0
- package/dist/test/record-card-height.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/test/fetch-failure-state.test.ts +26 -5
- package/test/record-card-height.test.ts +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/data-grist",
|
|
3
|
-
"version": "10.29.
|
|
3
|
+
"version": "10.29.28",
|
|
4
4
|
"description": "User interface for grid (desktop) and list (mobile)",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"type": "module",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@material/web": "^2.0.0",
|
|
71
71
|
"@operato/headroom": "^10.29.1",
|
|
72
72
|
"@operato/i18n": "^10.29.27",
|
|
73
|
-
"@operato/input": "^10.29.
|
|
73
|
+
"@operato/input": "^10.29.28",
|
|
74
74
|
"@operato/list-state": "^10.29.27",
|
|
75
75
|
"@operato/p13n": "^10.29.27",
|
|
76
76
|
"@operato/popup": "^10.29.27",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"prettier --write"
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "cf6d84547fbf6a32a315c08f85c4dfc35a30d4a5"
|
|
120
120
|
}
|
|
@@ -36,11 +36,8 @@ async function grist(mode: 'GRID' | 'LIST' | 'CARD', handler: () => Promise<unkn
|
|
|
36
36
|
|
|
37
37
|
function emptyNote(el: HTMLElement & { renderRoot: ShadowRoot }): HTMLElement | null {
|
|
38
38
|
const body = el.renderRoot.querySelector('#grist') as (HTMLElement & { renderRoot: ShadowRoot }) | null
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/* GRID draws the note inside its body element. */
|
|
42
|
-
const gridBody = body?.renderRoot.querySelector('ox-grid-body') as HTMLElement | null
|
|
43
|
-
return (gridBody?.querySelector('ox-empty-note') as HTMLElement | null) ?? null
|
|
39
|
+
/* Every mode draws the note in its own shadow root - GRID on the grid host, not in its body. */
|
|
40
|
+
return (body?.renderRoot.querySelector('ox-empty-note') as HTMLElement | null) ?? null
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
describe('ox-grist when the fetch fails', () => {
|
|
@@ -97,6 +94,30 @@ describe('ox-grist when the fetch fails', () => {
|
|
|
97
94
|
expect(note!.getAttribute('title')).to.equal('nothing here yet.')
|
|
98
95
|
})
|
|
99
96
|
|
|
97
|
+
it('GRID: the note stays in the visible grid when the columns are wider than it', async () => {
|
|
98
|
+
const wide = {
|
|
99
|
+
columns: [
|
|
100
|
+
{ type: 'string', name: 'id', hidden: true },
|
|
101
|
+
{ type: 'string', name: 'a', header: 'a', width: 600 },
|
|
102
|
+
{ type: 'string', name: 'b', header: 'b', width: 600 }
|
|
103
|
+
],
|
|
104
|
+
pagination: { pages: [20] }
|
|
105
|
+
}
|
|
106
|
+
const el = (await fixture(html`
|
|
107
|
+
<ox-grist style="height: 300px; width: 500px" mode="GRID" .config=${wide} .fetchHandler=${async () => ({ total: 0, records: [] as Rec[] })}></ox-grist>
|
|
108
|
+
`)) as HTMLElement & { fetch(): Promise<void>; updateComplete: Promise<unknown>; renderRoot: ShadowRoot }
|
|
109
|
+
await el.fetch()
|
|
110
|
+
await settle()
|
|
111
|
+
await el.updateComplete
|
|
112
|
+
|
|
113
|
+
const note = emptyNote(el)
|
|
114
|
+
expect(note, 'a note is drawn').to.exist
|
|
115
|
+
const box = el.getBoundingClientRect()
|
|
116
|
+
const at = note!.getBoundingClientRect()
|
|
117
|
+
/* Inside the 500px the person sees, not centred in the 1200px of columns. */
|
|
118
|
+
expect(at.left >= box.left && at.right <= box.right, `note ${at.left}-${at.right} within grid ${box.left}-${box.right}`).to.equal(true)
|
|
119
|
+
})
|
|
120
|
+
|
|
100
121
|
it('rows from before stay, with a band saying they are not a fresh result; a good fetch clears it', async () => {
|
|
101
122
|
let fail = false
|
|
102
123
|
const el = await grist('GRID', async () => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing'
|
|
2
|
+
|
|
3
|
+
import { RecordCard } from '../src/data-card/record-card.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A card is as tall as its content by default. A list whose cards carry different numbers of lines (a fact row that
|
|
7
|
+
* only some records have) stretches the cards of a row to one height through --data-card-record-card-height.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const text = (styles: unknown) =>
|
|
11
|
+
(Array.isArray(styles) ? styles : [styles]).map(s => String((s as { cssText?: string }).cssText ?? s)).join('\n')
|
|
12
|
+
|
|
13
|
+
describe('record card height', () => {
|
|
14
|
+
it('reads --data-card-record-card-height, min-content when not set', () => {
|
|
15
|
+
const css = text(RecordCard.styles)
|
|
16
|
+
const host = css.slice(css.indexOf(':host {'), css.indexOf('}', css.indexOf(':host {')))
|
|
17
|
+
expect(host).to.contain('height: var(--data-card-record-card-height, min-content);')
|
|
18
|
+
})
|
|
19
|
+
})
|