Skip to content

Commit 6ea4e39

Browse files
* Fix issue of icon not getting set properly.
* Change icon size usage
1 parent d26acbd commit 6ea4e39

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

src/plugin/VColorField.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
v-else-if="prependIcon"
6363
:color="hoverIconColor"
6464
:icon="prependIcon"
65+
:iconSize="iconSize"
6566
@click="toggleColorPicker"
6667
/>
6768
</template>
@@ -93,6 +94,7 @@
9394
v-else-if="prependInnerIcon"
9495
:color="hoverIconColor"
9596
:icon="prependInnerIcon"
97+
:iconSize="iconSize"
9698
@click="toggleCheck('textFieldIcon')"
9799
/>
98100
</template>
@@ -124,6 +126,7 @@
124126
v-else-if="appendInnerIcon"
125127
:color="hoverIconColor"
126128
:icon="appendInnerIcon"
129+
:iconSize="iconSize"
127130
@click="toggleCheck('textFieldIcon')"
128131
/>
129132
</template>
@@ -155,6 +158,7 @@
155158
v-else-if="appendIcon"
156159
:color="hoverIconColor"
157160
:icon="appendIcon"
161+
:iconSize="iconSize"
158162
@click="toggleColorPicker"
159163
/>
160164
</template>
@@ -254,6 +258,7 @@ const props = withDefaults(defineProps<Props>(), {
254258
density: 'default',
255259
hint: '',
256260
iconHoverColor: undefined,
261+
iconSize: 'default',
257262
label: undefined,
258263
messages: undefined,
259264
name: 'color',
@@ -263,12 +268,11 @@ const props = withDefaults(defineProps<Props>(), {
263268
pip: false,
264269
pipBorder: '3px solid rgb(var(--v-theme-on-surface))',
265270
pipBorderRadius: '50%',
266-
pipIcon: undefined,
267-
pipSize: 'default',
271+
pipIcon: 'pip',
268272
pipSlot: 'prepend-inner',
269273
placeholder: undefined,
270274
prependIcon: undefined,
271-
prependInnerIcon: 'mdi:mdi-palette',
275+
prependInnerIcon: 'default',
272276
readonly: false,
273277
readonlyInput: false,
274278
required: false,
@@ -327,7 +331,7 @@ const pipProps = ref({
327331
pipBorder: props.pipBorder,
328332
pipBorderRadius: props.pipBorderRadius,
329333
pipIcon: props.pipIcon,
330-
pipSize: props.pipSize,
334+
pipSize: props.iconSize,
331335
});
332336
333337

src/plugin/components/ColorPickerIcon.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
v-bind="props"
66
:color="isHovering ? color : undefined"
77
:icon="theIcon"
8+
:size="iconSize"
89
@click="toggleColorPicker"
910
></v-icon>
1011
</template>
@@ -27,9 +28,9 @@ const iconOptions = inject<IconOptions>(Symbol.for('vuetify:icons'));
2728
2829
const theIcon = computed(() => {
2930
return useGetIcon({
30-
icon: props.icon,
31+
icon: props.icon !== 'default' ? props.icon : '',
3132
iconOptions,
32-
name: 'palette',
33+
name: 'default',
3334
});
3435
});
3536

src/plugin/components/PipComponent.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { usePipClasses } from '@/plugin/composables/classes';
1717
import { usePipStyles } from '@/plugin/composables/styles';
1818
import { useGetIcon } from '@/plugin/composables/icons';
1919
20-
2120
const emit = defineEmits(['click']);
2221
2322
const props = withDefaults(defineProps<PipComponentProps>(), {});
@@ -35,7 +34,7 @@ const iconOptions = inject<IconOptions>(Symbol.for('vuetify:icons'));
3534
3635
const thePipIcon = computed(() => {
3736
return useGetIcon({
38-
icon: props.pipIcon,
37+
icon: props.pipIcon !== 'pip' ? props.pipIcon : '',
3938
iconOptions,
4039
name: 'pip',
4140
});

src/stores/props.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ const componentProps = [
8484
name: 'icon-hover-color',
8585
type: 'string | undefined',
8686
},
87+
{
88+
default: 'default',
89+
desc: 'Sets the size of the <code class="ic">prepend-icon</code>, <code class="ic">prepend-inner-icon</code>, <code class="ic">append-inner-icon</code>, <code class="ic">append-icon</code> <code class="ic">VIcon</code> as well as the <code class="ic">pip-icon</code> <code class="ic">VIcon</code>.',
90+
name: 'icon-size',
91+
type: 'VIcon[\'$props\'][\'size\']',
92+
},
8793
{
8894
default: 'bottom left',
8995
desc: 'Sets the position of the <code class="ic">VCard</code> component relative to the <code class="ic">VTextField</code> input when it opens. Ex. <code class="ic">bottom left</code>, <code class="ic">bottom right</code>, <code class="ic">top left</code>, <code class="ic">top right</code>',
@@ -114,12 +120,6 @@ const componentProps = [
114120
name: 'pip-icon',
115121
type: 'VIcon[\'$props\'][\'icon\']',
116122
},
117-
{
118-
default: 'default',
119-
desc: 'Sets the size of the <code class="ic">pip</code> <code class="ic">VIcon</code>.',
120-
name: 'pip-size',
121-
type: 'VIcon[\'$props\'][\'size\']',
122-
},
123123
{
124124
default: 'prepend-inner',
125125
desc: 'Sets the slot where the <code class="ic">pip</code> is placed.',

0 commit comments

Comments
 (0)