@exakt/ui 0.0.56 → 0.0.59
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.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -8
- package/dist/runtime/components/e/alert.vue +11 -4
- package/dist/runtime/components/e/app-bars.vue +1 -1
- package/dist/runtime/components/e/avatar.vue +1 -1
- package/dist/runtime/components/e/btn.vue +32 -13
- package/dist/runtime/components/e/chip.vue +2 -1
- package/dist/runtime/components/e/container.vue +10 -9
- package/dist/runtime/components/e/dialog.vue +15 -15
- package/dist/runtime/components/e/dropdown.vue +40 -67
- package/dist/runtime/components/e/focus-sheet.vue +12 -9
- package/dist/runtime/components/e/icon.vue +3 -2
- package/dist/runtime/components/e/iconButton.vue +3 -3
- 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 +27 -25
- package/dist/runtime/components/e/nav/bar.vue +29 -23
- package/dist/runtime/components/e/nav/btn.vue +59 -83
- package/dist/runtime/components/e/nav/sidebar.vue +2 -4
- package/dist/runtime/components/e/nav/titlebar.vue +15 -5
- package/dist/runtime/css/main.scss +43 -15
- package/dist/runtime/css/util.scss +34 -0
- package/dist/runtime/plugin.d.ts +0 -1
- package/dist/runtime/plugin.mjs +2 -2
- package/package.json +5 -5
package/dist/module.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ interface ModuleOptions {
|
|
|
28
28
|
weight?: number;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
31
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
32
32
|
|
|
33
33
|
export { ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addPlugin, extendViteConfig,
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, extendViteConfig, addComponentsDir } from '@nuxt/kit';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
|
|
4
4
|
const defaults = {
|
|
@@ -31,7 +31,7 @@ const defaults = {
|
|
|
31
31
|
},
|
|
32
32
|
borderRadius: "8px",
|
|
33
33
|
corePaddingX: "1rem",
|
|
34
|
-
font: { family: "
|
|
34
|
+
font: { family: "Open Sans, sans-serif", weight: 400 }
|
|
35
35
|
};
|
|
36
36
|
const module = defineNuxtModule({
|
|
37
37
|
meta: {
|
|
@@ -79,20 +79,18 @@ const module = defineNuxtModule({
|
|
|
79
79
|
css: {
|
|
80
80
|
preprocessorOptions: {
|
|
81
81
|
scss: {
|
|
82
|
-
|
|
82
|
+
api: "modern-compiler",
|
|
83
|
+
additionalData: `@use "sass:color"; @use "sass:map"; @use "${resolver.resolve(
|
|
83
84
|
"../node_modules/.cache/exakt-ui/variables.scss"
|
|
84
|
-
)}"; `
|
|
85
|
+
)}" as exakt; `
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
});
|
|
90
|
-
addImportsSources({
|
|
91
|
-
from: "material-symbols",
|
|
92
|
-
imports: ["material-symbols"]
|
|
93
|
-
});
|
|
94
91
|
nuxt.options.css.push(resolver.resolve("./runtime/css/main.scss"));
|
|
95
92
|
nuxt.options.css.push(resolver.resolve("./runtime/css/util.scss"));
|
|
93
|
+
nuxt.options.css.push("material-symbols");
|
|
96
94
|
nuxt.options.css.push(
|
|
97
95
|
resolver.resolve("../node_modules/.cache/exakt-ui/variables.css")
|
|
98
96
|
);
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="flex-center"
|
|
4
|
+
:class="{ [severityMatrix[severity].class]: true }"
|
|
5
|
+
>
|
|
3
6
|
<e-icon
|
|
4
|
-
|
|
5
7
|
size="19"
|
|
6
8
|
class="mr-2"
|
|
7
9
|
>
|
|
8
|
-
|
|
9
|
-
</e-icon><small
|
|
10
|
+
{{ severityMatrix[severity].icon }}
|
|
11
|
+
</e-icon><small>
|
|
12
|
+
<slot />
|
|
13
|
+
</small>
|
|
10
14
|
</div>
|
|
11
15
|
</template>
|
|
12
16
|
<script setup lang="ts">
|
|
17
|
+
withDefaults(defineProps<{ severity?: 0 | 1 | 2 }>(), { severity: 2 })
|
|
18
|
+
|
|
19
|
+
const severityMatrix = { 0: { icon: "info", class: "" }, 1: { icon: "warning", class: "color-yellow" }, 2: { icon: "warning", class: "color-red" } }
|
|
13
20
|
</script>
|
|
@@ -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"
|
|
@@ -11,9 +12,9 @@
|
|
|
11
12
|
block,
|
|
12
13
|
rounded: solid,
|
|
13
14
|
'e-disabled': disabled,
|
|
14
|
-
'my-2': solid,
|
|
15
15
|
loading,
|
|
16
16
|
fab,
|
|
17
|
+
compact,
|
|
17
18
|
...backgroundClass
|
|
18
19
|
}"
|
|
19
20
|
>
|
|
@@ -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";
|
|
@@ -50,6 +51,7 @@ const props = withDefaults(
|
|
|
50
51
|
active?: boolean;
|
|
51
52
|
inactive?: boolean;
|
|
52
53
|
solid?: boolean;
|
|
54
|
+
compact?: boolean;
|
|
53
55
|
color?: string;
|
|
54
56
|
background?: string;
|
|
55
57
|
block?: boolean;
|
|
@@ -58,6 +60,7 @@ const props = withDefaults(
|
|
|
58
60
|
disabled?: boolean;
|
|
59
61
|
align?: string;
|
|
60
62
|
type?: "button" | "submit" | "reset";
|
|
63
|
+
button?: boolean;
|
|
61
64
|
}>(),
|
|
62
65
|
{
|
|
63
66
|
type: "button",
|
|
@@ -65,8 +68,10 @@ const props = withDefaults(
|
|
|
65
68
|
solid: true,
|
|
66
69
|
width: undefined,
|
|
67
70
|
justify: "center",
|
|
71
|
+
compact: false,
|
|
68
72
|
align: "center",
|
|
69
73
|
color: undefined,
|
|
74
|
+
button: true
|
|
70
75
|
}
|
|
71
76
|
);
|
|
72
77
|
|
|
@@ -88,13 +93,13 @@ const backgroundColorRgb = computed(() => {
|
|
|
88
93
|
return parseColor($exakt.parseColor(props.background));
|
|
89
94
|
});
|
|
90
95
|
|
|
91
|
-
const isRootColor = computed(() => $exakt.rootColors.includes(props.background))
|
|
96
|
+
const isRootColor = computed(() => $exakt && $exakt.rootColors && $exakt.rootColors.includes(props.background))
|
|
92
97
|
const backgroundClass = computed(() => {
|
|
93
98
|
const c: { [key: string]: boolean } = {}
|
|
94
99
|
|
|
95
|
-
if(props.background == 'transparent'){
|
|
100
|
+
if (props.background == 'transparent') {
|
|
96
101
|
c['transparent'] = true;
|
|
97
|
-
}else if (isRootColor.value) {
|
|
102
|
+
} else if (isRootColor.value) {
|
|
98
103
|
c["bg-" + props.background] = true
|
|
99
104
|
} else {
|
|
100
105
|
c['custom-color'] = true
|
|
@@ -161,7 +166,7 @@ const textColor = computed(() => {
|
|
|
161
166
|
flex-shrink: 1;
|
|
162
167
|
position: relative;
|
|
163
168
|
transition: background 0.4s, color 0.3s, opacity 0.4s;
|
|
164
|
-
|
|
169
|
+
white-space: nowrap;
|
|
165
170
|
font-family: var(--e-font-family);
|
|
166
171
|
box-sizing: border-box;
|
|
167
172
|
|
|
@@ -170,9 +175,10 @@ const textColor = computed(() => {
|
|
|
170
175
|
&.transparent {
|
|
171
176
|
color: var(--e-color-text);
|
|
172
177
|
background: rgba(0, 0, 0, 0);
|
|
178
|
+
|
|
173
179
|
&:hover {
|
|
174
|
-
|
|
175
|
-
|
|
180
|
+
background: rgba(98, 98, 98, 0.15);
|
|
181
|
+
opacity: 1;
|
|
176
182
|
}
|
|
177
183
|
}
|
|
178
184
|
|
|
@@ -190,8 +196,8 @@ const textColor = computed(() => {
|
|
|
190
196
|
}
|
|
191
197
|
|
|
192
198
|
&:hover {
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
// background: rgba(98, 98, 98, 0.15);
|
|
200
|
+
opacity: 0.7;
|
|
195
201
|
border: transparent solid 0.1rem;
|
|
196
202
|
}
|
|
197
203
|
|
|
@@ -220,17 +226,30 @@ const textColor = computed(() => {
|
|
|
220
226
|
background-color: v-bind(backgroundColor);
|
|
221
227
|
color: v-bind(textColor);
|
|
222
228
|
|
|
223
|
-
|
|
229
|
+
/* &:hover {
|
|
224
230
|
opacity: 0.9;
|
|
225
231
|
} */
|
|
226
232
|
}
|
|
227
233
|
|
|
228
234
|
&.solid {
|
|
229
235
|
padding: 0.7rem 0.9rem;
|
|
236
|
+
|
|
237
|
+
&.compact {
|
|
238
|
+
padding: 0.6rem 0.8rem;
|
|
239
|
+
}
|
|
230
240
|
}
|
|
231
241
|
|
|
232
242
|
&.active {
|
|
233
243
|
color: var(--e-color-primary);
|
|
244
|
+
|
|
245
|
+
&.transparent {
|
|
246
|
+
background: rgba(var(--e-color-primary-rgb), 0.1);
|
|
247
|
+
|
|
248
|
+
&:hover {
|
|
249
|
+
background: rgba(var(--e-color-primary-rgb), 0.075);
|
|
250
|
+
opacity: 1;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
234
253
|
}
|
|
235
254
|
|
|
236
255
|
&.inactive {
|
|
@@ -239,7 +258,7 @@ const textColor = computed(() => {
|
|
|
239
258
|
}
|
|
240
259
|
}
|
|
241
260
|
|
|
242
|
-
@media screen and (max-width:
|
|
261
|
+
@media screen and (max-width: exakt.$e-md-screen-breakpoint) {
|
|
243
262
|
.e-btn.fab {
|
|
244
263
|
right: 1rem;
|
|
245
264
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="e-chip py-3 px-4 ma-1
|
|
3
|
+
class="e-chip py-3 px-4 ma-1 flex-center"
|
|
4
4
|
:class="{ active, 'bg-i-active':active, 'bg-i-inactive':!active }"
|
|
5
5
|
@click="active = !active"
|
|
6
6
|
>
|
|
@@ -46,6 +46,7 @@ const active = computed({
|
|
|
46
46
|
user-select: none;
|
|
47
47
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
48
48
|
cursor: pointer;
|
|
49
|
+
display: inline-flex;
|
|
49
50
|
|
|
50
51
|
&>.check {
|
|
51
52
|
display: none;
|
|
@@ -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>
|
|
@@ -30,7 +31,7 @@ withDefaults(
|
|
|
30
31
|
|
|
31
32
|
width: 95%;
|
|
32
33
|
|
|
33
|
-
@media (max-width:
|
|
34
|
+
@media (max-width: exakt.$e-md-screen-breakpoint) {
|
|
34
35
|
&.forceFullWidth {
|
|
35
36
|
width: 100%;
|
|
36
37
|
}
|
|
@@ -38,16 +39,16 @@ withDefaults(
|
|
|
38
39
|
|
|
39
40
|
$padding: 0rem;
|
|
40
41
|
|
|
41
|
-
@media (min-width:
|
|
42
|
-
width: calc(
|
|
42
|
+
@media (min-width: exakt.$e-md-screen-breakpoint) {
|
|
43
|
+
width: calc(v-bind('`${sizes[0]}vw`') - $padding);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
@media (min-width:
|
|
46
|
-
width: calc(
|
|
46
|
+
@media (min-width: exakt.$e-lg-screen-breakpoint) {
|
|
47
|
+
width: calc(v-bind('`${sizes[1]}vw`') - $padding);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
@media (min-width:
|
|
50
|
-
width: calc(
|
|
50
|
+
@media (min-width: exakt.$e-xl-screen-breakpoint) {
|
|
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">
|
|
@@ -51,7 +51,7 @@ const emit = defineEmits(["update:modelValue"]);
|
|
|
51
51
|
overflow: clip;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
@media (max-width:
|
|
54
|
+
@media (max-width: exakt.$e-md-screen-breakpoint) {
|
|
55
55
|
.dialog {
|
|
56
56
|
width: 100%;
|
|
57
57
|
max-width: 100vw;
|
|
@@ -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,20 @@ 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
|
-
|
|
143
|
-
state.y = props.position.y;
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
state.x = 0;
|
|
147
|
-
state.y = 0;
|
|
148
|
-
|
|
115
|
+
// Too far right :(
|
|
116
|
+
//if (window.innerWidth > listRect.right) {
|
|
117
|
+
//state.x = -1 * activatorRect.width
|
|
118
|
+
// }
|
|
119
|
+
} //else{
|
|
120
|
+
//console.log(activator.value, list.value)
|
|
121
|
+
//}
|
|
149
122
|
/* await nextTick();
|
|
150
123
|
if (!list.value) return;
|
|
151
124
|
|
|
@@ -157,7 +130,7 @@ const updatePosition = async () => {
|
|
|
157
130
|
} */
|
|
158
131
|
};
|
|
159
132
|
|
|
160
|
-
const debouncedUpdatePosition =
|
|
133
|
+
const debouncedUpdatePosition = debounce(updatePosition, 200);
|
|
161
134
|
|
|
162
135
|
watch(visibleComputed, (value) => {
|
|
163
136
|
if (value) {
|
|
@@ -178,7 +151,7 @@ const currentItem = computed({
|
|
|
178
151
|
const select = (i: number) => {
|
|
179
152
|
visibleComputed.value = false;
|
|
180
153
|
currentItem.value = i;
|
|
181
|
-
if(props.items[i].callback){
|
|
154
|
+
if (props.items[i].callback) {
|
|
182
155
|
props.items[i].callback();
|
|
183
156
|
}
|
|
184
157
|
};
|
|
@@ -194,9 +167,9 @@ const onActivatorClick = () => {
|
|
|
194
167
|
|
|
195
168
|
.list {
|
|
196
169
|
position: absolute;
|
|
197
|
-
left: v-bind(
|
|
198
|
-
top: v-bind(
|
|
199
|
-
width: v-bind('
|
|
170
|
+
left: v-bind("(state.x) + `px`");
|
|
171
|
+
top: v-bind("(state.y) + `px`");
|
|
172
|
+
width: v-bind('props.width || "unset"');
|
|
200
173
|
display: flex;
|
|
201
174
|
|
|
202
175
|
z-index: 6;
|
|
@@ -205,7 +178,6 @@ const onActivatorClick = () => {
|
|
|
205
178
|
flex-direction: column;
|
|
206
179
|
overflow: clip;
|
|
207
180
|
justify-items: stretch;
|
|
208
|
-
margin-top: v-bind("props.paddingY");
|
|
209
181
|
|
|
210
182
|
.item {
|
|
211
183
|
// color: var(--e-color-text);
|
|
@@ -213,12 +185,13 @@ const onActivatorClick = () => {
|
|
|
213
185
|
padding: 0.7rem;
|
|
214
186
|
text-transform: capitalize;
|
|
215
187
|
position: relative;
|
|
216
|
-
|
|
188
|
+
white-space: nowrap;
|
|
217
189
|
&:hover {
|
|
218
190
|
background-color: rgba(var(--e-color-fg-rgb), 0.5);
|
|
219
191
|
}
|
|
220
192
|
|
|
221
|
-
&:focus {
|
|
193
|
+
&:focus {
|
|
194
|
+
}
|
|
222
195
|
|
|
223
196
|
&.active {
|
|
224
197
|
background-color: rgba(var(--e-color-primary-rgb), 0.2);
|
|
@@ -230,7 +203,7 @@ const onActivatorClick = () => {
|
|
|
230
203
|
}
|
|
231
204
|
}
|
|
232
205
|
|
|
233
|
-
@media screen and (max-width:
|
|
206
|
+
@media screen and (max-width: exakt.$e-md-screen-breakpoint) {
|
|
234
207
|
.list {
|
|
235
208
|
position: fixed;
|
|
236
209
|
top: unset;
|
|
@@ -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">
|
|
@@ -33,7 +36,7 @@ const emit = defineEmits(["update:modelValue"]);
|
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
@media screen and (max-width:
|
|
39
|
+
@media screen and (max-width: exakt.$e-md-screen-breakpoint) {
|
|
37
40
|
.focus-sheet {
|
|
38
41
|
background-color: rgba(var(--e-color-bg-rgb), 0.7);
|
|
39
42
|
}
|
|
@@ -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"] {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
>
|
|
9
9
|
<e-icon
|
|
10
10
|
v-if="icon"
|
|
11
|
-
|
|
11
|
+
:fill="fill"
|
|
12
12
|
:size="size"
|
|
13
13
|
>
|
|
14
14
|
{{ icon }}
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
<script setup lang="ts">
|
|
20
20
|
withDefaults(
|
|
21
|
-
defineProps<{ icon?: string; size?:
|
|
22
|
-
{ size: "21" }
|
|
21
|
+
defineProps<{ icon?: string; size?: number|`${number}`; loading?: boolean, type?: "button" | "submit" | "reset", fill?: boolean }>(),
|
|
22
|
+
{ size: "21", icon: undefined, type:undefined }
|
|
23
23
|
);
|
|
24
24
|
</script>
|
|
25
25
|
<style scoped>
|