@operato/input 1.1.28 → 1.1.31
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 +18 -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-select-buttons.d.ts +18 -0
- package/dist/src/ox-input-select-buttons.js +85 -0
- package/dist/src/ox-input-select-buttons.js.map +1 -0
- package/dist/src/ox-input-unit-number.js +1 -0
- package/dist/src/ox-input-unit-number.js.map +1 -1
- package/dist/src/ox-input-work-shift.d.ts +0 -1
- package/dist/src/ox-input-work-shift.js +2 -3
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/stories/ox-input-select-buttons.stories.d.ts +34 -0
- package/dist/stories/ox-input-select-buttons.stories.js +63 -0
- package/dist/stories/ox-input-select-buttons.stories.js.map +1 -0
- package/dist/stories/ox-input-unit.stories.d.ts +1 -0
- package/dist/stories/ox-input-unit.stories.js +8 -0
- package/dist/stories/ox-input-unit.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/ox-input-select-buttons.ts +86 -0
- package/src/ox-input-unit-number.ts +1 -0
- package/src/ox-input-work-shift.ts +2 -4
- package/stories/ox-input-select-buttons.stories.ts +80 -0
- package/stories/ox-input-unit.stories.ts +9 -0
@@ -2,8 +2,6 @@
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
4
|
|
5
|
-
import './ox-input-color'
|
6
|
-
|
7
5
|
import { css, html } from 'lit'
|
8
6
|
import { customElement, property } from 'lit/decorators.js'
|
9
7
|
|
@@ -138,14 +136,14 @@ export class OxInputWorkShift extends OxFormField {
|
|
138
136
|
<div data-record>
|
139
137
|
<input type="text" data-name .value=${item.name} required />
|
140
138
|
|
141
|
-
<select data-from-date .value=${item.fromDate || 0}>
|
139
|
+
<select data-from-date .value=${String(item.fromDate || 0)}>
|
142
140
|
<option value="-1">${msg('The day before')}</option>
|
143
141
|
<option value="0">${msg('The day')}</option>
|
144
142
|
<option value="1">${msg('The day after')}</option>
|
145
143
|
</select>
|
146
144
|
<input type="time" data-from-time .value=${item.fromTime} step="1800" required />
|
147
145
|
|
148
|
-
<select data-to-date .value=${item.toDate || 0}>
|
146
|
+
<select data-to-date .value=${String(item.toDate || 0)}>
|
149
147
|
<option value="-1">${msg('The day before')}</option>
|
150
148
|
<option value="0">${msg('The day')}</option>
|
151
149
|
<option value="1">${msg('The day after')}</option>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import '../src/ox-input-select-buttons.js'
|
2
|
+
|
3
|
+
import { html, TemplateResult } from 'lit'
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'ox-input-select-buttons',
|
7
|
+
component: 'ox-input-select-buttons',
|
8
|
+
argTypes: {
|
9
|
+
value: { control: 'object' },
|
10
|
+
options: { control: 'object' },
|
11
|
+
multiple: { control: 'boolean' },
|
12
|
+
name: { control: 'text' }
|
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?: object | string
|
25
|
+
options: object
|
26
|
+
multiple?: boolean
|
27
|
+
}
|
28
|
+
|
29
|
+
const Template: Story<ArgTypes> = ({ name = 'options', value, multiple = false, options = [] }: ArgTypes) => html`
|
30
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
31
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
32
|
+
<style>
|
33
|
+
ox-input-select-buttons {
|
34
|
+
max-width: 400px;
|
35
|
+
}
|
36
|
+
</style>
|
37
|
+
|
38
|
+
<ox-input-select-buttons
|
39
|
+
@change=${(e: Event) => {
|
40
|
+
console.log((e.target as HTMLInputElement).value)
|
41
|
+
}}
|
42
|
+
name=${name}
|
43
|
+
.value=${value}
|
44
|
+
.options=${options}
|
45
|
+
?multiple=${multiple}
|
46
|
+
>
|
47
|
+
</ox-input-select-buttons>
|
48
|
+
`
|
49
|
+
|
50
|
+
export const Regular = Template.bind({})
|
51
|
+
Regular.args = {
|
52
|
+
name: 'options',
|
53
|
+
value: 'Clothes',
|
54
|
+
options: [
|
55
|
+
{ display: 'SHOOSE', value: 'Shoose' },
|
56
|
+
{ display: 'CHOTHES', value: 'Clothes' },
|
57
|
+
{ display: 'GLOVES', value: 'Gloves' }
|
58
|
+
]
|
59
|
+
}
|
60
|
+
|
61
|
+
export const Multiple = Template.bind({})
|
62
|
+
Multiple.args = {
|
63
|
+
name: 'options',
|
64
|
+
value: ['Clothes'],
|
65
|
+
multiple: true,
|
66
|
+
options: [
|
67
|
+
{ display: 'SHOOSE1', value: 'Shoose1' },
|
68
|
+
{ display: 'CHOTHES1', value: 'Clothes1' },
|
69
|
+
{ display: 'GLOVES1', value: 'Gloves1' },
|
70
|
+
{ display: 'SHOOSE2', value: 'Shoose2' },
|
71
|
+
{ display: 'CHOTHES2', value: 'Clothes2' },
|
72
|
+
{ display: 'GLOVES2', value: 'Gloves2' },
|
73
|
+
{ display: 'SHOOSE3', value: 'Shoose3' },
|
74
|
+
{ display: 'CHOTHES3', value: 'Clothes3' },
|
75
|
+
{ display: 'GLOVES3', value: 'Gloves3' },
|
76
|
+
{ display: 'SHOOSE4', value: 'Shoose4' },
|
77
|
+
{ display: 'CHOTHES4', value: 'Clothes4' },
|
78
|
+
{ display: 'GLOVES4', value: 'Gloves4' }
|
79
|
+
]
|
80
|
+
}
|
@@ -37,6 +37,7 @@ export default {
|
|
37
37
|
'W/m2/K',
|
38
38
|
'N sec/m2',
|
39
39
|
'm2 oC/W',
|
40
|
+
'%',
|
40
41
|
'K'
|
41
42
|
]
|
42
43
|
}
|
@@ -96,3 +97,11 @@ Temperature.args = {
|
|
96
97
|
value: 0,
|
97
98
|
stdUnit: 'K'
|
98
99
|
}
|
100
|
+
|
101
|
+
export const Percentage = Template.bind({})
|
102
|
+
Percentage.args = {
|
103
|
+
placeholder: 'percentage',
|
104
|
+
name: 'percentage',
|
105
|
+
value: 0,
|
106
|
+
stdUnit: '%'
|
107
|
+
}
|