@operato/app 10.29.41 → 10.29.43
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/dist/src/grist-editor/ox-grist-editor-resource-code.d.ts +0 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js +6 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -1
- package/dist/test/resource-code-editor-commits.test.d.ts +1 -0
- package/dist/test/resource-code-editor-commits.test.js +63 -0
- package/dist/test/resource-code-editor-commits.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/test/resource-code-editor-commits.test.ts +71 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/app",
|
|
3
3
|
"description": "WebApplication production supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.29.
|
|
5
|
+
"version": "10.29.43",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -148,18 +148,18 @@
|
|
|
148
148
|
"@graphql-tools/delegate": "^10.0.1",
|
|
149
149
|
"@graphql-tools/wrap": "^10.0.0",
|
|
150
150
|
"@material/web": "^2.0.0",
|
|
151
|
-
"@operato/attachment": "^10.29.
|
|
152
|
-
"@operato/data-grist": "^10.29.
|
|
153
|
-
"@operato/font": "^10.29.
|
|
154
|
-
"@operato/form": "^10.29.
|
|
155
|
-
"@operato/graphql": "^10.29.
|
|
151
|
+
"@operato/attachment": "^10.29.43",
|
|
152
|
+
"@operato/data-grist": "^10.29.43",
|
|
153
|
+
"@operato/font": "^10.29.43",
|
|
154
|
+
"@operato/form": "^10.29.43",
|
|
155
|
+
"@operato/graphql": "^10.29.43",
|
|
156
156
|
"@operato/i18n": "^10.29.27",
|
|
157
|
-
"@operato/input": "^10.29.
|
|
158
|
-
"@operato/layout": "^10.29.
|
|
159
|
-
"@operato/property-editor": "^10.29.
|
|
160
|
-
"@operato/shell": "^10.29.
|
|
157
|
+
"@operato/input": "^10.29.43",
|
|
158
|
+
"@operato/layout": "^10.29.43",
|
|
159
|
+
"@operato/property-editor": "^10.29.43",
|
|
160
|
+
"@operato/shell": "^10.29.43",
|
|
161
161
|
"@operato/styles": "^10.29.30",
|
|
162
|
-
"@operato/utils": "^10.29.
|
|
162
|
+
"@operato/utils": "^10.29.43",
|
|
163
163
|
"cm6-graphql": "^0.0.14",
|
|
164
164
|
"codemirror": "^6.0.1",
|
|
165
165
|
"cronstrue": "^2.2.0",
|
|
@@ -200,5 +200,5 @@
|
|
|
200
200
|
"prettier --write"
|
|
201
201
|
]
|
|
202
202
|
},
|
|
203
|
-
"gitHead": "
|
|
203
|
+
"gitHead": "ccc06fed313fcc20a076a1cf7bc586fdacaba594"
|
|
204
204
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { expect, fixture, oneEvent } from '@open-wc/testing'
|
|
2
|
+
import { html } from 'lit'
|
|
3
|
+
|
|
4
|
+
import '../src/grist-editor/ox-grist-editor-resource-code.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A code chosen in a code cell reaches the grid.
|
|
8
|
+
*
|
|
9
|
+
* ## Why this test is here (2026-10-19)
|
|
10
|
+
*
|
|
11
|
+
* The code cell edits in place with a `<select>`, but it said `opensPopup`. On 10-17 the base editor stopped
|
|
12
|
+
* committing popup editors on blur — they commit through their own confirmation — and the code cell has none, so from
|
|
13
|
+
* then on nothing committed it: the select changed, the row did not, and saving kept the old 직책 · 직급 (every
|
|
14
|
+
* editable code column in every app). It is an inline editor like data-grist's select editor: it commits on blur, and
|
|
15
|
+
* its cell gets the inline mark, which is gone while the select is open.
|
|
16
|
+
*/
|
|
17
|
+
const column: any = {
|
|
18
|
+
name: 'jobPosition',
|
|
19
|
+
type: 'code',
|
|
20
|
+
record: {
|
|
21
|
+
editable: true,
|
|
22
|
+
selectDispOpt: 'name',
|
|
23
|
+
codes: [
|
|
24
|
+
{ name: '', description: '' },
|
|
25
|
+
{ name: '이사', description: '이사' },
|
|
26
|
+
{ name: '프로', description: '프로' }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function editorOn(value: string) {
|
|
32
|
+
const record: any = { id: 'e1', jobPosition: value }
|
|
33
|
+
const editor: any = await fixture(
|
|
34
|
+
html`<ox-grist-editor-resource-code .column=${column} .record=${record} .row=${3}></ox-grist-editor-resource-code>`
|
|
35
|
+
)
|
|
36
|
+
await editor.updateComplete
|
|
37
|
+
/* firstUpdated is async and fills the editor's value on the next frame. */
|
|
38
|
+
await new Promise(resolve => requestAnimationFrame(() => resolve(undefined)))
|
|
39
|
+
return { editor, select: editor.shadowRoot.querySelector('select') as HTMLSelectElement }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const pick = (select: HTMLSelectElement, value: string) => {
|
|
43
|
+
select.value = value
|
|
44
|
+
select.dispatchEvent(new Event('change', { bubbles: true, composed: true }))
|
|
45
|
+
select.dispatchEvent(new FocusEvent('focusout', { bubbles: true, composed: true }))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
describe('code cell · a chosen code reaches the grid', () => {
|
|
49
|
+
it('choosing another code and leaving the cell sends field-change with the old and the new code', async () => {
|
|
50
|
+
const { editor, select } = await editorOn('프로')
|
|
51
|
+
setTimeout(() => pick(select, '이사'))
|
|
52
|
+
const event: any = await oneEvent(editor, 'field-change')
|
|
53
|
+
expect(event.detail.before).to.equal('프로')
|
|
54
|
+
expect(event.detail.after).to.equal('이사')
|
|
55
|
+
expect(event.detail.row).to.equal(3)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('choosing the code the cell already has sends nothing', async () => {
|
|
59
|
+
const { editor, select } = await editorOn('프로')
|
|
60
|
+
let sent = 0
|
|
61
|
+
editor.addEventListener('field-change', () => sent++)
|
|
62
|
+
pick(select, '프로')
|
|
63
|
+
await new Promise(resolve => setTimeout(resolve, 50))
|
|
64
|
+
expect(sent).to.equal(0)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('it is an inline editor, not a popup one — so its mark is gone while the select is open', async () => {
|
|
68
|
+
const { editor } = await editorOn('프로')
|
|
69
|
+
expect((editor.constructor as any).opensPopup).to.equal(false)
|
|
70
|
+
})
|
|
71
|
+
})
|