@almadar/ui 5.126.0 → 5.127.0

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.
@@ -21142,6 +21142,32 @@ var init_ButtonGroup = __esm({
21142
21142
  ButtonGroup.displayName = "ButtonGroup";
21143
21143
  }
21144
21144
  });
21145
+
21146
+ // lib/getNestedValue.ts
21147
+ function getNestedValue(obj, path) {
21148
+ if (obj === null || obj === void 0 || !path) {
21149
+ return void 0;
21150
+ }
21151
+ if (!path.includes(".")) {
21152
+ return obj[path];
21153
+ }
21154
+ const parts = path.split(".");
21155
+ let value = obj;
21156
+ for (const part of parts) {
21157
+ if (value === null || value === void 0) {
21158
+ return void 0;
21159
+ }
21160
+ if (typeof value !== "object" || Array.isArray(value)) {
21161
+ return void 0;
21162
+ }
21163
+ value = value[part];
21164
+ }
21165
+ return value;
21166
+ }
21167
+ var init_getNestedValue = __esm({
21168
+ "lib/getNestedValue.ts"() {
21169
+ }
21170
+ });
21145
21171
  function useSwipeGesture(callbacks, options = {}) {
21146
21172
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
21147
21173
  const startX = React91.useRef(0);
@@ -21255,11 +21281,15 @@ function getWeekDays(start) {
21255
21281
  }
21256
21282
  return days;
21257
21283
  }
21258
- function generateDefaultTimeSlots(events2) {
21284
+ function eventStartDate(event, startField) {
21285
+ const raw = getNestedValue(event, startField);
21286
+ return new Date(raw ?? "");
21287
+ }
21288
+ function generateDefaultTimeSlots(events2, startField) {
21259
21289
  let first = DEFAULT_FIRST_HOUR;
21260
21290
  let last = DEFAULT_LAST_HOUR;
21261
21291
  for (const ev of events2) {
21262
- const start = new Date(ev.startTime);
21292
+ const start = eventStartDate(ev, startField);
21263
21293
  if (Number.isNaN(start.getTime())) continue;
21264
21294
  const hour = start.getHours();
21265
21295
  if (hour < first) first = hour;
@@ -21271,8 +21301,8 @@ function generateDefaultTimeSlots(events2) {
21271
21301
  }
21272
21302
  return slots;
21273
21303
  }
21274
- function eventInSlot(event, day, slotTime) {
21275
- const eventStart = new Date(event.startTime);
21304
+ function eventInSlot(event, day, slotTime, startField) {
21305
+ const eventStart = eventStartDate(event, startField);
21276
21306
  if (Number.isNaN(eventStart.getTime())) return false;
21277
21307
  const [slotHour] = slotTime.split(":").map(Number);
21278
21308
  return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour;
@@ -21289,7 +21319,12 @@ function CalendarGrid({
21289
21319
  longPressPayload,
21290
21320
  swipeLeftEvent,
21291
21321
  swipeRightEvent,
21292
- dayWindow = "auto"
21322
+ dayWindow = "auto",
21323
+ titleField = "title",
21324
+ startField = "startTime",
21325
+ colorField = "color",
21326
+ children,
21327
+ renderItem
21293
21328
  }) {
21294
21329
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
21295
21330
  const eventBus = useEventBus();
@@ -21304,8 +21339,8 @@ function CalendarGrid({
21304
21339
  [resolvedWeekStart]
21305
21340
  );
21306
21341
  const resolvedTimeSlots = React91.useMemo(
21307
- () => timeSlots ?? generateDefaultTimeSlots(evs),
21308
- [timeSlots, evs]
21342
+ () => timeSlots ?? generateDefaultTimeSlots(evs, startField),
21343
+ [timeSlots, evs, startField]
21309
21344
  );
21310
21345
  const visibleCount = useDayWindow(dayWindow);
21311
21346
  const [dayOffset, setDayOffset] = React91.useState(0);
@@ -21342,9 +21377,9 @@ function CalendarGrid({
21342
21377
  );
21343
21378
  const eventsForDayCount = React91.useCallback(
21344
21379
  (day) => evs.filter(
21345
- (ev) => new Date(ev.startTime).toDateString() === day.toDateString()
21380
+ (ev) => eventStartDate(ev, startField).toDateString() === day.toDateString()
21346
21381
  ).length,
21347
- [events2]
21382
+ [events2, startField]
21348
21383
  );
21349
21384
  const swipeCallbacks = React91.useMemo(() => ({
21350
21385
  onSwipeLeft: swipeLeftEvent ? () => eventBus.emit(`UI:${swipeLeftEvent}`, {}) : void 0,
@@ -21363,8 +21398,11 @@ function CalendarGrid({
21363
21398
  eventBus.emit(`UI:${longPressEvent}`, { date: day.toISOString(), time, ...longPressPayload });
21364
21399
  }, 500);
21365
21400
  }, [longPressEvent, longPressPayload, eventBus]);
21401
+ const renderChip = children ?? renderItem;
21366
21402
  const renderEvent = (event) => {
21367
- const color = event.color;
21403
+ const color = getNestedValue(event, colorField);
21404
+ const label = String(getNestedValue(event, titleField) ?? "");
21405
+ const eventIndex = evs.indexOf(event);
21368
21406
  return /* @__PURE__ */ jsxRuntime.jsx(
21369
21407
  Box,
21370
21408
  {
@@ -21376,7 +21414,7 @@ function CalendarGrid({
21376
21414
  color ? color : "bg-primary/10 border-primary/30 text-primary"
21377
21415
  ),
21378
21416
  onClick: (e) => handleEventClick(event, e),
21379
- children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
21417
+ children: renderChip ? renderChip(event, eventIndex) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "truncate font-medium", children: label })
21380
21418
  },
21381
21419
  event.id
21382
21420
  );
@@ -21460,7 +21498,7 @@ function CalendarGrid({
21460
21498
  ) }),
21461
21499
  visibleDays.map((day) => {
21462
21500
  const slotEvents = evs.filter(
21463
- (ev) => eventInSlot(ev, day, time)
21501
+ (ev) => eventInSlot(ev, day, time, startField)
21464
21502
  );
21465
21503
  const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
21466
21504
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -21497,6 +21535,7 @@ var init_CalendarGrid = __esm({
21497
21535
  "components/core/molecules/CalendarGrid.tsx"() {
21498
21536
  "use client";
21499
21537
  init_cn();
21538
+ init_getNestedValue();
21500
21539
  init_Box();
21501
21540
  init_Button();
21502
21541
  init_Stack();
@@ -21513,32 +21552,6 @@ var init_CalendarGrid = __esm({
21513
21552
  CalendarGrid.displayName = "CalendarGrid";
21514
21553
  }
21515
21554
  });
21516
-
21517
- // lib/getNestedValue.ts
21518
- function getNestedValue(obj, path) {
21519
- if (obj === null || obj === void 0 || !path) {
21520
- return void 0;
21521
- }
21522
- if (!path.includes(".")) {
21523
- return obj[path];
21524
- }
21525
- const parts = path.split(".");
21526
- let value = obj;
21527
- for (const part of parts) {
21528
- if (value === null || value === void 0) {
21529
- return void 0;
21530
- }
21531
- if (typeof value !== "object" || Array.isArray(value)) {
21532
- return void 0;
21533
- }
21534
- value = value[part];
21535
- }
21536
- return value;
21537
- }
21538
- var init_getNestedValue = __esm({
21539
- "lib/getNestedValue.ts"() {
21540
- }
21541
- });
21542
21555
  var Pagination;
21543
21556
  var init_Pagination = __esm({
21544
21557
  "components/core/molecules/Pagination.tsx"() {
@@ -51291,7 +51304,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51291
51304
  crossTraitLog.debug("listen:fired", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
51292
51305
  enqueueAndDrain(
51293
51306
  listen.triggers,
51294
- core.applyListenPayloadMapping(listen.payloadMapping, event.payload),
51307
+ core.applyListenPayloadMapping(listen.payloadMapping, event.payload, evaluator.evaluateListenPayloadExpr),
51295
51308
  binding.trait.name
51296
51309
  );
51297
51310
  });
package/dist/avl/index.js CHANGED
@@ -10,7 +10,7 @@ import * as LucideIcons2 from 'lucide-react';
10
10
  import { Loader2, X, Code, FileText, WrapText, Check, Copy, Lightbulb, CheckCircle, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, RotateCcw, Play, Terminal, XCircle, AlertTriangle, Trash2, Link2, ZoomOut, ZoomIn, Download, ChevronDown, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, PauseCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, ChevronUp, Tag, User, DollarSign } from 'lucide-react';
11
11
  import { createPortal } from 'react-dom';
12
12
  import { UISlotProvider, useUISlots, useTheme } from '@almadar/ui/context';
13
- import { evaluateGuard, evaluate, createMinimalContext, executeEffects } from '@almadar/evaluator';
13
+ import { evaluateGuard, evaluateListenPayloadExpr, evaluate, createMinimalContext, executeEffects } from '@almadar/evaluator';
14
14
  import { prepareSchemaForPreview, collectTraitRefsFromResolvedTrait, buildOrbitalsByTrait, collectEmbeddedTraits, wrapCallbackForEvent, pushPerfEntry, perfStart, perfEnd } from '@almadar/runtime/ui';
15
15
  import { Link, Outlet, useLocation } from 'react-router-dom';
16
16
  import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
@@ -21066,6 +21066,32 @@ var init_ButtonGroup = __esm({
21066
21066
  ButtonGroup.displayName = "ButtonGroup";
21067
21067
  }
21068
21068
  });
21069
+
21070
+ // lib/getNestedValue.ts
21071
+ function getNestedValue(obj, path) {
21072
+ if (obj === null || obj === void 0 || !path) {
21073
+ return void 0;
21074
+ }
21075
+ if (!path.includes(".")) {
21076
+ return obj[path];
21077
+ }
21078
+ const parts = path.split(".");
21079
+ let value = obj;
21080
+ for (const part of parts) {
21081
+ if (value === null || value === void 0) {
21082
+ return void 0;
21083
+ }
21084
+ if (typeof value !== "object" || Array.isArray(value)) {
21085
+ return void 0;
21086
+ }
21087
+ value = value[part];
21088
+ }
21089
+ return value;
21090
+ }
21091
+ var init_getNestedValue = __esm({
21092
+ "lib/getNestedValue.ts"() {
21093
+ }
21094
+ });
21069
21095
  function useSwipeGesture(callbacks, options = {}) {
21070
21096
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
21071
21097
  const startX = useRef(0);
@@ -21179,11 +21205,15 @@ function getWeekDays(start) {
21179
21205
  }
21180
21206
  return days;
21181
21207
  }
21182
- function generateDefaultTimeSlots(events2) {
21208
+ function eventStartDate(event, startField) {
21209
+ const raw = getNestedValue(event, startField);
21210
+ return new Date(raw ?? "");
21211
+ }
21212
+ function generateDefaultTimeSlots(events2, startField) {
21183
21213
  let first = DEFAULT_FIRST_HOUR;
21184
21214
  let last = DEFAULT_LAST_HOUR;
21185
21215
  for (const ev of events2) {
21186
- const start = new Date(ev.startTime);
21216
+ const start = eventStartDate(ev, startField);
21187
21217
  if (Number.isNaN(start.getTime())) continue;
21188
21218
  const hour = start.getHours();
21189
21219
  if (hour < first) first = hour;
@@ -21195,8 +21225,8 @@ function generateDefaultTimeSlots(events2) {
21195
21225
  }
21196
21226
  return slots;
21197
21227
  }
21198
- function eventInSlot(event, day, slotTime) {
21199
- const eventStart = new Date(event.startTime);
21228
+ function eventInSlot(event, day, slotTime, startField) {
21229
+ const eventStart = eventStartDate(event, startField);
21200
21230
  if (Number.isNaN(eventStart.getTime())) return false;
21201
21231
  const [slotHour] = slotTime.split(":").map(Number);
21202
21232
  return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour;
@@ -21213,7 +21243,12 @@ function CalendarGrid({
21213
21243
  longPressPayload,
21214
21244
  swipeLeftEvent,
21215
21245
  swipeRightEvent,
21216
- dayWindow = "auto"
21246
+ dayWindow = "auto",
21247
+ titleField = "title",
21248
+ startField = "startTime",
21249
+ colorField = "color",
21250
+ children,
21251
+ renderItem
21217
21252
  }) {
21218
21253
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
21219
21254
  const eventBus = useEventBus();
@@ -21228,8 +21263,8 @@ function CalendarGrid({
21228
21263
  [resolvedWeekStart]
21229
21264
  );
21230
21265
  const resolvedTimeSlots = useMemo(
21231
- () => timeSlots ?? generateDefaultTimeSlots(evs),
21232
- [timeSlots, evs]
21266
+ () => timeSlots ?? generateDefaultTimeSlots(evs, startField),
21267
+ [timeSlots, evs, startField]
21233
21268
  );
21234
21269
  const visibleCount = useDayWindow(dayWindow);
21235
21270
  const [dayOffset, setDayOffset] = useState(0);
@@ -21266,9 +21301,9 @@ function CalendarGrid({
21266
21301
  );
21267
21302
  const eventsForDayCount = useCallback(
21268
21303
  (day) => evs.filter(
21269
- (ev) => new Date(ev.startTime).toDateString() === day.toDateString()
21304
+ (ev) => eventStartDate(ev, startField).toDateString() === day.toDateString()
21270
21305
  ).length,
21271
- [events2]
21306
+ [events2, startField]
21272
21307
  );
21273
21308
  const swipeCallbacks = useMemo(() => ({
21274
21309
  onSwipeLeft: swipeLeftEvent ? () => eventBus.emit(`UI:${swipeLeftEvent}`, {}) : void 0,
@@ -21287,8 +21322,11 @@ function CalendarGrid({
21287
21322
  eventBus.emit(`UI:${longPressEvent}`, { date: day.toISOString(), time, ...longPressPayload });
21288
21323
  }, 500);
21289
21324
  }, [longPressEvent, longPressPayload, eventBus]);
21325
+ const renderChip = children ?? renderItem;
21290
21326
  const renderEvent = (event) => {
21291
- const color = event.color;
21327
+ const color = getNestedValue(event, colorField);
21328
+ const label = String(getNestedValue(event, titleField) ?? "");
21329
+ const eventIndex = evs.indexOf(event);
21292
21330
  return /* @__PURE__ */ jsx(
21293
21331
  Box,
21294
21332
  {
@@ -21300,7 +21338,7 @@ function CalendarGrid({
21300
21338
  color ? color : "bg-primary/10 border-primary/30 text-primary"
21301
21339
  ),
21302
21340
  onClick: (e) => handleEventClick(event, e),
21303
- children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
21341
+ children: renderChip ? renderChip(event, eventIndex) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: label })
21304
21342
  },
21305
21343
  event.id
21306
21344
  );
@@ -21384,7 +21422,7 @@ function CalendarGrid({
21384
21422
  ) }),
21385
21423
  visibleDays.map((day) => {
21386
21424
  const slotEvents = evs.filter(
21387
- (ev) => eventInSlot(ev, day, time)
21425
+ (ev) => eventInSlot(ev, day, time, startField)
21388
21426
  );
21389
21427
  const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
21390
21428
  return /* @__PURE__ */ jsx(
@@ -21421,6 +21459,7 @@ var init_CalendarGrid = __esm({
21421
21459
  "components/core/molecules/CalendarGrid.tsx"() {
21422
21460
  "use client";
21423
21461
  init_cn();
21462
+ init_getNestedValue();
21424
21463
  init_Box();
21425
21464
  init_Button();
21426
21465
  init_Stack();
@@ -21437,32 +21476,6 @@ var init_CalendarGrid = __esm({
21437
21476
  CalendarGrid.displayName = "CalendarGrid";
21438
21477
  }
21439
21478
  });
21440
-
21441
- // lib/getNestedValue.ts
21442
- function getNestedValue(obj, path) {
21443
- if (obj === null || obj === void 0 || !path) {
21444
- return void 0;
21445
- }
21446
- if (!path.includes(".")) {
21447
- return obj[path];
21448
- }
21449
- const parts = path.split(".");
21450
- let value = obj;
21451
- for (const part of parts) {
21452
- if (value === null || value === void 0) {
21453
- return void 0;
21454
- }
21455
- if (typeof value !== "object" || Array.isArray(value)) {
21456
- return void 0;
21457
- }
21458
- value = value[part];
21459
- }
21460
- return value;
21461
- }
21462
- var init_getNestedValue = __esm({
21463
- "lib/getNestedValue.ts"() {
21464
- }
21465
- });
21466
21479
  var Pagination;
21467
21480
  var init_Pagination = __esm({
21468
21481
  "components/core/molecules/Pagination.tsx"() {
@@ -51215,7 +51228,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51215
51228
  crossTraitLog.debug("listen:fired", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
51216
51229
  enqueueAndDrain(
51217
51230
  listen.triggers,
51218
- applyListenPayloadMapping(listen.payloadMapping, event.payload),
51231
+ applyListenPayloadMapping(listen.payloadMapping, event.payload, evaluateListenPayloadExpr),
51219
51232
  binding.trait.name
51220
51233
  );
51221
51234
  });
@@ -14488,6 +14488,32 @@ var init_ButtonGroup = __esm({
14488
14488
  exports.ButtonGroup.displayName = "ButtonGroup";
14489
14489
  }
14490
14490
  });
14491
+
14492
+ // lib/getNestedValue.ts
14493
+ function getNestedValue(obj, path) {
14494
+ if (obj === null || obj === void 0 || !path) {
14495
+ return void 0;
14496
+ }
14497
+ if (!path.includes(".")) {
14498
+ return obj[path];
14499
+ }
14500
+ const parts = path.split(".");
14501
+ let value = obj;
14502
+ for (const part of parts) {
14503
+ if (value === null || value === void 0) {
14504
+ return void 0;
14505
+ }
14506
+ if (typeof value !== "object" || Array.isArray(value)) {
14507
+ return void 0;
14508
+ }
14509
+ value = value[part];
14510
+ }
14511
+ return value;
14512
+ }
14513
+ var init_getNestedValue = __esm({
14514
+ "lib/getNestedValue.ts"() {
14515
+ }
14516
+ });
14491
14517
  function useSwipeGesture(callbacks, options = {}) {
14492
14518
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
14493
14519
  const startX = React74.useRef(0);
@@ -14601,11 +14627,15 @@ function getWeekDays(start) {
14601
14627
  }
14602
14628
  return days;
14603
14629
  }
14604
- function generateDefaultTimeSlots(events2) {
14630
+ function eventStartDate(event, startField) {
14631
+ const raw = getNestedValue(event, startField);
14632
+ return new Date(raw ?? "");
14633
+ }
14634
+ function generateDefaultTimeSlots(events2, startField) {
14605
14635
  let first = DEFAULT_FIRST_HOUR;
14606
14636
  let last = DEFAULT_LAST_HOUR;
14607
14637
  for (const ev of events2) {
14608
- const start = new Date(ev.startTime);
14638
+ const start = eventStartDate(ev, startField);
14609
14639
  if (Number.isNaN(start.getTime())) continue;
14610
14640
  const hour = start.getHours();
14611
14641
  if (hour < first) first = hour;
@@ -14617,8 +14647,8 @@ function generateDefaultTimeSlots(events2) {
14617
14647
  }
14618
14648
  return slots;
14619
14649
  }
14620
- function eventInSlot(event, day, slotTime) {
14621
- const eventStart = new Date(event.startTime);
14650
+ function eventInSlot(event, day, slotTime, startField) {
14651
+ const eventStart = eventStartDate(event, startField);
14622
14652
  if (Number.isNaN(eventStart.getTime())) return false;
14623
14653
  const [slotHour] = slotTime.split(":").map(Number);
14624
14654
  return eventStart.toDateString() === day.toDateString() && eventStart.getHours() === slotHour;
@@ -14635,7 +14665,12 @@ function CalendarGrid({
14635
14665
  longPressPayload,
14636
14666
  swipeLeftEvent,
14637
14667
  swipeRightEvent,
14638
- dayWindow = "auto"
14668
+ dayWindow = "auto",
14669
+ titleField = "title",
14670
+ startField = "startTime",
14671
+ colorField = "color",
14672
+ children,
14673
+ renderItem
14639
14674
  }) {
14640
14675
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
14641
14676
  const eventBus = useEventBus();
@@ -14650,8 +14685,8 @@ function CalendarGrid({
14650
14685
  [resolvedWeekStart]
14651
14686
  );
14652
14687
  const resolvedTimeSlots = React74.useMemo(
14653
- () => timeSlots ?? generateDefaultTimeSlots(evs),
14654
- [timeSlots, evs]
14688
+ () => timeSlots ?? generateDefaultTimeSlots(evs, startField),
14689
+ [timeSlots, evs, startField]
14655
14690
  );
14656
14691
  const visibleCount = useDayWindow(dayWindow);
14657
14692
  const [dayOffset, setDayOffset] = React74.useState(0);
@@ -14688,9 +14723,9 @@ function CalendarGrid({
14688
14723
  );
14689
14724
  const eventsForDayCount = React74.useCallback(
14690
14725
  (day) => evs.filter(
14691
- (ev) => new Date(ev.startTime).toDateString() === day.toDateString()
14726
+ (ev) => eventStartDate(ev, startField).toDateString() === day.toDateString()
14692
14727
  ).length,
14693
- [events2]
14728
+ [events2, startField]
14694
14729
  );
14695
14730
  const swipeCallbacks = React74.useMemo(() => ({
14696
14731
  onSwipeLeft: swipeLeftEvent ? () => eventBus.emit(`UI:${swipeLeftEvent}`, {}) : void 0,
@@ -14709,8 +14744,11 @@ function CalendarGrid({
14709
14744
  eventBus.emit(`UI:${longPressEvent}`, { date: day.toISOString(), time, ...longPressPayload });
14710
14745
  }, 500);
14711
14746
  }, [longPressEvent, longPressPayload, eventBus]);
14747
+ const renderChip = children ?? renderItem;
14712
14748
  const renderEvent = (event) => {
14713
- const color = event.color;
14749
+ const color = getNestedValue(event, colorField);
14750
+ const label = String(getNestedValue(event, titleField) ?? "");
14751
+ const eventIndex = evs.indexOf(event);
14714
14752
  return /* @__PURE__ */ jsxRuntime.jsx(
14715
14753
  exports.Box,
14716
14754
  {
@@ -14722,7 +14760,7 @@ function CalendarGrid({
14722
14760
  color ? color : "bg-primary/10 border-primary/30 text-primary"
14723
14761
  ),
14724
14762
  onClick: (e) => handleEventClick(event, e),
14725
- children: /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", className: "truncate font-medium", children: event.title })
14763
+ children: renderChip ? renderChip(event, eventIndex) : /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", className: "truncate font-medium", children: label })
14726
14764
  },
14727
14765
  event.id
14728
14766
  );
@@ -14806,7 +14844,7 @@ function CalendarGrid({
14806
14844
  ) }),
14807
14845
  visibleDays.map((day) => {
14808
14846
  const slotEvents = evs.filter(
14809
- (ev) => eventInSlot(ev, day, time)
14847
+ (ev) => eventInSlot(ev, day, time, startField)
14810
14848
  );
14811
14849
  const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
14812
14850
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -14843,6 +14881,7 @@ var init_CalendarGrid = __esm({
14843
14881
  "components/core/molecules/CalendarGrid.tsx"() {
14844
14882
  "use client";
14845
14883
  init_cn();
14884
+ init_getNestedValue();
14846
14885
  init_Box();
14847
14886
  init_Button();
14848
14887
  init_Stack();
@@ -16454,32 +16493,6 @@ var init_Canvas = __esm({
16454
16493
  Canvas.displayName = "Canvas";
16455
16494
  }
16456
16495
  });
16457
-
16458
- // lib/getNestedValue.ts
16459
- function getNestedValue(obj, path) {
16460
- if (obj === null || obj === void 0 || !path) {
16461
- return void 0;
16462
- }
16463
- if (!path.includes(".")) {
16464
- return obj[path];
16465
- }
16466
- const parts = path.split(".");
16467
- let value = obj;
16468
- for (const part of parts) {
16469
- if (value === null || value === void 0) {
16470
- return void 0;
16471
- }
16472
- if (typeof value !== "object" || Array.isArray(value)) {
16473
- return void 0;
16474
- }
16475
- value = value[part];
16476
- }
16477
- return value;
16478
- }
16479
- var init_getNestedValue = __esm({
16480
- "lib/getNestedValue.ts"() {
16481
- }
16482
- });
16483
16496
  exports.Pagination = void 0;
16484
16497
  var init_Pagination = __esm({
16485
16498
  "components/core/molecules/Pagination.tsx"() {
@@ -5307,8 +5307,34 @@ interface CalendarGridProps {
5307
5307
  * layouts or screenshot tests).
5308
5308
  */
5309
5309
  dayWindow?: CalendarDayWindow | 'auto';
5310
+ /**
5311
+ * Row field holding the chip label. Defaults to `title`. Lets a host bound
5312
+ * to its own entity name the column instead of being forced to rename its
5313
+ * fields to this grid's contract (same accessor idiom as `DataList`'s
5314
+ * `senderField` / `DataGrid`'s `imageField`).
5315
+ */
5316
+ titleField?: string;
5317
+ /** Row field holding the start timestamp (ISO or epoch). Defaults to `startTime`. */
5318
+ startField?: string;
5319
+ /** Row field holding the chip's Tailwind colour class. Defaults to `color`. */
5320
+ colorField?: string;
5321
+ /**
5322
+ * Render function for one event chip's content. Receives the row and its
5323
+ * index in the materialised events array. The grid keeps ownership of
5324
+ * placement, colour and the click target; this replaces only what is drawn
5325
+ * INSIDE the chip, so a host can show a time + instructor + badge stack
5326
+ * instead of the default single label.
5327
+ */
5328
+ children?: (item: EntityRow, index: number) => React__default.ReactNode;
5329
+ /**
5330
+ * Per-event render function (schema-level alias for the children render
5331
+ * prop). In `.orb`: `["fn", "item", { pattern tree with @item.field bindings }]`.
5332
+ * In `.lolo`: `renderItem: (fn item <Component …={@item.field}/>)` — the same
5333
+ * contract `data-list` / `data-grid` / `carousel` already use.
5334
+ */
5335
+ renderItem?: (item: EntityRow, index: number) => React__default.ReactNode;
5310
5336
  }
5311
- declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, dayWindow, }: CalendarGridProps): React__default.JSX.Element;
5337
+ declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, dayWindow, titleField, startField, colorField, children, renderItem, }: CalendarGridProps): React__default.JSX.Element;
5312
5338
  declare namespace CalendarGrid {
5313
5339
  var displayName: string;
5314
5340
  }
@@ -5307,8 +5307,34 @@ interface CalendarGridProps {
5307
5307
  * layouts or screenshot tests).
5308
5308
  */
5309
5309
  dayWindow?: CalendarDayWindow | 'auto';
5310
+ /**
5311
+ * Row field holding the chip label. Defaults to `title`. Lets a host bound
5312
+ * to its own entity name the column instead of being forced to rename its
5313
+ * fields to this grid's contract (same accessor idiom as `DataList`'s
5314
+ * `senderField` / `DataGrid`'s `imageField`).
5315
+ */
5316
+ titleField?: string;
5317
+ /** Row field holding the start timestamp (ISO or epoch). Defaults to `startTime`. */
5318
+ startField?: string;
5319
+ /** Row field holding the chip's Tailwind colour class. Defaults to `color`. */
5320
+ colorField?: string;
5321
+ /**
5322
+ * Render function for one event chip's content. Receives the row and its
5323
+ * index in the materialised events array. The grid keeps ownership of
5324
+ * placement, colour and the click target; this replaces only what is drawn
5325
+ * INSIDE the chip, so a host can show a time + instructor + badge stack
5326
+ * instead of the default single label.
5327
+ */
5328
+ children?: (item: EntityRow, index: number) => React__default.ReactNode;
5329
+ /**
5330
+ * Per-event render function (schema-level alias for the children render
5331
+ * prop). In `.orb`: `["fn", "item", { pattern tree with @item.field bindings }]`.
5332
+ * In `.lolo`: `renderItem: (fn item <Component …={@item.field}/>)` — the same
5333
+ * contract `data-list` / `data-grid` / `carousel` already use.
5334
+ */
5335
+ renderItem?: (item: EntityRow, index: number) => React__default.ReactNode;
5310
5336
  }
5311
- declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, dayWindow, }: CalendarGridProps): React__default.JSX.Element;
5337
+ declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, dayWindow, titleField, startField, colorField, children, renderItem, }: CalendarGridProps): React__default.JSX.Element;
5312
5338
  declare namespace CalendarGrid {
5313
5339
  var displayName: string;
5314
5340
  }