@postxl/generators 1.1.1 → 1.2.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.
- package/dist/frontend-core/frontend.generator.d.ts +0 -58
- package/dist/frontend-core/frontend.generator.js +6 -172
- package/dist/frontend-core/frontend.generator.js.map +1 -1
- package/dist/frontend-core/template/README.md +1 -1
- package/dist/frontend-core/template/src/components/admin/table-filter.tsx +1 -5
- package/dist/frontend-core/template/src/components/ui/color-mode-toggle/color-mode-toggle.tsx +10 -4
- package/dist/frontend-core/template/src/pages/dashboard/dashboard.page.tsx +2 -3
- package/dist/frontend-core/template/src/pages/error/default-error.page.tsx +1 -1
- package/dist/frontend-core/template/src/pages/error/not-found-error.page.tsx +1 -1
- package/dist/frontend-core/template/src/styles/styles.css +13 -1
- package/dist/frontend-core/template/tsconfig.json +2 -0
- package/dist/frontend-core/types/component.d.ts +1 -1
- package/dist/frontend-forms/generators/discriminated-union/fields.generator.js +4 -6
- package/dist/frontend-forms/generators/discriminated-union/fields.generator.js.map +1 -1
- package/dist/frontend-forms/generators/discriminated-union/inputs.generator.js +1 -1
- package/dist/frontend-forms/generators/discriminated-union/inputs.generator.js.map +1 -1
- package/dist/frontend-forms/generators/enum/inputs.generator.js +1 -1
- package/dist/frontend-forms/generators/enum/inputs.generator.js.map +1 -1
- package/dist/frontend-forms/generators/model/forms.generator.js +8 -12
- package/dist/frontend-forms/generators/model/forms.generator.js.map +1 -1
- package/dist/frontend-forms/generators/model/inputs.generator.js +2 -6
- package/dist/frontend-forms/generators/model/inputs.generator.js.map +1 -1
- package/dist/frontend-forms/template/src/components/ui/field/field.tsx +1 -4
- package/dist/frontend-tables/generators/model-table.generator.js +1 -5
- package/dist/frontend-tables/generators/model-table.generator.js.map +1 -1
- package/package.json +3 -2
- package/dist/frontend-core/template/src/components/ui/accordion/accordion.stories.tsx +0 -47
- package/dist/frontend-core/template/src/components/ui/accordion/accordion.tsx +0 -52
- package/dist/frontend-core/template/src/components/ui/admin-sidebar/admin-sidebar.tsx +0 -195
- package/dist/frontend-core/template/src/components/ui/alert/alert.stories.tsx +0 -61
- package/dist/frontend-core/template/src/components/ui/alert/alert.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/alert-dialog/alert-dialog.stories.tsx +0 -52
- package/dist/frontend-core/template/src/components/ui/alert-dialog/alert-dialog.tsx +0 -105
- package/dist/frontend-core/template/src/components/ui/avatar/avatar.stories.tsx +0 -30
- package/dist/frontend-core/template/src/components/ui/avatar/avatar.tsx +0 -39
- package/dist/frontend-core/template/src/components/ui/badge/badge.stories.tsx +0 -78
- package/dist/frontend-core/template/src/components/ui/badge/badge.tsx +0 -48
- package/dist/frontend-core/template/src/components/ui/breadcrumb/breadcrumb.stories.tsx +0 -67
- package/dist/frontend-core/template/src/components/ui/breadcrumb/breadcrumb.tsx +0 -85
- package/dist/frontend-core/template/src/components/ui/button/button.stories.tsx +0 -150
- package/dist/frontend-core/template/src/components/ui/button/button.tsx +0 -68
- package/dist/frontend-core/template/src/components/ui/calendar/calendar.stories.tsx +0 -160
- package/dist/frontend-core/template/src/components/ui/calendar/calendar.tsx +0 -293
- package/dist/frontend-core/template/src/components/ui/card/card.stories.tsx +0 -77
- package/dist/frontend-core/template/src/components/ui/card/card.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/card-hover/card-hover.stories.tsx +0 -29
- package/dist/frontend-core/template/src/components/ui/card-hover/card-hover.tsx +0 -28
- package/dist/frontend-core/template/src/components/ui/carousel/carousel.stories.tsx +0 -154
- package/dist/frontend-core/template/src/components/ui/carousel/carousel.tsx +0 -227
- package/dist/frontend-core/template/src/components/ui/checkbox/checkbox.stories.tsx +0 -106
- package/dist/frontend-core/template/src/components/ui/checkbox/checkbox.tsx +0 -88
- package/dist/frontend-core/template/src/components/ui/checkbox/shadcn-checkbox.stories.tsx +0 -90
- package/dist/frontend-core/template/src/components/ui/checkbox/shadcn-checkbox.tsx +0 -54
- package/dist/frontend-core/template/src/components/ui/collapse/collapse.stories.tsx +0 -52
- package/dist/frontend-core/template/src/components/ui/collapse/collapse.tsx +0 -9
- package/dist/frontend-core/template/src/components/ui/combobox/combobox.stories.tsx +0 -207
- package/dist/frontend-core/template/src/components/ui/combobox/combobox.tsx +0 -79
- package/dist/frontend-core/template/src/components/ui/command/command.stories.tsx +0 -186
- package/dist/frontend-core/template/src/components/ui/command/command.tsx +0 -165
- package/dist/frontend-core/template/src/components/ui/command-palette/command-palette.stories.tsx +0 -160
- package/dist/frontend-core/template/src/components/ui/command-palette/command-palette.tsx +0 -134
- package/dist/frontend-core/template/src/components/ui/content-frame/content-frame.stories.tsx +0 -198
- package/dist/frontend-core/template/src/components/ui/content-frame/content-frame.tsx +0 -100
- package/dist/frontend-core/template/src/components/ui/context-menu/context-menu.stories.tsx +0 -78
- package/dist/frontend-core/template/src/components/ui/context-menu/context-menu.tsx +0 -179
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/cell-variant-types.ts +0 -11
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/checkbox-cell.tsx +0 -116
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/date-cell.tsx +0 -157
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/gantt-cell.tsx +0 -82
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/long-text-cell.tsx +0 -180
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/multi-select-cell.tsx +0 -280
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/number-cell.tsx +0 -169
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/react-node-cell.tsx +0 -33
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/select-cell.tsx +0 -175
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/short-text-cell.tsx +0 -138
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/utils/gantt-timeline.tsx +0 -92
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/utils/gantt-timerange-picker.tsx +0 -330
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-cell-wrapper.tsx +0 -212
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-cell.tsx +0 -157
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-column-header.tsx +0 -340
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-context-menu.tsx +0 -271
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-row.tsx +0 -123
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-search.tsx +0 -211
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-types.ts +0 -159
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-utils.ts +0 -67
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-view-menu.tsx +0 -360
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid.stories.tsx +0 -780
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid.tsx +0 -217
- package/dist/frontend-core/template/src/components/ui/data-grid/hooks/use-callback-ref.ts +0 -22
- package/dist/frontend-core/template/src/components/ui/data-grid/hooks/use-data-grid.tsx +0 -1892
- package/dist/frontend-core/template/src/components/ui/data-grid/hooks/use-debounced-callback.ts +0 -19
- package/dist/frontend-core/template/src/components/ui/data-grid/styles.css +0 -3
- package/dist/frontend-core/template/src/components/ui/data-table/context-menu-simple.tsx +0 -141
- package/dist/frontend-core/template/src/components/ui/data-table/data-table.stories.tsx +0 -146
- package/dist/frontend-core/template/src/components/ui/data-table/data-table.tsx +0 -447
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/country-array-cell-renderer.tsx +0 -77
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/country-cell-renderer.tsx +0 -56
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/favorite-cell-renderer.tsx +0 -68
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/links-cell-renderer.tsx +0 -205
- package/dist/frontend-core/template/src/components/ui/data-table/utils/columns.ts +0 -351
- package/dist/frontend-core/template/src/components/ui/data-table/utils/data-table.utils.ts +0 -49
- package/dist/frontend-core/template/src/components/ui/date-picker/date-picker.stories.tsx +0 -149
- package/dist/frontend-core/template/src/components/ui/date-picker/date-picker.tsx +0 -30
- package/dist/frontend-core/template/src/components/ui/dialog/dialog.stories.tsx +0 -80
- package/dist/frontend-core/template/src/components/ui/dialog/dialog.tsx +0 -134
- package/dist/frontend-core/template/src/components/ui/drawer/drawer.stories.tsx +0 -104
- package/dist/frontend-core/template/src/components/ui/drawer/drawer.tsx +0 -87
- package/dist/frontend-core/template/src/components/ui/dropdown-menu/dropdown-menu.stories.tsx +0 -168
- package/dist/frontend-core/template/src/components/ui/dropdown-menu/dropdown-menu.tsx +0 -225
- package/dist/frontend-core/template/src/components/ui/input/input.stories.tsx +0 -141
- package/dist/frontend-core/template/src/components/ui/input/input.tsx +0 -47
- package/dist/frontend-core/template/src/components/ui/label/label.stories.tsx +0 -41
- package/dist/frontend-core/template/src/components/ui/label/label.tsx +0 -20
- package/dist/frontend-core/template/src/components/ui/loader/loader.stories.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/loader/loader.tsx +0 -17
- package/dist/frontend-core/template/src/components/ui/mark-value-renderer/mark-value-renderer.stories.tsx +0 -114
- package/dist/frontend-core/template/src/components/ui/mark-value-renderer/mark-value-renderer.tsx +0 -48
- package/dist/frontend-core/template/src/components/ui/menubar/menu.stories.tsx +0 -134
- package/dist/frontend-core/template/src/components/ui/menubar/menubar.tsx +0 -208
- package/dist/frontend-core/template/src/components/ui/modal/modal.stories.tsx +0 -297
- package/dist/frontend-core/template/src/components/ui/modal/modal.tsx +0 -80
- package/dist/frontend-core/template/src/components/ui/navigation-menu/navigation-menu.stories.tsx +0 -213
- package/dist/frontend-core/template/src/components/ui/navigation-menu/navigation-menu.tsx +0 -142
- package/dist/frontend-core/template/src/components/ui/pagination/pagination.stories.tsx +0 -49
- package/dist/frontend-core/template/src/components/ui/pagination/pagination.tsx +0 -84
- package/dist/frontend-core/template/src/components/ui/popover/popover.stories.tsx +0 -82
- package/dist/frontend-core/template/src/components/ui/popover/popover.tsx +0 -55
- package/dist/frontend-core/template/src/components/ui/progress/progress.stories.tsx +0 -80
- package/dist/frontend-core/template/src/components/ui/progress/progress.tsx +0 -17
- package/dist/frontend-core/template/src/components/ui/radio-group/radio-group.stories.tsx +0 -154
- package/dist/frontend-core/template/src/components/ui/radio-group/radio-group.tsx +0 -68
- package/dist/frontend-core/template/src/components/ui/resizable/resizable.stories.tsx +0 -73
- package/dist/frontend-core/template/src/components/ui/resizable/resizeable.tsx +0 -38
- package/dist/frontend-core/template/src/components/ui/scroll-area/scroll-area.stories.tsx +0 -55
- package/dist/frontend-core/template/src/components/ui/scroll-area/scroll-area.tsx +0 -39
- package/dist/frontend-core/template/src/components/ui/select/select.stories.tsx +0 -297
- package/dist/frontend-core/template/src/components/ui/select/select.tsx +0 -227
- package/dist/frontend-core/template/src/components/ui/separator/separator.tsx +0 -21
- package/dist/frontend-core/template/src/components/ui/separator/seperator.stories.tsx +0 -25
- package/dist/frontend-core/template/src/components/ui/sheet/sheet.stories.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/sheet/sheet.tsx +0 -107
- package/dist/frontend-core/template/src/components/ui/skeleton/skeleton.stories.tsx +0 -26
- package/dist/frontend-core/template/src/components/ui/skeleton/skeleton.tsx +0 -7
- package/dist/frontend-core/template/src/components/ui/slider/slider.stories.tsx +0 -101
- package/dist/frontend-core/template/src/components/ui/slider/slider.tsx +0 -98
- package/dist/frontend-core/template/src/components/ui/spinner/spinner.stories.tsx +0 -19
- package/dist/frontend-core/template/src/components/ui/spinner/spinner.tsx +0 -21
- package/dist/frontend-core/template/src/components/ui/switch/switch.stories.tsx +0 -33
- package/dist/frontend-core/template/src/components/ui/switch/switch.tsx +0 -28
- package/dist/frontend-core/template/src/components/ui/tabs/tabs.stories.tsx +0 -215
- package/dist/frontend-core/template/src/components/ui/tabs/tabs.tsx +0 -70
- package/dist/frontend-core/template/src/components/ui/textarea/textarea.stories.tsx +0 -138
- package/dist/frontend-core/template/src/components/ui/textarea/textarea.tsx +0 -40
- package/dist/frontend-core/template/src/components/ui/toast/toast.mdx +0 -31
- package/dist/frontend-core/template/src/components/ui/toast/toast.stories.tsx +0 -89
- package/dist/frontend-core/template/src/components/ui/toggle/toggle.stories.tsx +0 -65
- package/dist/frontend-core/template/src/components/ui/toggle/toggle.tsx +0 -38
- package/dist/frontend-core/template/src/components/ui/toggle-group/toggle-group.stories.tsx +0 -85
- package/dist/frontend-core/template/src/components/ui/toggle-group/toggle-group.tsx +0 -54
- package/dist/frontend-core/template/src/components/ui/tooltip/tooltip.stories.tsx +0 -29
- package/dist/frontend-core/template/src/components/ui/tooltip/tooltip.tsx +0 -29
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/number-cell.tsx
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import type { ColumnMeta } from '@tanstack/react-table'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
|
|
5
|
-
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
6
|
-
import { cn } from '@lib/utils'
|
|
7
|
-
|
|
8
|
-
import { CellVariantProps } from './cell-variant-types'
|
|
9
|
-
|
|
10
|
-
export function NumberCell<TData>({
|
|
11
|
-
cell,
|
|
12
|
-
table,
|
|
13
|
-
rowIndex,
|
|
14
|
-
columnId,
|
|
15
|
-
isFocused,
|
|
16
|
-
isEditing,
|
|
17
|
-
isSelected,
|
|
18
|
-
}: Readonly<CellVariantProps<TData, number>>) {
|
|
19
|
-
const initialValue = cell.getValue() as number | null
|
|
20
|
-
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
21
|
-
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
22
|
-
const meta = table.options.meta
|
|
23
|
-
const colMeta = cell.column.columnDef.meta as ColumnMeta<TData, number>
|
|
24
|
-
const cellOptions = colMeta?.cell
|
|
25
|
-
// Normalize editable to a resolver function and memoize to avoid typeof checks per cell
|
|
26
|
-
const editableResolver = React.useMemo(() => {
|
|
27
|
-
const v = colMeta?.editable
|
|
28
|
-
if (v === undefined) {
|
|
29
|
-
return () => true
|
|
30
|
-
}
|
|
31
|
-
return typeof v === 'function' ? (v as (row: TData) => boolean) : () => Boolean(v)
|
|
32
|
-
}, [colMeta?.editable])
|
|
33
|
-
const isEditable = editableResolver(cell.row.original)
|
|
34
|
-
const {
|
|
35
|
-
min,
|
|
36
|
-
max,
|
|
37
|
-
step,
|
|
38
|
-
prefix = '',
|
|
39
|
-
suffix = '',
|
|
40
|
-
fallbackValue = '',
|
|
41
|
-
} = cellOptions?.variant === 'number' ? cellOptions : {}
|
|
42
|
-
|
|
43
|
-
// Keep an unformatted string for editing (no grouping separators)
|
|
44
|
-
const [editValue, setEditValue] = React.useState<string>(
|
|
45
|
-
initialValue !== null && initialValue !== undefined ? String(initialValue) : '',
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
const onBlur = React.useCallback(() => {
|
|
49
|
-
const numValue = editValue === '' ? null : Number(editValue)
|
|
50
|
-
if (numValue !== initialValue) {
|
|
51
|
-
meta?.onDataUpdate?.({ rowIndex, columnId, value: numValue })
|
|
52
|
-
}
|
|
53
|
-
meta?.onCellEditingStop?.()
|
|
54
|
-
}, [meta, rowIndex, columnId, initialValue, editValue])
|
|
55
|
-
|
|
56
|
-
const onChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
57
|
-
setEditValue(event.target.value)
|
|
58
|
-
}, [])
|
|
59
|
-
const parseNumValue = React.useCallback((): number | null => {
|
|
60
|
-
return editValue === '' ? null : Number(editValue)
|
|
61
|
-
}, [editValue])
|
|
62
|
-
|
|
63
|
-
const saveAndStop = React.useCallback(
|
|
64
|
-
(options?: { moveToNextRow?: boolean; direction?: 'left' | 'right' }) => {
|
|
65
|
-
const numValue = parseNumValue()
|
|
66
|
-
if (numValue !== initialValue) {
|
|
67
|
-
meta?.onDataUpdate?.({ rowIndex, columnId, value: numValue })
|
|
68
|
-
}
|
|
69
|
-
meta?.onCellEditingStop?.(options)
|
|
70
|
-
},
|
|
71
|
-
[parseNumValue, initialValue, meta, rowIndex, columnId],
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
const handleEditingKeyDown = React.useCallback(
|
|
75
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
76
|
-
if (event.key === 'Enter') {
|
|
77
|
-
event.preventDefault()
|
|
78
|
-
saveAndStop({ moveToNextRow: true })
|
|
79
|
-
} else if (event.key === 'Tab') {
|
|
80
|
-
event.preventDefault()
|
|
81
|
-
saveAndStop({ direction: event.shiftKey ? 'left' : 'right' })
|
|
82
|
-
} else if (event.key === 'Escape') {
|
|
83
|
-
event.preventDefault()
|
|
84
|
-
setEditValue(initialValue !== null && initialValue !== undefined ? String(initialValue) : '')
|
|
85
|
-
inputRef.current?.blur()
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
[saveAndStop, initialValue],
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
const handleFocusedKeyDown = React.useCallback(
|
|
92
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
93
|
-
if (!isEditable) {
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (event.key === 'Backspace') {
|
|
98
|
-
setEditValue('')
|
|
99
|
-
} else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey) {
|
|
100
|
-
setEditValue(event.key)
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
[isEditable],
|
|
104
|
-
)
|
|
105
|
-
const onWrapperKeyDown = React.useCallback(
|
|
106
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
107
|
-
if (isEditing) {
|
|
108
|
-
handleEditingKeyDown(event)
|
|
109
|
-
} else if (isFocused) {
|
|
110
|
-
handleFocusedKeyDown(event)
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
[isEditing, isFocused, handleEditingKeyDown, handleFocusedKeyDown],
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
React.useEffect(() => {
|
|
117
|
-
setEditValue(initialValue !== null && initialValue !== undefined ? String(initialValue) : '')
|
|
118
|
-
}, [initialValue])
|
|
119
|
-
|
|
120
|
-
React.useEffect(() => {
|
|
121
|
-
if (isEditing && inputRef.current) {
|
|
122
|
-
inputRef.current.focus()
|
|
123
|
-
inputRef.current.select()
|
|
124
|
-
}
|
|
125
|
-
if (isFocused && !isEditing && !meta?.searchOpen && !meta?.isScrolling && containerRef.current) {
|
|
126
|
-
containerRef.current.focus()
|
|
127
|
-
}
|
|
128
|
-
}, [isFocused, isEditing, meta?.searchOpen, meta?.isScrolling])
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<DataGridCellWrapper
|
|
132
|
-
ref={containerRef}
|
|
133
|
-
cell={cell}
|
|
134
|
-
table={table}
|
|
135
|
-
rowIndex={rowIndex}
|
|
136
|
-
columnId={columnId}
|
|
137
|
-
isEditing={isEditing}
|
|
138
|
-
isFocused={isFocused}
|
|
139
|
-
isSelected={isSelected}
|
|
140
|
-
onKeyDown={onWrapperKeyDown}
|
|
141
|
-
>
|
|
142
|
-
{isEditing ? (
|
|
143
|
-
<input
|
|
144
|
-
ref={inputRef}
|
|
145
|
-
type="number"
|
|
146
|
-
value={editValue}
|
|
147
|
-
min={min}
|
|
148
|
-
max={max}
|
|
149
|
-
step={step}
|
|
150
|
-
onBlur={onBlur}
|
|
151
|
-
onChange={onChange}
|
|
152
|
-
className="w-full border-none bg-transparent p-0 outline-none"
|
|
153
|
-
/>
|
|
154
|
-
) : (
|
|
155
|
-
<span data-slot="grid-cell-content" className={cn('tabular-nums', colMeta?.align ?? 'text-right')}>
|
|
156
|
-
{initialValue === null || initialValue === undefined || editValue === '' ? (
|
|
157
|
-
fallbackValue
|
|
158
|
-
) : (
|
|
159
|
-
<>
|
|
160
|
-
{prefix}
|
|
161
|
-
{initialValue.toLocaleString()}
|
|
162
|
-
{suffix}
|
|
163
|
-
</>
|
|
164
|
-
)}
|
|
165
|
-
</span>
|
|
166
|
-
)}
|
|
167
|
-
</DataGridCellWrapper>
|
|
168
|
-
)
|
|
169
|
-
}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/react-node-cell.tsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
4
|
-
|
|
5
|
-
import { CellVariantProps } from './cell-variant-types'
|
|
6
|
-
|
|
7
|
-
export function ReactNodeCell<TData>({
|
|
8
|
-
cell,
|
|
9
|
-
table,
|
|
10
|
-
rowIndex,
|
|
11
|
-
columnId,
|
|
12
|
-
isFocused,
|
|
13
|
-
isSelected,
|
|
14
|
-
}: Readonly<CellVariantProps<TData, React.ReactNode>>) {
|
|
15
|
-
const children = cell.getValue()
|
|
16
|
-
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<DataGridCellWrapper
|
|
20
|
-
ref={containerRef}
|
|
21
|
-
cell={cell}
|
|
22
|
-
table={table}
|
|
23
|
-
rowIndex={rowIndex}
|
|
24
|
-
columnId={columnId}
|
|
25
|
-
isEditing={false}
|
|
26
|
-
isFocused={isFocused}
|
|
27
|
-
isSelected={isSelected}
|
|
28
|
-
className="flex size-full justify-center p-0"
|
|
29
|
-
>
|
|
30
|
-
{children ?? null}
|
|
31
|
-
</DataGridCellWrapper>
|
|
32
|
-
)
|
|
33
|
-
}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/select-cell.tsx
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { CheckIcon } from '@radix-ui/react-icons'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Command,
|
|
7
|
-
CommandEmpty,
|
|
8
|
-
CommandGroup,
|
|
9
|
-
CommandInput,
|
|
10
|
-
CommandItem,
|
|
11
|
-
CommandList,
|
|
12
|
-
} from '@components/ui/command/command'
|
|
13
|
-
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
14
|
-
import { Popover, PopoverContent, PopoverTrigger } from '@components/ui/popover/popover'
|
|
15
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@components/ui/select/select'
|
|
16
|
-
|
|
17
|
-
import { CellVariantProps } from './cell-variant-types'
|
|
18
|
-
|
|
19
|
-
export function SelectCell<TData>({
|
|
20
|
-
cell,
|
|
21
|
-
table,
|
|
22
|
-
rowIndex,
|
|
23
|
-
columnId,
|
|
24
|
-
isFocused,
|
|
25
|
-
isEditing,
|
|
26
|
-
isSelected,
|
|
27
|
-
}: Readonly<CellVariantProps<TData, string>>) {
|
|
28
|
-
const initialValue = cell.getValue()
|
|
29
|
-
const [value, setValue] = React.useState(initialValue)
|
|
30
|
-
const [open, setOpen] = React.useState(false)
|
|
31
|
-
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
32
|
-
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
33
|
-
const meta = table.options.meta
|
|
34
|
-
const cellOpts = cell.column.columnDef.meta?.cell
|
|
35
|
-
const options = cellOpts?.variant === 'select' ? cellOpts.options : []
|
|
36
|
-
const hasSearch = (cellOpts?.variant === 'select' && cellOpts?.hasSearch) ?? false
|
|
37
|
-
const sideOffset = -(inputRef.current?.clientHeight ?? 0)
|
|
38
|
-
|
|
39
|
-
const onValueChange = React.useCallback(
|
|
40
|
-
(newValue: string) => {
|
|
41
|
-
setValue(newValue)
|
|
42
|
-
meta?.onDataUpdate?.({ rowIndex, columnId, value: newValue })
|
|
43
|
-
meta?.onCellEditingStop?.()
|
|
44
|
-
},
|
|
45
|
-
[meta, rowIndex, columnId],
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
const onOpenChange = React.useCallback(
|
|
49
|
-
(isOpen: boolean) => {
|
|
50
|
-
setOpen(isOpen)
|
|
51
|
-
if (!isOpen) {
|
|
52
|
-
meta?.onCellEditingStop?.()
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
[meta],
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
const onOpenAutoFocus: NonNullable<React.ComponentProps<typeof PopoverContent>['onOpenAutoFocus']> =
|
|
59
|
-
React.useCallback((event) => {
|
|
60
|
-
event.preventDefault()
|
|
61
|
-
inputRef.current?.focus()
|
|
62
|
-
}, [])
|
|
63
|
-
|
|
64
|
-
const onWrapperKeyDown = React.useCallback(
|
|
65
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
66
|
-
if (isEditing) {
|
|
67
|
-
if (event.key === 'Escape') {
|
|
68
|
-
event.preventDefault()
|
|
69
|
-
setValue(initialValue)
|
|
70
|
-
setOpen(false)
|
|
71
|
-
meta?.onCellEditingStop?.()
|
|
72
|
-
} else if (event.key === 'Tab') {
|
|
73
|
-
event.preventDefault()
|
|
74
|
-
setOpen(false)
|
|
75
|
-
meta?.onCellEditingStop?.({
|
|
76
|
-
direction: event.shiftKey ? 'left' : 'right',
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
[isEditing, initialValue, meta],
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
React.useEffect(() => {
|
|
85
|
-
setValue(initialValue)
|
|
86
|
-
}, [initialValue])
|
|
87
|
-
|
|
88
|
-
React.useEffect(() => {
|
|
89
|
-
if (isEditing && !open) {
|
|
90
|
-
setOpen(true)
|
|
91
|
-
}
|
|
92
|
-
if (isFocused && !isEditing && !meta?.searchOpen && !meta?.isScrolling && containerRef.current) {
|
|
93
|
-
containerRef.current.focus()
|
|
94
|
-
}
|
|
95
|
-
}, [isFocused, isEditing, open, meta?.searchOpen, meta?.isScrolling])
|
|
96
|
-
|
|
97
|
-
const displayLabel = options.find((opt) => opt.value === value)?.label ?? value
|
|
98
|
-
let editingContent: React.ReactNode
|
|
99
|
-
|
|
100
|
-
if (hasSearch) {
|
|
101
|
-
editingContent = (
|
|
102
|
-
<Popover open={open} onOpenChange={onOpenChange}>
|
|
103
|
-
<PopoverTrigger asChild>
|
|
104
|
-
<div className="size-full items-start text-start border-none p-0 shadow-none focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden line-clamp-1">
|
|
105
|
-
{displayLabel}
|
|
106
|
-
</div>
|
|
107
|
-
</PopoverTrigger>
|
|
108
|
-
<PopoverContent
|
|
109
|
-
data-grid-cell-editor=""
|
|
110
|
-
align="start"
|
|
111
|
-
sideOffset={sideOffset}
|
|
112
|
-
className="max-w-[500px] w-full rounded-none p-0"
|
|
113
|
-
onOpenAutoFocus={onOpenAutoFocus}
|
|
114
|
-
>
|
|
115
|
-
<Command>
|
|
116
|
-
<CommandList>
|
|
117
|
-
<CommandInput ref={inputRef} placeholder="Search..." className="h-auto flex-1 p-0" />
|
|
118
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
119
|
-
<CommandGroup>
|
|
120
|
-
{options.map((option) => (
|
|
121
|
-
<CommandItem
|
|
122
|
-
key={option.value}
|
|
123
|
-
onSelect={() => {
|
|
124
|
-
onValueChange(option.value)
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
<span>{option.label}</span>
|
|
128
|
-
{value === option.value ? <CheckIcon className="ml-auto h-4 w-4" /> : null}
|
|
129
|
-
</CommandItem>
|
|
130
|
-
))}
|
|
131
|
-
</CommandGroup>
|
|
132
|
-
</CommandList>
|
|
133
|
-
</Command>
|
|
134
|
-
</PopoverContent>
|
|
135
|
-
</Popover>
|
|
136
|
-
)
|
|
137
|
-
} else {
|
|
138
|
-
editingContent = (
|
|
139
|
-
<Select value={value} onValueChange={onValueChange} open={open} onOpenChange={onOpenChange}>
|
|
140
|
-
<SelectTrigger className="size-full items-start text-start border-none p-0 shadow-none focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden">
|
|
141
|
-
<SelectValue />
|
|
142
|
-
</SelectTrigger>
|
|
143
|
-
<SelectContent
|
|
144
|
-
data-grid-cell-editor=""
|
|
145
|
-
// compensate for the wrapper padding
|
|
146
|
-
align="start"
|
|
147
|
-
alignOffset={-8}
|
|
148
|
-
sideOffset={-2}
|
|
149
|
-
className="min-w-[calc(var(--radix-select-trigger-width)+16px)]"
|
|
150
|
-
>
|
|
151
|
-
{options.map((option) => (
|
|
152
|
-
<SelectItem key={option.value} value={option.value} spacing="sm">
|
|
153
|
-
{option.label}
|
|
154
|
-
</SelectItem>
|
|
155
|
-
))}
|
|
156
|
-
</SelectContent>
|
|
157
|
-
</Select>
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
return (
|
|
161
|
-
<DataGridCellWrapper
|
|
162
|
-
ref={containerRef}
|
|
163
|
-
cell={cell}
|
|
164
|
-
table={table}
|
|
165
|
-
rowIndex={rowIndex}
|
|
166
|
-
columnId={columnId}
|
|
167
|
-
isEditing={isEditing}
|
|
168
|
-
isFocused={isFocused}
|
|
169
|
-
isSelected={isSelected}
|
|
170
|
-
onKeyDown={onWrapperKeyDown}
|
|
171
|
-
>
|
|
172
|
-
{isEditing ? editingContent : <span data-slot="grid-cell-content">{displayLabel}</span>}
|
|
173
|
-
</DataGridCellWrapper>
|
|
174
|
-
)
|
|
175
|
-
}
|
package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/short-text-cell.tsx
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
import { DataGridCellWrapper } from '@components/ui/data-grid/data-grid-cell-wrapper'
|
|
4
|
-
|
|
5
|
-
import { CellVariantProps } from './cell-variant-types'
|
|
6
|
-
|
|
7
|
-
export function ShortTextCell<TData>({
|
|
8
|
-
cell,
|
|
9
|
-
table,
|
|
10
|
-
rowIndex,
|
|
11
|
-
columnId,
|
|
12
|
-
isEditing,
|
|
13
|
-
isFocused,
|
|
14
|
-
isSelected,
|
|
15
|
-
}: Readonly<CellVariantProps<TData, string>>) {
|
|
16
|
-
const initialValue = cell.getValue()
|
|
17
|
-
const [value, setValue] = React.useState(initialValue)
|
|
18
|
-
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
19
|
-
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
20
|
-
const meta = table.options.meta
|
|
21
|
-
const colMeta = cell.column.columnDef.meta
|
|
22
|
-
// Normalize editable to a resolver function and memoize to avoid typeof checks per cell
|
|
23
|
-
const editableResolver = React.useMemo(() => {
|
|
24
|
-
const v = colMeta?.editable
|
|
25
|
-
if (v === undefined) {
|
|
26
|
-
return () => true
|
|
27
|
-
}
|
|
28
|
-
return typeof v === 'function' ? (v as (row: TData) => boolean) : () => Boolean(v)
|
|
29
|
-
}, [colMeta?.editable])
|
|
30
|
-
const isEditable = editableResolver(cell.row.original)
|
|
31
|
-
|
|
32
|
-
const onBlur = React.useCallback(() => {
|
|
33
|
-
const currentValue = inputRef.current?.value ?? ''
|
|
34
|
-
if (currentValue !== initialValue) {
|
|
35
|
-
meta?.onDataUpdate?.({ rowIndex, columnId, value: currentValue })
|
|
36
|
-
}
|
|
37
|
-
meta?.onCellEditingStop?.()
|
|
38
|
-
}, [meta, rowIndex, columnId, initialValue])
|
|
39
|
-
const onChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
40
|
-
setValue(event.target.value)
|
|
41
|
-
}, [])
|
|
42
|
-
const handleEditingKeyDown = React.useCallback(
|
|
43
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
44
|
-
if (event.key === 'Enter') {
|
|
45
|
-
event.preventDefault()
|
|
46
|
-
const currentValue = inputRef.current?.value ?? ''
|
|
47
|
-
if (currentValue !== initialValue) {
|
|
48
|
-
meta?.onDataUpdate?.({ rowIndex, columnId, value: currentValue })
|
|
49
|
-
}
|
|
50
|
-
meta?.onCellEditingStop?.({ moveToNextRow: true })
|
|
51
|
-
} else if (event.key === 'Tab') {
|
|
52
|
-
event.preventDefault()
|
|
53
|
-
const currentValue = inputRef.current?.value ?? ''
|
|
54
|
-
if (currentValue !== initialValue) {
|
|
55
|
-
meta?.onDataUpdate?.({ rowIndex, columnId, value: currentValue })
|
|
56
|
-
}
|
|
57
|
-
meta?.onCellEditingStop?.({
|
|
58
|
-
direction: event.shiftKey ? 'left' : 'right',
|
|
59
|
-
})
|
|
60
|
-
} else if (event.key === 'Escape') {
|
|
61
|
-
event.preventDefault()
|
|
62
|
-
setValue(initialValue)
|
|
63
|
-
inputRef.current?.blur()
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
[initialValue, meta, rowIndex, columnId],
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
const handleFocusedKeyDown = React.useCallback(
|
|
70
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
71
|
-
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey) {
|
|
72
|
-
// For non-editable columns we must not change the displayed value when the user types while focused.
|
|
73
|
-
if (!isEditable) {
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Handle typing to pre-fill the value when editing starts
|
|
78
|
-
setValue(event.key)
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
[isEditable],
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
const onWrapperKeyDown = React.useCallback(
|
|
85
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
86
|
-
if (isEditing) {
|
|
87
|
-
handleEditingKeyDown(event)
|
|
88
|
-
} else if (isFocused) {
|
|
89
|
-
handleFocusedKeyDown(event)
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
[isEditing, isFocused, handleEditingKeyDown, handleFocusedKeyDown],
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
React.useEffect(() => {
|
|
96
|
-
setValue(initialValue)
|
|
97
|
-
}, [initialValue])
|
|
98
|
-
|
|
99
|
-
React.useEffect(() => {
|
|
100
|
-
if (isEditing && inputRef.current) {
|
|
101
|
-
inputRef.current.focus()
|
|
102
|
-
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length)
|
|
103
|
-
}
|
|
104
|
-
// Don't focus if we're in the middle of a scroll operation
|
|
105
|
-
if (isFocused && !isEditing && !meta?.searchOpen && !meta?.isScrolling && containerRef.current) {
|
|
106
|
-
containerRef.current.focus()
|
|
107
|
-
}
|
|
108
|
-
}, [isFocused, isEditing, meta?.searchOpen, meta?.isScrolling])
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<DataGridCellWrapper
|
|
112
|
-
ref={containerRef}
|
|
113
|
-
cell={cell}
|
|
114
|
-
table={table}
|
|
115
|
-
rowIndex={rowIndex}
|
|
116
|
-
columnId={columnId}
|
|
117
|
-
isEditing={isEditing}
|
|
118
|
-
isFocused={isFocused}
|
|
119
|
-
isSelected={isSelected}
|
|
120
|
-
onKeyDown={onWrapperKeyDown}
|
|
121
|
-
>
|
|
122
|
-
{isEditing ? (
|
|
123
|
-
<input
|
|
124
|
-
ref={inputRef}
|
|
125
|
-
type="text"
|
|
126
|
-
value={value ?? ''}
|
|
127
|
-
onBlur={onBlur}
|
|
128
|
-
onChange={onChange}
|
|
129
|
-
className="size-full bg-transparent outline-none"
|
|
130
|
-
/>
|
|
131
|
-
) : (
|
|
132
|
-
<div data-slot="grid-cell-content" className="size-full overflow-hidden outline-none">
|
|
133
|
-
{value}
|
|
134
|
-
</div>
|
|
135
|
-
)}
|
|
136
|
-
</DataGridCellWrapper>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react'
|
|
2
|
-
|
|
3
|
-
import { GanttTimerangePicker } from './gantt-timerange-picker'
|
|
4
|
-
|
|
5
|
-
// Gantt header component rendering the timeline scale
|
|
6
|
-
export const GanttTimeline = ({ header }: { header: any }) => {
|
|
7
|
-
const cellOpts = header.column.columnDef.meta?.cell
|
|
8
|
-
const containerRef = useRef<HTMLDivElement>(null)
|
|
9
|
-
if (!cellOpts) {
|
|
10
|
-
return null
|
|
11
|
-
}
|
|
12
|
-
const ts = cellOpts.dateRangeFrom ?? cellOpts.timelineStart
|
|
13
|
-
const te = cellOpts.dateRangeTo ?? cellOpts.timelineEnd
|
|
14
|
-
if (!(ts instanceof Date) || !(te instanceof Date)) {
|
|
15
|
-
return null
|
|
16
|
-
}
|
|
17
|
-
const timelineStartMs = ts.getTime()
|
|
18
|
-
const timelineEndMs = te.getTime()
|
|
19
|
-
if (timelineEndMs <= timelineStartMs) {
|
|
20
|
-
return null
|
|
21
|
-
}
|
|
22
|
-
const firstFullYear = ts.getFullYear() + 1
|
|
23
|
-
const totalYears = te.getFullYear() - ts.getFullYear() + 1
|
|
24
|
-
|
|
25
|
-
const scale = containerRef.current?.getBoundingClientRect().width
|
|
26
|
-
? containerRef.current.getBoundingClientRect().width / (totalYears ?? 1)
|
|
27
|
-
: 1
|
|
28
|
-
const showMonths = scale / 12 >= 5
|
|
29
|
-
|
|
30
|
-
const timelineDurationMs = timelineEndMs - timelineStartMs
|
|
31
|
-
const firstYearPartialMs = new Date(firstFullYear, 0, 1).getTime() - timelineStartMs
|
|
32
|
-
const lastYearPartialMs = timelineEndMs - new Date(te.getFullYear(), 0, 1).getTime()
|
|
33
|
-
|
|
34
|
-
const firstMonthPartialMs = new Date(ts.getFullYear(), ts.getMonth() + 1, 1).getTime() - timelineStartMs
|
|
35
|
-
const lastMonthPartialMs = timelineEndMs - new Date(te.getFullYear(), te.getMonth(), 1).getTime()
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<>
|
|
39
|
-
<div className="absolute right-8 top-1/2 z-10 -translate-y-1/2">
|
|
40
|
-
<GanttTimerangePicker
|
|
41
|
-
initialDateFrom={cellOpts.dateRangeFrom ?? undefined}
|
|
42
|
-
initialDateTo={cellOpts.dateRangeTo ?? undefined}
|
|
43
|
-
onRangeChange={cellOpts.onRangeChange ?? undefined}
|
|
44
|
-
timelineStart={cellOpts.timelineStart}
|
|
45
|
-
timelineEnd={cellOpts.timelineEnd}
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
<div ref={containerRef} className="pointer-events-none absolute left-0 right-0 bottom-0 z-0 h-3 flex px-1">
|
|
49
|
-
{Array.from({ length: totalYears }, (_, i) => firstFullYear + i - 1).map((year, index) => (
|
|
50
|
-
/* distribute space between years with flex-grow except for first and last as they might only be partial */
|
|
51
|
-
<div
|
|
52
|
-
key={year}
|
|
53
|
-
className="h-full relative flex grow border-l border-muted-foreground/30 first:border-none first:grow-0 last:grow-0 overflow-hidden"
|
|
54
|
-
style={
|
|
55
|
-
// index == 0: first year, index == totalYears -1: last year
|
|
56
|
-
index == 0 || index == totalYears - 1
|
|
57
|
-
? { width: `${((index == 0 ? firstYearPartialMs : lastYearPartialMs) / timelineDurationMs) * 100}%` }
|
|
58
|
-
: undefined
|
|
59
|
-
}
|
|
60
|
-
>
|
|
61
|
-
{showMonths && (
|
|
62
|
-
/* first month with calculated width as it might only be partial */
|
|
63
|
-
<div className="absolute bottom-0 left-0 right-0 flex h-1.5 w-full">
|
|
64
|
-
{index == 0 && ts.getMonth() < 11 && (
|
|
65
|
-
<div
|
|
66
|
-
className="h-full border-r border-dashed border-muted-foreground/30"
|
|
67
|
-
style={{ width: `${(firstMonthPartialMs / firstYearPartialMs) * 100}%` }}
|
|
68
|
-
/>
|
|
69
|
-
)}
|
|
70
|
-
{/* distribute rest of space between months with flex-grow */}
|
|
71
|
-
{Array.from({
|
|
72
|
-
length: (index == totalYears - 1 ? te.getMonth() : 12) - (index == 0 ? ts.getMonth() + 1 : 0),
|
|
73
|
-
}).map((_, monthIndex) => (
|
|
74
|
-
<div
|
|
75
|
-
key={`${year}-${monthIndex}`}
|
|
76
|
-
className="grow h-full border-r border-dashed border-muted-foreground/30 last:border-0"
|
|
77
|
-
/>
|
|
78
|
-
))}
|
|
79
|
-
{/* last month with calculated width as it might only be partial */}
|
|
80
|
-
{index == totalYears - 1 && te.getMonth() > 0 && (
|
|
81
|
-
<div className="h-full" style={{ width: `${(lastMonthPartialMs / lastYearPartialMs) * 100}%` }} />
|
|
82
|
-
)}
|
|
83
|
-
</div>
|
|
84
|
-
)}
|
|
85
|
-
|
|
86
|
-
<span className="ps-0.5 -mt-px text-xs text-muted-foreground select-none z-1">{year}</span>
|
|
87
|
-
</div>
|
|
88
|
-
))}
|
|
89
|
-
</div>
|
|
90
|
-
</>
|
|
91
|
-
)
|
|
92
|
-
}
|