-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reworks micro style for color input, range input, select input. * Allows to pass modifiers to `AposSchema` for each field types that will override `modifiers` prop that is applied to all fields. * Adds new slot info to `AposInputWrapper` to add stuff on the right of the label.
- Loading branch information
Showing
11 changed files
with
221 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
modules/@apostrophecms/color-field/ui/apos/lib/AposColorInfo.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="apos-color-info" data-apos-test="colorInfo"> | ||
<span v-if="!isMicro"> | ||
{{ label }} | ||
</span> | ||
<AposButton | ||
v-if="!isMicro && value" | ||
type="quiet" | ||
:label="'apostrophe:clear'" | ||
class="apos-color-info__clear-btn" | ||
:modifiers="['no-motion']" | ||
@click="emit('clear')" | ||
/> | ||
<AposIndicator | ||
v-else-if="value" | ||
class="apos-color-info__clear-icon" | ||
icon="water-off-icon" | ||
@click="emit('clear')" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed } from 'vue'; | ||
const props = defineProps({ | ||
value: { | ||
type: String, | ||
default: null | ||
}, | ||
isMicro: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}); | ||
const label = computed(() => props.value || 'None Selected'); | ||
const emit = defineEmits([ 'clear' ]); | ||
</script> | ||
|
||
<style lang="scss"> | ||
.apos-color-info { | ||
@include type-base; | ||
& { | ||
color: var(--a-text-primary); | ||
} | ||
} | ||
.apos-color-info__clear-btn { | ||
margin-left: 10px; | ||
} | ||
.apos-color-info__clear-icon { | ||
cursor: pointer; | ||
color: var(--a-base-2); | ||
&:hover { | ||
color: var(--a-primary); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.