@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
|
@@ -9,9 +9,9 @@ $button: sass.fn-naming-prefix("button");
|
|
|
9
9
|
$shape-pill: sass.fn-naming-prefix("shape-pill");
|
|
10
10
|
|
|
11
11
|
// Property name - layer: decision-modal
|
|
12
|
-
$decision-modal-background-color: sass.fn-naming-var("
|
|
13
|
-
$decision-modal-border-color: sass.fn-naming-var("
|
|
14
|
-
$decision-modal-color: sass.fn-naming-var("
|
|
12
|
+
$decision-modal-background-color: sass.fn-naming-var("modal", "background-color");
|
|
13
|
+
$decision-modal-border-color: sass.fn-naming-var("modal", "border-color");
|
|
14
|
+
$decision-modal-color: sass.fn-naming-var("modal", "color");
|
|
15
15
|
|
|
16
16
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
17
17
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
@@ -28,8 +28,8 @@ $border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
|
28
28
|
|
|
29
29
|
.#{$decision-modal} {
|
|
30
30
|
// Styles
|
|
31
|
-
background-color:
|
|
32
|
-
color:
|
|
31
|
+
background-color: rgba(#{$decision-modal-background-color});
|
|
32
|
+
color: rgba(#{$decision-modal-color});
|
|
33
33
|
width: #{$width};
|
|
34
34
|
max-width: #{$max-width};
|
|
35
35
|
overflow: hidden;
|
|
@@ -51,7 +51,7 @@ $border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
|
51
51
|
align-items: center;
|
|
52
52
|
font-weight: 600;
|
|
53
53
|
border-bottom: #{$border-width} solid transparent;
|
|
54
|
-
color:
|
|
54
|
+
color: rgba(#{$decision-modal-color});
|
|
55
55
|
transition:
|
|
56
56
|
box-shadow #{$transition-duration} ease,
|
|
57
57
|
border-color #{$transition-duration} ease,
|
|
@@ -63,14 +63,14 @@ $border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
|
63
63
|
// Content of alert
|
|
64
64
|
.#{$decision-modal-body} {
|
|
65
65
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
66
|
-
color:
|
|
66
|
+
color: rgba(#{$decision-modal-color});
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Footer of alert
|
|
70
70
|
.#{$decision-modal-footer} {
|
|
71
71
|
display: flex;
|
|
72
72
|
border-top: #{$border-width} solid transparent;
|
|
73
|
-
color:
|
|
73
|
+
color: rgba(#{$decision-modal-color});
|
|
74
74
|
transition:
|
|
75
75
|
box-shadow #{$transition-duration} ease,
|
|
76
76
|
border-color #{$transition-duration} ease,
|
|
@@ -111,7 +111,7 @@ $border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
|
111
111
|
&.divider {
|
|
112
112
|
.#{$decision-modal-header},
|
|
113
113
|
.#{$decision-modal-footer} {
|
|
114
|
-
border-color:
|
|
114
|
+
border-color: rgba(#{$decision-modal-border-color});
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type DecisionModalButton,
|
|
10
10
|
type DecisionModalProps,
|
|
11
11
|
} from "./decision-modal.type";
|
|
12
|
-
import {
|
|
12
|
+
import { cssPrefix } from "../../utils";
|
|
13
13
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
14
14
|
|
|
15
15
|
// Component setup (props, emits, injects)
|
|
@@ -45,10 +45,10 @@ const decisionModalAttrs = computed(() => {
|
|
|
45
45
|
|
|
46
46
|
return {
|
|
47
47
|
class: [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
cssPrefix(["layer", "modal"]),
|
|
49
|
+
cssPrefix(["role", role]),
|
|
50
|
+
cssPrefix(["shape", shape.value]),
|
|
51
|
+
cssPrefix("decision-modal"),
|
|
52
52
|
{
|
|
53
53
|
pop: pop.value,
|
|
54
54
|
divider: divider.value,
|
|
@@ -59,19 +59,19 @@ const decisionModalAttrs = computed(() => {
|
|
|
59
59
|
|
|
60
60
|
const decisionModalHeaderAttrs = computed(() => {
|
|
61
61
|
return {
|
|
62
|
-
class: [
|
|
62
|
+
class: [cssPrefix("decision-modal-header")],
|
|
63
63
|
};
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
const decisionModalBodyAttrs = computed(() => {
|
|
67
67
|
return {
|
|
68
|
-
class: [
|
|
68
|
+
class: [cssPrefix("decision-modal-body")],
|
|
69
69
|
};
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
const decisionModalFooterAttrs = computed(() => {
|
|
73
73
|
return {
|
|
74
|
-
class: [
|
|
74
|
+
class: [cssPrefix("decision-modal-footer"), `actions-flow-${props.flow}`],
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
|
|
@@ -19,11 +19,11 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
19
19
|
|
|
20
20
|
&.horizontal {
|
|
21
21
|
width: 100%;
|
|
22
|
-
border-bottom: #{$border-width} solid
|
|
22
|
+
border-bottom: #{$border-width} solid rgba(#{$divider-border-color});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&.vertical {
|
|
26
26
|
height: 100%;
|
|
27
|
-
border-right: #{$border-width} solid
|
|
27
|
+
border-right: #{$border-width} solid rgba(#{$divider-border-color});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<style lang="scss" src="./divider.scss" scoped></style>
|
|
2
2
|
<template src="./divider.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../utils";
|
|
5
5
|
import { type DividerProps } from "./divider.type";
|
|
6
6
|
import { computed, inject } from "vue";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
@@ -19,9 +19,9 @@ const dividerAttrs = computed(() => {
|
|
|
19
19
|
const role = props.role || appState?.role.value || "";
|
|
20
20
|
return {
|
|
21
21
|
class: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
cssPrefix(["layer", "divider"]),
|
|
23
|
+
cssPrefix(["role", role]),
|
|
24
|
+
cssPrefix("divider"),
|
|
25
25
|
{
|
|
26
26
|
[props.direction]: true,
|
|
27
27
|
},
|
|
@@ -34,9 +34,9 @@ $radius-size: sass.fn-naming-var("radius-size");
|
|
|
34
34
|
border-width: #{$border-width};
|
|
35
35
|
margin: #{$spacing-y} 0;
|
|
36
36
|
border-style: solid;
|
|
37
|
-
border-color:
|
|
38
|
-
background-color:
|
|
39
|
-
color:
|
|
37
|
+
border-color: rgba(#{$dropdown-border-color});
|
|
38
|
+
background-color: rgba(#{$dropdown-background-color});
|
|
39
|
+
color: rgba(#{$dropdown-color});
|
|
40
40
|
font-size: #{$size-font-size};
|
|
41
41
|
line-height: #{$size-line-height};
|
|
42
42
|
max-height: min(50vh, 16rem);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, onMounted, onUnmounted, ref, watch } from "vue";
|
|
5
5
|
import type { DropdownEmit, DropdownProps } from "./dropdown.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)
|
|
@@ -35,11 +35,11 @@ const wrapperAttrs = computed(() => {
|
|
|
35
35
|
|
|
36
36
|
return {
|
|
37
37
|
class: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
cssPrefix(["layer", "dropdown"]),
|
|
39
|
+
cssPrefix(["role", role]),
|
|
40
|
+
cssPrefix(["shape", shape]),
|
|
41
|
+
cssPrefix(["size", props.size]),
|
|
42
|
+
cssPrefix("dropdown"),
|
|
43
43
|
{
|
|
44
44
|
open: isOpen.value,
|
|
45
45
|
disabled: props.disabled,
|
|
@@ -50,10 +50,8 @@ const wrapperAttrs = computed(() => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const panelAttrs = computed(() => {
|
|
53
|
-
const shape = props.shape ?? appState?.shape.value ?? "";
|
|
54
|
-
|
|
55
53
|
return {
|
|
56
|
-
class: [
|
|
54
|
+
class: [cssPrefix("dropdown-panel"), props.placement],
|
|
57
55
|
};
|
|
58
56
|
});
|
|
59
57
|
|
|
@@ -7,7 +7,7 @@ export type FieldType = "text" | "number" | "email" | "password" | "tel" | "url"
|
|
|
7
7
|
// Type definitions
|
|
8
8
|
export type FieldProps = {
|
|
9
9
|
// Wrapper
|
|
10
|
-
modelValue?: string;
|
|
10
|
+
modelValue?: string | number;
|
|
11
11
|
name?: string;
|
|
12
12
|
variant?: FieldVariant;
|
|
13
13
|
role?: string;
|
|
@@ -18,7 +18,7 @@ export type FieldProps = {
|
|
|
18
18
|
|
|
19
19
|
// Input
|
|
20
20
|
id?: string;
|
|
21
|
-
value?: string;
|
|
21
|
+
value?: string | number;
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
readonly?: boolean;
|
|
@@ -11,13 +11,15 @@ $field-help: sass.fn-naming-prefix("field-help");
|
|
|
11
11
|
// Property name - layer: field
|
|
12
12
|
$field-border-color: sass.fn-naming-var("field", "border-color");
|
|
13
13
|
$field-background-color: sass.fn-naming-var("field", "background-color");
|
|
14
|
+
$field-color: sass.fn-naming-var("field", "color");
|
|
15
|
+
$field-placeholder-color: sass.fn-naming-var("field", "placeholder-color");
|
|
16
|
+
$field-help-color: sass.fn-naming-var("field", "help-color");
|
|
14
17
|
$field-line: sass.fn-naming-var("field", "line");
|
|
15
18
|
$field-max-line: sass.fn-naming-var("field", "max-line");
|
|
16
19
|
|
|
17
20
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
18
21
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
19
22
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
20
|
-
$app-color: sass.fn-naming-var("app", "color");
|
|
21
23
|
|
|
22
24
|
$spacing-x: sass.fn-naming-var("spacing", "x");
|
|
23
25
|
$spacing-y: sass.fn-naming-var("spacing", "y");
|
|
@@ -45,7 +47,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
45
47
|
background-color #{$transition-duration} ease,
|
|
46
48
|
color #{$transition-duration} ease,
|
|
47
49
|
border-radius #{$transition-duration} ease;
|
|
48
|
-
border-color:
|
|
50
|
+
border-color: rgba(#{$field-border-color});
|
|
49
51
|
border-radius: calc(min(#{$size-control-block-size}, #{$radius-size}) * #{$radius-ratio});
|
|
50
52
|
border-width: #{$border-width};
|
|
51
53
|
border-style: solid;
|
|
@@ -86,7 +88,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
&::placeholder {
|
|
89
|
-
color: rgba(#{$
|
|
91
|
+
color: rgba(#{$field-placeholder-color});
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -102,8 +104,8 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
102
104
|
box-sizing: border-box;
|
|
103
105
|
width: 100%;
|
|
104
106
|
flex: 1;
|
|
105
|
-
color:
|
|
106
|
-
caret-color:
|
|
107
|
+
color: rgba(#{$field-color});
|
|
108
|
+
caret-color: rgba(#{$field-color});
|
|
107
109
|
border: none;
|
|
108
110
|
-webkit-user-select: text;
|
|
109
111
|
user-select: text;
|
|
@@ -136,7 +138,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
&::placeholder {
|
|
139
|
-
color: rgba(#{$
|
|
141
|
+
color: rgba(#{$field-placeholder-color});
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
|
|
@@ -148,8 +150,8 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
148
150
|
position: relative;
|
|
149
151
|
z-index: 2;
|
|
150
152
|
background-color: transparent;
|
|
151
|
-
color:
|
|
152
|
-
caret-color:
|
|
153
|
+
color: rgba(#{$field-color});
|
|
154
|
+
caret-color: rgba(#{$field-color});
|
|
153
155
|
border: none;
|
|
154
156
|
// user-select:all breaks caret placement on many mobile browsers for contenteditable.
|
|
155
157
|
-webkit-user-select: text;
|
|
@@ -170,7 +172,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
170
172
|
|
|
171
173
|
// Message
|
|
172
174
|
.#{$field-message} {
|
|
173
|
-
color:
|
|
175
|
+
color: rgba(#{$field-background-color});
|
|
174
176
|
font-size: 0.9em;
|
|
175
177
|
line-height: 1.5;
|
|
176
178
|
transition:
|
|
@@ -183,7 +185,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
183
185
|
|
|
184
186
|
// Help
|
|
185
187
|
.#{$field-help} {
|
|
186
|
-
color:
|
|
188
|
+
color: rgba(#{$field-help-color});
|
|
187
189
|
font-size: 0.8em;
|
|
188
190
|
line-height: 1.5;
|
|
189
191
|
transition:
|
|
@@ -197,13 +199,13 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
197
199
|
&.focus {
|
|
198
200
|
&.shadow {
|
|
199
201
|
.#{$field-content} {
|
|
200
|
-
box-shadow: 0 0 0 0.25rem
|
|
202
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$field-border-color}, 0.25);
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
&:not(.shadow) {
|
|
205
207
|
.#{$field-content} {
|
|
206
|
-
box-shadow: 0 0 0 calc(#{$border-width} * 1.5)
|
|
208
|
+
box-shadow: 0 0 0 calc(#{$border-width} * 1.5) rgba(#{$field-border-color});
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
211
|
}
|
|
@@ -224,7 +226,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
224
226
|
div.#{$field-input} {
|
|
225
227
|
&::before {
|
|
226
228
|
content: attr(placeholder);
|
|
227
|
-
color: rgba(#{$
|
|
229
|
+
color: rgba(#{$field-placeholder-color});
|
|
228
230
|
transition: color #{$transition-duration} ease;
|
|
229
231
|
position: absolute;
|
|
230
232
|
height: calc(#{$size-control-block-size} - #{$border-width} * 2);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
|
5
5
|
import type { FieldProps, FieldEmit } from "../field.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssProperty, cssPrefix } from "../../../utils";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
9
9
|
// ----------------------------------------------------------------------------
|
|
@@ -32,49 +32,57 @@ const isComposing = ref(false);
|
|
|
32
32
|
// Computed properties
|
|
33
33
|
// ----------------------------------------------------------------------------
|
|
34
34
|
const content = computed(() => {
|
|
35
|
-
|
|
35
|
+
if (props.value !== undefined && props.value !== null) {
|
|
36
|
+
return props.value;
|
|
37
|
+
}
|
|
38
|
+
return props.modelValue ?? "";
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const isContentEmpty = computed(() => {
|
|
42
|
+
const v = content.value;
|
|
43
|
+
return v === "" || v === undefined || v === null;
|
|
36
44
|
});
|
|
37
45
|
|
|
38
46
|
const fieldAttrs = computed(() => {
|
|
39
47
|
return {
|
|
40
48
|
class: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
cssPrefix(["layer", "field"]),
|
|
50
|
+
cssPrefix(["role", props.role || ""]),
|
|
51
|
+
cssPrefix(["shape", props.shape || ""]),
|
|
52
|
+
cssPrefix("field"),
|
|
53
|
+
cssPrefix(["size", props.size]),
|
|
54
|
+
cssPrefix(["direction", props.direction || "left"]),
|
|
47
55
|
props.variant,
|
|
48
56
|
props.type,
|
|
49
57
|
{
|
|
50
58
|
disabled: props.disabled,
|
|
51
59
|
focus: isFocus.value,
|
|
52
60
|
shadow: props.shadow,
|
|
53
|
-
empty:
|
|
61
|
+
empty: isContentEmpty.value,
|
|
54
62
|
readonly: props.readonly,
|
|
55
63
|
typing: isComposing.value,
|
|
56
64
|
},
|
|
57
65
|
],
|
|
58
66
|
style: {
|
|
59
|
-
[
|
|
60
|
-
[
|
|
67
|
+
[cssProperty(["field", "line"])]: props.line,
|
|
68
|
+
[cssProperty(["field", "max-line"])]: props.maxLine || props.line,
|
|
61
69
|
},
|
|
62
70
|
};
|
|
63
71
|
});
|
|
64
72
|
|
|
65
73
|
const fieldContentAttrs = computed(() => ({
|
|
66
|
-
class: [
|
|
74
|
+
class: [cssPrefix("field-content")],
|
|
67
75
|
}));
|
|
68
76
|
|
|
69
77
|
/** Outer shell: layout, placeholder pseudo-element (must stay off the contenteditable node on iOS). */
|
|
70
78
|
const fieldInputShellAttrs = computed(() => ({
|
|
71
|
-
class: [
|
|
79
|
+
class: [cssPrefix("field-input")],
|
|
72
80
|
placeholder: props.placeholder,
|
|
73
81
|
}));
|
|
74
82
|
|
|
75
83
|
/** contenteditable as the literal string "true"|"false" improves mobile WebKit behavior vs boolean. */
|
|
76
84
|
const fieldEditableAttrs = computed(() => ({
|
|
77
|
-
class: [
|
|
85
|
+
class: [cssPrefix("field-input-editable")],
|
|
78
86
|
name: props.name,
|
|
79
87
|
id: props.id,
|
|
80
88
|
contenteditable:
|
|
@@ -84,7 +92,7 @@ const fieldEditableAttrs = computed(() => ({
|
|
|
84
92
|
}));
|
|
85
93
|
|
|
86
94
|
const fieldPasswordInputAttrs = computed(() => ({
|
|
87
|
-
class: [
|
|
95
|
+
class: [cssPrefix("field-input")],
|
|
88
96
|
name: props.name,
|
|
89
97
|
id: props.id,
|
|
90
98
|
placeholder: props.placeholder,
|
|
@@ -95,11 +103,11 @@ const fieldPasswordInputAttrs = computed(() => ({
|
|
|
95
103
|
}));
|
|
96
104
|
|
|
97
105
|
const fieldMessageAttrs = computed(() => ({
|
|
98
|
-
class: [
|
|
106
|
+
class: [cssPrefix("field-message")],
|
|
99
107
|
}));
|
|
100
108
|
|
|
101
109
|
const fieldHelpAttrs = computed(() => ({
|
|
102
|
-
class: [
|
|
110
|
+
class: [cssPrefix("field-help")],
|
|
103
111
|
}));
|
|
104
112
|
|
|
105
113
|
// Methods
|
|
@@ -235,7 +243,7 @@ const syncContentFromModel = async () => {
|
|
|
235
243
|
if (!el || props.type === "password") return;
|
|
236
244
|
if (isComposing.value) return;
|
|
237
245
|
|
|
238
|
-
const next = normalizeText(content.value ?? "");
|
|
246
|
+
const next = normalizeText(content.value.toString() ?? "");
|
|
239
247
|
const current = normalizeText(el.innerText);
|
|
240
248
|
if (current === next) return;
|
|
241
249
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<style lang="scss" src="./form-group.scss" scoped></style>
|
|
2
2
|
<template src="./form-group.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../utils";
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
import { type FormGroupProps } from "./form-group.type";
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<FormGroupProps>(), {
|
|
|
15
15
|
// ----------------------------------------------------------------------------
|
|
16
16
|
const formGroupAttrs = computed(() => {
|
|
17
17
|
return {
|
|
18
|
-
class: [
|
|
18
|
+
class: [cssPrefix("form-group"), props.direction],
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
</script>
|
|
@@ -10,7 +10,7 @@ $radius-size: sass.fn-naming-var("radius-size");
|
|
|
10
10
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
11
11
|
|
|
12
12
|
.#{$gesture-indicator} {
|
|
13
|
-
background-color:
|
|
13
|
+
background-color: rgba(#{$gesture-indicator-border-color});
|
|
14
14
|
transition:
|
|
15
15
|
box-shadow #{$transition-duration} ease,
|
|
16
16
|
border-color #{$transition-duration} ease,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<style lang="scss" src="./gesture-indicator.scss" scoped></style>
|
|
2
2
|
<template src="./gesture-indicator.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../utils";
|
|
5
5
|
import { type GestureIndicatorProps } from "./gesture-indicator.type";
|
|
6
6
|
import { computed, inject } from "vue";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
@@ -21,9 +21,9 @@ const gestureIndicatorAttrs = computed(() => {
|
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
23
|
class: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
cssPrefix(["layer", "gesture-indicator"]),
|
|
25
|
+
cssPrefix(["role", role]),
|
|
26
|
+
cssPrefix("gesture-indicator"),
|
|
27
27
|
props.placement,
|
|
28
28
|
],
|
|
29
29
|
};
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
<template src="./image.html"></template>
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import { ref } from "vue";
|
|
3
|
+
import { ref, watch } from "vue";
|
|
4
4
|
import { type ImageProps } from "./image.type";
|
|
5
5
|
|
|
6
6
|
// Component setup (props, emits, injects)
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
|
-
const
|
|
8
|
+
const props = defineProps<ImageProps>();
|
|
9
9
|
|
|
10
10
|
// Reactive state
|
|
11
11
|
// ----------------------------------------------------------------------------
|
|
12
12
|
// Initialize from src to avoid an empty src flash before mount
|
|
13
|
-
const dataSrc = ref<string>(src ?? "");
|
|
13
|
+
const dataSrc = ref<string>(props.src ?? "");
|
|
14
14
|
|
|
15
15
|
// Methods
|
|
16
16
|
// ----------------------------------------------------------------------------
|
|
17
17
|
const handleError = () => {
|
|
18
|
-
if (defaultSrc) {
|
|
19
|
-
dataSrc.value = defaultSrc;
|
|
18
|
+
if (props.defaultSrc) {
|
|
19
|
+
dataSrc.value = props.defaultSrc;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
watch(
|
|
24
|
+
() => props.src,
|
|
25
|
+
(newVal) => {
|
|
26
|
+
dataSrc.value = newVal ?? "";
|
|
27
|
+
}
|
|
28
|
+
);
|
|
22
29
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./flex.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix, cssProperty } from "../../../utils";
|
|
6
6
|
import type { FlexProps } from "./flex.type";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
@@ -16,18 +16,18 @@ const props = withDefaults(defineProps<FlexProps>(), {
|
|
|
16
16
|
const flexAttrs = computed(() => {
|
|
17
17
|
const style = props.options.map((option) => {
|
|
18
18
|
return {
|
|
19
|
-
[
|
|
19
|
+
[cssProperty(["flex", "gap", option?.breakpoint || ""])]:
|
|
20
20
|
typeof option.gap === "number" ? `${option.gap}px` : option.gap,
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
21
|
+
[cssProperty(["flex", "direction", option?.breakpoint || ""])]: option.direction,
|
|
22
|
+
[cssProperty(["flex", "wrap", option?.breakpoint || ""])]: option.wrap,
|
|
23
|
+
[cssProperty(["flex", "justify", option?.breakpoint || ""])]: option.justify,
|
|
24
|
+
[cssProperty(["flex", "align", option?.breakpoint || ""])]: option.align,
|
|
25
|
+
[cssProperty(["flex", "align-content", option?.breakpoint || ""])]: option.alignContent,
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
return {
|
|
30
|
-
class: [
|
|
30
|
+
class: [cssPrefix("flex")],
|
|
31
31
|
style,
|
|
32
32
|
};
|
|
33
33
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./flex-item.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix, cssProperty } from "../../../utils";
|
|
6
6
|
import type { FlexItemProps } from "./flex-item.type";
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(defineProps<FlexItemProps>(), {
|
|
@@ -12,15 +12,15 @@ const props = withDefaults(defineProps<FlexItemProps>(), {
|
|
|
12
12
|
const flexItemAttrs = computed(() => {
|
|
13
13
|
const style = props.options.map((option) => {
|
|
14
14
|
return {
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
15
|
+
[cssProperty(["flex-item", "grow", option?.breakpoint || ""])]: option.grow,
|
|
16
|
+
[cssProperty(["flex-item", "shrink", option?.breakpoint || ""])]: option.shrink,
|
|
17
|
+
[cssProperty(["flex-item", "basis", option?.breakpoint || ""])]: option.basis,
|
|
18
|
+
[cssProperty(["flex-item", "order", option?.breakpoint || ""])]: option.order,
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
|
-
class: [
|
|
23
|
+
class: [cssPrefix("flex-item")],
|
|
24
24
|
style,
|
|
25
25
|
};
|
|
26
26
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./grid.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix, cssProperty } from "../../../utils";
|
|
6
6
|
import type { GridProps } from "./grid.type";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
@@ -16,16 +16,16 @@ const props = withDefaults(defineProps<GridProps>(), {
|
|
|
16
16
|
const gridAttrs = computed(() => {
|
|
17
17
|
const style = props.options.map((option) => {
|
|
18
18
|
return {
|
|
19
|
-
[
|
|
19
|
+
[cssProperty(["grid", "gap", option?.breakpoint || ""])]:
|
|
20
20
|
typeof option.gap === "number" ? `${option.gap}px` : option.gap,
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
21
|
+
[cssProperty(["grid", "columns", option?.breakpoint || ""])]: option.columns,
|
|
22
|
+
[cssProperty(["grid", "rows", option?.breakpoint || ""])]: option.rows,
|
|
23
|
+
[cssProperty(["grid", "auto-flow", option?.breakpoint || ""])]: option.autoFlow,
|
|
24
24
|
};
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
return {
|
|
28
|
-
class: [
|
|
28
|
+
class: [cssPrefix("grid")],
|
|
29
29
|
style,
|
|
30
30
|
};
|
|
31
31
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./grid-item.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix, cssProperty } from "../../../utils";
|
|
6
6
|
import type { GridItemProps } from "./grid-item.type";
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(defineProps<GridItemProps>(), {
|
|
@@ -12,15 +12,15 @@ const props = withDefaults(defineProps<GridItemProps>(), {
|
|
|
12
12
|
const gridItemAttrs = computed(() => {
|
|
13
13
|
const style = props.options.map((option) => {
|
|
14
14
|
return {
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
15
|
+
[cssProperty(["grid-item", "row", option?.breakpoint || ""])]: option.row,
|
|
16
|
+
[cssProperty(["grid-item", "column", option?.breakpoint || ""])]: option.column,
|
|
17
|
+
[cssProperty(["grid-item", "justify", option?.breakpoint || ""])]: option.justify,
|
|
18
|
+
[cssProperty(["grid-item", "align", option?.breakpoint || ""])]: option.align,
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
|
-
class: [
|
|
23
|
+
class: [cssPrefix("grid-item")],
|
|
24
24
|
style,
|
|
25
25
|
};
|
|
26
26
|
});
|
|
@@ -19,7 +19,7 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
19
19
|
$border-radius: calc(min(#{$viewport-width}, #{$radius-size}) * #{$radius-ratio});
|
|
20
20
|
|
|
21
21
|
.#{$modal} {
|
|
22
|
-
background:
|
|
22
|
+
background: rgba(#{$modal-background-color});
|
|
23
23
|
transition:
|
|
24
24
|
box-shadow #{$transition-duration} ease,
|
|
25
25
|
border-color #{$transition-duration} ease,
|