myoperator-ui 0.0.114 → 0.0.116
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/dist/index.js +34 -36
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5276,14 +5276,12 @@ export const EventGroupComponent = React.forwardRef<
|
|
|
5276
5276
|
onSelectionChange,
|
|
5277
5277
|
emptyGroupMessage = "No events available",
|
|
5278
5278
|
renderEmptyGroup,
|
|
5279
|
+
defaultExpanded = false,
|
|
5279
5280
|
className,
|
|
5280
5281
|
...props
|
|
5281
5282
|
},
|
|
5282
5283
|
ref
|
|
5283
5284
|
) => {
|
|
5284
|
-
// Track accordion open/closed state explicitly to survive re-renders
|
|
5285
|
-
const [isAccordionOpen, setIsAccordionOpen] = React.useState(true);
|
|
5286
|
-
|
|
5287
5285
|
// Calculate selection state for this group
|
|
5288
5286
|
const groupEventIds = events.map((e) => e.id);
|
|
5289
5287
|
const selectedInGroup = groupEventIds.filter((id) =>
|
|
@@ -5362,43 +5360,41 @@ export const EventGroupComponent = React.forwardRef<
|
|
|
5362
5360
|
// Multiple events: render as collapsible accordion
|
|
5363
5361
|
return (
|
|
5364
5362
|
<div ref={ref} className={cn("bg-white", className)} {...props}>
|
|
5365
|
-
<Accordion
|
|
5366
|
-
type="multiple"
|
|
5367
|
-
value={isAccordionOpen ? [group.id] : []}
|
|
5368
|
-
onValueChange={(values) => setIsAccordionOpen(values.includes(group.id))}
|
|
5369
|
-
>
|
|
5363
|
+
<Accordion type="multiple" defaultValue={defaultExpanded ? [group.id] : []}>
|
|
5370
5364
|
<AccordionItem value={group.id}>
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
<div className="flex
|
|
5383
|
-
<div className="flex items-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5365
|
+
{/* Header row with checkbox OUTSIDE the trigger button to avoid nested buttons */}
|
|
5366
|
+
<div className="flex items-center gap-3 p-4 hover:bg-[#F9FAFB]">
|
|
5367
|
+
<Checkbox
|
|
5368
|
+
checked={checkboxState}
|
|
5369
|
+
onCheckedChange={handleGroupCheckbox}
|
|
5370
|
+
aria-label={\`Select all \${group.name}\`}
|
|
5371
|
+
/>
|
|
5372
|
+
<AccordionTrigger
|
|
5373
|
+
showChevron={true}
|
|
5374
|
+
className="flex-1 p-0 hover:bg-transparent"
|
|
5375
|
+
>
|
|
5376
|
+
<div className="flex items-center gap-3 flex-1">
|
|
5377
|
+
<div className="flex flex-col items-start text-left flex-1 min-w-0">
|
|
5378
|
+
<div className="flex items-center gap-2">
|
|
5379
|
+
{group.icon && (
|
|
5380
|
+
<span className="text-[#6B7280]">{group.icon}</span>
|
|
5381
|
+
)}
|
|
5382
|
+
<span className="font-medium text-[#333333]">
|
|
5383
|
+
{group.name}
|
|
5384
|
+
</span>
|
|
5385
|
+
</div>
|
|
5386
|
+
<span className="text-sm text-[#6B7280] mt-0.5">
|
|
5387
|
+
{group.description}
|
|
5389
5388
|
</span>
|
|
5390
5389
|
</div>
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5390
|
+
{selectedCount > 0 && (
|
|
5391
|
+
<span className="text-sm text-[#6B7280] whitespace-nowrap">
|
|
5392
|
+
{selectedCount} Selected
|
|
5393
|
+
</span>
|
|
5394
|
+
)}
|
|
5394
5395
|
</div>
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
{selectedCount} Selected
|
|
5398
|
-
</span>
|
|
5399
|
-
)}
|
|
5400
|
-
</div>
|
|
5401
|
-
</AccordionTrigger>
|
|
5396
|
+
</AccordionTrigger>
|
|
5397
|
+
</div>
|
|
5402
5398
|
<AccordionContent>
|
|
5403
5399
|
<div className="border-t border-[#E5E7EB]">
|
|
5404
5400
|
{events.length > 0 ? (
|
|
@@ -5566,6 +5562,8 @@ export interface EventGroupComponentProps {
|
|
|
5566
5562
|
emptyGroupMessage?: string
|
|
5567
5563
|
/** Custom render function for empty group state */
|
|
5568
5564
|
renderEmptyGroup?: (group: EventGroup) => React.ReactNode
|
|
5565
|
+
/** Whether the accordion should be expanded by default (default: false) */
|
|
5566
|
+
defaultExpanded?: boolean
|
|
5569
5567
|
}
|
|
5570
5568
|
|
|
5571
5569
|
/**
|