@ai-matrx/records-ui 0.116.9 → 0.116.11
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/CHANGELOG.md +36 -1
- package/dist/index.cjs +75 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +78 -24
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -12,11 +12,46 @@
|
|
|
12
12
|
- Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
|
|
13
13
|
- **New subpath `@ai-matrx/records-ui/data-source`:** `recordsDataSource`, `personActor` and the who-changed words (`whenWords`, `actorWords`, `actorBadge`, `lastChangeSentence`, `SOMEBODY`, `THE_SYSTEM`) alone. `/helpers` also carries the field-type words, the colour resolver and the table builders, which read `@ai-matrx/records/core`; this entry reaches `@ai-matrx/kit` only, and shares the one data-source cache with `/helpers` and the root. Additive. Consumer action: a shell-reachable service that only binds its supabase client or says when imports from `/data-source`.
|
|
14
14
|
|
|
15
|
-
## 0.116.
|
|
15
|
+
## 0.116.11
|
|
16
16
|
|
|
17
17
|
UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
|
|
18
18
|
Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
|
|
19
19
|
|
|
20
|
+
## 0.116.10
|
|
21
|
+
|
|
22
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
23
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
24
|
+
Diff: `git diff 3efc627e11 29df753701 -- apps/shared/records-ui/src`
|
|
25
|
+
|
|
26
|
+
Changed shipped source files (2):
|
|
27
|
+
- `apps/shared/records-ui/src/Grid.tsx`
|
|
28
|
+
- `apps/shared/records-ui/src/gridEditing.tsx`
|
|
29
|
+
|
|
30
|
+
## 0.116.9
|
|
31
|
+
|
|
32
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
33
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
34
|
+
Diff: `git diff eab7a68c6e 3efc627e11 -- apps/shared/records-ui/src`
|
|
35
|
+
|
|
36
|
+
Changed shipped source files (7):
|
|
37
|
+
- `apps/shared/records-ui/src/CalendarView.tsx`
|
|
38
|
+
- `apps/shared/records-ui/src/Enrich.tsx`
|
|
39
|
+
- `apps/shared/records-ui/src/TablePage.tsx`
|
|
40
|
+
- `apps/shared/records-ui/src/ViewSwitcher.tsx`
|
|
41
|
+
- `apps/shared/records-ui/src/buttonCell.tsx`
|
|
42
|
+
- `apps/shared/records-ui/src/charts.ts`
|
|
43
|
+
- `apps/shared/records-ui/src/gridOpen.tsx`
|
|
44
|
+
|
|
45
|
+
## 0.116.8
|
|
46
|
+
|
|
47
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
48
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
49
|
+
Diff: `git diff b49ca17d10 eab7a68c6e -- apps/shared/records-ui/src`
|
|
50
|
+
|
|
51
|
+
Changed shipped source files (2):
|
|
52
|
+
- `apps/shared/records-ui/src/RecordPanel.tsx`
|
|
53
|
+
- `apps/shared/records-ui/src/gridEditing.tsx`
|
|
54
|
+
|
|
20
55
|
## 0.116.7
|
|
21
56
|
|
|
22
57
|
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
package/dist/index.cjs
CHANGED
|
@@ -21491,7 +21491,9 @@ function OpenCell({
|
|
|
21491
21491
|
// A one-line control sits centred on the row; a multi-line box hangs from the cell's top and
|
|
21492
21492
|
// grows downward over the rows below (Airtable's expanded long-text cell), never up over the
|
|
21493
21493
|
// header (D10: centred, its first lines sat 58px above the cell, outside it).
|
|
21494
|
-
|
|
21494
|
+
// …and its words wrap: the one-line frame sets `white-space: nowrap` on every descendant, so the
|
|
21495
|
+
// textarea scrolled sideways on one line (live, after the clip was lifted).
|
|
21496
|
+
multiline ? "top-0 rounded-md bg-card shadow-md [&_textarea]:![white-space:pre-wrap] [&_textarea]:![overflow-wrap:anywhere]" : "top-1/2 -translate-y-1/2",
|
|
21495
21497
|
// A box reaching over the next column is opaque, so what it covers never shows through it
|
|
21496
21498
|
// (the calendar button sat over the Actions cell's copy icon, both drawn).
|
|
21497
21499
|
widens && "rounded-md bg-card shadow-sm",
|
|
@@ -33312,7 +33314,8 @@ function GridBody({
|
|
|
33312
33314
|
...classicInCard || embeddedMore || loadAll.rows ? { hidePagination: true } : {},
|
|
33313
33315
|
...embedded ? { appearance: "embedded" } : {},
|
|
33314
33316
|
tableClassName: (0, import_design_system88.cn)(
|
|
33315
|
-
!look.wrap && lines === 1 && "[&_tbody_td]:max-w-[28rem] [&_tbody_td]:overflow-hidden [&_tbody_td]:text-ellipsis [&_tbody_td]:whitespace-nowrap! [&_tbody_td_
|
|
33317
|
+
!look.wrap && lines === 1 && "[&_tbody_td]:max-w-[28rem] [&_tbody_td]:overflow-hidden [&_tbody_td]:text-ellipsis [&_tbody_td]:whitespace-nowrap! [&_tbody_td_*:not(textarea)]:whitespace-nowrap!",
|
|
33318
|
+
// (A textarea is only ever an OPEN long-text editor, whose words must wrap — records walk D10.)
|
|
33316
33319
|
embedded && EMBEDDED_TABLE_CLASS,
|
|
33317
33320
|
embedded && !calculationChosen && EMBEDDED_PLAIN_FOOTER_CLASS
|
|
33318
33321
|
),
|
|
@@ -40030,6 +40033,25 @@ function useNarrow() {
|
|
|
40030
40033
|
}, []);
|
|
40031
40034
|
return narrow;
|
|
40032
40035
|
}
|
|
40036
|
+
var READABLE_CELL_PX = 72;
|
|
40037
|
+
function useGridWidth(grid, mode) {
|
|
40038
|
+
const [width, setWidth] = (0, import_react235.useState)(null);
|
|
40039
|
+
const useIsoLayoutEffect2 = typeof window === "undefined" ? import_react235.useEffect : import_react235.useLayoutEffect;
|
|
40040
|
+
useIsoLayoutEffect2(() => {
|
|
40041
|
+
const el = grid.current;
|
|
40042
|
+
if (!el) {
|
|
40043
|
+
setWidth(null);
|
|
40044
|
+
return;
|
|
40045
|
+
}
|
|
40046
|
+
const read = () => setWidth(el.clientWidth);
|
|
40047
|
+
read();
|
|
40048
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
40049
|
+
const watcher = new ResizeObserver(read);
|
|
40050
|
+
watcher.observe(el);
|
|
40051
|
+
return () => watcher.disconnect();
|
|
40052
|
+
}, [grid, mode]);
|
|
40053
|
+
return width;
|
|
40054
|
+
}
|
|
40033
40055
|
function byTime(a, b) {
|
|
40034
40056
|
const allDayOn = (p) => !p.at || p.lastDay > p.firstDay;
|
|
40035
40057
|
return Number(!allDayOn(a)) - Number(!allDayOn(b)) || (a.at && b.at && !allDayOn(a) && !allDayOn(b) ? a.at.getTime() - b.at.getTime() : 0) || a.firstDay.localeCompare(b.firstDay);
|
|
@@ -40122,6 +40144,11 @@ function CalendarView({
|
|
|
40122
40144
|
const titleOf = (row) => cardWords(row, titleField, labels).text;
|
|
40123
40145
|
const rowById = (id) => rows.find((r) => r.id === id);
|
|
40124
40146
|
const frame = (0, import_react235.useRef)(null);
|
|
40147
|
+
const grid = (0, import_react235.useRef)(null);
|
|
40148
|
+
const gridWidth = useGridWidth(grid, mode);
|
|
40149
|
+
const cellColumns = mode === "month" ? 7 : mode === "week" ? 7 : 1;
|
|
40150
|
+
const cellReserve = mode === "month" ? 0 : 44;
|
|
40151
|
+
const tightCells = (mode === "month" || mode === "week") && gridWidth !== null && gridWidth > 0 && (gridWidth - cellReserve) / cellColumns < READABLE_CELL_PX;
|
|
40125
40152
|
const [focusOn, setFocusOn] = (0, import_react235.useState)(null);
|
|
40126
40153
|
(0, import_react235.useEffect)(() => {
|
|
40127
40154
|
if (!focusOn) return;
|
|
@@ -40342,7 +40369,7 @@ function CalendarView({
|
|
|
40342
40369
|
window.addEventListener("pointermove", onMove);
|
|
40343
40370
|
window.addEventListener("pointerup", onUp);
|
|
40344
40371
|
};
|
|
40345
|
-
const cardFace = (row, extra, className2) => {
|
|
40372
|
+
const cardFace = (row, extra, className2, compact = false) => {
|
|
40346
40373
|
const may = canMove(row);
|
|
40347
40374
|
const lockWords = (0, import_react236.mayDrag)(row.level) ? WORKED_OUT_DATE_LOCK : "View only";
|
|
40348
40375
|
const color = colorOf(row);
|
|
@@ -40356,17 +40383,19 @@ function CalendarView({
|
|
|
40356
40383
|
// The chip palette, not the faint row tint: a calendar is read by its colours at a glance.
|
|
40357
40384
|
color ? import_data_table19.CHOICE_CHIP_CLASS[color] : "bg-background",
|
|
40358
40385
|
may ? "cursor-grab active:cursor-grabbing" : "cursor-default",
|
|
40386
|
+
compact ? "min-h-3 px-0" : "",
|
|
40359
40387
|
className2
|
|
40360
40388
|
),
|
|
40361
40389
|
onClick: () => onOpenRecord?.(row.id),
|
|
40390
|
+
...compact ? { "aria-label": title, "data-calendar-compact": "" } : {},
|
|
40362
40391
|
title: may ? `${title} \xB7 drag to another day, or Alt + arrow keys` : `${title} \xB7 ${lockWords}`,
|
|
40363
40392
|
...color ? { "data-calendar-color": color } : {},
|
|
40364
40393
|
...may ? { "aria-keyshortcuts": "Alt+ArrowLeft Alt+ArrowRight Alt+ArrowUp Alt+ArrowDown" } : { "data-calendar-locked": "" },
|
|
40365
40394
|
children: [
|
|
40366
|
-
may ? null : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { title: lockWords, "aria-label": lockWords, className: "inline-flex", ...(0, import_react236.mayDrag)(row.level) ? { "data-calendar-worked-out": "" } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(LockIcon, {}) }),
|
|
40367
|
-
extra,
|
|
40368
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "min-w-0 max-w-full shrink-0 truncate", "data-calendar-card-title": "", children: title }),
|
|
40369
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(CardFieldsInline, { row, fields: cardFields })
|
|
40395
|
+
compact ? null : may ? null : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { title: lockWords, "aria-label": lockWords, className: "inline-flex", ...(0, import_react236.mayDrag)(row.level) ? { "data-calendar-worked-out": "" } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(LockIcon, {}) }),
|
|
40396
|
+
compact ? null : extra,
|
|
40397
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "min-w-0 max-w-full shrink-0 truncate", "data-calendar-card-title": "", children: title }),
|
|
40398
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(CardFieldsInline, { row, fields: cardFields })
|
|
40370
40399
|
]
|
|
40371
40400
|
}
|
|
40372
40401
|
);
|
|
@@ -40376,8 +40405,8 @@ function CalendarView({
|
|
|
40376
40405
|
const words2 = timeOfDayWords(startOf(row));
|
|
40377
40406
|
return words2 ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "hidden shrink-0 tabular-nums text-[10px] opacity-75 @[8rem]:inline", "data-calendar-time": "", children: words2 }) : null;
|
|
40378
40407
|
};
|
|
40379
|
-
const listCard = (p, key) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("li", { ...dragSource(p.row), children: [
|
|
40380
|
-
cardFace(p.row, timeOn(p.row)),
|
|
40408
|
+
const listCard = (p, key, compact = false) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("li", { ...dragSource(p.row), children: [
|
|
40409
|
+
cardFace(p.row, timeOn(p.row), void 0, compact),
|
|
40381
40410
|
refusalOn(p.row)
|
|
40382
40411
|
] }, key);
|
|
40383
40412
|
const today = dayKey(personWallNow());
|
|
@@ -40435,7 +40464,7 @@ function CalendarView({
|
|
|
40435
40464
|
if (mode === "month") {
|
|
40436
40465
|
const first = startOfWeek(dayKey(new Date(anchorDate.getFullYear(), anchorDate.getMonth(), 1)), firstDay);
|
|
40437
40466
|
const weeks = Array.from({ length: 6 }, (_, w) => addDays2(first, w * 7));
|
|
40438
|
-
body = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "min-w-0 flex-1 overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "w-full min-w-0 border-l border-t", role: "grid", "aria-label": heading, "data-calendar-month": "", children: [
|
|
40467
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "min-w-0 flex-1 overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { ref: grid, className: "w-full min-w-0 border-l border-t", role: "grid", "aria-label": heading, "data-calendar-month": "", ...tightCells ? { "data-calendar-tight": "" } : {}, children: [
|
|
40439
40468
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "grid grid-cols-7", role: "row", children: Array.from({ length: 7 }, (_, i) => addDays2(first, i)).map((d) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { role: "columnheader", className: "border-b border-r px-1 py-0.5 text-center text-xs text-muted-foreground", children: dayDate(d).toLocaleDateString(void 0, { weekday: "short" }) }, `h${d}`)) }),
|
|
40440
40469
|
weeks.map((ws) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
40441
40470
|
MonthWeek,
|
|
@@ -40451,6 +40480,11 @@ function CalendarView({
|
|
|
40451
40480
|
barDrop,
|
|
40452
40481
|
canCreate: creates,
|
|
40453
40482
|
onCreate: (d) => void createAt(rescheduledValue(null, d, null, moments), null, calendarDayLabel(d)),
|
|
40483
|
+
tight: tightCells,
|
|
40484
|
+
dotClass: (row) => {
|
|
40485
|
+
const c = colorOf(row);
|
|
40486
|
+
return c ? import_data_table19.CHOICE_CHIP_CLASS[c] : "bg-muted-foreground/40";
|
|
40487
|
+
},
|
|
40454
40488
|
card: (p, key) => listCard(p, key),
|
|
40455
40489
|
bar: (p, key) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { ...dragSource(p.row), className: "relative h-full", children: [
|
|
40456
40490
|
cardFace(p.row, null, "h-full"),
|
|
@@ -40476,12 +40510,12 @@ function CalendarView({
|
|
|
40476
40510
|
})
|
|
40477
40511
|
);
|
|
40478
40512
|
const columns = `2.75rem repeat(${days.length}, minmax(0, 1fr))`;
|
|
40479
|
-
body = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "min-w-0 flex-1 overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "w-full min-w-0 border-l border-t", "data-calendar-week": "", "data-calendar-days": days.length, children: [
|
|
40513
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "min-w-0 flex-1 overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { ref: grid, className: "w-full min-w-0 border-l border-t", "data-calendar-week": "", "data-calendar-days": days.length, ...tightCells ? { "data-calendar-tight": "" } : {}, children: [
|
|
40480
40514
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "grid", style: { gridTemplateColumns: columns }, children: [
|
|
40481
40515
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "border-b border-r" }),
|
|
40482
40516
|
days.map((d) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: (0, import_design_system115.cn)("border-b border-r px-1 py-0.5 text-center text-xs", d === today ? "font-semibold text-primary" : "text-muted-foreground"), children: dayDate(d).toLocaleDateString(void 0, { weekday: "short", day: "numeric" }) }, `h${d}`)),
|
|
40483
40517
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "border-b border-r px-1 py-0.5 text-[10px] text-muted-foreground", children: "All day" }),
|
|
40484
|
-
days.map((d) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { "data-calendar-day": d, className: (0, import_design_system115.cn)("min-h-8 border-b border-r p-0.5", ghost?.day === d && ghost.minute === null ? "bg-primary/10" : void 0), ...dayDrop(d), children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("ul", { className: "flex flex-col gap-0.5", children: allDay(d).map((p) => listCard(p, `${p.row.id}:${d}
|
|
40518
|
+
days.map((d) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { "data-calendar-day": d, className: (0, import_design_system115.cn)("min-h-8 border-b border-r p-0.5", ghost?.day === d && ghost.minute === null ? "bg-primary/10" : void 0), ...dayDrop(d), children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("ul", { className: "flex flex-col gap-0.5", children: allDay(d).map((p) => listCard(p, `${p.row.id}:${d}`, tightCells)) }) }, `a${d}`))
|
|
40485
40519
|
] }),
|
|
40486
40520
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
40487
40521
|
WeekHours,
|
|
@@ -40527,7 +40561,8 @@ function CalendarView({
|
|
|
40527
40561
|
p.row,
|
|
40528
40562
|
tight ? null : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "hidden shrink-0 tabular-nums text-[10px] opacity-75 @[8rem]:inline", "data-calendar-time": "", children: timeLabel(start) }),
|
|
40529
40563
|
// Taller blocks sharing the width stack the time over the name.
|
|
40530
|
-
(0, import_design_system115.cn)("h-full items-start", !tight && end - start >= 45 && cols > 1 ? "flex-col gap-0" : void 0)
|
|
40564
|
+
(0, import_design_system115.cn)("h-full items-start", !tight && end - start >= 45 && cols > 1 ? "flex-col gap-0" : void 0),
|
|
40565
|
+
tightCells
|
|
40531
40566
|
),
|
|
40532
40567
|
endField && !endWorkedOut && canMove(p.row) ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
40533
40568
|
"div",
|
|
@@ -40596,7 +40631,9 @@ function MonthWeek({
|
|
|
40596
40631
|
onCreate,
|
|
40597
40632
|
card,
|
|
40598
40633
|
bar,
|
|
40599
|
-
refusalOn
|
|
40634
|
+
refusalOn,
|
|
40635
|
+
tight,
|
|
40636
|
+
dotClass
|
|
40600
40637
|
}) {
|
|
40601
40638
|
const weekEnd = addDays2(weekStart, 6);
|
|
40602
40639
|
const days = Array.from({ length: 7 }, (_, i) => addDays2(weekStart, i));
|
|
@@ -40608,7 +40645,7 @@ function MonthWeek({
|
|
|
40608
40645
|
laneEnds[lane] = s.to;
|
|
40609
40646
|
return { ...s, lane };
|
|
40610
40647
|
});
|
|
40611
|
-
const lanesShown = Math.min(laneEnds.length, MONTH_ROWS - 1);
|
|
40648
|
+
const lanesShown = tight ? 0 : Math.min(laneEnds.length, MONTH_ROWS - 1);
|
|
40612
40649
|
const singlesFit = MONTH_ROWS - lanesShown;
|
|
40613
40650
|
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "relative grid grid-cols-7", role: "row", "data-calendar-week-row": weekStart, children: [
|
|
40614
40651
|
days.map((d) => {
|
|
@@ -40620,7 +40657,8 @@ function MonthWeek({
|
|
|
40620
40657
|
const everything = placed.filter((p) => p.firstDay <= d && p.lastDay >= d).sort(byTime);
|
|
40621
40658
|
const create = (e) => {
|
|
40622
40659
|
if (e.target.closest("button, [data-calendar-card], [role=dialog]")) return;
|
|
40623
|
-
|
|
40660
|
+
if (tight && everything.length > 0) onOpenDay(d);
|
|
40661
|
+
else onCreate(d);
|
|
40624
40662
|
};
|
|
40625
40663
|
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
40626
40664
|
"div",
|
|
@@ -40629,7 +40667,8 @@ function MonthWeek({
|
|
|
40629
40667
|
"aria-label": calendarDayLabel(d),
|
|
40630
40668
|
"data-calendar-day": d,
|
|
40631
40669
|
className: (0, import_design_system115.cn)(
|
|
40632
|
-
"group relative flex min-
|
|
40670
|
+
"group relative flex min-w-0 flex-col gap-0.5 border-b border-r p-0.5",
|
|
40671
|
+
tight ? "min-h-14" : "min-h-24",
|
|
40633
40672
|
inMonth ? "" : "bg-muted/40",
|
|
40634
40673
|
ghostDay === d ? "bg-primary/10 ring-2 ring-inset ring-primary" : "",
|
|
40635
40674
|
canCreate ? "cursor-cell" : ""
|
|
@@ -40663,8 +40702,18 @@ function MonthWeek({
|
|
|
40663
40702
|
)
|
|
40664
40703
|
] }),
|
|
40665
40704
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { style: { height: lanesShown * BAR_PX }, "aria-hidden": "true" }),
|
|
40666
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
40667
|
-
|
|
40705
|
+
tight ? everything.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
40706
|
+
"button",
|
|
40707
|
+
{
|
|
40708
|
+
type: "button",
|
|
40709
|
+
className: "flex min-w-0 flex-wrap items-center justify-center gap-0.5 self-stretch px-0.5 py-0.5",
|
|
40710
|
+
"aria-label": `${everything.length} ${everything.length === 1 ? "record" : "records"} on ${calendarDayLabel(d)}`,
|
|
40711
|
+
"data-calendar-marks": d,
|
|
40712
|
+
onClick: () => onOpenDay(d),
|
|
40713
|
+
children: everything.length <= 3 ? everything.map((p) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { "aria-hidden": "true", "data-calendar-dot": "", className: (0, import_design_system115.cn)("h-1.5 w-1.5 rounded-full border", dotClass(p.row)) }, p.row.id)) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "rounded-full bg-muted px-1 text-[10px] tabular-nums leading-4", "data-calendar-count": "", children: everything.length })
|
|
40714
|
+
}
|
|
40715
|
+
) : null : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("ul", { className: "flex flex-col gap-0.5", children: shown5.map((p) => card(p, `${p.row.id}:${d}`)) }),
|
|
40716
|
+
more > 0 && !tight ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("button", { type: "button", className: "self-start px-1 text-xs text-muted-foreground hover:text-foreground", "data-calendar-more": d, onClick: () => onOpenDay(d), children: [
|
|
40668
40717
|
"+",
|
|
40669
40718
|
more,
|
|
40670
40719
|
" more"
|
|
@@ -40675,7 +40724,11 @@ function MonthWeek({
|
|
|
40675
40724
|
role: "dialog",
|
|
40676
40725
|
"aria-label": calendarDayLabel(d),
|
|
40677
40726
|
"data-calendar-day-open": d,
|
|
40678
|
-
className:
|
|
40727
|
+
className: (0, import_design_system115.cn)(
|
|
40728
|
+
"z-20 flex flex-col gap-1 rounded-md border bg-popover p-2 shadow-lg",
|
|
40729
|
+
// A narrow cell cannot hold a panel: the day's list opens as a sheet over the page's foot.
|
|
40730
|
+
tight ? "fixed inset-x-3 bottom-3 z-50 max-h-[60vh] overflow-y-auto" : "absolute left-0 top-0 w-56"
|
|
40731
|
+
),
|
|
40679
40732
|
onKeyDown: (e) => {
|
|
40680
40733
|
if (e.key === "Escape") onOpenDay(null);
|
|
40681
40734
|
},
|
|
@@ -40684,7 +40737,8 @@ function MonthWeek({
|
|
|
40684
40737
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "text-xs font-medium", children: calendarDayLabel(d) }),
|
|
40685
40738
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_design_system115.Button, { size: "sm", variant: "ghost", className: "ml-auto h-6", "aria-label": "Close", onClick: () => onOpenDay(null), children: "\xD7" })
|
|
40686
40739
|
] }),
|
|
40687
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("ul", { className: "flex flex-col gap-0.5", children: everything.map((p) => card(p, `open:${p.row.id}:${d}`)) })
|
|
40740
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("ul", { className: "flex flex-col gap-0.5", children: everything.map((p) => card(p, `open:${p.row.id}:${d}`)) }),
|
|
40741
|
+
tight && canCreate ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_design_system115.Button, { size: "sm", variant: "outline", className: "h-7 self-start", "data-calendar-add-in-sheet": d, onClick: () => onCreate(d), children: "Add a record" }) : null
|
|
40688
40742
|
]
|
|
40689
40743
|
}
|
|
40690
40744
|
) : null
|