@operato/input 10.10.0 → 10.10.5
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/dist/src/image-selector.d.ts +5 -5
- package/dist/src/image-selector.js +22 -29
- package/dist/src/image-selector.js.map +1 -1
- package/dist/src/ox-input-background-pattern.d.ts +6 -6
- package/dist/src/ox-input-background-pattern.js +7 -7
- package/dist/src/ox-input-background-pattern.js.map +1 -1
- package/dist/src/ox-input-formula.js +6 -6
- package/dist/src/ox-input-formula.js.map +1 -1
- package/dist/src/ox-input-search.js +7 -7
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/test/image-selector.test.js +17 -16
- package/dist/test/image-selector.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/test/image-selector.test.ts +17 -16
- package/yarn-error.log +17084 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/input",
|
|
3
3
|
"description": "Webcomponents for input following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh@hatiolab.com",
|
|
5
|
-
"version": "10.10.
|
|
5
|
+
"version": "10.10.5",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
"@material/web": "^2.0.0",
|
|
252
252
|
"@operato/i18n": "^10.0.0",
|
|
253
253
|
"@operato/pickr": "^10.0.0",
|
|
254
|
-
"@operato/popup": "^10.10.
|
|
254
|
+
"@operato/popup": "^10.10.5",
|
|
255
255
|
"@operato/styles": "^10.10.0",
|
|
256
256
|
"@operato/utils": "^10.7.0",
|
|
257
257
|
"@types/codemirror": "^5.60.5",
|
|
@@ -294,5 +294,5 @@
|
|
|
294
294
|
"prettier --write"
|
|
295
295
|
]
|
|
296
296
|
},
|
|
297
|
-
"gitHead": "
|
|
297
|
+
"gitHead": "8459323af943b966a724dae76253d11bc013bbaa"
|
|
298
298
|
}
|
|
@@ -5,39 +5,41 @@ import '../src/ox-input-background-pattern.js'
|
|
|
5
5
|
import { registerImageSelector } from '../src/image-selector.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* The image-picking slot.
|
|
9
9
|
*
|
|
10
|
-
* ##
|
|
10
|
+
* ## Why this is tested
|
|
11
11
|
*
|
|
12
|
-
* `@operato/input`
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* `@operato/input` used to import `@operato/attachment` directly. The bottom layer reached for a
|
|
13
|
+
* feature above it, closing a cycle (input ▶ attachment ▶ data-grist ▶ input) that stopped this
|
|
14
|
+
* package from building — TS5055 on seven files, with `noEmitOnError`.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* Reversing that arrow has to hold two things:
|
|
17
17
|
*
|
|
18
18
|
* ```
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* never empty with nothing registered there must still be a field; an unregistered
|
|
20
|
+
* custom element renders as a silent empty box
|
|
21
|
+
* value lands either branch carries value-key and raises change, so the value takes
|
|
22
|
+
* the same path out
|
|
21
23
|
* ```
|
|
22
24
|
*/
|
|
23
|
-
describe('
|
|
25
|
+
describe('image-picking field', () => {
|
|
24
26
|
async function pattern(value: any = {}) {
|
|
25
27
|
const el: any = await fixture(html`<ox-input-background-pattern .value=${value}></ox-input-background-pattern>`)
|
|
26
28
|
await el.updateComplete
|
|
27
29
|
return el
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
it('
|
|
32
|
+
it('falls back to a text box when nothing is registered', async () => {
|
|
31
33
|
const el = await pattern({ image: 'https://example.com/a.png' })
|
|
32
34
|
|
|
33
35
|
const field = el.renderRoot.querySelector('[value-key="image"]') as HTMLInputElement
|
|
34
36
|
|
|
35
|
-
expect(field, '
|
|
37
|
+
expect(field, 'no image field at all').to.exist
|
|
36
38
|
expect(field.tagName).to.equal('INPUT')
|
|
37
|
-
expect(field.value, '
|
|
39
|
+
expect(field.value, 'existing address did not reach the field').to.equal('https://example.com/a.png')
|
|
38
40
|
})
|
|
39
41
|
|
|
40
|
-
it('
|
|
42
|
+
it('takes an address typed into the fallback text box', async () => {
|
|
41
43
|
const el = await pattern({})
|
|
42
44
|
|
|
43
45
|
const field = el.renderRoot.querySelector('[value-key="image"]') as HTMLInputElement
|
|
@@ -47,7 +49,7 @@ describe('그림 고르는 칸은 위 layer 가 채운다', () => {
|
|
|
47
49
|
expect(el.value.image).to.equal('https://example.com/b.png')
|
|
48
50
|
})
|
|
49
51
|
|
|
50
|
-
it('
|
|
52
|
+
it('swaps in the registered field, even when registration lands after render', async () => {
|
|
51
53
|
class FakeSelector extends HTMLElement {
|
|
52
54
|
value: any
|
|
53
55
|
properties: any
|
|
@@ -56,7 +58,6 @@ describe('그림 고르는 칸은 위 layer 가 채운다', () => {
|
|
|
56
58
|
|
|
57
59
|
const el = await pattern({ image: 'https://example.com/c.png' })
|
|
58
60
|
|
|
59
|
-
/* 요소가 먼저 그려지고 등록이 나중에 와도 자리가 글자 칸으로 남아 있으면 안 된다. */
|
|
60
61
|
registerImageSelector('test-image-selector')
|
|
61
62
|
await el.updateComplete
|
|
62
63
|
|
|
@@ -67,7 +68,7 @@ describe('그림 고르는 칸은 위 layer 가 채운다', () => {
|
|
|
67
68
|
expect(field.properties).to.deep.equal({ category: 'image' })
|
|
68
69
|
})
|
|
69
70
|
|
|
70
|
-
it('
|
|
71
|
+
it('takes a change raised by the registered field the same way', async () => {
|
|
71
72
|
registerImageSelector('test-image-selector')
|
|
72
73
|
|
|
73
74
|
const el = await pattern({})
|