From f5209154ee3e8db76b15aba677a24beaea945145 Mon Sep 17 00:00:00 2001 From: Abizrh Date: Sun, 31 Aug 2025 17:21:23 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat=20(form):=20add=20stacked=20la?= =?UTF-8?q?yout=20option=20for=20form=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pub/base/data-table/data-table.vue | 15 ++++++----- .../pub/custom-ui/form/field-group.vue | 27 +++++++++---------- app/components/pub/custom-ui/form/label.vue | 10 ++++--- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/app/components/pub/base/data-table/data-table.vue b/app/components/pub/base/data-table/data-table.vue index 6524aaa8..ebfa1305 100644 --- a/app/components/pub/base/data-table/data-table.vue +++ b/app/components/pub/base/data-table/data-table.vue @@ -21,9 +21,11 @@ const loader = inject('table_data_loader') as DataTableLoader + > {{ h.label }} @@ -33,13 +35,13 @@ v-for="(h, idx) in header[0]" :key="`head-${idx}`" class="border" - + - +
Tidak ada data tersedia @@ -52,9 +54,10 @@ v-for="(h, idx) in header[0]" :key="`head-${idx}`" class="border" + /> - - diff --git a/app/components/pub/custom-ui/form/label.vue b/app/components/pub/custom-ui/form/label.vue index 179cee89..76e6e7cf 100644 --- a/app/components/pub/custom-ui/form/label.vue +++ b/app/components/pub/custom-ui/form/label.vue @@ -4,11 +4,13 @@ const props = withDefaults( size?: 'default' | 'narrow' | 'wide' height?: 'default' | 'compact' position?: 'default' | 'dynamic' + stacked?: boolean }>(), { size: 'default', height: 'default', position: 'default', + stacked: false, }, ) @@ -35,12 +37,12 @@ const positionChildMap = { const wrapperClass = computed(() => [ 'block shrink-0', - sizeMap[props.size], - heightMap[props.height], - positionWrapMap[props.position], + props.stacked ? 'w-full mb-1 text-start' : sizeMap[props.size], + props.stacked ? '' : heightMap[props.height], + props.stacked ? '' : positionWrapMap[props.position], ]) -const labelClass = computed(() => positionChildMap[props.position]) +const labelClass = computed(() => [props.stacked ? 'block mb-1 text-sm font-medium' : positionChildMap[props.position]])