@operato/attribute 10.29.81 → 10.29.84
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/dist/stories/ox-attribute-form.stories.d.ts +18 -0
- package/dist/stories/ox-attribute-form.stories.js +113 -0
- package/dist/stories/ox-attribute-view.stories.d.ts +18 -0
- package/dist/stories/ox-attribute-view.stories.js +106 -0
- package/dist/stories/ox-grist-editor-attributes.stories.d.ts +25 -0
- package/dist/stories/ox-grist-editor-attributes.stories.js +321 -0
- package/package.json +26 -12
- package/CHANGELOG.md +0 -4882
- package/dist/src/grist-editor/index.js.map +0 -1
- package/dist/src/grist-editor/ox-grist-editor-attributes.js.map +0 -1
- package/dist/src/grist-editor/ox-popup-attributes.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/ox-attribute-form.js.map +0 -1
- package/dist/src/ox-attribute-view.js.map +0 -1
- package/dist/src/types.js.map +0 -1
- package/dist/test/attribute-file.test.d.ts +0 -2
- package/dist/test/attribute-file.test.js +0 -45
- package/dist/test/attribute-file.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/test/attribute-file.test.ts +0 -51
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing'
|
|
2
|
-
import { html } from 'lit'
|
|
3
|
-
|
|
4
|
-
import '../src/ox-attribute-form.js'
|
|
5
|
-
import '../src/ox-attribute-view.js'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A file attribute.
|
|
9
|
-
*
|
|
10
|
-
* ## Why this is tested
|
|
11
|
-
*
|
|
12
|
-
* The `file` case fell through to `secret` in both the form and the view: a file attribute drew a
|
|
13
|
-
* password box (form) or "********" (view), and no file could be attached. What must hold: a file
|
|
14
|
-
* attribute is drawn with the file picker, and only with it.
|
|
15
|
-
*/
|
|
16
|
-
describe('file attribute', () => {
|
|
17
|
-
const attributeSet = {
|
|
18
|
-
entity: 'paper',
|
|
19
|
-
description: '',
|
|
20
|
-
items: [{ name: 'scan', description: '', tag: 'scan', type: 'file', active: true, options: {} }]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
for (const tag of ['ox-attribute-form', 'ox-attribute-view']) {
|
|
24
|
-
it(`${tag} draws the file picker`, async () => {
|
|
25
|
-
const el: any = await fixture(
|
|
26
|
-
tag === 'ox-attribute-form'
|
|
27
|
-
? html`<ox-attribute-form .attributeSet=${attributeSet}></ox-attribute-form>`
|
|
28
|
-
: html`<ox-attribute-view .attributeSet=${attributeSet}></ox-attribute-view>`
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
expect(el.renderRoot.querySelector('ox-input-file[name="scan"]'), 'no file picker').to.exist
|
|
32
|
-
expect(el.renderRoot.querySelector('input[type="password"], [secret-container]'), 'a password box instead').to.not.exist
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
/* A date attribute is the one field for days (ox-input-date), not the browser's date input. */
|
|
38
|
-
describe('date attribute', () => {
|
|
39
|
-
it('draws the day field and gives the form its value', async () => {
|
|
40
|
-
const attributeSet = {
|
|
41
|
-
entity: 'paper',
|
|
42
|
-
description: '',
|
|
43
|
-
items: [{ name: 'issued', description: '', tag: 'issued', type: 'date', active: true, options: {} }]
|
|
44
|
-
}
|
|
45
|
-
const el: any = await fixture(html`<ox-attribute-form .attributeSet=${attributeSet} .value=${{ issued: '2026-11-10' }}></ox-attribute-form>`)
|
|
46
|
-
const field = el.renderRoot.querySelector('ox-input-date[name="issued"]')
|
|
47
|
-
expect(field, 'no day field').to.exist
|
|
48
|
-
expect(el.renderRoot.querySelector('input[type="date"]')).to.not.exist
|
|
49
|
-
expect(field.value).to.equal('2026-11-10')
|
|
50
|
-
})
|
|
51
|
-
})
|