@postxl/generators 1.0.9 → 1.0.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/dist/frontend-admin/generators/admin-sidebar.generator.js +7 -12
- package/dist/frontend-admin/generators/admin-sidebar.generator.js.map +1 -1
- package/dist/frontend-admin/generators/audit-log-sidebar.generator.js +36 -53
- package/dist/frontend-admin/generators/audit-log-sidebar.generator.js.map +1 -1
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/checkbox-cell.tsx +3 -3
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/date-cell.tsx +1 -2
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/long-text-cell.tsx +1 -0
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/multi-select-cell.tsx +5 -9
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/number-cell.tsx +5 -3
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/react-node-cell.tsx +2 -1
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/select-cell.tsx +4 -4
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/short-text-cell.tsx +4 -3
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/utils/gantt-timeline.tsx +6 -5
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-cell-wrapper.tsx +2 -2
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-cell.tsx +7 -6
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-column-header.tsx +13 -20
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-row.tsx +2 -2
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-search.tsx +2 -2
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-utils.ts +3 -14
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-view-menu.tsx +3 -3
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid.tsx +6 -6
- package/dist/frontend-core/template/src/components/ui/data-grid/styles.css +3 -0
- package/dist/frontend-core/template/src/components/ui/data-table/data-table.tsx +11 -12
- package/dist/frontend-core/template/src/context-providers/theme-context-provider.tsx +52 -67
- package/dist/frontend-core/template/src/main.tsx +1 -1
- package/dist/frontend-core/template/src/pages/dashboard/dashboard.page.tsx +4 -4
- package/dist/frontend-core/template/src/styles/styles.css +102 -2
- package/dist/frontend-core/template/src/styles/theme-default.css +108 -178
- package/dist/frontend-trpc-client/generators/model-hook.generator.js +3 -11
- package/dist/frontend-trpc-client/generators/model-hook.generator.js.map +1 -1
- package/dist/frontend-trpc-client/trpc-client.generator.d.ts +1 -7
- package/dist/frontend-trpc-client/trpc-client.generator.js +1 -6
- package/dist/frontend-trpc-client/trpc-client.generator.js.map +1 -1
- package/package.json +1 -1
|
@@ -116,7 +116,7 @@ export function AdminSidebar() {
|
|
|
116
116
|
{/* Mobile toggle button */}
|
|
117
117
|
<button
|
|
118
118
|
onClick={() => setIsOpen(!isOpen)}
|
|
119
|
-
className="fixed top-4 left-4 z-50 md:hidden p-2 bg-
|
|
119
|
+
className="fixed top-4 left-4 z-50 md:hidden p-2 bg-sidebar rounded shadow-lg border border-sidebar-border"
|
|
120
120
|
aria-label="Toggle admin menu"
|
|
121
121
|
>
|
|
122
122
|
{isOpen ? <ChevronDownIcon className="w-6 h-6" /> : <ChevronRightIcon className="w-6 h-6" />}
|
|
@@ -125,7 +125,7 @@ export function AdminSidebar() {
|
|
|
125
125
|
{/* Sidebar */}
|
|
126
126
|
<aside
|
|
127
127
|
className={\`
|
|
128
|
-
fixed md:sticky top-0 left-0 h-screen bg-
|
|
128
|
+
fixed md:sticky top-0 left-0 h-screen bg-sidebar border-r border-sidebar-border
|
|
129
129
|
overflow-y-auto transition-all duration-300 z-40
|
|
130
130
|
\${isOpen ? 'translate-x-0' : '-translate-x-full md:translate-x-0'}
|
|
131
131
|
\${isCollapsed ? 'w-16 min-w-16' : 'w-64 min-w-64'}
|
|
@@ -134,13 +134,13 @@ export function AdminSidebar() {
|
|
|
134
134
|
<div className="p-4">
|
|
135
135
|
<div className="flex items-center justify-between mb-4">
|
|
136
136
|
{!isCollapsed && (
|
|
137
|
-
<Link to="/admin" className="text-lg font-bold hover:text-
|
|
137
|
+
<Link to="/admin" className="text-lg font-bold hover:text-sidebar-primary transition-colors">
|
|
138
138
|
Admin
|
|
139
139
|
</Link>
|
|
140
140
|
)}
|
|
141
141
|
<button
|
|
142
142
|
onClick={() => setIsCollapsed(!isCollapsed)}
|
|
143
|
-
className="hidden md:block p-1 hover:bg-
|
|
143
|
+
className="hidden md:block p-1 hover:bg-sidebar-accent rounded transition-colors ml-auto"
|
|
144
144
|
aria-label={isCollapsed ? 'Expand sidebar' : 'Collapse sidebar'}
|
|
145
145
|
>
|
|
146
146
|
{isCollapsed ? <ChevronRightIcon className="w-5 h-5" /> : <ChevronLeftIcon className="w-5 h-5" />}
|
|
@@ -153,7 +153,7 @@ export function AdminSidebar() {
|
|
|
153
153
|
<div key="Advanced" className="mb-4">
|
|
154
154
|
<button
|
|
155
155
|
onClick={() => toggleSchema('Advanced')}
|
|
156
|
-
className="flex items-center justify-between w-full px-4 py-2 font-semibold text-left hover:bg-
|
|
156
|
+
className="flex items-center justify-between w-full px-4 py-2 font-semibold text-left hover:bg-sidebar-accent rounded transition-colors"
|
|
157
157
|
>
|
|
158
158
|
<span>Advanced</span>
|
|
159
159
|
{expandedSchemas['Advanced'] ? (
|
|
@@ -167,7 +167,7 @@ export function AdminSidebar() {
|
|
|
167
167
|
<li key="DataManagement">
|
|
168
168
|
<Link
|
|
169
169
|
to="/admin/data-management"
|
|
170
|
-
className="block px-4 py-2 hover:bg-
|
|
170
|
+
className="block px-4 py-2 hover:bg-sidebar-accent rounded transition-colors"
|
|
171
171
|
>
|
|
172
172
|
Data Management
|
|
173
173
|
</Link>
|
|
@@ -182,12 +182,7 @@ export function AdminSidebar() {
|
|
|
182
182
|
</aside>
|
|
183
183
|
|
|
184
184
|
{/* Overlay for mobile */}
|
|
185
|
-
{isOpen && (
|
|
186
|
-
<div
|
|
187
|
-
className="fixed inset-0 bg-black/20 z-30 md:hidden"
|
|
188
|
-
onClick={() => setIsOpen(false)}
|
|
189
|
-
/>
|
|
190
|
-
)}
|
|
185
|
+
{isOpen && <div className="fixed inset-0 bg-sidebar/20 z-30 md:hidden" onClick={() => setIsOpen(false)} />}
|
|
191
186
|
</>
|
|
192
187
|
)
|
|
193
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-sidebar.generator.js","sourceRoot":"","sources":["../../../src/frontend-admin/generators/admin-sidebar.generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"admin-sidebar.generator.js","sourceRoot":"","sources":["../../../src/frontend-admin/generators/admin-sidebar.generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,oDA0JC;AAlKD,6DAA8C;AAG9C,oCAAqD;AAErD;;GAEG;AACH,SAAgB,oBAAoB,CAAC,EAAE,OAAO,EAA8B;IAC1E,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe;QACvC,EAAE;SACD,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,CAAC;SACjE,SAAS,CAAC;QACT,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC;QACtC,KAAK,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;KAC9C,CAAC;SACD,SAAS,CAAC;QACT,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,uBAAuB,CAAC;QACtD,KAAK,EAAE;YACL,SAAS,CAAC,cAAc,CAAC,kBAAkB,CAAC;YAC5C,SAAS,CAAC,cAAc,CAAC,iBAAiB,CAAC;YAC3C,SAAS,CAAC,cAAc,CAAC,iBAAiB,CAAC;SAC5C;KACF,CAAC,CAAA;IAEJ,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAA;IAEtF,+BAA+B;IAC/B,MAAM,cAAc,GAAG,aAAa;SACjC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,CAAA;QAC1C,MAAM,UAAU,GAAG,MAAM;aACtB,GAAG,CACF,CAAC,KAAK,EAAE,EAAE,CAAC;qBACA,KAAK,CAAC,IAAI;;oBAEX,KAAK,CAAC,KAAK;;;gBAGf,KAAK,CAAC,gBAAgB;;gBAEtB,CACP;aACA,IAAI,CAAC,EAAE,CAAC,CAAA;QAEX,OAAO;gBACG,MAAM;;uCAEiB,MAAM;;;gBAG7B,MAAM;4BACM,MAAM;;;;;;0BAMR,MAAM;;YAEpB,UAAU;;;WAGX,CAAA;IACP,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAA;IAEX,OAAO;;EAEP,OAAO,CAAC,QAAQ,EAAE;;;;;;MAMd,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAgDxD,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC7B,CAAA;AACD,CAAC"}
|
|
@@ -264,8 +264,8 @@ function ExpandedChangesList({ changedFields }: Readonly<{ changedFields: Readon
|
|
|
264
264
|
<div className="px-3 pb-3">
|
|
265
265
|
<div className="mt-2 space-y-2">
|
|
266
266
|
{changedFields.map((change) => (
|
|
267
|
-
<div key={change.field} className="text-xs bg-
|
|
268
|
-
<div className="font-medium text-
|
|
267
|
+
<div key={change.field} className="text-xs bg-sidebar rounded p-2">
|
|
268
|
+
<div className="font-medium text-sidebar-accent-foreground mb-1">
|
|
269
269
|
{change.field}
|
|
270
270
|
</div>
|
|
271
271
|
<div className="flex flex-col gap-0.5">
|
|
@@ -303,29 +303,27 @@ function AuditLogEntryCard({ entry, isExpanded, onToggle }: AuditLogEntryCardPro
|
|
|
303
303
|
const showExpandedContent = isExpanded && hasChanges && !isUpdateField
|
|
304
304
|
|
|
305
305
|
return (
|
|
306
|
-
<div className="border-b border-
|
|
306
|
+
<div className="border-b border-sidebar-border last:border-b-0">
|
|
307
307
|
<button
|
|
308
308
|
onClick={onToggle}
|
|
309
|
-
className={\`w-full p-3 text-left
|
|
309
|
+
className={\`w-full p-3 text-left bg-sidebar-accent transition-colors \${showExpandButton ? '' : 'cursor-default'}\`}
|
|
310
310
|
disabled={!showExpandButton}
|
|
311
311
|
>
|
|
312
312
|
<div className="flex items-start justify-between gap-2">
|
|
313
313
|
<div className="flex-1 min-w-0">
|
|
314
314
|
<div className="flex items-center gap-2">
|
|
315
|
-
<span
|
|
315
|
+
<span
|
|
316
|
+
className={\`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium \${getMutationKindClasses(entry.mutationKind)}\`}
|
|
317
|
+
>
|
|
316
318
|
{actionLabel}
|
|
317
319
|
</span>
|
|
318
|
-
{inlineChange &&
|
|
319
|
-
<span className="text-xs text-gray-500 dark:text-gray-400">
|
|
320
|
-
{inlineChange.field}
|
|
321
|
-
</span>
|
|
322
|
-
)}
|
|
320
|
+
{inlineChange && <span className="text-xs text-muted-foreground">{inlineChange.field}</span>}
|
|
323
321
|
</div>
|
|
324
|
-
<p className="mt-1 text-sm text-
|
|
322
|
+
<p className="mt-1 text-sm text-sidebar-foreground truncate">
|
|
325
323
|
{entry.entityLabel || entry.entityId || 'Unknown entity'}
|
|
326
324
|
</p>
|
|
327
325
|
{inlineChange && <InlineChangeDisplay change={inlineChange} />}
|
|
328
|
-
<div className="mt-1 flex items-center gap-3 text-xs text-
|
|
326
|
+
<div className="mt-1 flex items-center gap-3 text-xs text-muted-foreground">
|
|
329
327
|
<span className="flex items-center gap-1">
|
|
330
328
|
<ClockIcon className="w-3 h-3" />
|
|
331
329
|
{formatDate(entry.createdAt)}
|
|
@@ -340,12 +338,11 @@ function AuditLogEntryCard({ entry, isExpanded, onToggle }: AuditLogEntryCardPro
|
|
|
340
338
|
</div>
|
|
341
339
|
{showExpandButton && (
|
|
342
340
|
<ChevronRightIcon
|
|
343
|
-
className={\`w-4 h-4 text-
|
|
341
|
+
className={\`w-4 h-4 text-muted-foreground transition-transform \${isExpanded ? 'rotate-90' : ''}\`}
|
|
344
342
|
/>
|
|
345
343
|
)}
|
|
346
344
|
</div>
|
|
347
345
|
</button>
|
|
348
|
-
|
|
349
346
|
{showExpandedContent && <ExpandedChangesList changedFields={entry.changedFields} />}
|
|
350
347
|
</div>
|
|
351
348
|
)
|
|
@@ -374,34 +371,26 @@ function BreadcrumbNavigation({
|
|
|
374
371
|
const entityCountText = getEntityCountText(entityCount)
|
|
375
372
|
|
|
376
373
|
return (
|
|
377
|
-
<div className="px-4 py-2 border-b border-
|
|
378
|
-
<button
|
|
379
|
-
onClick={onClearEntity}
|
|
380
|
-
className="text-blue-600 dark:text-blue-400 hover:underline"
|
|
381
|
-
>
|
|
374
|
+
<div className="px-4 py-2 border-b border-sidebar-border flex items-center gap-1 text-xs">
|
|
375
|
+
<button onClick={onClearEntity} className="text-sidebar-primary hover:underline">
|
|
382
376
|
All {model}s
|
|
383
377
|
</button>
|
|
384
378
|
{hasEntityFilter && (
|
|
385
379
|
<>
|
|
386
|
-
<ChevronRightIcon className="w-3 h-3 text-
|
|
380
|
+
<ChevronRightIcon className="w-3 h-3 text-muted-foreground" />
|
|
387
381
|
{hasFieldFilter ? (
|
|
388
|
-
<button
|
|
389
|
-
onClick={onClearField}
|
|
390
|
-
className="text-blue-600 dark:text-blue-400 hover:underline"
|
|
391
|
-
>
|
|
382
|
+
<button onClick={onClearField} className="text-sidebar-primary hover:underline">
|
|
392
383
|
{entityCountText}
|
|
393
384
|
</button>
|
|
394
385
|
) : (
|
|
395
|
-
<span className="text-
|
|
396
|
-
{entityCountText}
|
|
397
|
-
</span>
|
|
386
|
+
<span className="text-sidebar-accent-foreground">{entityCountText}</span>
|
|
398
387
|
)}
|
|
399
388
|
</>
|
|
400
389
|
)}
|
|
401
390
|
{hasFieldFilter && (
|
|
402
391
|
<>
|
|
403
|
-
<ChevronRightIcon className="w-3 h-3 text-
|
|
404
|
-
<span className="text-
|
|
392
|
+
<ChevronRightIcon className="w-3 h-3 text-muted-foreground" />
|
|
393
|
+
<span className="text-sidebar-accent-foreground">{field}</span>
|
|
405
394
|
</>
|
|
406
395
|
)}
|
|
407
396
|
</div>
|
|
@@ -502,57 +491,52 @@ export function AuditLogSidebar({ model, entityId, entityIds, field, labelField:
|
|
|
502
491
|
className={\`
|
|
503
492
|
fixed right-0 top-1/2 -translate-y-1/2 z-40
|
|
504
493
|
flex items-center justify-center
|
|
505
|
-
w-6 h-24 bg-
|
|
506
|
-
border border-r-0 border-
|
|
494
|
+
w-6 h-24 bg-sidebar
|
|
495
|
+
border border-r-0 border-sidebar-border
|
|
507
496
|
rounded-l-lg shadow-lg
|
|
508
|
-
hover:bg-
|
|
497
|
+
hover:bg-sidebar-accent
|
|
509
498
|
transition-colors
|
|
510
499
|
\${isOpen ? 'right-80' : 'right-0'}
|
|
511
500
|
\`}
|
|
512
501
|
aria-label={isOpen ? 'Close audit log' : 'Open audit log'}
|
|
513
502
|
>
|
|
514
503
|
{isOpen ? (
|
|
515
|
-
<ChevronRightIcon className="w-4 h-4 text-
|
|
504
|
+
<ChevronRightIcon className="w-4 h-4 text-sidebar-accent-foreground" />
|
|
516
505
|
) : (
|
|
517
|
-
<ChevronLeftIcon className="w-4 h-4 text-
|
|
506
|
+
<ChevronLeftIcon className="w-4 h-4 text-sidebar-accent-foreground" />
|
|
518
507
|
)}
|
|
519
508
|
</button>
|
|
520
509
|
|
|
521
510
|
{/* Sidebar */}
|
|
522
511
|
<aside
|
|
523
512
|
className={\`
|
|
524
|
-
fixed right-0 top-0 h-screen w-80 bg-
|
|
525
|
-
border-l border-
|
|
513
|
+
fixed right-0 top-0 h-screen w-80 bg-sidebar
|
|
514
|
+
border-l border-sidebar-border
|
|
526
515
|
overflow-hidden transition-transform duration-300 z-30
|
|
527
516
|
\${isOpen ? 'translate-x-0' : 'translate-x-full'}
|
|
528
517
|
\`}
|
|
529
518
|
>
|
|
530
519
|
<div className="flex flex-col h-full">
|
|
531
520
|
{/* Header */}
|
|
532
|
-
<div className="p-4 border-b border-
|
|
521
|
+
<div className="p-4 border-b border-sidebar-border">
|
|
533
522
|
<div className="flex items-center justify-between">
|
|
534
|
-
<h3 className="text-lg font-semibold text-
|
|
535
|
-
Audit Log
|
|
536
|
-
</h3>
|
|
523
|
+
<h3 className="text-lg font-semibold text-sidebar-foreground">Audit Log</h3>
|
|
537
524
|
<button
|
|
538
525
|
onClick={() => void refetch()}
|
|
539
526
|
disabled={isFetching}
|
|
540
|
-
className="p-1 hover:bg-
|
|
527
|
+
className="p-1 hover:bg-sidebar-accent rounded transition-colors disabled:opacity-50"
|
|
541
528
|
aria-label="Refresh"
|
|
542
529
|
>
|
|
543
530
|
<ReloadIcon className={\`w-4 h-4 \${isFetching ? 'animate-spin' : ''}\`} />
|
|
544
531
|
</button>
|
|
545
532
|
</div>
|
|
546
|
-
<p className="mt-1 text-sm text-
|
|
547
|
-
{filterDescription}
|
|
548
|
-
</p>
|
|
533
|
+
<p className="mt-1 text-sm text-muted-foreground">{filterDescription}</p>
|
|
549
534
|
{data && (
|
|
550
|
-
<p className="mt-1 text-xs text-
|
|
535
|
+
<p className="mt-1 text-xs text-muted-foreground">
|
|
551
536
|
{data.total} {data.total === 1 ? 'change' : 'changes'} found
|
|
552
537
|
</p>
|
|
553
538
|
)}
|
|
554
539
|
</div>
|
|
555
|
-
|
|
556
540
|
{/* Breadcrumb navigation */}
|
|
557
541
|
{showBreadcrumbs && (
|
|
558
542
|
<BreadcrumbNavigation
|
|
@@ -567,13 +551,13 @@ export function AuditLogSidebar({ model, entityId, entityIds, field, labelField:
|
|
|
567
551
|
)}
|
|
568
552
|
|
|
569
553
|
{/* Limit selector */}
|
|
570
|
-
<div className="px-4 py-2 border-b border-
|
|
571
|
-
<label className="text-xs text-
|
|
554
|
+
<div className="px-4 py-2 border-b border-sidebar-border">
|
|
555
|
+
<label className="text-xs text-muted-foreground">
|
|
572
556
|
Show:{' '}
|
|
573
557
|
<select
|
|
574
558
|
value={limit}
|
|
575
559
|
onChange={(e) => setLimit(Number(e.target.value))}
|
|
576
|
-
className="ml-1 px-2 py-1 text-xs border border-
|
|
560
|
+
className="ml-1 px-2 py-1 text-xs border border-sidebar-border rounded bg-background"
|
|
577
561
|
>
|
|
578
562
|
<option value={10}>10</option>
|
|
579
563
|
<option value={20}>20</option>
|
|
@@ -582,16 +566,15 @@ export function AuditLogSidebar({ model, entityId, entityIds, field, labelField:
|
|
|
582
566
|
</select>
|
|
583
567
|
</label>
|
|
584
568
|
</div>
|
|
585
|
-
|
|
586
569
|
{/* Content */}
|
|
587
570
|
<div className="flex-1 overflow-y-auto">
|
|
588
571
|
{isLoading && (
|
|
589
572
|
<div className="flex items-center justify-center h-32">
|
|
590
|
-
<ReloadIcon className="w-6 h-6 animate-spin text-
|
|
573
|
+
<ReloadIcon className="w-6 h-6 animate-spin text-muted-foreground" />
|
|
591
574
|
</div>
|
|
592
575
|
)}
|
|
593
576
|
{!isLoading && data?.entries.length === 0 && (
|
|
594
|
-
<div className="flex flex-col items-center justify-center h-32 text-
|
|
577
|
+
<div className="flex flex-col items-center justify-center h-32 text-muted-foreground">
|
|
595
578
|
<p className="text-sm">No changes found</p>
|
|
596
579
|
<p className="text-xs mt-1">Changes will appear here when entities are modified</p>
|
|
597
580
|
</div>
|
|
@@ -610,7 +593,7 @@ export function AuditLogSidebar({ model, entityId, entityIds, field, labelField:
|
|
|
610
593
|
<div className="p-3">
|
|
611
594
|
<button
|
|
612
595
|
onClick={loadMore}
|
|
613
|
-
className="w-full py-2 text-sm text-
|
|
596
|
+
className="w-full py-2 text-sm text-primary hover:bg-sidebar-accent rounded transition-colors"
|
|
614
597
|
>
|
|
615
598
|
Load more...
|
|
616
599
|
</button>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log-sidebar.generator.js","sourceRoot":"","sources":["../../../src/frontend-admin/generators/audit-log-sidebar.generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"audit-log-sidebar.generator.js","sourceRoot":"","sources":["../../../src/frontend-admin/generators/audit-log-sidebar.generator.ts"],"names":[],"mappings":"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"}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/checkbox-cell.tsx
CHANGED
|
@@ -74,7 +74,7 @@ export function CheckboxCell<TData>({
|
|
|
74
74
|
[isFocused, value, onCheckedChange, isEditable],
|
|
75
75
|
)
|
|
76
76
|
|
|
77
|
-
const onCheckboxClick = React.useCallback((event: React.MouseEvent) => {
|
|
77
|
+
const onCheckboxClick = React.useCallback((event: React.MouseEvent<HTMLInputElement>) => {
|
|
78
78
|
event.stopPropagation()
|
|
79
79
|
}, [])
|
|
80
80
|
|
|
@@ -105,11 +105,11 @@ export function CheckboxCell<TData>({
|
|
|
105
105
|
iconStyle="simple"
|
|
106
106
|
checkIcon="check"
|
|
107
107
|
checked={value}
|
|
108
|
-
onChange={(
|
|
108
|
+
onChange={(event) => onCheckedChange(event.target.checked)}
|
|
109
109
|
onClick={onCheckboxClick}
|
|
110
110
|
onMouseDown={onCheckboxMouseDown}
|
|
111
111
|
onDoubleClick={onCheckboxDoubleClick}
|
|
112
|
-
className="border-
|
|
112
|
+
className="border-secondary-foreground"
|
|
113
113
|
/>
|
|
114
114
|
</DataGridCellWrapper>
|
|
115
115
|
)
|
|
@@ -28,7 +28,6 @@ function parseToLocalDate(value: string | Date | null | undefined): Date | undef
|
|
|
28
28
|
if (!match) {
|
|
29
29
|
return undefined
|
|
30
30
|
}
|
|
31
|
-
|
|
32
31
|
const year = Number.parseInt(match[1], 10)
|
|
33
32
|
const month = Number.parseInt(match[2], 10) - 1 // months are 0-indexed
|
|
34
33
|
const day = Number.parseInt(match[3], 10)
|
|
@@ -145,7 +144,7 @@ export function DateCell<TData>({
|
|
|
145
144
|
autoFocus
|
|
146
145
|
captionLayout="dropdown"
|
|
147
146
|
mode="single"
|
|
148
|
-
className="rounded-md border border-
|
|
147
|
+
className="rounded-md border border-border shadow-sm"
|
|
149
148
|
defaultMonth={value}
|
|
150
149
|
selected={value}
|
|
151
150
|
onSelect={onDateSelect}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/long-text-cell.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wra
|
|
|
4
4
|
import { useDebouncedCallback } from '@components/ui/data-grid/hooks/use-debounced-callback'
|
|
5
5
|
import { Popover, PopoverAnchor, PopoverContent } from '@components/ui/popover/popover'
|
|
6
6
|
import { Textarea } from '@components/ui/textarea/textarea'
|
|
7
|
+
|
|
7
8
|
import { CellVariantProps } from './cell-variant-types'
|
|
8
9
|
|
|
9
10
|
export function LongTextCell<TData>({
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/multi-select-cell.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wra
|
|
|
16
16
|
import { getLineCount } from '@components/ui/data-grid/data-grid-utils'
|
|
17
17
|
import { Popover, PopoverAnchor, PopoverContent } from '@components/ui/popover/popover'
|
|
18
18
|
import { cn } from '@lib/utils'
|
|
19
|
+
|
|
19
20
|
import { CellVariantProps } from './cell-variant-types'
|
|
20
21
|
|
|
21
22
|
export function MultiSelectCell<TData>({
|
|
@@ -234,10 +235,8 @@ export function MultiSelectCell<TData>({
|
|
|
234
235
|
<CommandItem key={option.value} value={option.label} onSelect={() => onValueChange(option.value)}>
|
|
235
236
|
<div
|
|
236
237
|
className={cn(
|
|
237
|
-
'flex size-4 items-center justify-center rounded-sm border border-
|
|
238
|
-
isSelected
|
|
239
|
-
? 'bg-neutral-900 text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900'
|
|
240
|
-
: 'opacity-50 [&_svg]:invisible',
|
|
238
|
+
'flex size-4 items-center justify-center rounded-sm border border-border',
|
|
239
|
+
isSelected ? 'bg-accent-foreground text-secondary' : 'opacity-50 [&_svg]:invisible',
|
|
241
240
|
)}
|
|
242
241
|
>
|
|
243
242
|
<CheckIcon className="size-3" />
|
|
@@ -251,10 +250,7 @@ export function MultiSelectCell<TData>({
|
|
|
251
250
|
<>
|
|
252
251
|
<CommandSeparator />
|
|
253
252
|
<CommandGroup>
|
|
254
|
-
<CommandItem
|
|
255
|
-
onSelect={clearAll}
|
|
256
|
-
className="justify-center text-neutral-500 dark:text-neutral-400"
|
|
257
|
-
>
|
|
253
|
+
<CommandItem onSelect={clearAll} className="justify-center text-muted-foreground">
|
|
258
254
|
Clear all
|
|
259
255
|
</CommandItem>
|
|
260
256
|
</CommandGroup>
|
|
@@ -273,7 +269,7 @@ export function MultiSelectCell<TData>({
|
|
|
273
269
|
</Badge>
|
|
274
270
|
))}
|
|
275
271
|
{hiddenBadgeCount > 0 && (
|
|
276
|
-
<Badge variant="outline" className="h-5 shrink-0 px-1.5 text-
|
|
272
|
+
<Badge variant="outline" className="h-5 shrink-0 px-1.5 text-muted-foreground text-xs">
|
|
277
273
|
+{hiddenBadgeCount}
|
|
278
274
|
</Badge>
|
|
279
275
|
)}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/number-cell.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ColumnMeta } from '@tanstack/react-table'
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
|
+
|
|
4
5
|
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
5
6
|
import { cn } from '@lib/utils'
|
|
7
|
+
|
|
6
8
|
import { CellVariantProps } from './cell-variant-types'
|
|
7
9
|
|
|
8
10
|
export function NumberCell<TData>({
|
|
@@ -54,7 +56,6 @@ export function NumberCell<TData>({
|
|
|
54
56
|
const onChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
55
57
|
setEditValue(event.target.value)
|
|
56
58
|
}, [])
|
|
57
|
-
|
|
58
59
|
const parseNumValue = React.useCallback((): number | null => {
|
|
59
60
|
return editValue === '' ? null : Number(editValue)
|
|
60
61
|
}, [editValue])
|
|
@@ -89,7 +90,9 @@ export function NumberCell<TData>({
|
|
|
89
90
|
|
|
90
91
|
const handleFocusedKeyDown = React.useCallback(
|
|
91
92
|
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
92
|
-
if (!isEditable)
|
|
93
|
+
if (!isEditable) {
|
|
94
|
+
return
|
|
95
|
+
}
|
|
93
96
|
|
|
94
97
|
if (event.key === 'Backspace') {
|
|
95
98
|
setEditValue('')
|
|
@@ -99,7 +102,6 @@ export function NumberCell<TData>({
|
|
|
99
102
|
},
|
|
100
103
|
[isEditable],
|
|
101
104
|
)
|
|
102
|
-
|
|
103
105
|
const onWrapperKeyDown = React.useCallback(
|
|
104
106
|
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
105
107
|
if (isEditing) {
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/react-node-cell.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
4
|
+
|
|
4
5
|
import { CellVariantProps } from './cell-variant-types'
|
|
5
6
|
|
|
6
7
|
export function ReactNodeCell<TData>({
|
|
@@ -24,7 +25,7 @@ export function ReactNodeCell<TData>({
|
|
|
24
25
|
isEditing={false}
|
|
25
26
|
isFocused={isFocused}
|
|
26
27
|
isSelected={isSelected}
|
|
27
|
-
className="flex size-full justify-center"
|
|
28
|
+
className="flex size-full justify-center p-0"
|
|
28
29
|
>
|
|
29
30
|
{children ?? null}
|
|
30
31
|
</DataGridCellWrapper>
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/select-cell.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { CheckIcon } from '@radix-ui/react-icons'
|
|
2
|
+
|
|
1
3
|
import * as React from 'react'
|
|
2
4
|
|
|
3
|
-
import { CheckIcon } from '@radix-ui/react-icons'
|
|
4
|
-
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
5
5
|
import {
|
|
6
6
|
Command,
|
|
7
7
|
CommandEmpty,
|
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
CommandItem,
|
|
11
11
|
CommandList,
|
|
12
12
|
} from '@components/ui/command/command'
|
|
13
|
+
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
13
14
|
import { Popover, PopoverContent, PopoverTrigger } from '@components/ui/popover/popover'
|
|
14
15
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@components/ui/select/select'
|
|
16
|
+
|
|
15
17
|
import { CellVariantProps } from './cell-variant-types'
|
|
16
18
|
|
|
17
19
|
export function SelectCell<TData>({
|
|
@@ -93,7 +95,6 @@ export function SelectCell<TData>({
|
|
|
93
95
|
}, [isFocused, isEditing, open, meta?.searchOpen, meta?.isScrolling])
|
|
94
96
|
|
|
95
97
|
const displayLabel = options.find((opt) => opt.value === value)?.label ?? value
|
|
96
|
-
|
|
97
98
|
let editingContent: React.ReactNode
|
|
98
99
|
|
|
99
100
|
if (hasSearch) {
|
|
@@ -156,7 +157,6 @@ export function SelectCell<TData>({
|
|
|
156
157
|
</Select>
|
|
157
158
|
)
|
|
158
159
|
}
|
|
159
|
-
|
|
160
160
|
return (
|
|
161
161
|
<DataGridCellWrapper
|
|
162
162
|
ref={containerRef}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/short-text-cell.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
4
|
+
|
|
4
5
|
import { CellVariantProps } from './cell-variant-types'
|
|
5
6
|
|
|
6
7
|
export function ShortTextCell<TData>({
|
|
@@ -35,11 +36,9 @@ export function ShortTextCell<TData>({
|
|
|
35
36
|
}
|
|
36
37
|
meta?.onCellEditingStop?.()
|
|
37
38
|
}, [meta, rowIndex, columnId, initialValue])
|
|
38
|
-
|
|
39
39
|
const onChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
40
40
|
setValue(event.target.value)
|
|
41
41
|
}, [])
|
|
42
|
-
|
|
43
42
|
const handleEditingKeyDown = React.useCallback(
|
|
44
43
|
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
45
44
|
if (event.key === 'Enter') {
|
|
@@ -130,7 +129,9 @@ export function ShortTextCell<TData>({
|
|
|
130
129
|
className="size-full bg-transparent outline-none"
|
|
131
130
|
/>
|
|
132
131
|
) : (
|
|
133
|
-
<div className="size-full overflow-hidden outline-none">
|
|
132
|
+
<div data-slot="grid-cell-content" className="size-full overflow-hidden outline-none">
|
|
133
|
+
{value}
|
|
134
|
+
</div>
|
|
134
135
|
)}
|
|
135
136
|
</DataGridCellWrapper>
|
|
136
137
|
)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useRef } from 'react'
|
|
2
|
+
|
|
2
3
|
import { GanttTimerangePicker } from './gantt-timerange-picker'
|
|
3
4
|
|
|
4
5
|
// Gantt header component rendering the timeline scale
|
|
@@ -49,7 +50,7 @@ export const GanttTimeline = ({ header }: { header: any }) => {
|
|
|
49
50
|
/* distribute space between years with flex-grow except for first and last as they might only be partial */
|
|
50
51
|
<div
|
|
51
52
|
key={year}
|
|
52
|
-
className="h-full relative flex grow border-l border-
|
|
53
|
+
className="h-full relative flex grow border-l border-muted-foreground/30 first:border-none first:grow-0 last:grow-0 overflow-hidden"
|
|
53
54
|
style={
|
|
54
55
|
// index == 0: first year, index == totalYears -1: last year
|
|
55
56
|
index == 0 || index == totalYears - 1
|
|
@@ -62,7 +63,7 @@ export const GanttTimeline = ({ header }: { header: any }) => {
|
|
|
62
63
|
<div className="absolute bottom-0 left-0 right-0 flex h-1.5 w-full">
|
|
63
64
|
{index == 0 && ts.getMonth() < 11 && (
|
|
64
65
|
<div
|
|
65
|
-
className="h-full border-r border-dashed border-
|
|
66
|
+
className="h-full border-r border-dashed border-muted-foreground/30"
|
|
66
67
|
style={{ width: `${(firstMonthPartialMs / firstYearPartialMs) * 100}%` }}
|
|
67
68
|
/>
|
|
68
69
|
)}
|
|
@@ -71,8 +72,8 @@ export const GanttTimeline = ({ header }: { header: any }) => {
|
|
|
71
72
|
length: (index == totalYears - 1 ? te.getMonth() : 12) - (index == 0 ? ts.getMonth() + 1 : 0),
|
|
72
73
|
}).map((_, monthIndex) => (
|
|
73
74
|
<div
|
|
74
|
-
key={`${year}-${
|
|
75
|
-
className="grow h-full border-r border-dashed border-
|
|
75
|
+
key={`${year}-${monthIndex}`}
|
|
76
|
+
className="grow h-full border-r border-dashed border-muted-foreground/30 last:border-0"
|
|
76
77
|
/>
|
|
77
78
|
))}
|
|
78
79
|
{/* last month with calculated width as it might only be partial */}
|
|
@@ -82,7 +83,7 @@ export const GanttTimeline = ({ header }: { header: any }) => {
|
|
|
82
83
|
</div>
|
|
83
84
|
)}
|
|
84
85
|
|
|
85
|
-
<span className="ps-0.5 -mt-px text-xs text-
|
|
86
|
+
<span className="ps-0.5 -mt-px text-xs text-muted-foreground select-none z-1">{year}</span>
|
|
86
87
|
</div>
|
|
87
88
|
))}
|
|
88
89
|
</div>
|
|
@@ -186,10 +186,10 @@ export function DataGridCellWrapper<TData>({
|
|
|
186
186
|
'text-center': align === 'center',
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
|
-
'ring-1 ring-
|
|
189
|
+
'ring-1 ring-foreground ring-inset dark:ring-secondary-foreground': isFocused,
|
|
190
190
|
'bg-yellow-100 dark:bg-yellow-900/30': isSearchMatch && !isActiveSearchMatch,
|
|
191
191
|
'bg-orange-200 dark:bg-orange-900/50': isActiveSearchMatch,
|
|
192
|
-
'bg-
|
|
192
|
+
'bg-accent-foreground/10': isSelected && !isEditing,
|
|
193
193
|
'cursor-default': !isEditing,
|
|
194
194
|
'**:data-[slot=grid-cell-content]:line-clamp-1': !isEditing && rowHeight === 'short',
|
|
195
195
|
'**:data-[slot=grid-cell-content]:line-clamp-2': !isEditing && rowHeight === 'medium',
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Cell, Table } from '@tanstack/react-table'
|
|
2
|
-
|
|
3
|
-
import { LongTextCell } from './cell-variants/long-text-cell'
|
|
4
|
-
import { NumberCell } from './cell-variants/number-cell'
|
|
5
|
-
import { SelectCell } from './cell-variants/select-cell'
|
|
6
|
-
import { MultiSelectCell } from './cell-variants/multi-select-cell'
|
|
2
|
+
|
|
7
3
|
import { CheckboxCell } from './cell-variants/checkbox-cell'
|
|
8
4
|
import { DateCell } from './cell-variants/date-cell'
|
|
9
|
-
import { ReactNodeCell } from './cell-variants/react-node-cell'
|
|
10
5
|
import { GanttCell } from './cell-variants/gantt-cell'
|
|
6
|
+
import { LongTextCell } from './cell-variants/long-text-cell'
|
|
7
|
+
import { MultiSelectCell } from './cell-variants/multi-select-cell'
|
|
8
|
+
import { NumberCell } from './cell-variants/number-cell'
|
|
9
|
+
import { ReactNodeCell } from './cell-variants/react-node-cell'
|
|
10
|
+
import { SelectCell } from './cell-variants/select-cell'
|
|
11
|
+
import { ShortTextCell } from './cell-variants/short-text-cell'
|
|
11
12
|
|
|
12
13
|
type DataGridCellProps<TData> = {
|
|
13
14
|
cell: Cell<TData, unknown>
|