diff --git a/admin/layout/style-css/table-list.css b/admin/layout/style-css/table-list.css new file mode 100644 index 0000000..58b84ef --- /dev/null +++ b/admin/layout/style-css/table-list.css @@ -0,0 +1,180 @@ +.table-list-table th, +.table-list-table td { + vertical-align: middle !important; +} + +.table-list-table th.text-right, +.table-list-table td.text-right { + display: table-cell !important; + text-align: right !important; + justify-content: initial !important; + align-items: initial !important; +} + +.table-list-table th:first-child, +.table-list-table td:first-child { + width: 70px; + white-space: nowrap; +} + +.js-table-filters-form .js-filter-compact-select { + width: 100%; + min-width: 0; + max-width: none; +} + +.table-list-table th.table-col-compact, +.table-list-table td.table-col-compact { + width: 120px; + min-width: 120px; + white-space: nowrap; +} + +.table-list-per-page-form { + display: inline-flex; + align-items: center; + justify-content: flex-end; + flex-wrap: wrap; + gap: 8px; +} + +.jconfirm.table-list-confirm-dialog .jconfirm-row { + min-height: 100vh; + display: flex; + align-items: center; + justify-content: center; +} + +.jconfirm.table-list-confirm-dialog .jconfirm-box-container { + width: 100%; + max-width: 560px; + padding-left: 12px; + padding-right: 12px; + margin: 0 auto; +} + +.jconfirm.table-list-confirm-dialog .jconfirm-box { + width: 100% !important; +} + +/* --- Column visibility toggle --- */ + +.table-list-header-actions { + display: inline-flex; + align-items: center; + gap: 10px; +} + +.table-col-toggle-wrapper { + position: relative; + display: inline-block; +} + +.table-col-toggle-dropdown { + display: none; + position: absolute; + right: 0; + top: 100%; + z-index: 1050; + min-width: 220px; + max-height: 400px; + overflow-y: auto; + background: #fff; + border: 1px solid #ddd; + border-radius: 4px; + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + padding: 0; + margin-top: 4px; +} + +.table-col-toggle-dropdown.open { + display: block; +} + +.table-col-toggle-header { + padding: 8px 12px; + font-weight: 600; + font-size: 12px; + color: #555; + border-bottom: 1px solid #eee; + background: #f8f8f8; +} + +.table-col-toggle-item { + display: flex; + align-items: center; + padding: 5px 12px; + margin: 0; + font-weight: normal; + cursor: pointer; + font-size: 13px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + gap: 10px; +} + +.table-col-toggle-item:hover { + background: #f5f5f5; +} + +.table-col-toggle-footer { + padding: 6px 12px; + border-top: 1px solid #eee; + background: #f8f8f8; + text-align: center; +} + +.table-list-table th.table-col-hidden, +.table-list-table td.table-col-hidden { + display: none; +} + +/* Toggle switch */ + +.table-col-switch { + position: relative; + display: inline-block; + width: 34px; + min-width: 34px; + height: 18px; +} + +.table-col-switch input { + opacity: 0; + width: 0; + height: 0; + position: absolute; +} + +.table-col-switch-slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + border-radius: 18px; + transition: background-color 0.2s; +} + +.table-col-switch-slider:before { + position: absolute; + content: ""; + height: 14px; + width: 14px; + left: 2px; + bottom: 2px; + background-color: #fff; + border-radius: 50%; + transition: transform 0.2s; +} + +.table-col-switch input:checked + .table-col-switch-slider { + background-color: #5cb85c; +} + +.table-col-switch input:checked + .table-col-switch-slider:before { + transform: translateX(16px); +} diff --git a/admin/templates/components/table-list.php b/admin/templates/components/table-list.php index 831c9f4..a97747e 100644 --- a/admin/templates/components/table-list.php +++ b/admin/templates/components/table-list.php @@ -46,7 +46,30 @@ $isCompactColumn = function(array $column): bool {
- Wyników: +
+ Wyników: +
+ +
+
Widoczność kolumn
+ columns as $colIndex => $column): ?> + + + + +
+
+
@@ -130,8 +153,9 @@ $isCompactColumn = function(array $column): bool { - columns as $column): ?> + columns as $colIndex => $column): ?> sortableColumns) || in_array($sortKey, $list->sortableColumns, true); $isSortable = !empty($column['sortable']) && $sortKey !== '' && $isAllowedSortKey; @@ -147,7 +171,7 @@ $isCompactColumn = function(array $column): bool { $headerClass = trim($headerClass . ' table-col-compact'); } ?> - - columns as $column): ?> + columns as $colIndex => $column): ?> -
+ @@ -169,9 +193,10 @@ $isCompactColumn = function(array $column): bool { rows) && !empty($list->rows)): ?> rows as $row): ?>
+ @@ -269,67 +294,6 @@ $isCompactColumn = function(array $column): bool { - - diff --git a/admin/templates/site/main-layout.php b/admin/templates/site/main-layout.php index 938d7c7..9cb584d 100644 --- a/admin/templates/site/main-layout.php +++ b/admin/templates/site/main-layout.php @@ -35,6 +35,7 @@ +
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 165c634..8c49c4e 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,16 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze. --- +## ver. 0.299 (2026-02-21) - Widoczność kolumn w tabelach + +- **NEW**: Toggle widoczności kolumn w komponentach `table-list` — przycisk z ikoną kolumn, dropdown z toggle switchami +- **NEW**: Stan widoczności kolumn zapisywany w `localStorage` per tabela (klucz na bazie `basePath`) +- **NEW**: Przycisk "Pokaż wszystkie" resetujący widoczność +- **UPDATE**: Style z `table-list.php` wyekstrahowane do osobnego pliku `admin/layout/style-css/table-list.css` +- **UPDATE**: `admin/templates/site/main-layout.php` — podłączenie `table-list.css` + +--- + ## ver. 0.297 (2026-02-19) - REST API produktów - **NEW**: Endpoint `products` w REST API — lista, szczegóły, tworzenie, aktualizacja produktów diff --git a/docs/UPDATE_INSTRUCTIONS.md b/docs/UPDATE_INSTRUCTIONS.md index 499ab85..d67b986 100644 --- a/docs/UPDATE_INSTRUCTIONS.md +++ b/docs/UPDATE_INSTRUCTIONS.md @@ -18,14 +18,14 @@ Aktualizacje znajdują się w folderze `updates/0.XX/` gdzie XX oznacza dziesią ## Procedura tworzenia nowej aktualizacji -## Status biezacej aktualizacji (ver. 0.297) +## Status biezacej aktualizacji (ver. 0.299) -- Wersja udostepniona: `0.297` (data: 2026-02-19). +- Wersja udostepniona: `0.299` (data: 2026-02-21). - Pliki publikacyjne: - - `updates/0.20/ver_0.297.zip` + - `updates/0.20/ver_0.299.zip` - Pliki metadanych aktualizacji: - `updates/changelog.php` - - `updates/versions.php` (`$current_ver = 297`) + - `updates/versions.php` (`$current_ver = 299`) - Weryfikacja testow przed publikacja: - `OK (687 tests, 1971 assertions)` diff --git a/updates/0.20/ver_0.299.zip b/updates/0.20/ver_0.299.zip new file mode 100644 index 0000000..7dddc2e Binary files /dev/null and b/updates/0.20/ver_0.299.zip differ diff --git a/updates/changelog.php b/updates/changelog.php index 05d1ff8..702735d 100644 --- a/updates/changelog.php +++ b/updates/changelog.php @@ -1,3 +1,6 @@ +ver. 0.299 - 21.02.2026
+- NEW - Ukrywanie/pokazywanie kolumn w tabelach admina (toggle switch + localStorage) +
ver. 0.298 - 20.02.2026
- FIX - kilka poprawek po aktualizacji
diff --git a/updates/versions.php b/updates/versions.php index b7e10da..168f4a3 100644 --- a/updates/versions.php +++ b/updates/versions.php @@ -1,5 +1,5 @@