@vuetify/nightly 3.4.0-alpha.1-dev.2023-10-19 → 3.4.0-alpha.1-dev.2023-10-21
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/CHANGELOG.md +7 -2
- package/dist/json/importMap-labs.json +24 -24
- package/dist/json/importMap.json +12 -12
- package/dist/json/web-types.json +1 -1
- package/dist/vuetify-labs.css +77 -88
- package/dist/vuetify-labs.esm.js +7 -6
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +7 -6
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +77 -88
- package/dist/vuetify.d.ts +10 -10
- package/dist/vuetify.esm.js +7 -6
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +7 -6
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +6 -6
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +7 -9
- package/lib/components/VAutocomplete/VAutocomplete.sass +10 -9
- package/lib/components/VAutocomplete/_variables.scss +3 -2
- package/lib/components/VCombobox/VCombobox.css +7 -9
- package/lib/components/VCombobox/VCombobox.sass +10 -9
- package/lib/components/VCombobox/_variables.scss +1 -0
- package/lib/components/VField/VField.css +32 -16
- package/lib/components/VField/VField.sass +11 -2
- package/lib/components/VField/_variables.scss +5 -3
- package/lib/components/VFileInput/VFileInput.css +6 -4
- package/lib/components/VFileInput/VFileInput.mjs +2 -1
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +10 -4
- package/lib/components/VInput/VInput.css +22 -16
- package/lib/components/VInput/VInput.sass +17 -6
- package/lib/components/VInput/_variables.scss +3 -3
- package/lib/components/VSelect/VSelect.css +0 -4
- package/lib/components/VSelect/VSelect.sass +0 -3
- package/lib/components/VTextField/VTextField.css +1 -28
- package/lib/components/VTextField/VTextField.mjs +1 -1
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +0 -26
- package/lib/components/VTextarea/VTextarea.mjs +1 -1
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +10 -10
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
cursor: text;
|
|
5
5
|
}
|
|
6
6
|
.v-autocomplete .v-field .v-field__input > input {
|
|
7
|
-
align-self: flex-start;
|
|
8
7
|
flex: 1 1;
|
|
9
8
|
}
|
|
10
9
|
.v-autocomplete .v-field input {
|
|
@@ -33,17 +32,20 @@
|
|
|
33
32
|
.v-autocomplete__selection {
|
|
34
33
|
display: inline-flex;
|
|
35
34
|
align-items: center;
|
|
35
|
+
height: 1.5rem;
|
|
36
36
|
letter-spacing: inherit;
|
|
37
37
|
line-height: inherit;
|
|
38
38
|
max-width: calc(100% - 2px);
|
|
39
39
|
}
|
|
40
|
-
.v-autocomplete__selection {
|
|
41
|
-
margin-top: var(--v-input-chips-margin-top);
|
|
42
|
-
margin-bottom: var(--v-input-chips-margin-bottom);
|
|
43
|
-
}
|
|
44
40
|
.v-autocomplete__selection:first-child {
|
|
45
41
|
margin-inline-start: 0;
|
|
46
42
|
}
|
|
43
|
+
.v-autocomplete--chips.v-input--density-compact .v-field--variant-solo .v-label.v-field-label--floating,
|
|
44
|
+
.v-autocomplete--chips.v-input--density-compact .v-field--variant-solo-inverted .v-label.v-field-label--floating,
|
|
45
|
+
.v-autocomplete--chips.v-input--density-compact .v-field--variant-filled .v-label.v-field-label--floating,
|
|
46
|
+
.v-autocomplete--chips.v-input--density-compact .v-field--variant-solo-filled .v-label.v-field-label--floating {
|
|
47
|
+
top: 0px;
|
|
48
|
+
}
|
|
47
49
|
.v-autocomplete--selecting-index .v-autocomplete__selection {
|
|
48
50
|
opacity: var(--v-medium-emphasis-opacity);
|
|
49
51
|
}
|
|
@@ -61,10 +63,6 @@
|
|
|
61
63
|
width: 100%;
|
|
62
64
|
padding-inline: inherit;
|
|
63
65
|
}
|
|
64
|
-
.v-autocomplete--single .v-field--variant-outlined input {
|
|
65
|
-
top: 50%;
|
|
66
|
-
transform: translateY(calc(-50% - (var(--v-input-chips-margin-top) + var(--v-input-chips-margin-bottom)) / 2));
|
|
67
|
-
}
|
|
68
66
|
.v-autocomplete--single .v-field--active input {
|
|
69
67
|
transition: none;
|
|
70
68
|
}
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
.v-field
|
|
16
16
|
.v-field__input
|
|
17
17
|
> input
|
|
18
|
-
align-self: flex-start
|
|
19
18
|
flex: 1 1
|
|
20
19
|
|
|
21
20
|
.v-field
|
|
@@ -48,17 +47,24 @@
|
|
|
48
47
|
&__selection
|
|
49
48
|
display: inline-flex
|
|
50
49
|
align-items: center
|
|
50
|
+
height: calc($input-font-size * $input-line-height)
|
|
51
51
|
letter-spacing: inherit
|
|
52
52
|
line-height: inherit
|
|
53
53
|
max-width: calc(100% - $autocomplete-selection-gap)
|
|
54
54
|
|
|
55
55
|
&__selection
|
|
56
|
-
margin-top: var(--v-input-chips-margin-top)
|
|
57
|
-
margin-bottom: var(--v-input-chips-margin-bottom)
|
|
58
|
-
|
|
59
56
|
&:first-child
|
|
60
57
|
margin-inline-start: 0
|
|
61
58
|
|
|
59
|
+
&--chips.v-input--density-compact
|
|
60
|
+
.v-field--variant-solo,
|
|
61
|
+
.v-field--variant-solo-inverted,
|
|
62
|
+
.v-field--variant-filled,
|
|
63
|
+
.v-field--variant-solo-filled
|
|
64
|
+
.v-label.v-field-label
|
|
65
|
+
&--floating
|
|
66
|
+
top: 0px
|
|
67
|
+
|
|
62
68
|
&--selecting-index
|
|
63
69
|
.v-autocomplete__selection
|
|
64
70
|
opacity: var(--v-medium-emphasis-opacity)
|
|
@@ -78,11 +84,6 @@
|
|
|
78
84
|
width: 100%
|
|
79
85
|
padding-inline: inherit
|
|
80
86
|
|
|
81
|
-
.v-field--variant-outlined
|
|
82
|
-
input
|
|
83
|
-
top: 50%
|
|
84
|
-
transform: translateY(calc(-50% - (var(--v-input-chips-margin-top) + var(--v-input-chips-margin-bottom))/2))
|
|
85
|
-
|
|
86
87
|
.v-field--active
|
|
87
88
|
input
|
|
88
89
|
transition: none
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@forward '../VInput/variables';
|
|
1
2
|
@use '../../styles/settings';
|
|
2
3
|
|
|
3
4
|
// Defaults
|
|
@@ -8,5 +9,5 @@ $autocomplete-line-height: 1.75 !default;
|
|
|
8
9
|
$autocomplete-selection-gap: 2px !default;
|
|
9
10
|
$autocomplete-transition: .2s settings.$standard-easing !default;
|
|
10
11
|
$autocomplete-chips-control-min-height: 64px !default;
|
|
11
|
-
$autocomplete-chips-margin-top:
|
|
12
|
-
$autocomplete-chips-margin-bottom:
|
|
12
|
+
$autocomplete-chips-margin-top: null !default;
|
|
13
|
+
$autocomplete-chips-margin-bottom: null !default;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
cursor: text;
|
|
5
5
|
}
|
|
6
6
|
.v-combobox .v-field .v-field__input > input {
|
|
7
|
-
align-self: flex-start;
|
|
8
7
|
flex: 1 1;
|
|
9
8
|
}
|
|
10
9
|
.v-combobox .v-field input {
|
|
@@ -33,17 +32,20 @@
|
|
|
33
32
|
.v-combobox__selection {
|
|
34
33
|
display: inline-flex;
|
|
35
34
|
align-items: center;
|
|
35
|
+
height: 1.5rem;
|
|
36
36
|
letter-spacing: inherit;
|
|
37
37
|
line-height: inherit;
|
|
38
38
|
max-width: 90%;
|
|
39
39
|
}
|
|
40
|
-
.v-combobox__selection {
|
|
41
|
-
margin-top: var(--v-input-chips-margin-top);
|
|
42
|
-
margin-bottom: var(--v-input-chips-margin-bottom);
|
|
43
|
-
}
|
|
44
40
|
.v-combobox__selection:first-child {
|
|
45
41
|
margin-inline-start: 0;
|
|
46
42
|
}
|
|
43
|
+
.v-combobox--chips.v-input--density-compact .v-field--variant-solo .v-label.v-field-label--floating,
|
|
44
|
+
.v-combobox--chips.v-input--density-compact .v-field--variant-solo-inverted .v-label.v-field-label--floating,
|
|
45
|
+
.v-combobox--chips.v-input--density-compact .v-field--variant-filled .v-label.v-field-label--floating,
|
|
46
|
+
.v-combobox--chips.v-input--density-compact .v-field--variant-solo-filled .v-label.v-field-label--floating {
|
|
47
|
+
top: 0px;
|
|
48
|
+
}
|
|
47
49
|
.v-combobox--selecting-index .v-combobox__selection {
|
|
48
50
|
opacity: var(--v-medium-emphasis-opacity);
|
|
49
51
|
}
|
|
@@ -61,10 +63,6 @@
|
|
|
61
63
|
width: 100%;
|
|
62
64
|
padding-inline: inherit;
|
|
63
65
|
}
|
|
64
|
-
.v-combobox--single .v-field--variant-outlined input {
|
|
65
|
-
top: 50%;
|
|
66
|
-
transform: translateY(calc(-50% - (var(--v-input-chips-margin-top) + var(--v-input-chips-margin-bottom)) / 2));
|
|
67
|
-
}
|
|
68
66
|
.v-combobox--single .v-field--active input {
|
|
69
67
|
transition: none;
|
|
70
68
|
}
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
.v-field
|
|
16
16
|
.v-field__input
|
|
17
17
|
> input
|
|
18
|
-
align-self: flex-start
|
|
19
18
|
flex: 1 1
|
|
20
19
|
|
|
21
20
|
.v-field
|
|
@@ -48,17 +47,24 @@
|
|
|
48
47
|
&__selection
|
|
49
48
|
display: inline-flex
|
|
50
49
|
align-items: center
|
|
50
|
+
height: calc($input-font-size * $input-line-height)
|
|
51
51
|
letter-spacing: inherit
|
|
52
52
|
line-height: inherit
|
|
53
53
|
max-width: 90%
|
|
54
54
|
|
|
55
55
|
&__selection
|
|
56
|
-
margin-top: var(--v-input-chips-margin-top)
|
|
57
|
-
margin-bottom: var(--v-input-chips-margin-bottom)
|
|
58
|
-
|
|
59
56
|
&:first-child
|
|
60
57
|
margin-inline-start: 0
|
|
61
58
|
|
|
59
|
+
&--chips.v-input--density-compact
|
|
60
|
+
.v-field--variant-solo,
|
|
61
|
+
.v-field--variant-solo-inverted,
|
|
62
|
+
.v-field--variant-filled,
|
|
63
|
+
.v-field--variant-solo-filled
|
|
64
|
+
.v-label.v-field-label
|
|
65
|
+
&--floating
|
|
66
|
+
top: 0px
|
|
67
|
+
|
|
62
68
|
&--selecting-index
|
|
63
69
|
.v-combobox__selection
|
|
64
70
|
opacity: var(--v-medium-emphasis-opacity)
|
|
@@ -78,11 +84,6 @@
|
|
|
78
84
|
width: 100%
|
|
79
85
|
padding-inline: inherit
|
|
80
86
|
|
|
81
|
-
.v-field--variant-outlined
|
|
82
|
-
input
|
|
83
|
-
top: 50%
|
|
84
|
-
transform: translateY(calc(-50% - (var(--v-input-chips-margin-top) + var(--v-input-chips-margin-bottom))/2))
|
|
85
|
-
|
|
86
87
|
.v-field--active
|
|
87
88
|
input
|
|
88
89
|
transition: none
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
position: relative;
|
|
14
14
|
--v-field-padding-start: 16px;
|
|
15
15
|
--v-field-padding-end: 16px;
|
|
16
|
-
--v-field-padding-top:
|
|
17
|
-
--v-field-padding-bottom:
|
|
18
|
-
--v-field-input-padding-top: calc(var(--v-field-padding-top,
|
|
19
|
-
--v-field-input-padding-bottom: var(--v-field-padding-bottom,
|
|
16
|
+
--v-field-padding-top: 8px;
|
|
17
|
+
--v-field-padding-bottom: 4px;
|
|
18
|
+
--v-field-input-padding-top: calc(var(--v-field-padding-top, 8px) + var(--v-input-padding-top, 0));
|
|
19
|
+
--v-field-input-padding-bottom: var(--v-field-padding-bottom, 4px);
|
|
20
20
|
}
|
|
21
21
|
.v-field--disabled {
|
|
22
22
|
opacity: var(--v-disabled-opacity);
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
}
|
|
56
56
|
.v-input--density-default .v-field--variant-solo, .v-input--density-default .v-field--variant-solo-inverted, .v-input--density-default .v-field--variant-solo-filled, .v-input--density-default .v-field--variant-filled {
|
|
57
57
|
--v-input-control-height: 56px;
|
|
58
|
-
--v-field-padding-bottom:
|
|
58
|
+
--v-field-padding-bottom: 4px;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.v-input--density-comfortable .v-field--variant-solo, .v-input--density-comfortable .v-field--variant-solo-inverted, .v-input--density-comfortable .v-field--variant-solo-filled, .v-input--density-comfortable .v-field--variant-filled {
|
|
62
62
|
--v-input-control-height: 48px;
|
|
63
|
-
--v-field-padding-bottom:
|
|
63
|
+
--v-field-padding-bottom: 0px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.v-input--density-compact .v-field--variant-solo, .v-input--density-compact .v-field--variant-solo-inverted, .v-input--density-compact .v-field--variant-solo-filled, .v-input--density-compact .v-field--variant-filled {
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
--v-field-padding-top: 0px;
|
|
73
73
|
}
|
|
74
74
|
.v-input--density-default .v-field--variant-outlined, .v-input--density-default .v-field--single-line, .v-input--density-default .v-field--no-label {
|
|
75
|
-
--v-field-padding-bottom:
|
|
75
|
+
--v-field-padding-bottom: 16px;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.v-input--density-comfortable .v-field--variant-outlined, .v-input--density-comfortable .v-field--single-line, .v-input--density-comfortable .v-field--no-label {
|
|
79
|
-
--v-field-padding-bottom:
|
|
79
|
+
--v-field-padding-bottom: 12px;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.v-input--density-compact .v-field--variant-outlined, .v-input--density-compact .v-field--single-line, .v-input--density-compact .v-field--no-label {
|
|
83
|
-
--v-field-padding-bottom:
|
|
83
|
+
--v-field-padding-bottom: 8px;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.v-field--variant-plain, .v-field--variant-underlined {
|
|
@@ -90,20 +90,22 @@
|
|
|
90
90
|
.v-field--variant-plain.v-field, .v-field--variant-underlined.v-field {
|
|
91
91
|
--v-field-padding-start: 0px;
|
|
92
92
|
--v-field-padding-end: 0px;
|
|
93
|
-
--v-field-padding-top: var(--v-field-padding-top--plain-underlined, 6px);
|
|
94
93
|
}
|
|
95
94
|
.v-input--density-default .v-field--variant-plain, .v-input--density-default .v-field--variant-underlined {
|
|
96
95
|
--v-input-control-height: 48px;
|
|
97
|
-
--v-field-padding-
|
|
96
|
+
--v-field-padding-top: 4px;
|
|
97
|
+
--v-field-padding-bottom: 4px;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.v-input--density-comfortable .v-field--variant-plain, .v-input--density-comfortable .v-field--variant-underlined {
|
|
101
101
|
--v-input-control-height: 40px;
|
|
102
|
-
--v-field-padding-
|
|
102
|
+
--v-field-padding-top: 2px;
|
|
103
|
+
--v-field-padding-bottom: 0px;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
.v-input--density-compact .v-field--variant-plain, .v-input--density-compact .v-field--variant-underlined {
|
|
106
107
|
--v-input-control-height: 32px;
|
|
108
|
+
--v-field-padding-top: 0px;
|
|
107
109
|
--v-field-padding-bottom: 0px;
|
|
108
110
|
}
|
|
109
111
|
|
|
@@ -123,12 +125,14 @@
|
|
|
123
125
|
/* endregion */
|
|
124
126
|
/* region ELEMENTS */
|
|
125
127
|
.v-field__input {
|
|
128
|
+
align-items: center;
|
|
126
129
|
color: inherit;
|
|
130
|
+
column-gap: 2px;
|
|
127
131
|
display: flex;
|
|
128
132
|
flex-wrap: wrap;
|
|
129
133
|
letter-spacing: 0.009375em;
|
|
130
134
|
opacity: var(--v-high-emphasis-opacity);
|
|
131
|
-
min-height: max(var(--v-input-control-height, 56px), 1.5rem + var(--v-field-input-padding-top) + var(--v-field-input-padding-bottom)
|
|
135
|
+
min-height: max(var(--v-input-control-height, 56px), 1.5rem + var(--v-field-input-padding-top) + var(--v-field-input-padding-bottom));
|
|
132
136
|
min-width: 0;
|
|
133
137
|
padding-inline: var(--v-field-padding-start) var(--v-field-padding-end);
|
|
134
138
|
padding-top: var(--v-field-input-padding-top);
|
|
@@ -136,6 +140,18 @@
|
|
|
136
140
|
position: relative;
|
|
137
141
|
width: 100%;
|
|
138
142
|
}
|
|
143
|
+
.v-input--density-default .v-field__input {
|
|
144
|
+
row-gap: 8px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.v-input--density-comfortable .v-field__input {
|
|
148
|
+
row-gap: 6px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.v-input--density-compact .v-field__input {
|
|
152
|
+
row-gap: 4px;
|
|
153
|
+
}
|
|
154
|
+
|
|
139
155
|
.v-field__input input {
|
|
140
156
|
letter-spacing: inherit;
|
|
141
157
|
}
|
|
@@ -182,7 +198,7 @@ textarea.v-field__input::placeholder {
|
|
|
182
198
|
.v-field__prepend-inner {
|
|
183
199
|
display: flex;
|
|
184
200
|
align-items: flex-start;
|
|
185
|
-
padding-top: var(--v-input-padding-top,
|
|
201
|
+
padding-top: var(--v-input-padding-top, 8px);
|
|
186
202
|
}
|
|
187
203
|
.v-field--center-affix .v-field__append-inner,
|
|
188
204
|
.v-field--center-affix .v-field__clearable,
|
|
@@ -198,8 +214,8 @@ textarea.v-field__input::placeholder {
|
|
|
198
214
|
.v-field.v-field--variant-plain .v-field__clearable,
|
|
199
215
|
.v-field.v-field--variant-plain .v-field__prepend-inner {
|
|
200
216
|
align-items: flex-start;
|
|
201
|
-
padding-top: calc(var(--v-field-padding-top,
|
|
202
|
-
padding-bottom: var(--v-field-padding-bottom,
|
|
217
|
+
padding-top: calc(var(--v-field-padding-top, 8px) + var(--v-input-padding-top, 0));
|
|
218
|
+
padding-bottom: var(--v-field-padding-bottom, 4px);
|
|
203
219
|
}
|
|
204
220
|
|
|
205
221
|
.v-field--focused .v-field__prepend-inner,
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
@at-root
|
|
86
86
|
@include tools.density('v-input', $input-density) using ($modifier)
|
|
87
87
|
@at-root #{selector.nest(&, $root)}
|
|
88
|
-
--v-field-padding-bottom: #{
|
|
88
|
+
--v-field-padding-bottom: #{16px + $modifier * .5}
|
|
89
89
|
|
|
90
90
|
&--variant-plain,
|
|
91
91
|
&--variant-underlined
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
&.v-field
|
|
97
97
|
--v-field-padding-start: 0px
|
|
98
98
|
--v-field-padding-end: 0px
|
|
99
|
-
--v-field-padding-top: var(--v-field-padding-top--plain-underlined, 6px)
|
|
100
99
|
|
|
101
100
|
@at-root
|
|
102
101
|
@include tools.density('v-input', $input-density) using ($modifier)
|
|
103
102
|
@at-root #{selector.nest(&, $root)}
|
|
104
103
|
--v-input-control-height: #{$field-control-underlined-height + $modifier}
|
|
104
|
+
--v-field-padding-top: #{math.max(0px, 4px + $modifier * .25)}
|
|
105
105
|
--v-field-padding-bottom: #{math.max(0px, $field-control-padding-bottom + $modifier * .5)}
|
|
106
106
|
|
|
107
107
|
&--flat
|
|
@@ -121,7 +121,9 @@
|
|
|
121
121
|
/* endregion */
|
|
122
122
|
/* region ELEMENTS */
|
|
123
123
|
.v-field__input
|
|
124
|
+
align-items: center
|
|
124
125
|
color: inherit
|
|
126
|
+
column-gap: $field-input-column-gap
|
|
125
127
|
display: flex
|
|
126
128
|
flex-wrap: wrap
|
|
127
129
|
letter-spacing: $field-letter-spacing
|
|
@@ -134,6 +136,13 @@
|
|
|
134
136
|
position: relative
|
|
135
137
|
width: 100%
|
|
136
138
|
|
|
139
|
+
$root: &
|
|
140
|
+
|
|
141
|
+
@at-root
|
|
142
|
+
@include tools.density('v-input', $input-density) using ($modifier)
|
|
143
|
+
@at-root #{selector.nest(&, $root)}
|
|
144
|
+
row-gap: #{$field-input-row-gap + $modifier * .25}
|
|
145
|
+
|
|
137
146
|
input
|
|
138
147
|
letter-spacing: inherit
|
|
139
148
|
|
|
@@ -27,8 +27,8 @@ $field-control-solo-inverted-focused-color: rgb(var(--v-theme-on-surface-variant
|
|
|
27
27
|
$field-control-filled-background: rgba(var(--v-theme-on-surface), var(--v-idle-opacity)) !default;
|
|
28
28
|
$field-control-padding-start: 16px !default;
|
|
29
29
|
$field-control-padding-end: 16px !default;
|
|
30
|
-
$field-control-padding-top:
|
|
31
|
-
$field-control-padding-bottom:
|
|
30
|
+
$field-control-padding-top: 8px !default;
|
|
31
|
+
$field-control-padding-bottom: 4px !default;
|
|
32
32
|
$field-control-affixed-padding: 12px !default;
|
|
33
33
|
$field-control-affixed-inner-padding: 6px !default;
|
|
34
34
|
$field-control-underlined-height: 48px !default;
|
|
@@ -39,10 +39,12 @@ $field-control-height: 56px !default;
|
|
|
39
39
|
$field-input-opacity: var(--v-high-emphasis-opacity) !default;
|
|
40
40
|
$field-input-min-height: #{max(
|
|
41
41
|
var(--v-input-control-height, $input-control-height),
|
|
42
|
-
calc($input-font-size * $input-line-height + var(--v-field-input-padding-top) + var(--v-field-input-padding-bottom)
|
|
42
|
+
calc($input-font-size * $input-line-height + var(--v-field-input-padding-top) + var(--v-field-input-padding-bottom))
|
|
43
43
|
)} !default;
|
|
44
44
|
$field-input-padding-top: calc(var(--v-field-padding-top, $field-control-padding-top) + var(--v-input-padding-top, 0)) !default;
|
|
45
45
|
$field-input-padding-bottom: var(--v-field-padding-bottom, $field-control-padding-bottom) !default;
|
|
46
|
+
$field-input-column-gap: 2px !default;
|
|
47
|
+
$field-input-row-gap: 8px !default;
|
|
46
48
|
|
|
47
49
|
// LABEL
|
|
48
50
|
$field-label-floating-scale: .75 !default;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
.v-file-input--chips.v-input--density-compact .v-field--variant-solo .v-label.v-field-label--floating,
|
|
2
|
+
.v-file-input--chips.v-input--density-compact .v-field--variant-solo-inverted .v-label.v-field-label--floating,
|
|
3
|
+
.v-file-input--chips.v-input--density-compact .v-field--variant-filled .v-label.v-field-label--floating,
|
|
4
|
+
.v-file-input--chips.v-input--density-compact .v-field--variant-solo-filled .v-label.v-field-label--floating {
|
|
5
|
+
top: 0px;
|
|
6
|
+
}
|
|
1
7
|
.v-file-input input[type=file] {
|
|
2
8
|
height: 100%;
|
|
3
9
|
left: 0;
|
|
@@ -9,8 +15,4 @@
|
|
|
9
15
|
}
|
|
10
16
|
.v-file-input .v-input__details {
|
|
11
17
|
padding-inline: 16px;
|
|
12
|
-
}
|
|
13
|
-
.v-file-input .v-chip {
|
|
14
|
-
margin-top: var(--v-input-chips-margin-top);
|
|
15
|
-
margin-bottom: var(--v-input-chips-margin-bottom);
|
|
16
18
|
}
|
|
@@ -140,7 +140,8 @@ export const VFileInput = genericComponent()({
|
|
|
140
140
|
"modelValue": model.value,
|
|
141
141
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
142
142
|
"class": ['v-file-input', {
|
|
143
|
-
'v-
|
|
143
|
+
'v-file-input--chips': !!props.chips,
|
|
144
|
+
'v-input--plain-underlined': isPlainOrUnderlined.value
|
|
144
145
|
}, props.class],
|
|
145
146
|
"style": props.style,
|
|
146
147
|
"onClick:prepend": onClickPrepend
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VFileInput.mjs","names":["VChip","VCounter","VField","filterFieldProps","makeVFieldProps","makeVInputProps","VInput","useFocus","forwardRefs","useLocale","useProxiedModel","computed","nextTick","ref","watch","callEvent","filterInputAttrs","genericComponent","humanReadableFileSize","propsFactory","useRender","wrapInArray","makeVFileInputProps","chips","Boolean","counter","counterSizeString","type","String","default","counterString","multiple","showSize","Number","validator","v","includes","prependIcon","modelValue","Array","val","every","clearable","VFileInput","name","inheritAttrs","props","emits","e","focused","files","setup","_ref","attrs","emit","slots","t","model","isFocused","focus","blur","base","undefined","totalBytes","value","reduce","bytes","_ref2","size","totalBytesReadable","fileNames","map","file","counterValue","fileCount","length","vInputRef","vFieldRef","inputRef","isActive","active","isPlainOrUnderlined","variant","onFocus","document","activeElement","onClickPrepend","onControlClick","onControlMousedown","click","onClear","stopPropagation","newValue","hasModelReset","isArray","hasCounter","hasDetails","details","rootAttrs","inputAttrs","_","inputProps","filterProps","fieldProps","_createVNode","_mergeProps","$event","class","style","_ref3","id","isDisabled","isDirty","isReadonly","isValid","_ref4","fieldClass","slotProps","_Fragment","preventDefault","target","selection","text","color","join"],"sources":["../../../src/components/VFileInput/VFileInput.tsx"],"sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Components\nimport { VChip } from '@/components/VChip'\nimport { VCounter } from '@/components/VCounter'\nimport { VField } from '@/components/VField'\nimport { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref, watch } from 'vue'\nimport {\n callEvent,\n filterInputAttrs,\n genericComponent,\n humanReadableFileSize,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\nexport type VFileInputSlots = VInputSlots & VFieldSlots & {\n counter: never\n selection: {\n fileNames: string[]\n totalBytes: number\n totalBytesReadable: string\n }\n}\n\nexport const makeVFileInputProps = propsFactory({\n chips: Boolean,\n counter: Boolean,\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n multiple: Boolean,\n showSize: {\n type: [Boolean, Number] as PropType<boolean | 1000 | 1024>,\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(v)\n )\n },\n },\n\n ...makeVInputProps({ prependIcon: '$file' }),\n\n modelValue: {\n type: Array as PropType<File[]>,\n default: () => ([]),\n validator: (val: any) => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n },\n\n ...makeVFieldProps({ clearable: true }),\n}, 'VFileInput')\n\nexport const VFileInput = genericComponent<VFileInputSlots>()({\n name: 'VFileInput',\n\n inheritAttrs: false,\n\n props: makeVFileInputProps(),\n\n emits: {\n 'click:control': (e: MouseEvent) => true,\n 'mousedown:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (files: File[]) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { t } = useLocale()\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined)\n const totalBytes = computed(() => (model.value ?? []).reduce((bytes, { size = 0 }) => bytes + size, 0))\n const totalBytesReadable = computed(() => humanReadableFileSize(totalBytes.value, base.value))\n\n const fileNames = computed(() => (model.value ?? []).map(file => {\n const { name = '', size = 0 } = file\n\n return !props.showSize\n ? name\n : `${name} (${humanReadableFileSize(size, base.value)})`\n }))\n\n const counterValue = computed(() => {\n const fileCount = model.value?.length ?? 0\n if (props.showSize) return t(props.counterSizeString, fileCount, totalBytesReadable.value)\n else return t(props.counterString, fileCount)\n })\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VInput>()\n const inputRef = ref<HTMLInputElement>()\n const isActive = computed(() => (\n isFocused.value ||\n props.active\n ))\n const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant))\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) focus()\n }\n function onClickPrepend (e: MouseEvent) {\n onControlClick(e)\n }\n function onControlMousedown (e: MouseEvent) {\n emit('mousedown:control', e)\n }\n function onControlClick (e: MouseEvent) {\n inputRef.value?.click()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = []\n\n callEvent(props['onClick:clear'], e)\n })\n }\n\n watch(model, newValue => {\n const hasModelReset = !Array.isArray(newValue) || !newValue.length\n\n if (hasModelReset && inputRef.value) {\n inputRef.value.value = ''\n }\n })\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const [{ modelValue: _, ...inputProps }] = VInput.filterProps(props)\n const [fieldProps] = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class={[\n 'v-file-input',\n {\n 'v-text-field--plain-underlined': isPlainOrUnderlined.value,\n },\n props.class,\n ]}\n style={ props.style }\n onClick:prepend={ onClickPrepend }\n { ...rootAttrs }\n { ...inputProps }\n centerAffix={ !isPlainOrUnderlined.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n prepend-icon={ props.prependIcon }\n onMousedown={ onControlMousedown }\n onClick={ onControlClick }\n onClick:clear={ onClear }\n onClick:prependInner={ props['onClick:prependInner'] }\n onClick:appendInner={ props['onClick:appendInner'] }\n { ...fieldProps }\n id={ id.value }\n active={ isActive.value || isDirty.value }\n dirty={ isDirty.value }\n disabled={ isDisabled.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <>\n <input\n ref={ inputRef }\n type=\"file\"\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n multiple={ props.multiple }\n name={ props.name }\n onClick={ e => {\n e.stopPropagation()\n\n if (isReadonly.value) e.preventDefault()\n\n onFocus()\n }}\n onChange={ e => {\n if (!e.target) return\n\n const target = e.target as HTMLInputElement\n model.value = [...target.files ?? []]\n }}\n onFocus={ onFocus }\n onBlur={ blur }\n { ...slotProps }\n { ...inputAttrs }\n />\n\n <div class={ fieldClass }>\n { !!model.value?.length && (\n slots.selection ? slots.selection({\n fileNames: fileNames.value,\n totalBytes: totalBytes.value,\n totalBytesReadable: totalBytesReadable.value,\n })\n : props.chips ? fileNames.value.map(text => (\n <VChip\n key={ text }\n size=\"small\"\n color={ props.color }\n >{ text }</VChip>\n ))\n : fileNames.value.join(', ')\n )}\n </div>\n </>\n ),\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ !!model.value?.length }\n value={ counterValue.value }\n v-slots:default={ slots.counter }\n />\n </>\n )}\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VFileInput = InstanceType<typeof VFileInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,QAAQ;AAAA,SACRC,MAAM;AAAA,SACNC,gBAAgB,EAAEC,eAAe;AAAA,SACjCC,eAAe,EAAEC,MAAM,gCAEhC;AAAA,SACSC,QAAQ;AAAA,SACRC,WAAW;AAAA,SACXC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAElDC,SAAS,EACTC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AAcA,OAAO,MAAMC,mBAAmB,GAAGH,YAAY,CAAC;EAC9CI,KAAK,EAAEC,OAAO;EACdC,OAAO,EAAED,OAAO;EAChBE,iBAAiB,EAAE;IACjBC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,aAAa,EAAE;IACbH,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDE,QAAQ,EAAEP,OAAO;EACjBQ,QAAQ,EAAE;IACRL,IAAI,EAAE,CAACH,OAAO,EAAES,MAAM,CAAoC;IAC1DJ,OAAO,EAAE,KAAK;IACdK,SAAS,EAAGC,CAAmB,IAAK;MAClC,OACE,OAAOA,CAAC,KAAK,SAAS,IACtB,CAAC,IAAI,EAAE,IAAI,CAAC,CAACC,QAAQ,CAACD,CAAC,CAAC;IAE5B;EACF,CAA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AAEW,MAAM,KACrBpB,KAAK,CAACkE,SAAS,GAAGlE,KAAK,CAACkE,SAAS,CAAC;gBAChCnD,SAAS,EAAEA,SAAS,CAACN,KAAK;gBAC1BD,UAAU,EAAEA,UAAU,CAACC,KAAK;gBAC5BK,kBAAkB,EAAEA,kBAAkB,CAACL;cACzC,CAAC,CAAC,GACAlB,KAAK,CAACvB,KAAK,GAAG+C,SAAS,CAACN,KAAK,CAACO,GAAG,CAACmD,IAAI,IAAAlB,YAAA,CAAAxG,KAAA;gBAAA,OAE9B0H,IAAI;gBAAA,QACL,OAAO;gBAAA,SACJ5E,KAAK,CAAC6E;cAAK;gBAAA9F,OAAA,EAAAA,CAAA,MAClB6F,IAAI;cAAA,EACR,CAAC,GACApD,SAAS,CAACN,KAAK,CAAC4D,IAAI,CAAC,IAAI,CAAC,CAC7B;YAAA;UAGN;QAAA,CAGN;QACD3B,OAAO,EAAED,UAAU,GAAGqB,SAAS,IAAAb,YAAA,CAAAc,SAAA,SAEzB/D,KAAK,CAAC0C,OAAO,GAAGoB,SAAS,CAAC,EAE1BtB,UAAU,IAAAS,YAAA,CAAAc,SAAA,SAAAd,YAAA,sBAAAA,YAAA,CAAAvG,QAAA;UAAA,UAKG,CAAC,CAACwD,KAAK,CAACO,KAAK,EAAEW,MAAM;UAAA,SACtBF,YAAY,CAACT;QAAK,GACRT,KAAK,CAAC9B,OAAO,GAGpC,EAEJ,GAAGqC;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAOtD,WAAW,CAAC,CAAC,CAAC,EAAEoE,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACxD;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VFileInput.mjs","names":["VChip","VCounter","VField","filterFieldProps","makeVFieldProps","makeVInputProps","VInput","useFocus","forwardRefs","useLocale","useProxiedModel","computed","nextTick","ref","watch","callEvent","filterInputAttrs","genericComponent","humanReadableFileSize","propsFactory","useRender","wrapInArray","makeVFileInputProps","chips","Boolean","counter","counterSizeString","type","String","default","counterString","multiple","showSize","Number","validator","v","includes","prependIcon","modelValue","Array","val","every","clearable","VFileInput","name","inheritAttrs","props","emits","e","focused","files","setup","_ref","attrs","emit","slots","t","model","isFocused","focus","blur","base","undefined","totalBytes","value","reduce","bytes","_ref2","size","totalBytesReadable","fileNames","map","file","counterValue","fileCount","length","vInputRef","vFieldRef","inputRef","isActive","active","isPlainOrUnderlined","variant","onFocus","document","activeElement","onClickPrepend","onControlClick","onControlMousedown","click","onClear","stopPropagation","newValue","hasModelReset","isArray","hasCounter","hasDetails","details","rootAttrs","inputAttrs","_","inputProps","filterProps","fieldProps","_createVNode","_mergeProps","$event","class","style","_ref3","id","isDisabled","isDirty","isReadonly","isValid","_ref4","fieldClass","slotProps","_Fragment","preventDefault","target","selection","text","color","join"],"sources":["../../../src/components/VFileInput/VFileInput.tsx"],"sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Components\nimport { VChip } from '@/components/VChip'\nimport { VCounter } from '@/components/VCounter'\nimport { VField } from '@/components/VField'\nimport { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref, watch } from 'vue'\nimport {\n callEvent,\n filterInputAttrs,\n genericComponent,\n humanReadableFileSize,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { VFieldSlots } from '@/components/VField/VField'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\nexport type VFileInputSlots = VInputSlots & VFieldSlots & {\n counter: never\n selection: {\n fileNames: string[]\n totalBytes: number\n totalBytesReadable: string\n }\n}\n\nexport const makeVFileInputProps = propsFactory({\n chips: Boolean,\n counter: Boolean,\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n multiple: Boolean,\n showSize: {\n type: [Boolean, Number] as PropType<boolean | 1000 | 1024>,\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(v)\n )\n },\n },\n\n ...makeVInputProps({ prependIcon: '$file' }),\n\n modelValue: {\n type: Array as PropType<File[]>,\n default: () => ([]),\n validator: (val: any) => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n },\n\n ...makeVFieldProps({ clearable: true }),\n}, 'VFileInput')\n\nexport const VFileInput = genericComponent<VFileInputSlots>()({\n name: 'VFileInput',\n\n inheritAttrs: false,\n\n props: makeVFileInputProps(),\n\n emits: {\n 'click:control': (e: MouseEvent) => true,\n 'mousedown:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (files: File[]) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { t } = useLocale()\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined)\n const totalBytes = computed(() => (model.value ?? []).reduce((bytes, { size = 0 }) => bytes + size, 0))\n const totalBytesReadable = computed(() => humanReadableFileSize(totalBytes.value, base.value))\n\n const fileNames = computed(() => (model.value ?? []).map(file => {\n const { name = '', size = 0 } = file\n\n return !props.showSize\n ? name\n : `${name} (${humanReadableFileSize(size, base.value)})`\n }))\n\n const counterValue = computed(() => {\n const fileCount = model.value?.length ?? 0\n if (props.showSize) return t(props.counterSizeString, fileCount, totalBytesReadable.value)\n else return t(props.counterString, fileCount)\n })\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VInput>()\n const inputRef = ref<HTMLInputElement>()\n const isActive = computed(() => (\n isFocused.value ||\n props.active\n ))\n const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant))\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) focus()\n }\n function onClickPrepend (e: MouseEvent) {\n onControlClick(e)\n }\n function onControlMousedown (e: MouseEvent) {\n emit('mousedown:control', e)\n }\n function onControlClick (e: MouseEvent) {\n inputRef.value?.click()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = []\n\n callEvent(props['onClick:clear'], e)\n })\n }\n\n watch(model, newValue => {\n const hasModelReset = !Array.isArray(newValue) || !newValue.length\n\n if (hasModelReset && inputRef.value) {\n inputRef.value.value = ''\n }\n })\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const [{ modelValue: _, ...inputProps }] = VInput.filterProps(props)\n const [fieldProps] = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class={[\n 'v-file-input',\n {\n 'v-file-input--chips': !!props.chips,\n 'v-input--plain-underlined': isPlainOrUnderlined.value,\n },\n props.class,\n ]}\n style={ props.style }\n onClick:prepend={ onClickPrepend }\n { ...rootAttrs }\n { ...inputProps }\n centerAffix={ !isPlainOrUnderlined.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n prepend-icon={ props.prependIcon }\n onMousedown={ onControlMousedown }\n onClick={ onControlClick }\n onClick:clear={ onClear }\n onClick:prependInner={ props['onClick:prependInner'] }\n onClick:appendInner={ props['onClick:appendInner'] }\n { ...fieldProps }\n id={ id.value }\n active={ isActive.value || isDirty.value }\n dirty={ isDirty.value }\n disabled={ isDisabled.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <>\n <input\n ref={ inputRef }\n type=\"file\"\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n multiple={ props.multiple }\n name={ props.name }\n onClick={ e => {\n e.stopPropagation()\n\n if (isReadonly.value) e.preventDefault()\n\n onFocus()\n }}\n onChange={ e => {\n if (!e.target) return\n\n const target = e.target as HTMLInputElement\n model.value = [...target.files ?? []]\n }}\n onFocus={ onFocus }\n onBlur={ blur }\n { ...slotProps }\n { ...inputAttrs }\n />\n\n <div class={ fieldClass }>\n { !!model.value?.length && (\n slots.selection ? slots.selection({\n fileNames: fileNames.value,\n totalBytes: totalBytes.value,\n totalBytesReadable: totalBytesReadable.value,\n })\n : props.chips ? fileNames.value.map(text => (\n <VChip\n key={ text }\n size=\"small\"\n color={ props.color }\n >{ text }</VChip>\n ))\n : fileNames.value.join(', ')\n )}\n </div>\n </>\n ),\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ !!model.value?.length }\n value={ counterValue.value }\n v-slots:default={ slots.counter }\n />\n </>\n )}\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return forwardRefs({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VFileInput = InstanceType<typeof VFileInput>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,QAAQ;AAAA,SACRC,MAAM;AAAA,SACNC,gBAAgB,EAAEC,eAAe;AAAA,SACjCC,eAAe,EAAEC,MAAM,gCAEhC;AAAA,SACSC,QAAQ;AAAA,SACRC,WAAW;AAAA,SACXC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAElDC,SAAS,EACTC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AAcA,OAAO,MAA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B,UAAU,IAAAS,YAAA,CAAAc,SAAA,SAAAd,YAAA,sBAAAA,YAAA,CAAAvG,QAAA;UAAA,UAKG,CAAC,CAACwD,KAAK,CAACO,KAAK,EAAEW,MAAM;UAAA,SACtBF,YAAY,CAACT;QAAK,GACRT,KAAK,CAAC9B,OAAO,GAGpC,EAEJ,GAAGqC;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAOtD,WAAW,CAAC,CAAC,CAAC,EAAEoE,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACxD;AACF,CAAC,CAAC"}
|
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
// Block
|
|
6
6
|
.v-file-input
|
|
7
|
+
|
|
8
|
+
&--chips.v-input--density-compact
|
|
9
|
+
.v-field--variant-solo,
|
|
10
|
+
.v-field--variant-solo-inverted,
|
|
11
|
+
.v-field--variant-filled,
|
|
12
|
+
.v-field--variant-solo-filled
|
|
13
|
+
.v-label.v-field-label
|
|
14
|
+
&--floating
|
|
15
|
+
top: 0px
|
|
16
|
+
|
|
7
17
|
input[type="file"]
|
|
8
18
|
height: 100%
|
|
9
19
|
left: 0
|
|
@@ -15,7 +25,3 @@
|
|
|
15
25
|
|
|
16
26
|
.v-input__details
|
|
17
27
|
padding-inline: $file-input-details-padding-inline
|
|
18
|
-
|
|
19
|
-
.v-chip
|
|
20
|
-
margin-top: var(--v-input-chips-margin-top)
|
|
21
|
-
margin-bottom: var(--v-input-chips-margin-bottom)
|
|
@@ -4,36 +4,23 @@
|
|
|
4
4
|
font-size: 1rem;
|
|
5
5
|
font-weight: 400;
|
|
6
6
|
line-height: 1.5;
|
|
7
|
-
--v-input-chips-margin-top: 2px;
|
|
8
7
|
}
|
|
9
8
|
.v-input--disabled {
|
|
10
9
|
pointer-events: none;
|
|
11
10
|
}
|
|
12
11
|
.v-input--density-default {
|
|
13
12
|
--v-input-control-height: 56px;
|
|
14
|
-
--v-input-padding-top:
|
|
13
|
+
--v-input-padding-top: 16px;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
.v-input--density-comfortable {
|
|
18
17
|
--v-input-control-height: 48px;
|
|
19
|
-
--v-input-padding-top:
|
|
18
|
+
--v-input-padding-top: 12px;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.v-input--density-compact {
|
|
23
22
|
--v-input-control-height: 40px;
|
|
24
|
-
--v-input-padding-top:
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.v-input--density-default {
|
|
28
|
-
--v-input-chips-margin-bottom: 0px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.v-input--density-comfortable {
|
|
32
|
-
--v-input-chips-margin-bottom: 2px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.v-input--density-compact {
|
|
36
|
-
--v-input-chips-margin-bottom: 4px;
|
|
23
|
+
--v-input-padding-top: 8px;
|
|
37
24
|
}
|
|
38
25
|
|
|
39
26
|
.v-input--vertical {
|
|
@@ -129,4 +116,23 @@
|
|
|
129
116
|
.v-input__control {
|
|
130
117
|
display: flex;
|
|
131
118
|
grid-area: control;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.v-input--plain-underlined .v-input__details {
|
|
122
|
+
padding: 0;
|
|
123
|
+
}
|
|
124
|
+
.v-input--plain-underlined .v-input__prepend,
|
|
125
|
+
.v-input--plain-underlined .v-input__append {
|
|
126
|
+
align-items: flex-start;
|
|
127
|
+
}
|
|
128
|
+
.v-input--density-default.v-input--plain-underlined .v-input__prepend, .v-input--density-default.v-input--plain-underlined .v-input__append {
|
|
129
|
+
padding-top: calc(var(--v-input-padding-top) + 4px);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.v-input--density-comfortable.v-input--plain-underlined .v-input__prepend, .v-input--density-comfortable.v-input--plain-underlined .v-input__append {
|
|
133
|
+
padding-top: calc(var(--v-input-padding-top) + 2px);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.v-input--density-compact.v-input--plain-underlined .v-input__prepend, .v-input--density-compact.v-input--plain-underlined .v-input__append {
|
|
137
|
+
padding-top: calc(var(--v-input-padding-top) + 0px);
|
|
132
138
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:math'
|
|
2
|
+
@use 'sass:selector'
|
|
2
3
|
@use '../../styles/tools'
|
|
3
4
|
@use './variables' as *
|
|
4
5
|
|
|
@@ -9,18 +10,13 @@
|
|
|
9
10
|
font-weight: $input-font-weight
|
|
10
11
|
line-height: $input-line-height
|
|
11
12
|
|
|
12
|
-
--v-input-chips-margin-top: #{$input-chips-margin-top}
|
|
13
|
-
|
|
14
13
|
&--disabled
|
|
15
14
|
pointer-events: none
|
|
16
15
|
|
|
17
16
|
@at-root
|
|
18
17
|
@include tools.density('v-input', $input-density) using ($modifier)
|
|
19
18
|
--v-input-control-height: #{$input-control-height + $modifier}
|
|
20
|
-
--v-input-padding-top: #{
|
|
21
|
-
|
|
22
|
-
@include tools.density('v-input', $input-chips-margin-bottom) using ($modifier)
|
|
23
|
-
--v-input-chips-margin-bottom: #{0px + math.div($modifier, 2)}
|
|
19
|
+
--v-input-padding-top: #{16px + $modifier * .5}
|
|
24
20
|
|
|
25
21
|
.v-input--vertical
|
|
26
22
|
grid-template-areas: "append" "control" "prepend"
|
|
@@ -96,3 +92,18 @@
|
|
|
96
92
|
.v-input__control
|
|
97
93
|
display: flex
|
|
98
94
|
grid-area: control
|
|
95
|
+
|
|
96
|
+
.v-input
|
|
97
|
+
&--plain-underlined
|
|
98
|
+
.v-input__details
|
|
99
|
+
padding: 0
|
|
100
|
+
|
|
101
|
+
.v-input__prepend,
|
|
102
|
+
.v-input__append
|
|
103
|
+
$this: &
|
|
104
|
+
align-items: flex-start
|
|
105
|
+
|
|
106
|
+
@at-root
|
|
107
|
+
@include tools.density('v-input', $input-density) using ($modifier)
|
|
108
|
+
@at-root #{selector.append(&, $this)}
|
|
109
|
+
padding-top: calc(var(--v-input-padding-top) + #{math.max(0px, 4px + $modifier * .25)})
|