@operato/data-grist 10.29.29 → 10.29.31
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 +18 -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 +59697 -0
- package/dist/src/data-card/ox-card-thumb.d.ts +33 -0
- package/dist/src/data-card/ox-card-thumb.js +115 -0
- package/dist/src/data-card/ox-card-thumb.js.map +1 -0
- package/dist/src/filters/filter-checkbox.js +1 -1
- package/dist/src/filters/filter-checkbox.js.map +1 -1
- package/dist/src/filters/filters-form.js +1 -1
- package/dist/src/filters/filters-form.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/test/card-thumb.test.d.ts +1 -0
- package/dist/test/card-thumb.test.js +44 -0
- package/dist/test/card-thumb.test.js.map +1 -0
- package/dist/test/filter-labels.test.js +28 -0
- package/dist/test/filter-labels.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -7
- package/test/card-thumb.test.ts +51 -0
- package/test/filter-labels.test.ts +31 -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.31",
|
|
4
4
|
"description": "User interface for grid (desktop) and list (mobile)",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"./ox-sorters-control.js": "./dist/src/sorters/sorters-control.js",
|
|
28
28
|
"./ox-record-creator.js": "./dist/src/record-view/ox-record-creator.js",
|
|
29
29
|
"./ox-grist-personalizer.js": "./dist/src/personalizer/ox-grist-personalizer.js",
|
|
30
|
-
"./ox-popup-code-input.js": "./dist/src/editors/ox-popup-code-input.js"
|
|
30
|
+
"./ox-popup-code-input.js": "./dist/src/editors/ox-popup-code-input.js",
|
|
31
|
+
"./ox-card-thumb.js": "./dist/src/data-card/ox-card-thumb.js"
|
|
31
32
|
},
|
|
32
33
|
"typesVersions": {
|
|
33
34
|
"*": {
|
|
@@ -51,6 +52,9 @@
|
|
|
51
52
|
],
|
|
52
53
|
"ox-popup-code-input.js": [
|
|
53
54
|
"dist/src/personalizer/ox-grist-personalizer.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"ox-card-thumb.js": [
|
|
57
|
+
"dist/src/data-card/ox-card-thumb.d.ts"
|
|
54
58
|
]
|
|
55
59
|
}
|
|
56
60
|
},
|
|
@@ -70,12 +74,12 @@
|
|
|
70
74
|
"@material/web": "^2.0.0",
|
|
71
75
|
"@operato/headroom": "^10.29.1",
|
|
72
76
|
"@operato/i18n": "^10.29.27",
|
|
73
|
-
"@operato/input": "^10.29.
|
|
77
|
+
"@operato/input": "^10.29.30",
|
|
74
78
|
"@operato/list-state": "^10.29.27",
|
|
75
|
-
"@operato/p13n": "^10.29.
|
|
76
|
-
"@operato/popup": "^10.29.
|
|
79
|
+
"@operato/p13n": "^10.29.30",
|
|
80
|
+
"@operato/popup": "^10.29.30",
|
|
77
81
|
"@operato/pull-to-refresh": "^10.29.23",
|
|
78
|
-
"@operato/styles": "^10.29.
|
|
82
|
+
"@operato/styles": "^10.29.30",
|
|
79
83
|
"@operato/time-calculator": "^10.29.1",
|
|
80
84
|
"@operato/utils": "^10.29.23",
|
|
81
85
|
"i18next": "^24.2.1",
|
|
@@ -116,5 +120,5 @@
|
|
|
116
120
|
"prettier --write"
|
|
117
121
|
]
|
|
118
122
|
},
|
|
119
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "0b1246851e25dae823d204c352757c93585f6612"
|
|
120
124
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing'
|
|
2
|
+
|
|
3
|
+
import '../src/data-card/ox-card-thumb.js'
|
|
4
|
+
import type { OxCardThumb } from '../src/data-card/ox-card-thumb.js'
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* The one picture cell of a catalog card (ADR-0117 amendment 2026-10-13): the picture whole, an icon when there is
|
|
8
|
+
* none, at most one marker in the top-left corner, and a seam under it.
|
|
9
|
+
*/
|
|
10
|
+
describe('ox-card-thumb', () => {
|
|
11
|
+
it('★ shows the picture whole, never cropped, with a seam under it', async () => {
|
|
12
|
+
const thumb = await fixture<OxCardThumb>(html`<ox-card-thumb
|
|
13
|
+
style="--md-sys-color-outline-variant: rgb(200, 200, 200)"
|
|
14
|
+
src="data:image/gif;base64,R0lGODlhAQABAAAAACw="
|
|
15
|
+
alt="a board"
|
|
16
|
+
></ox-card-thumb>`)
|
|
17
|
+
const img = thumb.shadowRoot!.querySelector('img')!
|
|
18
|
+
expect(img.getAttribute('alt')).to.equal('a board')
|
|
19
|
+
expect(getComputedStyle(img).objectFit).to.equal('contain')
|
|
20
|
+
expect(getComputedStyle(thumb).borderBottomStyle).to.equal('solid')
|
|
21
|
+
expect(thumb.shadowRoot!.querySelector('[empty]')).to.equal(null)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('★ draws its icon when there is no picture, or the empty slot when one is given', async () => {
|
|
25
|
+
const bare = await fixture<OxCardThumb>(html`<ox-card-thumb icon="dashboard"></ox-card-thumb>`)
|
|
26
|
+
expect(bare.shadowRoot!.querySelector('[empty] md-icon')!.textContent).to.equal('dashboard')
|
|
27
|
+
|
|
28
|
+
const marked = await fixture<OxCardThumb>(html`<ox-card-thumb><span slot="empty" id="mark">no picture</span></ox-card-thumb>`)
|
|
29
|
+
const slot = marked.shadowRoot!.querySelector('slot[name="empty"]') as HTMLSlotElement
|
|
30
|
+
expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['mark'])
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('★ says one thing in the corner, in its tone, and nothing when there is nothing to say', async () => {
|
|
34
|
+
const quiet = await fixture<OxCardThumb>(html`<ox-card-thumb></ox-card-thumb>`)
|
|
35
|
+
expect(quiet.shadowRoot!.querySelector('[badge]')).to.equal(null)
|
|
36
|
+
|
|
37
|
+
const warned = await fixture<OxCardThumb>(html`<ox-card-thumb badge="not latest" tone="warn"></ox-card-thumb>`)
|
|
38
|
+
const badge = warned.shadowRoot!.querySelector('[badge]') as HTMLElement
|
|
39
|
+
expect(badge.textContent).to.equal('not latest')
|
|
40
|
+
expect(badge.getAttribute('tone')).to.equal('warn')
|
|
41
|
+
expect(getComputedStyle(badge).position).to.equal('absolute')
|
|
42
|
+
expect(getComputedStyle(badge).top).to.equal('6px')
|
|
43
|
+
expect(getComputedStyle(badge).left).to.equal('6px')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('lays the default slot over the picture for an action that belongs to it', async () => {
|
|
47
|
+
const thumb = await fixture<OxCardThumb>(html`<ox-card-thumb><button id="del">x</button></ox-card-thumb>`)
|
|
48
|
+
const slot = thumb.shadowRoot!.querySelector('slot:not([name])') as HTMLSlotElement
|
|
49
|
+
expect(slot.assignedElements().map(e => e.id)).to.deep.equal(['del'])
|
|
50
|
+
})
|
|
51
|
+
})
|
|
@@ -65,4 +65,35 @@ describe('필터 라벨', () => {
|
|
|
65
65
|
expect(label!.querySelector('span')?.textContent?.trim()).to.equal(name)
|
|
66
66
|
}
|
|
67
67
|
})
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* A header may draw more than its words - a help `?` beside them. The filter is not the header: it names the column
|
|
71
|
+
* by its words, or a press on that `?` would also tick the checkbox around it.
|
|
72
|
+
*/
|
|
73
|
+
it('names a filter by the header words when the header draws more', async () => {
|
|
74
|
+
const drawn = [
|
|
75
|
+
{ type: 'checkbox', name: 'flag', header: { text: 'flag', renderer: () => html`flag <button class="extra">?</button>` }, filter: true },
|
|
76
|
+
{ type: 'select', name: 'kind', header: { text: 'kind', renderer: () => html`kind <button class="extra">?</button>` }, record: { options: ['', 'A'] }, filter: true }
|
|
77
|
+
]
|
|
78
|
+
const el = (await fixture(html`
|
|
79
|
+
<ox-grist
|
|
80
|
+
style="height: 300px"
|
|
81
|
+
mode="GRID"
|
|
82
|
+
.config=${{ columns: drawn, pagination: { pages: [20] } }}
|
|
83
|
+
.fetchHandler=${async () => ({ page: 1, limit: 20, total: 0, records: [] })}
|
|
84
|
+
>
|
|
85
|
+
<div slot="headroom"><ox-filters-form without-search></ox-filters-form></div>
|
|
86
|
+
</ox-grist>
|
|
87
|
+
`)) as any
|
|
88
|
+
await settle()
|
|
89
|
+
|
|
90
|
+
const form = el.querySelector('ox-filters-form') as any
|
|
91
|
+
await form.updateComplete
|
|
92
|
+
const root = form.renderRoot as ShadowRoot
|
|
93
|
+
const deep = (node: ParentNode): boolean =>
|
|
94
|
+
Array.from(node.querySelectorAll('*')).some(one => one.matches('button.extra') || (!!one.shadowRoot && deep(one.shadowRoot)))
|
|
95
|
+
expect(deep(root), 'the header drawing is not in the filter form').to.equal(false)
|
|
96
|
+
expect(root.textContent).to.contain('flag')
|
|
97
|
+
expect(root.textContent).to.contain('kind')
|
|
98
|
+
})
|
|
68
99
|
})
|