@mlightcad/ui-components 0.0.7 → 0.0.8
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/README.md +52 -0
- package/dist/ui-components.es.js +408 -71
- package/dist/ui-components.umd.js +2 -2
- package/lib/MlToolPalette.vue.d.ts +2 -0
- package/lib/MlToolPalette.vue.js +149 -0
- package/lib/index.d.ts +8 -5
- package/lib/index.js +8 -4
- package/package.json +1 -1
- package/src/components/MlCollapse.vue +55 -0
- package/src/{MlDropdown.vue → components/MlDropdown.vue} +18 -7
- package/src/components/MlLanguage.vue +41 -0
- package/src/components/MlToolPalette.vue +199 -0
- package/src/{MlToolbar.vue → components/MlToolbar.vue} +12 -8
- package/src/composable/types.ts +16 -0
- package/src/composable/useBoundingRect.ts +87 -0
- package/src/composable/useDrag.ts +157 -0
- package/src/composable/useDragEx.ts +50 -0
- package/src/composable/useInitialRect.ts +51 -0
- package/src/composable/useRect.ts +23 -0
- package/src/composable/useResize.ts +184 -0
- package/src/composable/useTransition.ts +67 -0
- package/src/composable/useWindowSize.ts +25 -0
- package/src/index.ts +10 -6
- package/src/svg/arrow-left.svg +11 -0
- package/src/svg/arrow-right.svg +11 -0
- package/src/svg/svg.d.ts +6 -0
- package/src/MlLanguage.vue +0 -36
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
width="1em"
|
|
4
|
+
height="1em"
|
|
5
|
+
viewBox="0 0 1024 1024"
|
|
6
|
+
>
|
|
7
|
+
<path
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
d="M609.408 149.376L277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0a30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688a29.12 29.12 0 0 0-41.728 0"
|
|
10
|
+
/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
width="1em"
|
|
4
|
+
height="1em"
|
|
5
|
+
viewBox="0 0 1024 1024"
|
|
6
|
+
>
|
|
7
|
+
<path
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
d="M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512L340.864 831.872a30.59 30.59 0 0 0 0 42.752a29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
|
|
10
|
+
/>
|
|
11
|
+
</svg>
|
package/src/svg/svg.d.ts
ADDED
package/src/MlLanguage.vue
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ml-dropdown :icon="svg" :items="props.languages" :current="props.current" @click="handleClick" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup lang="ts">
|
|
6
|
-
import MlDropdown, { MlDropdownMenuItem } from './MlDropdown.vue'
|
|
7
|
-
|
|
8
|
-
const svg = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Properties of MlLanguage component
|
|
12
|
-
*/
|
|
13
|
-
interface Props {
|
|
14
|
-
/**
|
|
15
|
-
* An array of avaiable languages
|
|
16
|
-
*/
|
|
17
|
-
languages: MlDropdownMenuItem[]
|
|
18
|
-
/**
|
|
19
|
-
* Key of the current language
|
|
20
|
-
*/
|
|
21
|
-
current: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const props = defineProps<Props>()
|
|
25
|
-
|
|
26
|
-
const emit = defineEmits({
|
|
27
|
-
click: null
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const handleClick = (command: string) => {
|
|
31
|
-
emit('click', command)
|
|
32
|
-
}
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<style scoped>
|
|
36
|
-
</style>
|