@unsource/ui 2.7.10 → 2.7.11
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/UnToggle.d.vue.ts +12 -3
- package/dist/runtime/components/UnToggle.vue +38 -11
- package/dist/runtime/components/UnToggle.vue.d.ts +12 -3
- package/dist/runtime/uno.config.js +1 -0
- package/package.json +1 -1
- package/dist/runtime/components/UnToggleButton.d.vue.ts +0 -11
- package/dist/runtime/components/UnToggleButton.vue +0 -22
- package/dist/runtime/components/UnToggleButton.vue.d.ts +0 -11
package/dist/module.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
export type CardCustomClass = Partial<Record<'label' | 'button' | 'buttonWrapper' | 'buttonLabel', string>>;
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
label
|
|
3
|
-
disabled
|
|
3
|
+
label?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
customClass?: CardCustomClass;
|
|
6
|
+
trueLabel?: string;
|
|
7
|
+
falseLabel?: string;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
4
9
|
};
|
|
5
10
|
type __VLS_ModelProps = {
|
|
6
11
|
modelValue?: any;
|
|
7
12
|
};
|
|
8
13
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: any) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
19
|
declare const _default: typeof __VLS_export;
|
|
11
20
|
export default _default;
|
|
@@ -1,26 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="h-12 w-full flex flex-row gap-1 items-center cursor-pointer text-black-1 select-none"
|
|
4
|
-
@click="
|
|
3
|
+
class="group h-12 w-full flex flex-row gap-1 items-center cursor-pointer text-black-1 select-none"
|
|
4
|
+
@click="changeValue"
|
|
5
5
|
>
|
|
6
|
-
<div
|
|
6
|
+
<div
|
|
7
|
+
v-if="label"
|
|
8
|
+
:class="customClass?.label"
|
|
9
|
+
class="flex-grow truncate text-sm"
|
|
10
|
+
>
|
|
7
11
|
{{ label }}
|
|
8
12
|
</div>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
+
<div
|
|
14
|
+
class="aspect-2/1 relative flex items-center rounded-full transition-bg duration-300 group/wrapper"
|
|
15
|
+
:class="[sizeClass[size], { 'opacity-50 disabled': disabled }, value ? 'true bg-primary' : 'false bg-border', customClass?.buttonWrapper]"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="group/button flex justify-center items-center absolute bg-white top-1/2 -translate-y-1/2 h-[calc(100%-4px)] aspect-square rounded-full shadow-toggle transform transition-all duration-200"
|
|
19
|
+
:class="[value ? 'end-[calc(100%-2px)] -translate-x-full' : 'end-0.5', customClass?.button]"
|
|
20
|
+
>
|
|
21
|
+
<small
|
|
22
|
+
v-if="value ? trueLabel : falseLabel"
|
|
23
|
+
:class="customClass?.buttonLabel"
|
|
24
|
+
class="px-1 text-inherit"
|
|
25
|
+
>
|
|
26
|
+
{{ value ? trueLabel : falseLabel }}
|
|
27
|
+
</small>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
13
30
|
</div>
|
|
14
31
|
</template>
|
|
15
32
|
|
|
16
33
|
<script setup>
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
const { size = "xl", disabled } = defineProps({
|
|
35
|
+
label: { type: String, required: false },
|
|
36
|
+
disabled: { type: Boolean, required: false },
|
|
37
|
+
customClass: { type: Object, required: false },
|
|
38
|
+
trueLabel: { type: String, required: false },
|
|
39
|
+
falseLabel: { type: String, required: false },
|
|
40
|
+
size: { type: String, required: false }
|
|
21
41
|
});
|
|
22
42
|
const value = defineModel();
|
|
23
43
|
const changeValue = () => {
|
|
44
|
+
if (disabled) return;
|
|
24
45
|
value.value = !value.value;
|
|
25
46
|
};
|
|
47
|
+
const sizeClass = {
|
|
48
|
+
sm: "w-8 children:(text-xs)",
|
|
49
|
+
md: "w-10 children:(text-sm)",
|
|
50
|
+
lg: "w-14 children:(text-md)",
|
|
51
|
+
xl: "w-18 children:(text-lg)"
|
|
52
|
+
};
|
|
26
53
|
</script>
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
export type CardCustomClass = Partial<Record<'label' | 'button' | 'buttonWrapper' | 'buttonLabel', string>>;
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
label
|
|
3
|
-
disabled
|
|
3
|
+
label?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
customClass?: CardCustomClass;
|
|
6
|
+
trueLabel?: string;
|
|
7
|
+
falseLabel?: string;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
4
9
|
};
|
|
5
10
|
type __VLS_ModelProps = {
|
|
6
11
|
modelValue?: any;
|
|
7
12
|
};
|
|
8
13
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: any) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
19
|
declare const _default: typeof __VLS_export;
|
|
11
20
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const _default: typeof __VLS_export;
|
|
2
|
-
export default _default;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
4
|
-
$props: Partial<typeof __VLS_props>;
|
|
5
|
-
value: number | boolean;
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
-
declare const __VLS_props: {
|
|
9
|
-
readonly value: number | boolean;
|
|
10
|
-
readonly disabled: boolean;
|
|
11
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="w-9 h-5 relative flex items-center rounded-full transition-bg duration-200"
|
|
4
|
-
:class="[value && !disabled ? 'bg-primary-500' : 'bg-border']">
|
|
5
|
-
<div
|
|
6
|
-
class="absolute bg-white h-4 w-4 rounded-1/2 shadow-toggle transform transition-all duration-200"
|
|
7
|
-
:class="[ value ? 'left-full -translate-x-18px ' : 'left-0 translate-x-0.5',]"/>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
defineProps({
|
|
13
|
-
value: {
|
|
14
|
-
type: [Boolean, Number],
|
|
15
|
-
default: false
|
|
16
|
-
},
|
|
17
|
-
disabled: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const _default: typeof __VLS_export;
|
|
2
|
-
export default _default;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
4
|
-
$props: Partial<typeof __VLS_props>;
|
|
5
|
-
value: number | boolean;
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
-
declare const __VLS_props: {
|
|
9
|
-
readonly value: number | boolean;
|
|
10
|
-
readonly disabled: boolean;
|
|
11
|
-
};
|