@operato/dataset 10.29.78 → 10.29.79
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 +9 -0
- package/dist/src/ox-checklist-entry-form.d.ts +1 -0
- package/dist/src/ox-checklist-entry-form.js +3 -6
- package/dist/src/ox-checklist-entry-form.js.map +1 -1
- package/dist/src/ox-data-entry-form.d.ts +1 -0
- package/dist/src/ox-data-entry-form.js +2 -6
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-input-factory.d.ts +1 -0
- package/dist/src/ox-data-input-factory.js +2 -6
- package/dist/src/ox-data-input-factory.js.map +1 -1
- package/dist/test/date-item.test.d.ts +2 -0
- package/dist/test/date-item.test.js +49 -0
- package/dist/test/date-item.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/test/date-item.test.ts +55 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/dataset",
|
|
3
3
|
"description": "WebApplication dataset supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.29.
|
|
5
|
+
"version": "10.29.79",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -117,15 +117,15 @@
|
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"@material/web": "^2.0.0",
|
|
120
|
-
"@operato/data-grist": "^10.29.
|
|
121
|
-
"@operato/graphql": "^10.29.
|
|
122
|
-
"@operato/grist-editor": "^10.29.
|
|
120
|
+
"@operato/data-grist": "^10.29.79",
|
|
121
|
+
"@operato/graphql": "^10.29.79",
|
|
122
|
+
"@operato/grist-editor": "^10.29.79",
|
|
123
123
|
"@operato/i18n": "^10.29.27",
|
|
124
|
-
"@operato/input": "^10.29.
|
|
125
|
-
"@operato/popup": "^10.29.
|
|
126
|
-
"@operato/property-editor": "^10.29.
|
|
127
|
-
"@operato/shell": "^10.29.
|
|
128
|
-
"@operato/styles": "^10.29.
|
|
124
|
+
"@operato/input": "^10.29.79",
|
|
125
|
+
"@operato/popup": "^10.29.79",
|
|
126
|
+
"@operato/property-editor": "^10.29.79",
|
|
127
|
+
"@operato/shell": "^10.29.79",
|
|
128
|
+
"@operato/styles": "^10.29.79",
|
|
129
129
|
"@operato/utils": "^10.29.76",
|
|
130
130
|
"lit": "^3.1.2"
|
|
131
131
|
},
|
|
@@ -161,5 +161,5 @@
|
|
|
161
161
|
"prettier --write"
|
|
162
162
|
]
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "f86fbc40c2d343d7996573fe49f82829c1ac1ea4"
|
|
165
165
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { expect, fixture, oneEvent } from '@open-wc/testing'
|
|
2
|
+
import { sendKeys } from '@web/test-runner-commands'
|
|
3
|
+
import { html } from 'lit'
|
|
4
|
+
|
|
5
|
+
import { i18next } from '@operato/i18n'
|
|
6
|
+
import { OxInputDate } from '@operato/input/ox-input-date.js'
|
|
7
|
+
|
|
8
|
+
import '../src/ox-data-entry-form.js'
|
|
9
|
+
import '../src/ox-checklist-entry-form.js'
|
|
10
|
+
|
|
11
|
+
/* A date item of a data set is entered in the one field for days (ox-input-date); what is typed is the item's value. */
|
|
12
|
+
describe('a date item', () => {
|
|
13
|
+
const touchQuery = OxInputDate.touchQuery
|
|
14
|
+
let previousLanguage: string
|
|
15
|
+
before(async () => {
|
|
16
|
+
OxInputDate.touchQuery = 'not all'
|
|
17
|
+
previousLanguage = i18next.language
|
|
18
|
+
await i18next.changeLanguage('ko')
|
|
19
|
+
})
|
|
20
|
+
after(async () => {
|
|
21
|
+
OxInputDate.touchQuery = touchQuery
|
|
22
|
+
/* The language is kept in the browser's storage; the next test file must not start in Korean. */
|
|
23
|
+
await i18next.changeLanguage(previousLanguage)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const dataSet = {
|
|
27
|
+
name: 'inspection',
|
|
28
|
+
description: '',
|
|
29
|
+
dataItems: [{ name: 'checked on', tag: 'checkedOn', type: 'date', active: true, quota: 1, options: {} }]
|
|
30
|
+
} as any
|
|
31
|
+
|
|
32
|
+
it('is entered in the field and read into the form\'s value', async () => {
|
|
33
|
+
const form = await fixture<any>(html`<ox-data-entry-form .dataSet=${dataSet} .value=${{ checkedOn: '2026-01-01' }}></ox-data-entry-form>`)
|
|
34
|
+
const field = form.renderRoot.querySelector('ox-input-date[name="checkedOn"]') as OxInputDate
|
|
35
|
+
expect(field, 'no day field').to.exist
|
|
36
|
+
await field.updateComplete
|
|
37
|
+
const input = field.renderRoot.querySelector('input') as HTMLInputElement
|
|
38
|
+
expect(input.value).to.equal('2026-01-01')
|
|
39
|
+
|
|
40
|
+
input.focus()
|
|
41
|
+
input.select()
|
|
42
|
+
setTimeout(async () => {
|
|
43
|
+
await sendKeys({ type: '1110' })
|
|
44
|
+
await sendKeys({ press: 'Enter' })
|
|
45
|
+
})
|
|
46
|
+
const { detail } = await oneEvent(form, 'change')
|
|
47
|
+
expect(detail.checkedOn).to.deep.equal(['2026-11-10'])
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('is the same field in a checklist', async () => {
|
|
51
|
+
const form = await fixture<any>(html`<ox-checklist-entry-form .dataSet=${dataSet}></ox-checklist-entry-form>`)
|
|
52
|
+
expect(form.renderRoot.querySelector('ox-input-date[name="checkedOn"]'), 'no day field').to.exist
|
|
53
|
+
expect(form.renderRoot.querySelector('input[type="date"]')).to.not.exist
|
|
54
|
+
})
|
|
55
|
+
})
|