mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Remove PDF previews
This commit is contained in:
Generated
-13
@@ -35,7 +35,6 @@
|
||||
"filepond-plugin-image-resize": "^2.0.10",
|
||||
"filepond-plugin-image-transform": "^3.8.6",
|
||||
"filepond-plugin-media-preview": "^1.0.9",
|
||||
"filepond-plugin-pdf-preview": "^1.0.4",
|
||||
"laravel-echo": "^1.14.0",
|
||||
"laravel-mix": "^6.0.37",
|
||||
"luxon": "^3.4.3",
|
||||
@@ -5562,18 +5561,6 @@
|
||||
"filepond": ">=4.x <5.x"
|
||||
}
|
||||
},
|
||||
"node_modules/filepond-plugin-pdf-preview": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/filepond-plugin-pdf-preview/-/filepond-plugin-pdf-preview-1.0.4.tgz",
|
||||
"integrity": "sha512-i1sMTfPMTirm5LWYfAihmbr/Ef9UWRNWNL3aKtmluZ+iTAtcNsJJOnXtbptRrF2ngrbr9vpXF5q9/bnCKkbuTA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"filepond": "^4.25.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"filepond": ">=4.x <5.x"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
"filepond-plugin-image-resize": "^2.0.10",
|
||||
"filepond-plugin-image-transform": "^3.8.6",
|
||||
"filepond-plugin-media-preview": "^1.0.9",
|
||||
"filepond-plugin-pdf-preview": "^1.0.4",
|
||||
"laravel-echo": "^1.14.0",
|
||||
"laravel-mix": "^6.0.37",
|
||||
"luxon": "^3.4.3",
|
||||
|
||||
@@ -216,7 +216,6 @@ use Filament\Forms\Components\FileUpload;
|
||||
|
||||
FileUpload::make('attachment')
|
||||
->imagePreviewHeight('250')
|
||||
->pdfPreviewHeight('250')
|
||||
->loadingIndicatorPosition('left')
|
||||
->panelAspectRatio('2:1')
|
||||
->panelLayout('integrated')
|
||||
|
||||
@@ -9,7 +9,6 @@ import FilePondPluginImagePreview from 'filepond-plugin-image-preview'
|
||||
import FilePondPluginImageResize from 'filepond-plugin-image-resize'
|
||||
import FilePondPluginImageTransform from 'filepond-plugin-image-transform'
|
||||
import FilePondPluginMediaPreview from 'filepond-plugin-media-preview'
|
||||
import FilePondPluginPdfPreview from 'filepond-plugin-pdf-preview'
|
||||
|
||||
FilePond.registerPlugin(FilePondPluginFileValidateSize)
|
||||
FilePond.registerPlugin(FilePondPluginFileValidateType)
|
||||
@@ -20,7 +19,6 @@ FilePond.registerPlugin(FilePondPluginImagePreview)
|
||||
FilePond.registerPlugin(FilePondPluginImageResize)
|
||||
FilePond.registerPlugin(FilePondPluginImageTransform)
|
||||
FilePond.registerPlugin(FilePondPluginMediaPreview)
|
||||
FilePond.registerPlugin(FilePondPluginPdfPreview)
|
||||
|
||||
window.FilePond = FilePond
|
||||
|
||||
@@ -57,8 +55,6 @@ export default function fileUploadFormComponent({
|
||||
minSize,
|
||||
panelAspectRatio,
|
||||
panelLayout,
|
||||
pdfPreviewHeight,
|
||||
pdfPreviewParams,
|
||||
placeholder,
|
||||
removeUploadedFileButtonPosition,
|
||||
removeUploadedFileUsing,
|
||||
@@ -105,7 +101,6 @@ export default function fileUploadFormComponent({
|
||||
allowVideoPreview: isPreviewable,
|
||||
allowAudioPreview: isPreviewable,
|
||||
allowImageTransform: shouldTransformImage,
|
||||
allowPdfPreview: isPreviewable,
|
||||
credits: false,
|
||||
files: await this.getFiles(),
|
||||
imageCropAspectRatio,
|
||||
@@ -124,8 +119,6 @@ export default function fileUploadFormComponent({
|
||||
stylePanelAspectRatio: panelAspectRatio,
|
||||
stylePanelLayout: panelLayout,
|
||||
styleProgressIndicatorPosition: uploadProgressIndicatorPosition,
|
||||
pdfPreviewHeight,
|
||||
pdfComponentExtraParams: pdfPreviewParams,
|
||||
server: {
|
||||
load: async (source, load) => {
|
||||
let response = await fetch(source, {
|
||||
|
||||
@@ -68,8 +68,6 @@
|
||||
locale: @js(app()->getLocale()),
|
||||
panelAspectRatio: @js($getPanelAspectRatio()),
|
||||
panelLayout: @js($getPanelLayout()),
|
||||
pdfPreviewHeight: @js($getPdfPreviewHeight()),
|
||||
pdfPreviewParams: @js($getPdfPreviewParams()),
|
||||
placeholder: @js($getPlaceholder()),
|
||||
maxSize: @js(($size = $getMaxSize()) ? "'{$size} KB'" : null),
|
||||
minSize: @js(($size = $getMinSize()) ? "'{$size} KB'" : null),
|
||||
|
||||
@@ -22,13 +22,6 @@ class FileUpload extends BaseFileUpload
|
||||
*/
|
||||
protected string $view = 'filament-forms::components.file-upload';
|
||||
|
||||
protected string | Closure | null $pdfPreviewHeight = '320';
|
||||
|
||||
/**
|
||||
* @var array<string, mixed> | Closure | null
|
||||
*/
|
||||
protected array | Closure | null $pdfPreviewParams = ['toolbar' => 0, 'view' => 'fit'];
|
||||
|
||||
protected string | Closure | null $imageCropAspectRatio = null;
|
||||
|
||||
protected string | Closure | null $imagePreviewHeight = null;
|
||||
@@ -123,23 +116,6 @@ class FileUpload extends BaseFileUpload
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function pdfPreviewHeight(string | Closure | null $height): static
|
||||
{
|
||||
$this->pdfPreviewHeight = $height;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> | Closure | null $params
|
||||
*/
|
||||
public function pdfPreviewParams(array | Closure | null $params): static
|
||||
{
|
||||
$this->pdfPreviewParams = $params;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function imageCropAspectRatio(string | Closure | null $ratio): static
|
||||
{
|
||||
$this->imageCropAspectRatio = $ratio;
|
||||
@@ -241,18 +217,6 @@ class FileUpload extends BaseFileUpload
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPdfPreviewHeight(): ?string
|
||||
{
|
||||
return $this->evaluate($this->pdfPreviewHeight);
|
||||
}
|
||||
|
||||
public function getPdfPreviewParams(): ?string
|
||||
{
|
||||
$params = $this->evaluate($this->pdfPreviewParams);
|
||||
|
||||
return http_build_query($params);
|
||||
}
|
||||
|
||||
public function getImageCropAspectRatio(): ?string
|
||||
{
|
||||
return $this->evaluate($this->imageCropAspectRatio);
|
||||
|
||||
Reference in New Issue
Block a user