@toife/vue 3.1.3 → 3.1.5
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 +1 -1
- package/package.json +1 -1
- package/src/components/action/action.scss +1 -1
- package/src/components/action/action.vue +5 -5
- package/src/components/app/app.scss +2 -2
- package/src/components/app/app.type.ts +6 -0
- package/src/components/app/app.vue +8 -2
- package/src/components/avatar/avatar.scss +6 -4
- package/src/components/avatar/avatar.vue +6 -6
- package/src/components/button/button.scss +19 -16
- package/src/components/button/button.type.ts +3 -1
- package/src/components/button/button.vue +7 -7
- package/src/components/cable/cable.vue +2 -2
- package/src/components/card/card/card.scss +5 -3
- package/src/components/card/card/card.vue +5 -5
- package/src/components/card/card-body/card-body.scss +2 -2
- package/src/components/card/card-body/card-body.vue +2 -2
- package/src/components/card/card-footer/card-footer.scss +3 -3
- package/src/components/card/card-footer/card-footer.vue +2 -2
- package/src/components/card/card-header/card-header.scss +3 -3
- package/src/components/card/card-header/card-header.vue +2 -2
- package/src/components/checkbox/checkbox.html +1 -1
- package/src/components/checkbox/checkbox.scss +27 -27
- package/src/components/checkbox/checkbox.type.ts +4 -0
- package/src/components/checkbox/checkbox.vue +8 -6
- package/src/components/collapse/collapse.html +1 -1
- package/src/components/collapse/collapse.scss +2 -2
- package/src/components/collapse/collapse.vue +9 -9
- package/src/components/container/container.vue +2 -2
- package/src/components/decision-modal/decision-modal.scss +12 -10
- package/src/components/decision-modal/decision-modal.vue +8 -8
- package/src/components/divider/divider.scss +2 -2
- package/src/components/divider/divider.vue +4 -4
- package/src/components/dropdown/dropdown.scss +8 -5
- package/src/components/dropdown/dropdown.type.ts +4 -1
- package/src/components/dropdown/dropdown.vue +8 -6
- package/src/components/field/field.type.ts +4 -4
- package/src/components/field/outline/outline.scss +24 -21
- package/src/components/field/outline/outline.vue +26 -18
- package/src/components/form-group/form-group.vue +2 -2
- package/src/components/gesture-indicator/gesture-indicator.scss +4 -2
- package/src/components/gesture-indicator/gesture-indicator.vue +4 -4
- package/src/components/image/image.vue +12 -5
- package/src/components/index.ts +1 -0
- package/src/components/layout/flex/flex.scss +0 -2
- package/src/components/layout/flex/flex.vue +8 -8
- package/src/components/layout/flex-item/flex-item.html +1 -0
- package/src/components/layout/flex-item/flex-item.scss +48 -0
- package/src/components/layout/flex-item/flex-item.type.ts +11 -0
- package/src/components/layout/flex-item/flex-item.vue +27 -0
- package/src/components/layout/flex-item/index.ts +2 -0
- package/src/components/layout/grid/grid.scss +0 -2
- package/src/components/layout/grid/grid.vue +6 -6
- package/src/components/layout/grid-item/grid-item.html +1 -0
- package/src/components/layout/grid-item/grid-item.scss +49 -0
- package/src/components/layout/grid-item/grid-item.type.ts +14 -0
- package/src/components/layout/grid-item/grid-item.vue +27 -0
- package/src/components/layout/grid-item/index.ts +2 -0
- package/src/components/layout/index.ts +2 -1
- package/src/components/modal/modal.scss +4 -2
- package/src/components/modal/modal.vue +68 -5
- package/src/components/page/page.vue +2 -2
- package/src/components/present/present.scss +3 -3
- package/src/components/present/present.vue +14 -14
- package/src/components/radio/radio/radio.html +1 -1
- package/src/components/radio/radio/radio.scss +25 -18
- package/src/components/radio/radio/radio.type.ts +4 -0
- package/src/components/radio/radio/radio.vue +7 -5
- package/src/components/radio/radio-group/radio-group.vue +2 -2
- package/src/components/refresher/refresher.html +1 -4
- package/src/components/refresher/refresher.scss +8 -26
- package/src/components/refresher/refresher.vue +2 -16
- package/src/components/route/route-navigator/route-navigator.scss +2 -2
- package/src/components/route/route-navigator/route-navigator.vue +10 -13
- package/src/components/route/route-wrapper/route-wrapper.composable.ts +5 -15
- package/src/components/route/route-wrapper/route-wrapper.type.ts +0 -4
- package/src/components/route/route-wrapper/route-wrapper.vue +4 -12
- package/src/components/route/route.type.ts +0 -1
- package/src/components/segmented-field/segmented-field.html +1 -1
- package/src/components/segmented-field/segmented-field.scss +2 -2
- package/src/components/segmented-field/segmented-field.vue +8 -8
- package/src/components/select/select.html +2 -2
- package/src/components/select/select.scss +10 -10
- package/src/components/select/select.vue +10 -10
- package/src/components/skeleton/skeleton.scss +3 -1
- package/src/components/skeleton/skeleton.vue +7 -7
- package/src/components/slide-range/index.ts +2 -0
- package/src/components/slide-range/slide-range.html +19 -0
- package/src/components/slide-range/slide-range.scss +161 -0
- package/src/components/slide-range/slide-range.type.ts +16 -0
- package/src/components/slide-range/slide-range.vue +229 -0
- package/src/components/switch/switch.html +1 -1
- package/src/components/switch/switch.scss +29 -38
- package/src/components/switch/switch.type.ts +6 -0
- package/src/components/switch/switch.vue +24 -8
- package/src/components/tabs/tab/tab.html +1 -1
- package/src/components/tabs/tab/tab.scss +13 -0
- package/src/components/tabs/tab/tab.vue +4 -2
- package/src/components/tabs/tabs/index.ts +1 -0
- package/src/components/tabs/tabs/tabs.scss +194 -122
- package/src/components/tabs/tabs/tabs.type.ts +5 -2
- package/src/components/tabs/tabs/tabs.vue +47 -27
- package/src/components/toast/toast/toast.vue +2 -2
- package/src/components/toast/toast-content/toast-content.scss +6 -5
- package/src/components/toast/toast-content/toast-content.vue +5 -5
- package/src/components/toolbar/toolbar.scss +4 -4
- package/src/components/toolbar/toolbar.type.ts +1 -1
- package/src/components/toolbar/toolbar.vue +7 -7
- package/src/factory.ts +108 -50
- package/src/index.ts +1 -1
- package/src/type.ts +2 -1
- package/src/utils/style/index.ts +9 -9
- package/src/utils/style.md +9 -9
- package/src/components/action/action.md +0 -115
- package/src/components/app/app.md +0 -77
- package/src/components/avatar/avatar.md +0 -64
- package/src/components/button/button.md +0 -66
- package/src/components/cable/cable.md +0 -57
- package/src/components/card/card/card.md +0 -57
- package/src/components/card/card-body/card-body.md +0 -34
- package/src/components/card/card-footer/card-footer.md +0 -42
- package/src/components/card/card-header/card-header.md +0 -44
- package/src/components/checkbox/checkbox.md +0 -60
- package/src/components/collapse/collapse.md +0 -59
- package/src/components/container/container.md +0 -38
- package/src/components/decision-modal/decision-modal.md +0 -79
- package/src/components/divider/divider.md +0 -42
- package/src/components/field/field.md +0 -68
- package/src/components/field/outline/outline-field.md +0 -44
- package/src/components/form-group/form-group.md +0 -41
- package/src/components/gesture-indicator/gesture-indicator.md +0 -42
- package/src/components/image/image.md +0 -41
- package/src/components/layout/cell/cell.html +0 -1
- package/src/components/layout/cell/cell.md +0 -47
- package/src/components/layout/cell/cell.scss +0 -54
- package/src/components/layout/cell/cell.type.ts +0 -19
- package/src/components/layout/cell/cell.vue +0 -35
- package/src/components/layout/cell/index.ts +0 -2
- package/src/components/layout/grid/grid.md +0 -50
- package/src/components/modal/modal.md +0 -65
- package/src/components/page/page.md +0 -39
- package/src/components/present/present.md +0 -60
- package/src/components/radio/radio/radio.md +0 -53
- package/src/components/radio/radio-group/radio-group.md +0 -62
- package/src/components/refresher/refresher.md +0 -53
- package/src/components/route/route-navigator/route-navigator.md +0 -50
- package/src/components/route/route-outlet/route-outlet.md +0 -30
- package/src/components/route/route-provider/route-provider.md +0 -46
- package/src/components/route/route-wrapper/route-wrapper.md +0 -45
- package/src/components/segmented-field/segmented-field.md +0 -58
- package/src/components/skeleton/skeleton.md +0 -47
- package/src/components/switch/switch.md +0 -57
- package/src/components/tabs/tab/tab.md +0 -52
- package/src/components/tabs/tabs/tabs.md +0 -59
- package/src/components/toast/toast/toast.md +0 -56
- package/src/components/toast/toast-content/toast-content.md +0 -41
- package/src/components/toolbar/toolbar.md +0 -54
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { AppSize } from "../app";
|
|
2
|
+
|
|
3
|
+
export type SwitchSize = AppSize;
|
|
4
|
+
|
|
1
5
|
// Type definitions
|
|
2
6
|
export type SwitchProps = {
|
|
3
7
|
modelValue?: boolean;
|
|
4
8
|
role?: string;
|
|
9
|
+
size?: SwitchSize;
|
|
5
10
|
shape?: string;
|
|
6
11
|
disabled?: boolean;
|
|
7
12
|
readonly?: boolean;
|
|
8
13
|
shadow?: boolean;
|
|
14
|
+
bounce?: number | string;
|
|
9
15
|
};
|
|
10
16
|
|
|
11
17
|
export type SwitchEmit = {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
<style lang="scss" src="./switch.scss" scoped></style>
|
|
2
2
|
<template src="./switch.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import { computed, inject, ref } from "vue";
|
|
4
|
+
import { computed, inject, ref, onMounted } from "vue";
|
|
5
5
|
import type { SwitchProps, SwitchEmit } from "./switch.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix, cssProperty } from "../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
10
10
|
// ----------------------------------------------------------------------------
|
|
11
11
|
const props = withDefaults(defineProps<SwitchProps>(), {
|
|
12
12
|
modelValue: false,
|
|
13
|
+
size: "standard",
|
|
13
14
|
readonly: false,
|
|
14
15
|
shadow: undefined,
|
|
16
|
+
bounce: 1.5,
|
|
15
17
|
});
|
|
16
18
|
const emit = defineEmits<SwitchEmit>();
|
|
17
19
|
const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
@@ -19,6 +21,7 @@ const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
|
19
21
|
// Reactive state
|
|
20
22
|
// ----------------------------------------------------------------------------
|
|
21
23
|
const isFocused = ref(false);
|
|
24
|
+
const isFirstRender = ref(true);
|
|
22
25
|
|
|
23
26
|
// Computed properties
|
|
24
27
|
// ----------------------------------------------------------------------------
|
|
@@ -26,7 +29,7 @@ const switchWrapperAttrs = computed(() => {
|
|
|
26
29
|
const shadow = (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
|
|
27
30
|
return {
|
|
28
31
|
class: [
|
|
29
|
-
|
|
32
|
+
cssPrefix("switch-wrapper"),
|
|
30
33
|
{
|
|
31
34
|
disabled: props.disabled,
|
|
32
35
|
readonly: props.readonly,
|
|
@@ -34,7 +37,13 @@ const switchWrapperAttrs = computed(() => {
|
|
|
34
37
|
focus: isFocused.value,
|
|
35
38
|
on: props.modelValue,
|
|
36
39
|
},
|
|
40
|
+
{
|
|
41
|
+
transition: isFirstRender.value ? false : true,
|
|
42
|
+
},
|
|
37
43
|
],
|
|
44
|
+
style: {
|
|
45
|
+
[cssProperty(["switch", "bounce", "ratio"])]: props.bounce,
|
|
46
|
+
},
|
|
38
47
|
};
|
|
39
48
|
});
|
|
40
49
|
|
|
@@ -44,16 +53,17 @@ const switchAttrs = computed(() => {
|
|
|
44
53
|
const role = props.role || baseRole;
|
|
45
54
|
return {
|
|
46
55
|
class: [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
cssPrefix(["layer", "switch"]),
|
|
57
|
+
cssPrefix(["role", role]),
|
|
58
|
+
cssPrefix(["shape", shape]),
|
|
59
|
+
cssPrefix(["size", props.size]),
|
|
60
|
+
cssPrefix("switch"),
|
|
51
61
|
],
|
|
52
62
|
};
|
|
53
63
|
});
|
|
54
64
|
|
|
55
65
|
const switchIconAttrs = {
|
|
56
|
-
class: [
|
|
66
|
+
class: [cssPrefix("switch-icon")],
|
|
57
67
|
} as const;
|
|
58
68
|
|
|
59
69
|
// Methods
|
|
@@ -78,4 +88,10 @@ const onKeydown = (e: KeyboardEvent) => {
|
|
|
78
88
|
e.preventDefault();
|
|
79
89
|
onSwitch();
|
|
80
90
|
};
|
|
91
|
+
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
isFirstRender.value = false;
|
|
95
|
+
}, 500);
|
|
96
|
+
});
|
|
81
97
|
</script>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template src="./tab.html"></template>
|
|
2
|
+
<style lang="scss" src="./tab.scss" scoped></style>
|
|
2
3
|
<script lang="ts" setup>
|
|
3
4
|
import { computed, inject } from "vue";
|
|
4
5
|
import { Button as CustomButton } from "../../button";
|
|
5
6
|
import { type TabProps } from "./tab.type";
|
|
6
|
-
import {
|
|
7
|
+
import { cssPrefix } from "../../../utils";
|
|
7
8
|
import { type TabsProviderState, TABS_PROVIDER_STATE_KEY } from "../tabs";
|
|
8
9
|
|
|
9
10
|
// Component setup (props, emits, injects)
|
|
@@ -17,11 +18,12 @@ const tabsState = inject<TabsProviderState>(TABS_PROVIDER_STATE_KEY);
|
|
|
17
18
|
// ----------------------------------------------------------------------------
|
|
18
19
|
const role = computed(() => tabsState?.role.value || "");
|
|
19
20
|
const shape = computed(() => tabsState?.shape.value || "");
|
|
21
|
+
const size = computed(() => tabsState?.size.value || "standard");
|
|
20
22
|
const isActive = computed(() => tabsState?.activeValue.value === props.value);
|
|
21
23
|
const tabAttrs = computed(() => {
|
|
22
24
|
return {
|
|
23
25
|
class: [
|
|
24
|
-
|
|
26
|
+
cssPrefix("tab"),
|
|
25
27
|
{
|
|
26
28
|
active: isActive.value,
|
|
27
29
|
},
|
|
@@ -6,23 +6,83 @@ $tab: sass.fn-naming-prefix("tab");
|
|
|
6
6
|
$button: sass.fn-naming-prefix("button");
|
|
7
7
|
|
|
8
8
|
// Property name - layer: tabs
|
|
9
|
-
|
|
10
|
-
$tabs-
|
|
11
|
-
$tabs-
|
|
12
|
-
|
|
13
|
-
$
|
|
14
|
-
$
|
|
15
|
-
$border-
|
|
9
|
+
// Underline
|
|
10
|
+
$tabs-underline-color: sass.fn-naming-var("tabs", "underline", "color");
|
|
11
|
+
$tabs-underline-color-active: sass.fn-naming-var("tabs", "underline", "color", "active");
|
|
12
|
+
$tabs-underline-color-hover: sass.fn-naming-var("tabs", "underline", "color", "hover");
|
|
13
|
+
$tabs-underline-color-focus: sass.fn-naming-var("tabs", "underline", "color", "focus");
|
|
14
|
+
$tabs-underline-color-disabled: sass.fn-naming-var("tabs", "underline", "color", "disabled");
|
|
15
|
+
$tabs-underline-border-color: sass.fn-naming-var("tabs", "underline", "border-color");
|
|
16
|
+
$tabs-underline-border-color-active: sass.fn-naming-var(
|
|
17
|
+
"tabs",
|
|
18
|
+
"underline",
|
|
19
|
+
"border-color",
|
|
20
|
+
"active"
|
|
21
|
+
);
|
|
22
|
+
$tabs-underline-border-color-hover: sass.fn-naming-var(
|
|
23
|
+
"tabs",
|
|
24
|
+
"underline",
|
|
25
|
+
"border-color",
|
|
26
|
+
"hover"
|
|
27
|
+
);
|
|
28
|
+
$tabs-underline-border-color-focus: sass.fn-naming-var(
|
|
29
|
+
"tabs",
|
|
30
|
+
"underline",
|
|
31
|
+
"border-color",
|
|
32
|
+
"focus"
|
|
33
|
+
);
|
|
34
|
+
$tabs-underline-border-color-disabled: sass.fn-naming-var(
|
|
35
|
+
"tabs",
|
|
36
|
+
"underline",
|
|
37
|
+
"border-color",
|
|
38
|
+
"disabled"
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
// Fill
|
|
42
|
+
$tabs-fill-color: sass.fn-naming-var("tabs", "fill", "color");
|
|
43
|
+
$tabs-fill-color-active: sass.fn-naming-var("tabs", "fill", "color", "active");
|
|
44
|
+
$tabs-fill-color-hover: sass.fn-naming-var("tabs", "fill", "color", "hover");
|
|
45
|
+
$tabs-fill-color-focus: sass.fn-naming-var("tabs", "fill", "color", "focus");
|
|
46
|
+
$tabs-fill-color-disabled: sass.fn-naming-var("tabs", "fill", "color", "disabled");
|
|
47
|
+
$tabs-fill-background-color: sass.fn-naming-var("tabs", "fill", "background-color");
|
|
48
|
+
$tabs-fill-background-color-active: sass.fn-naming-var(
|
|
49
|
+
"tabs",
|
|
50
|
+
"fill",
|
|
51
|
+
"background-color",
|
|
52
|
+
"active"
|
|
53
|
+
);
|
|
54
|
+
$tabs-fill-background-color-hover: sass.fn-naming-var("tabs", "fill", "background-color", "hover");
|
|
55
|
+
$tabs-fill-background-color-focus: sass.fn-naming-var("tabs", "fill", "background-color", "focus");
|
|
56
|
+
$tabs-fill-background-color-disabled: sass.fn-naming-var(
|
|
57
|
+
"tabs",
|
|
58
|
+
"fill",
|
|
59
|
+
"background-color",
|
|
60
|
+
"disabled"
|
|
61
|
+
);
|
|
62
|
+
$tabs-fill-border-color: sass.fn-naming-var("tabs", "fill", "border-color");
|
|
63
|
+
$tabs-fill-border-color-active: sass.fn-naming-var("tabs", "fill", "border-color", "active");
|
|
64
|
+
$tabs-fill-border-color-hover: sass.fn-naming-var("tabs", "fill", "border-color", "hover");
|
|
65
|
+
$tabs-fill-border-color-focus: sass.fn-naming-var("tabs", "fill", "border-color", "focus");
|
|
66
|
+
$tabs-fill-border-color-disabled: sass.fn-naming-var("tabs", "fill", "border-color", "disabled");
|
|
67
|
+
|
|
68
|
+
// Text
|
|
69
|
+
$tabs-text-color: sass.fn-naming-var("tabs", "text", "color");
|
|
70
|
+
$tabs-text-color-active: sass.fn-naming-var("tabs", "text", "color", "active");
|
|
71
|
+
$tabs-text-color-hover: sass.fn-naming-var("tabs", "text", "color", "hover");
|
|
72
|
+
$tabs-text-color-focus: sass.fn-naming-var("tabs", "text", "color", "focus");
|
|
73
|
+
$tabs-text-color-disabled: sass.fn-naming-var("tabs", "text", "color", "disabled");
|
|
74
|
+
|
|
75
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
16
76
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
17
77
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
18
|
-
|
|
78
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
19
79
|
// layer: highlight (indicator geometry)
|
|
20
|
-
$highlight-top: sass.fn-naming-var("highlight", "top");
|
|
21
|
-
$highlight-left: sass.fn-naming-var("highlight", "left");
|
|
22
|
-
$highlight-width: sass.fn-naming-var("highlight", "width");
|
|
23
|
-
$highlight-height: sass.fn-naming-var("highlight", "height");
|
|
24
|
-
$highlight-space-x: sass.fn-naming-var("highlight", "space-x");
|
|
25
|
-
$highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
80
|
+
$highlight-top: sass.fn-naming-var("tabs", "highlight", "top");
|
|
81
|
+
$highlight-left: sass.fn-naming-var("tabs", "highlight", "left");
|
|
82
|
+
$highlight-width: sass.fn-naming-var("tabs", "highlight", "width");
|
|
83
|
+
$highlight-height: sass.fn-naming-var("tabs", "highlight", "height");
|
|
84
|
+
$highlight-space-x: sass.fn-naming-var("tabs", "highlight", "space-x");
|
|
85
|
+
$highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
|
|
26
86
|
|
|
27
87
|
.#{$tabs} {
|
|
28
88
|
display: flex;
|
|
@@ -31,30 +91,29 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
31
91
|
margin: 0;
|
|
32
92
|
list-style: none;
|
|
33
93
|
border: none;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
border-color #{$transition-duration} ease,
|
|
37
|
-
background-color #{$transition-duration} ease,
|
|
38
|
-
color #{$transition-duration} ease,
|
|
39
|
-
border-radius #{$transition-duration} ease;
|
|
94
|
+
overflow-y: hidden;
|
|
95
|
+
overflow-x: hidden;
|
|
40
96
|
|
|
41
97
|
> * {
|
|
42
98
|
z-index: 1;
|
|
43
99
|
}
|
|
44
100
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
101
|
+
&:not(.text) {
|
|
102
|
+
&::before {
|
|
103
|
+
content: "";
|
|
104
|
+
z-index: 1;
|
|
105
|
+
display: block;
|
|
106
|
+
position: absolute;
|
|
107
|
+
top: 0;
|
|
108
|
+
left: 0;
|
|
109
|
+
width: #{$highlight-width};
|
|
110
|
+
height: #{$highlight-height};
|
|
111
|
+
transform: translate(#{$highlight-left}, #{$highlight-top});
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
border-radius: calc(
|
|
114
|
+
min(#{$highlight-width}, #{$highlight-height}, #{$radius-size}) * #{$radius-ratio}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
58
117
|
}
|
|
59
118
|
|
|
60
119
|
&.top-start,
|
|
@@ -88,6 +147,9 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
88
147
|
flex-direction: row;
|
|
89
148
|
height: fit-content;
|
|
90
149
|
width: 100%;
|
|
150
|
+
padding-top: #{$highlight-space-y};
|
|
151
|
+
padding-bottom: #{$highlight-space-y};
|
|
152
|
+
overflow-x: auto;
|
|
91
153
|
|
|
92
154
|
> * {
|
|
93
155
|
height: 100%;
|
|
@@ -100,129 +162,146 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
100
162
|
&.right-start,
|
|
101
163
|
&.right-center,
|
|
102
164
|
&.right-end {
|
|
165
|
+
padding-left: #{$highlight-space-x};
|
|
166
|
+
padding-right: #{$highlight-space-x};
|
|
103
167
|
flex-direction: column;
|
|
104
168
|
width: fit-content;
|
|
105
169
|
height: 100%;
|
|
170
|
+
overflow-y: auto;
|
|
106
171
|
|
|
107
172
|
> * {
|
|
108
173
|
width: 100%;
|
|
109
174
|
}
|
|
110
175
|
}
|
|
111
176
|
|
|
112
|
-
&.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
&.top-end {
|
|
116
|
-
border-bottom: #{$border-width} solid rgb(#{$tabs-border-color});
|
|
177
|
+
&.underline {
|
|
178
|
+
&::before {
|
|
179
|
+
background-color: rgba(#{$tabs-underline-border-color-active});
|
|
117
180
|
}
|
|
118
181
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
182
|
+
:deep(.#{$tab}) {
|
|
183
|
+
.#{$button} {
|
|
184
|
+
color: rgba(#{$tabs-underline-color});
|
|
185
|
+
background-color: transparent !important;
|
|
186
|
+
}
|
|
124
187
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
188
|
+
&.active {
|
|
189
|
+
.#{$button} {
|
|
190
|
+
color: rgba(#{$tabs-underline-color-active});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
130
193
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
194
|
+
&:hover,
|
|
195
|
+
&.hover {
|
|
196
|
+
.#{$button} {
|
|
197
|
+
color: rgba(#{$tabs-underline-color-hover});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
137
200
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
&.bottom-end {
|
|
145
|
-
padding-top: #{$highlight-space-y};
|
|
146
|
-
padding-bottom: #{$highlight-space-y};
|
|
147
|
-
}
|
|
201
|
+
&:focus,
|
|
202
|
+
&.focus {
|
|
203
|
+
.#{$button} {
|
|
204
|
+
color: rgba(#{$tabs-underline-color-focus});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
148
207
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
padding-left: #{$highlight-space-x};
|
|
156
|
-
padding-right: #{$highlight-space-x};
|
|
208
|
+
&:disabled,
|
|
209
|
+
&.disabled {
|
|
210
|
+
.#{$button} {
|
|
211
|
+
color: rgba(#{$tabs-underline-color-disabled});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
157
214
|
}
|
|
158
215
|
}
|
|
159
216
|
|
|
160
217
|
&.fill {
|
|
218
|
+
&::before {
|
|
219
|
+
background-color: rgba(#{$tabs-fill-background-color-active});
|
|
220
|
+
}
|
|
221
|
+
|
|
161
222
|
:deep(.#{$tab}) {
|
|
223
|
+
.#{$button} {
|
|
224
|
+
color: rgba(#{$tabs-fill-color});
|
|
225
|
+
background-color: rgba(#{$tabs-fill-background-color});
|
|
226
|
+
}
|
|
227
|
+
|
|
162
228
|
&.active {
|
|
163
229
|
.#{$button} {
|
|
164
|
-
color:
|
|
230
|
+
color: rgba(#{$tabs-fill-color-active});
|
|
231
|
+
background-color: transparent !important;
|
|
165
232
|
}
|
|
166
233
|
}
|
|
167
|
-
}
|
|
168
234
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
padding-bottom: calc(#{$highlight-space-y} + #{$space-y});
|
|
177
|
-
}
|
|
235
|
+
&:hover,
|
|
236
|
+
&.hover {
|
|
237
|
+
.#{$button} {
|
|
238
|
+
color: rgba(#{$tabs-fill-color-hover});
|
|
239
|
+
background-color: rgba(#{$tabs-fill-background-color-hover});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
178
242
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
243
|
+
&:focus,
|
|
244
|
+
&.focus {
|
|
245
|
+
.#{$button} {
|
|
246
|
+
color: rgba(#{$tabs-fill-color-focus});
|
|
247
|
+
background-color: rgba(#{$tabs-fill-background-color-focus});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&:disabled,
|
|
252
|
+
&.disabled {
|
|
253
|
+
.#{$button} {
|
|
254
|
+
color: rgba(#{$tabs-fill-color-disabled});
|
|
255
|
+
background-color: rgba(#{$tabs-fill-background-color-disabled});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
187
258
|
}
|
|
188
259
|
}
|
|
189
260
|
|
|
190
261
|
&.text {
|
|
191
|
-
&::before {
|
|
192
|
-
display: none;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
262
|
:deep(.#{$tab}) {
|
|
263
|
+
.#{$button} {
|
|
264
|
+
color: rgba(#{$tabs-text-color});
|
|
265
|
+
background-color: transparent;
|
|
266
|
+
}
|
|
267
|
+
|
|
196
268
|
&.active {
|
|
197
269
|
.#{$button} {
|
|
198
|
-
color:
|
|
199
|
-
text-shadow: 0 0 rgb(#{$tabs-background-color});
|
|
270
|
+
color: rgba(#{$tabs-text-color-active});
|
|
200
271
|
}
|
|
201
272
|
}
|
|
202
|
-
}
|
|
203
273
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
padding-top: calc(#{$highlight-space-y} + #{$space-y});
|
|
211
|
-
padding-bottom: calc(#{$highlight-space-y} + #{$space-y});
|
|
212
|
-
}
|
|
274
|
+
&:hover,
|
|
275
|
+
&.hover {
|
|
276
|
+
.#{$button} {
|
|
277
|
+
color: rgba(#{$tabs-text-color-hover});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
213
280
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
281
|
+
&:focus,
|
|
282
|
+
&.focus {
|
|
283
|
+
.#{$button} {
|
|
284
|
+
color: rgba(#{$tabs-text-color-focus});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&:disabled,
|
|
289
|
+
&.disabled {
|
|
290
|
+
.#{$button} {
|
|
291
|
+
color: rgba(#{$tabs-text-color-disabled});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
222
294
|
}
|
|
223
295
|
}
|
|
224
296
|
|
|
225
297
|
&.transition {
|
|
298
|
+
transition:
|
|
299
|
+
box-shadow #{$transition-duration} ease,
|
|
300
|
+
border-color #{$transition-duration} ease,
|
|
301
|
+
background-color #{$transition-duration} ease,
|
|
302
|
+
color #{$transition-duration} ease,
|
|
303
|
+
border-radius #{$transition-duration} ease;
|
|
304
|
+
|
|
226
305
|
&::before {
|
|
227
306
|
transition:
|
|
228
307
|
background-color #{$transition-duration} ease,
|
|
@@ -256,14 +335,7 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
|
|
|
256
335
|
align-items: center;
|
|
257
336
|
|
|
258
337
|
.#{$button} {
|
|
259
|
-
padding: #{$space-y} calc(#{$space-x} * 4);
|
|
260
|
-
color: unset;
|
|
261
338
|
cursor: pointer;
|
|
262
|
-
background-color: transparent !important;
|
|
263
|
-
border: none !important;
|
|
264
|
-
box-shadow: none !important;
|
|
265
|
-
border-radius: 0 !important;
|
|
266
|
-
transition: none;
|
|
267
339
|
}
|
|
268
340
|
}
|
|
269
341
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComputedRef } from "vue";
|
|
2
|
+
import { AppSize } from "../../app";
|
|
2
3
|
|
|
3
4
|
export type TabsVariant = "fill" | "underline" | "text";
|
|
5
|
+
export type TabsSize = AppSize;
|
|
4
6
|
export type TabsPlacement =
|
|
5
7
|
| "top-start"
|
|
6
8
|
| "top-end"
|
|
@@ -17,11 +19,11 @@ export type TabsProps = {
|
|
|
17
19
|
variant?: TabsVariant;
|
|
18
20
|
role?: string;
|
|
19
21
|
modelValue?: string;
|
|
20
|
-
border?: number;
|
|
22
|
+
border?: number[];
|
|
21
23
|
margin?: number[];
|
|
22
24
|
shape?: string;
|
|
23
|
-
divider?: boolean;
|
|
24
25
|
transition?: boolean;
|
|
26
|
+
size?: TabsSize;
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
export type TabsEmit = {
|
|
@@ -32,5 +34,6 @@ export type TabsProviderState = {
|
|
|
32
34
|
activeValue: ComputedRef<string>;
|
|
33
35
|
role: ComputedRef<string>;
|
|
34
36
|
shape: ComputedRef<string>;
|
|
37
|
+
size: ComputedRef<TabsSize>;
|
|
35
38
|
setValue: (val: string) => void;
|
|
36
39
|
};
|