Popover.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * PHP表单生成器
  4. *
  5. * @package FormBuilder
  6. * @author xaboy <xaboy2005@qq.com>
  7. * @version 2.0
  8. * @license MIT
  9. * @link https://github.com/xaboy/form-builder
  10. * @document http://php.form-create.com
  11. */
  12. namespace FormBuilder\UI\Elm\Components;
  13. use FormBuilder\Driver\CustomComponent;
  14. /**
  15. * Class Popover
  16. *
  17. * @method $this trigger(string $trigger) 触发方式, 可选值: click/focus/hover/manual, 默认值: click
  18. * @method $this popoverTitle(string $title) 标题
  19. * @method $this content(string $content) 显示的内容,也可以通过 slot 传入 DOM
  20. * @method $this width(string $width) 宽度, 默认值: 最小宽度 150px
  21. * @method $this placement(string $placement) 出现位置, 可选值: top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end, 默认值: bottom
  22. * @method $this disabled(boolean $disabled) Popover 是否可用, 默认值: false
  23. * @method $this offset(number $offset) 出现位置的偏移量
  24. * @method $this transition(string $transition) 定义渐变动画, 默认值: fade-in-linear
  25. * @method $this visibleArrow(boolean $visibleArrow) 是否显示 Tooltip 箭头,更多参数可见Vue-popper, 默认值: true
  26. * @method $this popperOptions(object $popperOptions) popper.js 的参数, 可选值: 参考 popper.js 文档, 默认值: {boundariesElement: 'body', gpuAcceleration: false}
  27. * @method $this popperClass(string $popperClass) 为 popper 添加类名
  28. * @method $this openDelay(number $openDelay) 触发方式为 hover 时的显示延迟,单位为毫秒
  29. * @method $this closeDelay(float $closeDelay) 触发方式为 hover 时的隐藏延迟,单位为毫秒, 默认值: 200
  30. * @method $this tabindex(float $tabindex) Popover 组件的 tabindex
  31. */
  32. class Popover extends CustomComponent
  33. {
  34. protected static $propsRule = [
  35. 'trigger' => 'string',
  36. 'title' => 'string',
  37. 'content' => 'string',
  38. 'width' => 'string',
  39. 'placement' => 'string',
  40. 'disabled' => 'boolean',
  41. 'popoverTitle' => ['string', 'title'],
  42. 'offset' => 'number',
  43. 'transition' => 'string',
  44. 'visibleArrow' => 'boolean',
  45. 'popperOptions' => 'object',
  46. 'popperClass' => 'string',
  47. 'openDelay' => 'number',
  48. 'closeDelay' => 'float',
  49. 'tabindex' => 'float',
  50. ];
  51. }