diff --git a/app/Helpers/DocumentHelper.php b/app/Helpers/DocumentHelper.php
index 97cce79b..f9598d3c 100644
--- a/app/Helpers/DocumentHelper.php
+++ b/app/Helpers/DocumentHelper.php
@@ -7,7 +7,6 @@ use Illuminate\Http\Request;
class DocumentHelper
{
-
/**
* Extract the Issuu embed URL from an iframe or raw Issuu input.
*
@@ -51,7 +50,7 @@ class DocumentHelper
/**
* Return a document query with all the request filters applied
*
- * @param Request $request
+ * @param \Illuminate\Http\Request $request
* @param \Illuminate\Database\Eloquent\Builder<\App\Models\Document> $query
* @return \Illuminate\Database\Eloquent\Builder<\App\Models\Document> $query
*/
diff --git a/lang/en/back.php b/lang/en/back.php
index 8d264d12..a3e8f564 100644
--- a/lang/en/back.php
+++ b/lang/en/back.php
@@ -265,21 +265,22 @@ return [
]
],
"refresh_original" => "reset to original state",
- "model_filters" => [
- "button_label" => "filters",
- "select_status" => [
+ "model_filters" => [
+ "button_tooltip" => "open the filters window",
+ "sheet_title" => "filters window",
+ "select_status" => [
"label" => "status",
"placeholder" => "choose a status"
],
- "has_no_link" => [
+ "has_no_link" => [
"label" => "filter document with no usable link"
],
- "categories" => [
- "label" => "filter by category",
+ "categories" => [
+ "label" => "filter by category",
"placeholder" => "select one or more categories"
],
- "tags" => [
- "label" => "filter by tag",
+ "tags" => [
+ "label" => "filter by tag",
"placeholder" => "select one or more tags"
],
],
diff --git a/lang/fr/back.php b/lang/fr/back.php
index cd0153bd..7df0bdf3 100644
--- a/lang/fr/back.php
+++ b/lang/fr/back.php
@@ -267,20 +267,21 @@ return [
],
"refresh_original" => "remettre à l'état d'origine",
"model_filters" => [
- "button_label" => "filtres",
- "select_status" => [
- "label" => "statut",
+ "button_tooltip" => "ouvrir la fenêtre des filtres",
+ "sheet_title" => "fenêtre des filtres",
+ "select_status" => [
+ "label" => "filtrer par statut",
"placeholder" => "selectionner un statut"
],
- "has_no_link" => [
+ "has_no_link" => [
"label" => "filtrer les documents qui n'ont aucun lien d'accès"
],
- "categories" => [
- "label" => "filtrer par categorie",
+ "categories" => [
+ "label" => "filtrer par catégorie",
"placeholder" => "selectionner une ou plusieurs catégories"
],
- "tags" => [
- "label" => "filtrer par étiquette",
+ "tags" => [
+ "label" => "filtrer par étiquette",
"placeholder" => "selectionner une ou plusieurs étiquettes"
],
],
diff --git a/resources/ts/back/Components/Documents/Filters.tsx b/resources/ts/back/Components/Documents/Filters.tsx
new file mode 100644
index 00000000..a6b2adb4
--- /dev/null
+++ b/resources/ts/back/Components/Documents/Filters.tsx
@@ -0,0 +1,100 @@
+// * Packages
+import { usePage } from "@inertiajs/react";
+// * Other
+import useTrans from "@/hooks/use-translations";
+import str from "@/hooks/use-string";
+import EnumFilter from "@/back/Components/Filters/EnumFilter";
+import SwitchFilter from "@/back/Components/Filters/SwitchFilter";
+import MultiSelectRelationFilter from "@/back/Components/Filters/MultiSelectRelationFilter";
+import FiltersWrapper from "@/back/Components/FiltersWrapper";
+import {
+ DocumentCategoryModel,
+ DocumentTagModel,
+ LaravelEnum,
+} from "@/back/types/global";
+
+const Filters = () => {
+ const modelName = usePage().props.modelName as string;
+ const categories = usePage().props.categories as DocumentCategoryModel[];
+ const tags = usePage().props.tags as DocumentTagModel[];
+ const enumDocumentStatus = usePage().props.enumDocumentStatus as LaravelEnum;
+
+ return (
+
+
+
+
+
+
+ );
+};
+
+export default Filters;
diff --git a/resources/ts/back/Components/FiltersWrapper.tsx b/resources/ts/back/Components/FiltersWrapper.tsx
new file mode 100644
index 00000000..62e75cac
--- /dev/null
+++ b/resources/ts/back/Components/FiltersWrapper.tsx
@@ -0,0 +1,62 @@
+// * Packages
+import { Filter } from "lucide-react";
+import { ReactNode } from "react";
+// * Components shadcn
+import {
+ Sheet,
+ SheetContent,
+ SheetDescription,
+ SheetHeader,
+ SheetTitle,
+ SheetTrigger,
+} from "@/components/ui/sheet";
+// * Other
+import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
+import useTrans from "@/hooks/use-translations";
+import str from "@/hooks/use-string";
+
+const FiltersWrapper = ({ children }: { children: ReactNode }) => {
+ return (
+
+
+
+
+ }
+ tooltipContent={
+
+ {str(
+ useTrans(
+ "back.model_filters.button_tooltip",
+ ),
+ )
+ .ucFirst()
+ .value()}
+
+ }
+ type="button"
+ size="icon"
+ variant="outline"
+ />
+
+
+
+
+ {str(useTrans("back.model_filters.sheet_title"))
+ .ucFirst()
+ .value()}
+
+
+
+
+ {children}
+
+
+
+
+
+
+ );
+};
+
+export default FiltersWrapper;
diff --git a/resources/ts/back/Components/Inputs/MultiSelect.tsx b/resources/ts/back/Components/Inputs/MultiSelect.tsx
index b14151f8..64d805bc 100644
--- a/resources/ts/back/Components/Inputs/MultiSelect.tsx
+++ b/resources/ts/back/Components/Inputs/MultiSelect.tsx
@@ -1057,6 +1057,7 @@ export const MultiSelect = forwardRef(
onClick={handleTogglePopover}
disabled={disabled}
role="combobox"
+ variant="outline"
aria-expanded={isPopoverOpen}
aria-haspopup="listbox"
aria-controls={
@@ -1067,10 +1068,9 @@ export const MultiSelect = forwardRef(
getAllOptions().length
} options selected. ${placeholder}`}
className={cn(
- "flex rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto gap-2 px-4 py-2",
+ "group/button flex rounded-md border min-h-10 h-auto items-center justify-between [&_svg]:pointer-events-auto gap-2 px-4 py-2",
autoSize ? "w-auto" : "w-full",
- responsiveSettings.compactMode &&
- "min-h-8 text-sm",
+ responsiveSettings.compactMode && "min-h-8 text-sm",
screenSize === "mobile" && "min-h-12 text-base",
disabled && "opacity-50 cursor-not-allowed",
className,
@@ -1255,8 +1255,9 @@ export const MultiSelect = forwardRef(
)}
-
{
event.stopPropagation();
@@ -1273,26 +1274,24 @@ export const MultiSelect = forwardRef(
}
}}
aria-label={`Clear all ${selectedValues.length} selected options`}
- className="flex items-center justify-center h-4 w-4 me-2 cursor-pointer text-muted-foreground hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm"
+ className="flex items-center justify-center h-4 w-4 p-0 me-2 cursor-pointer transition-opacity opacity-50 group-hover:opacity-60 hover:opacity-100 rounded-sm"
>
-
+
) : (
-
-
- {placeholder}
-
-
+
)}
@@ -1401,7 +1400,7 @@ export const MultiSelect = forwardRef
(
)}
aria-hidden="true"
>
-
+
(
@@ -1467,7 +1466,7 @@ export const MultiSelect = forwardRef(
)}
aria-hidden="true"
>
-
+
{option.icon && (
(
)}
aria-hidden="true"
>
-
+
{option.icon && (
{
- return (
-
-
-
-
-
-
-
-
-
- {str(useTrans("back.model_filters.button_label")).ucFirst().value()}
-
-
-
-
-
-
-
- );
-}
-
-export default ButtonTrigger;
diff --git a/resources/ts/back/Pages/Document/Actions/Filters.tsx b/resources/ts/back/Pages/Document/Actions/Filters.tsx
deleted file mode 100644
index 00f59069..00000000
--- a/resources/ts/back/Pages/Document/Actions/Filters.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-// * Packages
-import { usePage } from "@inertiajs/react";
-// * Components shadcn
-import { SheetDescription } from "@/components/ui/sheet";
-// * Other
-import EnumFilter from "@/back/Components/Filters/EnumFilter";
-import SwitchFilter from "@/back/Components/Filters/SwitchFilter";
-import MultiSelectRelationFilter from "@/back/Components/Filters/MultiSelectRelationFilter";
-import { DocumentCategoryModel, DocumentTagModel, LaravelEnum } from "@/back/types/global";
-import useTrans from "@/hooks/use-translations";
-import str from "@/hooks/use-string";
-
-export default function Filters() {
- const modelName = usePage().props.modelName as string;
- const categories = usePage().props.categories as DocumentCategoryModel[];
- const tags = usePage().props.tags as DocumentTagModel[];
- const enumDocumentStatus = usePage().props.enumDocumentStatus as LaravelEnum;
-
- return (
-
-
-
-
-
-
-
-
- );
-}
diff --git a/resources/ts/back/Pages/Document/Index.tsx b/resources/ts/back/Pages/Document/Index.tsx
index a71554fd..bc00fefe 100644
--- a/resources/ts/back/Pages/Document/Index.tsx
+++ b/resources/ts/back/Pages/Document/Index.tsx
@@ -16,9 +16,9 @@ import DataTable from "@/back/Components/Table/DataTable";
import DataTableSearch from "@/back/Components/Table/DataTableSearch";
import DataTableFilterButton from "@/back/Components/Table/DataTableFilterButton";
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
-import ButtonTrigger from "@/back/Pages/Document/Actions/ButtonTrigger";
import DocumentStatusBadge from "@/back/Components/Documents/DocumentStatusBadge";
import DocumentFinanceTagBadge from "@/back/Components/Documents/DocumentFinanceTagBadge";
+import Filters from "@/back/Components/Documents/Filters";
import { cn, Views } from "@/lib/utils";
import { renderTranslationCell } from "@/lib/translationCellFallback";
import { useFormatedDate } from "@/hooks/use-formated-value";
@@ -260,7 +260,7 @@ export default function Index({
searchText={search}
searchFields={searchFields}
>
-
+