mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
wip
This commit is contained in:
@@ -5,10 +5,12 @@
|
||||
"dev:js": "node bin/build.js --dev",
|
||||
"dev:forms-css": "npx tailwindcss -c ./packages/support/tailwind.config.js -i ./packages/forms/dist/index.css -o ./packages/forms/dist/index.css --watch",
|
||||
"dev:panels-css": "npx tailwindcss -c ./packages/panels/tailwind.config.js -i ./packages/panels/resources/css/theme.css -o ./packages/panels/dist/theme.css --watch",
|
||||
"dev:support-css": "npx tailwindcss -c ./packages/support/tailwind.config.js -i ./packages/support/dist/index.css -o ./packages/support/dist/index.css --watch",
|
||||
"dev": "npm-run-all --parallel dev:*",
|
||||
"build:js": "node bin/build.js",
|
||||
"build:forms-css": "npx tailwindcss -c ./packages/support/tailwind.config.js -i ./packages/forms/dist/index.css -o ./packages/forms/dist/index.css --minify",
|
||||
"build:panels-css": "npx tailwindcss -c ./packages/panels/tailwind.config.js -i ./packages/panels/resources/css/theme.css -o ./packages/panels/dist/theme.css --minify",
|
||||
"build:support-css": "npx tailwindcss -c ./packages/support/tailwind.config.js -i ./packages/support/dist/index.css -o ./packages/support/dist/index.css --minify",
|
||||
"build": "npm-run-all build:*",
|
||||
"prettier": "npx prettier --write ."
|
||||
},
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -3,5 +3,4 @@ import '../css/components/file-upload.css'
|
||||
import '../css/components/markdown-editor.css'
|
||||
import '../css/components/rich-editor.css'
|
||||
import '../css/components/select.css'
|
||||
import '../css/components/sortable.css'
|
||||
import '../css/components/tags-input.css'
|
||||
|
||||
@@ -6,6 +6,7 @@ use Closure;
|
||||
use Filament\Forms\ComponentContainer;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Components\Builder\Block;
|
||||
use Filament\Support\Concerns\HasReorderAnimationDuration;
|
||||
use Filament\Support\Enums\ActionSize;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -18,6 +19,7 @@ class Builder extends Field implements Contracts\CanConcealComponents
|
||||
use Concerns\CanBeCollapsed;
|
||||
use Concerns\CanLimitItemsLength;
|
||||
use Concerns\CanBeCloned;
|
||||
use HasReorderAnimationDuration;
|
||||
|
||||
/**
|
||||
* @var view-string
|
||||
@@ -30,8 +32,6 @@ class Builder extends Field implements Contracts\CanConcealComponents
|
||||
|
||||
protected bool | Closure $isReorderable = true;
|
||||
|
||||
protected int | Closure $reorderAnimationDuration = 300;
|
||||
|
||||
protected bool | Closure $isReorderableWithDragAndDrop = true;
|
||||
|
||||
protected bool | Closure $isReorderableWithButtons = false;
|
||||
@@ -591,18 +591,6 @@ class Builder extends Field implements Contracts\CanConcealComponents
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function reorderAnimationDuration(int | Closure $animation = 300): static
|
||||
{
|
||||
$this->reorderAnimationDuration = $animation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReorderAnimationDuration()
|
||||
{
|
||||
return (string) $this->evaluate($this->reorderAnimationDuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `addable()` instead.
|
||||
*/
|
||||
|
||||
@@ -5,11 +5,13 @@ namespace Filament\Forms\Components;
|
||||
use Closure;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Support\Concerns\HasExtraAlpineAttributes;
|
||||
use Filament\Support\Concerns\HasReorderAnimationDuration;
|
||||
use Filament\Support\Enums\ActionSize;
|
||||
|
||||
class KeyValue extends Field
|
||||
{
|
||||
use HasExtraAlpineAttributes;
|
||||
use HasReorderAnimationDuration;
|
||||
|
||||
/**
|
||||
* @var view-string
|
||||
@@ -40,8 +42,6 @@ class KeyValue extends Field
|
||||
|
||||
protected bool | Closure $isReorderable = false;
|
||||
|
||||
protected int | Closure $reorderAnimationDuration = 300;
|
||||
|
||||
protected ?Closure $modifyAddActionUsing = null;
|
||||
|
||||
protected ?Closure $modifyDeleteActionUsing = null;
|
||||
@@ -316,18 +316,6 @@ class KeyValue extends Field
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function reorderAnimationDuration(int | Closure $animation): static
|
||||
{
|
||||
$this->reorderAnimationDuration = $animation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReorderAnimationDuration(): int
|
||||
{
|
||||
return $this->evaluate($this->reorderAnimationDuration);
|
||||
}
|
||||
|
||||
public function isAddable(): bool
|
||||
{
|
||||
return (bool) $this->evaluate($this->isAddable);
|
||||
|
||||
@@ -6,6 +6,7 @@ use Closure;
|
||||
use Filament\Forms\ComponentContainer;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Contracts\HasForms;
|
||||
use Filament\Support\Concerns\HasReorderAnimationDuration;
|
||||
use Filament\Support\Enums\ActionSize;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -23,6 +24,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents
|
||||
use Concerns\CanLimitItemsLength;
|
||||
use Concerns\HasContainerGridLayout;
|
||||
use Concerns\CanBeCloned;
|
||||
use HasReorderAnimationDuration;
|
||||
|
||||
protected string | Closure | null $addActionLabel = null;
|
||||
|
||||
@@ -32,8 +34,6 @@ class Repeater extends Field implements Contracts\CanConcealComponents
|
||||
|
||||
protected bool | Closure $isReorderable = true;
|
||||
|
||||
protected int | Closure $reorderAnimationDuration = 300;
|
||||
|
||||
protected bool | Closure $isReorderableWithDragAndDrop = true;
|
||||
|
||||
protected bool | Closure $isReorderableWithButtons = false;
|
||||
@@ -608,18 +608,6 @@ class Repeater extends Field implements Contracts\CanConcealComponents
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function reorderAnimationDuration(int | Closure $animation): static
|
||||
{
|
||||
$this->reorderAnimationDuration = $animation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReorderAnimationDuration(): int
|
||||
{
|
||||
return $this->evaluate($this->reorderAnimationDuration);
|
||||
}
|
||||
|
||||
public function reorderableWithDragAndDrop(bool | Closure $condition = true): static
|
||||
{
|
||||
$this->isReorderableWithDragAndDrop = $condition;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}.tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}
|
||||
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity;white-space:normal}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}.tippy-box[data-theme~=light]{background-color:#fff;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;color:#26323d}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.fi-sortable-ghost{opacity:.3}
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -5,6 +5,7 @@ import Tooltip from '@ryangjchandler/alpine-tooltip'
|
||||
|
||||
import 'tippy.js/dist/tippy.css'
|
||||
import 'tippy.js/themes/light.css'
|
||||
import '../css/sortable.css'
|
||||
|
||||
document.addEventListener('alpine:init', () => {
|
||||
window.Alpine.plugin(AlpineFloatingUI)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Support\Concerns;
|
||||
|
||||
use Closure;
|
||||
|
||||
trait HasReorderAnimationDuration
|
||||
{
|
||||
protected int | Closure $reorderAnimationDuration = 300;
|
||||
|
||||
public function reorderAnimationDuration(int | Closure $animation): static
|
||||
{
|
||||
$this->reorderAnimationDuration = $animation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReorderAnimationDuration(): int
|
||||
{
|
||||
return $this->evaluate($this->reorderAnimationDuration);
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@
|
||||
namespace Filament\Tables\Table\Concerns;
|
||||
|
||||
use Closure;
|
||||
use Filament\Support\Concerns\HasReorderAnimationDuration;
|
||||
use Filament\Tables\Actions\Action;
|
||||
|
||||
trait CanReorderRecords
|
||||
{
|
||||
protected bool | Closure $isReorderable = true;
|
||||
use HasReorderAnimationDuration;
|
||||
|
||||
protected int | Closure $reorderAnimationDuration = 300;
|
||||
protected bool | Closure $isReorderable = true;
|
||||
|
||||
protected string | Closure | null $reorderColumn = null;
|
||||
|
||||
@@ -33,18 +34,6 @@ trait CanReorderRecords
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function reorderAnimationDuration(int | Closure $animation): static
|
||||
{
|
||||
$this->reorderAnimationDuration = $animation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReorderAnimationDuration(): int
|
||||
{
|
||||
return $this->evaluate($this->reorderAnimationDuration);
|
||||
}
|
||||
|
||||
public function getReorderRecordsTriggerAction(bool $isReordering): Action
|
||||
{
|
||||
$action = Action::make('reorderRecords')
|
||||
|
||||
Reference in New Issue
Block a user