@operato/data-grist 10.29.17 → 10.29.20
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 +17 -0
- package/coverage/lcov-report/index.html +50 -50
- package/coverage/lcov-report/webpack/bootstrap.html +1 -1
- package/coverage/lcov-report/webpack/index.html +1 -1
- package/coverage/lcov-report/webpack/runtime/define property getters.html +1 -1
- package/coverage/lcov-report/webpack/runtime/global.html +1 -1
- package/coverage/lcov-report/webpack/runtime/hasOwnProperty shorthand.html +1 -1
- package/coverage/lcov-report/webpack/runtime/index.html +1 -1
- package/coverage/lcov-report/webpack/runtime/make namespace object.html +1 -1
- package/coverage/lcov.info +22107 -22049
- package/dist/src/record-view/event-handlers/record-view-body-click-handler.d.ts +1 -1
- package/dist/src/record-view/event-handlers/record-view-body-click-handler.js +23 -1
- package/dist/src/record-view/event-handlers/record-view-body-click-handler.js.map +1 -1
- package/dist/test/record-view-popup-editor.test.d.ts +1 -0
- package/dist/test/record-view-popup-editor.test.js +58 -0
- package/dist/test/record-view-popup-editor.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/test/record-view-popup-editor.test.ts +68 -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.20",
|
|
4
4
|
"description": "User interface for grid (desktop) and list (mobile)",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"type": "module",
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"@material/web": "^2.0.0",
|
|
71
71
|
"@operato/headroom": "^10.29.1",
|
|
72
72
|
"@operato/i18n": "^10.29.1",
|
|
73
|
-
"@operato/input": "^10.29.
|
|
74
|
-
"@operato/list-state": "^10.29.
|
|
75
|
-
"@operato/p13n": "^10.29.
|
|
76
|
-
"@operato/popup": "^10.29.
|
|
73
|
+
"@operato/input": "^10.29.20",
|
|
74
|
+
"@operato/list-state": "^10.29.20",
|
|
75
|
+
"@operato/p13n": "^10.29.20",
|
|
76
|
+
"@operato/popup": "^10.29.20",
|
|
77
77
|
"@operato/pull-to-refresh": "^10.29.1",
|
|
78
78
|
"@operato/styles": "^10.29.17",
|
|
79
79
|
"@operato/time-calculator": "^10.29.1",
|
|
80
|
-
"@operato/utils": "^10.29.
|
|
80
|
+
"@operato/utils": "^10.29.20",
|
|
81
81
|
"i18next": "^24.2.1",
|
|
82
82
|
"json5": "^2.2.0",
|
|
83
83
|
"lit": "^3.1.2",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"prettier --write"
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "d1f454a95c5aead1bbe2169d107c7b6f5f98c525"
|
|
120
120
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
|
|
5
|
+
import '../src/record-view/record-view.js'
|
|
6
|
+
import { buildColumn } from '../src/configure/column-builder.js'
|
|
7
|
+
import { OxGristEditor } from '../src/editors/ox-grist-editor.js'
|
|
8
|
+
import { registerEditor } from '../src/editors/registry.js'
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* In a form (ox-record-view - the 「만들기」 dialog of a grid) a field is pressed to be edited. A field whose editor
|
|
12
|
+
* opens a popup used to become 「editing」 on the first press but open nothing until its editor was pressed again,
|
|
13
|
+
* so what was typed after the first press went nowhere (pdf template 「만들기」, body HTML, 2026-10-10).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
let opened = 0
|
|
17
|
+
|
|
18
|
+
class ProbePopupEditor extends OxGristEditor {
|
|
19
|
+
static opensPopup = true
|
|
20
|
+
|
|
21
|
+
_onclick(e: Event): void {
|
|
22
|
+
e.stopPropagation()
|
|
23
|
+
opened++
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
customElements.define('probe-popup-editor', ProbePopupEditor)
|
|
27
|
+
registerEditor('probe-popup', ProbePopupEditor)
|
|
28
|
+
|
|
29
|
+
const settle = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms))
|
|
30
|
+
|
|
31
|
+
describe('a popup field in a form', () => {
|
|
32
|
+
it('opens its popup on the first press', async () => {
|
|
33
|
+
opened = 0
|
|
34
|
+
const columns = [
|
|
35
|
+
buildColumn({ type: 'string', name: 'name', header: 'name', record: { editable: true } } as any),
|
|
36
|
+
buildColumn({ type: 'probe-popup', name: 'body', header: 'body', record: { editable: true } } as any)
|
|
37
|
+
]
|
|
38
|
+
const view = (await fixture(html`<ox-record-view .columns=${columns} .record=${{}}></ox-record-view>`)) as any
|
|
39
|
+
await view.updateComplete
|
|
40
|
+
await settle()
|
|
41
|
+
|
|
42
|
+
const body = view.renderRoot.querySelector('ox-record-view-body') as any
|
|
43
|
+
await body.updateComplete
|
|
44
|
+
const field = Array.from(body.renderRoot.querySelectorAll('ox-grid-field') as NodeListOf<any>).find(one => one.column?.name === 'body')
|
|
45
|
+
expect(!!field, 'the body field is drawn').to.equal(true)
|
|
46
|
+
|
|
47
|
+
field.click()
|
|
48
|
+
await settle(200)
|
|
49
|
+
|
|
50
|
+
expect(field.getAttribute('editing'), 'the field is being edited').to.equal('true')
|
|
51
|
+
expect(opened, 'the popup editor was opened once').to.equal(1)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('leaves a field edited in place as it was - nothing extra is pressed', async () => {
|
|
55
|
+
opened = 0
|
|
56
|
+
const columns = [buildColumn({ type: 'string', name: 'name', header: 'name', record: { editable: true } } as any)]
|
|
57
|
+
const view = (await fixture(html`<ox-record-view .columns=${columns} .record=${{}}></ox-record-view>`)) as any
|
|
58
|
+
await view.updateComplete
|
|
59
|
+
await settle()
|
|
60
|
+
const body = view.renderRoot.querySelector('ox-record-view-body') as any
|
|
61
|
+
await body.updateComplete
|
|
62
|
+
const field = body.renderRoot.querySelector('ox-grid-field') as any
|
|
63
|
+
field.click()
|
|
64
|
+
await settle(200)
|
|
65
|
+
expect(field.getAttribute('editing')).to.equal('true')
|
|
66
|
+
expect(opened).to.equal(0)
|
|
67
|
+
})
|
|
68
|
+
})
|