jws-frontend/src/components/ItemCard.vue

83 lines
1.8 KiB
Vue
Raw Normal View History

2024-04-22 14:21:14 +07:00
<script setup lang="ts">
2024-09-06 11:09:42 +07:00
import { ref } from 'vue';
2024-04-22 14:21:14 +07:00
import { Icon } from '@iconify/vue';
2024-09-06 11:09:42 +07:00
import { onMounted } from 'vue';
const props = defineProps<{
2024-04-22 14:21:14 +07:00
icon: string;
text: string;
2024-09-06 11:09:42 +07:00
iconColor: string;
bgColor: string;
2024-06-11 15:12:33 +07:00
changeColor?: boolean;
2024-09-06 11:09:42 +07:00
index?: number;
2024-04-22 14:21:14 +07:00
}>();
2024-09-06 11:09:42 +07:00
const _self = ref<InstanceType<typeof HTMLDivElement>>();
onMounted(() => {
if (props.index === 0) {
_self.value?.focus();
}
});
2024-04-22 14:21:14 +07:00
</script>
<template>
2024-09-06 11:09:42 +07:00
<button
ref="_self"
class="wrapper surface-1 shadow-2"
type="submit"
2024-06-07 02:42:21 +00:00
@click="$emit('trigger')"
2024-09-06 11:09:42 +07:00
style="padding: 0; border-radius: var(--radius-2); width: 320px"
2024-04-22 14:21:14 +07:00
>
2024-09-06 11:09:42 +07:00
<div class="column justify-center" style="height: 100%">
<div class="col-6 flex justify-center items-center">
<div
class="q-pa-md row items-center"
:style="`border-radius: 50%; background-color: hsla(${bgColor} / 0.1)`"
>
<Icon :icon="icon" width="53px" :color="`var(${iconColor})`" />
</div>
2024-04-22 14:21:14 +07:00
</div>
<div
2024-09-06 11:09:42 +07:00
class="col-2 flex text-bold text-h6 text-center justify-center items-center variable-item-card"
2024-04-22 14:21:14 +07:00
:class="{ dark: $q.dark.isActive }"
2024-09-06 11:09:42 +07:00
:style="`background-color: ${bgColor}`"
2024-04-22 14:21:14 +07:00
>
refactor: responsive (#180) * refactor: can open one dropdown whe lt.md * style: update MainLayout background color and fix avatar border class name * feat: add touch position binding for dropdown in ProfileMenu * refactor: enhance icon styling in DrawerComponent * fix: update screen size conditions * feat: add responsive search and filter functionality in MainPage * feat: update styling and functionality in BasicInformation and MainPage components * feat: package view mode improve layout and responsiveness * feat: improve layout and responsiveness of ProfileBanner component * feat: enhance TreeView component with improved icon layout and cursor pointer styling * feat: update DialogForm component to prevent text wrapping in the center column * feat: enhance FormDocument, PriceDataComponent, and BasicInfoProduct components with layout and styling improvements * feat: enhance ProfileBanner dark tab * feat: 02 => responsive & responsibleArea type * fix: layout header bg condition & 02 filter col * feat: 04 flow => add AddButton component and enhance layout in FormFlow and FlowDialog * feat: 07 => enhance layout and responsiveness * refactor: simplify header structure and improve layout consistency * fix: improve text color in ItemCard and adjust responsive breakpoints in product service group * refactor: 05 => enhance layout responsiveness and improve class bindings in quotation components * refactor: enhance styling and improve props flexibility in dialog and select components * refactor: 05 => enhance layout responsiveness in quotation components * refactor: 05 => enhance layout responsiveness * refactor: 05 => formWorkerAdd * refactor: 05 => formWorkerAdd Product table * refactor: 05 => improve layout responsiveness and enhance component structure * refactor: enhance grid view handling and improve component imports * refactor: improve column classes for better layout consistency * refactor: 09 => enhance layout structure and improve responsiveness in task order views * refactor: 10 => enhance invoice main page layout and improve component interactions * refactor: 13 => enhance receipt main page layout and improve component interactions * refactor: 11 => enhance layout and improve responsiveness in credit note pages * refactor: 01 => screen.sm search & filter * refactor: 01 => improve layout responsiveness and fix variable naming in branch management forms --------- Co-authored-by: puriphatt <puriphat@frappet.com>
2025-01-27 10:39:53 +07:00
<div style="font-size: 14px; color: var(--foreground)">
{{ $t(text) }}
</div>
2024-04-22 14:21:14 +07:00
</div>
</div>
2024-09-06 11:09:42 +07:00
</button>
2024-04-22 14:21:14 +07:00
</template>
<style scoped>
.variable-item-card {
--_var-filter: grayscale(30%);
filter: var(--_var-filter);
&.dark {
--_var-filter: grayscale(0%);
}
}
.variable-icon-color {
--_var-filter: grayscale(0%);
filter: var(--_var-filter);
&.dark {
--_var-filter: color;
}
}
2024-09-06 11:09:42 +07:00
.wrapper {
appearance: none;
background: transparent;
outline: none;
border: none;
}
.wrapper:focus {
border: 2px solid var(--blue-6);
border-radius: 10px;
}
2024-04-22 14:21:14 +07:00
</style>