@toife/vue 3.1.4 → 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.vue +5 -5
- package/src/components/avatar/avatar.scss +3 -2
- package/src/components/avatar/avatar.vue +6 -6
- package/src/components/button/button.scss +13 -13
- package/src/components/button/button.vue +7 -7
- package/src/components/cable/cable.vue +2 -2
- package/src/components/card/card/card.scss +2 -2
- 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 +18 -13
- package/src/components/checkbox/checkbox.vue +7 -7
- 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 +9 -9
- 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 +3 -3
- package/src/components/dropdown/dropdown.vue +7 -9
- package/src/components/field/field.type.ts +2 -2
- package/src/components/field/outline/outline.scss +15 -13
- 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 +1 -1
- package/src/components/gesture-indicator/gesture-indicator.vue +4 -4
- package/src/components/image/image.vue +12 -5
- package/src/components/layout/flex/flex.vue +8 -8
- package/src/components/layout/flex-item/flex-item.vue +6 -6
- package/src/components/layout/grid/grid.vue +6 -6
- package/src/components/layout/grid-item/grid-item.vue +6 -6
- package/src/components/modal/modal.scss +1 -1
- 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 +18 -13
- package/src/components/radio/radio/radio.type.ts +1 -1
- package/src/components/radio/radio/radio.vue +6 -6
- package/src/components/radio/radio-group/radio-group.vue +2 -2
- package/src/components/refresher/refresher.html +0 -3
- package/src/components/refresher/refresher.scss +1 -25
- 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.vue +7 -7
- package/src/components/slide-range/slide-range.html +3 -4
- package/src/components/slide-range/slide-range.scss +10 -10
- package/src/components/slide-range/slide-range.vue +16 -16
- package/src/components/switch/switch.html +1 -1
- package/src/components/switch/switch.scss +22 -20
- package/src/components/switch/switch.type.ts +1 -0
- package/src/components/switch/switch.vue +23 -9
- 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 +81 -49
- package/src/components/tabs/tabs/tabs.type.ts +5 -1
- package/src/components/tabs/tabs/tabs.vue +47 -23
- package/src/components/toast/toast/toast.vue +2 -2
- package/src/components/toast/toast-content/toast-content.scss +3 -3
- package/src/components/toast/toast-content/toast-content.vue +5 -5
- package/src/components/toolbar/toolbar.scss +3 -3
- package/src/components/toolbar/toolbar.vue +5 -5
- package/src/factory.ts +105 -51
- package/src/type.ts +2 -1
- package/src/utils/style/index.ts +9 -9
- package/src/utils/style.md +9 -9
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Usage docs live **next to source** under `src/`. Authoring scaffold: [docs/templ
|
|
|
55
55
|
|-----|----------|
|
|
56
56
|
| [element.md](src/utils/element.md) | `isFormElement`, `blurCurrentActive` |
|
|
57
57
|
| [events.md](src/utils/events.md) | `preventDefault` |
|
|
58
|
-
| [style.md](src/utils/style.md) | `
|
|
58
|
+
| [style.md](src/utils/style.md) | `stylePrefix`, `property`, `variable`, … |
|
|
59
59
|
|
|
60
60
|
## Requirements
|
|
61
61
|
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import { Present } from "../present";
|
|
|
6
6
|
import { Button as CustomButton } from "../button";
|
|
7
7
|
import { FormGroup } from "../form-group";
|
|
8
8
|
import { type ActionEmit, type ActionButton, type ActionProps } from "./action.type";
|
|
9
|
-
import {
|
|
9
|
+
import { cssPrefix } from "../../utils";
|
|
10
10
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
11
11
|
|
|
12
12
|
// Component setup (props, emits, injects)
|
|
@@ -36,10 +36,10 @@ const actionAttrs = computed(() => {
|
|
|
36
36
|
const role = props.role ?? appState?.role.value ?? "";
|
|
37
37
|
return {
|
|
38
38
|
class: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
cssPrefix("action"),
|
|
40
|
+
cssPrefix(["layer", "action"]),
|
|
41
|
+
cssPrefix(["role", role]),
|
|
42
|
+
cssPrefix(["shape", shape]),
|
|
43
43
|
props.placement,
|
|
44
44
|
{
|
|
45
45
|
pop: pop.value,
|
|
@@ -13,8 +13,8 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
13
13
|
max-width: #{sass.fn-naming-var("viewport", "max-width")};
|
|
14
14
|
height: #{sass.fn-naming-var("viewport", "height")};
|
|
15
15
|
max-height: #{sass.fn-naming-var("viewport", "max-height")};
|
|
16
|
-
background-color:
|
|
17
|
-
color:
|
|
16
|
+
background-color: rgba(#{$app-background-color});
|
|
17
|
+
color: rgba(#{$app-color});
|
|
18
18
|
transition:
|
|
19
19
|
background-color #{$transition-duration} ease,
|
|
20
20
|
color #{$transition-duration} ease,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<style lang="scss" src="./app.scss" scoped></style>
|
|
2
2
|
<template src="./app.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../utils";
|
|
5
5
|
import { computed, provide, toRefs } from "vue";
|
|
6
6
|
import { Toast } from "../toast";
|
|
7
7
|
import { Action, useAction } from "../action";
|
|
@@ -30,10 +30,10 @@ const action = useAction();
|
|
|
30
30
|
const appAttrs = computed(() => {
|
|
31
31
|
return {
|
|
32
32
|
class: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
cssPrefix("app"),
|
|
34
|
+
cssPrefix(["layer", "app"]),
|
|
35
|
+
cssPrefix(["shape", shape.value]),
|
|
36
|
+
cssPrefix(["size", props.size]),
|
|
37
37
|
],
|
|
38
38
|
};
|
|
39
39
|
});
|
|
@@ -19,12 +19,13 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
19
19
|
.#{$avatar} {
|
|
20
20
|
position: relative;
|
|
21
21
|
overflow: hidden;
|
|
22
|
-
background-color:
|
|
22
|
+
background-color: rgba(#{$avatar-background-color});
|
|
23
23
|
width: #{$width};
|
|
24
24
|
aspect-ratio: 1/1;
|
|
25
25
|
border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
26
26
|
background-repeat: no-repeat;
|
|
27
27
|
background-size: cover;
|
|
28
|
+
background-position: center;
|
|
28
29
|
transition:
|
|
29
30
|
background-color #{$transition-duration} ease,
|
|
30
31
|
color #{$transition-duration} ease,
|
|
@@ -39,6 +40,6 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
&.divider {
|
|
42
|
-
border: #{$border-width} solid
|
|
43
|
+
border: #{$border-width} solid rgba(#{$avatar-border-color});
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
5
|
import { type AvatarProps } from "./avatar.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssProperty, cssPrefix } from "../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -27,16 +27,16 @@ const avatarAttrs = computed(() => {
|
|
|
27
27
|
|
|
28
28
|
return {
|
|
29
29
|
class: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
cssPrefix(["layer", "avatar"]),
|
|
31
|
+
cssPrefix(["role", role]),
|
|
32
|
+
cssPrefix(["shape", shape]),
|
|
33
|
+
cssPrefix("avatar"),
|
|
34
34
|
{
|
|
35
35
|
divider: divider,
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
38
|
style: {
|
|
39
|
-
[
|
|
39
|
+
[cssProperty("width")]: size,
|
|
40
40
|
backgroundImage: backgroundImage,
|
|
41
41
|
},
|
|
42
42
|
};
|
|
@@ -41,9 +41,9 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
position: relative;
|
|
43
43
|
overflow: hidden;
|
|
44
|
-
color:
|
|
45
|
-
background:
|
|
46
|
-
border-color:
|
|
44
|
+
color: rgba(#{$button-color});
|
|
45
|
+
background: rgba(#{$button-background-color});
|
|
46
|
+
border-color: rgba(#{$button-border-color});
|
|
47
47
|
border-style: solid;
|
|
48
48
|
border-width: #{$border-width};
|
|
49
49
|
white-space: nowrap;
|
|
@@ -63,31 +63,31 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
63
63
|
line-height: #{$size-line-height};
|
|
64
64
|
|
|
65
65
|
&:hover {
|
|
66
|
-
border-color:
|
|
67
|
-
background-color:
|
|
66
|
+
border-color: rgba(#{$button-border-color-hover});
|
|
67
|
+
background-color: rgba(#{$button-background-color-hover});
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&.focus,
|
|
71
71
|
&:focus {
|
|
72
|
-
border-color:
|
|
73
|
-
background-color:
|
|
72
|
+
border-color: rgba(#{$button-border-color-focus});
|
|
73
|
+
background-color: rgba(#{$button-background-color-focus});
|
|
74
74
|
|
|
75
75
|
&.shadow {
|
|
76
|
-
box-shadow: 0 0 0 0.25rem
|
|
76
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$button-box-shadow-color-focus}, 0.25);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
&:active,
|
|
81
81
|
&.active {
|
|
82
|
-
border-color:
|
|
83
|
-
background-color:
|
|
82
|
+
border-color: rgba(#{$button-border-color-active});
|
|
83
|
+
background-color: rgba(#{$button-background-color-active});
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
&:disabled,
|
|
87
87
|
&.disabled {
|
|
88
|
-
border-color:
|
|
89
|
-
background-color:
|
|
90
|
-
color:
|
|
88
|
+
border-color: rgba(#{$button-border-color-disabled});
|
|
89
|
+
background-color: rgba(#{$button-background-color-disabled});
|
|
90
|
+
color: rgba(#{$button-color-disabled});
|
|
91
91
|
cursor: not-allowed;
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, ref } from "vue";
|
|
5
5
|
import { type ButtonProps } from "./button.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -30,11 +30,11 @@ const buttonAttrs = computed(() => {
|
|
|
30
30
|
|
|
31
31
|
return {
|
|
32
32
|
class: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
cssPrefix(["layer", "button"]),
|
|
34
|
+
cssPrefix(["role", role]),
|
|
35
|
+
cssPrefix(["shape", shape]),
|
|
36
|
+
cssPrefix("button"),
|
|
37
|
+
cssPrefix(["size", props.size]),
|
|
38
38
|
props.variant,
|
|
39
39
|
{
|
|
40
40
|
block: props.block,
|
|
@@ -46,7 +46,7 @@ const buttonAttrs = computed(() => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const loaderAttrs = {
|
|
49
|
-
class: [
|
|
49
|
+
class: [cssPrefix("loader")],
|
|
50
50
|
} as const;
|
|
51
51
|
|
|
52
52
|
// Methods
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, provide, toRefs } from "vue";
|
|
5
5
|
import { type CableProviderState, type CableProps } from "./cable.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../utils";
|
|
7
7
|
import { CABLE_PROVIDER_STATE_KEY } from "./cable.constants";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -21,7 +21,7 @@ const { placement } = toRefs(props);
|
|
|
21
21
|
// ----------------------------------------------------------------------------
|
|
22
22
|
const cableAttrs = computed(() => {
|
|
23
23
|
return {
|
|
24
|
-
class: [
|
|
24
|
+
class: [cssPrefix(["layer", "cable"]), cssPrefix("cable"), placement.value],
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -13,8 +13,8 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
13
13
|
$border-radius: calc(#{$radius-size} * #{$radius-ratio});
|
|
14
14
|
|
|
15
15
|
.#{$card} {
|
|
16
|
-
background-color:
|
|
17
|
-
color:
|
|
16
|
+
background-color: rgba(#{$card-background-color});
|
|
17
|
+
color: rgba(#{$card-color});
|
|
18
18
|
border-radius: #{$border-radius};
|
|
19
19
|
transition:
|
|
20
20
|
box-shadow #{$transition-duration} ease,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, provide } from "vue";
|
|
5
5
|
import { type CardProps, type CardProviderState } from "./card.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../../app";
|
|
8
8
|
import { CARD_PROVIDER_STATE_KEY } from "./card.constants";
|
|
9
9
|
|
|
@@ -33,10 +33,10 @@ const role = computed(() => {
|
|
|
33
33
|
const cardAttrs = computed(() => {
|
|
34
34
|
return {
|
|
35
35
|
class: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
cssPrefix(["layer", "card"]),
|
|
37
|
+
cssPrefix(["role", role.value]),
|
|
38
|
+
cssPrefix(["shape", shape.value]),
|
|
39
|
+
cssPrefix("card"),
|
|
40
40
|
{
|
|
41
41
|
divider: divider.value,
|
|
42
42
|
},
|
|
@@ -11,8 +11,8 @@ $padding-x: sass.fn-naming-var("spacing", "x");
|
|
|
11
11
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
12
12
|
|
|
13
13
|
.#{$card-body} {
|
|
14
|
-
background-color:
|
|
15
|
-
color:
|
|
14
|
+
background-color: rgba(#{$card-background-color});
|
|
15
|
+
color: rgba(#{$card-color});
|
|
16
16
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
17
17
|
transition:
|
|
18
18
|
box-shadow #{$transition-duration} ease,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<style lang="scss" src="./card-body.scss"></style>
|
|
2
2
|
<template src="./card-body.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../../utils";
|
|
5
5
|
|
|
6
6
|
const cardBodyAttrs = {
|
|
7
|
-
class: [
|
|
7
|
+
class: [cssPrefix("card-body")],
|
|
8
8
|
} as const;
|
|
9
9
|
</script>
|
|
@@ -15,8 +15,8 @@ $border: #{$border-width} solid transparent;
|
|
|
15
15
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
16
16
|
|
|
17
17
|
.#{$card-footer} {
|
|
18
|
-
background-color:
|
|
19
|
-
color:
|
|
18
|
+
background-color: rgba(#{$card-background-color});
|
|
19
|
+
color: rgba(#{$card-color});
|
|
20
20
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
21
21
|
border-top: #{$border};
|
|
22
22
|
transition:
|
|
@@ -27,6 +27,6 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
27
27
|
border-radius #{$transition-duration} ease;
|
|
28
28
|
|
|
29
29
|
&.divider {
|
|
30
|
-
border-color:
|
|
30
|
+
border-color: rgba(#{$card-border-color});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./card-footer.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix } from "../../../utils";
|
|
6
6
|
import { type CardProviderState, CARD_PROVIDER_STATE_KEY } from "../card";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
@@ -15,7 +15,7 @@ const cardFooterAttrs = computed(() => {
|
|
|
15
15
|
const divider = cardProviderState?.divider.value ?? false;
|
|
16
16
|
return {
|
|
17
17
|
class: [
|
|
18
|
-
|
|
18
|
+
cssPrefix("card-footer"),
|
|
19
19
|
{
|
|
20
20
|
divider,
|
|
21
21
|
},
|
|
@@ -15,8 +15,8 @@ $border: #{$border-width} solid transparent;
|
|
|
15
15
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
16
16
|
|
|
17
17
|
.#{$card-header} {
|
|
18
|
-
background-color:
|
|
19
|
-
color:
|
|
18
|
+
background-color: rgba(#{$card-background-color});
|
|
19
|
+
color: rgba(#{$card-color});
|
|
20
20
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
21
21
|
border-bottom: #{$border};
|
|
22
22
|
transition:
|
|
@@ -27,6 +27,6 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
27
27
|
border-radius #{$transition-duration} ease;
|
|
28
28
|
|
|
29
29
|
&.divider {
|
|
30
|
-
border-color:
|
|
30
|
+
border-color: rgba(#{$card-border-color});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./card-header.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix } from "../../../utils";
|
|
6
6
|
import { type CardProviderState, CARD_PROVIDER_STATE_KEY } from "../card";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
@@ -15,7 +15,7 @@ const cardHeaderAttrs = computed(() => {
|
|
|
15
15
|
const divider = cardProviderState?.divider.value ?? false;
|
|
16
16
|
return {
|
|
17
17
|
class: [
|
|
18
|
-
|
|
18
|
+
cssPrefix("card-header"),
|
|
19
19
|
{
|
|
20
20
|
divider,
|
|
21
21
|
},
|
|
@@ -17,7 +17,11 @@ $checkbox-background-color-unchecked: sass.fn-naming-var(
|
|
|
17
17
|
$checkbox-background-color-checked: sass.fn-naming-var("checkbox", "background-color", "checked");
|
|
18
18
|
$checkbox-background-color-disabled: sass.fn-naming-var("checkbox", "background-color", "disabled");
|
|
19
19
|
|
|
20
|
-
$checkbox-color: sass.fn-naming-var("checkbox", "color");
|
|
20
|
+
$checkbox-color-checked: sass.fn-naming-var("checkbox", "color", "checked");
|
|
21
|
+
$checkbox-color-unchecked: sass.fn-naming-var("checkbox", "color", "unchecked");
|
|
22
|
+
$checkbox-color-hover: sass.fn-naming-var("checkbox", "color", "hover");
|
|
23
|
+
$checkbox-color-focus: sass.fn-naming-var("checkbox", "color", "focus");
|
|
24
|
+
$checkbox-color-disabled: sass.fn-naming-var("checkbox", "color", "disabled");
|
|
21
25
|
|
|
22
26
|
$checkbox-border-color-hover: sass.fn-naming-var("checkbox", "border-color", "hover");
|
|
23
27
|
$checkbox-border-color-focus: sass.fn-naming-var("checkbox", "border-color", "focus");
|
|
@@ -49,7 +53,7 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
49
53
|
display: flex;
|
|
50
54
|
align-items: center;
|
|
51
55
|
justify-content: center;
|
|
52
|
-
border: 1px solid
|
|
56
|
+
border: 1px solid transparent;
|
|
53
57
|
background-color: transparent;
|
|
54
58
|
border-radius: #{$border-radius};
|
|
55
59
|
transition:
|
|
@@ -65,7 +69,7 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
65
69
|
content: "";
|
|
66
70
|
width: calc(#{$size-control-mark-size} * 0.2);
|
|
67
71
|
height: calc(#{$size-control-mark-size} * 0.5);
|
|
68
|
-
border: solid
|
|
72
|
+
border: solid rgba(#{$checkbox-color-unchecked});
|
|
69
73
|
border-width: 0 2px 2px 0;
|
|
70
74
|
transform: rotate(45deg) scale(0);
|
|
71
75
|
transform-origin: center;
|
|
@@ -81,12 +85,12 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
81
85
|
&:not(.on) {
|
|
82
86
|
.#{$checkbox-icon} {
|
|
83
87
|
background-color: transparent;
|
|
84
|
-
border-color:
|
|
88
|
+
border-color: rgba(#{$checkbox-border-color-unchecked});
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
&:not(.disabled):not(.readonly):hover {
|
|
88
92
|
.#{$checkbox-icon} {
|
|
89
|
-
border-color:
|
|
93
|
+
border-color: rgba(#{$checkbox-border-color-hover});
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
}
|
|
@@ -94,22 +98,23 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
94
98
|
&.on {
|
|
95
99
|
&.fill {
|
|
96
100
|
.#{$checkbox-icon} {
|
|
97
|
-
background-color:
|
|
98
|
-
border-color:
|
|
101
|
+
background-color: rgba(#{$checkbox-background-color-checked});
|
|
102
|
+
border-color: rgba(#{$checkbox-border-color-checked});
|
|
99
103
|
|
|
100
104
|
&::after {
|
|
101
105
|
transform: rotate(45deg) scale(1);
|
|
106
|
+
border-color: rgba(#{$checkbox-color-checked});
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
&.outline {
|
|
107
112
|
.#{$checkbox-icon} {
|
|
108
|
-
border-color:
|
|
113
|
+
border-color: rgba(#{$checkbox-border-color-checked});
|
|
109
114
|
|
|
110
115
|
&::after {
|
|
111
116
|
transform: rotate(45deg) scale(1);
|
|
112
|
-
border-color:
|
|
117
|
+
border-color: rgba(#{$checkbox-background-color-checked});
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
}
|
|
@@ -121,8 +126,8 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
121
126
|
|
|
122
127
|
&.on {
|
|
123
128
|
.#{$checkbox-icon} {
|
|
124
|
-
background-color:
|
|
125
|
-
border-color:
|
|
129
|
+
background-color: rgba(#{$checkbox-background-color-disabled});
|
|
130
|
+
border-color: rgba(#{$checkbox-border-color-disabled});
|
|
126
131
|
}
|
|
127
132
|
}
|
|
128
133
|
}
|
|
@@ -134,12 +139,12 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
134
139
|
&.focus {
|
|
135
140
|
&.shadow {
|
|
136
141
|
.#{$checkbox-icon} {
|
|
137
|
-
box-shadow: 0 0 0 0.25rem
|
|
142
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$checkbox-box-shadow-color-focus}, 0.25);
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
.#{$checkbox-icon} {
|
|
142
|
-
border-color:
|
|
147
|
+
border-color: rgba(#{$checkbox-border-color-focus});
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, ref } from "vue";
|
|
5
5
|
import type { CheckboxProps, CheckboxEmit } from "./checkbox.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -32,11 +32,11 @@ const checkboxAttrs = computed(() => {
|
|
|
32
32
|
const shadow = (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
|
|
33
33
|
return {
|
|
34
34
|
class: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
cssPrefix(["layer", "checkbox"]),
|
|
36
|
+
cssPrefix(["role", role]),
|
|
37
|
+
cssPrefix(["shape", shape]),
|
|
38
|
+
cssPrefix(["size", props.size]),
|
|
39
|
+
cssPrefix("checkbox"),
|
|
40
40
|
props.variant,
|
|
41
41
|
{
|
|
42
42
|
on: props.modelValue,
|
|
@@ -50,7 +50,7 @@ const checkboxAttrs = computed(() => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const checkboxIconAttrs = {
|
|
53
|
-
class: [
|
|
53
|
+
class: [cssPrefix("checkbox-icon")],
|
|
54
54
|
} as const;
|
|
55
55
|
|
|
56
56
|
// Methods
|
|
@@ -19,8 +19,8 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
19
19
|
|
|
20
20
|
// Collapse
|
|
21
21
|
.#{$collapse} {
|
|
22
|
-
background-color:
|
|
23
|
-
color:
|
|
22
|
+
background-color: rgba(#{$collapse-background-color});
|
|
23
|
+
color: rgba(#{$collapse-color});
|
|
24
24
|
transition:
|
|
25
25
|
background-color #{$transition-duration} ease,
|
|
26
26
|
color #{$transition-duration} ease;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, nextTick, onMounted, ref, watch } from "vue";
|
|
5
5
|
import type { CollapseEmit, CollapseProps } from "./collapse.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)
|
|
@@ -36,9 +36,9 @@ const durationCss = computed(() =>
|
|
|
36
36
|
const wrapperAttrs = computed(() => {
|
|
37
37
|
return {
|
|
38
38
|
class: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
cssPrefix(["layer", "collapse"]),
|
|
40
|
+
cssPrefix(["role", role.value]),
|
|
41
|
+
cssPrefix("collapse"),
|
|
42
42
|
{
|
|
43
43
|
open: isOpen.value,
|
|
44
44
|
disabled: props.disabled,
|
|
@@ -49,7 +49,7 @@ const wrapperAttrs = computed(() => {
|
|
|
49
49
|
|
|
50
50
|
const triggerAttrs = computed(() => {
|
|
51
51
|
return {
|
|
52
|
-
class: [
|
|
52
|
+
class: [cssPrefix("collapse-trigger")],
|
|
53
53
|
"aria-expanded": isOpen.value,
|
|
54
54
|
"aria-disabled": props.disabled,
|
|
55
55
|
};
|
|
@@ -57,15 +57,15 @@ const triggerAttrs = computed(() => {
|
|
|
57
57
|
|
|
58
58
|
const contentAttrs = computed(() => {
|
|
59
59
|
return {
|
|
60
|
-
class: [
|
|
60
|
+
class: [cssPrefix("collapse-content")],
|
|
61
61
|
style: {
|
|
62
|
-
[
|
|
63
|
-
[
|
|
62
|
+
[cssProperty("collapse-duration")]: durationCss.value || undefined,
|
|
63
|
+
[cssProperty("collapse-height")]: isOpen.value ? `${contentHeight.value}px` : "0px",
|
|
64
64
|
},
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
const contentInnerClass = computed(() =>
|
|
68
|
+
const contentInnerClass = computed(() => cssPrefix("collapse-content-inner"));
|
|
69
69
|
|
|
70
70
|
// Methods
|
|
71
71
|
// ----------------------------------------------------------------------------
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<style lang="scss" src="./container.scss" scoped></style>
|
|
2
2
|
<template src="./container.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../utils";
|
|
5
5
|
|
|
6
6
|
// Static layout wrapper classes
|
|
7
7
|
const containerAttrs = {
|
|
8
|
-
class: [
|
|
8
|
+
class: [cssPrefix("container")],
|
|
9
9
|
} as const;
|
|
10
10
|
</script>
|