@operato/input 1.0.0-beta.43 → 1.0.0-beta.46
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 +29 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-input-data.js +1 -1
- package/dist/src/ox-input-data.js.map +1 -1
- package/dist/src/ox-input-options.js +1 -0
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-quantifier.d.ts +11 -0
- package/dist/src/ox-input-quantifier.js +67 -0
- package/dist/src/ox-input-quantifier.js.map +1 -0
- package/dist/src/ox-input-work-shift.js +2 -1
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/src/ox-select.js +1 -2
- package/dist/src/ox-select.js.map +1 -1
- package/dist/stories/ox-input-barcode.stories.js +7 -0
- package/dist/stories/ox-input-barcode.stories.js.map +1 -1
- package/dist/stories/ox-input-quantifier.stories.d.ts +25 -0
- package/dist/stories/ox-input-quantifier.stories.js +27 -0
- package/dist/stories/ox-input-quantifier.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/src/index.ts +1 -0
- package/src/ox-input-data.ts +2 -2
- package/src/ox-input-options.ts +1 -0
- package/src/ox-input-quantifier.ts +62 -0
- package/src/ox-input-work-shift.ts +3 -1
- package/src/ox-select.ts +1 -2
- package/stories/ox-input-barcode.stories.ts +7 -0
- package/stories/ox-input-quantifier.stories.ts +43 -0
@@ -121,6 +121,8 @@ export class OxInputWorkShift extends OxFormField {
|
|
121
121
|
}
|
122
122
|
|
123
123
|
render() {
|
124
|
+
const workshifts = this.value || []
|
125
|
+
|
124
126
|
return html`
|
125
127
|
<div data-header>
|
126
128
|
<span>${msg('name')}</span>
|
@@ -131,7 +133,7 @@ export class OxInputWorkShift extends OxFormField {
|
|
131
133
|
<empty-element></empty-element>
|
132
134
|
</div>
|
133
135
|
|
134
|
-
${
|
136
|
+
${workshifts.map(
|
135
137
|
item => html`
|
136
138
|
<div data-record>
|
137
139
|
<input type="text" data-name .value=${item.name} required />
|
package/src/ox-select.ts
CHANGED
@@ -46,7 +46,6 @@ export class Select extends OxFormField {
|
|
46
46
|
padding: var(--input-padding);
|
47
47
|
font: var(--input-font);
|
48
48
|
color: var(--primary-text-color);
|
49
|
-
max-height: 17px;
|
50
49
|
}
|
51
50
|
|
52
51
|
span {
|
@@ -112,7 +111,7 @@ export class Select extends OxFormField {
|
|
112
111
|
this.addEventListener('keydown', (e: KeyboardEvent) => {
|
113
112
|
e.preventDefault()
|
114
113
|
|
115
|
-
if (e.key === ' ' || e.key
|
114
|
+
if (e.key === ' ' || e.key === 'Spacebar' || e.key === 'ArrowDown') {
|
116
115
|
this.expand()
|
117
116
|
}
|
118
117
|
})
|
@@ -39,6 +39,13 @@ const Template: Story<ArgTypes> = ({
|
|
39
39
|
}: ArgTypes) => html`
|
40
40
|
<link href="/themes/app-theme.css" rel="stylesheet" />
|
41
41
|
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
42
|
+
<style>
|
43
|
+
ox-input-barcode {
|
44
|
+
font-size: 80px;
|
45
|
+
--input-font: initial;
|
46
|
+
}
|
47
|
+
</style>
|
48
|
+
|
42
49
|
<ox-input-barcode
|
43
50
|
name=${name}
|
44
51
|
?without-enter=${withoutEnter}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import '../src/ox-input-quantifier.js'
|
2
|
+
|
3
|
+
import { html, TemplateResult } from 'lit'
|
4
|
+
|
5
|
+
import { OxInputQuantifier } from '../src/ox-input-quantifier.js'
|
6
|
+
|
7
|
+
export default {
|
8
|
+
title: 'ox-input-quantifier',
|
9
|
+
component: 'ox-input-quantifier',
|
10
|
+
argTypes: {
|
11
|
+
name: { control: 'text' },
|
12
|
+
value: { control: 'array' }
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
interface Story<T> {
|
17
|
+
(args: T): TemplateResult
|
18
|
+
args?: Partial<T>
|
19
|
+
argTypes?: Record<string, unknown>
|
20
|
+
}
|
21
|
+
|
22
|
+
interface ArgTypes {
|
23
|
+
name?: string
|
24
|
+
value?: number[]
|
25
|
+
}
|
26
|
+
|
27
|
+
const Template: Story<ArgTypes> = ({ name = 'quantifier', value }: ArgTypes) => html`
|
28
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
29
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
30
|
+
|
31
|
+
<ox-input-quantifier
|
32
|
+
name=${name}
|
33
|
+
.value=${value}
|
34
|
+
@change=${(e: Event) => console.log((e.target as OxInputQuantifier).value)}
|
35
|
+
>
|
36
|
+
</ox-input-quantifier>
|
37
|
+
`
|
38
|
+
|
39
|
+
export const Regular = Template.bind({})
|
40
|
+
Regular.args = {
|
41
|
+
name: 'quantifier',
|
42
|
+
value: [10, 100]
|
43
|
+
}
|