v1.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace zin;
  3. require_once dirname(__DIR__) . DS . 'formrow' . DS . 'v1.php';
  4. require_once dirname(__DIR__) . DS . 'icon' . DS . 'v1.php';
  5. class formRowGroup extends formRow
  6. {
  7. /**
  8. * @var mixed[]
  9. */
  10. protected static $defineProps = array(
  11. 'title: array',
  12. 'items?: array'
  13. );
  14. /**
  15. * @var mixed[]
  16. */
  17. protected static $defineBlocks = array(
  18. 'prefix' => array(),
  19. 'suffix' => array()
  20. );
  21. public static function getPageCSS()
  22. {
  23. return file_get_contents(__DIR__ . DS . 'css' . DS . 'v1.css');
  24. }
  25. protected function build()
  26. {
  27. return formRow
  28. (
  29. setClass('form-row-group border-b border-b-1'),
  30. div
  31. (
  32. $this->block('prefix'),
  33. setClass('row-group-title font-black px-3 py-1'),
  34. $this->prop('title'),
  35. $this->block('suffix')
  36. ),
  37. set($this->getRestProps()),
  38. $this->prop('items')
  39. );
  40. }
  41. }