@panneau/lists 5.0.0-alpha.11 → 5.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/dist/ItemDetails.css +16 -0
- package/dist/ItemDetails.d.ts +12 -3
- package/dist/ItemDetails.d.ts.map +1 -1
- package/dist/ItemDetails.js +89 -59
- package/dist/ItemDetails.js.map +1 -1
- package/dist/ItemDetails.module.js +6 -2
- package/dist/ItemDetails.module.js.map +1 -1
- package/dist/List.d.ts +1 -1
- package/dist/List.d.ts.map +1 -1
- package/dist/List.js +29 -50
- package/dist/List.js.map +1 -1
- package/dist/ListView.d.ts +34 -5
- package/dist/ListView.d.ts.map +1 -1
- package/dist/ListView.js +416 -359
- package/dist/ListView.js.map +1 -1
- package/dist/columns.d.ts +10 -0
- package/dist/columns.d.ts.map +1 -0
- package/dist/columns.js +25 -0
- package/dist/columns.js.map +1 -0
- package/dist/displays/Displays.css +12 -0
- package/dist/displays/Displays.module.js +6 -2
- package/dist/displays/Displays.module.js.map +1 -1
- package/dist/displays/displays.d.ts +11 -1
- package/dist/displays/displays.d.ts.map +1 -1
- package/dist/displays/displays.js +185 -22
- package/dist/displays/displays.js.map +1 -1
- package/dist/images.d.ts +6 -0
- package/dist/images.d.ts.map +1 -0
- package/dist/images.js +18 -0
- package/dist/images.js.map +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/inline/Inline.css +58 -0
- package/dist/inline/Inline.module.js +20 -0
- package/dist/inline/Inline.module.js.map +1 -0
- package/dist/inline/InlineCell.d.ts +27 -0
- package/dist/inline/InlineCell.d.ts.map +1 -0
- package/dist/inline/InlineCell.js +471 -0
- package/dist/inline/InlineCell.js.map +1 -0
- package/dist/inline/editable.d.ts +12 -0
- package/dist/inline/editable.d.ts.map +1 -0
- package/dist/inline/editable.js +29 -0
- package/dist/inline/editable.js.map +1 -0
- package/dist/layouts/CalendarLayout.css +153 -0
- package/dist/layouts/CalendarLayout.d.ts +9 -0
- package/dist/layouts/CalendarLayout.d.ts.map +1 -0
- package/dist/layouts/CalendarLayout.js +298 -0
- package/dist/layouts/CalendarLayout.js.map +1 -0
- package/dist/layouts/CalendarLayout.module.js +28 -0
- package/dist/layouts/CalendarLayout.module.js.map +1 -0
- package/dist/layouts/CardsLayout.js +1 -1
- package/dist/layouts/GalleryLayout.css +80 -0
- package/dist/layouts/GalleryLayout.d.ts +8 -0
- package/dist/layouts/GalleryLayout.d.ts.map +1 -0
- package/dist/layouts/GalleryLayout.js +129 -0
- package/dist/layouts/GalleryLayout.js.map +1 -0
- package/dist/layouts/GalleryLayout.module.js +26 -0
- package/dist/layouts/GalleryLayout.module.js.map +1 -0
- package/dist/layouts/TableLayout.d.ts +1 -1
- package/dist/layouts/TableLayout.d.ts.map +1 -1
- package/dist/layouts/TableLayout.js +44 -39
- package/dist/layouts/TableLayout.js.map +1 -1
- package/dist/layouts/builtIn.d.ts +1 -1
- package/dist/layouts/builtIn.d.ts.map +1 -1
- package/dist/layouts/builtIn.js +6 -2
- package/dist/layouts/builtIn.js.map +1 -1
- package/dist/toolbar/ColumnMenu.d.ts +17 -0
- package/dist/toolbar/ColumnMenu.d.ts.map +1 -0
- package/dist/toolbar/ColumnMenu.js +193 -0
- package/dist/toolbar/ColumnMenu.js.map +1 -0
- package/dist/toolbar/LayoutSwitch.d.ts.map +1 -1
- package/dist/toolbar/LayoutSwitch.js +73 -55
- package/dist/toolbar/LayoutSwitch.js.map +1 -1
- package/dist/toolbar/Toolbar.css +36 -0
- package/dist/toolbar/Toolbar.module.js +12 -2
- package/dist/toolbar/Toolbar.module.js.map +1 -1
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/values.d.ts +1 -0
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +1 -1
- package/dist/values.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
.panneau-calendar-layout-calendar {
|
|
2
|
+
container-type: inline-size;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--panneau-space-2);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.panneau-calendar-layout-header {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
gap: var(--panneau-space-2);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.panneau-calendar-layout-month {
|
|
17
|
+
margin: 0;
|
|
18
|
+
font-size: var(--panneau-font-size-lg);
|
|
19
|
+
font-weight: var(--panneau-font-weight-medium);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.panneau-calendar-layout-month::first-letter {
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.panneau-calendar-layout-navigation {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--panneau-space-1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.panneau-calendar-layout-more {
|
|
33
|
+
margin: 0;
|
|
34
|
+
font-size: var(--panneau-font-size-sm);
|
|
35
|
+
color: var(--panneau-color-text-muted);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.panneau-calendar-layout-grid {
|
|
39
|
+
width: 100%;
|
|
40
|
+
table-layout: fixed;
|
|
41
|
+
border-collapse: collapse;
|
|
42
|
+
background-color: var(--panneau-color-surface);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.panneau-calendar-layout-grid th {
|
|
46
|
+
padding: var(--panneau-space-1);
|
|
47
|
+
font-size: var(--panneau-font-size-sm);
|
|
48
|
+
font-weight: var(--panneau-font-weight-medium);
|
|
49
|
+
color: var(--panneau-color-text-muted);
|
|
50
|
+
text-align: start;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.panneau-calendar-layout-grid abbr {
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.panneau-calendar-layout-grid td {
|
|
58
|
+
height: 6rem;
|
|
59
|
+
padding: var(--panneau-space-1);
|
|
60
|
+
vertical-align: top;
|
|
61
|
+
border: var(--panneau-border-width) solid var(--panneau-color-border);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.panneau-calendar-layout-grid td[data-outside] {
|
|
65
|
+
background-color: var(--panneau-color-surface-sunken);
|
|
66
|
+
color: var(--panneau-color-text-muted);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.panneau-calendar-layout-day {
|
|
70
|
+
display: block;
|
|
71
|
+
font-size: var(--panneau-font-size-sm);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.panneau-calendar-layout-grid td[aria-current='date'] .panneau-calendar-layout-day-number {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
min-width: 1.5rem;
|
|
79
|
+
height: 1.5rem;
|
|
80
|
+
color: var(--panneau-color-accent-text);
|
|
81
|
+
background-color: var(--panneau-color-accent);
|
|
82
|
+
border-radius: 999px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* The full date, for assistive technologies; shown on narrow lists. */
|
|
86
|
+
.panneau-calendar-layout-day-label {
|
|
87
|
+
position: absolute;
|
|
88
|
+
width: 1px;
|
|
89
|
+
height: 1px;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
clip-path: inset(50%);
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.panneau-calendar-layout-items {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 2px;
|
|
99
|
+
margin: var(--panneau-space-1) 0 0;
|
|
100
|
+
padding: 0;
|
|
101
|
+
list-style: none;
|
|
102
|
+
font-size: var(--panneau-font-size-sm);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.panneau-calendar-layout-items li {
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.panneau-calendar-layout-items li[data-current] {
|
|
112
|
+
font-weight: var(--panneau-font-weight-medium);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* On narrow lists: the days that have items, one under the other. */
|
|
116
|
+
@container (max-width: 40rem) {
|
|
117
|
+
.panneau-calendar-layout-grid,
|
|
118
|
+
.panneau-calendar-layout-grid tbody,
|
|
119
|
+
.panneau-calendar-layout-grid tr,
|
|
120
|
+
.panneau-calendar-layout-grid td {
|
|
121
|
+
display: block;
|
|
122
|
+
width: auto;
|
|
123
|
+
height: auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.panneau-calendar-layout-grid thead,
|
|
127
|
+
.panneau-calendar-layout-grid td[data-empty],
|
|
128
|
+
.panneau-calendar-layout-day-number {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.panneau-calendar-layout-grid td {
|
|
133
|
+
border-width: 0 0 var(--panneau-border-width);
|
|
134
|
+
padding: var(--panneau-space-2) 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.panneau-calendar-layout-grid td[data-outside] {
|
|
138
|
+
background: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.panneau-calendar-layout-day-label {
|
|
142
|
+
position: static;
|
|
143
|
+
width: auto;
|
|
144
|
+
height: auto;
|
|
145
|
+
overflow: visible;
|
|
146
|
+
clip-path: none;
|
|
147
|
+
font-weight: var(--panneau-font-weight-medium);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.panneau-calendar-layout-items li {
|
|
151
|
+
white-space: normal;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ListLayoutProps } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Items on the days of a month (decision 0044): the weeks of the month, from the first day of the
|
|
4
|
+
* week of the locale, with the title of each item as its link, in the order of their dates, and
|
|
5
|
+
* buttons to the previous, the next and the current month. On narrow lists, the days that have
|
|
6
|
+
* items, one under the other.
|
|
7
|
+
*/
|
|
8
|
+
export declare function CalendarLayout({ items, columns, renderValue, getItemLabel, getItemHref, isCurrent, label, calendar, }: ListLayoutProps): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=CalendarLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/CalendarLayout.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,UAAU,CAAC;AAyD1D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,GACX,EAAE,eAAe,+BA4IjB"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { messages } from "../messages.js";
|
|
2
|
+
import CalendarLayout_module_default from "./CalendarLayout.module.js";
|
|
3
|
+
import { ItemTitle } from "./ItemTitle.js";
|
|
4
|
+
import { currentMonth, isMonth, shiftMonth } from "@panneau/core";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { Button, IconButton, usePanneauIntl } from "@panneau/ui";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
9
|
+
//#region src/layouts/CalendarLayout.tsx
|
|
10
|
+
var DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
11
|
+
function pad(value, length = 2) {
|
|
12
|
+
return String(value).padStart(length, "0");
|
|
13
|
+
}
|
|
14
|
+
function dayOf(date) {
|
|
15
|
+
return `${pad(date.getUTCFullYear(), 4)}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;
|
|
16
|
+
}
|
|
17
|
+
/** The day of a `date` (as it is) or a `datetime` (in the time zone of the browser). */
|
|
18
|
+
function getItemDay(value) {
|
|
19
|
+
if (typeof value !== "string" || value === "") return null;
|
|
20
|
+
if (DAY.test(value)) return value;
|
|
21
|
+
const date = new Date(value);
|
|
22
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
23
|
+
return `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
24
|
+
}
|
|
25
|
+
/** The first day of the week in a locale: 1 for Monday to 7 for Sunday. */
|
|
26
|
+
function getFirstDay(locale) {
|
|
27
|
+
try {
|
|
28
|
+
const info = new Intl.Locale(locale);
|
|
29
|
+
return info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay ?? 1;
|
|
30
|
+
} catch {
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** The weeks that show a month, as days (`2026-11-02`), from the first day of the week. */
|
|
35
|
+
function getWeeks(month, firstDay) {
|
|
36
|
+
const [year = 1970, index = 1] = month.split("-").map(Number);
|
|
37
|
+
const first = new Date(Date.UTC(year, index - 1, 1));
|
|
38
|
+
const last = new Date(Date.UTC(year, index, 0));
|
|
39
|
+
const offset = (first.getUTCDay() - firstDay % 7 + 7) % 7;
|
|
40
|
+
const start = Date.UTC(year, index - 1, 1 - offset);
|
|
41
|
+
const days = [];
|
|
42
|
+
for (let time = start; days.length % 7 !== 0 || time <= last.getTime(); time += 864e5) days.push(dayOf(new Date(time)));
|
|
43
|
+
return Array.from({ length: days.length / 7 }, (_, week) => days.slice(week * 7, week * 7 + 7));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Items on the days of a month (decision 0044): the weeks of the month, from the first day of the
|
|
47
|
+
* week of the locale, with the title of each item as its link, in the order of their dates, and
|
|
48
|
+
* buttons to the previous, the next and the current month. On narrow lists, the days that have
|
|
49
|
+
* items, one under the other.
|
|
50
|
+
*/
|
|
51
|
+
function CalendarLayout(t0) {
|
|
52
|
+
const $ = c(45);
|
|
53
|
+
const { items, columns, renderValue, getItemLabel, getItemHref, isCurrent, label, calendar } = t0;
|
|
54
|
+
const intl = usePanneauIntl();
|
|
55
|
+
let t1;
|
|
56
|
+
let t2;
|
|
57
|
+
let t3;
|
|
58
|
+
let t4;
|
|
59
|
+
let t5;
|
|
60
|
+
let t6;
|
|
61
|
+
let t7;
|
|
62
|
+
if ($[0] !== calendar || $[1] !== columns || $[2] !== getItemHref || $[3] !== getItemLabel || $[4] !== intl || $[5] !== isCurrent || $[6] !== items || $[7] !== label || $[8] !== renderValue) {
|
|
63
|
+
const today = currentMonth();
|
|
64
|
+
const month = calendar !== void 0 && isMonth(calendar.month) ? calendar.month : today;
|
|
65
|
+
const [t8, t9] = month.split("-").map(Number);
|
|
66
|
+
const year = t8 === void 0 ? 1970 : t8;
|
|
67
|
+
const index = t9 === void 0 ? 1 : t9;
|
|
68
|
+
const [title] = columns;
|
|
69
|
+
const weeks = getWeeks(month, getFirstDay(intl.locale));
|
|
70
|
+
const monthLabel = new Intl.DateTimeFormat(intl.locale, {
|
|
71
|
+
month: "long",
|
|
72
|
+
year: "numeric",
|
|
73
|
+
timeZone: "UTC"
|
|
74
|
+
}).format(new Date(Date.UTC(year, index - 1, 1)));
|
|
75
|
+
const dayLabel = new Intl.DateTimeFormat(intl.locale, {
|
|
76
|
+
weekday: "long",
|
|
77
|
+
day: "numeric",
|
|
78
|
+
month: "long",
|
|
79
|
+
timeZone: "UTC"
|
|
80
|
+
});
|
|
81
|
+
let t10;
|
|
82
|
+
if ($[16] !== intl.locale) {
|
|
83
|
+
t10 = (format) => new Intl.DateTimeFormat(intl.locale, {
|
|
84
|
+
weekday: format,
|
|
85
|
+
timeZone: "UTC"
|
|
86
|
+
});
|
|
87
|
+
$[16] = intl.locale;
|
|
88
|
+
$[17] = t10;
|
|
89
|
+
} else t10 = $[17];
|
|
90
|
+
const weekday = t10;
|
|
91
|
+
let t11;
|
|
92
|
+
let t12;
|
|
93
|
+
let t13;
|
|
94
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
95
|
+
const now = /* @__PURE__ */ new Date();
|
|
96
|
+
t11 = pad(now.getFullYear(), 4);
|
|
97
|
+
t12 = pad(now.getMonth() + 1);
|
|
98
|
+
t13 = pad(now.getDate());
|
|
99
|
+
$[18] = t11;
|
|
100
|
+
$[19] = t12;
|
|
101
|
+
$[20] = t13;
|
|
102
|
+
} else {
|
|
103
|
+
t11 = $[18];
|
|
104
|
+
t12 = $[19];
|
|
105
|
+
t13 = $[20];
|
|
106
|
+
}
|
|
107
|
+
const todayDay = `${t11}-${t12}-${t13}`;
|
|
108
|
+
const byDay = /* @__PURE__ */ new Map();
|
|
109
|
+
if (calendar !== void 0) items.forEach((item) => {
|
|
110
|
+
const value = item[calendar.field];
|
|
111
|
+
const day = getItemDay(value);
|
|
112
|
+
if (day !== null) byDay.set(day, [...byDay.get(day) ?? [], {
|
|
113
|
+
item,
|
|
114
|
+
value: String(value)
|
|
115
|
+
}]);
|
|
116
|
+
});
|
|
117
|
+
const more = calendar?.more ?? null;
|
|
118
|
+
t5 = CalendarLayout_module_default.calendar;
|
|
119
|
+
let t14;
|
|
120
|
+
if ($[21] !== intl) {
|
|
121
|
+
t14 = intl.formatMessage(messages.previousMonth);
|
|
122
|
+
$[21] = intl;
|
|
123
|
+
$[22] = t14;
|
|
124
|
+
} else t14 = $[22];
|
|
125
|
+
let t15;
|
|
126
|
+
if ($[23] !== intl) {
|
|
127
|
+
t15 = intl.formatMessage(messages.thisMonth);
|
|
128
|
+
$[23] = intl;
|
|
129
|
+
$[24] = t15;
|
|
130
|
+
} else t15 = $[24];
|
|
131
|
+
let t16;
|
|
132
|
+
if ($[25] !== intl) {
|
|
133
|
+
t16 = intl.formatMessage(messages.nextMonth);
|
|
134
|
+
$[25] = intl;
|
|
135
|
+
$[26] = t16;
|
|
136
|
+
} else t16 = $[26];
|
|
137
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
138
|
+
className: CalendarLayout_module_default.header,
|
|
139
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
140
|
+
className: CalendarLayout_module_default.month,
|
|
141
|
+
"aria-live": "polite",
|
|
142
|
+
children: monthLabel
|
|
143
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
144
|
+
className: CalendarLayout_module_default.navigation,
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
147
|
+
icon: ChevronLeft,
|
|
148
|
+
label: t14,
|
|
149
|
+
onPress: () => calendar?.onMonthChange(shiftMonth(month, -1))
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsx(Button, {
|
|
152
|
+
size: "sm",
|
|
153
|
+
isDisabled: month === today,
|
|
154
|
+
onPress: () => calendar?.onMonthChange(today),
|
|
155
|
+
children: t15
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
158
|
+
icon: ChevronRight,
|
|
159
|
+
label: t16,
|
|
160
|
+
onPress: () => calendar?.onMonthChange(shiftMonth(month, 1))
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
})]
|
|
164
|
+
});
|
|
165
|
+
if ($[27] !== intl || $[28] !== items || $[29] !== more) {
|
|
166
|
+
t7 = more !== null ? /* @__PURE__ */ jsx("p", {
|
|
167
|
+
className: CalendarLayout_module_default.more,
|
|
168
|
+
role: "status",
|
|
169
|
+
children: more.total !== null ? intl.formatMessage(messages.calendarMore, {
|
|
170
|
+
shown: items.length,
|
|
171
|
+
total: more.total
|
|
172
|
+
}) : intl.formatMessage(messages.calendarMoreUnknown, { shown: items.length })
|
|
173
|
+
}) : null;
|
|
174
|
+
$[27] = intl;
|
|
175
|
+
$[28] = items;
|
|
176
|
+
$[29] = more;
|
|
177
|
+
$[30] = t7;
|
|
178
|
+
} else t7 = $[30];
|
|
179
|
+
t2 = CalendarLayout_module_default.grid;
|
|
180
|
+
t3 = `${label}, ${monthLabel}`;
|
|
181
|
+
let t17;
|
|
182
|
+
if ($[31] !== weekday) {
|
|
183
|
+
t17 = (day_0) => {
|
|
184
|
+
const date = /* @__PURE__ */ new Date(`${day_0}T00:00:00Z`);
|
|
185
|
+
return /* @__PURE__ */ jsx("th", {
|
|
186
|
+
scope: "col",
|
|
187
|
+
children: /* @__PURE__ */ jsx("abbr", {
|
|
188
|
+
title: weekday("long").format(date),
|
|
189
|
+
children: weekday("short").format(date)
|
|
190
|
+
})
|
|
191
|
+
}, day_0);
|
|
192
|
+
};
|
|
193
|
+
$[31] = weekday;
|
|
194
|
+
$[32] = t17;
|
|
195
|
+
} else t17 = $[32];
|
|
196
|
+
t4 = /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: (weeks[0] ?? []).map(t17) }) });
|
|
197
|
+
t1 = weeks.map((week) => /* @__PURE__ */ jsx("tr", { children: week.map((day_1) => {
|
|
198
|
+
const entries = [...byDay.get(day_1) ?? []].sort(_temp);
|
|
199
|
+
return /* @__PURE__ */ jsxs("td", {
|
|
200
|
+
"data-outside": !day_1.startsWith(month) || void 0,
|
|
201
|
+
"data-empty": entries.length === 0 || void 0,
|
|
202
|
+
"aria-current": day_1 === todayDay ? "date" : void 0,
|
|
203
|
+
children: [/* @__PURE__ */ jsxs("time", {
|
|
204
|
+
dateTime: day_1,
|
|
205
|
+
className: CalendarLayout_module_default.day,
|
|
206
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
207
|
+
"aria-hidden": "true",
|
|
208
|
+
className: CalendarLayout_module_default.dayNumber,
|
|
209
|
+
children: Number(day_1.slice(8))
|
|
210
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
211
|
+
className: CalendarLayout_module_default.dayLabel,
|
|
212
|
+
children: dayLabel.format(/* @__PURE__ */ new Date(`${day_1}T00:00:00Z`))
|
|
213
|
+
})]
|
|
214
|
+
}), entries.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
215
|
+
className: CalendarLayout_module_default.items,
|
|
216
|
+
children: entries.map((t18) => {
|
|
217
|
+
const { item: item_0 } = t18;
|
|
218
|
+
return /* @__PURE__ */ jsx("li", {
|
|
219
|
+
"data-current": isCurrent?.(item_0) === true || void 0,
|
|
220
|
+
children: /* @__PURE__ */ jsx(ItemTitle, {
|
|
221
|
+
href: getItemHref?.(item_0) ?? null,
|
|
222
|
+
current: isCurrent?.(item_0) ?? false,
|
|
223
|
+
children: title !== void 0 ? renderValue(item_0, title) : getItemLabel(item_0)
|
|
224
|
+
})
|
|
225
|
+
}, item_0.id);
|
|
226
|
+
})
|
|
227
|
+
}) : null]
|
|
228
|
+
}, day_1);
|
|
229
|
+
}) }, week[0]));
|
|
230
|
+
$[0] = calendar;
|
|
231
|
+
$[1] = columns;
|
|
232
|
+
$[2] = getItemHref;
|
|
233
|
+
$[3] = getItemLabel;
|
|
234
|
+
$[4] = intl;
|
|
235
|
+
$[5] = isCurrent;
|
|
236
|
+
$[6] = items;
|
|
237
|
+
$[7] = label;
|
|
238
|
+
$[8] = renderValue;
|
|
239
|
+
$[9] = t1;
|
|
240
|
+
$[10] = t2;
|
|
241
|
+
$[11] = t3;
|
|
242
|
+
$[12] = t4;
|
|
243
|
+
$[13] = t5;
|
|
244
|
+
$[14] = t6;
|
|
245
|
+
$[15] = t7;
|
|
246
|
+
} else {
|
|
247
|
+
t1 = $[9];
|
|
248
|
+
t2 = $[10];
|
|
249
|
+
t3 = $[11];
|
|
250
|
+
t4 = $[12];
|
|
251
|
+
t5 = $[13];
|
|
252
|
+
t6 = $[14];
|
|
253
|
+
t7 = $[15];
|
|
254
|
+
}
|
|
255
|
+
let t8;
|
|
256
|
+
if ($[33] !== t1) {
|
|
257
|
+
t8 = /* @__PURE__ */ jsx("tbody", { children: t1 });
|
|
258
|
+
$[33] = t1;
|
|
259
|
+
$[34] = t8;
|
|
260
|
+
} else t8 = $[34];
|
|
261
|
+
let t9;
|
|
262
|
+
if ($[35] !== t2 || $[36] !== t3 || $[37] !== t4 || $[38] !== t8) {
|
|
263
|
+
t9 = /* @__PURE__ */ jsxs("table", {
|
|
264
|
+
className: t2,
|
|
265
|
+
"aria-label": t3,
|
|
266
|
+
children: [t4, t8]
|
|
267
|
+
});
|
|
268
|
+
$[35] = t2;
|
|
269
|
+
$[36] = t3;
|
|
270
|
+
$[37] = t4;
|
|
271
|
+
$[38] = t8;
|
|
272
|
+
$[39] = t9;
|
|
273
|
+
} else t9 = $[39];
|
|
274
|
+
let t10;
|
|
275
|
+
if ($[40] !== t5 || $[41] !== t6 || $[42] !== t7 || $[43] !== t9) {
|
|
276
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
277
|
+
className: t5,
|
|
278
|
+
children: [
|
|
279
|
+
t6,
|
|
280
|
+
t7,
|
|
281
|
+
t9
|
|
282
|
+
]
|
|
283
|
+
});
|
|
284
|
+
$[40] = t5;
|
|
285
|
+
$[41] = t6;
|
|
286
|
+
$[42] = t7;
|
|
287
|
+
$[43] = t9;
|
|
288
|
+
$[44] = t10;
|
|
289
|
+
} else t10 = $[44];
|
|
290
|
+
return t10;
|
|
291
|
+
}
|
|
292
|
+
function _temp(a, b) {
|
|
293
|
+
return a.value.localeCompare(b.value);
|
|
294
|
+
}
|
|
295
|
+
//#endregion
|
|
296
|
+
export { CalendarLayout };
|
|
297
|
+
|
|
298
|
+
//# sourceMappingURL=CalendarLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarLayout.js","names":["ChevronLeft","ChevronRight","currentMonth","isMonth","shiftMonth","Button","IconButton","usePanneauIntl","messages","ListItem","ListLayoutProps","styles","ItemTitle","DAY","pad","value","length","String","padStart","dayOf","date","Date","getUTCFullYear","getUTCMonth","getUTCDate","getItemDay","test","Number","isNaN","getTime","getFullYear","getMonth","getDate","getFirstDay","locale","info","Intl","Locale","getWeekInfo","firstDay","weekInfo","getWeeks","month","year","index","split","map","first","UTC","last","offset","getUTCDay","start","days","time","push","Array","from","_","week","slice","CalendarLayout","t0","$","_c","items","columns","renderValue","getItemLabel","getItemHref","isCurrent","label","calendar","intl","t1","t2","t3","t4","t5","t6","t7","today","undefined","t8","t9","title","weeks","monthLabel","DateTimeFormat","timeZone","format","dayLabel","weekday","day","t10","t11","t12","t13","Symbol","for","now","todayDay","byDay","Map","forEach","item","field","set","get","more","t14","formatMessage","previousMonth","t15","thisMonth","t16","nextMonth","header","navigation","onMonthChange","total","calendarMore","shown","calendarMoreUnknown","grid","t17","day_0","day_1","entries","sort","_temp","startsWith","dayNumber","t18","item_0","id","a","b","localeCompare","_c","styles"],"sources":["../../src/layouts/CalendarLayout.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight } from 'lucide-react';\n\nimport { currentMonth, isMonth, shiftMonth } from '@panneau/core';\nimport { Button, IconButton, usePanneauIntl } from '@panneau/ui';\n\nimport { messages } from '../messages';\nimport type { ListItem, ListLayoutProps } from '../types';\nimport styles from './CalendarLayout.module.css';\nimport { ItemTitle } from './ItemTitle';\n\nconst DAY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nfunction pad(value: number, length = 2): string {\n return String(value).padStart(length, '0');\n}\n\nfunction dayOf(date: Date): string {\n return `${pad(date.getUTCFullYear(), 4)}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;\n}\n\n/** The day of a `date` (as it is) or a `datetime` (in the time zone of the browser). */\nfunction getItemDay(value: unknown): string | null {\n if (typeof value !== 'string' || value === '') {\n return null;\n }\n if (DAY.test(value)) {\n return value;\n }\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n return null;\n }\n return `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n}\n\n/** The first day of the week in a locale: 1 for Monday to 7 for Sunday. */\nfunction getFirstDay(locale: string): number {\n try {\n const info = new Intl.Locale(locale) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n };\n return info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay ?? 1;\n } catch {\n return 1;\n }\n}\n\n/** The weeks that show a month, as days (`2026-11-02`), from the first day of the week. */\nfunction getWeeks(month: string, firstDay: number): string[][] {\n const [year = 1970, index = 1] = month.split('-').map(Number);\n const first = new Date(Date.UTC(year, index - 1, 1));\n const last = new Date(Date.UTC(year, index, 0));\n // getUTCDay(): 0 for Sunday; firstDay: 7 for Sunday.\n const offset = (first.getUTCDay() - (firstDay % 7) + 7) % 7;\n const start = Date.UTC(year, index - 1, 1 - offset);\n const days: string[] = [];\n for (let time = start; days.length % 7 !== 0 || time <= last.getTime(); time += 86_400_000) {\n days.push(dayOf(new Date(time)));\n }\n return Array.from({ length: days.length / 7 }, (_, week) => days.slice(week * 7, week * 7 + 7));\n}\n\n/**\n * Items on the days of a month (decision 0044): the weeks of the month, from the first day of the\n * week of the locale, with the title of each item as its link, in the order of their dates, and\n * buttons to the previous, the next and the current month. On narrow lists, the days that have\n * items, one under the other.\n */\nexport function CalendarLayout({\n items,\n columns,\n renderValue,\n getItemLabel,\n getItemHref,\n isCurrent,\n label,\n calendar,\n}: ListLayoutProps) {\n const intl = usePanneauIntl();\n const today = currentMonth();\n const month = calendar !== undefined && isMonth(calendar.month) ? calendar.month : today;\n const [year = 1970, index = 1] = month.split('-').map(Number);\n const [title] = columns;\n const weeks = getWeeks(month, getFirstDay(intl.locale));\n const monthLabel = new Intl.DateTimeFormat(intl.locale, {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC',\n }).format(new Date(Date.UTC(year, index - 1, 1)));\n const dayLabel = new Intl.DateTimeFormat(intl.locale, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n const weekday = (format: 'short' | 'long') =>\n new Intl.DateTimeFormat(intl.locale, { weekday: format, timeZone: 'UTC' });\n const now = new Date();\n const todayDay = `${pad(now.getFullYear(), 4)}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;\n\n const byDay = new Map<string, { item: ListItem; value: string }[]>();\n if (calendar !== undefined) {\n items.forEach((item) => {\n const value = item[calendar.field];\n const day = getItemDay(value);\n if (day !== null) {\n byDay.set(day, [...(byDay.get(day) ?? []), { item, value: String(value) }]);\n }\n });\n }\n const more = calendar?.more ?? null;\n\n return (\n <div className={styles.calendar}>\n <div className={styles.header}>\n <p className={styles.month} aria-live=\"polite\">\n {monthLabel}\n </p>\n <div className={styles.navigation}>\n <IconButton\n icon={ChevronLeft}\n label={intl.formatMessage(messages.previousMonth)}\n onPress={() => calendar?.onMonthChange(shiftMonth(month, -1))}\n />\n <Button\n size=\"sm\"\n isDisabled={month === today}\n onPress={() => calendar?.onMonthChange(today)}\n >\n {intl.formatMessage(messages.thisMonth)}\n </Button>\n <IconButton\n icon={ChevronRight}\n label={intl.formatMessage(messages.nextMonth)}\n onPress={() => calendar?.onMonthChange(shiftMonth(month, 1))}\n />\n </div>\n </div>\n {more !== null ? (\n <p className={styles.more} role=\"status\">\n {more.total !== null\n ? intl.formatMessage(messages.calendarMore, {\n shown: items.length,\n total: more.total,\n })\n : intl.formatMessage(messages.calendarMoreUnknown, {\n shown: items.length,\n })}\n </p>\n ) : null}\n <table className={styles.grid} aria-label={`${label}, ${monthLabel}`}>\n <thead>\n <tr>\n {(weeks[0] ?? []).map((day) => {\n const date = new Date(`${day}T00:00:00Z`);\n return (\n <th key={day} scope=\"col\">\n <abbr title={weekday('long').format(date)}>\n {weekday('short').format(date)}\n </abbr>\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]}>\n {week.map((day) => {\n const entries = [...(byDay.get(day) ?? [])].sort((a, b) =>\n a.value.localeCompare(b.value),\n );\n return (\n <td\n key={day}\n data-outside={!day.startsWith(month) || undefined}\n data-empty={entries.length === 0 || undefined}\n aria-current={day === todayDay ? 'date' : undefined}\n >\n <time dateTime={day} className={styles.day}>\n <span aria-hidden=\"true\" className={styles.dayNumber}>\n {Number(day.slice(8))}\n </span>\n <span className={styles.dayLabel}>\n {dayLabel.format(new Date(`${day}T00:00:00Z`))}\n </span>\n </time>\n {entries.length > 0 ? (\n <ul className={styles.items}>\n {entries.map(({ item }) => (\n <li\n key={item.id}\n data-current={\n isCurrent?.(item) === true || undefined\n }\n >\n <ItemTitle\n href={getItemHref?.(item) ?? null}\n current={isCurrent?.(item) ?? false}\n >\n {title !== undefined\n ? renderValue(item, title)\n : getItemLabel(item)}\n </ItemTitle>\n </li>\n ))}\n </ul>\n ) : null}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAMa,MAAM;AAEZ,SAASC,IAAIC,OAAeC,SAAS,GAAW;CAC5C,OAAOC,OAAOF,KAAK,CAAC,CAACG,SAASF,QAAQ,GAAG;AAC7C;AAEA,SAASG,MAAMC,MAAoB;CAC/B,OAAO,GAAGN,IAAIM,KAAKE,eAAe,GAAG,CAAC,EAAC,GAAIR,IAAIM,KAAKG,YAAY,IAAI,CAAC,EAAC,GAAIT,IAAIM,KAAKI,WAAW,CAAC;AACnG;;AAGA,SAASC,WAAWV,OAA+B;CAC/C,IAAI,OAAOA,UAAU,YAAYA,UAAU,IACvC,OAAO;CAEX,IAAIF,IAAIa,KAAKX,KAAK,GACd,OAAOA;CAEX,MAAMK,OAAO,IAAIC,KAAKN,KAAK;CAC3B,IAAIY,OAAOC,MAAMR,KAAKS,QAAQ,CAAC,GAC3B,OAAO;CAEX,OAAO,GAAGf,IAAIM,KAAKU,YAAY,GAAG,CAAC,EAAC,GAAIhB,IAAIM,KAAKW,SAAS,IAAI,CAAC,EAAC,GAAIjB,IAAIM,KAAKY,QAAQ,CAAC;AAC1F;;AAGA,SAASC,YAAYC,QAAwB;CACzC,IAAI;EACA,MAAMC,OAAO,IAAIC,KAAKC,OAAOH,MAAM;EAInC,OAAOC,KAAKG,cAAc,CAAC,CAACC,YAAYJ,KAAKK,UAA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AkB,WAAAT;GAAyB,cAAAC;GAA3C,UAAA,CACIC,IAcAM,EAiDI;;EAAApB,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;CAAA,OAAAA,KAAArB,EAAA;CAAA,IAAA+B;CAAA,IAAA/B,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,MAAAhB,EAAA,QAAAiB,MAAAjB,EAAA,QAAAqB,IAAA;EArGZU,MAAA,qBAAA,OAAA;GAAgB,WAAAhB;GAAhB,UAAA;IACIC;IAwBCC;IAYDI;GAiEE;;EAAArB,EAAA,MAAAe;EAAAf,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAqB;EAAArB,EAAA,MAAA+B;CAAA,OAAAA,MAAA/B,EAAA;CAAA,OAtGN+B;AAsGM;AAnJP,SAAAoC,MAAAM,GAAAC,GAAA;CAAA,OAsG6BD,EAACzH,MAAM2H,cAAeD,EAAC1H,KAAM;AAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./CalendarLayout.css";
|
|
2
|
+
//#region src/layouts/CalendarLayout.module.css
|
|
3
|
+
var calendar = "panneau-calendar-layout-calendar";
|
|
4
|
+
var header = "panneau-calendar-layout-header";
|
|
5
|
+
var month = "panneau-calendar-layout-month";
|
|
6
|
+
var navigation = "panneau-calendar-layout-navigation";
|
|
7
|
+
var more = "panneau-calendar-layout-more";
|
|
8
|
+
var grid = "panneau-calendar-layout-grid";
|
|
9
|
+
var day = "panneau-calendar-layout-day";
|
|
10
|
+
var dayNumber = "panneau-calendar-layout-day-number";
|
|
11
|
+
var dayLabel = "panneau-calendar-layout-day-label";
|
|
12
|
+
var items = "panneau-calendar-layout-items";
|
|
13
|
+
var CalendarLayout_module_default = {
|
|
14
|
+
calendar,
|
|
15
|
+
header,
|
|
16
|
+
month,
|
|
17
|
+
navigation,
|
|
18
|
+
more,
|
|
19
|
+
grid,
|
|
20
|
+
day,
|
|
21
|
+
dayNumber,
|
|
22
|
+
dayLabel,
|
|
23
|
+
items
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { calendar, day, dayLabel, dayNumber, CalendarLayout_module_default as default, grid, header, items, month, more, navigation };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=CalendarLayout.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarLayout.module.js","names":[],"sources":["../../src/layouts/CalendarLayout.module.css"],"sourcesContent":[".calendar {\n container-type: inline-size;\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-2);\n}\n\n.header {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--panneau-space-2);\n}\n\n.month {\n margin: 0;\n font-size: var(--panneau-font-size-lg);\n font-weight: var(--panneau-font-weight-medium);\n}\n\n.month::first-letter {\n text-transform: uppercase;\n}\n\n.navigation {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-1);\n}\n\n.more {\n margin: 0;\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n}\n\n.grid {\n width: 100%;\n table-layout: fixed;\n border-collapse: collapse;\n background-color: var(--panneau-color-surface);\n}\n\n.grid th {\n padding: var(--panneau-space-1);\n font-size: var(--panneau-font-size-sm);\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text-muted);\n text-align: start;\n}\n\n.grid abbr {\n text-decoration: none;\n}\n\n.grid td {\n height: 6rem;\n padding: var(--panneau-space-1);\n vertical-align: top;\n border: var(--panneau-border-width) solid var(--panneau-color-border);\n}\n\n.grid td[data-outside] {\n background-color: var(--panneau-color-surface-sunken);\n color: var(--panneau-color-text-muted);\n}\n\n.day {\n display: block;\n font-size: var(--panneau-font-size-sm);\n}\n\n.grid td[aria-current='date'] .dayNumber {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.5rem;\n height: 1.5rem;\n color: var(--panneau-color-accent-text);\n background-color: var(--panneau-color-accent);\n border-radius: 999px;\n}\n\n/* The full date, for assistive technologies; shown on narrow lists. */\n.dayLabel {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n.items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin: var(--panneau-space-1) 0 0;\n padding: 0;\n list-style: none;\n font-size: var(--panneau-font-size-sm);\n}\n\n.items li {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.items li[data-current] {\n font-weight: var(--panneau-font-weight-medium);\n}\n\n/* On narrow lists: the days that have items, one under the other. */\n@container (max-width: 40rem) {\n .grid,\n .grid tbody,\n .grid tr,\n .grid td {\n display: block;\n width: auto;\n height: auto;\n }\n\n .grid thead,\n .grid td[data-empty],\n .dayNumber {\n display: none;\n }\n\n .grid td {\n border-width: 0 0 var(--panneau-border-width);\n padding: var(--panneau-space-2) 0;\n }\n\n .grid td[data-outside] {\n background: none;\n }\n\n .dayLabel {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n clip-path: none;\n font-weight: var(--panneau-font-weight-medium);\n }\n\n .items li {\n white-space: normal;\n }\n}\n"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { messages } from "../messages.js";
|
|
2
|
-
import CardsLayout_module_default from "./CardsLayout.module.js";
|
|
3
2
|
import { ItemTitle } from "./ItemTitle.js";
|
|
3
|
+
import CardsLayout_module_default from "./CardsLayout.module.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { Checkbox, usePanneauIntl } from "@panneau/ui";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.panneau-gallery-layout-gallery {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr));
|
|
4
|
+
gap: var(--panneau-space-3);
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
list-style: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.panneau-gallery-layout-tile {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
background-color: var(--panneau-color-surface);
|
|
15
|
+
border: var(--panneau-border-width) solid var(--panneau-color-border);
|
|
16
|
+
border-radius: var(--panneau-radius-lg);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.panneau-gallery-layout-tile[data-current] {
|
|
20
|
+
border-color: var(--panneau-color-accent);
|
|
21
|
+
box-shadow: inset 0 0 0 1px var(--panneau-color-accent);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.panneau-gallery-layout-tile[data-selected] {
|
|
25
|
+
background-color: var(--panneau-color-accent-subtle);
|
|
26
|
+
border-color: var(--panneau-color-border-control);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.panneau-gallery-layout-media {
|
|
30
|
+
position: relative;
|
|
31
|
+
aspect-ratio: 4 / 3;
|
|
32
|
+
background-color: var(--panneau-color-surface-sunken);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.panneau-gallery-layout-media img {
|
|
36
|
+
display: block;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
object-fit: cover;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.panneau-gallery-layout-placeholder {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
height: 100%;
|
|
47
|
+
color: var(--panneau-color-text-muted);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.panneau-gallery-layout-check {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: var(--panneau-space-2);
|
|
53
|
+
left: var(--panneau-space-2);
|
|
54
|
+
padding: 2px;
|
|
55
|
+
background-color: var(--panneau-color-surface);
|
|
56
|
+
border-radius: var(--panneau-radius-sm);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.panneau-gallery-layout-caption {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
gap: var(--panneau-space-2);
|
|
63
|
+
padding: var(--panneau-space-2) var(--panneau-space-3);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.panneau-gallery-layout-title {
|
|
67
|
+
flex: 1;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
overflow-wrap: anywhere;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.panneau-gallery-layout-actions {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
gap: var(--panneau-space-1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.panneau-gallery-layout-page-selection {
|
|
79
|
+
margin-bottom: var(--panneau-space-2);
|
|
80
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ListLayoutProps } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Items as a grid of images (decision 0044): the image of each item (`itemImage` of the
|
|
4
|
+
* resource), its title under it, its checkbox and its actions. An item without an image shows a
|
|
5
|
+
* placeholder.
|
|
6
|
+
*/
|
|
7
|
+
export declare function GalleryLayout({ items, columns, renderValue, getItemLabel, getItemHref, getItemImage, isCurrent, selectable, isSelected, onToggle, renderActions, label, pageSelection, }: ListLayoutProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=GalleryLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/GalleryLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,KAAK,EACL,aAAa,GAChB,EAAE,eAAe,+BAyDjB"}
|