@katlux/toolkit 0.1.0-beta.22 → 0.1.0-beta.26
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/KIcon/KIcon.logic.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.js +2 -2
- package/dist/runtime/presets/default/assets/scss/index.css +8 -0
- package/dist/runtime/presets/default/assets/scss/index.scss +9 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue +17 -8
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -25,5 +25,5 @@ export declare const KIconDefaultProps: {
|
|
|
25
25
|
export declare function useKIconLogic(props: KIconProps): {
|
|
26
26
|
widthPx: import("vue").ComputedRef<string | undefined>;
|
|
27
27
|
heightPx: import("vue").ComputedRef<string>;
|
|
28
|
-
iconComponent: import("vue").ComputedRef<
|
|
28
|
+
iconComponent: import("vue").ComputedRef<string | null>;
|
|
29
29
|
};
|
|
@@ -18,12 +18,12 @@ export const KIconDefaultProps = {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
export function useKIconLogic(props) {
|
|
21
|
-
const modules = import.meta.glob("../../presets/default/assets/svg/*.svg", { eager: true });
|
|
21
|
+
const modules = import.meta.glob("../../presets/default/assets/svg/*.svg", { eager: true, as: "raw" });
|
|
22
22
|
const iconMap = {};
|
|
23
23
|
for (const path in modules) {
|
|
24
24
|
const match = path.match(/([^/]+)\.svg$/);
|
|
25
25
|
if (match) {
|
|
26
|
-
iconMap[match[1]] = modules[path]
|
|
26
|
+
iconMap[match[1]] = modules[path];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
const widthPx = computed(
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
@use "reset";
|
|
2
2
|
@use "css-variables";
|
|
3
3
|
@use "docs";
|
|
4
|
-
@forward "mixins";
|
|
4
|
+
@forward "mixins";
|
|
5
|
+
|
|
6
|
+
body {
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
background-color: var(--layout-content-bg);
|
|
10
|
+
font-family: var(--font-family);
|
|
11
|
+
color: var(--font-color-primary);
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
widthPx?: string;
|
|
3
3
|
heightPx?: string;
|
|
4
|
-
iconComponent:
|
|
4
|
+
iconComponent: string;
|
|
5
5
|
rotate: number | string;
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
span.KIcon(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
)
|
|
2
|
+
span.KIcon(
|
|
3
|
+
v-if="iconComponent"
|
|
4
|
+
:style="iconStyle"
|
|
5
|
+
v-html="iconComponent"
|
|
6
|
+
)
|
|
8
7
|
</template>
|
|
9
8
|
|
|
10
9
|
<script lang="ts" setup>
|
|
10
|
+
import { computed } from 'vue'
|
|
11
|
+
|
|
11
12
|
const props = defineProps<{
|
|
12
13
|
widthPx?: string
|
|
13
14
|
heightPx?: string
|
|
14
|
-
iconComponent:
|
|
15
|
+
iconComponent: string
|
|
15
16
|
rotate: number | string
|
|
16
17
|
}>()
|
|
18
|
+
|
|
19
|
+
const iconStyle = computed(() => ({
|
|
20
|
+
width: props.widthPx,
|
|
21
|
+
height: props.heightPx,
|
|
22
|
+
transform: props.rotate ? `rotate(${props.rotate}deg)` : undefined
|
|
23
|
+
}))
|
|
17
24
|
</script>
|
|
18
25
|
|
|
19
26
|
<style lang="scss" scoped>
|
|
@@ -23,7 +30,9 @@ const props = defineProps<{
|
|
|
23
30
|
justify-content: center;
|
|
24
31
|
line-height: 0;
|
|
25
32
|
vertical-align: middle;
|
|
26
|
-
|
|
33
|
+
|
|
34
|
+
:deep(svg) {
|
|
35
|
+
width: 100%;
|
|
27
36
|
height: 100%;
|
|
28
37
|
}
|
|
29
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
widthPx?: string;
|
|
3
3
|
heightPx?: string;
|
|
4
|
-
iconComponent:
|
|
4
|
+
iconComponent: string;
|
|
5
5
|
rotate: number | string;
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|