承接 valentin-morice/filament-sketchpad 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

valentin-morice/filament-sketchpad

最新稳定版本:1.1.0

Composer 安装命令:

composer require valentin-morice/filament-sketchpad

包简介

A simple package that provides you with a sketchpad field in Filament

README 文档

README

Screenshot from 2024-08-24 15-37-49

A simple package that provides you with a sketchpad field in Filament

Installation

You can install the package via composer:

composer require valentin-morice/filament-sketchpad

Usage

The filament-sketchpad plugin works as any other Filament Form Builder class. Make sure the column on which it is called is cast to JSON.

public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Sketchpad::make('example'),
            ]);
    }

// An infolist component is also available.
public static function infolist(Infolist $infolist): Form
    {
        return $form
            ->schema([
                SketchpadInfolist::make('example'),
            ]);
    }

Set history configuration

// Provide full or partial configuration.
// Keys 'undo' and 'redo' are mandatory.

$config = [
    'undo' => [
         'label' => 'Undo',
         'icon' => 'heroicon-o-arrow-left',
         'color' => 'gray',
    ],
    'redo' => [
            'label' => 'Redo',
            'icon' => 'heroicon-o-arrow-right',
            'color' => 'gray',
    ],
];

FilamentSketchpad::make('example')->history(array |Closure $config);

Set controls configuration

// Provide full or partial configuration.
// Keys 'clear' and 'reset' are mandatory.

$config = [
    'clear' => [
            'label' => 'Clear',
            'icon' => 'heroicon-o-document',
            'color' => 'gray',
    ],
    'reset' => [
            'label' => 'Reset',
            'icon' => 'heroicon-o-trash',
            'color' => 'gray',
    ],
];

FilamentSketchpad::make('example')->controls(array |Closure $config);

Set download configuration

// Provide full or partial configuration.
$config = [
            'label' => 'Download',
            'icon' => 'heroicon-m-arrow-down-tray',
            'color' => 'gray',
          ];

FilamentSketchpad::make('example')->download(array |Closure $config);

Minimal mode

Display only icons instead of buttons.

FilamentSketchpad::make('example')->minimal(bool|Closure $bool = true);

Set the height

FilamentSketchpad::make('example')->height(int 400|Closure); // in px

NOTE: All standard injected utilities are available in your closures.

Thanks to http://yiom.github.io/sketchpad/ for the JS.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 387
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 17
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 2
  • Forks: 1
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-24