@exakt/ui 0.0.58 → 0.0.60
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/dist/module.json +1 -1
- package/dist/runtime/components/e/btn.vue +8 -5
- package/dist/runtime/components/e/container.vue +6 -5
- package/dist/runtime/components/e/dialog.vue +14 -14
- package/dist/runtime/components/e/dropdown.vue +54 -65
- package/dist/runtime/components/e/focus-sheet.vue +11 -8
- package/dist/runtime/components/e/icon.vue +3 -2
- package/dist/runtime/components/e/input/checkbox.vue +103 -0
- package/dist/runtime/components/e/input/combo.vue +72 -22
- package/dist/runtime/components/e/input/date.vue +96 -0
- package/dist/runtime/components/e/input/radio.vue +14 -4
- package/dist/runtime/components/e/input/text.vue +10 -25
- package/dist/runtime/components/e/nav/btn.vue +21 -38
- package/dist/runtime/css/util.scss +7 -0
- package/package.json +5 -5
- package/dist/runtime/components/e/input/datetime-local.vue +0 -98
package/dist/module.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<component
|
|
3
|
+
:is="button ? 'button' : 'div'"
|
|
3
4
|
class="e-btn"
|
|
4
5
|
:style="{ width }"
|
|
5
6
|
:type="type"
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
<slot />
|
|
39
40
|
</span>
|
|
40
41
|
</div>
|
|
41
|
-
</
|
|
42
|
+
</component>
|
|
42
43
|
</template>
|
|
43
44
|
<script lang="ts" setup>
|
|
44
45
|
import { computed, useNuxtApp, } from "#imports";
|
|
@@ -59,6 +60,7 @@ const props = withDefaults(
|
|
|
59
60
|
disabled?: boolean;
|
|
60
61
|
align?: string;
|
|
61
62
|
type?: "button" | "submit" | "reset";
|
|
63
|
+
button?: boolean;
|
|
62
64
|
}>(),
|
|
63
65
|
{
|
|
64
66
|
type: "button",
|
|
@@ -69,6 +71,7 @@ const props = withDefaults(
|
|
|
69
71
|
compact: false,
|
|
70
72
|
align: "center",
|
|
71
73
|
color: undefined,
|
|
74
|
+
button: true
|
|
72
75
|
}
|
|
73
76
|
);
|
|
74
77
|
|
|
@@ -90,7 +93,7 @@ const backgroundColorRgb = computed(() => {
|
|
|
90
93
|
return parseColor($exakt.parseColor(props.background));
|
|
91
94
|
});
|
|
92
95
|
|
|
93
|
-
const isRootColor = computed(() =>
|
|
96
|
+
const isRootColor = computed(() => $exakt && $exakt.rootColors && $exakt.rootColors.includes(props.background))
|
|
94
97
|
const backgroundClass = computed(() => {
|
|
95
98
|
const c: { [key: string]: boolean } = {}
|
|
96
99
|
|
|
@@ -163,7 +166,7 @@ const textColor = computed(() => {
|
|
|
163
166
|
flex-shrink: 1;
|
|
164
167
|
position: relative;
|
|
165
168
|
transition: background 0.4s, color 0.3s, opacity 0.4s;
|
|
166
|
-
|
|
169
|
+
white-space: nowrap;
|
|
167
170
|
font-family: var(--e-font-family);
|
|
168
171
|
box-sizing: border-box;
|
|
169
172
|
|
|
@@ -243,7 +246,7 @@ const textColor = computed(() => {
|
|
|
243
246
|
background: rgba(var(--e-color-primary-rgb), 0.1);
|
|
244
247
|
|
|
245
248
|
&:hover {
|
|
246
|
-
background: rgba(var(--e-color-primary-rgb),0.075);
|
|
249
|
+
background: rgba(var(--e-color-primary-rgb), 0.075);
|
|
247
250
|
opacity: 1;
|
|
248
251
|
}
|
|
249
252
|
}
|
|
@@ -16,11 +16,12 @@ withDefaults(
|
|
|
16
16
|
defineProps<{
|
|
17
17
|
noBtnPadding?: boolean;
|
|
18
18
|
forceFullWidth?: boolean;
|
|
19
|
-
|
|
19
|
+
sizes?: number[],
|
|
20
20
|
}>(),
|
|
21
21
|
{
|
|
22
22
|
noBtnPadding: false,
|
|
23
|
-
forceFullWidth:false
|
|
23
|
+
forceFullWidth:false,
|
|
24
|
+
sizes: () => [100, 95, 85]
|
|
24
25
|
}
|
|
25
26
|
);
|
|
26
27
|
</script>
|
|
@@ -39,15 +40,15 @@ withDefaults(
|
|
|
39
40
|
$padding: 0rem;
|
|
40
41
|
|
|
41
42
|
@media (min-width: exakt.$e-md-screen-breakpoint) {
|
|
42
|
-
width: calc(
|
|
43
|
+
width: calc(v-bind('`${sizes[0]}vw`') - $padding);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
@media (min-width: exakt.$e-lg-screen-breakpoint) {
|
|
46
|
-
width: calc(
|
|
47
|
+
width: calc(v-bind('`${sizes[1]}vw`') - $padding);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
@media (min-width: exakt.$e-xl-screen-breakpoint) {
|
|
50
|
-
width: calc(
|
|
51
|
+
width: calc(v-bind('`${sizes[2]}vw`') - $padding);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<e-focus-sheet
|
|
4
|
-
:model-value="modelValue"
|
|
5
|
-
:opaque-on-desktop="true"
|
|
6
|
-
@update:model-value="emit('update:modelValue', $event)"
|
|
7
|
-
/>
|
|
3
|
+
<e-focus-sheet :model-value="modelValue" :opaque-on-desktop="true"
|
|
4
|
+
@update:model-value="emit('update:modelValue', $event)" v-bind="{ dismissable }" />
|
|
8
5
|
|
|
9
6
|
<e-tr-scale :multiplier="1.3">
|
|
10
|
-
<div
|
|
11
|
-
v-if="modelValue"
|
|
12
|
-
class="dialog-wrap flex-center"
|
|
13
|
-
>
|
|
7
|
+
<div v-if="modelValue" class="dialog-wrap flex-center">
|
|
14
8
|
<div class="dialog bg-elev rounded px-6 pe-6 pb-2">
|
|
15
|
-
<div class="
|
|
9
|
+
<div v-if="!!slots.title" class="my-4">
|
|
16
10
|
<h2 class="ma-0 pa-0">
|
|
17
11
|
<slot name="title" />
|
|
18
12
|
</h2>
|
|
19
13
|
</div>
|
|
20
14
|
<slot />
|
|
21
|
-
<div class="button-bar
|
|
15
|
+
<div class="button-bar mb-3">
|
|
22
16
|
<slot name="buttons" />
|
|
23
17
|
</div>
|
|
24
18
|
</div>
|
|
@@ -28,9 +22,15 @@
|
|
|
28
22
|
</template>
|
|
29
23
|
|
|
30
24
|
<script setup lang="ts">
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
import { useSlots } from '#imports';
|
|
26
|
+
withDefaults(
|
|
27
|
+
defineProps<{
|
|
28
|
+
modelValue: boolean;
|
|
29
|
+
dismissable?: boolean;
|
|
30
|
+
}>(), { dismissable: true });
|
|
31
|
+
|
|
32
|
+
const slots = useSlots();
|
|
33
|
+
|
|
34
34
|
const emit = defineEmits(["update:modelValue"]);
|
|
35
35
|
</script>
|
|
36
36
|
<style scoped lang="scss">
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex-stretch t-dropdown">
|
|
3
3
|
<!-- class="flex-stretch fullwidth" -->
|
|
4
|
-
<div
|
|
5
|
-
ref="activator"
|
|
6
|
-
@click="onActivatorClick"
|
|
7
|
-
>
|
|
4
|
+
<div ref="activator" @click="onActivatorClick">
|
|
8
5
|
<slot />
|
|
9
6
|
</div>
|
|
10
7
|
<e-focus-sheet v-model="visibleComputed" />
|
|
@@ -13,14 +10,15 @@
|
|
|
13
10
|
v-if="visibleComputed"
|
|
14
11
|
ref="list"
|
|
15
12
|
class="list bg-elev-2 rounded"
|
|
16
|
-
:style="{position:
|
|
13
|
+
:style="{ position: fixed ? 'fixed' : undefined }"
|
|
17
14
|
>
|
|
18
15
|
<component
|
|
19
|
-
:is="item.href ? 'a' : 'div'"
|
|
16
|
+
:is="item.to ? EUndecoratedLink : item.href ? 'a' : 'div'"
|
|
20
17
|
v-for="(item, i) in items"
|
|
21
18
|
:key="i"
|
|
22
19
|
class="fullwidth"
|
|
23
20
|
:href="item.href ? item.href : undefined"
|
|
21
|
+
:to="item.to ? item.to : undefined"
|
|
24
22
|
>
|
|
25
23
|
<e-btn
|
|
26
24
|
justify="start"
|
|
@@ -35,28 +33,28 @@
|
|
|
35
33
|
}"
|
|
36
34
|
@click="select(i)"
|
|
37
35
|
>
|
|
38
|
-
<e-icon
|
|
39
|
-
v-if="item.icon"
|
|
40
|
-
:size="20"
|
|
41
|
-
class="mr-2"
|
|
42
|
-
>
|
|
36
|
+
<e-icon v-if="item.icon" :size="20" class="mr-2">
|
|
43
37
|
{{ item.icon }}
|
|
44
38
|
</e-icon>
|
|
45
39
|
{{ item.name }}
|
|
46
40
|
</e-btn>
|
|
47
41
|
</component>
|
|
42
|
+
<div class="mx-4 my-2 fullwidth text-secondary" v-if="hint">
|
|
43
|
+
{{ hint }}
|
|
44
|
+
</div>
|
|
48
45
|
</div>
|
|
49
46
|
</e-tr-scale>
|
|
50
47
|
</div>
|
|
51
48
|
</template>
|
|
52
49
|
<script setup lang="ts">
|
|
53
|
-
import { computed, ref, reactive, watch
|
|
54
|
-
import
|
|
50
|
+
import { computed, ref, reactive, watch, resolveComponent } from "#imports";
|
|
51
|
+
import { debounce } from "lodash-es";
|
|
55
52
|
|
|
56
53
|
interface DropdownItem {
|
|
57
54
|
name: string;
|
|
58
55
|
icon?: string;
|
|
59
56
|
href?: string;
|
|
57
|
+
to?: string;
|
|
60
58
|
callback?: () => void;
|
|
61
59
|
color?: string;
|
|
62
60
|
background?: string;
|
|
@@ -65,27 +63,31 @@ interface DropdownItem {
|
|
|
65
63
|
const props = withDefaults(
|
|
66
64
|
defineProps<{
|
|
67
65
|
modelValue?: number;
|
|
68
|
-
width
|
|
66
|
+
width?: string | "100%";
|
|
69
67
|
center?: boolean;
|
|
70
68
|
items: DropdownItem[];
|
|
69
|
+
hint?: string;
|
|
71
70
|
visible?: boolean | null;
|
|
72
|
-
|
|
73
|
-
position?: { x: number, y: number }
|
|
74
|
-
fixed?:boolean;
|
|
71
|
+
fixed?: boolean;
|
|
75
72
|
}>(),
|
|
76
|
-
{
|
|
73
|
+
{
|
|
74
|
+
center: false,
|
|
75
|
+
visible: null,
|
|
76
|
+
paddingY: "",
|
|
77
|
+
modelValue: undefined,
|
|
78
|
+
position: undefined,
|
|
79
|
+
width: undefined,
|
|
80
|
+
},
|
|
77
81
|
);
|
|
78
82
|
|
|
79
83
|
const activator = ref<HTMLDivElement>();
|
|
80
84
|
const list = ref<HTMLDivElement>();
|
|
81
|
-
|
|
85
|
+
const EUndecoratedLink = resolveComponent("EUndecoratedLink");
|
|
82
86
|
const state = reactive({
|
|
83
87
|
visibleInternal: false,
|
|
84
88
|
x: 0,
|
|
85
89
|
y: 0,
|
|
86
|
-
width: 0,
|
|
87
90
|
});
|
|
88
|
-
|
|
89
91
|
// Visibility computed variable. We use the state unless we have a variable from the parent.
|
|
90
92
|
const visibleComputed = computed<boolean>({
|
|
91
93
|
get: () => {
|
|
@@ -103,49 +105,23 @@ const visibleComputed = computed<boolean>({
|
|
|
103
105
|
},
|
|
104
106
|
});
|
|
105
107
|
|
|
106
|
-
function computeWidth(input: string | number) {
|
|
107
|
-
const div = document.createElement("div");
|
|
108
|
-
document.body.appendChild(div);
|
|
109
|
-
div.style.width = String(input);
|
|
110
|
-
const c = getComputedStyle(div).width as any;
|
|
111
|
-
// const res = c.match(/[.\d]+/g).map(Number);
|
|
112
|
-
|
|
113
|
-
div.remove();
|
|
114
|
-
return parseInt(c, 10);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
108
|
const updatePosition = async () => {
|
|
118
|
-
|
|
119
|
-
if (!visibleComputed.value) {
|
|
120
|
-
window.removeEventListener("resize", debouncedUpdatePosition);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
109
|
if (activator.value) {
|
|
125
110
|
const activatorRect = activator.value.getBoundingClientRect();
|
|
126
111
|
|
|
127
|
-
|
|
128
|
-
state.width = activatorRect.width;
|
|
129
|
-
} else {
|
|
130
|
-
state.width = computeWidth(props.width);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
state.y = activatorRect.height;
|
|
112
|
+
state.y = Math.round(activatorRect.height);
|
|
134
113
|
state.x = 0;
|
|
135
114
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
state.x = props.position.x;
|
|
143
|
-
state.y = props.position.y;
|
|
144
|
-
return;
|
|
115
|
+
//Too far right :(
|
|
116
|
+
console.log(list.value);
|
|
117
|
+
if (list.value) {
|
|
118
|
+
if (window?.innerWidth > list.value?.getBoundingClientRect().right) {
|
|
119
|
+
state.x = -1 * activatorRect.width;
|
|
120
|
+
}
|
|
145
121
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
122
|
+
} //else{
|
|
123
|
+
//console.log(activator.value, list.value)
|
|
124
|
+
//}
|
|
149
125
|
/* await nextTick();
|
|
150
126
|
if (!list.value) return;
|
|
151
127
|
|
|
@@ -157,7 +133,20 @@ const updatePosition = async () => {
|
|
|
157
133
|
} */
|
|
158
134
|
};
|
|
159
135
|
|
|
160
|
-
|
|
136
|
+
watch(
|
|
137
|
+
() => list.value,
|
|
138
|
+
(newList) => {
|
|
139
|
+
const activatorRect = activator.value?.getBoundingClientRect();
|
|
140
|
+
|
|
141
|
+
if (newList && activatorRect) {
|
|
142
|
+
if (window?.innerWidth < newList.getBoundingClientRect().right) {
|
|
143
|
+
state.x = -1 * activatorRect.width * 2;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
const debouncedUpdatePosition = debounce(updatePosition, 200);
|
|
161
150
|
|
|
162
151
|
watch(visibleComputed, (value) => {
|
|
163
152
|
if (value) {
|
|
@@ -178,7 +167,7 @@ const currentItem = computed({
|
|
|
178
167
|
const select = (i: number) => {
|
|
179
168
|
visibleComputed.value = false;
|
|
180
169
|
currentItem.value = i;
|
|
181
|
-
if(props.items[i].callback){
|
|
170
|
+
if (props.items[i].callback) {
|
|
182
171
|
props.items[i].callback();
|
|
183
172
|
}
|
|
184
173
|
};
|
|
@@ -194,9 +183,9 @@ const onActivatorClick = () => {
|
|
|
194
183
|
|
|
195
184
|
.list {
|
|
196
185
|
position: absolute;
|
|
197
|
-
left: v-bind(
|
|
198
|
-
top: v-bind(
|
|
199
|
-
width: v-bind('
|
|
186
|
+
left: v-bind("(state.x) + `px`");
|
|
187
|
+
top: v-bind("(state.y) + `px`");
|
|
188
|
+
width: v-bind('props.width || "unset"');
|
|
200
189
|
display: flex;
|
|
201
190
|
|
|
202
191
|
z-index: 6;
|
|
@@ -205,7 +194,6 @@ const onActivatorClick = () => {
|
|
|
205
194
|
flex-direction: column;
|
|
206
195
|
overflow: clip;
|
|
207
196
|
justify-items: stretch;
|
|
208
|
-
margin-top: v-bind("props.paddingY");
|
|
209
197
|
|
|
210
198
|
.item {
|
|
211
199
|
// color: var(--e-color-text);
|
|
@@ -213,12 +201,13 @@ const onActivatorClick = () => {
|
|
|
213
201
|
padding: 0.7rem;
|
|
214
202
|
text-transform: capitalize;
|
|
215
203
|
position: relative;
|
|
216
|
-
|
|
204
|
+
white-space: nowrap;
|
|
217
205
|
&:hover {
|
|
218
206
|
background-color: rgba(var(--e-color-fg-rgb), 0.5);
|
|
219
207
|
}
|
|
220
208
|
|
|
221
|
-
&:focus {
|
|
209
|
+
&:focus {
|
|
210
|
+
}
|
|
222
211
|
|
|
223
212
|
&.active {
|
|
224
213
|
background-color: rgba(var(--e-color-primary-rgb), 0.2);
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Transition name="fade">
|
|
4
|
-
<div
|
|
5
|
-
v-if="modelValue"
|
|
6
|
-
class="focus-sheet"
|
|
7
|
-
:class="{ 'opaque-on-desktop': opaqueOnDesktop }"
|
|
8
|
-
@click="emit('update:modelValue', false)"
|
|
9
|
-
/>
|
|
4
|
+
<div v-if="modelValue" class="focus-sheet" :class="{ 'opaque-on-desktop': opaqueOnDesktop }" @click="dismiss" />
|
|
10
5
|
</Transition>
|
|
11
6
|
</div>
|
|
12
7
|
</template>
|
|
13
8
|
<script setup lang="ts">
|
|
14
|
-
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<{
|
|
15
11
|
modelValue: boolean;
|
|
16
12
|
opaqueOnDesktop?: boolean;
|
|
17
|
-
|
|
13
|
+
dismissable?: boolean;
|
|
14
|
+
}>(), { dismissable: true });
|
|
18
15
|
const emit = defineEmits(["update:modelValue"]);
|
|
16
|
+
|
|
17
|
+
const dismiss = () => {
|
|
18
|
+
if (props.dismissable) {
|
|
19
|
+
emit('update:modelValue', false);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
19
22
|
</script>
|
|
20
23
|
|
|
21
24
|
<style scoped lang="scss">
|
|
@@ -13,7 +13,7 @@ const props = withDefaults(
|
|
|
13
13
|
defineProps<{
|
|
14
14
|
iconStyle?: 'outlined' | 'rounded' | 'sharp', size?: number|`${number}`, fill?:boolean|"0"|"1"|`${boolean}`, grade?:number|`${number}`, weight?: number|`${number}`
|
|
15
15
|
}>(),
|
|
16
|
-
{ iconStyle: '
|
|
16
|
+
{ iconStyle: 'outlined', size: 24, fill:true, weight: 400, grade:0}
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
const sizePx = computed(() => props.size + "px")
|
|
@@ -30,13 +30,14 @@ const fillNum = computed(()=> {
|
|
|
30
30
|
font-weight: normal;
|
|
31
31
|
font-style: normal;
|
|
32
32
|
/* Preferred icon size */
|
|
33
|
-
display: inline
|
|
33
|
+
display: inline;
|
|
34
34
|
line-height: 1;
|
|
35
35
|
text-transform: none;
|
|
36
36
|
letter-spacing: normal;
|
|
37
37
|
word-wrap: normal;
|
|
38
38
|
white-space: nowrap;
|
|
39
39
|
direction: ltr;
|
|
40
|
+
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.material-symbol[icon-style="outlined"] {
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label class="d-flex flex-align-center mt-3">
|
|
3
|
+
<input
|
|
4
|
+
v-bind="{ name }"
|
|
5
|
+
v-model="selected"
|
|
6
|
+
type="checkbox"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</label>
|
|
10
|
+
</template>
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { computed } from '#imports';
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
15
|
+
const props = defineProps<{ modelValue: boolean, name?: string }>();
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const selected = computed({
|
|
19
|
+
get() {
|
|
20
|
+
return props.modelValue;
|
|
21
|
+
},
|
|
22
|
+
set(v) {
|
|
23
|
+
emit("update:modelValue", v);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
input[type="checkbox"] {
|
|
29
|
+
-webkit-appearance: none;
|
|
30
|
+
appearance: none;
|
|
31
|
+
background-color: var(--e-color-i-inactive);
|
|
32
|
+
|
|
33
|
+
margin: 0;
|
|
34
|
+
outline: var(--e-color-i-outline) solid 0.1rem;
|
|
35
|
+
|
|
36
|
+
font-family: 'Material Symbols Outlined';
|
|
37
|
+
color: transparent;
|
|
38
|
+
|
|
39
|
+
width: 1rem;
|
|
40
|
+
margin-right: 0.6rem;
|
|
41
|
+
height: 1rem;
|
|
42
|
+
border-radius: 0.15em;
|
|
43
|
+
|
|
44
|
+
display: flex;
|
|
45
|
+
|
|
46
|
+
transition: background-color 0.15s, transform 0.15s;
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
background-color: var(--e-color-elev-2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&::before {
|
|
54
|
+
content: "check";
|
|
55
|
+
background-color: var(--e-color-primary);
|
|
56
|
+
border-radius: 0.15em;
|
|
57
|
+
width: 100%;
|
|
58
|
+
text-align: center;
|
|
59
|
+
transform: scale(0);
|
|
60
|
+
transition: transform 0.15s ease-in-out, color 0.15s;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:checked::before {
|
|
64
|
+
transform: scale(1);
|
|
65
|
+
color: var(--e-color-i-inactive);
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
input[type="checkbox"]:active {
|
|
73
|
+
transform: scale(0.9);
|
|
74
|
+
|
|
75
|
+
&::before {
|
|
76
|
+
color: transparent;
|
|
77
|
+
transform: scale(0.65);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
input[type="checkbox"]:focus {
|
|
90
|
+
outline: var(--e-color-primary) solid 0.125rem;
|
|
91
|
+
background-color: var(--e-color-i-depressed-active);
|
|
92
|
+
&::before {
|
|
93
|
+
opacity: 0.7;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
input[type="checkbox"]:disabled {
|
|
98
|
+
--form-control-color: var(--form-control-disabled);
|
|
99
|
+
|
|
100
|
+
color: var(--form-control-disabled);
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -1,43 +1,93 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<e-dropdown
|
|
4
|
+
v-model="dropdownActive"
|
|
5
|
+
:items="items"
|
|
6
|
+
:visible="disabled ? false : dropdownVisible"
|
|
7
|
+
v-bind="{ width, hint }"
|
|
8
|
+
@update:visible="dropdownVisible = $event"
|
|
9
|
+
@update:model-value="updateSelection"
|
|
10
|
+
>
|
|
11
|
+
<e-input-text
|
|
12
|
+
v-model="searchFieldComputed"
|
|
13
|
+
v-bind="{ label, placeholder, icon }"
|
|
14
|
+
solid
|
|
15
|
+
@input="inputHandler"
|
|
16
|
+
:disabled="disabled"
|
|
17
|
+
:class="{ 'e-disabled': props.disabled }"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</e-input-text>
|
|
21
|
+
</e-dropdown>
|
|
22
|
+
</div>
|
|
17
23
|
</template>
|
|
18
24
|
<script setup lang="ts">
|
|
19
|
-
import { ref, watch } from "#imports";
|
|
20
|
-
const items = [{ name: "test" }, { name: "test2" }, { name: "test3" }];
|
|
25
|
+
import { ref, watch, computed } from "#imports";
|
|
21
26
|
const dropdownActive = ref<undefined | number>(undefined);
|
|
22
27
|
const dropdownVisible = ref<boolean>(false);
|
|
23
|
-
|
|
28
|
+
const props = defineProps<{
|
|
29
|
+
label?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
width?: string;
|
|
32
|
+
items: { name: string; id: string | number }[];
|
|
33
|
+
modelValue?: number | string;
|
|
34
|
+
value?: string;
|
|
35
|
+
hint?: string;
|
|
36
|
+
icon?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
}>();
|
|
24
39
|
const searchField = ref("");
|
|
40
|
+
const emit = defineEmits(["update:modelValue", "update:searchValue"]);
|
|
41
|
+
const modified = ref(false);
|
|
42
|
+
const updateSelection = ($event: number) => {
|
|
43
|
+
emit("update:modelValue", props.items[$event]?.id);
|
|
44
|
+
};
|
|
25
45
|
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
const inputHandler = () => {
|
|
47
|
+
emit("update:searchValue", searchField.value);
|
|
48
|
+
modified.value = true;
|
|
49
|
+
if (searchField.value.length > 0) {
|
|
28
50
|
//dropdownActive.value = 0;
|
|
29
51
|
dropdownVisible.value = true;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (props.hint) {
|
|
55
|
+
dropdownVisible.value = true;
|
|
30
56
|
} else {
|
|
31
|
-
dropdownActive.value = undefined;
|
|
32
57
|
dropdownVisible.value = false;
|
|
33
58
|
}
|
|
59
|
+
dropdownActive.value = undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
watch(
|
|
63
|
+
() => props.modelValue,
|
|
64
|
+
(modelValue) => {
|
|
65
|
+
if (modelValue) {
|
|
66
|
+
const foundItem = props.items.find(({ id }) => id == modelValue);
|
|
67
|
+
searchField.value = foundItem?.name || "";
|
|
68
|
+
} else {
|
|
69
|
+
searchField.value = "";
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const searchFieldComputed = computed({
|
|
75
|
+
get: () => {
|
|
76
|
+
if (modified.value) {
|
|
77
|
+
return searchField.value;
|
|
78
|
+
}
|
|
79
|
+
return searchField.value || props.value || "";
|
|
80
|
+
},
|
|
81
|
+
set: (newValue) => {
|
|
82
|
+
searchField.value = newValue;
|
|
83
|
+
},
|
|
34
84
|
});
|
|
35
85
|
|
|
36
86
|
watch(dropdownActive, (value) => {
|
|
37
87
|
if (value == undefined) {
|
|
38
88
|
searchField.value = "";
|
|
39
89
|
} else {
|
|
40
|
-
searchField.value = items[value].name;
|
|
90
|
+
searchField.value = props.items[value].name;
|
|
41
91
|
}
|
|
42
92
|
});
|
|
43
93
|
</script>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="label" class="pb-2">
|
|
4
|
+
<label :for="id" class="text-secondary">{{ label }}</label>
|
|
5
|
+
</div>
|
|
6
|
+
<input
|
|
7
|
+
:id="id"
|
|
8
|
+
v-model="currentText"
|
|
9
|
+
v-bind="{ required, disabled, type, name }"
|
|
10
|
+
class="py-3 px-4"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { ref, computed, useId, onMounted } from "#imports";
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
label?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
modelValue?: string;
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
type?: string;
|
|
26
|
+
}>(),
|
|
27
|
+
{
|
|
28
|
+
label: "",
|
|
29
|
+
modelValue: "",
|
|
30
|
+
name: undefined,
|
|
31
|
+
type: "datetime-local",
|
|
32
|
+
defaultValue: undefined,
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const id = useId();
|
|
37
|
+
|
|
38
|
+
const internalText = ref<string | null>(null);
|
|
39
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
40
|
+
|
|
41
|
+
const currentText = computed({
|
|
42
|
+
get: () => {
|
|
43
|
+
const setValue =
|
|
44
|
+
props.modelValue === undefined ? internalText.value : props.modelValue;
|
|
45
|
+
|
|
46
|
+
if (!setValue || !setValue.length) {
|
|
47
|
+
return props.defaultValue || "";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return setValue;
|
|
51
|
+
},
|
|
52
|
+
set: (value) => {
|
|
53
|
+
if (props.modelValue === undefined) {
|
|
54
|
+
internalText.value = value;
|
|
55
|
+
} else {
|
|
56
|
+
emit("update:modelValue", value);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
onMounted(() => {
|
|
62
|
+
if (props.defaultValue) {
|
|
63
|
+
currentText.value = props.defaultValue;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
<style lang="scss" scoped>
|
|
68
|
+
input[type="datetime-local"],
|
|
69
|
+
input[type="date"] {
|
|
70
|
+
border-radius: var(--e-rounded-border-radius);
|
|
71
|
+
border: none;
|
|
72
|
+
outline: var(--e-color-i-outline) solid 0.1rem;
|
|
73
|
+
background-color: var(--e-color-i-depressed);
|
|
74
|
+
font-family: var(--e-font-family);
|
|
75
|
+
|
|
76
|
+
transition:
|
|
77
|
+
outline ease-in-out 0.15s,
|
|
78
|
+
background-color ease-in-out 0.15s;
|
|
79
|
+
|
|
80
|
+
&:active {
|
|
81
|
+
background-color: var(--e-color-i-depressed-2) !important;
|
|
82
|
+
outline: var(--e-color-primary) solid 0.2rem !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:focus-within {
|
|
86
|
+
outline: var(--e-color-primary) solid 0.125rem;
|
|
87
|
+
//box-shadow: 0 0 0 0.125rem var(--e-color-primary);
|
|
88
|
+
background-color: var(--e-color-i-depressed-active);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
::-webkit-datetime-edit,
|
|
93
|
+
::-webkit-date-edit {
|
|
94
|
+
font-family: var(--e-font-family);
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
class="label mb-5"
|
|
6
6
|
>
|
|
7
7
|
{{ item[useKey] }}
|
|
8
|
+
<div
|
|
9
|
+
v-if="useSecondaryKey && item[useSecondaryKey]"
|
|
10
|
+
class="text-secondary"
|
|
11
|
+
>{{ item[useSecondaryKey] }}</div>
|
|
8
12
|
<input
|
|
9
13
|
v-model="selected"
|
|
10
14
|
type="radio"
|
|
@@ -17,9 +21,10 @@
|
|
|
17
21
|
<script lang="ts" setup>
|
|
18
22
|
import {computed} from '#imports';
|
|
19
23
|
const props = defineProps<{
|
|
20
|
-
items: { [
|
|
21
|
-
modelValue
|
|
24
|
+
items: { [key: string]: string }[];
|
|
25
|
+
modelValue?: number;
|
|
22
26
|
useKey: string;
|
|
27
|
+
useSecondaryKey?:string;
|
|
23
28
|
}>();
|
|
24
29
|
|
|
25
30
|
const emit = defineEmits(["update:modelValue"]);
|
|
@@ -67,7 +72,9 @@ const selected = computed({
|
|
|
67
72
|
left: 0;
|
|
68
73
|
height: var(--size);
|
|
69
74
|
width: var(--size);
|
|
70
|
-
background-color: var(--e-color-
|
|
75
|
+
background-color: var(--e-color-i-inactive);
|
|
76
|
+
outline: var(--e-color-i-outline) solid 0.1rem;
|
|
77
|
+
|
|
71
78
|
border-radius: 50%;
|
|
72
79
|
transition: background-color 0.15s, transform 0.25s;
|
|
73
80
|
}
|
|
@@ -84,7 +91,10 @@ const selected = computed({
|
|
|
84
91
|
|
|
85
92
|
&~.checkmark::after {
|
|
86
93
|
transform: scale(1) !important;
|
|
94
|
+
background-color: var(--e-color-primary);
|
|
87
95
|
}
|
|
96
|
+
|
|
97
|
+
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
/* Checked */
|
|
@@ -116,7 +126,7 @@ const selected = computed({
|
|
|
116
126
|
width: var(--size);
|
|
117
127
|
height: var(--size);
|
|
118
128
|
border-radius: 50%;
|
|
119
|
-
background: var(--e-color-
|
|
129
|
+
background: var(--e-color-i-active);
|
|
120
130
|
transform: scale(0);
|
|
121
131
|
transition: transform 0.25s;
|
|
122
132
|
box-sizing: border-box;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div
|
|
4
4
|
v-if="label"
|
|
5
|
-
class="
|
|
5
|
+
class="my-3"
|
|
6
6
|
>
|
|
7
7
|
<label :for="id">
|
|
8
8
|
{{ label }} </label>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div
|
|
12
|
-
class="wrapper
|
|
12
|
+
class="wrapper"
|
|
13
13
|
:style="inputState.overtakeStyle"
|
|
14
|
-
:class="{ rounded: rounded
|
|
14
|
+
:class="{ rounded: rounded === undefined ? solid : rounded, solid, compact }"
|
|
15
15
|
@click="focus"
|
|
16
16
|
>
|
|
17
17
|
<e-icon
|
|
@@ -92,7 +92,7 @@ const internalText = ref<string | null>(null)
|
|
|
92
92
|
|
|
93
93
|
const currentText = computed({
|
|
94
94
|
get: () => {
|
|
95
|
-
const setValue = props.modelValue
|
|
95
|
+
const setValue = props.modelValue === undefined ? internalText.value : props.modelValue
|
|
96
96
|
|
|
97
97
|
if (!setValue || !setValue.length) {
|
|
98
98
|
return props.defaultValue || ''
|
|
@@ -100,7 +100,7 @@ const currentText = computed({
|
|
|
100
100
|
|
|
101
101
|
return setValue
|
|
102
102
|
},
|
|
103
|
-
set: (value) => { if (props.modelValue
|
|
103
|
+
set: (value) => { if (props.modelValue === undefined) { internalText.value = value } else { emit("update:modelValue", value) } },
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
onMounted(() => {
|
|
@@ -126,7 +126,7 @@ const props = withDefaults(
|
|
|
126
126
|
focus?: boolean;
|
|
127
127
|
spellcheck?: boolean;
|
|
128
128
|
height?: string;
|
|
129
|
-
|
|
129
|
+
width?:string;
|
|
130
130
|
compact?: boolean;
|
|
131
131
|
}>(),
|
|
132
132
|
{
|
|
@@ -137,6 +137,7 @@ const props = withDefaults(
|
|
|
137
137
|
modelValue: "",
|
|
138
138
|
autocomplete: "off",
|
|
139
139
|
height: "unset",
|
|
140
|
+
width: "100%",
|
|
140
141
|
compact: false,
|
|
141
142
|
rounded: undefined,
|
|
142
143
|
placeholder: undefined,
|
|
@@ -161,7 +162,7 @@ const getInputStyle = (prop: string) => {
|
|
|
161
162
|
};
|
|
162
163
|
|
|
163
164
|
const transitionEnd = () => {
|
|
164
|
-
inputState.autofilled = !inputState.autofilled;
|
|
165
|
+
//inputState.autofilled = !inputState.autofilled;
|
|
165
166
|
|
|
166
167
|
if (inputState.autofilled) {
|
|
167
168
|
inputState.overtakeStyle = `color: ${getInputStyle(
|
|
@@ -173,17 +174,6 @@ const transitionEnd = () => {
|
|
|
173
174
|
};
|
|
174
175
|
</script>
|
|
175
176
|
<style scoped lang="scss">
|
|
176
|
-
.pos-wrap {
|
|
177
|
-
display: flex;
|
|
178
|
-
align-content: stretch;
|
|
179
|
-
align-items: stretch;
|
|
180
|
-
justify-content: stretch;
|
|
181
|
-
width: 100%;
|
|
182
|
-
box-sizing: border-box;
|
|
183
|
-
|
|
184
|
-
// padding: 0px var(--e-core-padding-x);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
177
|
.input {
|
|
188
178
|
border: none;
|
|
189
179
|
box-sizing: border-box;
|
|
@@ -196,6 +186,7 @@ const transitionEnd = () => {
|
|
|
196
186
|
color: var(--e-color-text);
|
|
197
187
|
font-family: var(--e-font-family);
|
|
198
188
|
height: v-bind(height);
|
|
189
|
+
|
|
199
190
|
transition: outline ease-in-out 0.15s, background-color ease-in-out 0.15s;
|
|
200
191
|
|
|
201
192
|
&:-webkit-autofill {
|
|
@@ -227,7 +218,7 @@ const transitionEnd = () => {
|
|
|
227
218
|
justify-content: stretch;
|
|
228
219
|
align-items: center;
|
|
229
220
|
justify-items: stretch;
|
|
230
|
-
|
|
221
|
+
width: v-bind(width);
|
|
231
222
|
position: relative;
|
|
232
223
|
|
|
233
224
|
background-color: transparent;
|
|
@@ -242,8 +233,6 @@ const transitionEnd = () => {
|
|
|
242
233
|
|
|
243
234
|
.wrapper.solid:has(:focus) {
|
|
244
235
|
outline: var(--e-color-primary) solid 0.125rem;
|
|
245
|
-
//box-shadow: 0 0 0 0.125rem var(--e-color-primary);
|
|
246
|
-
|
|
247
236
|
background-color: var(--e-color-i-depressed-active);
|
|
248
237
|
|
|
249
238
|
}
|
|
@@ -263,10 +252,6 @@ const transitionEnd = () => {
|
|
|
263
252
|
|
|
264
253
|
|
|
265
254
|
|
|
266
|
-
.fullwidth {
|
|
267
|
-
width: 100%;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
255
|
.wrapper:active {
|
|
271
256
|
background-color: var(--e-color-i-depressed-2) !important;
|
|
272
257
|
outline: var(--e-color-primary) solid 0.2rem !important;
|
|
@@ -1,32 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<e-undecorated-link
|
|
3
|
-
:to="to"
|
|
4
|
-
class="grow-on-mobile"
|
|
5
|
-
>
|
|
2
|
+
<e-undecorated-link :to="to" :class="{ 'grow-on-mobile': responsive }">
|
|
6
3
|
<e-btn
|
|
7
4
|
:solid="true"
|
|
8
5
|
background="transparent"
|
|
9
|
-
class="nav-btn
|
|
6
|
+
class="nav-btn"
|
|
7
|
+
:class="{ 'grow-on-mobile': responsive }"
|
|
10
8
|
align="center"
|
|
11
9
|
:active="active"
|
|
10
|
+
:button="false"
|
|
12
11
|
>
|
|
13
|
-
<div class="content">
|
|
14
|
-
<div
|
|
15
|
-
|
|
16
|
-
class="icon-wrapper flex-center mr-2"
|
|
17
|
-
>
|
|
18
|
-
<e-icon
|
|
19
|
-
class="icon"
|
|
20
|
-
size="20"
|
|
21
|
-
:fill="active"
|
|
22
|
-
>
|
|
12
|
+
<div class="content" :class="{ responsive }">
|
|
13
|
+
<div v-if="icon" class="icon-wrapper flex-center mr-2">
|
|
14
|
+
<e-icon class="icon" size="20" :fill="active">
|
|
23
15
|
{{ icon }}
|
|
24
16
|
</e-icon>
|
|
25
17
|
<transition name="fade">
|
|
26
|
-
<div
|
|
27
|
-
v-if="alert"
|
|
28
|
-
class="icon-alert"
|
|
29
|
-
/>
|
|
18
|
+
<div v-if="alert" class="icon-alert" />
|
|
30
19
|
</transition>
|
|
31
20
|
</div>
|
|
32
21
|
<p v-if="label">
|
|
@@ -47,18 +36,16 @@ const props = withDefaults(
|
|
|
47
36
|
label?: string;
|
|
48
37
|
icon?: string;
|
|
49
38
|
alert?: boolean;
|
|
39
|
+
responsive?: boolean;
|
|
50
40
|
}>(),
|
|
51
|
-
{ to: "", label: "", icon: "" }
|
|
41
|
+
{ to: "", label: "", icon: "", responsive: true },
|
|
52
42
|
);
|
|
53
43
|
|
|
54
44
|
const route = useRoute();
|
|
55
45
|
|
|
56
|
-
|
|
57
|
-
|
|
58
46
|
const active = computed(() => {
|
|
59
|
-
return route && route.path
|
|
47
|
+
return route && route.path && route.path.startsWith(props.to);
|
|
60
48
|
});
|
|
61
|
-
|
|
62
49
|
</script>
|
|
63
50
|
|
|
64
51
|
<style scoped lang="scss">
|
|
@@ -67,7 +54,9 @@ const active = computed(() => {
|
|
|
67
54
|
background-color: rgba(var(--e-color-primary-rgb), 0.075);
|
|
68
55
|
}*/
|
|
69
56
|
|
|
70
|
-
|
|
57
|
+
a {
|
|
58
|
+
border-radius: var(--e-rounded-border-radius);
|
|
59
|
+
}
|
|
71
60
|
|
|
72
61
|
.content {
|
|
73
62
|
display: flex;
|
|
@@ -81,12 +70,9 @@ const active = computed(() => {
|
|
|
81
70
|
margin: 0;
|
|
82
71
|
padding: 0;
|
|
83
72
|
white-space: nowrap;
|
|
84
|
-
|
|
85
73
|
}
|
|
86
|
-
|
|
87
74
|
}
|
|
88
75
|
|
|
89
|
-
|
|
90
76
|
.icon-wrapper {
|
|
91
77
|
position: relative;
|
|
92
78
|
box-sizing: border-box;
|
|
@@ -107,27 +93,24 @@ const active = computed(() => {
|
|
|
107
93
|
}
|
|
108
94
|
}
|
|
109
95
|
|
|
110
|
-
|
|
111
96
|
@media screen and (max-width: exakt.$e-md-screen-breakpoint) {
|
|
112
|
-
|
|
113
97
|
.grow-on-mobile {
|
|
114
98
|
flex-grow: 1;
|
|
115
99
|
width: 100%;
|
|
116
100
|
}
|
|
117
101
|
|
|
118
|
-
|
|
119
|
-
margin: 0px;
|
|
120
|
-
white-space: nowrap;
|
|
121
|
-
font-size: small;
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.content {
|
|
102
|
+
.content.responsive {
|
|
126
103
|
flex-direction: column;
|
|
127
104
|
|
|
128
105
|
.icon-wrapper {
|
|
129
106
|
margin-right: 0rem;
|
|
130
107
|
}
|
|
108
|
+
|
|
109
|
+
p {
|
|
110
|
+
margin: 0px;
|
|
111
|
+
white-space: nowrap;
|
|
112
|
+
font-size: small;
|
|
113
|
+
}
|
|
131
114
|
}
|
|
132
115
|
}
|
|
133
116
|
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exakt/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"description": "A UI library for Nuxt.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@nuxt/eslint-config": "^0.1.1",
|
|
37
|
-
"@nuxt/kit": "
|
|
37
|
+
"@nuxt/kit": "^3.16.2",
|
|
38
38
|
"@nuxt/module-builder": "^0.2.1",
|
|
39
|
-
"@nuxt/schema": "
|
|
39
|
+
"@nuxt/schema": "^3.16.2",
|
|
40
40
|
"@nuxt/test-utils": "^3.2.3",
|
|
41
41
|
"@types/lodash": "^4.14.191",
|
|
42
42
|
"@types/lodash-es": "^4.17.9",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint": "^8.35.0",
|
|
46
46
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
47
47
|
"mkdist": "^1.2.0",
|
|
48
|
-
"nuxt": "
|
|
48
|
+
"nuxt": "^3.16.2",
|
|
49
49
|
"vitest": "^0.29.2"
|
|
50
50
|
},
|
|
51
51
|
"directories": {
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"url": "https://github.com/wd-4000/exakt/issues"
|
|
68
68
|
},
|
|
69
69
|
"homepage": "https://github.com/wd-4000/exakt#readme",
|
|
70
|
-
"packageManager": "yarn@
|
|
70
|
+
"packageManager": "yarn@4.6.0"
|
|
71
71
|
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div
|
|
4
|
-
v-if="label"
|
|
5
|
-
class="pb-2"
|
|
6
|
-
>
|
|
7
|
-
<label
|
|
8
|
-
:for="id"
|
|
9
|
-
class="text-secondary"
|
|
10
|
-
>{{ label }}</label>
|
|
11
|
-
</div>
|
|
12
|
-
<input
|
|
13
|
-
:id="id"
|
|
14
|
-
v-model="currentText"
|
|
15
|
-
type="datetime-local"
|
|
16
|
-
class="py-3 px-4"
|
|
17
|
-
:name="name"
|
|
18
|
-
:required="required"
|
|
19
|
-
:disabled="disabled"
|
|
20
|
-
>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
<script setup lang="ts">
|
|
24
|
-
import { ref, computed, useId, onMounted } from "#imports";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const props = withDefaults(
|
|
28
|
-
defineProps<{
|
|
29
|
-
label?: string;
|
|
30
|
-
name?: string;
|
|
31
|
-
modelValue?: string;
|
|
32
|
-
defaultValue?: string;
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
required?: boolean;
|
|
35
|
-
}>(),
|
|
36
|
-
{
|
|
37
|
-
label: "",
|
|
38
|
-
modelValue: "",
|
|
39
|
-
name: undefined,
|
|
40
|
-
defaultValue: undefined
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const id = useId();
|
|
45
|
-
|
|
46
|
-
const internalText = ref<string | null>(null)
|
|
47
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const currentText = computed({
|
|
51
|
-
get: () => {
|
|
52
|
-
const setValue = props.modelValue == undefined ? internalText.value : props.modelValue
|
|
53
|
-
|
|
54
|
-
if (!setValue || !setValue.length) {
|
|
55
|
-
return props.defaultValue || ''
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return setValue
|
|
59
|
-
},
|
|
60
|
-
set: (value) => { if (props.modelValue == undefined) { internalText.value = value } else { emit("update:modelValue", value) } },
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
onMounted(() => {
|
|
64
|
-
if (props.defaultValue) {
|
|
65
|
-
currentText.value = props.defaultValue
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</script>
|
|
71
|
-
<style lang="scss" scoped>
|
|
72
|
-
|
|
73
|
-
input[type=datetime-local] {
|
|
74
|
-
border-radius: var(--e-rounded-border-radius);
|
|
75
|
-
border: none;
|
|
76
|
-
outline: var(--e-color-i-outline) solid 0.1rem;
|
|
77
|
-
background-color: var(--e-color-i-depressed);
|
|
78
|
-
|
|
79
|
-
transition: outline ease-in-out 0.15s, background-color ease-in-out 0.15s;
|
|
80
|
-
|
|
81
|
-
&:active {
|
|
82
|
-
background-color: var(--e-color-i-depressed-2) !important;
|
|
83
|
-
outline: var(--e-color-primary) solid 0.2rem !important;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:focus-within {
|
|
87
|
-
outline: var(--e-color-primary) solid 0.125rem;
|
|
88
|
-
//box-shadow: 0 0 0 0.125rem var(--e-color-primary);
|
|
89
|
-
background-color: var(--e-color-i-depressed-active);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
::-webkit-datetime-edit {
|
|
96
|
-
font-family: var(--e-font-family);
|
|
97
|
-
}
|
|
98
|
-
</style>
|