@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.
@@ -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
- ${this.value.map(
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 == 'Spacebar' || e.key == 'ArrowDown') {
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
+ }