From d7e3a725ac61704c3dc62076cdb56d1acb5de38d Mon Sep 17 00:00:00 2001 From: ygbanzato Date: Tue, 9 Jan 2024 12:09:27 +0000 Subject: [PATCH] Test to use snappy pdf, but only with Dompdf were we able to make the reports. Create a reporting system, in which reporting by Ambit has already been completed. --- app/DataTables/UsersDataTable.php | 110 +++ app/Http/Controllers/ClientController.php | 68 +- .../Controllers/CreateProjectController.php | 30 +- app/Http/Middleware/CheckUserType.php | 12 +- app/Models/EquipmentWorkHistory.php | 11 + composer.json | 1 + composer.lock | 158 +++- config/datatables-buttons.php | 91 ++ .../vendor/datatables/buttons.server-side.js | 284 ++++++ .../articulated_2_ShowEquipment.blade.php | 2 +- .../views/testeRelatorioblk.blade copy.php | 120 --- .../equipmentsForAmbitPdf.blade.php | 199 +++++ ...llEquipmentsForAmbitProject.blade copy.php | 136 --- ...tingAllEquipmentsForAmbitProject.blade.php | 84 -- .../userClient/reportingDataClient.blade.php | 18 +- .../showDataDetailsProjectClient.blade.php | 404 ++++----- ...tingAllEquipmentsForAmbitProject.blade.php | 99 +++ .../views/vendor/datatables/print.blade.php | 37 + routes/web.php | 48 +- vendor/composer/autoload_classmap.php | 72 +- vendor/composer/autoload_files.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_static.php | 76 +- vendor/composer/installed.json | 162 ++++ vendor/composer/installed.php | 22 +- .../laravel-datatables-buttons/CHANGELOG.md | 38 + .../CONTRIBUTING.md | 19 + .../laravel-datatables-buttons/LICENSE.md | 22 + .../laravel-datatables-buttons/README.md | 62 ++ .../laravel-datatables-buttons/composer.json | 65 ++ .../src/ButtonsServiceProvider.php | 70 ++ .../src/Contracts/DataTableButtons.php | 34 + .../src/Contracts/DataTableHtmlBuilder.php | 13 + .../src/Contracts/DataTableScope.php | 14 + .../Exports/DataTablesCollectionExport.php | 49 ++ .../src/Generators/DataTablesHtmlCommand.php | 97 +++ .../src/Generators/DataTablesMakeCommand.php | 423 +++++++++ .../src/Generators/DataTablesScopeCommand.php | 54 ++ .../src/Generators/stubs/builder.stub | 48 + .../src/Generators/stubs/datatables.stub | 76 ++ .../src/Generators/stubs/html.stub | 45 + .../src/Generators/stubs/scopes.stub | 19 + .../src/Html/DataTableHtml.php | 58 ++ .../src/Services/DataTable.php | 819 ++++++++++++++++++ .../src/Services/DataTablesExportHandler.php | 9 + .../src/Transformers/DataArrayTransformer.php | 87 ++ .../src/config/config.php | 91 ++ .../resources/assets/buttons.server-side.js | 284 ++++++ .../src/resources/views/print.blade.php | 37 + .../laravel-datatables-html/CHANGELOG.md | 101 +++ .../yajra/laravel-datatables-html/CONDUCT.md | 22 + .../yajra/laravel-datatables-html/LICENSE.md | 22 + .../yajra/laravel-datatables-html/README.md | 79 ++ .../yajra/laravel-datatables-html/UPGRADE.md | 1 + .../laravel-datatables-html/composer.json | 49 ++ .../yajra/laravel-datatables-html/phpunit.xml | 17 + .../src/Html/Builder.php | 312 +++++++ .../src/Html/Button.php | 445 ++++++++++ .../src/Html/Column.php | 631 ++++++++++++++ .../src/Html/ColumnDefinition.php | 55 ++ .../src/Html/ColumnDefinitions.php | 10 + .../src/Html/Columns/Action.php | 39 + .../src/Html/Columns/Checkbox.php | 42 + .../src/Html/Columns/Index.php | 36 + .../src/Html/Editor/Editor.php | 324 +++++++ .../src/Html/Editor/Fields/BelongsTo.php | 31 + .../src/Html/Editor/Fields/Boolean.php | 20 + .../src/Html/Editor/Fields/Checkbox.php | 8 + .../src/Html/Editor/Fields/Date.php | 18 + .../src/Html/Editor/Fields/DateTime.php | 166 ++++ .../src/Html/Editor/Fields/Field.php | 398 +++++++++ .../src/Html/Editor/Fields/File.php | 205 +++++ .../src/Html/Editor/Fields/Hidden.php | 8 + .../src/Html/Editor/Fields/Image.php | 23 + .../src/Html/Editor/Fields/Number.php | 11 + .../src/Html/Editor/Fields/Options.php | 125 +++ .../src/Html/Editor/Fields/Password.php | 8 + .../src/Html/Editor/Fields/Radio.php | 8 + .../src/Html/Editor/Fields/ReadOnlyField.php | 8 + .../src/Html/Editor/Fields/Select.php | 84 ++ .../src/Html/Editor/Fields/Select2.php | 135 +++ .../src/Html/Editor/Fields/Text.php | 7 + .../src/Html/Editor/Fields/TextArea.php | 26 + .../src/Html/Editor/Fields/Time.php | 30 + .../src/Html/Editor/FormOptions.php | 211 +++++ .../src/Html/Editor/HasEvents.php | 84 ++ .../src/Html/HasAuthorizations.php | 117 +++ .../src/Html/HasEditor.php | 76 ++ .../src/Html/HasOptions.php | 401 +++++++++ .../src/Html/HasTable.php | 205 +++++ .../src/Html/HtmlBuilder.php | 578 ++++++++++++ .../src/Html/Options/HasAjax.php | 191 ++++ .../src/Html/Options/HasCallbacks.php | 230 +++++ .../src/Html/Options/HasColumns.php | 189 ++++ .../src/Html/Options/HasFeatures.php | 179 ++++ .../Html/Options/HasInternationalisation.php | 217 +++++ .../src/Html/Options/Languages/Aria.php | 102 +++ .../src/Html/Options/Languages/AutoFill.php | 102 +++ .../src/Html/Options/Languages/Paginate.php | 66 ++ .../src/Html/Options/Languages/Select.php | 54 ++ .../src/Html/Options/Plugins/AutoFill.php | 135 +++ .../src/Html/Options/Plugins/Buttons.php | 58 ++ .../src/Html/Options/Plugins/ColReorder.php | 99 +++ .../src/Html/Options/Plugins/FixedColumns.php | 74 ++ .../src/Html/Options/Plugins/FixedHeader.php | 86 ++ .../src/Html/Options/Plugins/KeyTable.php | 182 ++++ .../src/Html/Options/Plugins/Responsive.php | 129 +++ .../src/Html/Options/Plugins/RowGroup.php | 134 +++ .../src/Html/Options/Plugins/RowReorder.php | 122 +++ .../src/Html/Options/Plugins/Scroller.php | 98 +++ .../src/Html/Options/Plugins/SearchPanes.php | 54 ++ .../src/Html/Options/Plugins/Select.php | 216 +++++ .../src/Html/Parameters.php | 18 + .../src/Html/SearchPane.php | 348 ++++++++ .../src/HtmlServiceProvider.php | 47 + .../src/resources/config/config.php | 27 + .../src/resources/views/editor.blade.php | 15 + .../src/resources/views/function.blade.php | 14 + .../views/functions/batch_remove.blade.php | 14 + .../src/resources/views/options.blade.php | 6 + .../src/resources/views/scout.blade.php | 23 + .../src/resources/views/script.blade.php | 4 + 122 files changed, 12605 insertions(+), 585 deletions(-) create mode 100644 app/DataTables/UsersDataTable.php create mode 100644 app/Models/EquipmentWorkHistory.php create mode 100644 config/datatables-buttons.php create mode 100644 public/vendor/datatables/buttons.server-side.js delete mode 100644 resources/views/testeRelatorioblk.blade copy.php create mode 100644 resources/views/userClient/pdfReportings/equipmentsForAmbitPdf.blade.php delete mode 100644 resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade copy.php delete mode 100644 resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade.php create mode 100644 resources/views/userClient/showReportingAllEquipmentsForAmbitProject.blade.php create mode 100644 resources/views/vendor/datatables/print.blade.php create mode 100644 vendor/yajra/laravel-datatables-buttons/CHANGELOG.md create mode 100644 vendor/yajra/laravel-datatables-buttons/CONTRIBUTING.md create mode 100644 vendor/yajra/laravel-datatables-buttons/LICENSE.md create mode 100644 vendor/yajra/laravel-datatables-buttons/README.md create mode 100644 vendor/yajra/laravel-datatables-buttons/composer.json create mode 100644 vendor/yajra/laravel-datatables-buttons/src/ButtonsServiceProvider.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Contracts/DataTableButtons.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Contracts/DataTableHtmlBuilder.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Contracts/DataTableScope.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Exports/DataTablesCollectionExport.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesHtmlCommand.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesMakeCommand.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesScopeCommand.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/builder.stub create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/datatables.stub create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/html.stub create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/scopes.stub create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Html/DataTableHtml.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Services/DataTable.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Services/DataTablesExportHandler.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/Transformers/DataArrayTransformer.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/config/config.php create mode 100644 vendor/yajra/laravel-datatables-buttons/src/resources/assets/buttons.server-side.js create mode 100644 vendor/yajra/laravel-datatables-buttons/src/resources/views/print.blade.php create mode 100644 vendor/yajra/laravel-datatables-html/CHANGELOG.md create mode 100644 vendor/yajra/laravel-datatables-html/CONDUCT.md create mode 100644 vendor/yajra/laravel-datatables-html/LICENSE.md create mode 100644 vendor/yajra/laravel-datatables-html/README.md create mode 100644 vendor/yajra/laravel-datatables-html/UPGRADE.md create mode 100644 vendor/yajra/laravel-datatables-html/composer.json create mode 100644 vendor/yajra/laravel-datatables-html/phpunit.xml create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Builder.php create mode 100755 vendor/yajra/laravel-datatables-html/src/Html/Button.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Column.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinition.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinitions.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Columns/Action.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Columns/Checkbox.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Columns/Index.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Editor.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/BelongsTo.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Boolean.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Checkbox.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Date.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/DateTime.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Field.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/File.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Hidden.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Image.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Number.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Options.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Password.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Radio.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/ReadOnlyField.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Select.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Select2.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Text.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/TextArea.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Time.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/FormOptions.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Editor/HasEvents.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/HasAuthorizations.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/HasEditor.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/HasOptions.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/HasTable.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/HtmlBuilder.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/HasAjax.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/HasCallbacks.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/HasColumns.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/HasFeatures.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/HasInternationalisation.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Aria.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/AutoFill.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Paginate.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Select.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/AutoFill.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Buttons.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/ColReorder.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedColumns.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedHeader.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/KeyTable.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Responsive.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowGroup.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowReorder.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Scroller.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/SearchPanes.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Select.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/Parameters.php create mode 100644 vendor/yajra/laravel-datatables-html/src/Html/SearchPane.php create mode 100644 vendor/yajra/laravel-datatables-html/src/HtmlServiceProvider.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/config/config.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/views/editor.blade.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/views/function.blade.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/views/functions/batch_remove.blade.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/views/options.blade.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/views/scout.blade.php create mode 100644 vendor/yajra/laravel-datatables-html/src/resources/views/script.blade.php diff --git a/app/DataTables/UsersDataTable.php b/app/DataTables/UsersDataTable.php new file mode 100644 index 00000000..8d294532 --- /dev/null +++ b/app/DataTables/UsersDataTable.php @@ -0,0 +1,110 @@ +addColumn('action', 'users.action') + ->setRowId('id'); + } + + /** + * Get the query source of dataTable. + */ + // public function query(User $model): QueryBuilder + // { + // return $model->newQuery(); + // } + + public function query() + { + $query = Equipment::select(['ispt_number', 'unit_id', 'equipment_tag']); + return $this->applyScopes($query); + } + + /** + * Optional method if you want to use the html builder. + */ + // public function html(): HtmlBuilder + // { + // return $this->builder() + // ->setTableId('users-table') + // ->columns($this->getColumns()) + // ->minifiedAjax() + // //->dom('Bfrtip') + // ->orderBy(1) + // ->selectStyleSingle() + // ->buttons([ + // // Button::make('excel'), + // // Button::make('csv'), + // Button::make('pdf'), + // // Button::make('print'), + // // Button::make('reset'), + // // Button::make('reload') + // ]); + // } + public function html() +{ + return $this->builder() + ->setTableId('Equipments') + ->columns($this->getColumns()) + // Outras configurações necessárias ... + ->minifiedAjax() + ->dom('Bfrtip') + ->orderBy(1); +} + + /** + * Get the dataTable columns definition. + */ + // public function getColumns(): array + // { + // return [ + // Column::computed('action') + // ->exportable(false) + // ->printable(false) + // ->width(60) + // ->addClass('text-center'), + // Column::make('id'), + // Column::make('add your columns'), + // Column::make('created_at'), + // Column::make('updated_at'), + // ]; + // } + + protected function getColumns() +{ + return [ + 'ispt_number', + 'unit_id', + 'equipment_tag', + ]; +} + + /** + * Get the filename for export. + */ + protected function filename(): string + { + return 'Users_' . date('YmdHis'); + } +} diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 060224d6..8a75873e 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -19,23 +19,66 @@ class ClientController extends Controller { - public function showReportingForAmbitsProject($dataAmbit, $projectId) + + public function showReportingForAmbitsProject($ambitId, $projectId) + { + $dataAmbit = AmbitsEquipment::where('ambits_id', $ambitId)->first(); + // $receiveDataEquipments = Equipment::where('company_projects_id', $projectId)->get(); + + return view('userClient.showReportingAllEquipmentsForAmbitProject', compact('ambitId', 'projectId','dataAmbit')); + + } + public function getEquipmentsOfAmbit(Request $request) + { + + $projectId = $request->get('projectId'); + $ambitId = $request->get('ambitId'); + + $dataAmbit = AmbitsEquipment::where('ambits_id', $ambitId)->first(); + + $receiveDataEquipments = Equipment::where('company_projects_id', $projectId)->get(); + + $filteredAssociations = EquipmentAssociationAmbit::where('ambits_id', $dataAmbit->ambits_id) + ->whereIn('equipment_id', $receiveDataEquipments->pluck('equipment_id')) + ->get(); + + $query = Equipment::whereIn('equipment_id', $filteredAssociations->pluck('equipment_id'))->get(); + // $query = Equipment::select(['ispt_number', 'unit_id', 'equipment_tag'])->get(); + + return DataTables::of($query) + // Adicione aqui qualquer manipulação de dados ou colunas adicionais que você precise + ->make(true); + } + + + public function showReportingForAmbitsProjectPdf($ambitId, $projectId) { // Obter o caminho da imagem do usuário ou uma imagem padrão $userLogoPath = Auth::user()->user_logo ? public_path('user_logos/' . Auth::user()->user_logo) : public_path('user_logos/logoISPT4.0.jpg'); - // $pdf = PDF::loadView('userClient.pdfReportings.showReportingAllEquipmentsForAmbitProject', [ - // 'userLogoPath' => $userLogoPath, - // 'dataAmbit' => $dataAmbit, - // 'projectId' => $projectId - // ])->setPaper('a4', 'landscape'); - // return $pdf->stream('relatorio_teste.pdf'); + $dataAmbit = AmbitsEquipment::where('ambits_id', $ambitId)->first(); - return view('userClient.pdfReportings.showReportingAllEquipmentsForAmbitProject', [ + $receiveDataEquipments = Equipment::where('company_projects_id', $projectId)->get(); + + $filteredAssociations = EquipmentAssociationAmbit::where('ambits_id', $dataAmbit->ambits_id) + ->whereIn('equipment_id', $receiveDataEquipments->pluck('equipment_id')) + ->get(); + + $equipmentDetails = Equipment::whereIn('equipment_id', $filteredAssociations->pluck('equipment_id'))->get(); + + $pdf = PDF::loadView('userClient.pdfReportings.equipmentsForAmbitPdf', [ + 'equipmentDetails' => $equipmentDetails, 'userLogoPath' => $userLogoPath, 'dataAmbit' => $dataAmbit, 'projectId' => $projectId - ]); + ])->setPaper('a4', 'landscape'); + return $pdf->stream('relatorio_teste.pdf'); + + // return view('userClient.pdfReportings.showReportingAllEquipmentsForAmbitProject', [ + // 'userLogoPath' => $userLogoPath, + // 'dataAmbit' => $dataAmbit, + // 'projectId' => $projectId + // ]); } public function getDataAllEquipmentsForAmbitOfProject(Request $request) @@ -62,8 +105,8 @@ public function getDataAllEquipmentsForAmbitOfProject(Request $request) $equipmentsQuery = Equipment::whereIn('equipment_id', $equipmentsOfProject) ->whereHas('equipmentAssociationAmbit', function ($q) use ($dataAmbit) { $q->where('ambits_id', $dataAmbit); - }) - ->select(['equipment_id','ispt_number', 'unit_id', 'equipment_tag']); // Selecionar apenas as colunas necessárias + }) + ->select(['equipment_id', 'ispt_number', 'unit_id', 'equipment_tag']); // Selecionar apenas as colunas necessárias // Utilize o Yajra DataTables para formatar a resposta return DataTables::of($equipmentsQuery) @@ -92,7 +135,7 @@ public function getDataAmbitsOfProject(Request $request) })->count(); }) ->addColumn('action', function ($dataAmbitProject) use ($projectId) { // Incluindo $projectId no escopo da função anônima - $actionBtn = ''; + $actionBtn = ''; return $actionBtn; }) ->make(true); @@ -161,7 +204,6 @@ public function showDataDetailsProjectClient($projectID) // Recebe os dados de cada Ambito $receiveDataAmbitsProject = AmbitsEquipment::whereIn('ambits_id', $AmbitsId)->get(); - return view('userClient.showDataDetailsProjectClient', compact('receiveDataProject', 'receiveUnitsOfProject', 'receiveAllTypeEquipments', 'receiveDataAmbitsProject', 'AmbitsIdString')); } diff --git a/app/Http/Controllers/CreateProjectController.php b/app/Http/Controllers/CreateProjectController.php index 088f43c9..85c49cb3 100755 --- a/app/Http/Controllers/CreateProjectController.php +++ b/app/Http/Controllers/CreateProjectController.php @@ -849,7 +849,7 @@ public function receiveIdEquipment(Equipment $equipment) public function processStep2(Request $request) { - + // dd($request); // Valide e processe os dados do formulário $file = $request->file('documento'); @@ -867,12 +867,15 @@ public function processStep2(Request $request) // Obtenha a primeira planilha, onde fica os nomes chaves para associar a tabela : general_attributes_equipaments $worksheet = $spreadsheet->getSheet(0); + // Transforme os dados da planilha em um array $data = $worksheet->toArray(); // Retorna um array com todos os names preenchidos na primeira linha do template de Excel $nomesColunas = $data[0]; + // dd($nomesColunas); + $countPendingEquipments = 0; $countNewEquipment = 0; @@ -893,7 +896,7 @@ public function processStep2(Request $request) continue; } - // Em cada um das linhas horizontais do excel, vai se guardar a 'key' vinculada ao valor do campo preenchido ou seja a 'key' vai ter o mesmo nome de um dos dados da tabela : general_attributes_equipaments na coluna : general_attributes_equipment_description, assim sendo mais facil implementar na tabela : specific_attributes_equipament_types + // Em cada um das linhas horizontais do excel, vai se guardar a 'key' vinculada ao valor do campo preenchido ou seja a 'key' vai ter o mesmo nome de um dos dados da tabela 'general_attributes_equipaments' na coluna : general_attributes_equipment_description, assim sendo mais facil implementar na tabela : specific_attributes_equipament_types $juntarArrays = array_combine($nomesColunas, $dadosLinha); // vai guardar todos os campos de possiveis novos equipamentos, cada um em um array para multiplos inserts, na base de dados @@ -902,14 +905,14 @@ public function processStep2(Request $request) }, ARRAY_FILTER_USE_KEY); //Indentifica qual o tipo de equipamento selecionado de acordo com a tabela EquipmentType - $equipmentType = EquipmentType::where('equipment_type_name', $datas['tipo_equipamento'])->first(); + $equipmentType = EquipmentType::where('equipment_type_name', $datas['equipment_type_name'])->first(); - $checkFactory = Unit::where('unit_name', $datas['fabrica'])->first(); + $checkFactory = Unit::where('unit_name', $datas['unit'])->first(); // Antes de criar o novo equipamento, verifique se já existe um equipamento // com o mesmo factory_id e tag. $existingEquipment = Equipment::where('unit_id', $checkFactory->unit_id) - ->where('equipment_tag', $datas['tag']) + ->where('equipment_tag', $datas['equipment_tag']) ->first(); if ($existingEquipment) { @@ -938,10 +941,11 @@ public function processStep2(Request $request) $newEquipament->unit_id = $checkFactory->unit_id; $newEquipament->equipment_type_id = $equipmentType->equipment_type_id; - $newEquipament->equipment_Description = $datas['equipment_Description']; - $newEquipament->equipment_tag = $datas['tag']; - $newEquipament->equipment_serial_number = $datas['n_serie']; - $newEquipament->equipment_model = $datas['modelo']; + $newEquipament->equipment_Description = $datas['equipment_description']; + $newEquipament->equipment_tag = $datas['equipment_tag']; + $newEquipament->equipment_serial_number = $datas['equipment_serial_number']; + $newEquipament->equipment_brand = $datas['equipment_brand']; + $newEquipament->equipment_model = $datas['equipment_model']; $newEquipament->ispt_number = $isptNumber; $newEquipament->company_projects_id = $company_projects_id; @@ -955,7 +959,8 @@ public function processStep2(Request $request) $receveEquipment_ID = $newEquipament->equipment_id; $receveEquipament_type_ID = $newEquipament->equipment_type_id; - $ambit = AmbitsEquipment::where('ambits_description', $datas['ambito'])->first(); + + $ambit = AmbitsEquipment::where('ambits_description', $datas['ambit'])->first(); if ($ambit) { $ambit_id = $ambit->ambits_id; @@ -987,18 +992,19 @@ public function processStep2(Request $request) $generalAttributes = GeneralAttributesEquipment::all(); + foreach ($generalAttributes as $generalAttribute) { // Verifica se a chave existe em $datas, comparando com os dados da tabela : GeneralAttributesEquipment assim adicionando todos diferentes de NULL relacionados com o equipamento acabado de cria if (isset($datas[$generalAttribute->general_attributes_equipment_description])) { - $specificAttribute = new SpecificAttributesEquipmentType; + $specificAttribute = new SpecificAttributesEquipmentType; $specificAttribute->equipment_id = $receveEquipment_ID; $specificAttribute->equipment_type_id = $receveEquipament_type_ID; $specificAttribute->general_attributes_equipment_id = $generalAttribute->general_attributes_equipment_id; // Atribui o valor da chave correspondente em $datas $specificAttribute->specific_attributes_value = $datas[$generalAttribute->general_attributes_equipment_description]; - // $specificAttribute->save(); + $specificAttribute->save(); } } } diff --git a/app/Http/Middleware/CheckUserType.php b/app/Http/Middleware/CheckUserType.php index 7c8269e8..ac578601 100755 --- a/app/Http/Middleware/CheckUserType.php +++ b/app/Http/Middleware/CheckUserType.php @@ -53,8 +53,16 @@ protected function getAllowedRoutesForUserType($userType) switch ($userType) { case 5: // Técnico return ['enterWorkstation', 'getEquipmentData', 'receiveAnswersEquipment']; - case 3: // Empresa - return ['dashboardClient', 'manageAssetsClient', 'ExecutionProject','reportingDataClient']; + case 3: + // Empresa + return ['dashboardClient','reportingDataClient', 'manageAssetsClient', + // Obras em Execussao + 'ExecutionProject', + //Relatorios + 'showDataDetailsProjectClient','showReportingForAmbitsProject', + //Api.s + 'getDataAmbitsOfProject','getDataEquipmentsOfProject','getEquipmentsOfAmbit' + ]; // Adicione mais casos conforme necessário... default: diff --git a/app/Models/EquipmentWorkHistory.php b/app/Models/EquipmentWorkHistory.php new file mode 100644 index 00000000..37797189 --- /dev/null +++ b/app/Models/EquipmentWorkHistory.php @@ -0,0 +1,11 @@ + [ + /* + * Base namespace/directory to create the new file. + * This is appended on default Laravel namespace. + * Usage: php artisan datatables:make User + * Output: App\DataTables\UserDataTable + * With Model: App\User (default model) + * Export filename: users_timestamp + */ + 'base' => 'DataTables', + + /* + * Base namespace/directory where your model's are located. + * This is appended on default Laravel namespace. + * Usage: php artisan datatables:make Post --model + * Output: App\DataTables\PostDataTable + * With Model: App\Post + * Export filename: posts_timestamp + */ + 'model' => 'App\\Models', + ], + + /* + * Set Custom stub folder + */ + //'stub' => '/resources/custom_stub', + + /* + * PDF generator to be used when converting the table to pdf. + * Available generators: excel, snappy + * Snappy package: barryvdh/laravel-snappy + * Excel package: maatwebsite/excel + */ + 'pdf_generator' => 'snappy', + + /* + * Snappy PDF options. + */ + 'snappy' => [ + 'options' => [ + 'no-outline' => true, + 'margin-left' => '0', + 'margin-right' => '0', + 'margin-top' => '10mm', + 'margin-bottom' => '10mm', + ], + 'orientation' => 'landscape', + ], + + /* + * Default html builder parameters. + */ + 'parameters' => [ + 'dom' => 'Bfrtip', + 'order' => [[0, 'desc']], + 'buttons' => [ + 'excel', + 'csv', + 'pdf', + 'print', + 'reset', + 'reload', + ], + ], + + /* + * Generator command default options value. + */ + 'generator' => [ + /* + * Default columns to generate when not set. + */ + 'columns' => 'id,add your columns,created_at,updated_at', + + /* + * Default buttons to generate when not set. + */ + 'buttons' => 'excel,csv,pdf,print,reset,reload', + + /* + * Default DOM to generate when not set. + */ + 'dom' => 'Bfrtip', + ], +]; diff --git a/public/vendor/datatables/buttons.server-side.js b/public/vendor/datatables/buttons.server-side.js new file mode 100644 index 00000000..e012c9bc --- /dev/null +++ b/public/vendor/datatables/buttons.server-side.js @@ -0,0 +1,284 @@ +(function ($, DataTable) { + "use strict"; + + var _buildParams = function (dt, action, onlyVisibles) { + var params = dt.ajax.params(); + params.action = action; + params._token = $('meta[name="csrf-token"]').attr('content'); + + if (onlyVisibles) { + params.visible_columns = _getVisibleColumns(); + } else { + params.visible_columns = null; + } + + return params; + }; + + var _getVisibleColumns = function () { + + var visible_columns = []; + $.each(DataTable.settings[0].aoColumns, function (key, col) { + if (col.bVisible) { + visible_columns.push(col.name); + } + }); + + return visible_columns; + }; + + var _downloadFromUrl = function (url, params) { + var postUrl = url + '/export'; + var xhr = new XMLHttpRequest(); + xhr.open('POST', postUrl, true); + xhr.responseType = 'arraybuffer'; + xhr.onload = function () { + if (this.status === 200) { + var filename = ""; + var disposition = xhr.getResponseHeader('Content-Disposition'); + if (disposition && disposition.indexOf('attachment') !== -1) { + var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; + var matches = filenameRegex.exec(disposition); + if (matches != null && matches[1]) filename = matches[1].replace(/['"]/g, ''); + } + var type = xhr.getResponseHeader('Content-Type'); + + var blob = new Blob([this.response], {type: type}); + if (typeof window.navigator.msSaveBlob !== 'undefined') { + // IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed." + window.navigator.msSaveBlob(blob, filename); + } else { + var URL = window.URL || window.webkitURL; + var downloadUrl = URL.createObjectURL(blob); + + if (filename) { + // use HTML5 a[download] attribute to specify filename + var a = document.createElement("a"); + // safari doesn't support this yet + if (typeof a.download === 'undefined') { + window.location = downloadUrl; + } else { + a.href = downloadUrl; + a.download = filename; + document.body.appendChild(a); + a.click(); + } + } else { + window.location = downloadUrl; + } + + setTimeout(function () { + URL.revokeObjectURL(downloadUrl); + }, 100); // cleanup + } + } + }; + xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + xhr.send($.param(params)); + }; + + var _buildUrl = function(dt, action) { + var url = dt.ajax.url() || ''; + var params = dt.ajax.params(); + params.action = action; + + if (url.indexOf('?') > -1) { + return url + '&' + $.param(params); + } + + return url + '?' + $.param(params); + }; + + DataTable.ext.buttons.excel = { + className: 'buttons-excel', + + text: function (dt) { + return ' ' + dt.i18n('buttons.excel', 'Excel'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'excel'); + window.location = url; + } + }; + + DataTable.ext.buttons.postExcel = { + className: 'buttons-excel', + + text: function (dt) { + return ' ' + dt.i18n('buttons.excel', 'Excel'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'excel'); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.postExcelVisibleColumns = { + className: 'buttons-excel', + + text: function (dt) { + return ' ' + dt.i18n('buttons.excel', 'Excel (only visible columns)'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'excel', true); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.export = { + extend: 'collection', + + className: 'buttons-export', + + text: function (dt) { + return ' ' + dt.i18n('buttons.export', 'Export') + ' '; + }, + + buttons: ['csv', 'excel', 'pdf'] + }; + + DataTable.ext.buttons.csv = { + className: 'buttons-csv', + + text: function (dt) { + return ' ' + dt.i18n('buttons.csv', 'CSV'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'csv'); + window.location = url; + } + }; + + DataTable.ext.buttons.postCsvVisibleColumns = { + className: 'buttons-csv', + + text: function (dt) { + return ' ' + dt.i18n('buttons.csv', 'CSV (only visible columns)'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'csv', true); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.postCsv = { + className: 'buttons-csv', + + text: function (dt) { + return ' ' + dt.i18n('buttons.csv', 'CSV'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'csv'); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.pdf = { + className: 'buttons-pdf', + + text: function (dt) { + return ' ' + dt.i18n('buttons.pdf', 'PDF'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'pdf'); + window.location = url; + } + }; + + DataTable.ext.buttons.postPdf = { + className: 'buttons-pdf', + + text: function (dt) { + return ' ' + dt.i18n('buttons.pdf', 'PDF'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'pdf'); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.print = { + className: 'buttons-print', + + text: function (dt) { + return ' ' + dt.i18n('buttons.print', 'Print'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'print'); + window.location = url; + } + }; + + DataTable.ext.buttons.reset = { + className: 'buttons-reset', + + text: function (dt) { + return ' ' + dt.i18n('buttons.reset', 'Reset'); + }, + + action: function (e, dt, button, config) { + dt.search(''); + dt.columns().search(''); + dt.draw(); + } + }; + + DataTable.ext.buttons.reload = { + className: 'buttons-reload', + + text: function (dt) { + return ' ' + dt.i18n('buttons.reload', 'Reload'); + }, + + action: function (e, dt, button, config) { + dt.draw(false); + } + }; + + DataTable.ext.buttons.create = { + className: 'buttons-create', + + text: function (dt) { + return ' ' + dt.i18n('buttons.create', 'Create'); + }, + + action: function (e, dt, button, config) { + window.location = window.location.href.replace(/\/+$/, "") + '/create'; + } + }; + + if (typeof DataTable.ext.buttons.copyHtml5 !== 'undefined') { + $.extend(DataTable.ext.buttons.copyHtml5, { + text: function (dt) { + return ' ' + dt.i18n('buttons.copy', 'Copy'); + } + }); + } + + if (typeof DataTable.ext.buttons.colvis !== 'undefined') { + $.extend(DataTable.ext.buttons.colvis, { + text: function (dt) { + return ' ' + dt.i18n('buttons.colvis', 'Column visibility'); + } + }); + } +})(jQuery, jQuery.fn.dataTable); diff --git a/resources/views/projectsClients/articulated_2_ShowEquipment.blade.php b/resources/views/projectsClients/articulated_2_ShowEquipment.blade.php index ee08d439..76fcf141 100755 --- a/resources/views/projectsClients/articulated_2_ShowEquipment.blade.php +++ b/resources/views/projectsClients/articulated_2_ShowEquipment.blade.php @@ -622,7 +622,7 @@ class="form-control card_inputs" - - - - - - - - Documento Rotacionado - - - - - - - - - {{--
- - - - --}} - -
-
-
- Logo Esquerdo - User Logo -
-
- - - - - - - - - - - - - - - - - - -
-
- Logo Esquerdo - User Logo -
-
Nº ISPTUnidadeTag NºDim#LocalizacaoPI&DAmbitoObsercoesAndaimeIsolamentoGruaConclusao
-
- - - {{-- -
-
-
- Column -
-
- Column -
-
- Column -
-
-
--}} - - - - - - diff --git a/resources/views/userClient/pdfReportings/equipmentsForAmbitPdf.blade.php b/resources/views/userClient/pdfReportings/equipmentsForAmbitPdf.blade.php new file mode 100644 index 00000000..4be63f81 --- /dev/null +++ b/resources/views/userClient/pdfReportings/equipmentsForAmbitPdf.blade.php @@ -0,0 +1,199 @@ + + + + + + + + Invoice + + + + + + + + {{--
+ + + + + @php $count = 0; @endphp + @foreach ($equipmentDetails as $equipmentDetail) + @if ($count % 23 == 0) + @if ($count != 0) + +
+ @endif + + + + + + + @endif + + + + + + @php $count++; @endphp + @endforeach + + + +
+ + --}} + + + @php $page = 1; @endphp + @php $count = 0; @endphp + @foreach ($equipmentDetails as $equipmentDetail) + @if ($count % 25 == 0) + @if ($count != 0) + + + @endif + + + + + + + + @endif + + + + + + @php $count++; @endphp + @endforeach + + {{-- --}} + + + + + + + + + diff --git a/resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade copy.php b/resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade copy.php deleted file mode 100644 index b51fd9ab..00000000 --- a/resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade copy.php +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - Documento Rotacionado - - - - - - - - - - -
-
- Logo Esquerdo -
-
-

Lugar do Ambito

-
-
- User Logo -
-
- - - - - - - - - - - - - - - - - -
Nº ISPTUnidadeTag NºDim#LocalizacaoPI&DAmbitoObsercoesAndaimeIsolamentoGruaConclusao
- - - - - - - -@section('scriptsTemplateAdmin') - -@endsection diff --git a/resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade.php b/resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade.php deleted file mode 100644 index 83bb9c3e..00000000 --- a/resources/views/userClient/pdfReportings/showReportingAllEquipmentsForAmbitProject.blade.php +++ /dev/null @@ -1,84 +0,0 @@ -@extends('Templates/templateAdmin') - -@section('Main-content') - - - - - -
-
- -
- -
-

Obrar Concluidas

-
- -
- - - - - - - - - - - - - - - - - - -
Nº ISPTUnidadeTag NºDim#PI&DObsercoesAndaimeIsolamentoGruaConclusao
- -
-
-
-
- -@endsection - - - -@section('scriptsTemplateAdmin') - -@endsection diff --git a/resources/views/userClient/reportingDataClient.blade.php b/resources/views/userClient/reportingDataClient.blade.php index 49258953..c8b191e2 100644 --- a/resources/views/userClient/reportingDataClient.blade.php +++ b/resources/views/userClient/reportingDataClient.blade.php @@ -1,12 +1,28 @@ @extends('Templates/templateAdmin') @section('Main-content') + +
+
+
+
+

Relatorios

+
+
+ +
+
+
+
+
-

Obrar Concluidas

+

Obras Concluidas

diff --git a/resources/views/userClient/showDataDetailsProjectClient.blade.php b/resources/views/userClient/showDataDetailsProjectClient.blade.php index cd586b81..19559e09 100644 --- a/resources/views/userClient/showDataDetailsProjectClient.blade.php +++ b/resources/views/userClient/showDataDetailsProjectClient.blade.php @@ -5,248 +5,258 @@
-

Relatorio Geral

+

Relatorios Gerais

-
+ +
- - - +
+
+ + -
-
-

{{ $receiveDataProject->company_project_description }}

-
- -
- -
- -
-

Relatório geral Ambito

-
- -
+
+
+

{{ $receiveDataProject->company_project_description }}

- - - - - - - - -
AmbitoQtd.EquipmentosVisualizar
+
-
-
- +
+

Relatório geral Ambito

+
+ +
+
-
+
-
-

Relatório individual dos Equipamentos

-
- + + + + + + + + +
AmbitoQtd.EquipmentosVisualizar
+ +
-
- + -
+
-
- -
-
- - +
+

Relatório individual dos Equipamentos

+
+
+ -
-
- - -
-
+
+ +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
-
-
- -
+ + + + + + + + + + + + +
FabricaTag NumberTipo de EquipamentoAmbitoVisualizar
+
+
- - - - - - - - - - - - -
FabricaTag NumberTipo de EquipamentoAmbitoVisualizar
+
- -
- -
- @endsection +
+
+@endsection - @section('scriptsTemplateAdmin') - {{-- Script para abrir os cards sem precisar click no icones --}} - +@section('scriptsTemplateAdmin') + {{-- Script para abrir os cards sem precisar click no icones --}} - + + + + dataTables = $('#showReportingForAmbits').DataTable({ + responsive: true, + processing: true, + serverSide: true, + ajax: { + // Rota para obter os valores para o Yajra + url: '{{ route('getDataAmbitsOfProject') }}', + type: 'GET', + data: function(d) { + // Busca diretamente o valor de um input tipo Hidden para buscar e enviar o valor do id do project atual + d.AmbitsIdString = $('#AmbitsIdString').val(); + d.projectId = $('#projectId').val(); + } + }, + columns: [{ + data: 'ambits_description', + name: 'ambits_description' + }, + + { + data: 'amountEquipment', + name: 'amountEquipment' + }, + { + data: 'action', + name: 'action', + orderable: false, + searchable: false + }, + ], + }); + }); + - - @endsection + //De acordo com os valores deste campos, como anteriormente ja sao enviados para a DataTables para fazer as filtragens, agora atualizamos a Tabela com base no filtros feitos + $('#allUnitsProject,#AllAmbitsProject,#typeEquipments').on('change', + function() { + dataTables.ajax.reload(); + }); + +@endsection diff --git a/resources/views/userClient/showReportingAllEquipmentsForAmbitProject.blade.php b/resources/views/userClient/showReportingAllEquipmentsForAmbitProject.blade.php new file mode 100644 index 00000000..c74431bb --- /dev/null +++ b/resources/views/userClient/showReportingAllEquipmentsForAmbitProject.blade.php @@ -0,0 +1,99 @@ +@extends('Templates/templateAdmin') + +@section('Main-content') + + + +
+
+
+
+

Relatório geral Ambito

+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+

{{ $dataAmbit->ambits_description }}

+
+
+ {{-- --}} + +
+
+
+ +
+ + + + + + + + + +
Nº ISPTUnidadeTag Nº
+ +
+ +
+ +
+
+@endsection + +@section('scriptsTemplateAdmin') + + + +@endsection diff --git a/resources/views/vendor/datatables/print.blade.php b/resources/views/vendor/datatables/print.blade.php new file mode 100644 index 00000000..735d84df --- /dev/null +++ b/resources/views/vendor/datatables/print.blade.php @@ -0,0 +1,37 @@ + + + + Print Table + + + + + + + + + + + @foreach($data as $row) + @if ($loop->first) + + @foreach($row as $key => $value) + + @endforeach + + @endif + + @foreach($row as $key => $value) + @if(is_string($value) || is_numeric($value)) + + @else + + @endif + @endforeach + + @endforeach +
{!! $key !!}
{!! $value !!}
+ + diff --git a/routes/web.php b/routes/web.php index e4c16a85..58e2a13c 100755 --- a/routes/web.php +++ b/routes/web.php @@ -1,5 +1,6 @@ name('test22'); + Route::get('getDataEquipment', [ExecutionProjectController::class, 'getDataEquipment'])->name('getDataEquipment'); Route::get('getDataEquipmentClient', [ExecutionProjectController::class, 'getDataEquipmentClient'])->name('getDataEquipmentClient'); -Route::get('showDataDetailsProjectClient/{projectID?}', [ClientController::class, 'showDataDetailsProjectClient'])->name('showDataDetailsProjectClient'); -Route::get('getDataProjectsClient', [ClientController::class,'getDataProjectsClient'])->name('getDataProjectsClient'); //OK -Route::get('getDataEquipmentsOfProject',[ClientController::class,'getDataEquipmentsOfProject'])->name('getDataEquipmentsOfProject');//ok -Route::get('showReportingEquipmentProject/{dataEquipment}', [ClientController::class,'showReportingEquipmentProject'])->name('showReportingEquipmentProject');//oK -Route::get('showReportingForAmbitsProject/{dataAmbit}/{projectId}', [ClientController::class,'showReportingForAmbitsProject'])->name('showReportingForAmbitsProject');//ok -Route::get('getDataAmbitsOfProject', [ClientController::class, 'getDataAmbitsOfProject'])->name('getDataAmbitsOfProject');//ok +Route::get('getDataProjectsClient', [ClientController::class, 'getDataProjectsClient'])->name('getDataProjectsClient'); +Route::get('showReportingEquipmentProject/{dataEquipment}', [ClientController::class, 'showReportingEquipmentProject'])->name('showReportingEquipmentProject'); //oK -Route::get('getDataAllEquipmentsForAmbitOfProject', [ClientController::class,'getDataAllEquipmentsForAmbitOfProject'])->name('getDataAllEquipmentsForAmbitOfProject'); +Route::get('showReportingForAmbitsProjectPdf/{ambitId}/{projectId}', [ClientController::class, 'showReportingForAmbitsProjectPdf'])->name('showReportingForAmbitsProjectPdf'); //ok + +Route::get('getDataAllEquipmentsForAmbitOfProject', [ClientController::class, 'getDataAllEquipmentsForAmbitOfProject'])->name('getDataAllEquipmentsForAmbitOfProject'); // Route::get('test/{id}',[ExecutionProjectController::class, 'test11'])->name('test11'); +// Route::get('getEquipment', [ClientController::class, 'getEquipment'])->name('getEquipment'); + +// Route::get('getEquipmentsOfAmbit', [ClientController::class, 'getEquipmentsOfAmbit'])->name('getEquipmentsOfAmbit'); + + + +// Route::get('getEquipment', [UsersDataTable::class,'getEquipment'])->name('getEquipment'); +// Route::get('getEquipment', [UsersDataTable::class, 'html'])->name('getEquipment'); + + + Route::post('language/switch', [LanguageController::class, 'switchLanguage'])->name('language.switch'); // Esta rota so pode aceder quem tiver o link atravez do email @@ -105,10 +116,28 @@ }); Route::middleware(['checkUserType:testClient'])->group(function () { + // Dashboard Route::get('dashboardClient', [ClientController::class, 'receiveProjectsClient'])->name('dashboardClient'); + // Relatorios + Route::get('reportingDataClient', [ClientController::class, 'reportingDataClient'])->name('reportingDataClient'); + //Api + Route::get('/api/receiveMonths/{yearsProjects}', [ClientController::class, 'receiveMonths']); + Route::get('/api/receiveDays/{yearProjects}/{monthProjects}', [ClientController::class, 'receiveDays']); + + // Equipamentos do Cliente Route::get('manageAssetsClient', [ClientController::class, 'receiveManageAssetsClient'])->name('manageAssetsClient'); - Route::get('reportingDataClient', [ClientController::class,'reportingDataClient'])->name('reportingDataClient'); + + //Relatorios Obras Concluidas + Route::get('showDataDetailsProjectClient/{projectID?}', [ClientController::class, 'showDataDetailsProjectClient'])->name('showDataDetailsProjectClient'); + //Api + Route::get('getDataAmbitsOfProject', [ClientController::class, 'getDataAmbitsOfProject'])->name('getDataAmbitsOfProject'); + Route::get('getDataEquipmentsOfProject', [ClientController::class, 'getDataEquipmentsOfProject'])->name('getDataEquipmentsOfProject'); + // Relatorio por Ambito de uma Determinada Obra. + Route::get('showReportingForAmbitsProject/{ambitId}/{projectId}', [ClientController::class, 'showReportingForAmbitsProject'])->name('showReportingForAmbitsProject'); + //Api + Route::get('getEquipmentsOfAmbit', [ClientController::class, 'getEquipmentsOfAmbit'])->name('getEquipmentsOfAmbit'); + }); /* @@ -239,10 +268,7 @@ -Route::get('/api/receiveMonths/{yearsProjects}', [ClientController::class,'receiveMonths']); -// Route::get('/api/receiveDays/{monthsProjects}', [ClientController::class,'receiveDays']); -Route::get('/api/receiveDays/{yearProjects}/{monthProjects}', [ClientController::class, 'receiveDays']); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 9998083b..2bdc5fae 100755 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -16,7 +16,6 @@ 'App\\Http\\Controllers\\Auth\\PasswordResetLinkController' => $baseDir . '/app/Http/Controllers/Auth/PasswordResetLinkController.php', 'App\\Http\\Controllers\\Auth\\ResetPasswordController' => $baseDir . '/app/Http/Controllers/Auth/ResetPasswordController.php', 'App\\Http\\Controllers\\ClientController' => $baseDir . '/app/Http/Controllers/ClientController.php', - 'App\\Http\\Controllers\\ClienteController' => $baseDir . '/app/Http/Controllers/ClienteController.php', 'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php', 'App\\Http\\Controllers\\CreateProjectController' => $baseDir . '/app/Http/Controllers/CreateProjectController.php', 'App\\Http\\Controllers\\CustomRegistrationController' => $baseDir . '/app/Http/Controllers/CustomRegistrationController.php', @@ -7246,18 +7245,89 @@ 'Whoops\\Util\\SystemFacade' => $vendorDir . '/filp/whoops/src/Whoops/Util/SystemFacade.php', 'Whoops\\Util\\TemplateHelper' => $vendorDir . '/filp/whoops/src/Whoops/Util/TemplateHelper.php', 'Yajra\\DataTables\\ApiResourceDataTable' => $vendorDir . '/yajra/laravel-datatables-oracle/src/ApiResourceDataTable.php', + 'Yajra\\DataTables\\ButtonsServiceProvider' => $vendorDir . '/yajra/laravel-datatables-buttons/src/ButtonsServiceProvider.php', 'Yajra\\DataTables\\CollectionDataTable' => $vendorDir . '/yajra/laravel-datatables-oracle/src/CollectionDataTable.php', 'Yajra\\DataTables\\Contracts\\DataTable' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Contracts/DataTable.php', + 'Yajra\\DataTables\\Contracts\\DataTableButtons' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Contracts/DataTableButtons.php', + 'Yajra\\DataTables\\Contracts\\DataTableHtmlBuilder' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Contracts/DataTableHtmlBuilder.php', + 'Yajra\\DataTables\\Contracts\\DataTableScope' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Contracts/DataTableScope.php', 'Yajra\\DataTables\\Contracts\\Formatter' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Contracts/Formatter.php', 'Yajra\\DataTables\\DataTableAbstract' => $vendorDir . '/yajra/laravel-datatables-oracle/src/DataTableAbstract.php', 'Yajra\\DataTables\\DataTables' => $vendorDir . '/yajra/laravel-datatables-oracle/src/DataTables.php', 'Yajra\\DataTables\\DataTablesServiceProvider' => $vendorDir . '/yajra/laravel-datatables-oracle/src/DataTablesServiceProvider.php', 'Yajra\\DataTables\\EloquentDataTable' => $vendorDir . '/yajra/laravel-datatables-oracle/src/EloquentDataTable.php', 'Yajra\\DataTables\\Exceptions\\Exception' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Exceptions/Exception.php', + 'Yajra\\DataTables\\Exports\\DataTablesCollectionExport' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Exports/DataTablesCollectionExport.php', 'Yajra\\DataTables\\Facades\\DataTables' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Facades/DataTables.php', + 'Yajra\\DataTables\\Generators\\DataTablesHtmlCommand' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Generators/DataTablesHtmlCommand.php', + 'Yajra\\DataTables\\Generators\\DataTablesMakeCommand' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Generators/DataTablesMakeCommand.php', + 'Yajra\\DataTables\\Generators\\DataTablesScopeCommand' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Generators/DataTablesScopeCommand.php', + 'Yajra\\DataTables\\HtmlServiceProvider' => $vendorDir . '/yajra/laravel-datatables-html/src/HtmlServiceProvider.php', + 'Yajra\\DataTables\\Html\\Builder' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Builder.php', + 'Yajra\\DataTables\\Html\\Button' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Button.php', + 'Yajra\\DataTables\\Html\\Column' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Column.php', + 'Yajra\\DataTables\\Html\\ColumnDefinition' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/ColumnDefinition.php', + 'Yajra\\DataTables\\Html\\ColumnDefinitions' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/ColumnDefinitions.php', + 'Yajra\\DataTables\\Html\\Columns\\Action' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Columns/Action.php', + 'Yajra\\DataTables\\Html\\Columns\\Checkbox' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Columns/Checkbox.php', + 'Yajra\\DataTables\\Html\\Columns\\Index' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Columns/Index.php', + 'Yajra\\DataTables\\Html\\DataTableHtml' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Html/DataTableHtml.php', + 'Yajra\\DataTables\\Html\\Editor\\Editor' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Editor.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\BelongsTo' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/BelongsTo.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Boolean' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Boolean.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Checkbox' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Checkbox.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Date' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Date.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\DateTime' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/DateTime.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Field' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Field.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\File' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/File.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Hidden' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Hidden.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Image' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Image.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Number' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Number.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Options' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Options.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Password' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Password.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Radio' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Radio.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\ReadOnlyField' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/ReadOnlyField.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Select' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Select.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Select2' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Select2.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Text' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Text.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\TextArea' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/TextArea.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Time' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Time.php', + 'Yajra\\DataTables\\Html\\Editor\\FormOptions' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/FormOptions.php', + 'Yajra\\DataTables\\Html\\Editor\\HasEvents' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Editor/HasEvents.php', + 'Yajra\\DataTables\\Html\\HasAuthorizations' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/HasAuthorizations.php', + 'Yajra\\DataTables\\Html\\HasEditor' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/HasEditor.php', + 'Yajra\\DataTables\\Html\\HasOptions' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/HasOptions.php', + 'Yajra\\DataTables\\Html\\HasTable' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/HasTable.php', + 'Yajra\\DataTables\\Html\\HtmlBuilder' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/HtmlBuilder.php', + 'Yajra\\DataTables\\Html\\Options\\HasAjax' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/HasAjax.php', + 'Yajra\\DataTables\\Html\\Options\\HasCallbacks' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/HasCallbacks.php', + 'Yajra\\DataTables\\Html\\Options\\HasColumns' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/HasColumns.php', + 'Yajra\\DataTables\\Html\\Options\\HasFeatures' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/HasFeatures.php', + 'Yajra\\DataTables\\Html\\Options\\HasInternationalisation' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/HasInternationalisation.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\Aria' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Languages/Aria.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\AutoFill' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Languages/AutoFill.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\Paginate' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Languages/Paginate.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\Select' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Languages/Select.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\AutoFill' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/AutoFill.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Buttons' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Buttons.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\ColReorder' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/ColReorder.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\FixedColumns' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedColumns.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\FixedHeader' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedHeader.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\KeyTable' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/KeyTable.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Responsive' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Responsive.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\RowGroup' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowGroup.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\RowReorder' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowReorder.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Scroller' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Scroller.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\SearchPanes' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/SearchPanes.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Select' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Select.php', + 'Yajra\\DataTables\\Html\\Parameters' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/Parameters.php', + 'Yajra\\DataTables\\Html\\SearchPane' => $vendorDir . '/yajra/laravel-datatables-html/src/Html/SearchPane.php', 'Yajra\\DataTables\\Processors\\DataProcessor' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Processors/DataProcessor.php', 'Yajra\\DataTables\\Processors\\RowProcessor' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Processors/RowProcessor.php', 'Yajra\\DataTables\\QueryDataTable' => $vendorDir . '/yajra/laravel-datatables-oracle/src/QueryDataTable.php', + 'Yajra\\DataTables\\Services\\DataTable' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Services/DataTable.php', + 'Yajra\\DataTables\\Services\\DataTablesExportHandler' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Services/DataTablesExportHandler.php', + 'Yajra\\DataTables\\Transformers\\DataArrayTransformer' => $vendorDir . '/yajra/laravel-datatables-buttons/src/Transformers/DataArrayTransformer.php', 'Yajra\\DataTables\\Utilities\\Config' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Utilities/Config.php', 'Yajra\\DataTables\\Utilities\\Helper' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Utilities/Helper.php', 'Yajra\\DataTables\\Utilities\\Request' => $vendorDir . '/yajra/laravel-datatables-oracle/src/Utilities/Request.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 4b2fe88e..6ba78894 100755 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -17,6 +17,7 @@ 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '3bd81c9b8fcc150b69d8b63b4d2ccf23' => $vendorDir . '/spatie/flare-client-php/src/helpers.php', + '0b47d6d4a00ca9112ba3953b49e7c9a4' => $vendorDir . '/yajra/laravel-datatables-oracle/src/helper.php', '35a6ad97d21e794e7e22a17d806652e4' => $vendorDir . '/nunomaduro/termwind/src/Functions.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', '09f6b20656683369174dd6fa83b7e5fb' => $vendorDir . '/symfony/polyfill-uuid/bootstrap.php', @@ -35,5 +36,4 @@ 'a1cfe24d14977df6878b9bf804af2d1c' => $vendorDir . '/nunomaduro/collision/src/Adapters/Phpunit/Autoload.php', 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', '320163ac6b93aebe3dc25b60a0533d56' => $vendorDir . '/spatie/laravel-ignition/src/helpers.php', - '0b47d6d4a00ca9112ba3953b49e7c9a4' => $vendorDir . '/yajra/laravel-datatables-oracle/src/helper.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index a3b65e69..4c1abab7 100755 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -8,7 +8,7 @@ return array( 'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'), 'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'), - 'Yajra\\DataTables\\' => array($vendorDir . '/yajra/laravel-datatables-oracle/src'), + 'Yajra\\DataTables\\' => array($vendorDir . '/yajra/laravel-datatables-oracle/src', $vendorDir . '/yajra/laravel-datatables-buttons/src', $vendorDir . '/yajra/laravel-datatables-html/src'), 'Whoops\\' => array($vendorDir . '/filp/whoops/src/Whoops'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 52c31429..1f079656 100755 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -18,6 +18,7 @@ class ComposerStaticInit4de2290df2a8c5142f72130885c7079d 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '3bd81c9b8fcc150b69d8b63b4d2ccf23' => __DIR__ . '/..' . '/spatie/flare-client-php/src/helpers.php', + '0b47d6d4a00ca9112ba3953b49e7c9a4' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/helper.php', '35a6ad97d21e794e7e22a17d806652e4' => __DIR__ . '/..' . '/nunomaduro/termwind/src/Functions.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', '09f6b20656683369174dd6fa83b7e5fb' => __DIR__ . '/..' . '/symfony/polyfill-uuid/bootstrap.php', @@ -36,7 +37,6 @@ class ComposerStaticInit4de2290df2a8c5142f72130885c7079d 'a1cfe24d14977df6878b9bf804af2d1c' => __DIR__ . '/..' . '/nunomaduro/collision/src/Adapters/Phpunit/Autoload.php', 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', '320163ac6b93aebe3dc25b60a0533d56' => __DIR__ . '/..' . '/spatie/laravel-ignition/src/helpers.php', - '0b47d6d4a00ca9112ba3953b49e7c9a4' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/helper.php', ); public static $prefixLengthsPsr4 = array ( @@ -211,6 +211,8 @@ class ComposerStaticInit4de2290df2a8c5142f72130885c7079d 'Yajra\\DataTables\\' => array ( 0 => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src', + 1 => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src', + 2 => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src', ), 'Whoops\\' => array ( @@ -636,7 +638,6 @@ class ComposerStaticInit4de2290df2a8c5142f72130885c7079d 'App\\Http\\Controllers\\Auth\\PasswordResetLinkController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/PasswordResetLinkController.php', 'App\\Http\\Controllers\\Auth\\ResetPasswordController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/ResetPasswordController.php', 'App\\Http\\Controllers\\ClientController' => __DIR__ . '/../..' . '/app/Http/Controllers/ClientController.php', - 'App\\Http\\Controllers\\ClienteController' => __DIR__ . '/../..' . '/app/Http/Controllers/ClienteController.php', 'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php', 'App\\Http\\Controllers\\CreateProjectController' => __DIR__ . '/../..' . '/app/Http/Controllers/CreateProjectController.php', 'App\\Http\\Controllers\\CustomRegistrationController' => __DIR__ . '/../..' . '/app/Http/Controllers/CustomRegistrationController.php', @@ -7866,18 +7867,89 @@ class ComposerStaticInit4de2290df2a8c5142f72130885c7079d 'Whoops\\Util\\SystemFacade' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/SystemFacade.php', 'Whoops\\Util\\TemplateHelper' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/TemplateHelper.php', 'Yajra\\DataTables\\ApiResourceDataTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/ApiResourceDataTable.php', + 'Yajra\\DataTables\\ButtonsServiceProvider' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/ButtonsServiceProvider.php', 'Yajra\\DataTables\\CollectionDataTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/CollectionDataTable.php', 'Yajra\\DataTables\\Contracts\\DataTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Contracts/DataTable.php', + 'Yajra\\DataTables\\Contracts\\DataTableButtons' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Contracts/DataTableButtons.php', + 'Yajra\\DataTables\\Contracts\\DataTableHtmlBuilder' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Contracts/DataTableHtmlBuilder.php', + 'Yajra\\DataTables\\Contracts\\DataTableScope' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Contracts/DataTableScope.php', 'Yajra\\DataTables\\Contracts\\Formatter' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Contracts/Formatter.php', 'Yajra\\DataTables\\DataTableAbstract' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/DataTableAbstract.php', 'Yajra\\DataTables\\DataTables' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/DataTables.php', 'Yajra\\DataTables\\DataTablesServiceProvider' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/DataTablesServiceProvider.php', 'Yajra\\DataTables\\EloquentDataTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/EloquentDataTable.php', 'Yajra\\DataTables\\Exceptions\\Exception' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Exceptions/Exception.php', + 'Yajra\\DataTables\\Exports\\DataTablesCollectionExport' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Exports/DataTablesCollectionExport.php', 'Yajra\\DataTables\\Facades\\DataTables' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Facades/DataTables.php', + 'Yajra\\DataTables\\Generators\\DataTablesHtmlCommand' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Generators/DataTablesHtmlCommand.php', + 'Yajra\\DataTables\\Generators\\DataTablesMakeCommand' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Generators/DataTablesMakeCommand.php', + 'Yajra\\DataTables\\Generators\\DataTablesScopeCommand' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Generators/DataTablesScopeCommand.php', + 'Yajra\\DataTables\\HtmlServiceProvider' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/HtmlServiceProvider.php', + 'Yajra\\DataTables\\Html\\Builder' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Builder.php', + 'Yajra\\DataTables\\Html\\Button' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Button.php', + 'Yajra\\DataTables\\Html\\Column' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Column.php', + 'Yajra\\DataTables\\Html\\ColumnDefinition' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/ColumnDefinition.php', + 'Yajra\\DataTables\\Html\\ColumnDefinitions' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/ColumnDefinitions.php', + 'Yajra\\DataTables\\Html\\Columns\\Action' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Columns/Action.php', + 'Yajra\\DataTables\\Html\\Columns\\Checkbox' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Columns/Checkbox.php', + 'Yajra\\DataTables\\Html\\Columns\\Index' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Columns/Index.php', + 'Yajra\\DataTables\\Html\\DataTableHtml' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Html/DataTableHtml.php', + 'Yajra\\DataTables\\Html\\Editor\\Editor' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Editor.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\BelongsTo' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/BelongsTo.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Boolean' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Boolean.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Checkbox' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Checkbox.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Date' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Date.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\DateTime' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/DateTime.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Field' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Field.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\File' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/File.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Hidden' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Hidden.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Image' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Image.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Number' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Number.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Options' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Options.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Password' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Password.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Radio' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Radio.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\ReadOnlyField' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/ReadOnlyField.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Select' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Select.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Select2' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Select2.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Text' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Text.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\TextArea' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/TextArea.php', + 'Yajra\\DataTables\\Html\\Editor\\Fields\\Time' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/Fields/Time.php', + 'Yajra\\DataTables\\Html\\Editor\\FormOptions' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/FormOptions.php', + 'Yajra\\DataTables\\Html\\Editor\\HasEvents' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Editor/HasEvents.php', + 'Yajra\\DataTables\\Html\\HasAuthorizations' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/HasAuthorizations.php', + 'Yajra\\DataTables\\Html\\HasEditor' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/HasEditor.php', + 'Yajra\\DataTables\\Html\\HasOptions' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/HasOptions.php', + 'Yajra\\DataTables\\Html\\HasTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/HasTable.php', + 'Yajra\\DataTables\\Html\\HtmlBuilder' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/HtmlBuilder.php', + 'Yajra\\DataTables\\Html\\Options\\HasAjax' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/HasAjax.php', + 'Yajra\\DataTables\\Html\\Options\\HasCallbacks' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/HasCallbacks.php', + 'Yajra\\DataTables\\Html\\Options\\HasColumns' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/HasColumns.php', + 'Yajra\\DataTables\\Html\\Options\\HasFeatures' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/HasFeatures.php', + 'Yajra\\DataTables\\Html\\Options\\HasInternationalisation' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/HasInternationalisation.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\Aria' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Languages/Aria.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\AutoFill' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Languages/AutoFill.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\Paginate' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Languages/Paginate.php', + 'Yajra\\DataTables\\Html\\Options\\Languages\\Select' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Languages/Select.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\AutoFill' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/AutoFill.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Buttons' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Buttons.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\ColReorder' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/ColReorder.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\FixedColumns' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedColumns.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\FixedHeader' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedHeader.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\KeyTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/KeyTable.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Responsive' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Responsive.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\RowGroup' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowGroup.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\RowReorder' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowReorder.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Scroller' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Scroller.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\SearchPanes' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/SearchPanes.php', + 'Yajra\\DataTables\\Html\\Options\\Plugins\\Select' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Options/Plugins/Select.php', + 'Yajra\\DataTables\\Html\\Parameters' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/Parameters.php', + 'Yajra\\DataTables\\Html\\SearchPane' => __DIR__ . '/..' . '/yajra/laravel-datatables-html/src/Html/SearchPane.php', 'Yajra\\DataTables\\Processors\\DataProcessor' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Processors/DataProcessor.php', 'Yajra\\DataTables\\Processors\\RowProcessor' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Processors/RowProcessor.php', 'Yajra\\DataTables\\QueryDataTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/QueryDataTable.php', + 'Yajra\\DataTables\\Services\\DataTable' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Services/DataTable.php', + 'Yajra\\DataTables\\Services\\DataTablesExportHandler' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Services/DataTablesExportHandler.php', + 'Yajra\\DataTables\\Transformers\\DataArrayTransformer' => __DIR__ . '/..' . '/yajra/laravel-datatables-buttons/src/Transformers/DataArrayTransformer.php', 'Yajra\\DataTables\\Utilities\\Config' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Utilities/Config.php', 'Yajra\\DataTables\\Utilities\\Helper' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Utilities/Helper.php', 'Yajra\\DataTables\\Utilities\\Request' => __DIR__ . '/..' . '/yajra/laravel-datatables-oracle/src/Utilities/Request.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3e2137ae..58b2e8f3 100755 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -9550,6 +9550,168 @@ }, "install-path": "../webmozart/assert" }, + { + "name": "yajra/laravel-datatables-buttons", + "version": "v10.0.8", + "version_normalized": "10.0.8.0", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-buttons.git", + "reference": "cdd2b907f892cba4b840b4ed14f73bc73086d0cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-buttons/zipball/cdd2b907f892cba4b840b4ed14f73bc73086d0cf", + "reference": "cdd2b907f892cba4b840b4ed14f73bc73086d0cf", + "shasum": "" + }, + "require": { + "illuminate/console": "^10", + "php": "^8.1", + "yajra/laravel-datatables-html": "^10", + "yajra/laravel-datatables-oracle": "^10" + }, + "require-dev": { + "barryvdh/laravel-snappy": "^1.0.1", + "maatwebsite/excel": "^3.1.46", + "nunomaduro/larastan": "^2.4", + "orchestra/testbench": "^8", + "rap2hpoutre/fast-excel": "^5.1" + }, + "suggest": { + "barryvdh/laravel-snappy": "Allows exporting of dataTable to PDF using the print view.", + "dompdf/dompdf": "Allows exporting of dataTable to PDF using the DomPDF.", + "maatwebsite/excel": "Exporting of dataTables (excel, csv and PDF) using maatwebsite package.", + "rap2hpoutre/fast-excel": "Faster exporting of dataTables using fast-excel package.", + "yajra/laravel-datatables-export": "Exporting of dataTables (excel, csv and PDF) via livewire and queue worker." + }, + "time": "2023-11-15T06:05:11+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "10.0-dev" + }, + "laravel": { + "providers": [ + "Yajra\\DataTables\\ButtonsServiceProvider" + ] + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables Buttons Plugin.", + "keywords": [ + "buttons", + "datatables", + "jquery", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-buttons/issues", + "source": "https://github.com/yajra/laravel-datatables-buttons/tree/v10.0.8" + }, + "funding": [ + { + "url": "https://github.com/sponsors/yajra", + "type": "github" + } + ], + "install-path": "../yajra/laravel-datatables-buttons" + }, + { + "name": "yajra/laravel-datatables-html", + "version": "v10.12.0", + "version_normalized": "10.12.0.0", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-html.git", + "reference": "1c0fc1ff2026457ff29ab1a6a3433a44d59b251d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-html/zipball/1c0fc1ff2026457ff29ab1a6a3433a44d59b251d", + "reference": "1c0fc1ff2026457ff29ab1a6a3433a44d59b251d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^8.1", + "yajra/laravel-datatables-oracle": "^10.0" + }, + "require-dev": { + "nunomaduro/larastan": "^2.4", + "orchestra/testbench": "^7.21" + }, + "time": "2023-12-15T04:41:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "10.0-dev" + }, + "laravel": { + "providers": [ + "Yajra\\DataTables\\HtmlServiceProvider" + ] + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables HTML builder plugin for Laravel 5.4+.", + "keywords": [ + "JS", + "datatables", + "html", + "jquery", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-html/issues", + "source": "https://github.com/yajra/laravel-datatables-html/tree/v10.12.0" + }, + "funding": [ + { + "url": "https://www.paypal.me/yajra", + "type": "custom" + }, + { + "url": "https://github.com/yajra", + "type": "github" + }, + { + "url": "https://www.patreon.com/yajra", + "type": "patreon" + } + ], + "install-path": "../yajra/laravel-datatables-html" + }, { "name": "yajra/laravel-datatables-oracle", "version": "v10.6.0", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 33cc565b..d0672d31 100755 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'laravel/laravel', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'ff6e6a91ad76aee6fc8a84554605b54db7d43c25', + 'reference' => 'b29188b29ea6c7e18c4a9303a174fb6d2abc6b64', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -427,7 +427,7 @@ 'laravel/laravel' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'ff6e6a91ad76aee6fc8a84554605b54db7d43c25', + 'reference' => 'b29188b29ea6c7e18c4a9303a174fb6d2abc6b64', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -1463,6 +1463,24 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'yajra/laravel-datatables-buttons' => array( + 'pretty_version' => 'v10.0.8', + 'version' => '10.0.8.0', + 'reference' => 'cdd2b907f892cba4b840b4ed14f73bc73086d0cf', + 'type' => 'library', + 'install_path' => __DIR__ . '/../yajra/laravel-datatables-buttons', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'yajra/laravel-datatables-html' => array( + 'pretty_version' => 'v10.12.0', + 'version' => '10.12.0.0', + 'reference' => '1c0fc1ff2026457ff29ab1a6a3433a44d59b251d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../yajra/laravel-datatables-html', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'yajra/laravel-datatables-oracle' => array( 'pretty_version' => 'v10.6.0', 'version' => '10.6.0.0', diff --git a/vendor/yajra/laravel-datatables-buttons/CHANGELOG.md b/vendor/yajra/laravel-datatables-buttons/CHANGELOG.md new file mode 100644 index 00000000..9727ffc5 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/CHANGELOG.md @@ -0,0 +1,38 @@ +# Laravel DataTables Buttons Plugin CHANGELOG. + +## v10.0.8 - 2023-11-15 + +- fix: unnecessary exception thrown #183 + +## v10.0.7 - 2023-07-31 + +- fix: use callback function if exportRender method is set #177 + +## v10.0.6 - 2023-02-28 + +- fix: export package integration error message #174 + +## v10.0.5 - 2023-02-28 + +- fix: prevent redeclaring export query generator function (Laravel Octane) #173 + +## v10.0.4 - 2023-02-21 + +- fix: stubs - remove redundant docs #172 +- fix: default model namespace + +## v10.0.3 - 2023-02-20 + +- fix: default model namespace config #171 + +## v10.0.2 - 2023-02-20 + +- fix: scopes when using api resource #170 + +## v10.0.1 - 2023-02-20 + +- fix: applyScopes method to support Collection #168 + +## v10.0.0 - 2023-02-07 + +- Add Laravel 10 compatibility #169 diff --git a/vendor/yajra/laravel-datatables-buttons/CONTRIBUTING.md b/vendor/yajra/laravel-datatables-buttons/CONTRIBUTING.md new file mode 100644 index 00000000..5b11dba7 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +Contributions are **welcome** and will be fully **credited**. + +We accept contributions via Pull Requests on [Github](https://github.com/yajra/laravel-datatables-buttons). + + +## Pull Requests + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). + +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. + +- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. + +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. + + +**Happy coding**! \ No newline at end of file diff --git a/vendor/yajra/laravel-datatables-buttons/LICENSE.md b/vendor/yajra/laravel-datatables-buttons/LICENSE.md new file mode 100644 index 00000000..7c2696e5 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/LICENSE.md @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013-2018 Arjay Angeles + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/yajra/laravel-datatables-buttons/README.md b/vendor/yajra/laravel-datatables-buttons/README.md new file mode 100644 index 00000000..b580f37f --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/README.md @@ -0,0 +1,62 @@ +# Laravel DataTables Buttons Plugin + +[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-orange.svg)](http://laravel.com) +[![Latest Stable Version](https://img.shields.io/packagist/v/yajra/laravel-datatables-buttons.svg)](https://packagist.org/packages/yajra/laravel-datatables-buttons) +[![Continuous Integration](https://github.com/yajra/laravel-datatables-buttons/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/yajra/laravel-datatables-buttons/actions/workflows/continuous-integration.yml) +[![Static Analysis](https://github.com/yajra/laravel-datatables-buttons/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/yajra/laravel-datatables-buttons/actions/workflows/static-analysis.yml) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yajra/laravel-datatables-buttons/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yajra/laravel-datatables-buttons/?branch=master) +[![Total Downloads](https://img.shields.io/packagist/dt/yajra/laravel-datatables-buttons.svg)](https://packagist.org/packages/yajra/laravel-datatables-buttons) +[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/yajra/laravel-datatables-buttons) + +This package is a plugin of [Laravel DataTables](https://github.com/yajra/laravel-datatables) for handling server-side function of exporting the table as csv, excel, pdf and printing. + +## Requirements + +- [PHP >= 8.1](http://php.net/) +- [Laravel 10.x](https://github.com/laravel/framework) +- [Laravel DataTables](https://github.com/yajra/laravel-datatables) +- [jQuery DataTables v1.10.x](http://datatables.net/) +- [jQuery DataTables Buttons Extension](https://datatables.net/reference/button/) + +## Documentations + +- [Laravel DataTables Documentation](http://yajrabox.com/docs/laravel-datatables) + +## Laravel Version Compatibility + +| Laravel | Package | +|:--------------|:--------| +| 8.x and below | 4.x | +| 9.x | 9.x | +| 10.x | 10.x | + +## Quick Installation + +`composer require yajra/laravel-datatables-buttons:^10` + +#### Service Provider (Optional on Laravel 5.5) + +`Yajra\DataTables\ButtonsServiceProvider::class` + +#### Configuration and Assets (Optional) + +`$ php artisan vendor:publish --tag=datatables-buttons --force` + +And that's it! Start building out some awesome DataTables! + +## Contributing + +Please see [CONTRIBUTING](https://github.com/yajra/laravel-datatables-buttons/blob/master/.github/CONTRIBUTING.md) for details. + +## Security + +If you discover any security related issues, please email [aqangeles@gmail.com](mailto:aqangeles@gmail.com) instead of using the issue tracker. + +## Credits + +- [Arjay Angeles](https://github.com/yajra) +- [All Contributors](https://github.com/yajra/laravel-datatables-buttons/graphs/contributors) + +## License + +The MIT License (MIT). Please see [License File](https://github.com/yajra/laravel-datatables-buttons/blob/master/LICENSE.md) for more information. diff --git a/vendor/yajra/laravel-datatables-buttons/composer.json b/vendor/yajra/laravel-datatables-buttons/composer.json new file mode 100644 index 00000000..4f36783a --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/composer.json @@ -0,0 +1,65 @@ +{ + "name": "yajra/laravel-datatables-buttons", + "description": "Laravel DataTables Buttons Plugin.", + "keywords": [ + "laravel", + "datatables", + "buttons", + "jquery" + ], + "license": "MIT", + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "require": { + "php": "^8.1", + "yajra/laravel-datatables-oracle": "^10", + "yajra/laravel-datatables-html": "^10", + "illuminate/console": "^10" + }, + "require-dev": { + "maatwebsite/excel": "^3.1.46", + "nunomaduro/larastan": "^2.4", + "orchestra/testbench": "^8", + "rap2hpoutre/fast-excel": "^5.1", + "barryvdh/laravel-snappy": "^1.0.1" + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Yajra\\DataTables\\Buttons\\Tests\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "10.0-dev" + }, + "laravel": { + "providers": [ + "Yajra\\DataTables\\ButtonsServiceProvider" + ] + } + }, + "suggest": { + "yajra/laravel-datatables-export": "Exporting of dataTables (excel, csv and PDF) via livewire and queue worker.", + "maatwebsite/excel": "Exporting of dataTables (excel, csv and PDF) using maatwebsite package.", + "rap2hpoutre/fast-excel": "Faster exporting of dataTables using fast-excel package.", + "dompdf/dompdf": "Allows exporting of dataTable to PDF using the DomPDF.", + "barryvdh/laravel-snappy": "Allows exporting of dataTable to PDF using the print view." + }, + "minimum-stability": "dev", + "prefer-stable": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/yajra" + } + ] +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/ButtonsServiceProvider.php b/vendor/yajra/laravel-datatables-buttons/src/ButtonsServiceProvider.php new file mode 100644 index 00000000..23ea9c91 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/ButtonsServiceProvider.php @@ -0,0 +1,70 @@ +loadViewsFrom(__DIR__.'/resources/views', 'datatables'); + + $this->publishAssets(); + + $this->registerCommands(); + } + + /** + * Publish datatables assets. + */ + protected function publishAssets(): void + { + $this->publishes([ + __DIR__.'/config/config.php' => config_path('datatables-buttons.php'), + ], 'datatables-buttons'); + + $this->publishes([ + __DIR__.'/resources/assets/buttons.server-side.js' => public_path('vendor/datatables/buttons.server-side.js'), + ], 'datatables-buttons'); + + $this->publishes([ + __DIR__.'/resources/views' => base_path('/resources/views/vendor/datatables'), + ], 'datatables-buttons'); + } + + /** + * Register datatables commands. + */ + protected function registerCommands(): void + { + $this->commands(DataTablesMakeCommand::class); + $this->commands(DataTablesScopeCommand::class); + $this->commands(DataTablesHtmlCommand::class); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register(): void + { + $this->mergeConfigFrom(__DIR__.'/config/config.php', 'datatables-buttons'); + + $this->app->register(HtmlServiceProvider::class); + + if (class_exists(ExcelServiceProvider::class)) { + $this->app->register(ExcelServiceProvider::class); + } + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Contracts/DataTableButtons.php b/vendor/yajra/laravel-datatables-buttons/src/Contracts/DataTableButtons.php new file mode 100644 index 00000000..0a6b0bcb --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Contracts/DataTableButtons.php @@ -0,0 +1,34 @@ +collection = $collection ?? new Collection; + } + + /** + * @return Collection|LazyCollection + */ + public function collection() + { + return $this->collection; + } + + /** + * @return array + */ + public function headings(): array + { + /** @var array $first */ + $first = $this->collection->first(); + if ($first) { + return array_keys($first); + } + + return []; + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesHtmlCommand.php b/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesHtmlCommand.php new file mode 100644 index 00000000..5406ca05 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesHtmlCommand.php @@ -0,0 +1,97 @@ +files->get($this->getStub()); + + $stub = $this->replaceNamespace($stub, $name)->replaceClass($stub, $name); + + $this->replaceBuilder($stub) + ->replaceColumns($stub) + ->replaceButtons($stub) + ->replaceDOM($stub) + ->replaceTableId($stub); + + return $stub; + } + + /** + * Get the stub file for the generator. + * + * @return string + */ + protected function getStub(): string + { + return config('datatables-buttons.stub') + ? base_path().config('datatables-buttons.stub').'/html.stub' + : __DIR__.'/stubs/html.stub'; + } + + /** + * Parse the name and format according to the root namespace. + * + * @param string $name + * @return string + */ + protected function qualifyClass($name): string + { + $rootNamespace = $this->laravel->getNamespace(); + + if (Str::startsWith($name, $rootNamespace)) { + return $name; + } + + if (Str::contains($name, '/')) { + $name = str_replace('/', '\\', $name); + } + + if (! Str::contains(Str::lower($name), 'datatablehtml')) { + $name .= 'DataTableHtml'; + } else { + $name = preg_replace('#datatablehtml$#i', 'DataTableHtml', $name); + } + + return $this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name; + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesMakeCommand.php b/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesMakeCommand.php new file mode 100644 index 00000000..2a4c2d83 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesMakeCommand.php @@ -0,0 +1,423 @@ +option('builder')) { + $columns = config('datatables-buttons.generator.columns', 'id,add your columns,created_at,updated_at'); + $buttons = config('datatables-buttons.generator.buttons', 'create,export,print,reset,reload'); + $dom = config('datatables-buttons.generator.dom', 'Bfrtip'); + + $this->call('datatables:html', [ + 'name' => $this->getDataTableBaseName(), + '--columns' => $this->option('columns') ?: $columns, + '--buttons' => $this->option('buttons') ?: $buttons, + '--dom' => $this->option('dom') ?: $dom, + '--table' => $this->option('table'), + ]); + } + } + + /** + * Build the class with the given name. + * + * @param string $name + * @return string + * + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + */ + protected function buildClass($name): string + { + $stub = parent::buildClass($name); + + $this->replaceModelImport($stub) + ->replaceModel($stub) + ->replaceBuilder($stub) + ->replaceColumns($stub) + ->replaceButtons($stub) + ->replaceDOM($stub) + ->replaceTableId($stub) + ->replaceAction($stub) + ->replaceFilename($stub); + + return $stub; + } + + /** + * Get DataTable class base name without the suffix. + * + * @return string + */ + protected function getDataTableBaseName(): string + { + return (string) preg_replace('#datatable$#i', '', $this->getNameInput()); + } + + /** + * Prepare model name from input. + * + * @return string + */ + protected function prepareModelName(): string + { + return basename($this->getDataTableBaseName()); + } + + /** + * Replace the filename. + * + * @param string $stub + * @return $this + */ + protected function replaceFilename(string &$stub): static + { + $stub = str_replace('DummyFilename', $this->prepareModelName(), $stub); + + return $this; + } + + /** + * Replace the action. + * + * @param string $stub + * @return static + */ + protected function replaceAction(string &$stub): static + { + $stub = str_replace('DummyAction', $this->getAction(), $stub); + + return $this; + } + + /** + * Set the action view to be used. + * + * @return string + */ + protected function getAction(): string + { + /** @var string $action */ + $action = $this->option('action'); + + if ($action) { + return $action; + } + + return Str::lower($this->prepareModelName()).'.action'; + } + + /** + * Replace columns. + * + * @param string $stub + * @return $this + */ + protected function replaceTableId(string &$stub): static + { + $stub = str_replace('DummyTableId', Str::lower($this->prepareModelName()).'-table', $stub); + + return $this; + } + + /** + * Replace dom. + * + * @param string $stub + * @return $this + */ + protected function replaceDOM(string &$stub): static + { + /** @var string $dom */ + $dom = $this->option('dom') ?: config('datatables-buttons.generator.dom', 'Bfrtip'); + + $stub = str_replace('DummyDOM', $dom, $stub); + + return $this; + } + + /** + * Replace buttons. + * + * @param string $stub + * @return $this + */ + protected function replaceButtons(string &$stub): static + { + $stub = str_replace('DummyButtons', $this->getButtons(), $stub); + + return $this; + } + + /** + * Get the columns to be used. + * + * @return string + */ + protected function getButtons(): string + { + /** @var string $buttons */ + $buttons = $this->option('buttons'); + + if ($buttons) { + return $this->parseButtons($buttons); + } + + /** @var string $buttons */ + $buttons = config('datatables-buttons.generator.buttons', 'create,export,print,reset,reload'); + + return $this->parseButtons($buttons); + } + + /** + * Parse array from definition. + * + * @param string $definition + * @param int $indentation + * @return string + */ + protected function parseButtons(string $definition, int $indentation = 24): string + { + $columns = explode(',', $definition); + $stub = ''; + foreach ($columns as $key => $column) { + $indent = ''; + $separator = ','; + + if ($key < count($columns) - 1) { + $indent = PHP_EOL.str_repeat(' ', $indentation); + } + + if ($key == count($columns) - 1) { + $separator = ''; + } + + $stub .= "Button::make('{$column}')".$separator.$indent; + } + + return $stub; + } + + /** + * Replace columns. + * + * @param string $stub + * @return $this + */ + protected function replaceColumns(string &$stub): static + { + $stub = str_replace('DummyColumns', $this->getColumns(), $stub); + + return $this; + } + + /** + * Get the columns to be used. + * + * @return string + */ + protected function getColumns(): string + { + /** @var string $table */ + $table = $this->option('table'); + + if ($table) { + return $this->parseColumns(Schema::getColumnListing($table)); + } + + /** @var string $columns */ + $columns = $this->option('columns'); + + if ($columns) { + return $this->parseColumns($columns); + } + + /** @var string $columns */ + $columns = config('datatables-buttons.generator.columns', 'id,add your columns,created_at,updated_at'); + + return $this->parseColumns($columns); + } + + /** + * Parse array from definition. + * + * @param array|string $definition + * @param int $indentation + * @return string + */ + protected function parseColumns(array|string $definition, int $indentation = 12): string + { + $columns = is_array($definition) ? $definition : explode(',', $definition); + $stub = ''; + foreach ($columns as $key => $column) { + $stub .= "Column::make('{$column}'),"; + + if ($key < count($columns) - 1) { + $stub .= PHP_EOL.str_repeat(' ', $indentation); + } + } + + return $stub; + } + + /** + * Replace builder name. + * + * @param string $stub + * @return \Yajra\DataTables\Generators\DataTablesMakeCommand + */ + protected function replaceBuilder(&$stub) + { + $name = $this->qualifyClass($this->getNameInput()); + $class = str_replace($this->getNamespace($name).'\\', '', $name); + + $stub = str_replace('DummyBuilder', $class.'Html', $stub); + + return $this; + } + + /** + * Parse the name and format according to the root namespace. + * + * @param string $name + * @return string + */ + protected function qualifyClass($name) + { + $rootNamespace = $this->laravel->getNamespace(); + + if (Str::startsWith($name, $rootNamespace)) { + return $name; + } + + if (Str::contains($name, '/')) { + $name = str_replace('/', '\\', $name); + } + + if (! Str::contains(Str::lower($name), 'datatable')) { + $name .= 'DataTable'; + } else { + $name = preg_replace('#datatable$#i', 'DataTable', $name); + } + + return $this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name; + } + + /** + * Get the default namespace for the class. + * + * @param string $rootNamespace + * @return string + */ + protected function getDefaultNamespace($rootNamespace): string + { + return $rootNamespace.'\\'.config('datatables-buttons.namespace.base', 'DataTables'); + } + + /** + * Replace model name. + * + * @param string $stub + * @return static + */ + protected function replaceModel(string &$stub): static + { + $model = explode('\\', $this->getModel()); + $model = array_pop($model); + $stub = str_replace('ModelName', $model, $stub); + + return $this; + } + + /** + * Get model name to use. + * + * @return string + */ + protected function getModel(): string + { + /** @var string $modelFromOption */ + $modelFromOption = $this->option('model'); + $modelNamespaceFromOption = $this->option('model-namespace') + ? $this->option('model-namespace') + : config('datatables-buttons.namespace.model'); + + $name = $modelFromOption ?: $this->prepareModelName(); + $modelNamespace = $modelNamespaceFromOption ?: $this->laravel->getNamespace(); + + if (empty($modelNamespaceFromOption) && is_dir(app_path('Models'))) { + $modelNamespace = $modelNamespace.'\\Models\\'; + } + + return $modelNamespace.'\\'.Str::singular($name); + } + + /** + * Replace model import. + * + * @param string $stub + * @return $this + */ + protected function replaceModelImport(string &$stub): static + { + $stub = str_replace('DummyModel', str_replace('\\\\', '\\', $this->getModel()), $stub); + + return $this; + } + + /** + * Get the stub file for the generator. + * + * @return string + */ + protected function getStub(): string + { + $stub = 'datatables.stub'; + + if ($this->option('builder')) { + $stub = 'builder.stub'; + } + + return config('datatables-buttons.stub') + ? base_path().config('datatables-buttons.stub')."/$stub" + : __DIR__."/stubs/{$stub}"; + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesScopeCommand.php b/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesScopeCommand.php new file mode 100644 index 00000000..78ee6366 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Generators/DataTablesScopeCommand.php @@ -0,0 +1,54 @@ +addColumn('action', 'DummyAction') + ->setRowId('id'); + } + + /** + * Get the query source of dataTable. + */ + public function query(ModelName $model): QueryBuilder + { + return $model->newQuery(); + } + + /** + * Optional method if you want to use the html builder. + */ + public function html(): HtmlBuilder + { + return DummyBuilder::make(); + } + + /** + * Get the filename for export. + */ + protected function filename(): string + { + return 'DummyFilename_' . date('YmdHis'); + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/datatables.stub b/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/datatables.stub new file mode 100644 index 00000000..512be60b --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/datatables.stub @@ -0,0 +1,76 @@ +addColumn('action', 'DummyAction') + ->setRowId('id'); + } + + /** + * Get the query source of dataTable. + */ + public function query(ModelName $model): QueryBuilder + { + return $model->newQuery(); + } + + /** + * Optional method if you want to use the html builder. + */ + public function html(): HtmlBuilder + { + return $this->builder() + ->setTableId('DummyTableId') + ->columns($this->getColumns()) + ->minifiedAjax() + //->dom('DummyDOM') + ->orderBy(1) + ->selectStyleSingle() + ->buttons([ + DummyButtons + ]); + } + + /** + * Get the dataTable columns definition. + */ + public function getColumns(): array + { + return [ + Column::computed('action') + ->exportable(false) + ->printable(false) + ->width(60) + ->addClass('text-center'), + DummyColumns + ]; + } + + /** + * Get the filename for export. + */ + protected function filename(): string + { + return 'DummyFilename_' . date('YmdHis'); + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/html.stub b/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/html.stub new file mode 100644 index 00000000..37d1dcce --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/html.stub @@ -0,0 +1,45 @@ +setTableId('DummyTableId') + ->columns($this->getColumns()) + ->minifiedAjax() + //->dom('DummyDOM') + ->orderBy(1) + ->selectStyleSingle() + ->buttons([ + DummyButtons + ]); + } + + /** + * Get the dataTable columns definition. + */ + public function getColumns(): array + { + return [ + Column::computed('action') + ->exportable(false) + ->printable(false) + ->width(60) + ->addClass('text-center'), + DummyColumns + ]; + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/scopes.stub b/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/scopes.stub new file mode 100644 index 00000000..a39366a7 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Generators/stubs/scopes.stub @@ -0,0 +1,19 @@ +where('id', 1); + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Html/DataTableHtml.php b/vendor/yajra/laravel-datatables-buttons/src/Html/DataTableHtml.php new file mode 100644 index 00000000..d09d7c8b --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Html/DataTableHtml.php @@ -0,0 +1,58 @@ +handle(); + } + + /** @var static $html */ + $html = app(static::class); + + return $html->handle(); + } + + /** + * @param string $method + * @param mixed $parameters + * @return \Yajra\DataTables\Html\Builder + * + * @throws \Exception + */ + public function __call(string $method, $parameters) + { + if (method_exists($this->getHtmlBuilder(), $method)) { + return $this->getHtmlBuilder()->{$method}(...$parameters); + } + + throw new BadMethodCallException("Method {$method} does not exists"); + } + + protected function getHtmlBuilder(): Builder + { + if ($this->htmlBuilder) { + return $this->htmlBuilder; + } + + return $this->htmlBuilder = app(Builder::class); + } + + public function setHtmlBuilder(Builder $builder): static + { + $this->htmlBuilder = $builder; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Services/DataTable.php b/vendor/yajra/laravel-datatables-buttons/src/Services/DataTable.php new file mode 100644 index 00000000..07a7d847 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Services/DataTable.php @@ -0,0 +1,819 @@ +request = $request; + $this->htmlBuilder = $builder; + } + + /** + * Process dataTables needed render output. + * + * @phpstan-param view-string|null $view + * + * @param string|null $view + * @param array $data + * @param array $mergeData + * @return mixed + */ + public function render(string $view = null, array $data = [], array $mergeData = []) + { + if ($this->request()->ajax() && $this->request()->wantsJson()) { + return app()->call([$this, 'ajax']); + } + + /** @var string $action */ + $action = $this->request()->get('action'); + $actionMethod = $action === 'print' ? 'printPreview' : $action; + + if (in_array($action, $this->actions) && method_exists($this, $actionMethod)) { + /** @var callable $callback */ + $callback = [$this, $actionMethod]; + + return app()->call($callback); + } + + /** @phpstan-ignore-next-line */ + return view($view, $data, $mergeData)->with($this->dataTableVariable, $this->getHtmlBuilder()); + } + + /** + * Get DataTables Request instance. + * + * @return \Yajra\DataTables\Utilities\Request + */ + public function request(): Request + { + if (! $this->request) { + $this->request = app(Request::class); + } + + return $this->request; + } + + /** + * Display ajax response. + * + * @return \Illuminate\Http\JsonResponse + */ + public function ajax(): JsonResponse + { + $query = null; + if (method_exists($this, 'query')) { + /** @var EloquentBuilder|QueryBuilder|EloquentRelation $query */ + $query = app()->call([$this, 'query']); + $query = $this->applyScopes($query); + } + + /** @var \Yajra\DataTables\DataTableAbstract $dataTable */ + // @phpstan-ignore-next-line + $dataTable = app()->call([$this, 'dataTable'], compact('query')); + + if (is_callable($this->beforeCallback)) { + app()->call($this->beforeCallback, compact('dataTable')); + } + + if (is_callable($this->responseCallback)) { + $data = new Collection($dataTable->toArray()); + + $response = app()->call($this->responseCallback, compact('data')); + + return new JsonResponse($response); + } + + return $dataTable->toJson(); + } + + /** + * Display printable view of datatables. + * + * @return \Illuminate\Contracts\View\View + */ + public function printPreview(): Renderable + { + $data = $this->getDataForPrint(); + + return view($this->printPreview, compact('data')); + } + + /** + * Get mapped columns versus final decorated output. + * + * @return array + */ + protected function getDataForPrint(): array + { + $columns = $this->printColumns(); + + return $this->mapResponseToColumns($columns, 'printable'); + } + + /** + * Get printable columns. + * + * @return array|\Illuminate\Support\Collection + */ + protected function printColumns(): array|Collection + { + return is_array($this->printColumns) ? $this->toColumnsCollection($this->printColumns) : $this->getPrintColumnsFromBuilder(); + } + + /** + * Get filtered print columns definition from html builder. + * + * @return \Illuminate\Support\Collection + */ + protected function getPrintColumnsFromBuilder(): Collection + { + return $this->html()->removeColumn(...$this->excludeFromPrint)->getColumns(); + } + + /** + * Get filtered export columns definition from html builder. + * + * @return \Illuminate\Support\Collection + */ + protected function getExportColumnsFromBuilder(): Collection + { + return $this->html()->removeColumn(...$this->excludeFromExport)->getColumns(); + } + + /** + * Get columns definition from html builder. + * + * @return \Illuminate\Support\Collection + */ + protected function getColumnsFromBuilder(): Collection + { + return $this->html()->getColumns(); + } + + /** + * Optional method if you want to use html builder. + * + * @return \Yajra\DataTables\Html\Builder + */ + public function html() + { + return $this->builder(); + } + + /** + * Get DataTables Html Builder instance. + * + * @return \Yajra\DataTables\Html\Builder + */ + public function builder(): Builder + { + if (method_exists($this, 'htmlBuilder')) { + return $this->htmlBuilder = $this->htmlBuilder(); + } + + if (! $this->htmlBuilder) { + $this->htmlBuilder = app(Builder::class); + } + + return $this->htmlBuilder; + } + + /** + * Map ajax response to columns definition. + * + * @param array|Collection $columns + * @param string $type + * @return array + */ + protected function mapResponseToColumns($columns, string $type): array + { + $transformer = new DataArrayTransformer; + + return array_map(function ($row) use ($columns, $type, $transformer) { + return $transformer->transform($row, $columns, $type); + }, $this->getAjaxResponseData()); + } + + /** + * Get decorated data as defined in datatables ajax response. + * + * @return array + */ + protected function getAjaxResponseData(): array + { + $this->request()->merge([ + 'start' => 0, + 'length' => -1, + ]); + + /** @var JsonResponse $response */ + $response = app()->call([$this, 'ajax']); + + /** @var array{data: array} $data */ + $data = $response->getData(true); + + return $data['data']; + } + + /** + * @return \Yajra\DataTables\Html\Builder + */ + protected function getHtmlBuilder(): Builder + { + $builder = $this->html(); + if (is_callable($this->htmlCallback)) { + app()->call($this->htmlCallback, compact('builder')); + } + + return $builder; + } + + /** + * Add html builder callback hook. + * + * @param callable $callback + * @return $this + */ + public function withHtml(callable $callback): static + { + $this->htmlCallback = $callback; + + return $this; + } + + /** + * Add callback before sending the response. + * + * @param callable $callback + * @return $this + */ + public function before(callable $callback): static + { + $this->beforeCallback = $callback; + + return $this; + } + + /** + * Add callback after the response was processed. + * + * @param callable $callback + * @return $this + */ + public function response(callable $callback): static + { + $this->responseCallback = $callback; + + return $this; + } + + /** + * Export results to Excel file. + * + * @return string|\Symfony\Component\HttpFoundation\BinaryFileResponse|\Symfony\Component\HttpFoundation\StreamedResponse + * + * @throws \Exception + */ + public function excel() + { + set_time_limit(3600); + + $path = $this->getFilename().'.'.strtolower($this->excelWriter); + + $excelFile = $this->buildExcelFile(); + + if ($excelFile instanceof FastExcel) { + $callback = $this->fastExcelCallback ? $this->fastExcelCallback() : null; + + return $excelFile->download($path, $callback); + } + + // @phpstan-ignore-next-line + return $excelFile->download($path, $this->excelWriter); + } + + /** + * Build Excel file and prepare for export. + * + * @return mixed|FastExcel + * + * @throws \Exception + */ + protected function buildExcelFile() + { + if ($this->fastExcel) { + return $this->buildFastExcelFile(); + } + + if (! class_exists(ExcelServiceProvider::class)) { + throw new Exception('Please `composer require maatwebsite/excel` to be able to use this function.'); + } + + if (! new $this->exportClass instanceof DataTablesExportHandler) { + $collection = $this->getAjaxResponseData(); + + return new $this->exportClass($this->convertToLazyCollection($collection)); + } + + $collection = $this->getDataForExport(); + + return new $this->exportClass($this->convertToLazyCollection($collection)); + } + + /** + * Get export filename. + * + * @return string + */ + public function getFilename(): string + { + return $this->filename ?: $this->filename(); + } + + /** + * Set export filename. + * + * @param string $filename + * @return $this + */ + public function setFilename(string $filename): static + { + $this->filename = $filename; + + return $this; + } + + /** + * Get filename for export. + * + * @return string + */ + protected function filename(): string + { + return class_basename($this).'_'.date('YmdHis'); + } + + /** + * Get mapped columns versus final decorated output. + * + * @return array + */ + protected function getDataForExport(): array + { + $columns = $this->exportColumns(); + + return $this->mapResponseToColumns($columns, 'exportable'); + } + + /** + * Get export columns definition. + * + * @return Collection + */ + protected function exportColumns(): Collection + { + return is_array($this->exportColumns) ? $this->toColumnsCollection($this->exportColumns) : $this->getExportColumnsFromBuilder(); + } + + /** + * Convert array to collection of Column class. + * + * @param array $columns + * @return Collection + */ + private function toColumnsCollection(array $columns): Collection + { + $collection = new Collection; + + foreach ($columns as $column) { + if (isset($column['data'])) { + $column['title'] = $column['title'] ?? $column['data']; + $collection->push(new Column($column)); + } else { + $data = []; + $data['data'] = $column; + $data['title'] = $column; + $collection->push(new Column($data)); + } + } + + return $collection; + } + + /** + * Export results to CSV file. + * + * @return string|\Symfony\Component\HttpFoundation\StreamedResponse + * + * @throws \Exception + */ + public function csv() + { + set_time_limit(3600); + $path = $this->getFilename().'.'.strtolower($this->csvWriter); + + $excelFile = $this->buildExcelFile(); + + if ($excelFile instanceof FastExcel) { + $callback = $this->fastExcelCallback ? $this->fastExcelCallback() : null; + + return $excelFile->download($path, $callback); + } + + // @phpstan-ignore-next-line + return $this->buildExcelFile()->download($path, $this->csvWriter); + } + + /** + * Export results to PDF file. + * + * @return \Illuminate\Http\Response|string|\Symfony\Component\HttpFoundation\StreamedResponse + * + * @throws \Exception + */ + public function pdf() + { + if ('snappy' == config('datatables-buttons.pdf_generator', 'snappy')) { + return $this->snappyPdf(); + } + + // @phpstan-ignore-next-line + return $this->buildExcelFile()->download($this->getFilename().'.pdf', $this->pdfWriter); + } + + /** + * PDF version of the table using print preview blade template. + * + * @return \Illuminate\Http\Response + * + * @throws \Yajra\DataTables\Exceptions\Exception + */ + public function snappyPdf(): Response + { + if (! class_exists(PdfWrapper::class)) { + throw new Exception('Please `composer require barryvdh/laravel-snappy` to be able to use this feature.'); + } + + /** @var \Barryvdh\Snappy\PdfWrapper $snappy */ + $snappy = app('snappy.pdf.wrapper'); + $options = (array) config('datatables-buttons.snappy.options'); + + /** @var string $orientation */ + $orientation = config('datatables-buttons.snappy.orientation'); + + $snappy->setOptions($options)->setOrientation($orientation); + + return $snappy->loadHTML($this->printPreview())->download($this->getFilename().'.pdf'); + } + + /** + * Add basic array query scopes. + * + * @param \Yajra\DataTables\Contracts\DataTableScope $scope + * @return $this + */ + public function addScope(DataTableScope $scope): static + { + $this->scopes[] = $scope; + + return $this; + } + + /** + * Push multiples scopes to array query scopes. + * + * @param array $scopes + * @return $this + */ + public function addScopes(array $scopes): static + { + $this->scopes = array_merge($this->scopes, $scopes); + + return $this; + } + + /** + * Set a custom class attribute. + * + * @param array|string $key + * @param mixed|null $value + * @return $this + */ + public function with(array|string $key, mixed $value = null): static + { + if (is_array($key)) { + $this->attributes = array_merge($this->attributes, $key); + } else { + $this->attributes[$key] = $value; + } + + return $this; + } + + /** + * Dynamically retrieve the value of an attribute. + * + * @param string $key + * @return mixed|null + */ + public function __get(string $key) + { + if (array_key_exists($key, $this->attributes)) { + return $this->attributes[$key]; + } + + return null; + } + + /** + * Apply query scopes. + */ + protected function applyScopes( + EloquentBuilder|QueryBuilder|EloquentRelation|Collection|AnonymousResourceCollection $query + ): EloquentBuilder|QueryBuilder|EloquentRelation|Collection|AnonymousResourceCollection { + foreach ($this->scopes as $scope) { + $scope->apply($query); + } + + return $query; + } + + /** + * Determine if the DataTable has scopes. + * + * @param array $scopes + * @param bool $validateAll + * @return bool + */ + protected function hasScopes(array $scopes, bool $validateAll = false): bool + { + $filteredScopes = array_filter($this->scopes, function ($scope) use ($scopes) { + return in_array(get_class($scope), $scopes); + }); + + return $validateAll ? count($filteredScopes) === count($scopes) : ! empty($filteredScopes); + } + + /** + * Get default builder parameters. + * + * @return array + */ + protected function getBuilderParameters(): array + { + /** @var array $defaults */ + $defaults = config('datatables-buttons.parameters', []); + + return $defaults; + } + + /** + * @param array|\Illuminate\Support\Collection $collection + * @return \Illuminate\Support\LazyCollection + */ + protected function convertToLazyCollection(array|Collection $collection): LazyCollection + { + if (is_array($collection)) { + $collection = collect($collection); + } + + return $collection->lazy(); + } + + /** + * @return \Closure + */ + public function fastExcelCallback(): Closure + { + return function ($row) { + $mapped = []; + + $this->exportColumns()->each(function (Column $column) use (&$mapped, $row) { + if ($column['exportable']) { + $mapped[$column['title']] = $row[$column['data']]; + } + }); + + return $mapped; + }; + } + + /** + * @return \Rap2hpoutre\FastExcel\FastExcel + * + * @throws \Yajra\DataTables\Exceptions\Exception + */ + protected function buildFastExcelFile(): FastExcel + { + if (! class_exists(FastExcel::class)) { + throw new Exception('Please `composer require rap2hpoutre/fast-excel` to be able to use this function.'); + } + + $query = null; + if (method_exists($this, 'query')) { + /** @var EloquentBuilder|QueryBuilder $query */ + $query = app()->call([$this, 'query']); + $query = $this->applyScopes($query); + } + + /** @var \Yajra\DataTables\DataTableAbstract $dataTable */ + // @phpstan-ignore-next-line + $dataTable = app()->call([$this, 'dataTable'], compact('query')); + $dataTable->skipPaging(); + + if ($dataTable instanceof QueryDataTable) { + $queryGenerator = function ($dataTable): Generator { + foreach ($dataTable->getFilteredQuery()->cursor() as $row) { + yield $row; + } + }; + + return new FastExcel($queryGenerator($dataTable)); + } + + return new FastExcel($dataTable->toArray()['data']); + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/Services/DataTablesExportHandler.php b/vendor/yajra/laravel-datatables-buttons/src/Services/DataTablesExportHandler.php new file mode 100644 index 00000000..0b1e7e86 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/Services/DataTablesExportHandler.php @@ -0,0 +1,9 @@ + $columns + * @param string $type + * @return array + */ + public function transform(array $row, array|Collection $columns, string $type = 'printable'): array + { + if ($columns instanceof Collection) { + return $this->buildColumnByCollection($row, $columns, $type); + } + + return Arr::only($row, $columns); + } + + /** + * Transform row column by collection. + * + * @param array $row + * @param Collection $columns + * @param string $type + * @return array + */ + protected function buildColumnByCollection(array $row, Collection $columns, string $type = 'printable'): array + { + $results = []; + $columns->each(function (Column $column) use ($row, $type, &$results) { + if ($column[$type]) { + $title = $column->title; + if (is_array($column->data)) { + $key = $column->data['filter'] ?? $column->name ?? ''; + } else { + $key = $column->data ?? $column->name; + } + + $data = Arr::get($row, $key) ?? ''; + + if ($type == 'exportable') { + $title = $this->decodeContent($title); + $data = is_array($data) ? json_encode($data) : $this->decodeContent($data); + } + + if (isset($column->exportRender)) { + $callback = $column->exportRender; + $results[$title] = $callback($row, $data); + } else { + $results[$title] = $data; + } + } + }); + + return $results; + } + + /** + * Decode content to a readable text value. + * + * @param mixed $data + * @return mixed + */ + protected function decodeContent(mixed $data): mixed + { + if (is_bool($data)) { + return $data ? 'True' : 'False'; + } + + if (is_string($data)) { + $decoded = html_entity_decode(trim(strip_tags($data)), ENT_QUOTES, 'UTF-8'); + + return (string) str_replace("\xc2\xa0", ' ', $decoded); + } + + return $data; + } +} diff --git a/vendor/yajra/laravel-datatables-buttons/src/config/config.php b/vendor/yajra/laravel-datatables-buttons/src/config/config.php new file mode 100644 index 00000000..1276d133 --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/config/config.php @@ -0,0 +1,91 @@ + [ + /* + * Base namespace/directory to create the new file. + * This is appended on default Laravel namespace. + * Usage: php artisan datatables:make User + * Output: App\DataTables\UserDataTable + * With Model: App\User (default model) + * Export filename: users_timestamp + */ + 'base' => 'DataTables', + + /* + * Base namespace/directory where your model's are located. + * This is appended on default Laravel namespace. + * Usage: php artisan datatables:make Post --model + * Output: App\DataTables\PostDataTable + * With Model: App\Post + * Export filename: posts_timestamp + */ + 'model' => 'App\\Models', + ], + + /* + * Set Custom stub folder + */ + //'stub' => '/resources/custom_stub', + + /* + * PDF generator to be used when converting the table to pdf. + * Available generators: excel, snappy + * Snappy package: barryvdh/laravel-snappy + * Excel package: maatwebsite/excel + */ + 'pdf_generator' => 'snappy', + + /* + * Snappy PDF options. + */ + 'snappy' => [ + 'options' => [ + 'no-outline' => true, + 'margin-left' => '0', + 'margin-right' => '0', + 'margin-top' => '10mm', + 'margin-bottom' => '10mm', + ], + 'orientation' => 'landscape', + ], + + /* + * Default html builder parameters. + */ + 'parameters' => [ + 'dom' => 'Bfrtip', + 'order' => [[0, 'desc']], + 'buttons' => [ + 'excel', + 'csv', + 'pdf', + 'print', + 'reset', + 'reload', + ], + ], + + /* + * Generator command default options value. + */ + 'generator' => [ + /* + * Default columns to generate when not set. + */ + 'columns' => 'id,add your columns,created_at,updated_at', + + /* + * Default buttons to generate when not set. + */ + 'buttons' => 'excel,csv,pdf,print,reset,reload', + + /* + * Default DOM to generate when not set. + */ + 'dom' => 'Bfrtip', + ], +]; diff --git a/vendor/yajra/laravel-datatables-buttons/src/resources/assets/buttons.server-side.js b/vendor/yajra/laravel-datatables-buttons/src/resources/assets/buttons.server-side.js new file mode 100644 index 00000000..e012c9bc --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/resources/assets/buttons.server-side.js @@ -0,0 +1,284 @@ +(function ($, DataTable) { + "use strict"; + + var _buildParams = function (dt, action, onlyVisibles) { + var params = dt.ajax.params(); + params.action = action; + params._token = $('meta[name="csrf-token"]').attr('content'); + + if (onlyVisibles) { + params.visible_columns = _getVisibleColumns(); + } else { + params.visible_columns = null; + } + + return params; + }; + + var _getVisibleColumns = function () { + + var visible_columns = []; + $.each(DataTable.settings[0].aoColumns, function (key, col) { + if (col.bVisible) { + visible_columns.push(col.name); + } + }); + + return visible_columns; + }; + + var _downloadFromUrl = function (url, params) { + var postUrl = url + '/export'; + var xhr = new XMLHttpRequest(); + xhr.open('POST', postUrl, true); + xhr.responseType = 'arraybuffer'; + xhr.onload = function () { + if (this.status === 200) { + var filename = ""; + var disposition = xhr.getResponseHeader('Content-Disposition'); + if (disposition && disposition.indexOf('attachment') !== -1) { + var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; + var matches = filenameRegex.exec(disposition); + if (matches != null && matches[1]) filename = matches[1].replace(/['"]/g, ''); + } + var type = xhr.getResponseHeader('Content-Type'); + + var blob = new Blob([this.response], {type: type}); + if (typeof window.navigator.msSaveBlob !== 'undefined') { + // IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed." + window.navigator.msSaveBlob(blob, filename); + } else { + var URL = window.URL || window.webkitURL; + var downloadUrl = URL.createObjectURL(blob); + + if (filename) { + // use HTML5 a[download] attribute to specify filename + var a = document.createElement("a"); + // safari doesn't support this yet + if (typeof a.download === 'undefined') { + window.location = downloadUrl; + } else { + a.href = downloadUrl; + a.download = filename; + document.body.appendChild(a); + a.click(); + } + } else { + window.location = downloadUrl; + } + + setTimeout(function () { + URL.revokeObjectURL(downloadUrl); + }, 100); // cleanup + } + } + }; + xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + xhr.send($.param(params)); + }; + + var _buildUrl = function(dt, action) { + var url = dt.ajax.url() || ''; + var params = dt.ajax.params(); + params.action = action; + + if (url.indexOf('?') > -1) { + return url + '&' + $.param(params); + } + + return url + '?' + $.param(params); + }; + + DataTable.ext.buttons.excel = { + className: 'buttons-excel', + + text: function (dt) { + return ' ' + dt.i18n('buttons.excel', 'Excel'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'excel'); + window.location = url; + } + }; + + DataTable.ext.buttons.postExcel = { + className: 'buttons-excel', + + text: function (dt) { + return ' ' + dt.i18n('buttons.excel', 'Excel'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'excel'); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.postExcelVisibleColumns = { + className: 'buttons-excel', + + text: function (dt) { + return ' ' + dt.i18n('buttons.excel', 'Excel (only visible columns)'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'excel', true); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.export = { + extend: 'collection', + + className: 'buttons-export', + + text: function (dt) { + return ' ' + dt.i18n('buttons.export', 'Export') + ' '; + }, + + buttons: ['csv', 'excel', 'pdf'] + }; + + DataTable.ext.buttons.csv = { + className: 'buttons-csv', + + text: function (dt) { + return ' ' + dt.i18n('buttons.csv', 'CSV'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'csv'); + window.location = url; + } + }; + + DataTable.ext.buttons.postCsvVisibleColumns = { + className: 'buttons-csv', + + text: function (dt) { + return ' ' + dt.i18n('buttons.csv', 'CSV (only visible columns)'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'csv', true); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.postCsv = { + className: 'buttons-csv', + + text: function (dt) { + return ' ' + dt.i18n('buttons.csv', 'CSV'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'csv'); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.pdf = { + className: 'buttons-pdf', + + text: function (dt) { + return ' ' + dt.i18n('buttons.pdf', 'PDF'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'pdf'); + window.location = url; + } + }; + + DataTable.ext.buttons.postPdf = { + className: 'buttons-pdf', + + text: function (dt) { + return ' ' + dt.i18n('buttons.pdf', 'PDF'); + }, + + action: function (e, dt, button, config) { + var url = dt.ajax.url() || window.location.href; + var params = _buildParams(dt, 'pdf'); + + _downloadFromUrl(url, params); + } + }; + + DataTable.ext.buttons.print = { + className: 'buttons-print', + + text: function (dt) { + return ' ' + dt.i18n('buttons.print', 'Print'); + }, + + action: function (e, dt, button, config) { + var url = _buildUrl(dt, 'print'); + window.location = url; + } + }; + + DataTable.ext.buttons.reset = { + className: 'buttons-reset', + + text: function (dt) { + return ' ' + dt.i18n('buttons.reset', 'Reset'); + }, + + action: function (e, dt, button, config) { + dt.search(''); + dt.columns().search(''); + dt.draw(); + } + }; + + DataTable.ext.buttons.reload = { + className: 'buttons-reload', + + text: function (dt) { + return ' ' + dt.i18n('buttons.reload', 'Reload'); + }, + + action: function (e, dt, button, config) { + dt.draw(false); + } + }; + + DataTable.ext.buttons.create = { + className: 'buttons-create', + + text: function (dt) { + return ' ' + dt.i18n('buttons.create', 'Create'); + }, + + action: function (e, dt, button, config) { + window.location = window.location.href.replace(/\/+$/, "") + '/create'; + } + }; + + if (typeof DataTable.ext.buttons.copyHtml5 !== 'undefined') { + $.extend(DataTable.ext.buttons.copyHtml5, { + text: function (dt) { + return ' ' + dt.i18n('buttons.copy', 'Copy'); + } + }); + } + + if (typeof DataTable.ext.buttons.colvis !== 'undefined') { + $.extend(DataTable.ext.buttons.colvis, { + text: function (dt) { + return ' ' + dt.i18n('buttons.colvis', 'Column visibility'); + } + }); + } +})(jQuery, jQuery.fn.dataTable); diff --git a/vendor/yajra/laravel-datatables-buttons/src/resources/views/print.blade.php b/vendor/yajra/laravel-datatables-buttons/src/resources/views/print.blade.php new file mode 100644 index 00000000..735d84df --- /dev/null +++ b/vendor/yajra/laravel-datatables-buttons/src/resources/views/print.blade.php @@ -0,0 +1,37 @@ + + + + Print Table + + + + + + + + + + + @foreach($data as $row) + @if ($loop->first) + + @foreach($row as $key => $value) + + @endforeach + + @endif + + @foreach($row as $key => $value) + @if(is_string($value) || is_numeric($value)) + + @else + + @endif + @endforeach + + @endforeach +
{!! $key !!}
{!! $value !!}
+ + diff --git a/vendor/yajra/laravel-datatables-html/CHANGELOG.md b/vendor/yajra/laravel-datatables-html/CHANGELOG.md new file mode 100644 index 00000000..12afe79d --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/CHANGELOG.md @@ -0,0 +1,101 @@ +# Laravel DataTables Html Plugin. + +[![Latest Stable Version](https://poser.pugx.org/yajra/laravel-datatables-html/v/stable.png)](https://packagist.org/packages/yajra/laravel-datatables-html) +[![Total Downloads](https://poser.pugx.org/yajra/laravel-datatables-html/downloads.png)](https://packagist.org/packages/yajra/laravel-datatables-html) +[![Build Status](https://travis-ci.org/yajra/laravel-datatables-html.png?branch=master)](https://travis-ci.org/yajra/laravel-datatables-html) +[![Latest Unstable Version](https://poser.pugx.org/yajra/laravel-datatables-html/v/unstable.svg)](https://packagist.org/packages/yajra/laravel-datatables-html) +[![License](https://poser.pugx.org/yajra/laravel-datatables-html/license.svg)](https://packagist.org/packages/yajra/laravel-datatables-html) + +## CHANGELOG + +### v10.12.0 - 2023-12-15 + +- feat: allow macro on Field #213 + +### v10.11.0 - 2023-11-06 + +- feat: add batch remove optimization script (optional) #212 + +### v10.10.0 - 2023-11-04 + +- feat: Add optional scout js script #210 +- feat: add script support when using editor #211 + +### v10.9.1 - 2023-10-04 + +- fix: add missing Arrayable param #208 +- fix phpstan error: Parameter #1 $value of method Yajra\DataTables\Html\Builder::searchPanes() expects array|bool|(callable(): mixed), Yajra\DataTables\Html\SearchPane given. + +### v10.9.0 - 2023-10-02 + +- feat: add dtsp collapse option setter #206 +- feat: add initCollapsed option setter #207 + +### v10.8.2 - 2023-10-02 + +- fix: show searchPanes by default #205 + +### v10.8.1 - 2023-08-16 + +- Revert "fix: Mixed Content problem with updating minifiedAjax method and get current url based on http or https scheme" #202 +- Reverts #186 +- fix: #201 + +### v10.8.0 - 2023-07-31 + +- fix: Mixed Content problem with updating minifiedAjax method and get current url based on http or https scheme #186 +- fix: #194 +- feat: add exportRender method #195 + +### v10.7.0 - 2023-06-08 + +- feat: new method for enum options #196 + +### v10.6.0 - 2023-03-31 + +- feat: thead class builder #191 +- fix: #169 +- fix: [yajra/laravel-datatables#2706](https://github.com/yajra/laravel-datatables/issues/2706) + +### v10.5.2 - 2023-03-31 + +- fix: backward compatibility with FormOptions class #190 + +### v10.5.1 - 2023-03-28 + +- fix: scripts attributes not working #189 + +### v10.5.0 - 2023-03-02 + +- feat: hide/show fields based on editor action #188 + - hiddenOnCreate + - hiddenOnEdit + - hiddenOn + +### v10.4.0 - 2023-03-02 + +- feat: add datetime field options #187 + - wireFormat + - keyInput + - displayFormat + +### v10.3.1 - 2023-02-20 + +- fix: too long file name check for column render #185 + +### v10.3.0 - 2023-02-20 + +- feat: add builder ability to use viteJs by default #184 + +### v10.2.0 - 2023-02-20 + +- feat: allow callable exportFormat parameter #167 + +### v10.1.0 - 2023-02-07 + +- Drop Collective\Html dependency #183 +- Copy Collective HtmlBuilder class and implemented php-stan + +### v10.0.0 - 2023-02-07 + +- Add Laravel 10 specific support diff --git a/vendor/yajra/laravel-datatables-html/CONDUCT.md b/vendor/yajra/laravel-datatables-html/CONDUCT.md new file mode 100644 index 00000000..6ff94ca3 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/CONDUCT.md @@ -0,0 +1,22 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/vendor/yajra/laravel-datatables-html/LICENSE.md b/vendor/yajra/laravel-datatables-html/LICENSE.md new file mode 100644 index 00000000..178e5252 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/LICENSE.md @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013-2022 Arjay Angeles + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/yajra/laravel-datatables-html/README.md b/vendor/yajra/laravel-datatables-html/README.md new file mode 100644 index 00000000..4384075b --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/README.md @@ -0,0 +1,79 @@ +# Laravel DataTables Html Plugin. + +[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-orange.svg)](http://laravel.com) +[![Latest Stable Version](https://img.shields.io/packagist/v/yajra/laravel-datatables-html.svg)](https://packagist.org/packages/yajra/laravel-datatables-html) +![Build Status](https://github.com/yajra/laravel-datatables-html/workflows/tests/badge.svg) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yajra/laravel-datatables-html/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yajra/laravel-datatables-html/?branch=master) +[![Total Downloads](https://img.shields.io/packagist/dt/yajra/laravel-datatables-html.svg)](https://packagist.org/packages/yajra/laravel-datatables-html) +[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/yajra/laravel-datatables-html) + +This package is a plugin of [Laravel DataTables](https://github.com/yajra/laravel-datatables) for generating dataTables script using PHP. + +## Requirements + +- [Laravel 10.x](https://github.com/laravel/framework) +- [Laravel DataTables](https://github.com/yajra/laravel-datatables) + +## Documentations + +- [Laravel DataTables Documentation](http://yajrabox.com/docs/laravel-datatables) +- [Demo Application](http://datatables.yajrabox.com) is available for artisan's reference. + +## Laravel Version Compatibility + +| Laravel | Package | +|:--------------|:--------| +| 8.x and below | 4.x | +| 9.x | 9.x | +| 10.x | 10.x | + +## Quick Installation + +`composer require yajra/laravel-datatables-html:^10` + +#### Setup scripts with ViteJS + +Set the default javascript type to `module` by setting `Builder::useVite()` in the `AppServiceProvider`. + +```php +namespace App\Providers; + +use Illuminate\Pagination\Paginator; +use Illuminate\Support\ServiceProvider; +use Yajra\DataTables\Html\Builder; + +class AppServiceProvider extends ServiceProvider +{ + /** + * Bootstrap any application services. + */ + public function boot(): void + { + Paginator::useBootstrapFive(); + Builder::useVite(); + } +} +``` + +#### Publish Assets (Optional) + +`$ php artisan vendor:publish --tag=datatables-html` + +And that's it! Start building out some awesome DataTables! + +## Contributing + +Please see [CONTRIBUTING](https://github.com/yajra/laravel-datatables-html/blob/master/.github/CONTRIBUTING.md) for details. + +## Security + +If you discover any security related issues, please email [aqangeles@gmail.com](mailto:aqangeles@gmail.com) instead of using the issue tracker. + +## Credits + +- [Arjay Angeles](https://github.com/yajra) +- [All Contributors](https://github.com/yajra/laravel-datatables-html/graphs/contributors) + +## License + +The MIT License (MIT). Please see [License File](https://github.com/yajra/laravel-datatables-html/blob/master/LICENSE.md) for more information. diff --git a/vendor/yajra/laravel-datatables-html/UPGRADE.md b/vendor/yajra/laravel-datatables-html/UPGRADE.md new file mode 100644 index 00000000..453dc3ee --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/UPGRADE.md @@ -0,0 +1 @@ +# Upgrade Notes diff --git a/vendor/yajra/laravel-datatables-html/composer.json b/vendor/yajra/laravel-datatables-html/composer.json new file mode 100644 index 00000000..2b9d3e59 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/composer.json @@ -0,0 +1,49 @@ +{ + "name": "yajra/laravel-datatables-html", + "description": "Laravel DataTables HTML builder plugin for Laravel 5.4+.", + "keywords": [ + "laravel", + "dataTables", + "jquery", + "html", + "js" + ], + "license": "MIT", + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "require": { + "php": "^8.1", + "ext-json": "*", + "yajra/laravel-datatables-oracle": "^10.0" + }, + "require-dev": { + "nunomaduro/larastan": "^2.4", + "orchestra/testbench": "^7.21" + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Yajra\\DataTables\\Html\\Tests\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "10.0-dev" + }, + "laravel": { + "providers": [ + "Yajra\\DataTables\\HtmlServiceProvider" + ] + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/vendor/yajra/laravel-datatables-html/phpunit.xml b/vendor/yajra/laravel-datatables-html/phpunit.xml new file mode 100644 index 00000000..422eeac6 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/phpunit.xml @@ -0,0 +1,17 @@ + + + + + ./tests/ + + + diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Builder.php b/vendor/yajra/laravel-datatables-html/src/Html/Builder.php new file mode 100644 index 00000000..5335e06e --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Builder.php @@ -0,0 +1,312 @@ + + */ + public Collection $collection; + + /** + * @var array + */ + protected array $tableAttributes = []; + + /** + * @var string + */ + protected string $template = ''; + + /** + * @var array + */ + protected array $attributes = []; + + /** + * @var string|array + */ + protected string|array $ajax = ''; + + /** + * @var array + */ + protected array $additionalScripts = []; + + /** + * @param Repository $config + * @param Factory $view + * @param HtmlBuilder $html + */ + public function __construct(public Repository $config, public Factory $view, public HtmlBuilder $html) + { + /** @var array $defaults */ + $defaults = $this->config->get('datatables-html.table', []); + + $this->collection = new Collection; + $this->tableAttributes = $defaults; + $this->attributes = [ + 'serverSide' => true, + 'processing' => true, + ]; + } + + /** + * Set the default type to module for the DataTables javascript. + */ + public static function useVite(): void + { + static::$jsType = 'module'; + } + + /** + * Set the default type to text/javascript for the DataTables javascript. + */ + public static function useWebpack(): void + { + static::$jsType = 'text/javascript'; + } + + /** + * Generate DataTable javascript. + * + * @param string|null $script + * @param array $attributes + * @return \Illuminate\Support\HtmlString + */ + public function scripts(string $script = null, array $attributes = []): HtmlString + { + $script = $script ?: $this->generateScripts(); + $attributes = $this->html->attributes( + array_merge($attributes, ['type' => $attributes['type'] ?? static::$jsType]) + ); + + return new HtmlString("$script"); + } + + /** + * Get generated raw scripts. + * + * @return \Illuminate\Support\HtmlString + */ + public function generateScripts(): HtmlString + { + $parameters = $this->generateJson(); + + return new HtmlString( + trim(sprintf($this->template(), $this->getTableAttribute('id'), $parameters)) + ); + } + + /** + * Get generated json configuration. + * + * @return string + */ + public function generateJson(): string + { + return $this->parameterize($this->getOptions()); + } + + /** + * Generate DataTables js parameters. + * + * @param array $attributes + * @return string + */ + public function parameterize(array $attributes = []): string + { + $parameters = (new Parameters($attributes))->toArray(); + + return Helper::toJsonScript($parameters); + } + + /** + * Get DataTable options array. + * + * @return array + */ + public function getOptions(): array + { + return array_merge( + $this->attributes, [ + 'ajax' => $this->ajax, + 'columns' => $this->collection->map(function (Column $column) { + $column = $column->toArray(); + unset($column['attributes']); + + return $column; + })->toArray(), + ] + ); + } + + /** + * Get javascript template to use. + * + * @return string + */ + protected function template(): string + { + /** @var view-string $configTemplate */ + $configTemplate = $this->config->get('datatables-html.script', 'datatables::script'); + + $template = $this->template ?: $configTemplate; + + return $this->view->make($template, ['editors' => $this->editors, 'scripts' => $this->additionalScripts])->render(); + } + + /** + * Generate DataTable's table html. + * + * @param array $attributes + * @param bool $drawFooter + * @param bool $drawSearch + * @return \Illuminate\Support\HtmlString + */ + public function table(array $attributes = [], bool $drawFooter = false, bool $drawSearch = false): HtmlString + { + $this->setTableAttributes($attributes); + + $th = $this->compileTableHeaders(); + $htmlAttr = $this->html->attributes($this->tableAttributes); + + $tableHtml = ''; + $searchHtml = $drawSearch + ? ''.implode('', $this->compileTableSearchHeaders()).'' + : ''; + + $tableHtml .= 'theadClass ?? '').'>'; + $tableHtml .= ''.implode('', $th).''.$searchHtml.''; + + if ($drawFooter) { + $tf = $this->compileTableFooter(); + $tableHtml .= ''.implode('', $tf).''; + } + + $tableHtml .= ''; + + return new HtmlString($tableHtml); + } + + /** + * Configure DataTable's parameters. + * + * @param array $attributes + * @return $this + */ + public function parameters(array $attributes = []): static + { + $this->attributes = array_merge($this->attributes, $attributes); + + return $this; + } + + /** + * Generate scripts that set the dataTables options into a variable. + * + * @return $this + */ + public function asOptions(): static + { + return $this->setTemplate('datatables::options'); + } + + /** + * Set custom javascript template. + * + * @param string $template + * @return $this + */ + public function setTemplate(string $template): static + { + $this->template = $template; + + return $this; + } + + /** + * Wrap dataTable scripts with a function. + * + * @return $this + */ + public function asFunction(): static + { + return $this->setTemplate('datatables::function'); + } + + /** + * @return array + */ + public function getAttributes(): array + { + return $this->attributes; + } + + /** + * @param string $key + * @param mixed $default + * @return mixed + */ + public function getAttribute(string $key, mixed $default = ''): mixed + { + return $this->attributes[$key] ?? $default; + } + + /** + * @param string|null $key + * @return array|string + */ + public function getAjax(string $key = null): array|string + { + if (! is_null($key)) { + return $this->ajax[$key] ?? ''; + } + + return $this->ajax; + } + + /** + * Add additional scripts to the DataTables JS initialization. + * + * @param string $view + * @return $this + */ + public function addScript(string $view): static + { + $this->additionalScripts[] = $view; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Button.php b/vendor/yajra/laravel-datatables-html/src/Html/Button.php new file mode 100755 index 00000000..0b3b7f2a --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Button.php @@ -0,0 +1,445 @@ + $options]); + } + + return new static($options); + } + + /** + * Make a raw button that does not extend anything. + * + * @param array|string $options + * @return static + */ + public static function raw(array|string $options = []): static + { + if (is_string($options)) { + return new static(['text' => $options]); + } + + return new static($options); + } + + /** + * Set attr option value. + * + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.attr + */ + public function attr(array $value): static + { + $this->attributes['attr'] = $value; + + return $this; + } + + /** + * Set available option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.available + */ + public function available(string $value): static + { + if ($this->isFunction($value)) { + $this->attributes['available'] = $value; + } else { + $this->attributes['available'] = "function(dt, config) { $value }"; + } + + return $this; + } + + /** + * Check if a given value is a function. + * + * @param string $value + * @return bool + */ + protected function isFunction(string $value): bool + { + return str_starts_with($value, 'function'); + } + + /** + * Set enabled option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.enabled + */ + public function enabled(bool $value = true): static + { + $this->attributes['enabled'] = $value; + + return $this; + } + + /** + * Set init option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.init + */ + public function init(string $value): static + { + if ($this->isFunction($value)) { + $this->attributes['init'] = $value; + } else { + $this->attributes['init'] = "function(dt, node, config) { $value }"; + } + + return $this; + } + + /** + * Set key option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.key + */ + public function key(array|string $value): static + { + $this->attributes['key'] = $value; + + return $this; + } + + /** + * Set extend option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.extend + */ + public function extend(string $value): static + { + $this->attributes['extend'] = $value; + + return $this; + } + + /** + * Set editor option value. + * + * @param string $value + * @return $this + * @see https://editor.datatables.net/reference/button + */ + public function editor(string $value): static + { + $this->attributes['editor'] = $value; + + return $this; + } + + /** + * Set buttons option value. + * + * @param array $buttons + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons + */ + public function buttons(array $buttons): static + { + foreach ($buttons as $key => $button) { + if ($button instanceof Arrayable) { + $buttons[$key] = $button->toArray(); + } + } + + $this->attributes['buttons'] = $buttons; + + return $this; + } + + /** + * @param array $buttons + * @return $this + * @see https://editor.datatables.net/examples/api/cancelButton + */ + public function formButtons(array $buttons): static + { + foreach ($buttons as $key => $button) { + if ($button instanceof Arrayable) { + $buttons[$key] = $button->toArray(); + } + } + + $this->attributes['formButtons'] = $buttons; + + return $this; + } + + /** + * @param string $message + * @return $this + * @see https://editor.datatables.net/examples/api/removeMessage + * @see https://editor.datatables.net/reference/button/create + * @see https://editor.datatables.net/reference/button/edit + * @see https://editor.datatables.net/reference/button/remove + */ + public function formMessage(string $message): static + { + $this->attributes['formMessage'] = $message; + + return $this; + } + + /** + * @param string $title + * @return $this + * @see https://editor.datatables.net/reference/button/create + * @see https://editor.datatables.net/reference/button/edit + * @see https://editor.datatables.net/reference/button/remove + */ + public function formTitle(string $title): static + { + $this->attributes['formTitle'] = $title; + + return $this; + } + + /** + * Set className option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.className + */ + public function className(string $value): static + { + $this->attributes['className'] = $value; + + return $this; + } + + /** + * Set destroy option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.destroy + */ + public function destroy(string $value): static + { + if ($this->isFunction($value)) { + $this->attributes['destroy'] = $value; + } else { + $this->attributes['destroy'] = "function(dt, node, config) { $value }"; + } + + return $this; + } + + /** + * Set customize option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/button/excelHtml5 + */ + public function customize(string $value): static + { + $this->attributes['customize'] = $value; + + return $this; + } + + /** + * Append a class name to column. + * + * @param string $class + * @return $this + */ + public function addClass(string $class): static + { + if (! isset($this->attributes['className'])) { + $this->attributes['className'] = $class; + } else { + $this->attributes['className'] .= " $class"; + } + + return $this; + } + + /** + * Set text option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.text + */ + public function text(string $value): static + { + $this->attributes['text'] = $value; + + return $this; + } + + /** + * Set titleAttr option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.titleAttr + */ + public function titleAttr(string $value): static + { + $this->attributes['titleAttr'] = $value; + + return $this; + } + + /** + * Set name option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.name + */ + public function name(string $value): static + { + $this->attributes['name'] = $value; + + return $this; + } + + /** + * Set namespace option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.namespace + */ + public function namespace(string $value): static + { + $this->attributes['namespace'] = $value; + + return $this; + } + + /** + * Set tag option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/buttons.buttons.tag + */ + public function tag(string $value): static + { + $this->attributes['tag'] = $value; + + return $this; + } + + /** + * Set columns option value. + * + * @param array|string $value + * @return $this + */ + public function columns(array|string $value): static + { + $this->attributes['columns'] = $value; + + return $this; + } + + /** + * Set exportOptions option value. + * + * @param array|string $value + * @return $this + */ + public function exportOptions(array|string $value): static + { + $this->attributes['exportOptions'] = $value; + + return $this; + } + + /** + * Set action to submit the form. + * + * @return $this + */ + public function actionSubmit(): static + { + return $this->action('function() { this.submit(); }'); + } + + /** + * Set action option value. + * + * @param string $value + * @return $this + */ + public function action(string $value): static + { + if (str_starts_with($value, 'function')) { + $this->attributes['action'] = $value; + } else { + $this->attributes['action'] = "function(e, dt, node, config) { $value }"; + } + + return $this; + } + + /** + * Set editor class action handler. + * + * @param string $action + * @return $this + */ + public function actionHandler(string $action): static + { + return $this->action("function() { this.submit(null, null, function(data) { data.action = '{$action}'; return data; }) }"); + } + + /** + * Set action to close the form. + * + * @return $this + */ + public function actionClose(): static + { + return $this->action('function() { this.close(); }'); + } + + /** + * Set button alignment. + * + * @param string $align + * @return $this + */ + public function align(string $align = 'button-left'): static + { + $this->attributes['align'] = $align; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Column.php b/vendor/yajra/laravel-datatables-html/src/Html/Column.php new file mode 100644 index 00000000..61cc1b2c --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Column.php @@ -0,0 +1,631 @@ + $value) { + $method = 'parse'.ucfirst(strtolower($attribute)); + if (! is_null($value) && method_exists($this, $method)) { + $attributes[$attribute] = $this->$method($value); + } + } + + if (! isset($attributes['name']) && isset($attributes['data'])) { + $attributes['name'] = $attributes['data']; + } + + parent::__construct($attributes); + } + + /** + * Format string to title case. + * + * @param string $value + * @return string + */ + public static function titleFormat(string $value): string + { + return Str::title(str_replace(['.', '_'], ' ', Str::snake($value))); + } + + /** + * Set column title. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.title + */ + public function title(string $value): static + { + $this->attributes['title'] = $value; + + return $this; + } + + /** + * Create a computed column that is not searchable/orderable. + * + * @param string $data + * @param string|null $title + * @return Column + */ + public static function computed(string $data, string $title = null): Column + { + if (is_null($title)) { + $title = self::titleFormat($data); + } + + return static::make($data)->title($title)->orderable(false)->searchable(false); + } + + /** + * Set column searchable flag. + * + * @param bool $flag + * @return $this + * @see https://datatables.net/reference/option/columns.searchable + */ + public function searchable(bool $flag = true): static + { + $this->attributes['searchable'] = $flag; + + return $this; + } + + /** + * Set column orderable flag. + * + * @param bool $flag + * @return $this + * @see https://datatables.net/reference/option/columns.orderable + */ + public function orderable(bool $flag = true): static + { + $this->attributes['orderable'] = $flag; + + return $this; + } + + /** + * Make a new column instance. + * + * @param array|string $data + * @param string $name + * @return static + */ + public static function make(array|string $data = [], string $name = ''): static + { + $attr = $data; + if (is_string($data)) { + $attr = [ + 'data' => $data, + 'name' => $name ?: $data, + ]; + } + + return new static($attr); + } + + /** + * Make a new formatted column instance. + * + * @param string $name + * @return static + */ + public static function formatted(string $name): static + { + $attr = [ + 'data' => $name, + 'name' => $name, + 'title' => self::titleFormat($name), + 'render' => 'full.'.$name.'_formatted', + ]; + + return new static($attr); + } + + /** + * Create a checkbox column. + * + * @param string $title + * @return static + */ + public static function checkbox(string $title = ''): static + { + return static::make('') + ->content('') + ->title($title) + ->className('select-checkbox') + ->orderable(false) + ->exportable(false) + ->searchable(false); + } + + /** + * Set column exportable flag. + * + * @param bool $flag + * @return $this + */ + public function exportable(bool $flag = true): static + { + $this->attributes['exportable'] = $flag; + + return $this; + } + + /** + * Set column class name. + * + * @param string $class + * @return $this + * @see https://datatables.net/reference/option/columns.className + */ + public function className(string $class): static + { + $this->attributes['className'] = $class; + + return $this; + } + + /** + * Set column default content. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.defaultContent + */ + public function content(string $value): static + { + $this->attributes['defaultContent'] = $value; + + return $this; + } + + /** + * Set column responsive priority. + * + * @param int|string $value + * @return $this + * @see https://datatables.net/reference/option/columns.responsivePriority + */ + public function responsivePriority(int|string $value): static + { + $this->attributes['responsivePriority'] = $value; + + return $this; + } + + /** + * Set column hidden state. + * + * @return $this + * @see https://datatables.net/reference/option/columns.visible + */ + public function hidden(): static + { + return $this->visible(false); + } + + /** + * Set column visible flag. + * + * @param bool $flag + * @return $this + * @see https://datatables.net/reference/option/columns.visible + */ + public function visible(bool $flag = true): static + { + $this->attributes['visible'] = $flag; + + return $this; + } + + /** + * Append a class name to field. + * + * @param string $class + * @return $this + */ + public function addClass(string $class): static + { + if (! isset($this->attributes['className'])) { + $this->attributes['className'] = $class; + } else { + $this->attributes['className'] .= " $class"; + } + + return $this; + } + + /** + * Set column printable flag. + * + * @param bool $flag + * @return $this + */ + public function printable(bool $flag = true): static + { + $this->attributes['printable'] = $flag; + + return $this; + } + + /** + * Set column width value. + * + * @param int|string $value + * @return $this + * @see https://datatables.net/reference/option/columns.width + */ + public function width(int|string $value): static + { + $this->attributes['width'] = $value; + + return $this; + } + + /** + * Set column data option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/columns.data + * @see https://datatables.net/manual/data/orthogonal-data + */ + public function data(array|string $value): static + { + $this->attributes['data'] = $value; + + return $this; + } + + /** + * Set column name option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.name + */ + public function name(string $value): static + { + $this->attributes['name'] = $value; + + return $this; + } + + /** + * Set column edit field option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/columns.editField + */ + public function editField(array|string $value): static + { + $this->attributes['editField'] = $value; + + return $this; + } + + /** + * Set column orderData option value. + * + * @param array|int $value + * @return $this + * @see https://datatables.net/reference/option/columns.orderData + */ + public function orderData(array|int $value): static + { + $this->attributes['orderData'] = $value; + + return $this; + } + + /** + * Set column orderDataType option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.orderDataType + */ + public function orderDataType(string $value): static + { + $this->attributes['orderDataType'] = $value; + + return $this; + } + + /** + * Set column orderSequence option value. + * + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/columns.orderSequence + */ + public function orderSequence(array $value): static + { + $this->attributes['orderSequence'] = $value; + + return $this; + } + + /** + * Set column cellType option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.cellType + */ + public function cellType(string $value = 'th'): static + { + $this->attributes['cellType'] = $value; + + return $this; + } + + /** + * Set column type option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.type + */ + public function type(string $value): static + { + $this->attributes['type'] = $value; + + return $this; + } + + /** + * Set column contentPadding option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.contentPadding + */ + public function contentPadding(string $value): static + { + $this->attributes['contentPadding'] = $value; + + return $this; + } + + /** + * Set column createdCell option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.createdCell + */ + public function createdCell(string $value): static + { + $this->attributes['createdCell'] = $value; + + return $this; + } + + /** + * Use the js renderer "$.fn.dataTable.render.". + * + * @param string $value + * @param int|string|null ...$params + * @return $this + * @see https://datatables.net/reference/option/columns.render + */ + public function renderJs(string $value, ...$params): static + { + if ($params) { + $value .= '('; + foreach ($params as $param) { + $value .= sprintf("'%s',", $param); + } + $value = mb_substr($value, 0, -1); + $value .= ')'; + } + + $renderer = '$.fn.dataTable.render.'.$value; + + return $this->render($renderer); + } + + /** + * Set column renderer. + * + * @param mixed $value + * @return $this + * @see https://datatables.net/reference/option/columns.render + */ + public function render(mixed $value): static + { + $this->attributes['render'] = $this->parseRender($value); + + return $this; + } + + /** + * Set Callback function to render column for Print + Export + * + * @param callable $callback + * @return $this + + */ + public function exportRender(callable $callback): static + { + $this->attributes['exportRender'] = $callback; + + return $this; + } + + /** + * Parse render attribute. + * + * @param mixed $value + * @return string|null + */ + public function parseRender(mixed $value): ?string + { + /** @var \Illuminate\Contracts\View\Factory $view */ + $view = app('view'); + $parameters = []; + + if (is_array($value)) { + $parameters = Arr::except($value, 0); + $value = $value[0]; + } + + if (is_callable($value)) { + return $value($parameters); + } elseif ($this->isBuiltInRenderFunction($value)) { + return $value; + } elseif (strlen($value) < 256 && $view->exists($value)) { + return $view->make($value)->with($parameters)->render(); + } + + return $value ? $this->parseRenderAsString($value) : null; + } + + /** + * Check if given key & value is a valid datatables built-in renderer function. + * + * @param string $value + * @return bool + */ + private function isBuiltInRenderFunction(string $value): bool + { + if (empty($value)) { + return false; + } + + return Str::startsWith(trim($value), ['$.fn.dataTable.render', '[']); + } + + /** + * Display render value as is. + * + * @param string $value + * @return string + */ + private function parseRenderAsString(string $value): string + { + return "function(data,type,full,meta){return $value;}"; + } + + /** + * Set column renderer with give raw value. + * + * @param mixed $value + * @return $this + * @see https://datatables.net/reference/option/columns.render + */ + public function renderRaw(mixed $value): static + { + $this->attributes['render'] = $value; + + return $this; + } + + /** + * Set column footer. + * + * @param mixed $value + * @return $this + */ + public function footer(mixed $value): static + { + $this->attributes['footer'] = $value; + + return $this; + } + + /** + * Set custom html title instead default label. + * + * @param mixed $value + * @return $this + */ + public function titleAttr(mixed $value): static + { + $this->attributes['titleAttr'] = $value; + + return $this; + } + + /** + * Set excel column format when exporting. + * + * @param string|callable $format + * @return $this + * @see https://github.com/yajra/laravel-datatables-export + */ + public function exportFormat(string|callable $format): static + { + $this->attributes['exportFormat'] = $format; + + return $this; + } + + /** + * @return array + */ + public function toArray(): array + { + if (! $this->isAuthorized()) { + return []; + } + + return Arr::except($this->attributes, [ + 'printable', + 'exportable', + 'footer', + ]); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinition.php b/vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinition.php new file mode 100644 index 00000000..418f7a3c --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinition.php @@ -0,0 +1,55 @@ +attributes = $attributes; + } + + /** + * @param array|string|int $value + * @return $this + * @see https://datatables.net/reference/option/columnDefs.targets + */ + public function targets(array|string|int $value): static + { + $this->attributes['targets'] = $value; + + return $this; + } + + /** + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/columns + */ + public function columns(array $value): static + { + $this->attributes['columns'] = $value; + + return $this; + } + + /** + * @return array + */ + public function toArray(): array + { + $array = parent::toArray(); + + unset($array['attributes']); + + return $array; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinitions.php b/vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinitions.php new file mode 100644 index 00000000..83816ded --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/ColumnDefinitions.php @@ -0,0 +1,10 @@ + '', + 'data' => 'action', + 'name' => 'action', + 'title' => 'Action', + 'render' => null, + 'orderable' => false, + 'searchable' => false, + 'exportable' => false, + 'printable' => true, + 'footer' => '', + ], $attributes); + + if ($prepend) { + $this->collection->prepend(new Column($attributes)); + } else { + $this->collection->push(new Column($attributes)); + } + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Columns/Checkbox.php b/vendor/yajra/laravel-datatables-html/src/Html/Columns/Checkbox.php new file mode 100644 index 00000000..aaa76d63 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Columns/Checkbox.php @@ -0,0 +1,42 @@ + 'html->attributes($attributes).'/>', + 'title' => 'html->attributes($attributes + ['id' => 'dataTablesCheckbox']).'/>', + 'data' => 'checkbox', + 'name' => 'checkbox', + 'orderable' => false, + 'searchable' => false, + 'exportable' => false, + 'printable' => true, + 'width' => '10px', + ], $attributes); + + $column = new Column($attributes); + + if ($position === true) { + $this->collection->prepend($column); + } elseif ($position === false || $position >= $this->collection->count()) { + $this->collection->push($column); + } else { + $this->collection->splice($position, 0, [$column]); + } + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Columns/Index.php b/vendor/yajra/laravel-datatables-html/src/Html/Columns/Index.php new file mode 100644 index 00000000..41e9ee56 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Columns/Index.php @@ -0,0 +1,36 @@ +config->get('datatables.index_column', 'DT_RowIndex'); + + $attributes = array_merge([ + 'defaultContent' => '', + 'data' => $indexColumn, + 'name' => $indexColumn, + 'title' => '', + 'render' => null, + 'orderable' => false, + 'searchable' => false, + 'exportable' => false, + 'printable' => true, + 'footer' => '', + ], $attributes); + + $this->collection->push(new Column($attributes)); + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Editor.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Editor.php new file mode 100644 index 00000000..f12000da --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Editor.php @@ -0,0 +1,324 @@ +attributes['scripts'] = $scripts; + + return $this; + } + + /** + * Set Editor's variable name / instance. + * + * @param string $instance + * @return $this + */ + public function instance(string $instance): static + { + $this->attributes['instance'] = $instance; + + return $this; + } + + /** + * Set Editor's ajax parameter. + * + * @param array|string $ajax + * @return $this + * @see https://editor.datatables.net/reference/option/ajax + */ + public function ajax(array|string $ajax): static + { + $this->attributes['ajax'] = $ajax; + + return $this; + } + + /** + * Set Editor's table source. + * + * @param string $table + * @return $this + * @see https://editor.datatables.net/reference/option/table + */ + public function table(string $table): static + { + $this->attributes['table'] = $table; + + return $this; + } + + /** + * Set Editor's idSrc option. + * + * @param string $idSrc + * @return $this + * @see https://editor.datatables.net/reference/option/idSrc + */ + public function idSrc(string $idSrc = 'DT_RowId'): static + { + $this->attributes['idSrc'] = $idSrc; + + return $this; + } + + /** + * Set Editor's display option. + * + * @param string $display + * @return $this + * @see https://editor.datatables.net/reference/option/display + */ + public function display(string $display): static + { + $this->attributes['display'] = $display; + + return $this; + } + + /** + * Set Editor's fields. + * + * @param array $fields + * @return $this + * @see https://editor.datatables.net/reference/option/fields + */ + public function fields(array $fields): static + { + $this->attributes['fields'] = $fields; + + return $this; + } + + /** + * Set Editor's bubble formOptions. + * + * @param array|FormOptions $formOptions + * @return $this + * @see https://editor.datatables.net/reference/option/formOptions.bubble + */ + public function formOptionsBubble(array|FormOptions $formOptions): static + { + return $this->formOptions(['bubble' => Helper::castToArray($formOptions)]); + } + + /** + * Set Editor's formOptions. + * + * @param array $formOptions + * @return $this + * @see https://editor.datatables.net/reference/option/formOptions + * @see https://editor.datatables.net/reference/type/form-options + */ + public function formOptions(array $formOptions): static + { + $this->attributes['formOptions'] = $formOptions; + + return $this; + } + + /** + * Set Editor's inline formOptions. + * + * @param array|FormOptions $formOptions + * @return $this + * @see https://editor.datatables.net/reference/option/formOptions.inline + */ + public function formOptionsInline(array|FormOptions $formOptions): static + { + return $this->formOptions(['inline' => Helper::castToArray($formOptions)]); + } + + /** + * Set Editor's main formOptions. + * + * @param array|FormOptions $formOptions + * @return $this + * @see https://editor.datatables.net/reference/option/formOptions.main + */ + public function formOptionsMain(array|FormOptions $formOptions): static + { + return $this->formOptions(['main' => Helper::castToArray($formOptions)]); + } + + /** + * Set Editor's language. + * + * @param array $language + * @return $this + * @see https://editor.datatables.net/reference/option/i18n + */ + public function language(array $language): static + { + $this->attributes['i18n'] = $language; + + return $this; + } + + /** + * Set Editor's template. + * + * @param string $template + * @return $this + * @see https://editor.datatables.net/reference/option/template + */ + public function template(string $template): static + { + $this->attributes['template'] = $template; + + return $this; + } + + /** + * Convert the fluent instance to an array. + * + * @return array + */ + public function toArray(): array + { + if (! $this->isAuthorized()) { + return []; + } + + $array = parent::toArray(); + + unset($array['events']); + + foreach ((array) Arr::get($array, 'fields', []) as $key => &$field) { + if ($field instanceof Field) { + Arr::set($array['fields'], $key, $field->toArray()); + } + } + + return $array; + } + + /** + * Convert the fluent instance to JSON. + * + * @param int $options + * @return string + */ + public function toJson($options = 0): string + { + $parameters = $this->jsonSerialize(); + + unset($parameters['events']); + + return Helper::toJsonScript($parameters, $options); + } + + /** + * Hide fields on create action. + * + * @param array $fields + * @return $this + */ + public function hiddenOnCreate(array $fields): static + { + return $this->hiddenOn('create', $fields); + } + + /** + * Hide fields on specific action. + * + * @param string $action + * @param array $fields + * @return $this + */ + public function hiddenOn(string $action, array $fields): static + { + $script = 'function(e, mode, action) {'; + $script .= "if (action === '$action') {"; + foreach ($fields as $field) { + $script .= "this.hide('$field');"; + } + $script .= '} else {'; + foreach ($fields as $field) { + $script .= "this.show('$field');"; + } + $script .= '}'; + $script .= 'return true;'; + $script .= '}'; + + $this->onPreOpen($script); + + return $this; + } + + /** + * Hide fields on edit action. + * + * @param array $fields + * @return $this + */ + public function hiddenOnEdit(array $fields): static + { + return $this->hiddenOn('edit', $fields); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/BelongsTo.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/BelongsTo.php new file mode 100644 index 00000000..3177f34d --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/BelongsTo.php @@ -0,0 +1,31 @@ +|Builder $class + * @param string $text + * @param string $id + * @param string|null $foreign + * @return static + */ + public static function model(Builder|string $class, string $text, string $id = 'id', string $foreign = null): static + { + if ($class instanceof Builder) { + $table = $class->getModel()->getTable(); + } else { + $table = (new $class)->getTable(); + } + + $table = Str::singular($table); + $foreign = $foreign ?? $table.'_id'; + + return self::make($foreign, Str::title($table)) + ->modelOptions($class, $text, $id); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Boolean.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Boolean.php new file mode 100644 index 00000000..281b9ab2 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Boolean.php @@ -0,0 +1,20 @@ +separator(',')->options( + Options::make()->append('', 1) + ); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Checkbox.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Checkbox.php new file mode 100644 index 00000000..f55024e4 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Checkbox.php @@ -0,0 +1,8 @@ +format('YYYY-MM-DD'); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/DateTime.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/DateTime.php new file mode 100644 index 00000000..990be775 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/DateTime.php @@ -0,0 +1,166 @@ +format('YYYY-MM-DD hh:mm a'); + } + + /** + * Set format to military time (24 hrs). + * + * @return $this + */ + public function military(): static + { + return $this->format('YYYY-MM-DD HH:mm'); + } + + /** + * @param \DateTime $dateTime + * @param string $format + * @return $this + * @see https://editor.datatables.net/examples/dates/options-min-max.html + */ + public function minDate(\DateTime $dateTime, string $format = 'Y-m-d'): static + { + return $this->opts(['minDate' => "new Date('".$dateTime->format($format)."')"]); + } + + /** + * @param \DateTime $dateTime + * @param string $format + * @return $this + * @see https://editor.datatables.net/examples/dates/options-min-max.html + */ + public function maxDate(\DateTime $dateTime, string $format = 'Y-m-d'): static + { + return $this->opts(['maxDate' => "new Date('".$dateTime->format($format)."')"]); + } + + /** + * @param bool $state + * @return $this + * @see https://editor.datatables.net/examples/dates/options-week-numbers.html + */ + public function showWeekNumber(bool $state = true): static + { + return $this->opts(['showWeekNumber' => $state]); + } + + /** + * @param array $days + * @return $this + * @see https://editor.datatables.net/examples/dates/options-disable-days.html + */ + public function disableDays(array $days): static + { + return $this->opts(['disableDays' => $days]); + } + + /** + * @param int $minutes + * @return $this + * @see https://editor.datatables.net/examples/dates/time-increment.html + */ + public function minutesIncrement(int $minutes): static + { + return $this->opts(['minutesIncrement' => $minutes]); + } + + /** + * @param int $seconds + * @return $this + * @see https://editor.datatables.net/examples/dates/time-increment.html + */ + public function secondsIncrement(int $seconds): static + { + return $this->opts(['secondsIncrement' => $seconds]); + } + + /** + * @param array $hours + * @return $this + * @see https://editor.datatables.net/examples/dates/datetime.html + */ + public function hoursAvailable(array $hours): static + { + return $this->opts(['hoursAvailable' => $hours]); + } + + /** + * @param array $minutes + * @return $this + * @see https://editor.datatables.net/examples/dates/datetime.html + */ + public function minutesAvailable(array $minutes): static + { + return $this->opts(['minutesAvailable' => $minutes]); + } + + /** + * The format of the date string loaded from the server for the field's + * value and also for sending to the server on form submission. + * The formatting options are defined by Moment.js. + * + * @param string $format + * @return $this + * @see https://editor.datatables.net/reference/field/datetime#Options + * @see https://momentjs.com/docs/#/displaying/format/ + */ + public function wireFormat(string $format = 'YYYY-MM-DDTHH:mm:ss.000000Z'): static + { + $this->attributes['wireFormat'] = $format; + + return $this; + } + + /** + * Allow (default), or disallow, the end user to type into the date / time input element. + * If disallowed, they must use the calendar picker to enter data. This can be useful + * if you are using a more complex date format and wish to disallow the user from + * potentially making typing mistakes, although note that it does also disallow + * pasting of data. + * + * @param bool $state + * @return $this + * @see https://editor.datatables.net/reference/field/datetime#Options + */ + public function keyInput(bool $state = true): static + { + $this->attributes['keyInput'] = $state; + + return $this; + } + + /** + * The format of the date string that will be shown to the end user in the input element. + * The formatting options are defined by Moment.js. If a format is used that is not + * ISO8061 (i.e. YYYY-MM-DD) and Moment.js has not been included, Editor will + * throw an error stating that Moment.js must be included for custom + * formatting to be used. + * + * @param string $format + * @return $this + * @see https://editor.datatables.net/reference/field/datetime#Options + * @see https://momentjs.com/docs/#/displaying/format/ + */ + public function displayFormat(string $format = 'YYYY-MM-DD hh:mm a'): static + { + $this->attributes['displayFormat'] = $format; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Field.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Field.php new file mode 100644 index 00000000..eb9c4b52 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/Field.php @@ -0,0 +1,398 @@ +type; + + parent::__construct($attributes); + } + + /** + * Make a new instance of a field. + * + * @param array|string $name + * @param string $label + * @return static + */ + public static function make(array|string $name, string $label = ''): static + { + if (is_array($name)) { + return new static($name); + } + + $data = [ + 'name' => $name, + 'label' => $label ?: Str::title(str_replace('_', ' ', $name)), + ]; + + return new static($data); + } + + /** + * @param string $label + * @return $this + * @see https://editor.datatables.net/reference/option/fields.label + */ + public function label(string $label): static + { + $this->attributes['label'] = $label; + + return $this; + } + + /** + * @param string $name + * @return $this + * @see https://editor.datatables.net/reference/option/fields.name + */ + public function name(string $name): static + { + $this->attributes['name'] = $name; + + return $this; + } + + /** + * @param string $data + * @return $this + * @see https://editor.datatables.net/reference/option/fields.data + */ + public function data(string $data): static + { + $this->attributes['data'] = $data; + + return $this; + } + + /** + * @param string $type + * @return $this + * @see https://editor.datatables.net/reference/option/fields.type + */ + public function type(string $type): static + { + $this->attributes['type'] = $type; + $this->type = $type; + + return $this; + } + + /** + * Get options from a model. + * + * @param \Illuminate\Database\Eloquent\Builder|class-string<\Illuminate\Database\Eloquent\Model> $model + * @param string $value + * @param string $key + * @return $this + */ + public function modelOptions(Builder|string $model, string $value, string $key = 'id'): static + { + return $this->options( + Options::model($model, $value, $key) + ); + } + + /** + * Get options from a Enum::cases(). + * + * @param array $cases + * @return $this + */ + public function enumOptions(array $cases): static + { + $options = []; + foreach ($cases as $case) { + $options[] = [ + 'value' => $case->value, + 'label' => $case->value, + ]; + } + + return $this->options($options); + } + + /** + * Set select options. + * + * @param array|Arrayable $options + * @return $this + */ + public function options(array|Arrayable $options): static + { + if ($options instanceof Arrayable) { + $options = $options->toArray(); + } + + $this->attributes['options'] = $options; + + return $this; + } + + /** + * Get options from a table. + * + * @param QueryBuilder|\Closure|string $table + * @param string $value + * @param string $key + * @param \Closure|null $whereCallback + * @param string|null $connection + * @return $this + */ + public function tableOptions( + QueryBuilder|Closure|string $table, + string $value, + string $key = 'id', + Closure $whereCallback = null, + string $connection = null + ): static { + return $this->options( + Options::table($table, $value, $key, $whereCallback, $connection) + ); + } + + /** + * Set checkbox separator. + * + * @param string $separator + * @return $this + */ + public function separator(string $separator = ','): static + { + $this->attributes['separator'] = $separator; + + return $this; + } + + /** + * Set dateTime format. + * + * @param string $format + * @return $this + * @see https://editor.datatables.net/reference/field/datetime + */ + public function format(string $format): static + { + $this->attributes['format'] = $format; + + return $this; + } + + /** + * Set field default value. + * + * @param float|bool|int|string|array $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.def + */ + public function default(float|bool|int|string|array $value): static + { + $this->attributes['def'] = $value; + + return $this; + } + + /** + * Set field message value. + * + * @param string $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.message + */ + public function message(string $value): static + { + $this->attributes['message'] = $value; + + return $this; + } + + /** + * Set field fieldInfo value. + * + * @param string $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.fieldInfo + */ + public function fieldInfo(string $value): static + { + $this->attributes['fieldInfo'] = $value; + + return $this; + } + + /** + * Set field labelInfo value. + * + * @param string $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.labelInfo + */ + public function labelInfo(string $value): static + { + $this->attributes['labelInfo'] = $value; + + return $this; + } + + /** + * Set field entityDecode value. + * + * @param bool $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.entityDecode + */ + public function entityDecode(bool $value): static + { + $this->attributes['entityDecode'] = $value; + + return $this; + } + + /** + * Set field multiEditable value. + * + * @param bool $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.multiEditable + */ + public function multiEditable(bool $value): static + { + $this->attributes['multiEditable'] = $value; + + return $this; + } + + /** + * Set field id value. + * + * @param string $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.id + */ + public function id(string $value): static + { + $this->attributes['id'] = $value; + + return $this; + } + + /** + * Set field submit value. + * + * @param bool $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.submit + */ + public function submit(bool $value): static + { + $this->attributes['submit'] = $value; + + return $this; + } + + /** + * Set field compare value. + * + * @param bool $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.compare + */ + public function compare(bool $value): static + { + $this->attributes['compare'] = $value; + + return $this; + } + + /** + * Set field opts value. + * + * @param array $value + * @return $this + * @see https://datatables.net/forums/discussion/comment/156581/#Comment_156581 + */ + public function opts(array $value): static + { + if (! isset($this->attributes['opts'])) { + $this->attributes['opts'] = $value; + } else { + $this->attributes['opts'] = array_merge((array) $this->attributes['opts'], $value); + } + + return $this; + } + + /** + * Set field element html attributes. + * + * @param string $attribute + * @param int|bool|string $value + * @return $this + * @see https://datatables.net/forums/discussion/comment/156581/#Comment_156581 + */ + public function attr(string $attribute, int|bool|string $value): static + { + if (! isset($this->attributes['attr'])) { + $this->attributes['attr'] = []; + } + + $attributes = (array) $this->attributes['attr']; + $attributes[$attribute] = $value; + + $this->attributes['attr'] = $attributes; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * Replace null values with the field's default on edit. + * + * @param bool $value + * @return $this + * @see https://editor.datatables.net/reference/option/fields.nullDefault + */ + public function nullDefault(bool $value = true): static + { + $this->attributes['nullDefault'] = $value; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/File.php b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/File.php new file mode 100644 index 00000000..41df4a7e --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Editor/Fields/File.php @@ -0,0 +1,205 @@ +displayFile()->clearText()->noImageText(); + } + + /** + * @param string $value + * @return $this + */ + public function ajax(string $value): static + { + $this->attributes['ajax'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function ajaxData(string $value): static + { + $this->attributes['ajaxData'] = $value; + + return $this; + } + + /** + * @param bool $value + * @return $this + */ + public function dragDrop(bool $value = true): static + { + $this->attributes['dragDrop'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function dragDropText(string $value): static + { + $this->attributes['dragDropText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function fileReadText(string $value): static + { + $this->attributes['fileReadText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function noFileText(string $value): static + { + $this->attributes['noFileText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function processingText(string $value): static + { + $this->attributes['processingText'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + */ + public function uploadText(string $value): static + { + $this->attributes['uploadText'] = $value; + + return $this; + } + + /** + * Set editor instance for file upload. + * + * @param string $editor + * @return $this + */ + public function editor(string $editor): static + { + $this->editor = $editor; + + return $this; + } + + /** + * Display image upon upload. + * + * @return $this + */ + public function displayImage(): static + { + // TODO: Use Laravel filesystem instead of hard coded storage path + return $this->display(<<'); + } + + /** + * Transform the string to an Html serializable object + * + * @param string $html + * @return \Illuminate\Support\HtmlString + */ + protected function toHtmlString(string $html): HtmlString + { + return new HtmlString($html); + } + + /** + * Build an HTML attribute string from an array. + * + * @param array $attributes + * @return string + */ + public function attributes(array $attributes): string + { + $html = []; + + foreach ($attributes as $key => $value) { + $element = $this->attributeElement($key, $value); + + if (! is_null($element)) { + $html[] = $element; + } + } + + return ! empty($html) ? ' '.implode(' ', $html) : ''; + } + + /** + * Build a single attribute element. + * + * @param string $key + * @param mixed $value + * @return mixed + */ + protected function attributeElement(string $key, mixed $value): mixed + { + // For numeric keys we will assume that the value is a boolean attribute + // where the presence of the attribute represents a true value and the + // absence represents a false value. + // This will convert HTML attributes such as "required" to a correct + // form instead of using incorrect numerics. + if (is_numeric($key)) { + return $value; + } + + // Treat boolean attributes as HTML properties + if (is_bool($value) && $key !== 'value') { + return $value ? $key : ''; + } + + if (is_array($value) && $key === 'class') { + return 'class="'.implode(' ', $value).'"'; + } + + if (is_bool($value) || is_float($value) || is_int($value) || is_resource($value) || is_string($value)) { + return $key.'="'.e(strval($value), false).'"'; + } + + return null; + } + + /** + * Generate a link to a CSS file. + * + * @param string $url + * @param array $attributes + * @param bool|null $secure + * @return \Illuminate\Support\HtmlString + */ + public function style(string $url, array $attributes = [], bool $secure = null): HtmlString + { + $defaults = ['media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet']; + + $attributes = array_merge($defaults, $attributes); + + $attributes['href'] = $this->url->asset($url, $secure); + + return $this->toHtmlString('attributes($attributes).'>'); + } + + /** + * Generate an HTML image element. + * + * @param string $url + * @param string|null $alt + * @param array $attributes + * @param bool|null $secure + * @return \Illuminate\Support\HtmlString + */ + public function image(string $url, string $alt = null, array $attributes = [], bool $secure = null): HtmlString + { + $attributes['alt'] = $alt; + + return $this->toHtmlString('attributes($attributes).'>'); + } + + /** + * Generate a link to a Favicon file. + * + * @param string $url + * @param array $attributes + * @param bool|null $secure + * @return \Illuminate\Support\HtmlString + */ + public function favicon(string $url, array $attributes = [], bool $secure = null): HtmlString + { + $defaults = ['rel' => 'shortcut icon', 'type' => 'image/x-icon']; + + $attributes = array_merge($defaults, $attributes); + + $attributes['href'] = $this->url->asset($url, $secure); + + return $this->toHtmlString('attributes($attributes).'>'); + } + + /** + * Generate a HTTPS HTML link. + * + * @param string $url + * @param string|null $title + * @param array $attributes + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function secureLink( + string $url, + string $title = null, + array $attributes = [], + bool $escape = true + ): HtmlString { + return $this->link($url, $title, $attributes, true, $escape); + } + + /** + * Generate a HTML link. + * + * @param string $url + * @param string|null $title + * @param array $attributes + * @param bool|null $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function link( + string $url, + string $title = null, + array $attributes = [], + bool $secure = null, + bool $escape = true + ): HtmlString { + $url = $this->url->to($url, [], $secure); + + if (is_null($title)) { + $title = $url; + } + + if ($escape) { + $title = $this->entities($title); + } + + return $this->toHtmlString( + 'attributes($attributes).'>'.$title.'' + ); + } + + /** + * Convert an HTML string to entities. + * + * @param string $value + * @return string + */ + public function entities(string $value): string + { + return htmlentities($value, ENT_QUOTES, 'UTF-8', false); + } + + /** + * Generate a HTTPS HTML link to an asset. + * + * @param string $url + * @param string|null $title + * @param array $attributes + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function linkSecureAsset( + string $url, + string $title = null, + array $attributes = [], + bool $escape = true + ): HtmlString { + return $this->linkAsset($url, $title, $attributes, true, $escape); + } + + /** + * Generate a HTML link to an asset. + * + * @param string $url + * @param string|null $title + * @param array $attributes + * @param bool|null $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function linkAsset( + string $url, + string $title = null, + array $attributes = [], + bool $secure = null, + bool $escape = true + ): HtmlString { + $url = $this->url->asset($url, $secure); + + return $this->link($url, $title ?: $url, $attributes, $secure, $escape); + } + + /** + * Generate a HTML link to a named route. + * + * @param string $name + * @param string|null $title + * @param array $parameters + * @param array $attributes + * @param bool|null $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function linkRoute( + string $name, + string $title = null, + array $parameters = [], + array $attributes = [], + bool $secure = null, + bool $escape = true + ): HtmlString { + return $this->link($this->url->route($name, $parameters), $title, $attributes, $secure, $escape); + } + + /** + * Generate a HTML link to a controller action. + * + * @param string $action + * @param string|null $title + * @param array $parameters + * @param array $attributes + * @param bool|null $secure + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function linkAction( + string $action, + string $title = null, + array $parameters = [], + array $attributes = [], + bool $secure = null, + bool $escape = true + ): HtmlString { + return $this->link($this->url->action($action, $parameters), $title, $attributes, $secure, $escape); + } + + /** + * Generate a HTML link to an email address. + * + * @param string $email + * @param string|null $title + * @param array $attributes + * @param bool $escape + * @return \Illuminate\Support\HtmlString + */ + public function mailto(string $email, string $title = null, array $attributes = [], bool $escape = true): HtmlString + { + $email = $this->email($email); + + $title = $title ?: $email; + + if ($escape) { + $title = $this->entities($title); + } + + $email = $this->obfuscate('mailto:').$email; + + return $this->toHtmlString('attributes($attributes).'>'.$title.''); + } + + /** + * Obfuscate an e-mail address to prevent spam-bots from sniffing it. + * + * @param string $email + * @return string + */ + public function email(string $email): string + { + return str_replace('@', '@', $this->obfuscate($email)); + } + + /** + * Obfuscate a string to prevent spam-bots from sniffing it. + * + * @param string $value + * @return string + * @throws \Exception + */ + public function obfuscate(string $value): string + { + $safe = ''; + + foreach (str_split($value) as $letter) { + if (ord($letter) > 128) { + return $letter; + } + + // To properly obfuscate the value, we will randomly convert each letter to + // its entity or hexadecimal representation, keeping a bot from sniffing + // the randomly obfuscated letters out of the string on the responses. + switch (random_int(1, 3)) { + case 1: + $safe .= '&#'.ord($letter).';'; + break; + + case 2: + $safe .= '&#x'.dechex(ord($letter)).';'; + break; + + case 3: + $safe .= $letter; + } + } + + return $safe; + } + + /** + * Generates non-breaking space entities based on number supplied. + * + * @param int $num + * @return string + */ + public function nbsp(int $num = 1): string + { + return str_repeat(' ', $num); + } + + /** + * Generate an ordered list of items. + * + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString|string + */ + public function ol(array $list, array $attributes = []): HtmlString|string + { + return $this->listing('ol', $list, $attributes); + } + + /** + * Create a listing HTML element. + * + * @param string $type + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString|string + */ + protected function listing(string $type, array $list, array $attributes = []): HtmlString|string + { + $html = ''; + + if (empty($list)) { + return $html; + } + + // Essentially we will just spin through the list and build the list of the HTML + // elements from the array. We will also handled nested lists in case that is + // present in the array. Then we will build out the final listing elements. + foreach ($list as $key => $value) { + $html .= $this->listingElement($key, $type, $value); + } + + $attributes = $this->attributes($attributes); + + return $this->toHtmlString("<{$type}{$attributes}>{$html}"); + } + + /** + * Create the HTML for a listing element. + * + * @param mixed $key + * @param string $type + * @param mixed $value + * @return \Illuminate\Support\HtmlString|string + */ + protected function listingElement(mixed $key, string $type, mixed $value): HtmlString|string + { + if (is_array($value)) { + return $this->nestedListing($key, $type, $value); + } else { + if (is_bool($value) + || is_float($value) + || is_int($value) + || is_resource($value) + || is_string($value) + || is_null($value) + ) { + return '
  • '.e(strval($value), false).'
  • '; + } + } + + return '
  • '.$value.'
  • '; + } + + /** + * Create the HTML for a nested listing attribute. + * + * @param mixed $key + * @param string $type + * @param array $value + * @return \Illuminate\Support\HtmlString|string + */ + protected function nestedListing(mixed $key, string $type, array $value): HtmlString|string + { + if (is_int($key)) { + return $this->listing($type, $value); + } else { + return '
  • '.$key.$this->listing($type, $value).'
  • '; + } + } + + /** + * Generate an un-ordered list of items. + * + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString|string + */ + public function ul(array $list, array $attributes = []): HtmlString|string + { + return $this->listing('ul', $list, $attributes); + } + + /** + * Generate a description list of items. + * + * @param array $list + * @param array $attributes + * @return \Illuminate\Support\HtmlString + */ + public function dl(array $list, array $attributes = []): HtmlString + { + $attributes = $this->attributes($attributes); + + $html = ""; + + foreach ($list as $key => $value) { + $value = (array) $value; + + $html .= "
    $key
    "; + + foreach ($value as $v_value) { + $html .= "
    $v_value
    "; + } + } + + $html .= ''; + + return $this->toHtmlString($html); + } + + /** + * Generate a meta tag. + * + * @param string $name + * @param string $content + * @param array $attributes + * @return \Illuminate\Support\HtmlString + */ + public function meta(string $name, string $content, array $attributes = []): HtmlString + { + $defaults = compact('name', 'content'); + + $attributes = array_merge($defaults, $attributes); + + return $this->toHtmlString('attributes($attributes).'>'); + } + + /** + * Generate an html tag. + * + * @param string $tag + * @param mixed $content + * @param array $attributes + * @return \Illuminate\Support\HtmlString + */ + public function tag(string $tag, mixed $content, array $attributes = []): HtmlString + { + $content = is_array($content) ? implode('', $content) : $content; + + if (is_bool($content) + || is_float($content) + || is_int($content) + || is_resource($content) + || is_string($content) + || is_null($content) + ) { + return $this->toHtmlString( + '<'.$tag.$this->attributes($attributes).'>'.$this->toHtmlString(strval($content)).'' + ); + } + + return $this->toHtmlString('<'.$tag.$this->attributes($attributes).'>'.$content.''); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/HasAjax.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasAjax.php new file mode 100644 index 00000000..82526635 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasAjax.php @@ -0,0 +1,191 @@ + $attributes]; + } + + unset($attributes['method']); + Arr::set($attributes, 'type', 'POST'); + Arr::set($attributes, 'headers.X-HTTP-Method-Override', 'GET'); + + return $this->ajax($attributes); + } + + /** + * Setup ajax parameter. + * + * @param array|string $attributes + * @return $this + */ + public function ajax(array|string $attributes = ''): static + { + $this->ajax = $attributes; + + return $this; + } + + /** + * @param string $url + * @param string $formSelector + * @return $this + */ + public function postAjaxWithForm(string $url, string $formSelector): static + { + $attributes = ['url' => $url]; + + Arr::set($attributes, 'type', 'POST'); + Arr::set($attributes, 'headers.X-HTTP-Method-Override', 'GET'); + + $script = $this->getScriptWithFormSelector($formSelector); + + $attributes['data'] = "function(data) { $script }"; + + return $this->ajax($attributes); + } + + /** + * @param string $formSelector + * @return string + */ + protected function getScriptWithFormSelector(string $formSelector): string + { + return << 1) { + data[group[0].name] = []; + $.each(group, function(i, obj) { + data[obj.name].push(obj.value) + }) + } else { + data[group[0].name] = group[0].value; + } +}); +CDATA; + } + + /** + * Setup ajax parameter for datatables pipeline plugin. + * + * @param string $url + * @param int $pages + * @return $this + * @see https://datatables.net/examples/server_side/pipeline.html + */ + public function pipeline(string $url, int $pages = 5): static + { + return $this->ajax("$.fn.dataTable.pipeline({ url: '$url', pages: $pages })"); + } + + /** + * Get ajax url. + * + * @return string + */ + public function getAjaxUrl(): string + { + if (is_array($this->ajax)) { + return $this->ajax['url'] ?: url()->current(); + } + + return $this->ajax ?: url()->current(); + } + + /** + * Set ajax url with data added from form. + * + * @param string $url + * @param string $formSelector + * @return $this + */ + public function ajaxWithForm(string $url, string $formSelector): static + { + return $this->minifiedAjax($url, $this->getScriptWithFormSelector($formSelector)); + } + + /** + * Minify ajax url generated when using get request + * by deleting unnecessary url params. + * + * @param string $url + * @param string|null $script + * @param array $data + * @param array $ajaxParameters + * @return $this + */ + public function minifiedAjax( + string $url = '', + string $script = null, + array $data = [], + array $ajaxParameters = [] + ): static { + $this->ajax = []; + $appendData = $this->makeDataScript($data); + + $this->ajax['url'] = empty($url) ? url()->full() : $url; + $this->ajax['type'] = 'GET'; + if (! isset($this->attributes['serverSide']) || $this->attributes['serverSide']) { + $this->ajax['data'] = 'function(data) { + for (var i = 0, len = data.columns.length; i < len; i++) { + if (!data.columns[i].search.value) delete data.columns[i].search; + if (data.columns[i].searchable === true) delete data.columns[i].searchable; + if (data.columns[i].orderable === true) delete data.columns[i].orderable; + if (data.columns[i].data === data.columns[i].name) delete data.columns[i].name; + } + delete data.search.regex;'; + } else { + $this->ajax['data'] = 'function(data){'; + } + + if ($appendData) { + $this->ajax['data'] .= $appendData; + } + + if ($script) { + $this->ajax['data'] .= $script; + } + + $this->ajax['data'] .= '}'; + + $this->ajax = array_merge($this->ajax, $ajaxParameters); + + return $this; + } + + /** + * Make a data script to be appended on ajax request of dataTables. + * + * @param array $data + * @return string + */ + protected function makeDataScript(array $data): string + { + $script = ''; + foreach ($data as $key => $value) { + $dataValue = Helper::isJavascript($value, $key) ? $value : (is_string($value) ? "'$value'" : $value); + $script .= PHP_EOL."data.$key = $dataValue;"; + } + + return $script; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/HasCallbacks.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasCallbacks.php new file mode 100644 index 00000000..f970c2dd --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasCallbacks.php @@ -0,0 +1,230 @@ +attributes['createdRow'] = $script; + + return $this; + } + + /** + * Set drawCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/drawCallback + */ + public function drawCallback(string $script): static + { + $this->attributes['drawCallback'] = $script; + + return $this; + } + + /** + * Set drawCallback option value with Livewire integration. + * Solution as per issue https://github.com/yajra/laravel-datatables/issues/2401. + * + * @param string|null $script + * @return $this + * @see https://datatables.net/reference/option/drawCallback + */ + public function drawCallbackWithLivewire(string $script = null): static + { + $js = "function(settings) { + if (window.livewire) { + window.livewire.rescan(); + } + + $script + }"; + + $this->attributes['drawCallback'] = $js; + + return $this; + } + + /** + * Set footerCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/footerCallback + */ + public function footerCallback(string $script): static + { + $this->attributes['footerCallback'] = $script; + + return $this; + } + + /** + * Set formatNumber option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/formatNumber + */ + public function formatNumber(string $script): static + { + $this->attributes['formatNumber'] = $script; + + return $this; + } + + /** + * Set headerCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/headerCallback + */ + public function headerCallback(string $script): static + { + $this->attributes['headerCallback'] = $script; + + return $this; + } + + /** + * Set infoCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/infoCallback + */ + public function infoCallback(string $script): static + { + $this->attributes['infoCallback'] = $script; + + return $this; + } + + /** + * Set initComplete option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/initComplete + */ + public function initComplete(string $script): static + { + $this->attributes['initComplete'] = $script; + + return $this; + } + + /** + * Set preDrawCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/preDrawCallback + */ + public function preDrawCallback(string $script): static + { + $this->attributes['preDrawCallback'] = $script; + + return $this; + } + + /** + * Set rowCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/rowCallback + */ + public function rowCallback(string $script): static + { + $this->attributes['rowCallback'] = $script; + + return $this; + } + + /** + * Set stateLoadCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/stateLoadCallback + */ + public function stateLoadCallback(string $script): static + { + $this->attributes['stateLoadCallback'] = $script; + + return $this; + } + + /** + * Set stateLoaded option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/stateLoaded + */ + public function stateLoaded(string $script): static + { + $this->attributes['stateLoaded'] = $script; + + return $this; + } + + /** + * Set stateLoadParams option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/stateLoadParams + */ + public function stateLoadParams(string $script): static + { + $this->attributes['stateLoadParams'] = $script; + + return $this; + } + + /** + * Set stateSaveCallback option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/stateSaveCallback + */ + public function stateSaveCallback(string $script): static + { + $this->attributes['stateSaveCallback'] = $script; + + return $this; + } + + /** + * Set stateSaveParams option value. + * + * @param string $script + * @return $this + * @see https://datatables.net/reference/option/stateSaveParams + */ + public function stateSaveParams(string $script): static + { + $this->attributes['stateSaveParams'] = $script; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/HasColumns.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasColumns.php new file mode 100644 index 00000000..5708efac --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasColumns.php @@ -0,0 +1,189 @@ +call($value); + } + + if ($value instanceof Arrayable) { + $value = $value->toArray(); + } + + if (is_array($value)) { + foreach ($value as $key => $def) { + if ($def instanceof Arrayable) { + $value[$key] = $def->toArray(); + } + } + } + + $this->attributes['columnDefs'] = $value; + + return $this; + } + + /** + * Add a columnDef option. + * + * @param array|\Illuminate\Contracts\Support\Arrayable|callable $value + * @return $this + * @see https://datatables.net/reference/option/columnDefs + */ + public function addColumnDef(array|Arrayable|callable $value): static + { + if (is_callable($value)) { + $value = app()->call($value); + } + + if ($value instanceof Arrayable) { + $value = $value->toArray(); + } + + $this->attributes['columnDefs'][] = $value; + + return $this; + } + + /** + * Set columns option value. + * + * @param array $columns + * @return $this + * @see https://datatables.net/reference/option/columns + */ + public function columns(array $columns): static + { + $this->collection = new Collection; + + foreach ($columns as $key => $value) { + if (! is_a($value, Column::class)) { + if (is_array($value)) { + $attributes = array_merge($value, [ + 'name' => $value['name'] ?? $value['data'] ?? $key, + 'data' => $value['data'] ?? $key, + ]); + } else { + $attributes = [ + 'name' => $value, + 'data' => $value, + ]; + } + + $this->collection->push(new Column($attributes)); + } else { + $this->collection->push($value); + } + } + + return $this; + } + + /** + * Add a column in collection using attributes. + * + * @param array|\Yajra\DataTables\Html\Column $attributes + * @return $this + */ + public function addColumn(array|Column $attributes): static + { + if (is_array($attributes)) { + $this->collection->push(new Column($attributes)); + } else { + $this->add($attributes); + } + + return $this; + } + + /** + * Add a Column object in collection. + * + * @param \Yajra\DataTables\Html\Column $column + * @return $this + */ + public function add(Column $column): static + { + $this->collection->push($column); + + return $this; + } + + /** + * Add a Column object at the beginning of collection. + * + * @param \Yajra\DataTables\Html\Column $column + * @return $this + */ + public function addBefore(Column $column): static + { + $this->collection->prepend($column); + + return $this; + } + + /** + * Add a column at the beginning of collection using attributes. + * + * @param array|\Yajra\DataTables\Html\Column $attributes + * @return $this + */ + public function addColumnBefore(array|Column $attributes): static + { + if (is_array($attributes)) { + $this->collection->prepend(new Column($attributes)); + } else { + $this->addBefore($attributes); + } + + return $this; + } + + /** + * Get collection of columns. + * + * @return \Illuminate\Support\Collection + */ + public function getColumns(): Collection + { + return $this->collection; + } + + /** + * Remove column by name. + * + * @param array $names + * @return $this + */ + public function removeColumn(...$names): static + { + foreach ($names as $name) { + // @phpstan-ignore-next-line + $this->collection = $this->collection->filter(function (Column $column) use ($name) { + return $column->name !== $name; + })->flatten(); + } + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/HasFeatures.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasFeatures.php new file mode 100644 index 00000000..e9e29345 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasFeatures.php @@ -0,0 +1,179 @@ +attributes['autoWidth'] = $value; + + return $this; + } + + /** + * Set deferRender option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/deferRender + */ + public function deferRender(bool $value = true): static + { + $this->attributes['deferRender'] = $value; + + return $this; + } + + /** + * Set info option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/info + */ + public function info(bool $value = true): static + { + $this->attributes['info'] = $value; + + return $this; + } + + /** + * Set lengthChange option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/lengthChange + */ + public function lengthChange(bool $value = true): static + { + $this->attributes['lengthChange'] = $value; + + return $this; + } + + /** + * Set ordering option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/ordering + */ + public function ordering(bool $value = true): static + { + $this->attributes['ordering'] = $value; + + return $this; + } + + /** + * Set processing option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/processing + */ + public function processing(bool $value = true): static + { + $this->attributes['processing'] = $value; + + return $this; + } + + /** + * Set scrollX option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/scrollX + */ + public function scrollX(bool $value = true): static + { + $this->attributes['scrollX'] = $value; + + return $this; + } + + /** + * Set scrollY option value. + * + * @param bool|string $value + * @return $this + * @see https://datatables.net/reference/option/scrollY + */ + public function scrollY(bool|string $value = true): static + { + $this->attributes['scrollY'] = $value; + + return $this; + } + + /** + * Set paging option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/paging + */ + public function paging(bool $value = true): static + { + $this->attributes['paging'] = $value; + + return $this; + } + + /** + * Set searching option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/searching + */ + public function searching(bool $value = true): static + { + $this->attributes['searching'] = $value; + + return $this; + } + + /** + * Set serverSide option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/serverSide + */ + public function serverSide(bool $value = true): static + { + $this->attributes['serverSide'] = $value; + + return $this; + } + + /** + * Set stateSave option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/stateSave + */ + public function stateSave(bool $value = true): static + { + $this->attributes['stateSave'] = $value; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/HasInternationalisation.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasInternationalisation.php new file mode 100644 index 00000000..3c910df7 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/HasInternationalisation.php @@ -0,0 +1,217 @@ +language(['decimal' => $value]); + } + + /** + * Set language option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/language + */ + public function language(array|string $value): static + { + if (is_array($value)) { + $this->attributes['language'] = array_merge((array) ($this->attributes['language'] ?? []), $value); + } else { + $this->attributes['language']['url'] = $value; + } + + return $this; + } + + /** + * Set language emptyTable option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.emptyTable + */ + public function languageEmptyTable(string $value): static + { + return $this->language(['emptyTable' => $value]); + } + + /** + * Set language info option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.info + */ + public function languageInfo(string $value): static + { + return $this->language(['info' => $value]); + } + + /** + * Set language infoEmpty option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.infoEmpty + */ + public function languageInfoEmpty(string $value): static + { + return $this->language(['infoEmpty' => $value]); + } + + /** + * Set language infoFiltered option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.infoFiltered + */ + public function languageInfoFiltered(string $value): static + { + return $this->language(['infoFiltered' => $value]); + } + + /** + * Set language infoPostFix option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.infoPostFix + */ + public function languageInfoPostFix(string $value): static + { + return $this->language(['infoPostFix' => $value]); + } + + /** + * Set language lengthMenu option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.lengthMenu + */ + public function languageLengthMenu(string $value): static + { + return $this->language(['lengthMenu' => $value]); + } + + /** + * Set language loadingRecords option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.loadingRecords + */ + public function languageLoadingRecords(string $value): static + { + return $this->language(['loadingRecords' => $value]); + } + + /** + * Set language processing option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.processing + */ + public function languageProcessing(string $value): static + { + return $this->language(['processing' => $value]); + } + + /** + * Set language search option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.search + */ + public function languageSearch(string $value): static + { + return $this->language(['search' => $value]); + } + + /** + * Set language searchPlaceholder option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.searchPlaceholder + */ + public function languageSearchPlaceholder(string $value): static + { + return $this->language(['searchPlaceholder' => $value]); + } + + /** + * Set language thousands option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.thousands + */ + public function languageThousands(string $value): static + { + return $this->language(['thousands' => $value]); + } + + /** + * Set language url option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.url + */ + public function languageUrl(string $value): static + { + return $this->language(['url' => $value]); + } + + /** + * Set language zeroRecords option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.zeroRecords + */ + public function languageZeroRecords(string $value): static + { + return $this->language(['zeroRecords' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getLanguage(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['language'] ?? []; + } + + return $this->attributes['language'][$key] ?? ''; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Aria.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Aria.php new file mode 100644 index 00000000..5dd71ca9 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Aria.php @@ -0,0 +1,102 @@ +language(['aria' => $value]); + } + + /** + * Set language aria paginate option value. + * + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.paginate + */ + public function languageAriaPaginate(array $value): static + { + return $this->languageAria(['paginate' => $value]); + } + + /** + * Set language aria paginate first option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.paginate.first + */ + public function languageAriaPaginateFirst(string $value): static + { + return $this->languageAriaPaginate(['first' => $value]); + } + + /** + * Set language aria paginate last option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.paginate.last + */ + public function languageAriaPaginateLast(string $value): static + { + return $this->languageAriaPaginate(['last' => $value]); + } + + /** + * Set language aria paginate next option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.paginate.next + */ + public function languageAriaPaginateNext(string $value): static + { + return $this->languageAriaPaginate(['next' => $value]); + } + + /** + * Set language aria paginate previous option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.paginate.previous + */ + public function languageAriaPaginatePrevious(string $value): static + { + return $this->languageAriaPaginate(['previous' => $value]); + } + + /** + * Set language aria sortAscending option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.sortAscending + */ + public function languageAriaSortAscending(string $value): static + { + return $this->languageAria(['sortAscending' => $value]); + } + + /** + * Set language aria sortDescending option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.aria.sortDescending + */ + public function languageAriaSortDescending(string $value): static + { + return $this->languageAria(['sortDescending' => $value]); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/AutoFill.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/AutoFill.php new file mode 100644 index 00000000..5276574a --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/AutoFill.php @@ -0,0 +1,102 @@ +language(['autoFill' => $value]); + } + + /** + * Set language autoFill button option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.button + */ + public function languageAutoFillButton(string $value): static + { + return $this->languageAutoFill(['button' => $value]); + } + + /** + * Set language autoFill cancel option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.cancel + */ + public function languageAutoFillCancel(string $value): static + { + return $this->languageAutoFill(['cancel' => $value]); + } + + /** + * Set language autoFill fill option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.fill + */ + public function languageAutoFillFill(string $value): static + { + return $this->languageAutoFill(['fill' => $value]); + } + + /** + * Set language autoFill fillHorizontal option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.fillHorizontal + */ + public function languageAutoFillFillHorizontal(string $value): static + { + return $this->languageAutoFill(['fillHorizontal' => $value]); + } + + /** + * Set language autoFill fillVertical option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.fillVertical + */ + public function languageAutoFillFillVertical(string $value): static + { + return $this->languageAutoFill(['fillVertical' => $value]); + } + + /** + * Set language autoFill increment option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.increment + */ + public function languageAutoFillIncrement(string $value): static + { + return $this->languageAutoFill(['increment' => $value]); + } + + /** + * Set language autoFill info option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.autoFill.info + */ + public function languageAutoFillInfo(string $value): static + { + return $this->languageAutoFill(['info' => $value]); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Paginate.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Paginate.php new file mode 100644 index 00000000..a8d8e76e --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Paginate.php @@ -0,0 +1,66 @@ +language(['paginate' => $value]); + } + + /** + * Set language aria paginate first option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.paginate.first + */ + public function languagePaginateFirst(string $value): static + { + return $this->languagePaginate(['first' => $value]); + } + + /** + * Set language aria paginate last option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.paginate.last + */ + public function languagePaginateLast(string $value): static + { + return $this->languagePaginate(['last' => $value]); + } + + /** + * Set language aria paginate next option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.paginate.next + */ + public function languagePaginateNext(string $value): static + { + return $this->languagePaginate(['next' => $value]); + } + + /** + * Set language aria paginate previous option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/language.paginate.previous + */ + public function languagePaginatePrevious(string $value): static + { + return $this->languagePaginate(['previous' => $value]); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Select.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Select.php new file mode 100644 index 00000000..fbef5762 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Languages/Select.php @@ -0,0 +1,54 @@ +language(['select' => $value]); + } + + /** + * Set language select cells option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/language.select.cells + */ + public function languageSelectCells(array|string $value): static + { + return $this->languageSelect(['cells' => $value]); + } + + /** + * Set language select columns option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/language.select.columns + */ + public function languageSelectColumns(array|string $value): static + { + return $this->languageSelect(['columns' => $value]); + } + + /** + * Set language select rows option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/language.select.rows + */ + public function languageSelectRows(array|string $value): static + { + return $this->languageSelect(['rows' => $value]); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/AutoFill.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/AutoFill.php new file mode 100644 index 00000000..97c8ad1f --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/AutoFill.php @@ -0,0 +1,135 @@ +autoFill(['alwaysAsk' => $value]); + } + + /** + * Set autoFill option value. + * Enable and configure the AutoFill extension for DataTables. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/autoFill + */ + public function autoFill(array|bool $value = true): static + { + return $this->setPluginAttribute('autoFill', $value); + } + + /** + * Set autoFill columns option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.columns + */ + public function autoFillColumns(array|string $value): static + { + return $this->autoFill(['columns' => $value]); + } + + /** + * Set autoFill editor option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.editor + */ + public function autoFillEditor(string $value): static + { + return $this->autoFill(['editor' => $value]); + } + + /** + * Set autoFill enable option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.enable + */ + public function autoFillEnable(bool $value = true): static + { + return $this->autoFill(['enable' => $value]); + } + + /** + * Set autoFill focus option value. + * + * @param string|null $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.focus + */ + public function autoFillFocus(string $value = null): static + { + return $this->autoFill(['focus' => $value]); + } + + /** + * Set autoFill horizontal option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.horizontal + */ + public function autoFillHorizontal(bool $value = true): static + { + return $this->autoFill(['horizontal' => $value]); + } + + /** + * Set autoFill update option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.update + */ + public function autoFillUpdate(bool $value = true): static + { + return $this->autoFill(['update' => $value]); + } + + /** + * Set autoFill vertical option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/autoFill.vertical + */ + public function autoFillVertical(bool $value = true): static + { + return $this->autoFill(['vertical' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getAutoFill(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['autoFill'] ?? true; + } + + return $this->attributes['autoFill'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Buttons.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Buttons.php new file mode 100644 index 00000000..b4786d3b --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Buttons.php @@ -0,0 +1,58 @@ +attributes['buttons'] = []; + + if (is_array($buttons[0])) { + $buttons = $buttons[0]; + } + + foreach ($buttons as $button) { + $this->attributes['buttons'][] = $button instanceof Arrayable ? $button->toArray() : $button; + } + + return $this; + } + + /** + * @param \Yajra\DataTables\Html\Button $button + * @return $this + */ + public function addButton(Button $button): static + { + $this->attributes['buttons'][] = $button->toArray(); + + return $this; + } + + /** + * Get builder buttons. + * + * @return array + */ + public function getButtons(): array + { + return $this->attributes['buttons'] ?? []; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/ColReorder.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/ColReorder.php new file mode 100644 index 00000000..8a1c4245 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/ColReorder.php @@ -0,0 +1,99 @@ +colReorder(['enable' => $value]); + } + + /** + * Set colReorder option value. + * Enable and configure the AutoFill extension for DataTables. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/colReorder + */ + public function colReorder(array|bool $value = true): static + { + return $this->setPluginAttribute('colReorder', $value); + } + + /** + * Set colReorder fixedColumnsLeft option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/colReorder.fixedColumnsLeft + */ + public function colReorderFixedColumnsLeft(int $value = 0): static + { + return $this->colReorder(['fixedColumnsLeft' => $value]); + } + + /** + * Set colReorder fixedColumnsRight option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/colReorder.fixedColumnsRight + */ + public function colReorderFixedColumnsRight(int $value = 0): static + { + return $this->colReorder(['fixedColumnsRight' => $value]); + } + + /** + * Set colReorder order option value. + * + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/colReorder.order + */ + public function colReorderOrder(array $value = []): static + { + return $this->colReorder(['order' => $value]); + } + + /** + * Set colReorder realtime option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/colReorder.realtime + */ + public function colReorderRealtime(bool $value = true): static + { + return $this->colReorder(['realtime' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getColReorder(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['colReorder'] ?? true; + } + + return $this->attributes['colReorder'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedColumns.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedColumns.php new file mode 100644 index 00000000..81f37260 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedColumns.php @@ -0,0 +1,74 @@ +fixedColumns(['heightMatch' => $value]); + } + + /** + * Set fixedColumns option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/fixedColumns + */ + public function fixedColumns(array|bool $value = true): static + { + return $this->setPluginAttribute('fixedColumns', $value); + } + + /** + * Set fixedColumns leftColumns option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/fixedColumns.leftColumns + */ + public function fixedColumnsLeftColumns(int $value = 1): static + { + return $this->fixedColumns(['leftColumns' => $value]); + } + + /** + * Set fixedColumns rightColumns option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/fixedColumns.rightColumns + */ + public function fixedColumnsRightColumns(int $value = 0): static + { + return $this->fixedColumns(['rightColumns' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getFixedColumns(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['fixedColumns'] ?? true; + } + + return $this->attributes['fixedColumns'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedHeader.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedHeader.php new file mode 100644 index 00000000..25eb98d1 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/FixedHeader.php @@ -0,0 +1,86 @@ +fixedHeader(['footer' => $value]); + } + + /** + * Set fixedHeader option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/fixedHeader + */ + public function fixedHeader(array|bool $value = true): static + { + return $this->setPluginAttribute('fixedHeader', $value); + } + + /** + * Set fixedHeader footerOffset option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/fixedHeader.footerOffset + */ + public function fixedHeaderFooterOffset(int $value = 0): static + { + return $this->fixedHeader(['footerOffset' => $value]); + } + + /** + * Set fixedHeader header option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/fixedHeader.header + */ + public function fixedHeaderHeader(bool $value = true): static + { + return $this->fixedHeader(['header' => $value]); + } + + /** + * Set fixedHeader headerOffset option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/fixedHeader.headerOffset + */ + public function fixedHeaderHeaderOffset(int $value = 0): static + { + return $this->fixedHeader(['headerOffset' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getFixedHeader(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['fixedHeader'] ?? true; + } + + return $this->attributes['fixedHeader'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/KeyTable.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/KeyTable.php new file mode 100644 index 00000000..3363c860 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/KeyTable.php @@ -0,0 +1,182 @@ +keys(['blurable' => $value]); + } + + /** + * Set keys option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/keys + */ + public function keys(array|bool $value = true): static + { + return $this->setPluginAttribute('keys', $value); + } + + /** + * Set keys className option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/keys.className + */ + public function keysClassName(string $value = 'focus'): static + { + return $this->keys(['className' => $value]); + } + + /** + * Set keys clipboard option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/keys.clipboard + */ + public function keysClipboard(bool $value = true): static + { + return $this->keys(['clipboard' => $value]); + } + + /** + * Set keys clipboardOrthogonal option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/keys.clipboardOrthogonal + */ + public function keysClipboardOrthogonal(string $value = 'display'): static + { + return $this->keys(['clipboardOrthogonal' => $value]); + } + + /** + * Set keys columns option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/keys.columns + */ + public function keysColumns(array|string $value): static + { + return $this->keys(['columns' => $value]); + } + + /** + * Set keys editAutoSelect option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/keys.editAutoSelect + */ + public function keysEditAutoSelect(bool $value = true): static + { + return $this->keys(['editAutoSelect' => $value]); + } + + /** + * Set keys editOnFocus option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/keys.editOnFocus + */ + public function keysEditOnFocus(bool $value = true): static + { + return $this->keys(['editOnFocus' => $value]); + } + + /** + * Set keys editor option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/keys.editor + */ + public function keysEditor(string $value): static + { + return $this->keys(['editor' => $value]); + } + + /** + * Set keys editorKeys option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/keys.editorKeys + */ + public function keysEditorKeys(string $value = 'navigation-only'): static + { + return $this->keys(['editorKeys' => $value]); + } + + /** + * Set keys focus option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/keys.focus + */ + public function keysFocus(string $value): static + { + return $this->keys(['focus' => $value]); + } + + /** + * Set key's keys option value. + * + * @param array|null $value + * @return $this + * @see https://datatables.net/reference/option/keys.keys + */ + public function keysKeys(array $value = null): static + { + return $this->keys(['keys' => $value]); + } + + /** + * Set keys tabIndex option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/keys.tabIndex + */ + public function keysTabIndex(int $value): static + { + return $this->keys(['tabIndex' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getKeys(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['keys'] ?? true; + } + + return $this->attributes['keys'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Responsive.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Responsive.php new file mode 100644 index 00000000..81fef46c --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Responsive.php @@ -0,0 +1,129 @@ +responsive(['breakpoints' => $value]); + } + + /** + * Set responsive option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/responsive + */ + public function responsive(array|bool $value = true): static + { + return $this->setPluginAttribute('responsive', $value); + } + + /** + * Set responsive details display option value. + * + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/responsive.details.display + */ + public function responsiveDetailsDisplay(array|string $value): static + { + return $this->responsiveDetails(['display' => $value]); + } + + /** + * Set responsive details option value. + * + * @param bool|array $value + * @return $this + * @see https://datatables.net/reference/option/responsive.details + */ + public function responsiveDetails(bool|array $value): static + { + $responsive = (array) $this->getResponsive(); + if (is_array($value)) { + $responsive['details'] = array_merge((array) ($responsive['details'] ?? []), $value); + } else { + $responsive['details'] = $value; + } + + return $this->responsive($responsive); + } + + /** + * Set responsive details renderer option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/responsive.details.renderer + */ + public function responsiveDetailsRenderer(string $value): static + { + return $this->responsiveDetails(['renderer' => $value]); + } + + /** + * Set responsive details target option value. + * + * @param int|string $value + * @return $this + * @see https://datatables.net/reference/option/responsive.details.target + */ + public function responsiveDetailsTarget(int|string $value): static + { + return $this->responsiveDetails(['target' => $value]); + } + + /** + * Set responsive details type option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/responsive.details.type + */ + public function responsiveDetailsType(string $value): static + { + return $this->responsiveDetails(['type' => $value]); + } + + /** + * Set responsive orthogonal option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/responsive.orthogonal + */ + public function responsiveOrthogonal(string $value): static + { + return $this->responsive(['orthogonal' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getResponsive(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['responsive'] ?? true; + } + + return $this->attributes['responsive'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowGroup.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowGroup.php new file mode 100644 index 00000000..9893010d --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowGroup.php @@ -0,0 +1,134 @@ +rowGroup(['className' => $value]); + } + + /** + * Set rowGroup option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup + */ + public function rowGroup(array|bool $value = true): static + { + return $this->setPluginAttribute('rowGroup', $value); + } + + /** + * Set rowGroup dataSrc option value. + * + * @param array|int|string $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.dataSrc + */ + public function rowGroupDataSrc(array|int|string $value = 0): static + { + return $this->rowGroup(['dataSrc' => $value]); + } + + /** + * Set rowGroup emptyDataGroup option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.emptyDataGroup + */ + public function rowGroupEmptyDataGroup(string $value = 'No Group'): static + { + return $this->rowGroup(['emptyDataGroup' => $value]); + } + + /** + * Set rowGroup enable option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.enable + */ + public function rowGroupEnable(bool $value = true): static + { + return $this->rowGroup(['enable' => $value]); + } + + /** + * Set rowGroup endClassName option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.endClassName + */ + public function rowGroupEndClassName(string $value = 'group-end'): static + { + return $this->rowGroup(['endClassName' => $value]); + } + + /** + * Set rowGroup endRender option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.endRender + */ + public function rowGroupEndRender(string $value): static + { + return $this->rowGroup(['endRender' => $value]); + } + + /** + * Set rowGroup startClassName option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.startClassName + */ + public function rowGroupStartClassName(string $value = 'group-start'): static + { + return $this->rowGroup(['startClassName' => $value]); + } + + /** + * Set rowGroup startRender option value. + * + * @param string|null $value + * @return $this + * @see https://datatables.net/reference/option/rowGroup.startRender + */ + public function rowGroupStartRender(string $value = null): static + { + return $this->rowGroup(['startRender' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getRowGroup(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['rowGroup'] ?? true; + } + + return $this->attributes['rowGroup'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowReorder.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowReorder.php new file mode 100644 index 00000000..b7014eaa --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/RowReorder.php @@ -0,0 +1,122 @@ +rowReorder(['dataSrc' => $value]); + } + + /** + * Set rowReorder option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder + */ + public function rowReorder(array|bool $value = true): static + { + return $this->setPluginAttribute('rowReorder', $value); + } + + /** + * Set rowReorder editor option value. + * + * @param string|null $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder.editor + */ + public function rowReorderEditor(string $value = null): static + { + return $this->rowReorder(['editor' => $value]); + } + + /** + * Set rowReorder enable option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder.enable + */ + public function rowReorderEnable(bool $value = true): static + { + return $this->rowReorder(['enable' => $value]); + } + + /** + * Set rowReorder formOptions option value. + * + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder.formOptions + */ + public function rowReorderFormOptions(array $value): static + { + return $this->rowReorder(['formOptions' => $value]); + } + + /** + * Set rowReorder selector option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder.selector + */ + public function rowReorderSelector(string $value = 'td:first-child'): static + { + return $this->rowReorder(['selector' => $value]); + } + + /** + * Set rowReorder snapX option value. + * + * @param bool|int $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder.snapX + */ + public function rowReorderSnapX(bool|int $value = true): static + { + return $this->rowReorder(['snapX' => $value]); + } + + /** + * Set rowReorder update option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/rowReorder.update + */ + public function rowReorderUpdate(bool $value = true): static + { + return $this->rowReorder(['update' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getRowReorder(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['rowReorder'] ?? true; + } + + return $this->attributes['rowReorder'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Scroller.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Scroller.php new file mode 100644 index 00000000..d6e77a34 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Scroller.php @@ -0,0 +1,98 @@ +scroller(['boundaryScale' => $value]); + } + + /** + * Set scroller option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/scroller + */ + public function scroller(array|bool $value = true): static + { + return $this->setPluginAttribute('scroller', $value); + } + + /** + * Set scroller displayBuffer option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/scroller.displayBuffer + */ + public function scrollerDisplayBuffer(int $value = 9): static + { + return $this->scroller(['displayBuffer' => $value]); + } + + /** + * Set scroller loadingIndicator option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/scroller.loadingIndicator + */ + public function scrollerLoadingIndicator(bool $value = true): static + { + return $this->scroller(['loadingIndicator' => $value]); + } + + /** + * Set scroller rowHeight option value. + * + * @param int|string $value + * @return $this + * @see https://datatables.net/reference/option/scroller.rowHeight + */ + public function scrollerRowHeight(int|string $value = 'auto'): static + { + return $this->scroller(['rowHeight' => $value]); + } + + /** + * Set scroller serverWait option value. + * + * @param int $value + * @return $this + * @see https://datatables.net/reference/option/scroller.serverWait + */ + public function scrollerServerWait(int $value = 200): static + { + return $this->scroller(['serverWait' => $value]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getScroller(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['scroller'] ?? true; + } + + return $this->attributes['scroller'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/SearchPanes.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/SearchPanes.php new file mode 100644 index 00000000..754dc1ee --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/SearchPanes.php @@ -0,0 +1,54 @@ +call($value); + } + + if ($value instanceof Arrayable) { + $value = $value->toArray(); + } + + if (is_bool($value)) { + $value = SearchPane::make()->show($value)->toArray(); + } + + $this->attributes['searchPanes'] = $value; + + return $this; + } + + /** + * @param string|null $key + * @return mixed + */ + public function getSearchPanes(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['searchPanes'] ?? true; + } + + return $this->attributes['searchPanes'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Select.php b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Select.php new file mode 100644 index 00000000..c9fbc7e8 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Options/Plugins/Select.php @@ -0,0 +1,216 @@ +select(['blurable' => $value]); + } + + /** + * Set select className option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/select.className + */ + public function selectClassName(string $value = 'selected'): static + { + return $this->select(['className' => $value]); + } + + /** + * Append a class name to className option value. + * + * @param string $class + * @return $this + */ + public function selectAddClassName(string $class): static + { + if (! isset($this->attributes['select']['className'])) { + $this->attributes['select']['className'] = $class; + } else { + $this->attributes['select']['className'] .= " $class"; + } + + return $this; + } + + /** + * Set select info option value. + * + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/select.info + */ + public function selectInfo(bool $value = true): static + { + return $this->select(['info' => $value]); + } + + /** + * Set select items option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/select.items + */ + public function selectItems(string $value = 'row'): static + { + return $this->select(['items' => $value]); + } + + /** + * Set select items option value to row. + * + * @return $this + * @see https://datatables.net/reference/option/select.items + */ + public function selectItemsRow(): static + { + return $this->select(['items' => Builder::SELECT_ITEMS_ROW]); + } + + /** + * Set select items option value to column. + * + * @return $this + * @see https://datatables.net/reference/option/select.items + */ + public function selectItemsColumn(): static + { + return $this->select(['items' => Builder::SELECT_ITEMS_COLUMN]); + } + + /** + * Set select items option value to cell. + * + * @return $this + * @see https://datatables.net/reference/option/select.items + */ + public function selectItemsCell(): static + { + return $this->select(['items' => Builder::SELECT_ITEMS_CELL]); + } + + /** + * Set select selector option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/select.selector + */ + public function selectSelector(string $value = 'td'): static + { + return $this->select(['selector' => $value]); + } + + /** + * Set select style option value. + * + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/select.style + */ + public function selectStyle(string $value = 'os'): static + { + return $this->select(['style' => $value]); + } + + /** + * Set select style option value to api. + * + * @return $this + * @see https://datatables.net/reference/option/select.style + */ + public function selectStyleApi(): static + { + return $this->select(['style' => Builder::SELECT_STYLE_API]); + } + + /** + * Set select style option value to single. + * + * @return $this + * @see https://datatables.net/reference/option/select.style + */ + public function selectStyleSingle(): static + { + return $this->select(['style' => Builder::SELECT_STYLE_SINGLE]); + } + + /** + * Set select option value. + * + * @param array|bool $value + * @return $this + * @see https://datatables.net/reference/option/select + */ + public function select(bool|array $value = true): static + { + return $this->setPluginAttribute('select', $value); + } + + /** + * Set select style option value to multi. + * + * @return $this + * @see https://datatables.net/reference/option/select.style + */ + public function selectStyleMulti(): static + { + return $this->select(['style' => Builder::SELECT_STYLE_MULTI]); + } + + /** + * Set select style option value to os. + * + * @return $this + * @see https://datatables.net/reference/option/select.style + */ + public function selectStyleOS(): static + { + return $this->select(['style' => Builder::SELECT_STYLE_OS]); + } + + /** + * Set select style option value to multi+shift. + * + * @return $this + * @see https://datatables.net/reference/option/select.style + */ + public function selectStyleMultiShift(): static + { + return $this->select(['style' => Builder::SELECT_STYLE_MULTI_SHIFT]); + } + + /** + * @param string|null $key + * @return mixed + */ + public function getSelect(string $key = null): mixed + { + if (is_null($key)) { + return $this->attributes['select'] ?? true; + } + + return $this->attributes['select'][$key] ?? false; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/Parameters.php b/vendor/yajra/laravel-datatables-html/src/Html/Parameters.php new file mode 100644 index 00000000..7b6b0c47 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/Parameters.php @@ -0,0 +1,18 @@ + + */ + protected $attributes = [ + 'serverSide' => true, + 'processing' => true, + 'ajax' => '', + 'columns' => [], + ]; +} diff --git a/vendor/yajra/laravel-datatables-html/src/Html/SearchPane.php b/vendor/yajra/laravel-datatables-html/src/Html/SearchPane.php new file mode 100644 index 00000000..653820a5 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/Html/SearchPane.php @@ -0,0 +1,348 @@ + true] + $attributes); + } + + /** + * @param array $options + * @return static + */ + public static function make(array $options = []): static + { + return new static($options); + } + + /** + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.cascadePanes + */ + public function cascadePanes(bool $value = true): static + { + $this->attributes['cascadePanes'] = $value; + + return $this; + } + + /** + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.clear + */ + public function clear(bool $value = true): static + { + $this->attributes['clear'] = $value; + + return $this; + } + + /** + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.columns + */ + public function columns(array $value = []): static + { + $this->attributes['columns'] = $value; + + return $this; + } + + /** + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.controls + */ + public function controls(bool $value = true): static + { + $this->attributes['controls'] = $value; + + return $this; + } + + /** + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.dtOpts + * @see https://datatables.net/reference/option/columns.searchPanes.dtOpts + */ + public function dtOpts(array $value = []): static + { + $this->attributes['dtOpts'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.emptyMessage + */ + public function emptyMessage(string $value): static + { + $this->attributes['emptyMessage'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.filterChanged + */ + public function filterChanged(string $value): static + { + $this->attributes['filterChanged'] = $value; + + return $this; + } + + /** + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.hideCount + */ + public function hideCount(bool $value = true): static + { + $this->attributes['hideCount'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.layout + */ + public function layout(string $value): static + { + $this->attributes['layout'] = $value; + + return $this; + } + + /** + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.order + */ + public function order(array $value): static + { + $this->attributes['order'] = $value; + + return $this; + } + + /** + * @param boolean $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.orderable + */ + public function orderable(bool $value = true): static + { + $this->attributes['orderable'] = $value; + + return $this; + } + + /** + * @param array $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.panes + */ + public function panes(array $value): static + { + $panes = collect($value)->map(function ($pane) { + if ($pane instanceof Arrayable) { + return $pane->toArray(); + } + + return $pane; + })->toArray(); + + $this->attributes['panes'] = $panes; + + return $this; + } + + /** + * @param float $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.threshold + */ + public function threshold(float $value): static + { + $this->attributes['threshold'] = $value; + + return $this; + } + + /** + * @param boolean $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.viewTotal + */ + public function viewTotal(bool $value = true): static + { + $this->attributes['viewTotal'] = $value; + + return $this; + } + + /** + * @param boolean $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.viewTotal + */ + public function hideTotal(bool $value = true): static + { + $this->attributes['viewTotal'] = ! $value; + + return $this; + } + + /** + * Get options from a model. + * + * @param class-string<\Illuminate\Database\Eloquent\Model>|EloquentBuilder $model + * @param string $value + * @param string $key + * @return $this + */ + public function modelOptions(EloquentBuilder|string $model, string $value, string $key = 'id'): SearchPane + { + return $this->options(Options::model($model, $value, $key)); + } + + /** + * @param array|Arrayable $value + * @return $this + * @see https://datatables.net/reference/option/columns.searchPanes.options + */ + public function options(array|Arrayable $value): static + { + if ($value instanceof Arrayable) { + $value = $value->toArray(); + } + + $this->attributes['options'] = $value; + + return $this; + } + + /** + * Get options from a table. + * + * @param string $table + * @param string $value + * @param string $key + * @param \Closure|null $callback + * @param string|null $connection + * @return $this + */ + public function tableOptions( + string $table, + string $value, + string $key = 'id', + Closure $callback = null, + string $connection = null + ): static { + return $this->options(Options::table($table, $value, $key, $callback, $connection)); + } + + /** + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.searchPanes.className + */ + public function className(string $value): static + { + $this->attributes['className'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.panes.header + */ + public function header(string $value): static + { + $this->attributes['header'] = $value; + + return $this; + } + + /** + * @param bool $value + * @return $this + * @see https://datatables.net/reference/option/columns.searchPanes.show + */ + public function show(bool $value = true): static + { + $this->attributes['show'] = $value; + + return $this; + } + + /** + * @param string $value + * @return $this + * @see https://datatables.net/reference/option/columns.searchPanes.name + */ + public function name(string $value): static + { + $this->attributes['name'] = $value; + + return $this; + } + + /** + * @param array|string $value + * @return $this + * @see https://datatables.net/reference/option/columns.searchPanes.orthogonal + */ + public function orthogonal(array|string $value): static + { + $this->attributes['orthogonal'] = $value; + + return $this; + } + + /** + * @param boolean $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.collapse + */ + public function collapse(bool $value = true): static + { + $this->attributes['collapse'] = $value; + + return $this; + } + + /** + * @param boolean $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.initCollapsed + */ + public function initCollapsed(bool $value = false): static + { + $this->attributes['initCollapsed'] = $value; + + return $this; + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/HtmlServiceProvider.php b/vendor/yajra/laravel-datatables-html/src/HtmlServiceProvider.php new file mode 100644 index 00000000..cb219dc4 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/HtmlServiceProvider.php @@ -0,0 +1,47 @@ +loadViewsFrom(__DIR__.'/resources/views', 'datatables'); + + if ($this->app->runningInConsole()) { + $this->publishAssets(); + } + } + + /** + * Publish datatables assets. + */ + protected function publishAssets(): void + { + $this->publishes([ + __DIR__.'/resources/views' => base_path('/resources/views/vendor/datatables'), + __DIR__.'/resources/config/config.php' => config_path('datatables-html.php'), + ], 'datatables-html'); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register(): void + { + $this->mergeConfigFrom(__DIR__.'/resources/config/config.php', 'datatables-html'); + + $this->app->bind('datatables.html', function () { + return $this->app->make(Html\Builder::class); + }); + } +} diff --git a/vendor/yajra/laravel-datatables-html/src/resources/config/config.php b/vendor/yajra/laravel-datatables-html/src/resources/config/config.php new file mode 100644 index 00000000..5a5036f4 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/config/config.php @@ -0,0 +1,27 @@ + 'LaravelDataTables', + + /* + * Default table attributes when generating the table. + */ + 'table' => [ + 'class' => 'table', + 'id' => 'dataTableBuilder', + ], + + /* + * Html builder script template. + */ + 'script' => 'datatables::script', + + /* + * Html builder script template for DataTables Editor integration. + */ + 'editor' => 'datatables::editor', +]; diff --git a/vendor/yajra/laravel-datatables-html/src/resources/views/editor.blade.php b/vendor/yajra/laravel-datatables-html/src/resources/views/editor.blade.php new file mode 100644 index 00000000..70ab919a --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/views/editor.blade.php @@ -0,0 +1,15 @@ +$(function(){ + window.{{ config('datatables-html.namespace', 'LaravelDataTables') }} = window.{{ config('datatables-html.namespace', 'LaravelDataTables') }} || {}; + $.ajaxSetup({headers: {'X-CSRF-TOKEN': '{{csrf_token()}}'}}); + @foreach($editors as $editor) + var {{$editor->instance}} = window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s-{{$editor->instance}}"] = new $.fn.dataTable.Editor({!! $editor->toJson() !!}); + {!! $editor->scripts !!} + @foreach ((array) $editor->events as $event) + {{$editor->instance}}.on('{!! $event['event'] !!}', {!! $event['script'] !!}); + @endforeach + @endforeach + window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s"] = $("#%1$s").DataTable(%2$s); +}); +@foreach ($scripts as $script) +@include($script) +@endforeach diff --git a/vendor/yajra/laravel-datatables-html/src/resources/views/function.blade.php b/vendor/yajra/laravel-datatables-html/src/resources/views/function.blade.php new file mode 100644 index 00000000..8ba75037 --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/views/function.blade.php @@ -0,0 +1,14 @@ +window.dtx = window.dtx || {}; +window.dtx["%1$s"] = function(opts) { + window.{{ config('datatables-html.namespace', 'LaravelDataTables') }} = window.{{ config('datatables-html.namespace', 'LaravelDataTables') }} || {}; + @if(isset($editors)) + @foreach($editors as $editor) + var {{$editor->instance}} = window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s-{{$editor->instance}}"] = new $.fn.dataTable.Editor({!! $editor->toJson() !!}); + {!! $editor->scripts !!} + @foreach ((array) $editor->events as $event) + {{$editor->instance}}.on('{!! $event['event'] !!}', {!! $event['script'] !!}); + @endforeach + @endforeach + @endif + return window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s"] = $("#%1$s").DataTable($.extend(%2$s, opts)); +} diff --git a/vendor/yajra/laravel-datatables-html/src/resources/views/functions/batch_remove.blade.php b/vendor/yajra/laravel-datatables-html/src/resources/views/functions/batch_remove.blade.php new file mode 100644 index 00000000..192a7e5d --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/views/functions/batch_remove.blade.php @@ -0,0 +1,14 @@ +$(function(){ + @foreach($editors as $editor) + {{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s-{{$editor->instance}}"].on('preSubmit', function(e, data, action) { + if (action !== 'remove') return; + + for (let row_id of Object.keys(data.data)) + { + data.data[row_id] = { + DT_RowId: data.data[row_id].DT_RowId + }; + } + }); + @endforeach +}); diff --git a/vendor/yajra/laravel-datatables-html/src/resources/views/options.blade.php b/vendor/yajra/laravel-datatables-html/src/resources/views/options.blade.php new file mode 100644 index 00000000..0da5763a --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/views/options.blade.php @@ -0,0 +1,6 @@ +window.{{ config('datatables-html.namespace', 'LaravelDataTables') }} = window.{{ config('datatables-html.namespace', 'LaravelDataTables') }} || {}; +window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}.options = %2$s +window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}.editors = []; +@foreach($editors as $editor) +window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}.editors["{{$editor->instance}}"] = {!! $editor->toJson() !!} +@endforeach diff --git a/vendor/yajra/laravel-datatables-html/src/resources/views/scout.blade.php b/vendor/yajra/laravel-datatables-html/src/resources/views/scout.blade.php new file mode 100644 index 00000000..506ad40f --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/views/scout.blade.php @@ -0,0 +1,23 @@ +$(function(){ + $('#%1$s').on('xhr.dt', function (e, settings, json, xhr) { + if (json == null || !('disableOrdering' in json)) return; + + let table = {{ config('datatables-html.namespace', 'LaravelDataTables') }}[$(this).attr('id')]; + if (json.disableOrdering) { + table.settings()[0].aoColumns.forEach(function(column) { + column.bSortable = false; + $(column.nTh).removeClass('sorting_asc sorting_desc sorting').addClass('sorting_disabled'); + }); + } else { + let changed = false; + table.settings()[0].aoColumns.forEach(function(column) { + if (column.bSortable) return; + column.bSortable = true; + changed = true; + }); + if (changed) { + table.draw(); + } + } + }); +}); diff --git a/vendor/yajra/laravel-datatables-html/src/resources/views/script.blade.php b/vendor/yajra/laravel-datatables-html/src/resources/views/script.blade.php new file mode 100644 index 00000000..b01ac74c --- /dev/null +++ b/vendor/yajra/laravel-datatables-html/src/resources/views/script.blade.php @@ -0,0 +1,4 @@ +$(function(){window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}=window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}||{};window.{{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s"]=$("#%1$s").DataTable(%2$s);}); +@foreach ($scripts as $script) +@include($script) +@endforeach