定制 flatroy/nova-progressbar-field 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

flatroy/nova-progressbar-field

Composer 安装命令:

composer require flatroy/nova-progressbar-field

包简介

A Laravel Nova progress bar field.

README 文档

README

This package allows you to add progressbar fields to your resources and dashboards in Nova.

It basically takes a field with a decimal value between 0 and 1 and shows it as a percentage progress bar.

To edit a field, we recommend using the standard Number (\Laravel\Nova\Fields\Number) field.

index example

detail example

DISCLAIMER:

This package is still work in progress. Feel free to help improve it.

Original Package

Requirements

Installation

Just run:

composer require flatroy/nova-progressbar-field

After this the setup will be complete, you can use the components listed here.

Basic Usage

// in App\Nova\User
...
use Flatroy\FieldProgressbar\FieldProgressbar;
use Laravel\Nova\Fields\Number;
...

/**
 * Get the fields displayed by the resource.
 *
 * @param \Laravel\Nova\Http\Requests\NovaRequest $request
 * @return array
 */
public function fields(NovaRequest $request)
{
    return [
        Number::make(__('Score'), 'score')
            ->min(0.01)
            ->max(1)
            ->step(0.01)
            ->onlyOnForms(),

        FieldProgressbar::make(__('Score'), 'score')
            ->sortable(),  
    ];
}

Advanced Options

Custom color

public function cards(NovaRequest $request)
{
    return [
        FieldProgressbar::make('Awesomeness')
            ->options([
                'color' => '#FFEA82',
            ]),
    ];
}

Animate Bar Color A -> B

public function cards(NovaRequest $request)
{
    return [
        FieldProgressbar::make('Awesomeness')
            ->options([
                'fromColor' => '#FFEA82',
                'toColor' => '#40BF55',
                'animateColor' => true,
            ]),
    ];
}

Custom text and hide field label

public function cards(NovaRequest $request)
{
    return [
        FieldProgressbar::make('Awesomeness')
                ->hideLabel()
                ->subtitleInDetail('custom subtitle'),
    ];
}

Custom width (small, medium or large)

public function cards(NovaRequest $request)
{
    return [
        FieldProgressbar::make('Awesomeness')
            ->options([
                'width' => 'medium',
            ]),
    ];
}

Feel free to come with suggestions for improvements.

Packages based on this package: nova-progressbar-field by Signifly

统计信息

  • 总下载量: 72.72k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 9
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 3
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固