Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
596d21712a | ||
|
|
b504d9d0b2 | ||
|
|
e082a6ef06 | ||
|
|
1662453d9c | ||
|
|
9dd2e07f19 | ||
|
|
18064a972c |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "app-ts",
|
"name": "app-ts",
|
||||||
"version": "1.9.5",
|
"version": "1.9.8",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "app-ts",
|
"name": "app-ts",
|
||||||
"version": "1.9.5",
|
"version": "1.9.8",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "app-ts",
|
"name": "app-ts",
|
||||||
"version": "1.9.5",
|
"version": "1.9.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/server.js",
|
"main": "dist/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -610,6 +610,25 @@
|
|||||||
0 0 0 1px var(--border-color);
|
0 0 0 1px var(--border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.admin-tabs {
|
||||||
|
display: flex;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
scrollbar-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-tabs::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-tab {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
Empty State
|
Empty State
|
||||||
============================================================================ */
|
============================================================================ */
|
||||||
@@ -1075,37 +1094,44 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
/* Compact 2-up filter grid instead of a tall full-width column:
|
||||||
|
the search box spans the row; the filter selects / date pickers sit
|
||||||
|
two-per-row; the reset button spans the row. Touch sizing (44px height +
|
||||||
|
16px font from forms.css) is unchanged — this just halves the vertical
|
||||||
|
footprint of multi-filter bars on phones. */
|
||||||
.admin-search-bar {
|
.admin-search-bar {
|
||||||
flex-direction: column;
|
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-search-bar .admin-form-input,
|
/* Search box spans the full row (handles both the .admin-search wrapper
|
||||||
.admin-search-bar .admin-form-select {
|
and a bare text input used directly as the search field). */
|
||||||
max-width: 100%;
|
.admin-search-bar > .admin-search,
|
||||||
}
|
.admin-search-bar > .admin-form-input:not([type="date"]) {
|
||||||
|
flex: 1 1 100%;
|
||||||
.admin-search-bar .react-datepicker-wrapper {
|
max-width: none;
|
||||||
max-width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-search {
|
.admin-search {
|
||||||
max-width: 100%;
|
min-width: 0;
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Filters (status/supplier selects, native date inputs, datepicker
|
||||||
|
wrappers): two per row. */
|
||||||
|
.admin-search-bar > .admin-form-select,
|
||||||
|
.admin-search-bar > .admin-form-input[type="date"],
|
||||||
|
.admin-search-bar > .react-datepicker-wrapper {
|
||||||
|
flex: 1 1 calc(50% - 0.25rem);
|
||||||
|
min-width: 0;
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Action buttons (e.g. "Zrušit filtry") span the full row. */
|
||||||
|
.admin-search-bar > .admin-btn {
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
.admin-search-bar .admin-form-input,
|
|
||||||
.admin-search-bar .admin-form-select {
|
|
||||||
min-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-search-bar .react-datepicker-wrapper {
|
|
||||||
min-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
Item Picker (Warehouse)
|
Item Picker (Warehouse)
|
||||||
============================================================================ */
|
============================================================================ */
|
||||||
@@ -1185,3 +1211,14 @@
|
|||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.admin-item-picker-list {
|
||||||
|
max-width: calc(100vw - 24px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-item-picker-item {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ interface NativeInputProps {
|
|||||||
minDate?: string;
|
minDate?: string;
|
||||||
maxDate?: string;
|
maxDate?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
placeholder?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modeToInputType: Record<string, string> = {
|
const modeToInputType: Record<string, string> = {
|
||||||
@@ -73,6 +74,7 @@ function NativeInput({
|
|||||||
minDate,
|
minDate,
|
||||||
maxDate,
|
maxDate,
|
||||||
disabled,
|
disabled,
|
||||||
|
placeholder,
|
||||||
}: NativeInputProps) {
|
}: NativeInputProps) {
|
||||||
const type = modeToInputType[mode] || "date";
|
const type = modeToInputType[mode] || "date";
|
||||||
// For time inputs, min/max must be in HH:mm format, not date format
|
// For time inputs, min/max must be in HH:mm format, not date format
|
||||||
@@ -95,6 +97,7 @@ function NativeInput({
|
|||||||
value={value || ""}
|
value={value || ""}
|
||||||
onChange={(e) => onChange(e.target.value)}
|
onChange={(e) => onChange(e.target.value)}
|
||||||
className="admin-form-input"
|
className="admin-form-input"
|
||||||
|
placeholder={placeholder}
|
||||||
required={required}
|
required={required}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
min={minProp}
|
min={minProp}
|
||||||
@@ -126,6 +129,12 @@ export default function AdminDatePicker({
|
|||||||
}: AdminDatePickerProps) {
|
}: AdminDatePickerProps) {
|
||||||
const useNative = isTouchDevice();
|
const useNative = isTouchDevice();
|
||||||
|
|
||||||
|
// Mode-aware default placeholder so empty date fields always show a format
|
||||||
|
// hint (callers can still override, e.g. "Od"/"Do" on range filters).
|
||||||
|
const effectivePlaceholder =
|
||||||
|
placeholder ??
|
||||||
|
(mode === "time" ? "hh:mm" : mode === "month" ? "mm.rrrr" : "dd.mm.rrrr");
|
||||||
|
|
||||||
if (useNative) {
|
if (useNative) {
|
||||||
return (
|
return (
|
||||||
<NativeInput
|
<NativeInput
|
||||||
@@ -136,6 +145,7 @@ export default function AdminDatePicker({
|
|||||||
minDate={minDate}
|
minDate={minDate}
|
||||||
maxDate={maxDate}
|
maxDate={maxDate}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
placeholder={effectivePlaceholder}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -181,7 +191,7 @@ export default function AdminDatePicker({
|
|||||||
const customInput = (
|
const customInput = (
|
||||||
<CustomInput
|
<CustomInput
|
||||||
required={required}
|
required={required}
|
||||||
placeholder={placeholder}
|
placeholder={effectivePlaceholder}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -191,7 +201,7 @@ export default function AdminDatePicker({
|
|||||||
onChange: handleChange,
|
onChange: handleChange,
|
||||||
locale: "cs",
|
locale: "cs",
|
||||||
customInput,
|
customInput,
|
||||||
placeholderText: placeholder,
|
placeholderText: effectivePlaceholder,
|
||||||
minDate: parseMinMax(minDate),
|
minDate: parseMinMax(minDate),
|
||||||
maxDate: parseMinMax(maxDate),
|
maxDate: parseMinMax(maxDate),
|
||||||
popperPlacement: "bottom-start" as const,
|
popperPlacement: "bottom-start" as const,
|
||||||
|
|||||||
@@ -488,3 +488,23 @@
|
|||||||
color: var(--text-tertiary);
|
color: var(--text-tertiary);
|
||||||
font-size: 0.8125rem;
|
font-size: 0.8125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.admin-customer-dropdown {
|
||||||
|
max-width: calc(100vw - 24px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-customer-dropdown-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-customer-selected .admin-btn-icon {
|
||||||
|
min-width: 44px;
|
||||||
|
min-height: 44px;
|
||||||
|
margin-right: -10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { motion } from "framer-motion";
|
|||||||
import ConfirmModal from "../components/ConfirmModal";
|
import ConfirmModal from "../components/ConfirmModal";
|
||||||
import FormModal from "../components/FormModal";
|
import FormModal from "../components/FormModal";
|
||||||
import FormField from "../components/FormField";
|
import FormField from "../components/FormField";
|
||||||
|
import AdminDatePicker from "../components/AdminDatePicker";
|
||||||
|
|
||||||
import { formatDate, czechPlural } from "../utils/formatters";
|
import { formatDate, czechPlural } from "../utils/formatters";
|
||||||
import SortIcon from "../components/SortIcon";
|
import SortIcon from "../components/SortIcon";
|
||||||
@@ -530,23 +531,21 @@ export default function Projects() {
|
|||||||
|
|
||||||
<div className="admin-form-row">
|
<div className="admin-form-row">
|
||||||
<FormField label="Začátek">
|
<FormField label="Začátek">
|
||||||
<input
|
<AdminDatePicker
|
||||||
type="date"
|
mode="date"
|
||||||
value={createForm.start_date}
|
value={createForm.start_date}
|
||||||
onChange={(e) =>
|
onChange={(val) =>
|
||||||
setCreateForm({ ...createForm, start_date: e.target.value })
|
setCreateForm({ ...createForm, start_date: val })
|
||||||
}
|
}
|
||||||
className="admin-form-input"
|
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
<FormField label="Konec">
|
<FormField label="Konec">
|
||||||
<input
|
<AdminDatePicker
|
||||||
type="date"
|
mode="date"
|
||||||
value={createForm.end_date}
|
value={createForm.end_date}
|
||||||
onChange={(e) =>
|
onChange={(val) =>
|
||||||
setCreateForm({ ...createForm, end_date: e.target.value })
|
setCreateForm({ ...createForm, end_date: val })
|
||||||
}
|
}
|
||||||
className="admin-form-input"
|
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -378,7 +378,6 @@ export default function WarehouseReceiptForm() {
|
|||||||
delivery_note_date: val,
|
delivery_note_date: val,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
placeholder="dd.mm.yyyy"
|
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user