@operato/input 1.0.0-beta.3 → 1.0.0-beta.30
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/.storybook/main.js +2 -2
- package/.storybook/server.mjs +4 -4
- package/CHANGELOG.md +477 -0
- package/demo/index-multiple-colors.html +4 -1
- package/demo/index-partition-keys.html +2 -5
- package/demo/index-select.html +1 -1
- package/demo/index.html +4 -0
- package/dist/src/locales/en.d.ts +8 -0
- package/dist/src/locales/en.js +8 -0
- package/dist/src/locales/en.js.map +1 -1
- package/dist/src/locales/ko.d.ts +8 -0
- package/dist/src/locales/ko.js +8 -0
- package/dist/src/locales/ko.js.map +1 -1
- package/dist/src/locales/ms.d.ts +8 -0
- package/dist/src/locales/ms.js +8 -0
- package/dist/src/locales/ms.js.map +1 -1
- package/dist/src/locales/zh.d.ts +8 -0
- package/dist/src/locales/zh.js +8 -0
- package/dist/src/locales/zh.js.map +1 -1
- package/dist/src/ox-input-3dish.js +24 -8
- package/dist/src/ox-input-3dish.js.map +1 -1
- package/dist/src/ox-input-barcode.d.ts +1 -1
- package/dist/src/ox-input-barcode.js +14 -14
- package/dist/src/ox-input-barcode.js.map +1 -1
- package/dist/src/ox-input-color.js +16 -11
- package/dist/src/ox-input-color.js.map +1 -1
- package/dist/src/ox-input-crontab.js +28 -10
- package/dist/src/ox-input-crontab.js.map +1 -1
- package/dist/src/ox-input-file.js +5 -3
- package/dist/src/ox-input-file.js.map +1 -1
- package/dist/src/ox-input-key-values.d.ts +41 -0
- package/dist/src/ox-input-key-values.js +233 -0
- package/dist/src/ox-input-key-values.js.map +1 -0
- package/dist/src/ox-input-multiple-colors.d.ts +1 -0
- package/dist/src/ox-input-multiple-colors.js +29 -21
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.d.ts +1 -0
- package/dist/src/ox-input-options.js +54 -14
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-partition-keys.d.ts +1 -0
- package/dist/src/ox-input-partition-keys.js +51 -23
- package/dist/src/ox-input-partition-keys.js.map +1 -1
- package/dist/src/ox-input-range.js +35 -38
- package/dist/src/ox-input-range.js.map +1 -1
- package/dist/src/ox-input-search.d.ts +0 -1
- package/dist/src/ox-input-search.js +14 -7
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/src/ox-input-unit.d.ts +17 -0
- package/dist/src/ox-input-unit.js +122 -0
- package/dist/src/ox-input-unit.js.map +1 -0
- package/dist/src/ox-input-value-map.d.ts +2 -2
- package/dist/src/ox-input-value-map.js +51 -15
- package/dist/src/ox-input-value-map.js.map +1 -1
- package/dist/src/ox-input-value-ranges.d.ts +2 -2
- package/dist/src/ox-input-value-ranges.js +50 -23
- package/dist/src/ox-input-value-ranges.js.map +1 -1
- package/dist/src/ox-input-work-shift.js +77 -43
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/src/ox-select.js +9 -1
- package/dist/src/ox-select.js.map +1 -1
- package/dist/stories/ox-checkbox.stories.d.ts +39 -0
- package/dist/stories/ox-checkbox.stories.js +44 -0
- package/dist/stories/ox-checkbox.stories.js.map +1 -0
- package/dist/stories/ox-input-3dish.stories.d.ts +26 -0
- package/dist/stories/ox-input-3dish.stories.js +59 -0
- package/dist/stories/ox-input-3dish.stories.js.map +1 -0
- package/dist/stories/{index.stories.d.ts → ox-input-barcode.stories.d.ts} +11 -11
- package/dist/stories/ox-input-barcode.stories.js +24 -0
- package/dist/stories/ox-input-barcode.stories.js.map +1 -0
- package/dist/stories/ox-input-crontab.stories.d.ts +26 -0
- package/dist/stories/ox-input-crontab.stories.js +37 -0
- package/dist/stories/ox-input-crontab.stories.js.map +1 -0
- package/dist/stories/ox-input-file.stories.d.ts +49 -0
- package/dist/stories/ox-input-file.stories.js +48 -0
- package/dist/stories/ox-input-file.stories.js.map +1 -0
- package/dist/stories/ox-input-key-values.stories.d.ts +29 -0
- package/dist/stories/ox-input-key-values.stories.js +49 -0
- package/dist/stories/ox-input-key-values.stories.js.map +1 -0
- package/dist/stories/ox-input-multiple-colors.stories.d.ts +20 -0
- package/dist/stories/ox-input-multiple-colors.stories.js +167 -0
- package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -0
- package/dist/stories/ox-input-options.stories.d.ts +25 -0
- package/dist/stories/ox-input-options.stories.js +33 -0
- package/dist/stories/ox-input-options.stories.js.map +1 -0
- package/dist/stories/ox-input-partition-keys.stories.d.ts +25 -0
- package/dist/stories/ox-input-partition-keys.stories.js +37 -0
- package/dist/stories/ox-input-partition-keys.stories.js.map +1 -0
- package/dist/stories/ox-input-range.stories.d.ts +37 -0
- package/dist/stories/ox-input-range.stories.js +28 -0
- package/dist/stories/ox-input-range.stories.js.map +1 -0
- package/dist/stories/ox-input-search.stories.d.ts +29 -0
- package/dist/stories/ox-input-search.stories.js +32 -0
- package/dist/stories/ox-input-search.stories.js.map +1 -0
- package/dist/stories/ox-input-unit.stories.d.ts +40 -0
- package/dist/stories/ox-input-unit.stories.js +42 -0
- package/dist/stories/ox-input-unit.stories.js.map +1 -0
- package/dist/stories/ox-input-value-map.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-map.stories.js +37 -0
- package/dist/stories/ox-input-value-map.stories.js.map +1 -0
- package/dist/stories/ox-input-value-ranges.stories.d.ts +35 -0
- package/dist/stories/ox-input-value-ranges.stories.js +37 -0
- package/dist/stories/ox-input-value-ranges.stories.js.map +1 -0
- package/dist/stories/ox-input-work-shift.stories.d.ts +26 -0
- package/dist/stories/ox-input-work-shift.stories.js +59 -0
- package/dist/stories/ox-input-work-shift.stories.js.map +1 -0
- package/dist/stories/ox-select.stories.d.ts +30 -0
- package/dist/stories/ox-select.stories.js +83 -0
- package/dist/stories/ox-select.stories.js.map +1 -0
- package/dist/themes/common-grist-styles.d.ts +1 -0
- package/dist/themes/common-grist-styles.js +110 -0
- package/dist/themes/common-grist-styles.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -11
- package/src/locales/en.ts +8 -0
- package/src/locales/ko.ts +8 -0
- package/src/locales/ms.ts +8 -0
- package/src/locales/zh.ts +8 -0
- package/src/ox-input-3dish.ts +24 -8
- package/src/ox-input-barcode.ts +16 -15
- package/src/ox-input-color.ts +17 -11
- package/src/ox-input-crontab.ts +30 -10
- package/src/ox-input-file.ts +7 -6
- package/src/ox-input-key-values.ts +270 -0
- package/src/ox-input-multiple-colors.ts +29 -21
- package/src/ox-input-options.ts +53 -13
- package/src/ox-input-partition-keys.ts +51 -22
- package/src/ox-input-range.ts +35 -38
- package/src/ox-input-search.ts +14 -8
- package/src/ox-input-unit.ts +123 -0
- package/src/ox-input-value-map.ts +52 -16
- package/src/ox-input-value-ranges.ts +52 -25
- package/src/ox-input-work-shift.ts +78 -43
- package/src/ox-select.ts +12 -3
- package/stories/ox-checkbox.stories.ts +69 -0
- package/stories/ox-input-3dish.stories.ts +73 -0
- package/stories/ox-input-barcode.stories.ts +40 -0
- package/stories/ox-input-code.stories.ts_ +51 -0
- package/stories/ox-input-crontab.stories.ts +51 -0
- package/stories/ox-input-file.stories.ts +77 -0
- package/stories/ox-input-key-values.stories.ts +64 -0
- package/stories/ox-input-multiple-colors.stories.ts +178 -0
- package/stories/ox-input-options.stories.ts +47 -0
- package/stories/ox-input-partition-keys.stories.ts +51 -0
- package/stories/ox-input-range.stories.ts +45 -0
- package/stories/ox-input-search.stories.ts +47 -0
- package/stories/ox-input-unit.stories.ts +66 -0
- package/stories/ox-input-value-map.stories.ts +58 -0
- package/stories/ox-input-value-ranges.stories.ts +58 -0
- package/stories/ox-input-work-shift.stories.ts +73 -0
- package/stories/ox-select.stories.ts +101 -0
- package/themes/app-theme.css +142 -0
- package/themes/common-grist-styles.ts +110 -0
- package/themes/input-theme.css +19 -0
- package/xliff/en.xlf +24 -0
- package/xliff/ko.xlf +32 -0
- package/xliff/ms.xlf +24 -0
- package/xliff/zh.xlf +24 -0
- package/dist/stories/index.stories.js +0 -33
- package/dist/stories/index.stories.js.map +0 -1
- package/stories/index.stories.ts +0 -52
@@ -7,6 +7,8 @@ import './ox-input-color'
|
|
7
7
|
import { css, html } from 'lit'
|
8
8
|
import { customElement, property } from 'lit/decorators.js'
|
9
9
|
|
10
|
+
import { localized, msg } from '@lit/localize'
|
11
|
+
|
10
12
|
import { OxFormField } from './ox-form-field.js'
|
11
13
|
|
12
14
|
type WorkShift = { name: string; fromDate: number; fromTime: string; toDate: number; toTime: string }
|
@@ -21,40 +23,26 @@ Example:
|
|
21
23
|
</ox-input-work-shift>
|
22
24
|
*/
|
23
25
|
|
26
|
+
@localized()
|
24
27
|
@customElement('ox-input-work-shift')
|
25
28
|
export class OxInputWorkShift extends OxFormField {
|
26
29
|
static styles = css`
|
27
30
|
:host {
|
28
31
|
display: flex;
|
29
32
|
flex-direction: column;
|
30
|
-
align-content: center;
|
31
33
|
|
32
34
|
width: 100%;
|
33
35
|
overflow: hidden;
|
34
|
-
border: 1px solid #ccc;
|
35
36
|
}
|
36
37
|
|
37
38
|
div {
|
38
39
|
display: flex;
|
39
40
|
flex-flow: row nowrap;
|
40
|
-
|
41
|
-
|
42
|
-
border-bottom: 1px solid #c0c0c0;
|
43
|
-
}
|
44
|
-
|
45
|
-
div:last-child {
|
46
|
-
border-bottom: none;
|
47
|
-
}
|
48
|
-
|
49
|
-
div > * {
|
50
|
-
min-width: 0px;
|
51
|
-
margin: 2px;
|
52
|
-
padding: 0;
|
41
|
+
gap: var(--margin-default);
|
53
42
|
}
|
54
43
|
|
55
|
-
button,
|
56
44
|
empty-element {
|
57
|
-
width:
|
45
|
+
width: 34px;
|
58
46
|
text-align: center;
|
59
47
|
}
|
60
48
|
|
@@ -63,21 +51,64 @@ export class OxInputWorkShift extends OxFormField {
|
|
63
51
|
span {
|
64
52
|
flex: 1;
|
65
53
|
}
|
54
|
+
[data-header] {
|
55
|
+
background-color: rgba(var(--primary-color-rgb), 0.05);
|
56
|
+
padding: var(--padding-narrow);
|
57
|
+
}
|
58
|
+
[data-header] span {
|
59
|
+
font: var(--label-font);
|
60
|
+
color: var(--label-color);
|
61
|
+
text-transform: var(--label-text-transform);
|
62
|
+
text-align: center;
|
63
|
+
}
|
64
|
+
[data-record] {
|
65
|
+
margin-bottom: var(--margin-narrow);
|
66
|
+
}
|
67
|
+
input,
|
68
|
+
select {
|
69
|
+
border: 0;
|
70
|
+
border-bottom: var(--border-dark-color);
|
71
|
+
padding: var(--input-padding);
|
72
|
+
font: var(--input-font);
|
73
|
+
color: var(--primary-text-color);
|
74
|
+
|
75
|
+
max-height: 35px;
|
76
|
+
}
|
77
|
+
input:focus,
|
78
|
+
select:focus {
|
79
|
+
outline: none;
|
80
|
+
border-bottom: 1px solid var(--primary-color);
|
81
|
+
}
|
66
82
|
|
67
83
|
input:required:invalid {
|
68
84
|
border: 1px dashed red;
|
69
85
|
}
|
70
|
-
|
71
|
-
|
72
|
-
flex: 2;
|
86
|
+
input[type='time'] {
|
87
|
+
padding: 2px var(--padding-default);
|
73
88
|
}
|
74
89
|
|
75
|
-
|
76
|
-
border
|
90
|
+
button {
|
91
|
+
border: var(--button-border);
|
92
|
+
border-radius: var(--border-radius);
|
93
|
+
background-color: var(--button-background-color);
|
94
|
+
padding: var(--padding-narrow) var(--padding-default);
|
95
|
+
line-height: 0.8;
|
96
|
+
color: var(--button-color);
|
97
|
+
cursor: pointer;
|
98
|
+
}
|
99
|
+
button mwc-icon {
|
100
|
+
font-size: var(--fontsize-default);
|
101
|
+
}
|
102
|
+
button:focus,
|
103
|
+
button:hover,
|
104
|
+
button:active {
|
105
|
+
border: var(--button-activ-border);
|
106
|
+
background-color: var(--button-background-focus-color);
|
107
|
+
color: var(--theme-white-color);
|
77
108
|
}
|
78
109
|
|
79
|
-
|
80
|
-
|
110
|
+
[placeholder='value'] {
|
111
|
+
flex: 2;
|
81
112
|
}
|
82
113
|
`
|
83
114
|
|
@@ -92,11 +123,11 @@ export class OxInputWorkShift extends OxFormField {
|
|
92
123
|
render() {
|
93
124
|
return html`
|
94
125
|
<div data-header>
|
95
|
-
<span
|
96
|
-
<span
|
97
|
-
<span
|
98
|
-
<span
|
99
|
-
<span
|
126
|
+
<span>${msg('name')}</span>
|
127
|
+
<span>${msg('from date')}</span>
|
128
|
+
<span>${msg('from time')}</span>
|
129
|
+
<span>${msg('to date')}</span>
|
130
|
+
<span>${msg('to time')}</span>
|
100
131
|
<empty-element></empty-element>
|
101
132
|
</div>
|
102
133
|
|
@@ -106,20 +137,22 @@ export class OxInputWorkShift extends OxFormField {
|
|
106
137
|
<input type="text" data-name .value=${item.name} required />
|
107
138
|
|
108
139
|
<select data-from-date .value=${item.fromDate || 0}>
|
109
|
-
<option value="-1"
|
110
|
-
<option value="0"
|
111
|
-
<option value="1"
|
140
|
+
<option value="-1">${msg('The day before')}</option>
|
141
|
+
<option value="0">${msg('The day')}</option>
|
142
|
+
<option value="1">${msg('The day after')}</option>
|
112
143
|
</select>
|
113
144
|
<input type="time" data-from-time .value=${item.fromTime} step="1800" required />
|
114
145
|
|
115
146
|
<select data-to-date .value=${item.toDate || 0}>
|
116
|
-
<option value="-1"
|
117
|
-
<option value="0"
|
118
|
-
<option value="1"
|
147
|
+
<option value="-1">${msg('The day before')}</option>
|
148
|
+
<option value="0">${msg('The day')}</option>
|
149
|
+
<option value="1">${msg('The day after')}</option>
|
119
150
|
</select>
|
120
151
|
<input type="time" data-to-time .value=${item.toTime} step="1800" required />
|
121
152
|
|
122
|
-
<button class="record-action" @click=${(e: Event) => this._delete(e)} tabindex="-1"
|
153
|
+
<button class="record-action" @click=${(e: Event) => this._delete(e)} tabindex="-1">
|
154
|
+
<mwc-icon>remove</mwc-icon>
|
155
|
+
</button>
|
123
156
|
</div>
|
124
157
|
`
|
125
158
|
)}
|
@@ -128,20 +161,22 @@ export class OxInputWorkShift extends OxFormField {
|
|
128
161
|
<input type="text" data-name />
|
129
162
|
|
130
163
|
<select data-from-date>
|
131
|
-
<option value="-1"
|
132
|
-
<option value="0" selected
|
133
|
-
<option value="+1"
|
164
|
+
<option value="-1">${msg('The day before')}</option>
|
165
|
+
<option value="0" selected>${msg('The day')}</option>
|
166
|
+
<option value="+1">${msg('The day after')}</option>
|
134
167
|
</select>
|
135
168
|
<input type="time" data-from-time step="1800" />
|
136
169
|
|
137
170
|
<select data-to-date>
|
138
|
-
<option value="-1"
|
139
|
-
<option value="0" selected
|
140
|
-
<option value="+1"
|
171
|
+
<option value="-1">${msg('The day before')}</option>
|
172
|
+
<option value="0" selected>${msg('The day')}</option>
|
173
|
+
<option value="+1">${msg('The day after')}</option>
|
141
174
|
</select>
|
142
175
|
<input type="time" data-to-time step="1800" />
|
143
176
|
|
144
|
-
<button class="record-action" @click=${(e: Event) => this._add()} tabindex="-1"
|
177
|
+
<button class="record-action" @click=${(e: Event) => this._add()} tabindex="-1">
|
178
|
+
<mwc-icon>add</mwc-icon>
|
179
|
+
</button>
|
145
180
|
</div>
|
146
181
|
`
|
147
182
|
}
|
package/src/ox-select.ts
CHANGED
@@ -5,14 +5,15 @@
|
|
5
5
|
import '@material/mwc-icon'
|
6
6
|
import '@operato/popup/ox-popup-list.js'
|
7
7
|
|
8
|
-
import {
|
9
|
-
import { customElement, property,
|
8
|
+
import { css, html, PropertyValues } from 'lit'
|
9
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
10
10
|
|
11
|
-
import { OxFormField } from './ox-form-field.js'
|
12
11
|
import { OxPopupList } from '@operato/popup'
|
13
12
|
import { TooltipStyles } from '@operato/styles'
|
14
13
|
import { detectOverflow } from '@operato/utils'
|
15
14
|
|
15
|
+
import { OxFormField } from './ox-form-field.js'
|
16
|
+
|
16
17
|
function onmouseover(e: Event) {
|
17
18
|
const element = e.target as HTMLSpanElement
|
18
19
|
if (detectOverflow(element)) {
|
@@ -33,6 +34,7 @@ export class Select extends OxFormField {
|
|
33
34
|
:host {
|
34
35
|
display: block;
|
35
36
|
position: relative;
|
37
|
+
border-bottom: var(--border-dark-color);
|
36
38
|
}
|
37
39
|
|
38
40
|
div {
|
@@ -41,6 +43,10 @@ export class Select extends OxFormField {
|
|
41
43
|
align-items: center;
|
42
44
|
justify-content: center;
|
43
45
|
cursor: pointer;
|
46
|
+
padding: var(--input-padding);
|
47
|
+
font: var(--input-font);
|
48
|
+
color: var(--primary-text-color);
|
49
|
+
max-height: 17px;
|
44
50
|
}
|
45
51
|
|
46
52
|
span {
|
@@ -58,6 +64,9 @@ export class Select extends OxFormField {
|
|
58
64
|
color: var(--theme-primary-text-color, #3c3938);
|
59
65
|
opacity: 0.7;
|
60
66
|
}
|
67
|
+
div:hover mwc-icon {
|
68
|
+
color: var(--primary-color);
|
69
|
+
}
|
61
70
|
|
62
71
|
::slotted(ox-popup-list) {
|
63
72
|
width: 100%;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import '../src/ox-checkbox.js'
|
2
|
+
|
3
|
+
import { TemplateResult, html } from 'lit'
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'ox-checkbox',
|
7
|
+
component: 'ox-checkbox',
|
8
|
+
argTypes: {
|
9
|
+
label: { control: 'text' },
|
10
|
+
name: { control: 'text' },
|
11
|
+
value: { control: 'boolean' },
|
12
|
+
indeterminatable: { control: 'boolean' },
|
13
|
+
indeterminate: { control: 'boolean' }
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
interface Story<T> {
|
18
|
+
(args: T): TemplateResult
|
19
|
+
args?: Partial<T>
|
20
|
+
argTypes?: Record<string, unknown>
|
21
|
+
}
|
22
|
+
|
23
|
+
interface ArgTypes {
|
24
|
+
label?: string
|
25
|
+
name?: string
|
26
|
+
value?: boolean
|
27
|
+
indeterminatable?: boolean
|
28
|
+
indeterminate?: boolean
|
29
|
+
}
|
30
|
+
|
31
|
+
const Template: Story<ArgTypes> = ({
|
32
|
+
label = 'Checkbox',
|
33
|
+
name = 'hello',
|
34
|
+
value = true,
|
35
|
+
indeterminatable = false,
|
36
|
+
indeterminate = false
|
37
|
+
}: ArgTypes) => html`
|
38
|
+
<ox-checkbox
|
39
|
+
@click=${(e: MouseEvent) => console.log('clicked')}
|
40
|
+
name=${name}
|
41
|
+
.checked=${value}
|
42
|
+
?indeterminatable=${indeterminatable}
|
43
|
+
?indeterminate=${indeterminate}
|
44
|
+
>
|
45
|
+
${label}
|
46
|
+
</ox-checkbox>
|
47
|
+
`
|
48
|
+
|
49
|
+
export const Regular = Template.bind({})
|
50
|
+
Regular.args = {
|
51
|
+
label: 'label',
|
52
|
+
name: 'label',
|
53
|
+
value: false
|
54
|
+
}
|
55
|
+
|
56
|
+
export const CustomActivated = Template.bind({})
|
57
|
+
CustomActivated.args = {
|
58
|
+
label: 'Activated',
|
59
|
+
name: 'activated',
|
60
|
+
indeterminate: false,
|
61
|
+
value: true
|
62
|
+
}
|
63
|
+
|
64
|
+
export const CustomIndeterminated = Template.bind({})
|
65
|
+
CustomIndeterminated.args = {
|
66
|
+
label: 'Indeterminated',
|
67
|
+
indeterminate: true,
|
68
|
+
value: true
|
69
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import '../src/ox-input-3dish.js'
|
2
|
+
import '../src/locale/locale-picker.js'
|
3
|
+
|
4
|
+
import { html, TemplateResult } from 'lit'
|
5
|
+
|
6
|
+
export default {
|
7
|
+
title: 'ox-input-3dish',
|
8
|
+
component: 'ox-input-3dish',
|
9
|
+
argTypes: {
|
10
|
+
value: { control: 'object' },
|
11
|
+
name: { control: 'text' }
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
interface Story<T> {
|
16
|
+
(args: T): TemplateResult
|
17
|
+
args?: Partial<T>
|
18
|
+
argTypes?: Record<string, unknown>
|
19
|
+
}
|
20
|
+
|
21
|
+
interface ArgTypes {
|
22
|
+
name?: string
|
23
|
+
value?: object
|
24
|
+
}
|
25
|
+
|
26
|
+
const Template: Story<ArgTypes> = ({ name = '3dish', value = [] }: ArgTypes) => html`
|
27
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
28
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
29
|
+
<style>
|
30
|
+
body {
|
31
|
+
}
|
32
|
+
</style>
|
33
|
+
|
34
|
+
<locale-picker></locale-picker>
|
35
|
+
<br /><br />
|
36
|
+
|
37
|
+
<ox-input-3dish
|
38
|
+
@change=${(e: Event) => {
|
39
|
+
console.log((e.target as HTMLInputElement).value)
|
40
|
+
}}
|
41
|
+
name=${name}
|
42
|
+
.value=${value}
|
43
|
+
>
|
44
|
+
</ox-input-3dish>
|
45
|
+
`
|
46
|
+
|
47
|
+
export const Regular = Template.bind({})
|
48
|
+
Regular.args = {
|
49
|
+
name: '3dish',
|
50
|
+
value: [
|
51
|
+
{
|
52
|
+
name: 'DAY',
|
53
|
+
fromDate: -1,
|
54
|
+
fromTime: '22:00',
|
55
|
+
toDate: 0,
|
56
|
+
toTime: '06:00'
|
57
|
+
},
|
58
|
+
{
|
59
|
+
name: 'SWING',
|
60
|
+
fromDate: 0,
|
61
|
+
fromTime: '06:00',
|
62
|
+
toDate: 0,
|
63
|
+
toTime: '14:00'
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: 'NIGHT',
|
67
|
+
fromDate: 0,
|
68
|
+
fromTime: '14:00',
|
69
|
+
toDate: 0,
|
70
|
+
toTime: '22:00'
|
71
|
+
}
|
72
|
+
]
|
73
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import '../src/ox-input-barcode.js'
|
2
|
+
|
3
|
+
import { html, TemplateResult } from 'lit'
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'ox-input-barcode',
|
7
|
+
component: 'ox-input-barcode',
|
8
|
+
argTypes: {
|
9
|
+
name: { control: 'text' },
|
10
|
+
value: { control: 'text' },
|
11
|
+
scannable: { control: 'boolean' },
|
12
|
+
withoutEnter: { control: 'boolean' }
|
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?: string
|
25
|
+
scannable?: boolean
|
26
|
+
withoutEnter?: boolean
|
27
|
+
}
|
28
|
+
|
29
|
+
const Template: Story<ArgTypes> = ({ name = 'barcode', scannable = true, withoutEnter = true }: 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
|
+
<ox-input-barcode name=${name} ?without-enter=${withoutEnter} ?scannable=${scannable}> </ox-input-barcode>
|
33
|
+
`
|
34
|
+
|
35
|
+
export const Regular = Template.bind({})
|
36
|
+
Regular.args = {
|
37
|
+
name: 'barcode',
|
38
|
+
scannable: true,
|
39
|
+
withoutEnter: true
|
40
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import '../src/ox-input-code.js'
|
2
|
+
|
3
|
+
import { html, TemplateResult } from 'lit'
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'ox-input-code',
|
7
|
+
component: 'ox-input-code',
|
8
|
+
argTypes: {
|
9
|
+
value: { control: 'object' },
|
10
|
+
name: { control: 'text' }
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
interface Story<T> {
|
15
|
+
(args: T): TemplateResult
|
16
|
+
args?: Partial<T>
|
17
|
+
argTypes?: Record<string, unknown>
|
18
|
+
}
|
19
|
+
|
20
|
+
interface ArgTypes {
|
21
|
+
name?: string
|
22
|
+
value?: object
|
23
|
+
}
|
24
|
+
|
25
|
+
const Template: Story<ArgTypes> = ({ name = 'code', value = {} }: ArgTypes) => html`
|
26
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
27
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
28
|
+
<style>
|
29
|
+
body {
|
30
|
+
}
|
31
|
+
</style>
|
32
|
+
|
33
|
+
<ox-input-code
|
34
|
+
@change=${(e: Event) => {
|
35
|
+
console.log((e.target as HTMLInputElement).value)
|
36
|
+
}}
|
37
|
+
name=${name}
|
38
|
+
.value=${value}
|
39
|
+
>
|
40
|
+
</ox-input-code>
|
41
|
+
`
|
42
|
+
|
43
|
+
export const Regular = Template.bind({})
|
44
|
+
Regular.args = {
|
45
|
+
name: 'code',
|
46
|
+
value: {
|
47
|
+
A: 'A',
|
48
|
+
B: 'B',
|
49
|
+
C: 'C'
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import '../src/ox-input-crontab.js'
|
2
|
+
import '../src/locale/locale-picker.js'
|
3
|
+
|
4
|
+
import { html, TemplateResult } from 'lit'
|
5
|
+
|
6
|
+
export default {
|
7
|
+
title: 'ox-input-crontab',
|
8
|
+
component: 'ox-input-crontab',
|
9
|
+
argTypes: {
|
10
|
+
value: { control: 'text' },
|
11
|
+
name: { control: 'text' }
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
interface Story<T> {
|
16
|
+
(args: T): TemplateResult
|
17
|
+
args?: Partial<T>
|
18
|
+
argTypes?: Record<string, unknown>
|
19
|
+
}
|
20
|
+
|
21
|
+
interface ArgTypes {
|
22
|
+
name?: string
|
23
|
+
value?: string
|
24
|
+
}
|
25
|
+
|
26
|
+
const Template: Story<ArgTypes> = ({ name = 'crontab', value = '* * * * * *' }: ArgTypes) => html`
|
27
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
28
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
29
|
+
<style>
|
30
|
+
body {
|
31
|
+
}
|
32
|
+
</style>
|
33
|
+
|
34
|
+
<locale-picker></locale-picker>
|
35
|
+
<br /><br />
|
36
|
+
|
37
|
+
<ox-input-crontab
|
38
|
+
@change=${(e: Event) => {
|
39
|
+
console.log((e.target as HTMLInputElement).value)
|
40
|
+
}}
|
41
|
+
name=${name}
|
42
|
+
.value=${value}
|
43
|
+
>
|
44
|
+
</ox-input-crontab>
|
45
|
+
`
|
46
|
+
|
47
|
+
export const Regular = Template.bind({})
|
48
|
+
Regular.args = {
|
49
|
+
name: 'crontab',
|
50
|
+
value: '* * * * * *'
|
51
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import '../src/ox-input-file.js'
|
2
|
+
|
3
|
+
import { html, TemplateResult } from 'lit'
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'ox-input-file',
|
7
|
+
component: 'ox-input-file',
|
8
|
+
argTypes: {
|
9
|
+
name: { control: 'text' },
|
10
|
+
multiple: { control: 'boolean' },
|
11
|
+
accept: { control: 'text' },
|
12
|
+
icon: { control: 'text' },
|
13
|
+
label: { control: 'text' },
|
14
|
+
description: { control: 'text' },
|
15
|
+
hideFileList: { control: 'boolean' },
|
16
|
+
attachFileList: { control: 'boolean' }
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
interface Story<T> {
|
21
|
+
(args: T): TemplateResult
|
22
|
+
args?: Partial<T>
|
23
|
+
argTypes?: Record<string, unknown>
|
24
|
+
}
|
25
|
+
|
26
|
+
interface ArgTypes {
|
27
|
+
label?: string
|
28
|
+
name?: string
|
29
|
+
multiple?: boolean
|
30
|
+
accept?: string
|
31
|
+
icon?: string
|
32
|
+
description?: string
|
33
|
+
hideFileList?: boolean
|
34
|
+
attachFileList?: boolean
|
35
|
+
}
|
36
|
+
|
37
|
+
const Template: Story<ArgTypes> = ({
|
38
|
+
label = 'select files',
|
39
|
+
name = 'file',
|
40
|
+
multiple = true,
|
41
|
+
accept,
|
42
|
+
icon,
|
43
|
+
description,
|
44
|
+
hideFileList = false,
|
45
|
+
attachFileList = false
|
46
|
+
}: ArgTypes) => html`
|
47
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
48
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
49
|
+
<style>
|
50
|
+
body {
|
51
|
+
}
|
52
|
+
</style>
|
53
|
+
|
54
|
+
<ox-input-file
|
55
|
+
label=${label}
|
56
|
+
name=${name}
|
57
|
+
?multiple=${multiple}
|
58
|
+
?hide-filelist=${hideFileList}
|
59
|
+
?attach-filelist=${attachFileList}
|
60
|
+
accept=${accept}
|
61
|
+
icon=${icon}
|
62
|
+
description=${description}
|
63
|
+
>
|
64
|
+
</ox-input-file>
|
65
|
+
`
|
66
|
+
|
67
|
+
export const Regular = Template.bind({})
|
68
|
+
Regular.args = {
|
69
|
+
label: 'select files',
|
70
|
+
name: 'files',
|
71
|
+
multiple: true,
|
72
|
+
hideFileList: false,
|
73
|
+
attachFileList: false,
|
74
|
+
accept: '*.*',
|
75
|
+
icon: 'upload',
|
76
|
+
description: 'drop files here!'
|
77
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import '../src/ox-input-key-values.js'
|
2
|
+
|
3
|
+
import { html, TemplateResult } from 'lit'
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'ox-input-key-values',
|
7
|
+
component: 'ox-input-key-values',
|
8
|
+
argTypes: {
|
9
|
+
name: { control: 'text' },
|
10
|
+
value: { control: 'object' },
|
11
|
+
options: { control: 'object' }
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
interface Story<T> {
|
16
|
+
(args: T): TemplateResult
|
17
|
+
args?: Partial<T>
|
18
|
+
argTypes?: Record<string, unknown>
|
19
|
+
}
|
20
|
+
|
21
|
+
interface ArgTypes {
|
22
|
+
name?: string
|
23
|
+
value?: object
|
24
|
+
options?: object
|
25
|
+
}
|
26
|
+
|
27
|
+
const Template: Story<ArgTypes> = ({ name = 'key-values', value = {}, options = [] }: 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
|
+
<style>
|
31
|
+
body {
|
32
|
+
}
|
33
|
+
</style>
|
34
|
+
|
35
|
+
<ox-input-key-values
|
36
|
+
@change=${(e: Event) => {
|
37
|
+
console.log((e.target as HTMLInputElement).value)
|
38
|
+
}}
|
39
|
+
name=${name}
|
40
|
+
.value=${value}
|
41
|
+
.options=${options}
|
42
|
+
>
|
43
|
+
</ox-input-key-values>
|
44
|
+
`
|
45
|
+
|
46
|
+
export const Regular = Template.bind({})
|
47
|
+
Regular.args = {
|
48
|
+
name: 'key-values',
|
49
|
+
value: {
|
50
|
+
A: 'A',
|
51
|
+
B: 'B',
|
52
|
+
C: 'C'
|
53
|
+
},
|
54
|
+
options: [
|
55
|
+
{
|
56
|
+
display: '초기값',
|
57
|
+
value: 'ABC'
|
58
|
+
},
|
59
|
+
{
|
60
|
+
display: '후기값',
|
61
|
+
value: 'XYZ'
|
62
|
+
}
|
63
|
+
]
|
64
|
+
}
|