adata-ui 4.0.20 → 4.0.22
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/DigitBadge.vue +57 -0
- package/dist/runtime/components/DigitBadge.vue.d.ts +21 -0
- package/dist/runtime/components/floating-label/FloatingLabel.vue +22 -0
- package/dist/runtime/components/floating-label/FloatingLabel.vue.d.ts +16 -0
- package/dist/runtime/components/pill-tabs/PillTabs.vue +4 -2
- package/dist/runtime/components/pill-tabs/PillTabs.vue.d.ts +2 -2
- package/dist/runtime/composables/projectState.js +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
defineOptions({ name: "ADigitBadge" });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
type: { type: String, required: false, default: "primary" },
|
|
6
|
+
view: { type: String, required: false, default: "default" },
|
|
7
|
+
size: { type: String, required: false, default: "lg" },
|
|
8
|
+
value: { type: [String, Number], required: true },
|
|
9
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
10
|
+
customClasses: { type: String, required: false, default: "" },
|
|
11
|
+
prefix: { type: String, required: false, default: "" }
|
|
12
|
+
});
|
|
13
|
+
const formattedValue = computed(() => {
|
|
14
|
+
return Number(props.value).toLocaleString("ru-RU");
|
|
15
|
+
});
|
|
16
|
+
const classes = computed(() => [
|
|
17
|
+
props.disabled ? "text-gray-500 bg-deepblue-900/5" : typeSwitchValues[props.view][props.type],
|
|
18
|
+
"inline-flex items-center justify-center font-medium rounded-full select-none inline-flex outline-none",
|
|
19
|
+
sizeSwitchValues[props.size],
|
|
20
|
+
props.value && props.value.toString().length > 2 ? "w-auto" : ""
|
|
21
|
+
]);
|
|
22
|
+
const typeSwitchValues = {
|
|
23
|
+
default: {
|
|
24
|
+
primary: "bg-blue-700 text-white dark:bg-blue-500 dark:text-gray-900",
|
|
25
|
+
success: "bg-green-500 text-white dark:bg-green-400 dark:text-gray-900",
|
|
26
|
+
danger: "bg-red-500 text-white dark:bg-red-400 dark:text-gray-900",
|
|
27
|
+
warning: "bg-yellow-400 text-white dark:text-gray-900",
|
|
28
|
+
gray: "bg-gray-50 text-gray-500 dark:text-gray-900",
|
|
29
|
+
orange: "bg-orange-600 text-white dark:bg-orange-500 dark:text-gray-900"
|
|
30
|
+
},
|
|
31
|
+
inverted: {
|
|
32
|
+
primary: "bg-white text-blue-700 dark:text-blue-500 dark:bg-gray-900",
|
|
33
|
+
success: "bg-white text-green-500 dark:text-green-400 dark:bg-gray-900",
|
|
34
|
+
danger: "bg-white text-red-500 dark:text-red-400 dark:bg-gray-900",
|
|
35
|
+
warning: "bg-white text-yellow-400 dark:bg-gray-900",
|
|
36
|
+
gray: "bg-white text-gray-500 dark:text-gray-200 dark:bg-gray-200/10",
|
|
37
|
+
orange: "bg-white text-deepblue-900 dark:text-orange-500 dark:bg-gray-900"
|
|
38
|
+
},
|
|
39
|
+
transparent: {
|
|
40
|
+
success: "bg-green-500/20 text-green-500",
|
|
41
|
+
danger: "bg-red-500/20 text-red-500 dark:text-red-400"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const sizeSwitchValues = {
|
|
45
|
+
sm: "w-4 h-4 px-1 text-[9.5px]",
|
|
46
|
+
md: "w-5 h-5 px-1 text-[10px]",
|
|
47
|
+
lg: "px-2 w-6 h-6 text-xs font-semibold"
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<div
|
|
53
|
+
:class="twMerge(...classes, customClasses)"
|
|
54
|
+
>
|
|
55
|
+
{{ prefix }}{{ formattedValue }}
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
type?: 'primary' | 'success' | 'danger' | 'gray' | 'orange' | 'warning';
|
|
3
|
+
view?: 'default' | 'inverted';
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
value: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
customClasses?: string;
|
|
8
|
+
prefix?: string;
|
|
9
|
+
}
|
|
10
|
+
export type StateType = {
|
|
11
|
+
[key in 'primary' | 'success' | 'danger' | 'gray' | 'orange' | 'warning']?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
14
|
+
size: "sm" | "md" | "lg";
|
|
15
|
+
type: "primary" | "success" | "danger" | "gray" | "orange" | "warning";
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
view: "default" | "inverted";
|
|
18
|
+
customClasses: string;
|
|
19
|
+
prefix: string;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
value: { type: String, required: false },
|
|
5
|
+
labelClasses: { type: String, required: false }
|
|
6
|
+
});
|
|
7
|
+
const combinedClasses = twMerge(`
|
|
8
|
+
pointer-events-none absolute
|
|
9
|
+
left-8 top-0 text-[10px] ps-1.5
|
|
10
|
+
transition-all
|
|
11
|
+
peer-focus:top-0 peer-focus:pt-0 peer-focus:text-[10px]
|
|
12
|
+
peer-placeholder-shown:text-sm peer-placeholder-shown:top-1.5 peer-placeholder-shown:pt-0.5
|
|
13
|
+
`, props.labelClasses);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<label :class="combinedClasses">
|
|
18
|
+
<slot>
|
|
19
|
+
<span class="text-gray-500 leading-4">{{ value }}</span>
|
|
20
|
+
</slot>
|
|
21
|
+
</label>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
value?: string;
|
|
3
|
+
labelClasses?: string;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: 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>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import ADigitBadge from "../DigitBadge.vue";
|
|
3
|
+
import AButton from "../button/Button.vue";
|
|
2
4
|
defineOptions({ name: "APillTabs" });
|
|
3
5
|
const emit = defineEmits(["selectOption", "prevent"]);
|
|
4
6
|
const props = defineProps({
|
|
@@ -88,7 +90,7 @@ onMounted(() => {
|
|
|
88
90
|
class="scroll-container overflow-auto whitespace-nowrap"
|
|
89
91
|
:class="props.wrapper === 'row' ? 'flex gap-1' : 'flex flex-col gap-1'"
|
|
90
92
|
>
|
|
91
|
-
<button
|
|
93
|
+
<a-button
|
|
92
94
|
v-for="option in options"
|
|
93
95
|
:key="option.key"
|
|
94
96
|
:disabled="option.disabled"
|
|
@@ -123,7 +125,7 @@ onMounted(() => {
|
|
|
123
125
|
</template>
|
|
124
126
|
</span>
|
|
125
127
|
</slot>
|
|
126
|
-
</button>
|
|
128
|
+
</a-button>
|
|
127
129
|
</div>
|
|
128
130
|
</template>
|
|
129
131
|
|
|
@@ -13,11 +13,11 @@ type __VLS_Props = Props;
|
|
|
13
13
|
type __VLS_PublicProps = __VLS_Props & {
|
|
14
14
|
modelValue?: any;
|
|
15
15
|
};
|
|
16
|
-
declare var
|
|
16
|
+
declare var __VLS_8: {
|
|
17
17
|
option: any;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
20
|
-
option?: (props: typeof
|
|
20
|
+
option?: (props: typeof __VLS_8) => any;
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
|
|
23
23
|
size: "lg" | "sm" | "xs";
|