@operato/input 2.0.0-alpha.99 → 2.0.0-beta.0
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 +246 -0
- package/demo/index-barcode.html +4 -4
- package/demo/index-checkbox.html +4 -4
- package/demo/index-code.html +4 -4
- package/demo/index-options.html +2 -2
- package/dist/src/ox-buttons-radio.d.ts +9 -5
- package/dist/src/ox-buttons-radio.js +43 -11
- package/dist/src/ox-buttons-radio.js.map +1 -1
- package/dist/src/ox-checkbox.js +23 -19
- package/dist/src/ox-checkbox.js.map +1 -1
- package/dist/src/ox-input-3axis.js +12 -1
- package/dist/src/ox-input-3axis.js.map +1 -1
- package/dist/src/ox-input-3dish.js +16 -11
- package/dist/src/ox-input-3dish.js.map +1 -1
- package/dist/src/ox-input-angle.js +8 -1
- package/dist/src/ox-input-angle.js.map +1 -1
- package/dist/src/ox-input-barcode.js +11 -8
- package/dist/src/ox-input-barcode.js.map +1 -1
- package/dist/src/ox-input-code.js +3 -0
- package/dist/src/ox-input-code.js.map +1 -1
- package/dist/src/ox-input-color.js +8 -6
- package/dist/src/ox-input-color.js.map +1 -1
- package/dist/src/ox-input-crontab.js +29 -25
- package/dist/src/ox-input-crontab.js.map +1 -1
- package/dist/src/ox-input-data.js +15 -6
- package/dist/src/ox-input-data.js.map +1 -1
- package/dist/src/ox-input-duration.js +15 -34
- package/dist/src/ox-input-duration.js.map +1 -1
- package/dist/src/ox-input-file.js +18 -14
- package/dist/src/ox-input-file.js.map +1 -1
- package/dist/src/ox-input-hashtags.js +13 -14
- package/dist/src/ox-input-hashtags.js.map +1 -1
- package/dist/src/ox-input-i18n-label.js +4 -4
- package/dist/src/ox-input-i18n-label.js.map +1 -1
- package/dist/src/ox-input-image.js +2 -2
- package/dist/src/ox-input-image.js.map +1 -1
- package/dist/src/ox-input-key-values.js +6 -6
- package/dist/src/ox-input-key-values.js.map +1 -1
- package/dist/src/ox-input-mass-fraction.js +5 -5
- package/dist/src/ox-input-mass-fraction.js.map +1 -1
- package/dist/src/ox-input-multiple-colors.js +2 -2
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.js +6 -6
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-partition-keys.js +6 -6
- package/dist/src/ox-input-partition-keys.js.map +1 -1
- package/dist/src/ox-input-privilege.js +13 -16
- package/dist/src/ox-input-privilege.js.map +1 -1
- package/dist/src/ox-input-quantifier.js +5 -5
- package/dist/src/ox-input-quantifier.js.map +1 -1
- package/dist/src/ox-input-range.js +8 -8
- package/dist/src/ox-input-range.js.map +1 -1
- package/dist/src/ox-input-search.js +5 -6
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/src/ox-input-select-buttons.d.ts +2 -0
- package/dist/src/ox-input-select-buttons.js +14 -21
- package/dist/src/ox-input-select-buttons.js.map +1 -1
- package/dist/src/ox-input-table.js +1 -1
- package/dist/src/ox-input-table.js.map +1 -1
- package/dist/src/ox-input-unit-number.js +5 -5
- package/dist/src/ox-input-unit-number.js.map +1 -1
- package/dist/src/ox-input-value-map.js +9 -13
- package/dist/src/ox-input-value-map.js.map +1 -1
- package/dist/src/ox-input-value-ranges.js +7 -7
- package/dist/src/ox-input-value-ranges.js.map +1 -1
- package/dist/src/ox-input-work-shift.js +7 -7
- package/dist/src/ox-input-work-shift.js.map +1 -1
- package/dist/src/ox-select.d.ts +9 -1
- package/dist/src/ox-select.js +51 -17
- package/dist/src/ox-select.js.map +1 -1
- package/dist/src/ox-zoomable-image.d.ts +17 -0
- package/dist/src/ox-zoomable-image.js +80 -0
- package/dist/src/ox-zoomable-image.js.map +1 -0
- package/dist/stories/ox-buttons-radio.stories.d.ts +31 -0
- package/dist/stories/ox-buttons-radio.stories.js +81 -0
- package/dist/stories/ox-buttons-radio.stories.js.map +1 -0
- package/dist/stories/ox-checkbox.stories.d.ts +6 -0
- package/dist/stories/ox-checkbox.stories.js +57 -13
- package/dist/stories/ox-checkbox.stories.js.map +1 -1
- package/dist/stories/ox-input-3axis.stories.d.ts +5 -0
- package/dist/stories/ox-input-3axis.stories.js +32 -10
- package/dist/stories/ox-input-3axis.stories.js.map +1 -1
- package/dist/stories/ox-input-3dish.stories.d.ts +5 -0
- package/dist/stories/ox-input-3dish.stories.js +35 -13
- package/dist/stories/ox-input-3dish.stories.js.map +1 -1
- package/dist/stories/ox-input-angle.stories.d.ts +5 -0
- package/dist/stories/ox-input-angle.stories.js +36 -13
- package/dist/stories/ox-input-angle.stories.js.map +1 -1
- package/dist/stories/ox-input-barcode.stories.d.ts +5 -0
- package/dist/stories/ox-input-barcode.stories.js +35 -18
- package/dist/stories/ox-input-barcode.stories.js.map +1 -1
- package/dist/stories/ox-input-code.stories.d.ts +5 -0
- package/dist/stories/ox-input-code.stories.js +38 -13
- package/dist/stories/ox-input-code.stories.js.map +1 -1
- package/dist/stories/ox-input-crontab.stories.d.ts +5 -0
- package/dist/stories/ox-input-crontab.stories.js +35 -12
- package/dist/stories/ox-input-crontab.stories.js.map +1 -1
- package/dist/stories/ox-input-data.stories.d.ts +5 -0
- package/dist/stories/ox-input-data.stories.js +34 -11
- package/dist/stories/ox-input-data.stories.js.map +1 -1
- package/dist/stories/ox-input-duration.stories.d.ts +5 -0
- package/dist/stories/ox-input-duration.stories.js +36 -13
- package/dist/stories/ox-input-duration.stories.js.map +1 -1
- package/dist/stories/ox-input-file.stories.d.ts +5 -0
- package/dist/stories/ox-input-file.stories.js +39 -16
- package/dist/stories/ox-input-file.stories.js.map +1 -1
- package/dist/stories/ox-input-hashtags.stories.d.ts +5 -0
- package/dist/stories/ox-input-hashtags.stories.js +35 -12
- package/dist/stories/ox-input-hashtags.stories.js.map +1 -1
- package/dist/stories/ox-input-i18n-label.stories.d.ts +5 -0
- package/dist/stories/ox-input-i18n-label.stories.js +35 -12
- package/dist/stories/ox-input-i18n-label.stories.js.map +1 -1
- package/dist/stories/ox-input-key-values.stories.d.ts +5 -0
- package/dist/stories/ox-input-key-values.stories.js +35 -12
- package/dist/stories/ox-input-key-values.stories.js.map +1 -1
- package/dist/stories/ox-input-mass-fraction.stories.d.ts +5 -0
- package/dist/stories/ox-input-mass-fraction.stories.js +36 -13
- package/dist/stories/ox-input-mass-fraction.stories.js.map +1 -1
- package/dist/stories/ox-input-multiple-colors.stories.d.ts +5 -0
- package/dist/stories/ox-input-multiple-colors.stories.js +31 -149
- package/dist/stories/ox-input-multiple-colors.stories.js.map +1 -1
- package/dist/stories/ox-input-options.stories.d.ts +5 -0
- package/dist/stories/ox-input-options.stories.js +34 -11
- package/dist/stories/ox-input-options.stories.js.map +1 -1
- package/dist/stories/ox-input-partition-keys.stories.d.ts +5 -0
- package/dist/stories/ox-input-partition-keys.stories.js +34 -11
- package/dist/stories/ox-input-partition-keys.stories.js.map +1 -1
- package/dist/stories/ox-input-privilege.stories.d.ts +5 -0
- package/dist/stories/ox-input-privilege.stories.js +36 -18
- package/dist/stories/ox-input-privilege.stories.js.map +1 -1
- package/dist/stories/ox-input-quantifier.stories.d.ts +5 -0
- package/dist/stories/ox-input-quantifier.stories.js +37 -10
- package/dist/stories/ox-input-quantifier.stories.js.map +1 -1
- package/dist/stories/ox-input-range.stories.d.ts +5 -0
- package/dist/stories/ox-input-range.stories.js +32 -5
- package/dist/stories/ox-input-range.stories.js.map +1 -1
- package/dist/stories/ox-input-search.stories.d.ts +5 -0
- package/dist/stories/ox-input-search.stories.js +35 -12
- package/dist/stories/ox-input-search.stories.js.map +1 -1
- package/dist/stories/ox-input-select-buttons.stories.d.ts +5 -0
- package/dist/stories/ox-input-select-buttons.stories.js +36 -14
- package/dist/stories/ox-input-select-buttons.stories.js.map +1 -1
- package/dist/stories/ox-input-unit.stories.d.ts +5 -0
- package/dist/stories/ox-input-unit.stories.js +40 -13
- package/dist/stories/ox-input-unit.stories.js.map +1 -1
- package/dist/stories/ox-input-value-map.stories.d.ts +5 -0
- package/dist/stories/ox-input-value-map.stories.js +36 -13
- package/dist/stories/ox-input-value-map.stories.js.map +1 -1
- package/dist/stories/ox-input-value-ranges.stories.d.ts +5 -0
- package/dist/stories/ox-input-value-ranges.stories.js +36 -13
- package/dist/stories/ox-input-value-ranges.stories.js.map +1 -1
- package/dist/stories/ox-input-work-shift.stories.d.ts +5 -0
- package/dist/stories/ox-input-work-shift.stories.js +36 -13
- package/dist/stories/ox-input-work-shift.stories.js.map +1 -1
- package/dist/stories/ox-select-set-options.stories.d.ts +53 -0
- package/dist/stories/ox-select-set-options.stories.js +183 -0
- package/dist/stories/ox-select-set-options.stories.js.map +1 -0
- package/dist/stories/ox-select.stories.d.ts +5 -0
- package/dist/stories/ox-select.stories.js +33 -7
- package/dist/stories/ox-select.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/ox-buttons-radio.ts +37 -5
- package/src/ox-checkbox.ts +23 -19
- package/src/ox-input-3axis.ts +12 -1
- package/src/ox-input-3dish.ts +16 -11
- package/src/ox-input-angle.ts +8 -1
- package/src/ox-input-barcode.ts +11 -8
- package/src/ox-input-code.ts +3 -0
- package/src/ox-input-color.ts +8 -6
- package/src/ox-input-crontab.ts +29 -25
- package/src/ox-input-data.ts +15 -6
- package/src/ox-input-duration.ts +15 -34
- package/src/ox-input-file.ts +18 -14
- package/src/ox-input-hashtags.ts +14 -16
- package/src/ox-input-i18n-label.ts +4 -4
- package/src/ox-input-image.ts +2 -2
- package/src/ox-input-key-values.ts +6 -6
- package/src/ox-input-mass-fraction.ts +5 -5
- package/src/ox-input-multiple-colors.ts +2 -2
- package/src/ox-input-options.ts +6 -6
- package/src/ox-input-partition-keys.ts +6 -6
- package/src/ox-input-privilege.ts +13 -16
- package/src/ox-input-quantifier.ts +5 -5
- package/src/ox-input-range.ts +8 -8
- package/src/ox-input-search.ts +5 -6
- package/src/ox-input-select-buttons.ts +19 -24
- package/src/ox-input-table.ts +1 -1
- package/src/ox-input-unit-number.ts +5 -5
- package/src/ox-input-value-map.ts +9 -13
- package/src/ox-input-value-ranges.ts +7 -7
- package/src/ox-input-work-shift.ts +7 -7
- package/src/ox-select.ts +60 -13
- package/src/ox-zoomable-image.ts +75 -0
- package/stories/ox-buttons-radio.stories.ts +96 -0
- package/stories/ox-checkbox.stories.ts +61 -14
- package/stories/ox-input-3axis.stories.ts +35 -12
- package/stories/ox-input-3dish.stories.ts +38 -15
- package/stories/ox-input-angle.stories.ts +39 -15
- package/stories/ox-input-barcode.stories.ts +37 -18
- package/stories/ox-input-code.stories.ts +42 -15
- package/stories/ox-input-crontab.stories.ts +43 -14
- package/stories/ox-input-data.stories.ts +38 -14
- package/stories/ox-input-duration.stories.ts +39 -15
- package/stories/ox-input-file.stories.ts +41 -16
- package/stories/ox-input-hashtags.stories.ts +42 -12
- package/stories/ox-input-i18n-label.stories.ts +55 -31
- package/stories/ox-input-key-values.stories.ts +44 -14
- package/stories/ox-input-mass-fraction.stories.ts +40 -15
- package/stories/ox-input-multiple-colors.stories.ts +34 -151
- package/stories/ox-input-options.stories.ts +37 -13
- package/stories/ox-input-partition-keys.stories.ts +42 -13
- package/stories/ox-input-privilege.stories.ts +45 -20
- package/stories/ox-input-quantifier.stories.ts +38 -10
- package/stories/ox-input-range.stories.ts +34 -5
- package/stories/ox-input-search.stories.ts +37 -12
- package/stories/ox-input-select-buttons.stories.ts +40 -16
- package/stories/ox-input-unit.stories.ts +43 -14
- package/stories/ox-input-value-map.stories.ts +40 -15
- package/stories/ox-input-value-ranges.stories.ts +40 -15
- package/stories/ox-input-work-shift.stories.ts +39 -15
- package/stories/ox-select-set-options.stories.ts +215 -0
- package/stories/ox-select.stories.ts +37 -7
- 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/input-theme.css +0 -32
@@ -185,16 +185,16 @@ export class OxInputUnitNumber extends OxFormField {
|
|
185
185
|
input {
|
186
186
|
flex: 1;
|
187
187
|
border: 0;
|
188
|
-
border-bottom:
|
189
|
-
padding: var(--
|
188
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
189
|
+
padding: var(--spacing-tiny);
|
190
190
|
font: var(--input-font);
|
191
|
-
color: var(--
|
191
|
+
color: var(--md-sys-color-on-primary-container);
|
192
192
|
min-width: 40px;
|
193
193
|
}
|
194
194
|
|
195
195
|
input:focus {
|
196
196
|
outline: none;
|
197
|
-
border-bottom: 1px solid var(--primary-
|
197
|
+
border-bottom: 1px solid var(--md-sys-color-on-primary-container);
|
198
198
|
}
|
199
199
|
|
200
200
|
input::-webkit-outer-spin-button,
|
@@ -220,7 +220,7 @@ export class OxInputUnitNumber extends OxFormField {
|
|
220
220
|
}
|
221
221
|
|
222
222
|
md-icon {
|
223
|
-
color: var(--primary-
|
223
|
+
color: var(--md-sys-color-on-primary-container, #3c3938);
|
224
224
|
margin-left: auto;
|
225
225
|
}
|
226
226
|
|
@@ -31,7 +31,7 @@ export class OxInputValueMap extends OxFormField {
|
|
31
31
|
:host {
|
32
32
|
display: flex;
|
33
33
|
flex-direction: column;
|
34
|
-
border:
|
34
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
35
35
|
padding: var(--padding-narrow) var(--padding-narrow) 0 var(--padding-narrow);
|
36
36
|
|
37
37
|
--md-icon-size: var(--fontsize-default, 14px);
|
@@ -71,7 +71,7 @@ export class OxInputValueMap extends OxFormField {
|
|
71
71
|
button:active {
|
72
72
|
border: var(--button-activ-border);
|
73
73
|
background-color: var(--button-background-focus-color);
|
74
|
-
color: var(--
|
74
|
+
color: var(--md-sys-color-primary-container);
|
75
75
|
}
|
76
76
|
|
77
77
|
[data-key],
|
@@ -81,15 +81,15 @@ export class OxInputValueMap extends OxFormField {
|
|
81
81
|
|
82
82
|
input {
|
83
83
|
border: 0;
|
84
|
-
border-bottom:
|
85
|
-
padding: var(--
|
84
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
85
|
+
padding: var(--spacing-tiny);
|
86
86
|
font: var(--input-font);
|
87
|
-
color: var(--
|
87
|
+
color: var(--md-sys-color-on-primary-container);
|
88
88
|
}
|
89
89
|
|
90
90
|
input:focus {
|
91
91
|
outline: none;
|
92
|
-
border-bottom: 1px solid var(--primary-
|
92
|
+
border-bottom: 1px solid var(--md-sys-color-on-primary-container);
|
93
93
|
}
|
94
94
|
|
95
95
|
button.hidden {
|
@@ -98,13 +98,9 @@ export class OxInputValueMap extends OxFormField {
|
|
98
98
|
}
|
99
99
|
|
100
100
|
ox-input-color {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
--input-color-input-span: {
|
105
|
-
width: 10px;
|
106
|
-
height: 10px;
|
107
|
-
}
|
101
|
+
margin: 1px;
|
102
|
+
width: 10px;
|
103
|
+
height: 10px;
|
108
104
|
}
|
109
105
|
|
110
106
|
input[type='checkbox'] {
|
@@ -31,7 +31,7 @@ export class OxInputValueRange extends OxFormField {
|
|
31
31
|
:host {
|
32
32
|
display: flex;
|
33
33
|
flex-direction: column;
|
34
|
-
border:
|
34
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
35
35
|
padding: var(--padding-narrow) var(--padding-narrow) 0 var(--padding-narrow);
|
36
36
|
|
37
37
|
--md-icon-size: var(--fontsize-default, 14px);
|
@@ -71,7 +71,7 @@ export class OxInputValueRange extends OxFormField {
|
|
71
71
|
button:active {
|
72
72
|
border: var(--button-activ-border);
|
73
73
|
background-color: var(--button-background-focus-color);
|
74
|
-
color: var(--
|
74
|
+
color: var(--md-sys-color-primary-container);
|
75
75
|
}
|
76
76
|
|
77
77
|
[data-from],
|
@@ -85,15 +85,15 @@ export class OxInputValueRange extends OxFormField {
|
|
85
85
|
|
86
86
|
input {
|
87
87
|
border: 0;
|
88
|
-
border-bottom:
|
89
|
-
padding: var(--
|
88
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
89
|
+
padding: var(--spacing-tiny);
|
90
90
|
font: var(--input-font);
|
91
|
-
color: var(--
|
91
|
+
color: var(--md-sys-color-on-primary-container);
|
92
92
|
}
|
93
93
|
|
94
94
|
input:focus {
|
95
95
|
outline: none;
|
96
|
-
border-bottom: 1px solid var(--primary-
|
96
|
+
border-bottom: 1px solid var(--md-sys-color-on-primary-container);
|
97
97
|
}
|
98
98
|
|
99
99
|
button.hidden {
|
@@ -116,7 +116,7 @@ export class OxInputValueRange extends OxFormField {
|
|
116
116
|
}
|
117
117
|
|
118
118
|
[filler] {
|
119
|
-
padding: var(--
|
119
|
+
padding: var(--spacing-tiny);
|
120
120
|
flex: 1;
|
121
121
|
}
|
122
122
|
|
@@ -38,7 +38,7 @@ export class OxInputWorkShift extends OxFormField {
|
|
38
38
|
div {
|
39
39
|
display: flex;
|
40
40
|
flex-flow: row nowrap;
|
41
|
-
gap: var(--
|
41
|
+
gap: var(--spacing-medium);
|
42
42
|
}
|
43
43
|
|
44
44
|
empty-element {
|
@@ -52,7 +52,7 @@ export class OxInputWorkShift extends OxFormField {
|
|
52
52
|
flex: 1;
|
53
53
|
}
|
54
54
|
[data-header] {
|
55
|
-
background-color: rgba(var(--
|
55
|
+
background-color: rgba(var(--md-sys-color-on-primary-container-rgb), 0.05);
|
56
56
|
padding: var(--padding-narrow);
|
57
57
|
}
|
58
58
|
[data-header] span {
|
@@ -67,17 +67,17 @@ export class OxInputWorkShift extends OxFormField {
|
|
67
67
|
input,
|
68
68
|
select {
|
69
69
|
border: 0;
|
70
|
-
border-bottom:
|
71
|
-
padding: var(--
|
70
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
71
|
+
padding: var(--spacing-tiny);
|
72
72
|
font: var(--input-font);
|
73
|
-
color: var(--
|
73
|
+
color: var(--md-sys-color-on-primary-container);
|
74
74
|
|
75
75
|
max-height: 35px;
|
76
76
|
}
|
77
77
|
input:focus,
|
78
78
|
select:focus {
|
79
79
|
outline: none;
|
80
|
-
border-bottom: 1px solid var(--primary-
|
80
|
+
border-bottom: 1px solid var(--md-sys-color-on-primary-container);
|
81
81
|
}
|
82
82
|
|
83
83
|
input:required:invalid {
|
@@ -98,7 +98,7 @@ export class OxInputWorkShift extends OxFormField {
|
|
98
98
|
button:active {
|
99
99
|
border: var(--button-activ-border);
|
100
100
|
background-color: var(--button-background-focus-color);
|
101
|
-
color: var(--
|
101
|
+
color: var(--md-sys-color-primary-container);
|
102
102
|
}
|
103
103
|
|
104
104
|
[placeholder='value'] {
|
package/src/ox-select.ts
CHANGED
@@ -4,9 +4,10 @@
|
|
4
4
|
|
5
5
|
import '@material/web/icon/icon.js'
|
6
6
|
import '@operato/popup/ox-popup-list.js'
|
7
|
+
import './ox-checkbox.js'
|
7
8
|
|
8
|
-
import { css, html, PropertyValues } from 'lit'
|
9
|
-
import { customElement, property, state } from 'lit/decorators.js'
|
9
|
+
import { css, html, render, PropertyValues, nothing } from 'lit'
|
10
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
10
11
|
|
11
12
|
import { OxPopupList } from '@operato/popup'
|
12
13
|
import { TooltipStyles } from '@operato/styles'
|
@@ -27,20 +28,20 @@ function onmouseout(e: Event) {
|
|
27
28
|
}
|
28
29
|
|
29
30
|
@customElement('ox-select')
|
30
|
-
export class
|
31
|
+
export class OxSelect extends OxFormField {
|
31
32
|
static styles = [
|
32
33
|
TooltipStyles,
|
33
34
|
css`
|
34
35
|
:host {
|
35
36
|
display: block;
|
36
37
|
position: relative;
|
37
|
-
border-bottom:
|
38
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
|
38
39
|
|
39
|
-
--ox-select-padding: var(--
|
40
|
+
--ox-select-padding: var(--spacing-tiny);
|
40
41
|
--ox-select-font: var(--input-font);
|
41
|
-
--ox-select-color: var(--input-color);
|
42
|
-
--ox-select-icon-color: var(--theme-primary-text-color,
|
43
|
-
--ox-select-icon-hover-color: var(--primary-
|
42
|
+
--ox-select-color: var(--input-color, var(--md-sys-color-on-surface-variant));
|
43
|
+
--ox-select-icon-color: var(--theme-primary-text-color, var(--md-sys-color-on-surface-variant));
|
44
|
+
--ox-select-icon-hover-color: var(--md-sys-color-on-primary-container, #3c3938);
|
44
45
|
}
|
45
46
|
|
46
47
|
div {
|
@@ -74,7 +75,7 @@ export class Select extends OxFormField {
|
|
74
75
|
}
|
75
76
|
|
76
77
|
div:hover md-icon {
|
77
|
-
color: var(--primary-
|
78
|
+
color: var(--md-sys-color-on-primary-container);
|
78
79
|
}
|
79
80
|
|
80
81
|
::slotted(ox-popup-list) {
|
@@ -137,14 +138,60 @@ export class Select extends OxFormField {
|
|
137
138
|
async updated(changes: PropertyValues<this>) {
|
138
139
|
if (changes.has('value')) {
|
139
140
|
const popupList = this.querySelector('ox-popup-list') as OxPopupList
|
140
|
-
popupList
|
141
|
+
if (popupList) {
|
142
|
+
popupList.value = this.value
|
143
|
+
await this.requestUpdate()
|
141
144
|
|
142
|
-
|
143
|
-
|
144
|
-
this.label = popupList.getSelectedLabels()
|
145
|
+
this.label = popupList.getSelectedLabels()
|
146
|
+
}
|
145
147
|
}
|
146
148
|
}
|
147
149
|
|
150
|
+
setOptions(
|
151
|
+
options: string[] | { display: string; value: string }[],
|
152
|
+
opt: { multiple?: boolean; withSearch?: boolean } = {}
|
153
|
+
) {
|
154
|
+
const objOptions = options.map(option => {
|
155
|
+
return typeof option == 'string' ? { display: option, value: option } : option
|
156
|
+
})
|
157
|
+
|
158
|
+
const { multiple, withSearch } = opt || {}
|
159
|
+
|
160
|
+
const template = html`
|
161
|
+
<ox-popup-list
|
162
|
+
align-left
|
163
|
+
nowrap
|
164
|
+
?multiple=${multiple}
|
165
|
+
attr-selected=${multiple ? 'checked' : ''}
|
166
|
+
?with-search=${withSearch}
|
167
|
+
>
|
168
|
+
${multiple
|
169
|
+
? html`<ox-checkbox
|
170
|
+
@change=${(e: Event) => {
|
171
|
+
const target = e.target as HTMLInputElement
|
172
|
+
const options = Array.from(target.parentElement!.querySelectorAll('[option]')).filter(
|
173
|
+
option => !option.hasAttribute('hidden')
|
174
|
+
)
|
175
|
+
options.forEach(option => ((option as HTMLInputElement).checked = target.checked))
|
176
|
+
|
177
|
+
this.value = options
|
178
|
+
.map(option =>
|
179
|
+
(option as HTMLInputElement).checked ? (option as HTMLInputElement).value : undefined
|
180
|
+
)
|
181
|
+
.filter(Boolean)
|
182
|
+
}}
|
183
|
+
>set all</ox-checkbox
|
184
|
+
>
|
185
|
+
${objOptions.map(
|
186
|
+
option => html` <ox-checkbox option value=${option.value}>${option.display}</ox-checkbox> `
|
187
|
+
)} `
|
188
|
+
: html`${objOptions.map(option => html` <div option value=${option.value}>${option.display}</div> `)}`}
|
189
|
+
</ox-popup-list>
|
190
|
+
`
|
191
|
+
|
192
|
+
render(template, this)
|
193
|
+
}
|
194
|
+
|
148
195
|
expand() {
|
149
196
|
if (this.disabled) {
|
150
197
|
return
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import { LitElement, html, css } from 'lit'
|
2
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
3
|
+
|
4
|
+
@customElement('ox-zoomable-image')
|
5
|
+
export class OxZoomableImage extends LitElement {
|
6
|
+
static styles = css`
|
7
|
+
:host {
|
8
|
+
display: block;
|
9
|
+
overflow: hidden;
|
10
|
+
position: relative;
|
11
|
+
}
|
12
|
+
|
13
|
+
img {
|
14
|
+
transition: transform 0.25s ease;
|
15
|
+
transform-origin: center;
|
16
|
+
cursor: grab;
|
17
|
+
}
|
18
|
+
`
|
19
|
+
|
20
|
+
@property({ type: String }) src = ''
|
21
|
+
|
22
|
+
@query('img') image!: HTMLImageElement
|
23
|
+
|
24
|
+
private scale: number = 1
|
25
|
+
private startX: number = 0
|
26
|
+
private startY: number = 0
|
27
|
+
private x: number = 0
|
28
|
+
private y: number = 0
|
29
|
+
private dragging: boolean = false
|
30
|
+
|
31
|
+
render() {
|
32
|
+
return html`
|
33
|
+
<img
|
34
|
+
id="zoomableImage"
|
35
|
+
src="${this.src}"
|
36
|
+
@wheel="${this.handleWheel}"
|
37
|
+
@mousedown="${this.handleMouseDown}"
|
38
|
+
@mousemove="${this.handleMouseMove}"
|
39
|
+
@mouseup="${this.handleMouseUp}"
|
40
|
+
@mouseleave="${this.handleMouseUp}"
|
41
|
+
style="transform: translate(${this.x}px, ${this.y}px) scale(${this.scale});"
|
42
|
+
/>
|
43
|
+
`
|
44
|
+
}
|
45
|
+
|
46
|
+
private handleWheel(event: WheelEvent) {
|
47
|
+
event.preventDefault()
|
48
|
+
const delta = event.deltaY
|
49
|
+
const zoomIntensity = 0.1
|
50
|
+
this.scale += delta > 0 ? -zoomIntensity : zoomIntensity
|
51
|
+
this.scale = Math.max(0.1, Math.min(this.scale, 4))
|
52
|
+
this.requestUpdate()
|
53
|
+
}
|
54
|
+
|
55
|
+
private handleMouseDown(event: MouseEvent) {
|
56
|
+
this.startX = event.clientX - this.x
|
57
|
+
this.startY = event.clientY - this.y
|
58
|
+
this.dragging = true
|
59
|
+
const img = this.image as HTMLImageElement
|
60
|
+
img.style.cursor = 'grabbing'
|
61
|
+
}
|
62
|
+
|
63
|
+
private handleMouseMove(event: MouseEvent) {
|
64
|
+
if (!this.dragging) return
|
65
|
+
this.x = event.clientX - this.startX
|
66
|
+
this.y = event.clientY - this.startY
|
67
|
+
this.requestUpdate()
|
68
|
+
}
|
69
|
+
|
70
|
+
private handleMouseUp() {
|
71
|
+
this.dragging = false
|
72
|
+
const img = this.image as HTMLImageElement
|
73
|
+
img.style.cursor = 'grab'
|
74
|
+
}
|
75
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import '@material/web/all.js'
|
2
|
+
import '../src/ox-buttons-radio.js'
|
3
|
+
|
4
|
+
import { TemplateResult, html } from 'lit'
|
5
|
+
import { ifDefined } from 'lit/directives/if-defined.js'
|
6
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
7
|
+
|
8
|
+
export default {
|
9
|
+
title: 'ox-buttons-radio',
|
10
|
+
component: 'ox-buttons-radio',
|
11
|
+
argTypes: {
|
12
|
+
value: { control: 'boolean' },
|
13
|
+
disabled: { control: 'boolean' },
|
14
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
interface Story<T> {
|
19
|
+
(args: T): TemplateResult
|
20
|
+
args?: Partial<T>
|
21
|
+
argTypes?: Record<string, unknown>
|
22
|
+
}
|
23
|
+
|
24
|
+
interface ArgTypes {
|
25
|
+
value?: string
|
26
|
+
disabled?: boolean
|
27
|
+
theme?: string
|
28
|
+
}
|
29
|
+
|
30
|
+
const Template: Story<ArgTypes> = ({ value, disabled, theme = 'light' }: ArgTypes) => html`
|
31
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
32
|
+
|
33
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
34
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
35
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
36
|
+
|
37
|
+
<link
|
38
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
39
|
+
rel="stylesheet"
|
40
|
+
/>
|
41
|
+
<link
|
42
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
43
|
+
rel="stylesheet"
|
44
|
+
/>
|
45
|
+
<link
|
46
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
47
|
+
rel="stylesheet"
|
48
|
+
/>
|
49
|
+
|
50
|
+
<style>
|
51
|
+
${MDTypeScaleStyles.cssText}
|
52
|
+
</style>
|
53
|
+
|
54
|
+
<style>
|
55
|
+
.container {
|
56
|
+
height: 500px;
|
57
|
+
text-align: center;
|
58
|
+
padding: 20px;
|
59
|
+
background-color: var(--md-sys-color-primary-container);
|
60
|
+
color: var(--md-sys-color-on-primary-container);
|
61
|
+
|
62
|
+
padding: 20px;
|
63
|
+
}
|
64
|
+
|
65
|
+
ox-buttons-radio {
|
66
|
+
padding: 20px;
|
67
|
+
}
|
68
|
+
</style>
|
69
|
+
|
70
|
+
<script>
|
71
|
+
document.body.classList.add('${theme}')
|
72
|
+
</script>
|
73
|
+
|
74
|
+
<div class="container md-typescale-body-large-prominent">
|
75
|
+
<ox-buttons-radio
|
76
|
+
@change=${(e: CustomEvent) => {
|
77
|
+
console.log('changed', e.detail)
|
78
|
+
}}
|
79
|
+
value=${ifDefined(value)}
|
80
|
+
?disabled=${disabled}
|
81
|
+
>
|
82
|
+
<md-filled-button data-value="1">Option 1</md-filled-button>
|
83
|
+
<md-filled-button data-value="2">Option 2</md-filled-button>
|
84
|
+
<md-outlined-button data-value="3">Option 3</md-outlined-button>
|
85
|
+
<md-text-button trailing-icon>Open<md-icon slot="icon">upload</md-icon></md-text-button>
|
86
|
+
<md-elevated-button>Elevated</md-elevated-button>
|
87
|
+
</ox-buttons-radio>
|
88
|
+
</div>
|
89
|
+
`
|
90
|
+
|
91
|
+
export const Regular = Template.bind({})
|
92
|
+
Regular.args = {
|
93
|
+
value: '',
|
94
|
+
disabled: false,
|
95
|
+
theme: 'light'
|
96
|
+
}
|
@@ -1,6 +1,9 @@
|
|
1
|
+
import '@material/web/all.js'
|
1
2
|
import '../src/ox-checkbox.js'
|
2
3
|
|
3
4
|
import { TemplateResult, html } from 'lit'
|
5
|
+
import { ifDefined } from 'lit/directives/if-defined.js'
|
6
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
4
7
|
|
5
8
|
export default {
|
6
9
|
title: 'ox-checkbox',
|
@@ -11,7 +14,8 @@ export default {
|
|
11
14
|
value: { control: 'boolean' },
|
12
15
|
indeterminatable: { control: 'boolean' },
|
13
16
|
indeterminate: { control: 'boolean' },
|
14
|
-
disabled: { control: 'boolean' }
|
17
|
+
disabled: { control: 'boolean' },
|
18
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
15
19
|
}
|
16
20
|
}
|
17
21
|
|
@@ -28,26 +32,68 @@ interface ArgTypes {
|
|
28
32
|
indeterminatable?: boolean
|
29
33
|
indeterminate?: boolean
|
30
34
|
disabled?: boolean
|
35
|
+
theme?: string
|
31
36
|
}
|
32
37
|
|
33
38
|
const Template: Story<ArgTypes> = ({
|
34
39
|
label = 'Checkbox',
|
35
40
|
name = 'hello',
|
36
|
-
value
|
41
|
+
value,
|
37
42
|
indeterminatable = false,
|
38
43
|
indeterminate = false,
|
39
|
-
disabled
|
44
|
+
disabled,
|
45
|
+
theme = 'light'
|
40
46
|
}: ArgTypes) => html`
|
41
|
-
<
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
48
|
+
|
49
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
50
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
51
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
52
|
+
|
53
|
+
<link
|
54
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
55
|
+
rel="stylesheet"
|
56
|
+
/>
|
57
|
+
<link
|
58
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
59
|
+
rel="stylesheet"
|
60
|
+
/>
|
61
|
+
<link
|
62
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
63
|
+
rel="stylesheet"
|
64
|
+
/>
|
65
|
+
|
66
|
+
<style>
|
67
|
+
${MDTypeScaleStyles.cssText}
|
68
|
+
</style>
|
69
|
+
|
70
|
+
<style>
|
71
|
+
.container {
|
72
|
+
height: 500px;
|
73
|
+
text-align: center;
|
74
|
+
padding: 20px;
|
75
|
+
background-color: var(--md-sys-color-primary-container);
|
76
|
+
color: var(--md-sys-color-on-primary-container);
|
77
|
+
padding: 20px;
|
78
|
+
}
|
79
|
+
</style>
|
80
|
+
|
81
|
+
<script>
|
82
|
+
document.body.classList.add('${theme}')
|
83
|
+
</script>
|
84
|
+
|
85
|
+
<div class="container md-typescale-body-large-prominent">
|
86
|
+
<ox-checkbox
|
87
|
+
@click=${(e: MouseEvent) => console.log('clicked')}
|
88
|
+
name=${name}
|
89
|
+
.checked=${value}
|
90
|
+
?indeterminatable=${indeterminatable}
|
91
|
+
?indeterminate=${indeterminate}
|
92
|
+
?disabled=${disabled}
|
93
|
+
>
|
94
|
+
${label}
|
95
|
+
</ox-checkbox>
|
96
|
+
</div>
|
51
97
|
`
|
52
98
|
|
53
99
|
export const Regular = Template.bind({})
|
@@ -68,6 +114,7 @@ CustomActivated.args = {
|
|
68
114
|
export const CustomIndeterminated = Template.bind({})
|
69
115
|
CustomIndeterminated.args = {
|
70
116
|
label: 'Indeterminated',
|
117
|
+
indeterminatable: true,
|
71
118
|
indeterminate: true,
|
72
|
-
|
119
|
+
theme: 'light'
|
73
120
|
}
|
@@ -2,13 +2,15 @@ import '../src/ox-input-3axis.js'
|
|
2
2
|
import '../src/locale/locale-picker.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-input-3axis',
|
8
9
|
component: 'ox-input-3axis',
|
9
10
|
argTypes: {
|
10
11
|
value: { control: 'object' },
|
11
|
-
disabled: { control: 'boolean' }
|
12
|
+
disabled: { control: 'boolean' },
|
13
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
12
14
|
}
|
13
15
|
}
|
14
16
|
|
@@ -21,10 +23,15 @@ interface Story<T> {
|
|
21
23
|
interface ArgTypes {
|
22
24
|
value?: object
|
23
25
|
disabled?: boolean
|
26
|
+
theme?: string
|
24
27
|
}
|
25
28
|
|
26
|
-
const Template: Story<ArgTypes> = ({ value = {}, disabled }: ArgTypes) => html`
|
27
|
-
<link href="/
|
29
|
+
const Template: Story<ArgTypes> = ({ value = {}, disabled, theme = 'light' }: ArgTypes) => html`
|
30
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
31
|
+
|
32
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
33
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
34
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
28
35
|
|
29
36
|
<link
|
30
37
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
@@ -40,18 +47,34 @@ const Template: Story<ArgTypes> = ({ value = {}, disabled }: ArgTypes) => html`
|
|
40
47
|
/>
|
41
48
|
|
42
49
|
<style>
|
43
|
-
|
50
|
+
${MDTypeScaleStyles.cssText}
|
51
|
+
</style>
|
52
|
+
|
53
|
+
<style>
|
54
|
+
.container {
|
55
|
+
height: 500px;
|
56
|
+
text-align: center;
|
57
|
+
padding: 20px;
|
58
|
+
|
59
|
+
background-color: var(--md-sys-color-primary-container);
|
60
|
+
color: var(--md-sys-color-on-primary-container);
|
44
61
|
}
|
45
62
|
</style>
|
46
63
|
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
64
|
+
<script>
|
65
|
+
document.body.classList.add('${theme}')
|
66
|
+
</script>
|
67
|
+
|
68
|
+
<div class="container md-typescale-body-large-prominent">
|
69
|
+
<ox-input-3axis
|
70
|
+
@change=${(e: Event) => {
|
71
|
+
console.log((e.target as HTMLInputElement).value)
|
72
|
+
}}
|
73
|
+
.value=${value}
|
74
|
+
?disabled=${disabled}
|
75
|
+
>
|
76
|
+
</ox-input-3axis>
|
77
|
+
</div>
|
55
78
|
`
|
56
79
|
|
57
80
|
export const Regular = Template.bind({})
|