Files
breadcrumb-the-shire/pages/address-book/filter-schema.php
2026-03-04 15:56:58 +01:00

57 lines
2.1 KiB
PHP

<?php
return gridFilterSchema([
'query' => [
'limit' => ['type' => 'int', 'default' => 10, 'min' => 1, 'max' => 100],
'offset' => ['type' => 'int', 'default' => 0, 'min' => 0],
'search' => ['type' => 'string'],
'order' => ['type' => 'order', 'allowed' => ['display_name', 'email', 'first_name', 'last_name'], 'default' => 'last_name'],
'dir' => ['type' => 'dir', 'default' => 'asc'],
'tenant' => ['type' => 'string'],
'tenants' => ['type' => 'csv_strings', 'max' => 200],
'departments' => ['type' => 'csv_strings', 'max' => 200],
'roles' => ['type' => 'csv_strings', 'max' => 200],
],
'toolbar' => [
[
'key' => 'search',
'type' => 'text',
'label' => 'Search',
'placeholder' => 'Search...',
'input_id' => 'address-book-search',
'search' => true,
'query' => ['type' => 'string'],
],
[
'key' => 'tenants',
'type' => 'multi_csv',
'label' => 'Tenants',
'placeholder' => 'Select tenants',
'input_id' => 'address-book-tenant-filter',
'options_key' => 'tenant_items',
'query' => ['type' => 'csv_strings', 'max' => 200, 'return' => 'array'],
'default' => [],
],
[
'key' => 'departments',
'type' => 'multi_csv',
'label' => 'Departments',
'placeholder' => 'Select departments',
'input_id' => 'address-book-department-filter',
'options_key' => 'department_items',
'query' => ['type' => 'csv_strings', 'max' => 200, 'return' => 'array'],
'default' => [],
],
[
'key' => 'roles',
'type' => 'multi_csv',
'label' => 'Roles',
'placeholder' => 'Select roles',
'input_id' => 'address-book-role-filter',
'options_key' => 'role_items',
'query' => ['type' => 'csv_strings', 'max' => 200, 'return' => 'array'],
'default' => [],
],
],
]);