Masters and Transaction changes

This commit is contained in:
dhanabalan
2025-03-24 17:23:01 +05:30
parent 04ee0cadd5
commit c631f1f2c0
123 changed files with 6935 additions and 32 deletions

View File

@@ -0,0 +1,62 @@
@props([
'default' => 1,
'sm' => null,
'md' => null,
'lg' => null,
'xl' => null,
'twoXl' => null,
'defaultStart' => null,
'smStart' => null,
'mdStart' => null,
'lgStart' => null,
'xlStart' => null,
'twoXlStart' => null,
'hidden' => false,
])
@php
$getSpanValue = function ($span): string {
if ($span === 'full') {
return '1 / -1';
}
return "span {$span} / span {$span}";
};
@endphp
<div
{{
$attributes
->class([
'hidden' => $hidden || $default === 'hidden',
'col-[--col-span-default]' => $default && (! $hidden),
'sm:col-[--col-span-sm]' => $sm && (! $hidden),
'md:col-[--col-span-md]' => $md && (! $hidden),
'lg:col-[--col-span-lg]' => $lg && (! $hidden),
'xl:col-[--col-span-xl]' => $xl && (! $hidden),
'2xl:col-[--col-span-2xl]' => $twoXl && (! $hidden),
'col-start-[--col-start-default]' => $defaultStart && (! $hidden),
'sm:col-start-[--col-start-sm]' => $smStart && (! $hidden),
'md:col-start-[--col-start-md]' => $mdStart && (! $hidden),
'lg:col-start-[--col-start-lg]' => $lgStart && (! $hidden),
'xl:col-start-[--col-start-xl]' => $xlStart && (! $hidden),
'2xl:col-start-[--col-start-2xl]' => $twoXlStart && (! $hidden),
])
->style([
"--col-span-default: {$getSpanValue($default)}" => $default,
"--col-span-sm: {$getSpanValue($sm)}" => $sm,
"--col-span-md: {$getSpanValue($md)}" => $md,
"--col-span-lg: {$getSpanValue($lg)}" => $lg,
"--col-span-xl: {$getSpanValue($xl)}" => $xl,
"--col-span-2xl: {$getSpanValue($twoXl)}" => $twoXl,
"--col-start-default: {$defaultStart}" => $defaultStart,
"--col-start-sm: {$smStart}" => $smStart,
"--col-start-md: {$mdStart}" => $mdStart,
"--col-start-lg: {$lgStart}" => $lgStart,
"--col-start-xl: {$xlStart}" => $xlStart,
"--col-start-2xl: {$twoXlStart}" => $twoXlStart,
])
}}
>
{{ $slot }}
</div>

View File

@@ -0,0 +1,53 @@
@props([
'isGrid' => true,
'default' => 1,
'direction' => 'row',
'sm' => null,
'md' => null,
'lg' => null,
'xl' => null,
'twoXl' => null,
])
<div
{{
$attributes
->class([
'grid' => $isGrid && $direction === 'row',
'grid-cols-[--cols-default]' => $default && ($direction === 'row'),
'columns-[--cols-default]' => $default && ($direction === 'column'),
'sm:grid-cols-[--cols-sm]' => $sm && ($direction === 'row'),
'sm:columns-[--cols-sm]' => $sm && ($direction === 'column'),
'md:grid-cols-[--cols-md]' => $md && ($direction === 'row'),
'md:columns-[--cols-md]' => $md && ($direction === 'column'),
'lg:grid-cols-[--cols-lg]' => $lg && ($direction === 'row'),
'lg:columns-[--cols-lg]' => $lg && ($direction === 'column'),
'xl:grid-cols-[--cols-xl]' => $xl && ($direction === 'row'),
'xl:columns-[--cols-xl]' => $xl && ($direction === 'column'),
'2xl:grid-cols-[--cols-2xl]' => $twoXl && ($direction === 'row'),
'2xl:columns-[--cols-2xl]' => $twoXl && ($direction === 'column'),
])
->style(
match ($direction) {
'column' => [
"--cols-default: {$default}" => $default,
"--cols-sm: {$sm}" => $sm,
"--cols-md: {$md}" => $md,
"--cols-lg: {$lg}" => $lg,
"--cols-xl: {$xl}" => $xl,
"--cols-2xl: {$twoXl}" => $twoXl,
],
'row' => [
"--cols-default: repeat({$default}, minmax(0, 1fr))" => $default,
"--cols-sm: repeat({$sm}, minmax(0, 1fr))" => $sm,
"--cols-md: repeat({$md}, minmax(0, 1fr))" => $md,
"--cols-lg: repeat({$lg}, minmax(0, 1fr))" => $lg,
"--cols-xl: repeat({$xl}, minmax(0, 1fr))" => $xl,
"--cols-2xl: repeat({$twoXl}, minmax(0, 1fr))" => $twoXl,
],
},
)
}}
>
{{ $slot }}
</div>