first tr classname & hidden mobile controlled
This commit is contained in:
@ -11,6 +11,7 @@ class Td extends Component
|
||||
public $override;
|
||||
|
||||
public $kind;
|
||||
public $hiddenMobile;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
@ -18,11 +19,12 @@ class Td extends Component
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
string $class = '', string $override = '', string $kind = ''
|
||||
string $class = '', string $override = '', string $kind = '', bool $hiddenMobile = false,
|
||||
) {
|
||||
$this->override = $this->getOverride($override);
|
||||
|
||||
$this->kind = $kind;
|
||||
$this->hiddenMobile = $hiddenMobile;
|
||||
$this->class = $this->getClass($class);
|
||||
}
|
||||
|
||||
@ -47,6 +49,10 @@ class Td extends Component
|
||||
return $class;
|
||||
}
|
||||
|
||||
if ($this->hiddenMobile) {
|
||||
$class = $class . ' ' . 'hidden sm:table-cell';
|
||||
}
|
||||
|
||||
$default = 'py-4 whitespace-nowrap text-sm font-normal text-black truncate';
|
||||
|
||||
switch ($this->kind) {
|
||||
|
@ -12,17 +12,20 @@ class Th extends Component
|
||||
|
||||
public $kind;
|
||||
|
||||
public $hiddenMobile;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
string $class = '', string $override = '', string $kind = ''
|
||||
string $class = '', string $override = '', string $kind = '', bool $hiddenMobile = false,
|
||||
) {
|
||||
$this->override = $this->getOverride($override);
|
||||
|
||||
$this->kind = $kind;
|
||||
$this->hiddenMobile = $hiddenMobile;
|
||||
$this->class = $this->getClass($class);
|
||||
}
|
||||
|
||||
@ -47,6 +50,10 @@ class Th extends Component
|
||||
return $class;
|
||||
}
|
||||
|
||||
if ($this->hiddenMobile) {
|
||||
$class = $class . ' ' . 'hidden sm:table-cell';
|
||||
}
|
||||
|
||||
$default = 'py-3 text-xs font-medium text-black tracking-wider';
|
||||
|
||||
switch ($this->kind) {
|
||||
|
@ -45,6 +45,10 @@ class Tr extends Component
|
||||
return 'relative flex items-center px-1 group border-b hover:bg-gray-100';
|
||||
}
|
||||
|
||||
else if (array_key_exists('App\View\Components\Table\Thead', $values)) {
|
||||
return 'flex items-center px-1';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user