@operato/form 2.0.0-alpha.146 → 2.0.0-alpha.148
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 +31 -0
- package/dist/src/components/ox-custom-input.js +3 -4
- package/dist/src/components/ox-custom-input.js.map +1 -1
- package/dist/src/components/ox-file-uploader.js +1 -1
- package/dist/src/components/ox-file-uploader.js.map +1 -1
- package/dist/src/components/ox-search-form.js +25 -32
- package/dist/src/components/ox-search-form.js.map +1 -1
- package/dist/src/filters/filter-input-barcode.js +1 -0
- package/dist/src/filters/filter-input-barcode.js.map +1 -1
- package/dist/src/filters/filter-styles.js +31 -17
- package/dist/src/filters/filter-styles.js.map +1 -1
- package/dist/src/filters/ox-filters-form-base.js +6 -2
- package/dist/src/filters/ox-filters-form-base.js.map +1 -1
- package/dist/src/styles/multi-column-form-styles.js +6 -6
- package/dist/src/styles/multi-column-form-styles.js.map +1 -1
- package/dist/src/styles/search-form-styles.js +17 -18
- package/dist/src/styles/search-form-styles.js.map +1 -1
- package/dist/src/styles/single-column-form-styles.js +5 -5
- package/dist/src/styles/single-column-form-styles.js.map +1 -1
- package/dist/stories/ox-filters-form-barcode.stories.d.ts +5 -0
- package/dist/stories/ox-filters-form-barcode.stories.js +31 -5
- package/dist/stories/ox-filters-form-barcode.stories.js.map +1 -1
- package/dist/stories/ox-filters-form-base-bounded.stories.d.ts +5 -0
- package/dist/stories/ox-filters-form-base-bounded.stories.js +28 -23
- package/dist/stories/ox-filters-form-base-bounded.stories.js.map +1 -1
- package/dist/stories/ox-filters-form-base-change-handler.stories.d.ts +5 -0
- package/dist/stories/ox-filters-form-base-change-handler.stories.js +28 -23
- package/dist/stories/ox-filters-form-base-change-handler.stories.js.map +1 -1
- package/dist/stories/ox-filters-form-base.stories.d.ts +5 -0
- package/dist/stories/ox-filters-form-base.stories.js +26 -23
- package/dist/stories/ox-filters-form-base.stories.js.map +1 -1
- package/dist/stories/ox-search-form.stories.d.ts +5 -0
- package/dist/stories/ox-search-form.stories.js +28 -23
- package/dist/stories/ox-search-form.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/ox-custom-input.ts +3 -4
- package/src/components/ox-file-uploader.ts +1 -1
- package/src/components/ox-search-form.ts +25 -40
- package/src/filters/filter-input-barcode.ts +1 -0
- package/src/filters/filter-styles.ts +31 -17
- package/src/filters/ox-filters-form-base.ts +6 -2
- package/src/styles/multi-column-form-styles.ts +6 -6
- package/src/styles/search-form-styles.ts +17 -18
- package/src/styles/single-column-form-styles.ts +5 -5
- package/stories/ox-filters-form-barcode.stories.ts +32 -5
- package/stories/ox-filters-form-base-bounded.stories.ts +32 -25
- package/stories/ox-filters-form-base-change-handler.stories.ts +32 -25
- package/stories/ox-filters-form-base.stories.ts +30 -25
- package/stories/ox-search-form.stories.ts +32 -25
- package/themes/dark-hc.css +151 -0
- package/themes/dark-mc.css +151 -0
- package/themes/dark.css +151 -0
- package/themes/grist-theme.css +169 -0
- package/themes/light-hc.css +151 -0
- package/themes/light-mc.css +151 -0
- package/themes/light.css +151 -0
- package/themes/md-typescale-styles.css +100 -0
- package/themes/spacing.css +43 -0
- package/themes/state-color.css +6 -0
- package/themes/app-theme.css +0 -145
- package/themes/form-theme.css +0 -75
- package/themes/input-theme.css +0 -32
|
@@ -6,12 +6,11 @@ export class CustomInput extends LitElement {
|
|
|
6
6
|
static styles = css`
|
|
7
7
|
input {
|
|
8
8
|
margin: auto 0;
|
|
9
|
-
border
|
|
10
|
-
|
|
11
|
-
border-color: var(--form-input-border-color, #c4c5c6);
|
|
12
|
-
padding: var(--form-input-padding, 5px);
|
|
9
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
10
|
+
padding: 0 var(--spacing-small);
|
|
13
11
|
min-width: var(--form-input-width, 300px);
|
|
14
12
|
max-width: var(--form-input-width, 300px);
|
|
13
|
+
height:var(--form-element-height-medium);
|
|
15
14
|
outline: var(--form-input-outline, none);
|
|
16
15
|
background-color: var(--form-input-background-color, #fff);
|
|
17
16
|
}
|
|
@@ -16,7 +16,7 @@ export class FileUploader extends LitElement {
|
|
|
16
16
|
text-transform: capitalize;
|
|
17
17
|
|
|
18
18
|
border: var(--file-uploader-border);
|
|
19
|
-
background-color: var(--
|
|
19
|
+
background-color: var(--md-sys-color-background);
|
|
20
20
|
font: var(--file-uploader-font) !important;
|
|
21
21
|
color: var(--file-uploader-color);
|
|
22
22
|
}
|
|
@@ -7,6 +7,7 @@ import { css, html, LitElement, nothing, PropertyValues } from 'lit'
|
|
|
7
7
|
import { customElement, property, query, queryAll, queryAsync } from 'lit/decorators.js'
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
9
9
|
import { until } from 'lit/directives/until.js'
|
|
10
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
|
10
11
|
|
|
11
12
|
import { buildArgs, client } from '@operato/graphql'
|
|
12
13
|
|
|
@@ -43,11 +44,13 @@ function buildOptions(field: SearchFormField, options: SelectOption[]) {
|
|
|
43
44
|
@customElement('ox-search-form')
|
|
44
45
|
export class OxSearchForm extends LitElement {
|
|
45
46
|
static styles = [
|
|
47
|
+
MDTypeScaleStyles,
|
|
46
48
|
SearchFormStyles,
|
|
47
49
|
css`
|
|
48
50
|
:host {
|
|
49
51
|
display: flex;
|
|
50
52
|
flex-direction: column;
|
|
53
|
+
padding: var(--spacing-small);
|
|
51
54
|
|
|
52
55
|
position: relative;
|
|
53
56
|
}
|
|
@@ -56,6 +59,23 @@ export class OxSearchForm extends LitElement {
|
|
|
56
59
|
text-transform: capitalize;
|
|
57
60
|
color: rgba(var(--secondary-color-rgb), 0.5);
|
|
58
61
|
}
|
|
62
|
+
label {
|
|
63
|
+
font-size: var(--md-sys-typescale-label-medium-size);
|
|
64
|
+
color: var(--md-sys-color-primary);
|
|
65
|
+
}
|
|
66
|
+
select,
|
|
67
|
+
input {
|
|
68
|
+
border: none;
|
|
69
|
+
border-bottom: var(--ox-filters-input-border, 1px solid var(--md-sys-color-outline));
|
|
70
|
+
font: var(--ox-filters-input-font);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
select:focus,
|
|
74
|
+
input:focus {
|
|
75
|
+
outline: none;
|
|
76
|
+
border-bottom: var(--ox-filters-input-focus-border, 1px solid var(--md-ref-palette-primary50));
|
|
77
|
+
color: var(--ox-filters-input-focus-color, var(--md-sys-color-primary));
|
|
78
|
+
}
|
|
59
79
|
`
|
|
60
80
|
]
|
|
61
81
|
|
|
@@ -74,40 +94,7 @@ export class OxSearchForm extends LitElement {
|
|
|
74
94
|
|
|
75
95
|
return html`
|
|
76
96
|
<form
|
|
77
|
-
class="search-form"
|
|
78
|
-
@keypress=${async (e: KeyboardEvent) => {
|
|
79
|
-
if (e.key === 'Enter') {
|
|
80
|
-
e.preventDefault()
|
|
81
|
-
|
|
82
|
-
const field = e.target as HTMLInputElement
|
|
83
|
-
const name = field?.getAttribute('name')
|
|
84
|
-
const value = field.value
|
|
85
|
-
|
|
86
|
-
if (name && this.autoUpdateTargetsOnChange[name]) {
|
|
87
|
-
;(this.autoUpdateTargetsOnChange[name] || []).forEach(name => {
|
|
88
|
-
const target = this.renderRoot.querySelector(`[name='${name}']`)
|
|
89
|
-
if (target) {
|
|
90
|
-
;(target as HTMLInputElement).value = ''
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
this.requestUpdate()
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const { onchange } = this.fields?.find(field => field.name == name) || {}
|
|
98
|
-
|
|
99
|
-
const keepGoing = onchange ? await onchange.call(null, value, this) : true
|
|
100
|
-
|
|
101
|
-
keepGoing &&
|
|
102
|
-
this.dispatchEvent(
|
|
103
|
-
new CustomEvent('change', {
|
|
104
|
-
detail: value
|
|
105
|
-
})
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
this.submit()
|
|
109
|
-
}
|
|
110
|
-
}}
|
|
97
|
+
class="search-form md-typescale-body-medium-prominent"
|
|
111
98
|
@change=${async (e: Event) => {
|
|
112
99
|
const field = e.target as HTMLInputElement
|
|
113
100
|
const name = field?.getAttribute('name')
|
|
@@ -128,12 +115,10 @@ export class OxSearchForm extends LitElement {
|
|
|
128
115
|
|
|
129
116
|
const keepGoing = onchange ? await onchange.call(null, value, this) : true
|
|
130
117
|
|
|
131
|
-
keepGoing
|
|
132
|
-
this.dispatchEvent(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
})
|
|
136
|
-
)
|
|
118
|
+
if (keepGoing) {
|
|
119
|
+
this.dispatchEvent(new CustomEvent('change', { detail: value }))
|
|
120
|
+
this.submit()
|
|
121
|
+
}
|
|
137
122
|
}}
|
|
138
123
|
>
|
|
139
124
|
${(this.fields || []).map(
|
|
@@ -2,27 +2,30 @@ import { css } from 'lit'
|
|
|
2
2
|
|
|
3
3
|
export const FilterStyles = css`
|
|
4
4
|
:host {
|
|
5
|
-
--ox-filters-input-placeholder-color: var(--input-placeholder-color, var(--
|
|
5
|
+
--ox-filters-input-placeholder-color: var(--input-placeholder-color, var(--md-sys-color-on-surface-variant));
|
|
6
6
|
|
|
7
|
-
--ox-filters-input-border: var(--input-border, 1px solid
|
|
8
|
-
--ox-filters-input-focus-border: var(--input-focus-border, 1px solid var(--
|
|
7
|
+
--ox-filters-input-border: var(--input-border, 1px solid var(--md-sys-color-outline));
|
|
8
|
+
--ox-filters-input-focus-border: var(--input-focus-border, 1px solid var(--md-ref-palette-primary50));
|
|
9
9
|
--ox-filters-input-font: var(--input-font, normal 14px var(--theme-font));
|
|
10
|
-
--ox-filters-input-color: var(--input-color, var(--
|
|
11
|
-
--ox-filters-input-focus-color: var(--input-focus-color, var(--
|
|
10
|
+
--ox-filters-input-color: var(--input-color, var(--md-sys-color-on-surface));
|
|
11
|
+
--ox-filters-input-focus-color: var(--input-focus-color, var(--md-sys-color-on-surface-variant));
|
|
12
12
|
--ox-filters-label-font: var(--label-font, normal 14px var(--theme-font));
|
|
13
|
-
--ox-filters-label-color: var(--label-color, var(--
|
|
13
|
+
--ox-filters-label-color: var(--label-color, var(--md-sys-color-on-surface));
|
|
14
14
|
--ox-filters-input-background-color: transparent;
|
|
15
15
|
|
|
16
16
|
--ox-filters-form-gap: var(--input-gap-vertical, 8px) var(--input-gap-horizontal, 16px);
|
|
17
|
-
--ox-filters-input-padding: var(--
|
|
17
|
+
--ox-filters-input-padding: 0 var(--spacing-small);
|
|
18
18
|
|
|
19
19
|
--ox-select-padding: var(--ox-filters-input-padding);
|
|
20
20
|
--ox-checkbox-background-color: var(--ox-filters-input-background-color, transparent);
|
|
21
|
+
|
|
22
|
+
--md-sys-color-on-primary:transparent;
|
|
23
|
+
--form-element-height-medium:var(--form-element-height-small);
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
label {
|
|
24
|
-
font:
|
|
25
|
-
color: var(--
|
|
27
|
+
font-size:var(--md-sys-typescale-label-medium-size);
|
|
28
|
+
color: var(--md-sys-color-primary);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
span {
|
|
@@ -30,28 +33,34 @@ export const FilterStyles = css`
|
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
input::placeholder {
|
|
33
|
-
color: var(--ox-filters-input-placeholder-color);
|
|
34
|
-
opacity: 0.
|
|
36
|
+
color: var(--ox-filters-input-placeholder-color, var(--md-sys-color-on-surface-variant));
|
|
37
|
+
opacity: 0.7;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
input
|
|
40
|
+
input,
|
|
41
|
+
ox-input-search,
|
|
42
|
+
[filter-input] {
|
|
38
43
|
padding: var(--ox-filters-input-padding);
|
|
44
|
+
height:var(--form-element-height-medium);
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
ox-select,
|
|
42
|
-
input
|
|
48
|
+
ox-input-search,
|
|
49
|
+
input,
|
|
50
|
+
[filter-input] {
|
|
43
51
|
border: none;
|
|
44
|
-
border-bottom: var(--ox-filters-input-border);
|
|
52
|
+
border-bottom: var(--ox-filters-input-border, var(--md-sys-color-outline));
|
|
45
53
|
font: var(--ox-filters-input-font);
|
|
46
|
-
color: var(--ox-filters-input-color);
|
|
54
|
+
color: var(--ox-filters-input-color, var(--md-sys-color-on-surface-variant));
|
|
47
55
|
background-color: var(--ox-filters-input-background-color, transparent);
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
ox-select:focus,
|
|
51
|
-
input:focus
|
|
59
|
+
input:focus,
|
|
60
|
+
[filter-input]:focus {
|
|
52
61
|
outline: none;
|
|
53
62
|
border-bottom: var(--ox-filters-input-focus-border);
|
|
54
|
-
color: var(--ox-filters-input-focus-color);
|
|
63
|
+
color: var(--ox-filters-input-focus-color, var(--md-sys-color-primary));
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
ox-select {
|
|
@@ -74,6 +83,11 @@ export const FilterStyles = css`
|
|
|
74
83
|
max-width: 170px;
|
|
75
84
|
}
|
|
76
85
|
|
|
86
|
+
[filter-input] {
|
|
87
|
+
min-width: 140px;
|
|
88
|
+
max-width: 170px;
|
|
89
|
+
}
|
|
90
|
+
|
|
77
91
|
@media only screen and (max-width: 460px) {
|
|
78
92
|
:host {
|
|
79
93
|
--ox-filters-form-label-font: bold 13px var(--theme-font);
|
|
@@ -6,6 +6,7 @@ import '@operato/input/ox-input-search.js'
|
|
|
6
6
|
import json5 from 'json5'
|
|
7
7
|
import { css, html, LitElement, nothing, PropertyValues, TemplateResult } from 'lit'
|
|
8
8
|
import { customElement, property, queryAsync, state } from 'lit/decorators.js'
|
|
9
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
|
9
10
|
|
|
10
11
|
import { getDefaultValue } from '@operato/time-calculator'
|
|
11
12
|
import { PagePreferenceProvider } from '@operato/p13n'
|
|
@@ -19,10 +20,12 @@ export type QueryFilterRangeValue = [from: number, to: number]
|
|
|
19
20
|
@customElement('ox-filters-form-base')
|
|
20
21
|
export class OxFiltersFormBase extends LitElement {
|
|
21
22
|
static styles = [
|
|
23
|
+
MDTypeScaleStyles,
|
|
22
24
|
FilterStyles,
|
|
23
25
|
css`
|
|
24
26
|
:host {
|
|
25
27
|
display: flex;
|
|
28
|
+
padding: var(--spacing-small);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
form {
|
|
@@ -30,13 +33,13 @@ export class OxFiltersFormBase extends LitElement {
|
|
|
30
33
|
|
|
31
34
|
display: flex;
|
|
32
35
|
flex-flow: row wrap;
|
|
33
|
-
gap: var(--
|
|
36
|
+
gap: var(--spacing-medium) var(--spacing-large);
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
form > * {
|
|
37
40
|
display: flex;
|
|
38
41
|
align-items: center;
|
|
39
|
-
gap: var(--
|
|
42
|
+
gap: var(--spacing-small, 4px);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
label span {
|
|
@@ -127,6 +130,7 @@ export class OxFiltersFormBase extends LitElement {
|
|
|
127
130
|
render(): TemplateResult {
|
|
128
131
|
return html`
|
|
129
132
|
<form
|
|
133
|
+
class="md-typescale-body-medium-prominent"
|
|
130
134
|
@submit=${(e: Event) => {
|
|
131
135
|
e.preventDefault()
|
|
132
136
|
}}
|
|
@@ -23,7 +23,7 @@ export const MultiColumnFormStyles = css`
|
|
|
23
23
|
|
|
24
24
|
padding: var(--legend-padding);
|
|
25
25
|
font: var(--legend-font);
|
|
26
|
-
color: var(--legend-text-color);
|
|
26
|
+
color: var(--legend-text-color, var(--md-sys-color-on-surface-variant));
|
|
27
27
|
border-bottom: var(--legend-border-bottom);
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ export const MultiColumnFormStyles = css`
|
|
|
33
33
|
text-transform: capitalize;
|
|
34
34
|
align-self: center;
|
|
35
35
|
|
|
36
|
-
color: var(--label-color);
|
|
36
|
+
color: var(--label-color, var(--md-sys-color-on-surface));
|
|
37
37
|
font: var(--label-font);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -72,7 +72,7 @@ export const MultiColumnFormStyles = css`
|
|
|
72
72
|
grid-column: span 9 / auto;
|
|
73
73
|
|
|
74
74
|
font: var(--form-sublabel-font);
|
|
75
|
-
color: var(--form-sublabel-color);
|
|
75
|
+
color: var(--form-sublabel-color, var(--md-sys-color-on-surface));
|
|
76
76
|
}
|
|
77
77
|
.multi-column-form [options-wrap] {
|
|
78
78
|
grid-column: span 21 / auto;
|
|
@@ -80,7 +80,7 @@ export const MultiColumnFormStyles = css`
|
|
|
80
80
|
|
|
81
81
|
input:focus {
|
|
82
82
|
outline: none;
|
|
83
|
-
border: 1px solid var(--focus-background-color);
|
|
83
|
+
border: 1px solid var(--focus-background-color, var(--md-sys-color-surface-variant));
|
|
84
84
|
}
|
|
85
85
|
input[type='checkbox'] {
|
|
86
86
|
margin: 0;
|
|
@@ -109,7 +109,7 @@ export const MultiColumnFormStyles = css`
|
|
|
109
109
|
.multi-column-form [custom-input] {
|
|
110
110
|
grid-column: span 8 / auto;
|
|
111
111
|
max-width: initial;
|
|
112
|
-
padding: var(--padding-default);
|
|
112
|
+
padding: var(--padding-default, var(--spacing-medium));
|
|
113
113
|
font: normal 15px var(--theme-font);
|
|
114
114
|
}
|
|
115
115
|
.multi-column-form input[type='checkbox'],
|
|
@@ -131,7 +131,7 @@ export const MultiColumnFormStyles = css`
|
|
|
131
131
|
.multi-column-form [options-wrap] {
|
|
132
132
|
grid-column: span 12 / auto;
|
|
133
133
|
display: grid;
|
|
134
|
-
grid-gap: var(--padding-default) var(--padding-narrow);
|
|
134
|
+
grid-gap: var(--padding-default, var(--spacing-small)) var(--padding-narrow, var(--spacing-small));
|
|
135
135
|
grid-template-columns: repeat(12, 1fr);
|
|
136
136
|
}
|
|
137
137
|
.multi-column-form [options-wrap] input[type='checkbox'] + label,
|
|
@@ -3,17 +3,15 @@ import { css } from 'lit'
|
|
|
3
3
|
export const SearchFormStyles = css`
|
|
4
4
|
:host {
|
|
5
5
|
overflow: auto;
|
|
6
|
-
background-color:
|
|
6
|
+
background-color: transparent;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.search-form {
|
|
10
10
|
position: relative;
|
|
11
11
|
display: grid;
|
|
12
12
|
grid-template-columns: repeat(24, 1fr);
|
|
13
|
-
grid-gap: var(--form-grid-gap);
|
|
13
|
+
grid-gap: var(--form-grid-gap, var(--spacing-medium));
|
|
14
14
|
grid-auto-rows: minmax(24px, auto);
|
|
15
|
-
padding: var(--search-form-box-padding);
|
|
16
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
17
15
|
}
|
|
18
16
|
.search-form label {
|
|
19
17
|
grid-column: span 3;
|
|
@@ -21,8 +19,8 @@ export const SearchFormStyles = css`
|
|
|
21
19
|
align-self: center;
|
|
22
20
|
text-transform: capitalize;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
font-size:var(--md-sys-typescale-label-medium-size);
|
|
23
|
+
color: var(--md-sys-color-on-primary-container);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
.search-form input,
|
|
@@ -30,12 +28,13 @@ export const SearchFormStyles = css`
|
|
|
30
28
|
grid-column: span 9;
|
|
31
29
|
|
|
32
30
|
border: var(--input-field-border);
|
|
31
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
33
32
|
border-radius: var(--input-field-border-radius);
|
|
34
|
-
padding: var(--input-field-padding);
|
|
33
|
+
padding: var(--input-field-padding, var(--spacing-tiny));
|
|
35
34
|
font: var(--input-field-font);
|
|
36
35
|
max-width: 85%;
|
|
37
|
-
color: var(--input-field-color);
|
|
38
|
-
background-color:
|
|
36
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
37
|
+
background-color: transparent;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
.search-form select {
|
|
@@ -60,13 +59,13 @@ export const SearchFormStyles = css`
|
|
|
60
59
|
grid-column: span 9 / auto;
|
|
61
60
|
|
|
62
61
|
font: var(--form-sublabel-font);
|
|
63
|
-
color: var(--form-sublabel-color);
|
|
62
|
+
color: var(--form-sublabel-color, var(--md-sys-color-on-surface-variant));
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
input:focus {
|
|
67
66
|
outline: none;
|
|
68
|
-
border: 1px solid var(--focus-background-color);
|
|
69
67
|
}
|
|
68
|
+
|
|
70
69
|
input[type='checkbox'] {
|
|
71
70
|
margin: 0;
|
|
72
71
|
}
|
|
@@ -75,14 +74,14 @@ export const SearchFormStyles = css`
|
|
|
75
74
|
position: absolute;
|
|
76
75
|
right: 1%;
|
|
77
76
|
bottom: 15px;
|
|
78
|
-
color: var(--search-form-icon-color);
|
|
77
|
+
color: var(--search-form-icon-color, var(--md-sys-color-on-surface));
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
@media screen and (max-width: 460px) {
|
|
82
81
|
.search-form {
|
|
83
82
|
grid-template-columns: repeat(12, 1fr);
|
|
84
|
-
grid-gap:
|
|
85
|
-
background-color:
|
|
83
|
+
grid-gap: var(--spacing-medium) var(--spacing-medium);
|
|
84
|
+
background-color: transparent
|
|
86
85
|
|
|
87
86
|
max-height: 100%;
|
|
88
87
|
overflow-y: auto;
|
|
@@ -91,13 +90,13 @@ export const SearchFormStyles = css`
|
|
|
91
90
|
grid-column: span 3;
|
|
92
91
|
padding-right: 5px;
|
|
93
92
|
align-self: center;
|
|
94
|
-
color: var(--search-form-narrow-text-color);
|
|
93
|
+
color: var(--search-form-narrow-text-color, var(--md-sys-color-on-surface));
|
|
95
94
|
}
|
|
96
95
|
.search-form input,
|
|
97
96
|
.search-form select {
|
|
98
97
|
grid-column: span 8;
|
|
99
98
|
max-width: 100%;
|
|
100
|
-
color: var(--
|
|
99
|
+
color: var(--md-sys-color-surface, var(--md-sys-color-on-surface));
|
|
101
100
|
}
|
|
102
101
|
.search-form input[type='checkbox'],
|
|
103
102
|
.search-form input[type='radio'] {
|
|
@@ -112,12 +111,12 @@ export const SearchFormStyles = css`
|
|
|
112
111
|
align-self: center;
|
|
113
112
|
position: relative;
|
|
114
113
|
left: 5px;
|
|
115
|
-
color: var(--search-form-narrow-text-color);
|
|
114
|
+
color: var(--search-form-narrow-text-color, var(--md-sys-color-on-surface));
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
[search] {
|
|
119
118
|
right: 3%;
|
|
120
|
-
color: var(--search-form-narrow-text-color);
|
|
119
|
+
color: var(--search-form-narrow-text-color, var(--md-sys-color-on-surface));
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
@media (min-width: 461px) and (max-width: 1024px) {
|
|
@@ -24,7 +24,7 @@ export const SingleColumnFormStyles = css`
|
|
|
24
24
|
|
|
25
25
|
padding: var(--legend-padding);
|
|
26
26
|
font: var(--legend-font);
|
|
27
|
-
color: var(--legend-text-color);
|
|
27
|
+
color: var(--legend-text-color, var(--md-sys-color-on-surface-variant));
|
|
28
28
|
border-bottom: var(--legend-border-bottom);
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ export const SingleColumnFormStyles = css`
|
|
|
33
33
|
text-align: right;
|
|
34
34
|
text-transform: capitalize;
|
|
35
35
|
|
|
36
|
-
color: var(--label-color);
|
|
36
|
+
color: var(--label-color, var(--md-sys-color-on-surface));
|
|
37
37
|
font: var(--label-font);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -66,12 +66,12 @@ export const SingleColumnFormStyles = css`
|
|
|
66
66
|
grid-column: span 9 / auto;
|
|
67
67
|
|
|
68
68
|
font: var(--form-sublabel-font);
|
|
69
|
-
color: var(--form-sublabel-color);
|
|
69
|
+
color: var(--form-sublabel-color, var(--md-sys-color-on-surface));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
input:focus {
|
|
73
73
|
outline: none;
|
|
74
|
-
border: 1px solid var(--focus-background-color);
|
|
74
|
+
border: 1px solid var(--focus-background-color, var(--md-sys-color-surface-variant));
|
|
75
75
|
}
|
|
76
76
|
input[type='checkbox'] {
|
|
77
77
|
margin: 0;
|
|
@@ -94,7 +94,7 @@ export const SingleColumnFormStyles = css`
|
|
|
94
94
|
.single-column-form [custom-input] {
|
|
95
95
|
grid-column: span 12;
|
|
96
96
|
|
|
97
|
-
padding: var(--padding-default);
|
|
97
|
+
padding: var(--padding-default, var(--spacing-medium));
|
|
98
98
|
font: normal 15px var(--theme-font);
|
|
99
99
|
}
|
|
100
100
|
.single-column-form input[type='checkbox'],
|
|
@@ -2,6 +2,7 @@ import { CommonHeaderStyles } from '@operato/styles'
|
|
|
2
2
|
import '../src/filters/ox-filters-form-base.js'
|
|
3
3
|
|
|
4
4
|
import { html, TemplateResult } from 'lit'
|
|
5
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'ox-filters-form-barcode',
|
|
@@ -9,7 +10,8 @@ export default {
|
|
|
9
10
|
argTypes: {
|
|
10
11
|
value: { control: 'object' },
|
|
11
12
|
filters: { control: 'object' },
|
|
12
|
-
urlParamsSensitive: { control: 'boolean' }
|
|
13
|
+
urlParamsSensitive: { control: 'boolean' },
|
|
14
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -23,11 +25,15 @@ interface ArgTypes {
|
|
|
23
25
|
value?: object
|
|
24
26
|
filters?: object
|
|
25
27
|
urlParamsSensitive: boolean
|
|
28
|
+
theme: 'light' | 'dark'
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
const Template: Story<ArgTypes> = ({ value, filters, urlParamsSensitive }: ArgTypes) => html`
|
|
29
|
-
<link href="/
|
|
30
|
-
|
|
31
|
+
const Template: Story<ArgTypes> = ({ value, filters, urlParamsSensitive, theme = 'light' }: ArgTypes) => html`
|
|
32
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
33
|
+
|
|
34
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
|
35
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
|
36
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
31
37
|
|
|
32
38
|
<link
|
|
33
39
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
@@ -42,14 +48,35 @@ const Template: Story<ArgTypes> = ({ value, filters, urlParamsSensitive }: ArgTy
|
|
|
42
48
|
rel="stylesheet"
|
|
43
49
|
/>
|
|
44
50
|
|
|
51
|
+
<style>
|
|
52
|
+
${MDTypeScaleStyles.cssText}
|
|
53
|
+
</style>
|
|
54
|
+
|
|
55
|
+
<style>
|
|
56
|
+
${CommonHeaderStyles.cssText}
|
|
57
|
+
</style>
|
|
58
|
+
|
|
45
59
|
<style>
|
|
46
60
|
body {
|
|
61
|
+
width: 100%;
|
|
47
62
|
height: 500px;
|
|
63
|
+
text-align: center;
|
|
64
|
+
|
|
65
|
+
background-color: var(--md-sys-color-background);
|
|
66
|
+
color: var(--md-sys-color-on-background);
|
|
48
67
|
}
|
|
49
68
|
|
|
50
|
-
|
|
69
|
+
.header {
|
|
70
|
+
padding: var(--spacing-small) var(--spacing-medium);
|
|
71
|
+
background-color: var(--md-sys-color-primary-container);
|
|
72
|
+
color: var(--md-sys-color-on-primary-container);
|
|
73
|
+
}
|
|
51
74
|
</style>
|
|
52
75
|
|
|
76
|
+
<script>
|
|
77
|
+
document.body.classList.add('${theme}')
|
|
78
|
+
</script>
|
|
79
|
+
|
|
53
80
|
<div class="header">
|
|
54
81
|
<div class="filters">
|
|
55
82
|
<ox-filters-form-base
|
|
@@ -3,6 +3,8 @@ import { sleep } from '@operato/utils'
|
|
|
3
3
|
import '../src/filters/ox-filters-form-base.js'
|
|
4
4
|
|
|
5
5
|
import { html, TemplateResult } from 'lit'
|
|
6
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
|
7
|
+
|
|
6
8
|
import { OxFiltersFormBase, FilterConfig, FilterValue } from '../src/index.js'
|
|
7
9
|
|
|
8
10
|
export default {
|
|
@@ -11,7 +13,8 @@ export default {
|
|
|
11
13
|
argTypes: {
|
|
12
14
|
value: { control: 'object' },
|
|
13
15
|
filters: { control: 'object' },
|
|
14
|
-
urlParamsSensitive: { control: 'boolean' }
|
|
16
|
+
urlParamsSensitive: { control: 'boolean' },
|
|
17
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
|
|
@@ -25,12 +28,15 @@ interface ArgTypes {
|
|
|
25
28
|
value?: FilterValue[]
|
|
26
29
|
filters?: FilterConfig[]
|
|
27
30
|
urlParamsSensitive: boolean
|
|
31
|
+
theme: 'light' | 'dark'
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
const Template: Story<ArgTypes> = ({ value, filters, urlParamsSensitive }: ArgTypes) => html`
|
|
31
|
-
<link href="/
|
|
32
|
-
|
|
33
|
-
<link href="/themes/
|
|
34
|
+
const Template: Story<ArgTypes> = ({ value, filters, urlParamsSensitive, theme = 'light' }: ArgTypes) => html`
|
|
35
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
36
|
+
|
|
37
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
|
38
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
|
39
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
34
40
|
|
|
35
41
|
<link
|
|
36
42
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
@@ -46,33 +52,34 @@ const Template: Story<ArgTypes> = ({ value, filters, urlParamsSensitive }: ArgTy
|
|
|
46
52
|
/>
|
|
47
53
|
|
|
48
54
|
<style>
|
|
49
|
-
|
|
50
|
-
height: 500px;
|
|
51
|
-
}
|
|
55
|
+
${MDTypeScaleStyles.cssText}
|
|
52
56
|
</style>
|
|
53
57
|
|
|
54
58
|
<style>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
--ox-filters-label-font: normal 14px var(--theme-font);
|
|
67
|
-
--ox-filters-label-color: var(--primary-text-color);
|
|
68
|
-
|
|
69
|
-
--ox-filters-form-gap: var(--input-gap-vertical, 8px) var(--input-gap-horizontal, 16px);
|
|
70
|
-
--ox-filters-input-padding: 6px 2px;
|
|
59
|
+
${CommonHeaderStyles.cssText}
|
|
60
|
+
</style>
|
|
61
|
+
|
|
62
|
+
<style>
|
|
63
|
+
body {
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 500px;
|
|
66
|
+
text-align: center;
|
|
67
|
+
|
|
68
|
+
background-color: var(--md-sys-color-background);
|
|
69
|
+
color: var(--md-sys-color-on-background);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
.header {
|
|
73
|
+
padding: var(--spacing-medium);
|
|
74
|
+
background-color: var(--md-sys-color-primary-container);
|
|
75
|
+
color: var(--md-sys-color-on-primary-container);
|
|
76
|
+
}
|
|
74
77
|
</style>
|
|
75
78
|
|
|
79
|
+
<script>
|
|
80
|
+
document.body.classList.add('${theme}')
|
|
81
|
+
</script>
|
|
82
|
+
|
|
76
83
|
<div class="header">
|
|
77
84
|
<div class="filters">
|
|
78
85
|
<ox-filters-form-base
|