Skip to content

Commit 5575d48

Browse files
Fixing types
1 parent f25ecc2 commit 5575d48

File tree

9 files changed

+35
-10
lines changed

9 files changed

+35
-10
lines changed

Diff for: src/plugin/components/VInlineAutocomplete/VInlineAutocomplete.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ import type { VInlineAutocompleteProps } from './';
128128
import { IconOptions } from 'vuetify';
129129
import type { VSelect } from 'vuetify/components';
130130
import {
131+
autocompleteProps,
131132
defaultCardProps,
132-
selectProps,
133133
} from '@utils/props';
134134
import DisplayedValue from '@components/common/DisplayedValue.vue';
135135
import SaveFieldButtons from '@components/common/SaveFieldButtons.vue';
@@ -163,7 +163,7 @@ const injectedOptions = inject(globalOptions, {});
163163
164164
const iconOptions = inject<IconOptions>(Symbol.for('vuetify:icons'));
165165
166-
const props = withDefaults(defineProps<VInlineAutocompleteProps>(), { ...selectProps });
166+
const props = withDefaults(defineProps<VInlineAutocompleteProps>(), { ...autocompleteProps });
167167
const settings = reactive({ ...attrs, ...props, ...injectedOptions });
168168
169169
watchEffect(() => {

Diff for: src/plugin/components/VInlineAutocomplete/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface VInlineAutocompleteProps extends Omit<SharedProps,
77
'falseValue' | 'iconFalse' | 'iconFalseColor' | 'iconFalseTitle' | 'iconTrue' | 'iconTrueColor' | 'iconTrueTitle' | 'icons' | 'trueValue' | 'truncateLength' | 'truncateSuffix'
88
> {
99
autoSelectFirst?: VAutocomplete['$props']['autoSelectFirst'];
10-
clearIcon?: string | undefined;
10+
clearIcon?: VAutocomplete['$props']['clearIcon'];
1111
clearable?: VAutocomplete['$props']['clearable'];
1212
density?: VAutocomplete['$props']['density'];
1313
hideSelected?: VAutocomplete['$props']['hideSelected'];

Diff for: src/plugin/components/VInlineSelect/__tests__/VInlineSelect.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const vuetify = createVuetify();
1010
const componentProps = Object.assign(selectProps, {
1111
cardProps: {},
1212
items: [],
13+
rules: [],
1314
});
1415

1516
describe('VInlineSelect', () => {

Diff for: src/plugin/components/VInlineSelect/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type VInlineSelect from './VInlineSelect.vue';
66
export interface VInlineSelectProps extends Omit<SharedProps,
77
'falseValue' | 'iconFalse' | 'iconFalseColor' | 'iconFalseTitle' | 'iconTrue' | 'iconTrueColor' | 'iconTrueTitle' | 'icons' | 'trueValue' | 'truncateLength' | 'truncateSuffix'
88
> {
9-
clearIcon?: string | undefined;
9+
clearIcon?: VSelect['$props']['clearIcon'];
1010
clearable?: VSelect['$props']['clearable'];
1111
density?: VSelect['$props']['density'];
1212
hideSelected?: VSelect['$props']['hideSelected'];

Diff for: src/plugin/components/VInlineTextField/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type VInlineTextField from './VInlineTextField.vue';
66
export interface VInlineTextFieldProps extends Omit<SharedProps,
77
'falseValue' | 'iconFalse' | 'iconFalseColor' | 'iconFalseTitle' | 'iconTrue' | 'iconTrueColor' | 'iconTrueTitle' | 'icons' | 'trueValue'
88
> {
9-
clearIcon?: string | undefined;
9+
clearIcon?: VTextField['$props']['clearIcon'];
1010
density?: VTextField['$props']['density'];
1111
rules?: VTextField['$props']['rules'];
1212
variant?: VTextField['$props']['variant'];

Diff for: src/plugin/components/VInlineTextarea/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface VInlineTextareaProps extends Omit<SharedProps,
77
'falseValue' | 'iconFalse' | 'iconFalseColor' | 'iconFalseTitle' | 'iconTrue' | 'iconTrueColor' | 'iconTrueTitle' | 'icons' | 'trueValue'
88
> {
99
autoGrow?: VTextarea['$props']['autoGrow'];
10-
clearIcon?: string | undefined;
10+
clearIcon?: VTextarea['$props']['clearIcon'];
1111
density?: VTextarea['$props']['density'];
1212
rows?: VTextarea['$props']['rows'];
1313
rules?: VTextarea['$props']['rules'];

Diff for: src/plugin/composables/icons.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export const useGetIcon: UseGetIcon = (options) => {
3131
const iconSet = defaultIcons[iconOptions?.defaultSet as string];
3232

3333
if (!iconSet) {
34-
throw new Error(`VInlineFields: No VInlineFields default ${iconOptions?.defaultSet} icon set found for ${name}. Please set the icon prop.`);
34+
throw new Error(`[VInlineFields]: No default ${iconOptions?.defaultSet} icon set found.`);
3535
}
3636

3737
const newIcon = iconSet[name];
3838

3939
if (!newIcon) {
40-
throw new Error(`VInlineFields: No ${name} icon found. Please set the icon prop, or set the default icon set to 'mdi' or 'fa'`);
40+
throw new Error(`[VInlineFields]: No ${name} icon found.`);
4141
}
4242

4343
return newIcon;

Diff for: src/plugin/types/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export interface UseCardContainerClass {
267267
export interface UseGetIcon {
268268
(
269269
options: {
270-
icon: string | undefined,
270+
icon: VIconValue,
271271
iconOptions: IconOptions | undefined,
272272
name: string,
273273
}

Diff for: src/plugin/utils/props.ts

+25-1
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,34 @@ const selectProps = {
109109
...autofocus,
110110
...saveAndLoadingIconProps,
111111
...{
112-
clearIcon: undefined,
112+
clearIcon: '$clear',
113113
clearable: false,
114114
hideSelected: true,
115115
itemTitle: 'title',
116116
itemValue: 'value',
117117
items: () => ([]),
118118
menu: true,
119+
rules: () => ([]),
120+
variant: 'underlined' as const,
121+
},
122+
};
123+
124+
// v-autocomplete //
125+
const autocompleteProps = {
126+
...sharedProps,
127+
...autofocus,
128+
...saveAndLoadingIconProps,
129+
...{
130+
autoSelectFirst: false,
131+
clearIcon: '$clear',
132+
clearable: false,
133+
hideSelected: true,
134+
itemTitle: 'title',
135+
itemValue: 'value',
136+
items: () => ([]),
137+
menu: true,
138+
menuIcon: '$dropdown',
139+
rules: () => ([]),
119140
variant: 'underlined' as const,
120141
},
121142
};
@@ -138,6 +159,7 @@ const textareaProps = {
138159
...sharedProps,
139160
...{
140161
autoGrow: true,
162+
clearIcon: '$clear',
141163
rows: 1,
142164
truncateLength: undefined,
143165
truncateSuffix: '...',
@@ -151,6 +173,7 @@ const textFieldProps = {
151173
...autofocus,
152174
...saveAndLoadingIconProps,
153175
...{
176+
clearIcon: '$clear',
154177
truncateLength: undefined,
155178
truncateSuffix: '...',
156179
variant: 'underlined' as const,
@@ -160,6 +183,7 @@ const textFieldProps = {
160183

161184
// Export //
162185
export {
186+
autocompleteProps,
163187
checkboxProps,
164188
selectProps,
165189
switchProps,

0 commit comments

Comments
 (0)