impact-nova 2.1.0-alpha.1 → 2.1.0-alpha.10
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/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +3 -0
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +6 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +21 -21
- package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +1 -2
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.js +12 -6
- package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-editor.js +73 -94
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.d.ts +53 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.js +98 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +19 -19
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/switch-display-renderer.js +15 -15
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +33 -33
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +80 -73
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +66 -62
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +6 -6
- package/dist/components/data/ag-grid-react/headers/components/section-renderers.js +18 -18
- package/dist/components/data/ag-grid-react/headers/custom-header.js +112 -108
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.d.ts +12 -0
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +31 -0
- package/dist/components/data/ag-grid-react/headers/header-search-active-state.d.ts +10 -0
- package/dist/components/data/ag-grid-react/headers/header-search-active-state.js +38 -0
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
- package/dist/components/data/ag-grid-react/index.d.ts +3 -1
- package/dist/components/data/ag-grid-react/index.js +191 -167
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +7 -0
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +7 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
- package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
- package/dist/components/data/ag-grid-react/theme.js +92 -18
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +5 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +13 -0
- package/dist/components/data/ag-grid-react/useGridAutoSizeStrategyOnResize.js +8 -5
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +14 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +95 -0
- package/dist/components/data/data-table/column-indicator.d.ts +1 -1
- package/dist/components/data/data-table/column-indicator.js +15 -11
- package/dist/components/data/data-table/data-table-column-apply.d.ts +29 -0
- package/dist/components/data/data-table/data-table-column-apply.js +102 -0
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +30 -0
- package/dist/components/data/data-table/data-table-column-def-pin.js +66 -0
- package/dist/components/data/data-table/data-table-column-list-sync.d.ts +8 -0
- package/dist/components/data/data-table/data-table-column-list-sync.js +15 -0
- package/dist/components/data/data-table/data-table-column-list.d.ts +14 -4
- package/dist/components/data/data-table/data-table-column-list.js +74 -277
- package/dist/components/data/data-table/data-table-constants.d.ts +3 -4
- package/dist/components/data/data-table/data-table-context.d.ts +3 -6
- package/dist/components/data/data-table/data-table-context.js +21 -10
- package/dist/components/data/data-table/data-table-saved-views.js +61 -61
- package/dist/components/data/data-table/data-table-sheet-portal-store.d.ts +13 -0
- package/dist/components/data/data-table/data-table-sheet-portal-store.js +36 -0
- package/dist/components/data/data-table/data-table-sheet.d.ts +3 -6
- package/dist/components/data/data-table/data-table-sheet.js +19 -19
- package/dist/components/data/data-table/data-table-view-menu.js +40 -40
- package/dist/components/data/data-table/data-table.d.ts +8 -10
- package/dist/components/data/data-table/data-table.js +141 -109
- package/dist/components/data/data-table/data-table.types.d.ts +41 -0
- package/dist/components/data/data-table/index.js +28 -27
- package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
- package/dist/components/data/data-table/indicator-legend.js +19 -16
- package/dist/components/data/data-table/pin-switch.js +9 -9
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +16 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +225 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +8 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +72 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.d.ts +13 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.js +25 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.d.ts +6 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +41 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +31 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +233 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.d.ts +18 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +133 -0
- package/dist/components/data/expandable-list-item/expandable-list-item.d.ts +5 -0
- package/dist/components/data/{expandable-sku/expandable-sku.types.d.ts → expandable-list-item/expandable-list-item.types.d.ts} +7 -7
- package/dist/components/data/expandable-list-item/index.d.ts +5 -0
- package/dist/components/data/expandable-list-item/index.js +19 -0
- package/dist/components/data/nested-list/components/NestedListHeader.js +11 -11
- package/dist/components/data/nested-list/components/SortableItem.d.ts +3 -1
- package/dist/components/data/nested-list/components/SortableItem.js +111 -109
- package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
- package/dist/components/data/nested-list/nested-list.js +107 -97
- package/dist/components/data-display/avatar/avatar.types.d.ts +2 -0
- package/dist/components/data-display/badge/badge.types.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +11 -11
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +7 -7
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +31 -31
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +194 -189
- package/dist/components/data-display/card/card.js +8 -8
- package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
- package/dist/components/data-display/chart/chart-palette.js +28 -0
- package/dist/components/data-display/chart/chart.js +121 -115
- package/dist/components/data-display/chart/chart.types.d.ts +9 -0
- package/dist/components/data-display/chart/chart.utils.js +9 -6
- package/dist/components/data-display/chart/index.d.ts +1 -0
- package/dist/components/data-display/chart/index.js +15 -9
- package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
- package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
- package/dist/components/data-display/skeleton/skeleton.js +6 -6
- package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
- package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
- package/dist/components/data-display/statistics-card/statistics-card.js +135 -154
- package/dist/components/feedback/alert-dialog/alert-dialog.js +10 -10
- package/dist/components/feedback/dialog/dialog.js +4 -4
- package/dist/components/feedback/drawer/drawer.js +30 -30
- package/dist/components/feedback/dropdown-menu/dropdown-menu.js +68 -55
- package/dist/components/feedback/popover/popover.js +8 -1
- package/dist/components/feedback/sheet/sheet.js +9 -9
- package/dist/components/feedback/sheet/sheet.variants.js +1 -1
- package/dist/components/feedback/toast/toast.js +83 -92
- package/dist/components/feedback/tooltip/tooltip.js +22 -22
- package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
- package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
- package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
- package/dist/components/flows/command-palette/command-palette.js +226 -239
- package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
- package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
- package/dist/components/flows/command-palette/shortcut-settings.js +34 -34
- package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +99 -104
- package/dist/components/flows/filter-strip/filter-strip.js +36 -29
- package/dist/components/flows/filter-strip/filter-summary.js +43 -43
- package/dist/components/flows/filter-strip/filter-tag-list.js +52 -52
- package/dist/components/flows/notification-panel/notification-list.js +17 -17
- package/dist/components/flows/notification-panel/notification-panel.js +4 -4
- package/dist/components/flows/notification-panel/notification-panel.types.d.ts +3 -0
- package/dist/components/flows/wizard/wizard.js +29 -29
- package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
- package/dist/components/forms/choice-card/choice-card.js +156 -166
- package/dist/components/forms/combobox/combobox.js +83 -83
- package/dist/components/forms/date-picker/date-picker.js +42 -41
- package/dist/components/forms/date-picker/date-range-picker.js +3 -3
- package/dist/components/forms/date-picker/month-picker.js +1 -1
- package/dist/components/forms/date-picker/month-range-picker.js +42 -42
- package/dist/components/forms/date-picker/week-picker.js +15 -15
- package/dist/components/forms/date-picker/week-range-picker.js +3 -3
- package/dist/components/forms/file-upload/file-upload.js +322 -206
- package/dist/components/forms/file-upload/file-upload.types.d.ts +17 -2
- package/dist/components/forms/input/input.js +8 -8
- package/dist/components/forms/input/input.variants.js +3 -3
- package/dist/components/forms/prompt/prompt.js +47 -48
- package/dist/components/forms/select/components/SelectAllRow.js +14 -14
- package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
- package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
- package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
- package/dist/components/forms/select/components/SelectMenuPanel.d.ts +1 -2
- package/dist/components/forms/select/components/SelectMenuPanel.js +22 -24
- package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
- package/dist/components/forms/select/components/SelectTrigger.d.ts +9 -6
- package/dist/components/forms/select/components/SelectTrigger.js +119 -116
- package/dist/components/forms/select/components/Submenu.js +7 -7
- package/dist/components/forms/select/hooks/useSelectKeyboardHandlers.d.ts +1 -1
- package/dist/components/forms/select/hooks/useSelectValueState.d.ts +19 -0
- package/dist/components/forms/select/hooks/useSelectValueState.js +41 -0
- package/dist/components/forms/select/index.js +4 -3
- package/dist/components/forms/select/select.d.ts +5 -4
- package/dist/components/forms/select/select.js +190 -182
- package/dist/components/forms/select/select.types.d.ts +95 -203
- package/dist/components/forms/select/select.variants.js +5 -5
- package/dist/components/forms/select/utils/select.d.ts +2 -1
- package/dist/components/forms/select/utils/select.js +47 -37
- package/dist/components/forms/slider/slider.js +17 -17
- package/dist/components/forms/smart-input/smart-input.js +49 -49
- package/dist/components/forms/textarea/textarea.js +25 -25
- package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
- package/dist/components/layout/header/header.d.ts +5 -17
- package/dist/components/layout/header/header.js +127 -123
- package/dist/components/layout/header/header.types.d.ts +3 -0
- package/dist/components/layout/horizontal-scroller/index.d.ts +1 -0
- package/dist/components/layout/horizontal-scroller/index.js +3 -2
- package/dist/components/layout/sidebar/sidebar.d.ts +10 -51
- package/dist/components/layout/sidebar/sidebar.js +19 -17
- package/dist/components/layout/sidebar/sidebar.types.d.ts +35 -1
- package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
- package/dist/components/primitives/accordion/accordion.js +38 -41
- package/dist/components/primitives/button-group/button-group.js +32 -32
- package/dist/components/primitives/chips/chips.variants.js +5 -5
- package/dist/components/primitives/empty-container/empty-container.types.d.ts +3 -0
- package/dist/components/primitives/kbd/kbd.variants.js +4 -4
- package/dist/components/primitives/stepper/stepper.js +6 -6
- package/dist/components/primitives/tag/tag.variants.js +2 -2
- package/dist/components/ui/local-raster-icons/assets/excel-error-icon.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/assets/file-upload-error.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +2 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.js +32 -22
- package/dist/components/ui/show.d.ts +10 -0
- package/dist/components/ui/show.js +7 -0
- package/dist/components/ui/show.types.d.ts +5 -0
- package/dist/i18n/defaultMessages.d.ts +19 -0
- package/dist/i18n/defaultMessages.js +27 -13
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +14 -0
- package/dist/i18n/locales/es.js +14 -0
- package/dist/i18n/locales/hi.js +14 -0
- package/dist/i18n/locales/kn.js +14 -0
- package/dist/impact-nova-base.scss +14 -7
- package/dist/impact-nova-components.css +257 -21
- package/dist/impact-nova-tokens.scss +359 -179
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +535 -493
- package/dist/lib/compose-refs.d.ts +8 -0
- package/dist/lib/compose-refs.js +14 -0
- package/dist/lib/primitives/create-component.d.ts +1 -1
- package/dist/lib/primitives/create-component.js +4 -4
- package/dist/lib/primitives/field.js +17 -18
- package/dist/lib/primitives/field.types.d.ts +8 -2
- package/dist/lib/resolve-design-token-color.d.ts +5 -0
- package/dist/lib/resolve-design-token-color.js +12 -0
- package/dist/lib/virtualized/index.d.ts +3 -0
- package/dist/lib/virtualized/index.js +33 -16
- package/dist/lib/virtualized/useVirtualizedList.d.ts +2 -0
- package/dist/lib/virtualized/useVirtualizedList.js +115 -109
- package/dist/lib/virtualized/virtualized-list-context.d.ts +12 -0
- package/dist/lib/virtualized/virtualized-list-context.js +21 -0
- package/dist/lib/virtualized/virtualized-list-parts.d.ts +50 -0
- package/dist/lib/virtualized/virtualized-list-parts.js +175 -0
- package/dist/lib/virtualized/virtualized-list-utils.d.ts +5 -0
- package/dist/lib/virtualized/virtualized-list-utils.js +6 -0
- package/dist/lib/virtualized/virtualized.types.d.ts +10 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/tailwind.config.js +320 -0
- package/dist/theme/tailwind-colors.js +201 -0
- package/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
- package/dist/theme/tokens/chart-series-palette.json.js +7 -0
- package/package.json +58 -270
- package/tailwind.config.d.ts +3 -0
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.d.ts +0 -15
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.js +0 -27
- package/dist/components/data/ag-grid-react/headers/custom-header-group.d.ts +0 -10
- package/dist/components/data/ag-grid-react/headers/custom-header-group.js +0 -47
- package/dist/components/data/expandable-sku/expandable-sku.d.ts +0 -38
- package/dist/components/data/expandable-sku/expandable-sku.js +0 -245
- package/dist/components/data/expandable-sku/index.d.ts +0 -2
- package/dist/components/data/expandable-sku/index.js +0 -4
- package/tailwind.config.js +0 -334
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ColDef, ColGroupDef, IHeaderParams, IHeaderGroupParams, Column, ValueFormatterParams } from 'ag-grid-community';
|
|
3
|
+
import { Theme } from 'ag-grid-enterprise';
|
|
3
4
|
import { AgGridReactProps } from 'ag-grid-react';
|
|
4
5
|
/** ColDef extended with Impact Nova runtime metadata set during column processing */
|
|
5
6
|
export interface ImpactNovaColDef<TData = unknown> extends ColDef<TData> {
|
|
@@ -107,42 +108,41 @@ export interface InfoContent {
|
|
|
107
108
|
sections: UISection[];
|
|
108
109
|
}
|
|
109
110
|
/**
|
|
110
|
-
* Props for
|
|
111
|
+
* Props for `AgGridWrapper` — low-level AG Grid Enterprise surface.
|
|
112
|
+
*
|
|
113
|
+
* Forwards [`AgGridReact`](https://www.ag-grid.com/react-data-grid/grid-options/) props except `theme`
|
|
114
|
+
* (Impact Nova theme is applied internally). Application feature code should use
|
|
115
|
+
* `DataTable` / `DataTableContent` from `impact-nova/data-table` instead.
|
|
111
116
|
*/
|
|
112
117
|
export interface AgGridWrapperProps<TData = unknown> extends Omit<AgGridReactProps<TData>, 'theme' | 'defaultColDef' | 'defaultColGroupDef'> {
|
|
113
|
-
/**
|
|
114
|
-
* Children to render inside the grid container
|
|
115
|
-
*/
|
|
118
|
+
/** Content rendered inside the grid container — rarely needed; use for overlays or custom chrome. */
|
|
116
119
|
children?: ReactNode;
|
|
117
120
|
/**
|
|
118
|
-
* Default
|
|
121
|
+
* Default settings applied to every column unless overridden in `columnDefs`.
|
|
122
|
+
* Common keys: `sortable`, `filter`, `resizable`, `flex`, `minWidth`.
|
|
123
|
+
* Merged with Impact Nova wrapper defaults (custom header, theme, formatters).
|
|
119
124
|
*/
|
|
120
125
|
defaultColDef?: ColDef<TData>;
|
|
121
126
|
/**
|
|
122
|
-
* Default column
|
|
127
|
+
* Default settings for column groups (nested header rows).
|
|
128
|
+
* Merged with wrapper defaults when using grouped column headers.
|
|
123
129
|
*/
|
|
124
130
|
defaultColGroupDef?: ColGroupDef<TData>;
|
|
125
131
|
/**
|
|
126
|
-
* When true (default), DOM order matches visual order for screen readers.
|
|
127
|
-
*
|
|
132
|
+
* When true (default), DOM order matches visual column order for screen readers.
|
|
133
|
+
* Set false on very large planning grids (10k+ columns) for better virtualization performance.
|
|
128
134
|
*/
|
|
129
135
|
ensureDomOrder?: boolean;
|
|
130
136
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* ```typescript
|
|
136
|
-
* valueFormatters={{
|
|
137
|
-
* currency: (params) => `$${params.value.toFixed(2)}`,
|
|
138
|
-
* percentage: (params) => `${params.value}%`,
|
|
139
|
-
* }}
|
|
140
|
-
*
|
|
141
|
-
* // Backend can then send:
|
|
142
|
-
* { field: 'price', valueFormatter: 'currency' }
|
|
143
|
-
* ```
|
|
137
|
+
* Map of formatter name → function. Lets backend column defs reference formatters by string key.
|
|
138
|
+
* Example: `{ currency: (p) => '$' + p.value }` then column def uses `valueFormatter: 'currency'`.
|
|
144
139
|
*/
|
|
145
140
|
valueFormatters?: Record<string, (params: ValueFormatterParams) => string>;
|
|
141
|
+
/**
|
|
142
|
+
* Theme Builder preview only — resolves AG Grid params from a scoped DOM node.
|
|
143
|
+
* Application code must rely on document CSS variables and the default theme.
|
|
144
|
+
*/
|
|
145
|
+
themeOverride?: Theme;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Filter operators for advanced filtering.
|
|
@@ -44,7 +44,7 @@ const D = (t, i) => {
|
|
|
44
44
|
className: `flex w-full items-center justify-between rounded-[8px] px-1.5 h-7 ${a ? "bg-canvas-elevated cursor-pointer" : "bg-inherit"}`,
|
|
45
45
|
children: [
|
|
46
46
|
/* @__PURE__ */ n("span", { className: `truncate text-sm font-medium text-content ${f ? "text-content-empty" : ""}`, children: f ? g : u }),
|
|
47
|
-
a && /* @__PURE__ */ n("span", { className: "h-3.5 w-3.5 shrink-0 text-content-
|
|
47
|
+
a && /* @__PURE__ */ n("span", { className: "h-3.5 w-3.5 shrink-0 text-content-icon", children: /* @__PURE__ */ n(y, { className: "h-3.5 w-3.5" }) })
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICellRendererParams } from 'ag-grid-community';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Stable module-level reference — avoids inline function allocation in defaultColDef.
|
|
3
|
+
* Default text cell renderer — truncation + AG Grid tooltip when overflowed.
|
|
5
4
|
*/
|
|
6
5
|
export declare const DefaultTextCellRenderer: import('react').NamedExoticComponent<ICellRendererParams<any, any, any>>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as u, useRef as f, useEffect as i } from "react";
|
|
3
|
+
import { isAgGridTextOverflowing as s } from "../ag-grid-tooltip-overflow.js";
|
|
4
|
+
const x = u(function(e) {
|
|
5
|
+
const r = f(null), t = e.valueFormatted ?? (e.value != null ? String(e.value) : ""), { setTooltip: l } = e;
|
|
6
|
+
return i(() => {
|
|
7
|
+
t.trim() && l(t, () => {
|
|
8
|
+
const n = r.current;
|
|
9
|
+
return n ? s(n, "ellipsis") : !1;
|
|
10
|
+
});
|
|
11
|
+
}, [t, l]), /* @__PURE__ */ o("span", { ref: r, className: "truncate block w-full", children: t });
|
|
6
12
|
});
|
|
7
13
|
export {
|
|
8
|
-
|
|
14
|
+
x as DefaultTextCellRenderer
|
|
9
15
|
};
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import { jsxs as Z, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import ee, { forwardRef as te, useRef as d, useMemo as
|
|
2
|
+
import ee, { forwardRef as te, useRef as d, useMemo as O, useState as P, useImperativeHandle as ne, useEffect as C, useCallback as E } from "react";
|
|
3
3
|
import { createPortal as re } from "react-dom";
|
|
4
4
|
function oe(r) {
|
|
5
5
|
if ("options" in r && r.options) return r.options;
|
|
6
6
|
const f = [];
|
|
7
7
|
if (!r || r.step <= 0 || r.min > r.max) return f;
|
|
8
8
|
for (let n = r.min; n <= r.max; n += r.step) {
|
|
9
|
-
const
|
|
10
|
-
f.push(String(
|
|
9
|
+
const x = Math.round(n * 1e10) / 1e10;
|
|
10
|
+
f.push(String(x));
|
|
11
11
|
}
|
|
12
12
|
return f;
|
|
13
13
|
}
|
|
14
14
|
function ae(r, f) {
|
|
15
15
|
if (!f) return r;
|
|
16
16
|
const n = f.toLowerCase();
|
|
17
|
-
return r.filter((
|
|
17
|
+
return r.filter((x) => x.toLowerCase().includes(n));
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const K = te((r, f) => {
|
|
20
20
|
const {
|
|
21
21
|
value: n,
|
|
22
|
-
placeholder:
|
|
23
|
-
min:
|
|
24
|
-
max:
|
|
25
|
-
step:
|
|
22
|
+
placeholder: x,
|
|
23
|
+
min: F,
|
|
24
|
+
max: U,
|
|
25
|
+
step: _,
|
|
26
26
|
maxLength: D,
|
|
27
27
|
onValueChange: p,
|
|
28
28
|
colDef: q,
|
|
29
29
|
className: z,
|
|
30
30
|
autocompleteRule: w
|
|
31
|
-
} = r,
|
|
31
|
+
} = r, u = q?.cellDataType === "number", G = w ? "text" : u ? "number" : "text", i = d(null), a = !!w, S = O(
|
|
32
32
|
() => w ? oe(w) : [],
|
|
33
33
|
[w]
|
|
34
|
-
), [c, J] = P(""), [b,
|
|
34
|
+
), [c, J] = P(""), [b, v] = P(-1), M = d(-1);
|
|
35
35
|
M.current = b;
|
|
36
|
-
const g = d("keyboard"), H = d(null), A = d(null), L = d(null), I = d(!1), [R, Q] = P(null), s =
|
|
37
|
-
|
|
36
|
+
const g = d("keyboard"), H = d(null), A = d(null), L = d(null), I = d(!1), [R, Q] = P(null), s = O(() => ae(S, c), [S, c]), B = d(s);
|
|
37
|
+
B.current = s;
|
|
38
38
|
const y = n && typeof n == "object" && "value" in n, N = y ? n.cellMetadata : void 0, W = y ? n.value : n;
|
|
39
39
|
ne(f, () => ({
|
|
40
40
|
getValue() {
|
|
41
41
|
if (a) {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
42
|
+
const l = H.current;
|
|
43
|
+
if (l == null)
|
|
44
44
|
return n;
|
|
45
|
-
const h = Number(
|
|
45
|
+
const h = Number(l), $ = u && !isNaN(h) ? h : l;
|
|
46
46
|
return y ? {
|
|
47
|
-
value:
|
|
47
|
+
value: $,
|
|
48
48
|
...N !== void 0 && { cellMetadata: N }
|
|
49
|
-
} :
|
|
49
|
+
} : $;
|
|
50
50
|
}
|
|
51
51
|
const t = i.current?.value;
|
|
52
52
|
let o;
|
|
53
|
-
if (
|
|
53
|
+
if (u)
|
|
54
54
|
if (!t || t === "" || t === "-")
|
|
55
55
|
o = null;
|
|
56
56
|
else {
|
|
57
|
-
const
|
|
58
|
-
o = isNaN(
|
|
57
|
+
const l = Number(t);
|
|
58
|
+
o = isNaN(l) ? null : l;
|
|
59
59
|
}
|
|
60
60
|
else
|
|
61
61
|
o = t === "" ? null : t;
|
|
@@ -70,18 +70,18 @@ const O = te((r, f) => {
|
|
|
70
70
|
isCancelAfterEnd() {
|
|
71
71
|
return !1;
|
|
72
72
|
}
|
|
73
|
-
}), [a,
|
|
73
|
+
}), [a, u, y, N, n]), C(() => {
|
|
74
74
|
if (i.current) {
|
|
75
75
|
const e = n && typeof n == "object" && "value" in n ? n.value : n;
|
|
76
|
-
if (i.current.value = e != null ? String(e) : "",
|
|
76
|
+
if (i.current.value = e != null ? String(e) : "", u) {
|
|
77
77
|
const t = i.current, o = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
|
|
78
78
|
Object.defineProperty(t, "value", {
|
|
79
79
|
get() {
|
|
80
|
-
const
|
|
81
|
-
return isNaN(
|
|
80
|
+
const l = this.valueAsNumber;
|
|
81
|
+
return isNaN(l) ? o.get.call(this) : l;
|
|
82
82
|
},
|
|
83
|
-
set(
|
|
84
|
-
o.set.call(this,
|
|
83
|
+
set(l) {
|
|
84
|
+
o.set.call(this, l);
|
|
85
85
|
},
|
|
86
86
|
configurable: !0
|
|
87
87
|
});
|
|
@@ -90,16 +90,16 @@ const O = te((r, f) => {
|
|
|
90
90
|
}
|
|
91
91
|
return () => {
|
|
92
92
|
};
|
|
93
|
-
}, [n,
|
|
93
|
+
}, [n, u, r.suppressAutoFocus]);
|
|
94
94
|
const j = E(() => {
|
|
95
95
|
I.current || (I.current = !0, r.stopEditing?.());
|
|
96
96
|
}, [r]), V = E((e) => {
|
|
97
97
|
if (H.current = e, p) {
|
|
98
|
-
const t = Number(e), o =
|
|
98
|
+
const t = Number(e), o = u && !isNaN(t) ? t : e;
|
|
99
99
|
p(o);
|
|
100
100
|
}
|
|
101
101
|
I.current = !0, r.stopEditing?.();
|
|
102
|
-
}, [
|
|
102
|
+
}, [u, p, r]), k = d(V);
|
|
103
103
|
k.current = V, C(() => {
|
|
104
104
|
if (a && L.current) {
|
|
105
105
|
const e = L.current.getBoundingClientRect();
|
|
@@ -108,9 +108,9 @@ const O = te((r, f) => {
|
|
|
108
108
|
}, [a]), C(() => {
|
|
109
109
|
if (!a) return;
|
|
110
110
|
const e = k, t = (o) => {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const h =
|
|
111
|
+
const l = o.target.closest?.("[data-autocomplete-value]");
|
|
112
|
+
if (l && A.current?.contains(l)) {
|
|
113
|
+
const h = l.getAttribute("data-autocomplete-value");
|
|
114
114
|
h != null && (o.stopImmediatePropagation(), o.preventDefault(), e.current(h));
|
|
115
115
|
}
|
|
116
116
|
};
|
|
@@ -119,11 +119,11 @@ const O = te((r, f) => {
|
|
|
119
119
|
a && b >= 0 && A.current && A.current.querySelectorAll("[data-autocomplete-item]")[b]?.scrollIntoView({ block: "nearest" });
|
|
120
120
|
}, [b, a]), C(() => {
|
|
121
121
|
if (!a || !c) {
|
|
122
|
-
|
|
122
|
+
v(-1);
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
const e = s.findIndex((t) => t.toLowerCase() === c.toLowerCase());
|
|
126
|
-
g.current = "mouse",
|
|
126
|
+
g.current = "mouse", v(e >= 0 ? e : -1);
|
|
127
127
|
}, [a, c, s]);
|
|
128
128
|
const X = E(() => {
|
|
129
129
|
const e = i.current?.value;
|
|
@@ -132,34 +132,34 @@ const O = te((r, f) => {
|
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
if (!(D && e && e.length > D)) {
|
|
135
|
-
if (
|
|
135
|
+
if (u && i.current) {
|
|
136
136
|
const t = i.current.valueAsNumber;
|
|
137
137
|
isNaN(t) || i.current.setAttribute("data-value", String(t));
|
|
138
138
|
}
|
|
139
139
|
p?.(e);
|
|
140
140
|
}
|
|
141
|
-
}, [D, p,
|
|
141
|
+
}, [D, p, u, a]), T = E((e) => {
|
|
142
142
|
if (a) {
|
|
143
143
|
if (e.key === "Escape") {
|
|
144
144
|
e.stopPropagation(), j();
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (e.key === "ArrowDown") {
|
|
148
|
-
e.preventDefault(), e.stopPropagation(), g.current = "keyboard",
|
|
148
|
+
e.preventDefault(), e.stopPropagation(), g.current = "keyboard", v((t) => t < s.length - 1 ? t + 1 : 0);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
if (e.key === "ArrowUp") {
|
|
152
|
-
e.preventDefault(), e.stopPropagation(), g.current = "keyboard",
|
|
152
|
+
e.preventDefault(), e.stopPropagation(), g.current = "keyboard", v((t) => t > 0 ? t - 1 : s.length - 1);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
if (e.key === "Enter" || e.key === "Tab") {
|
|
156
156
|
e.preventDefault(), e.stopPropagation(), e.nativeEvent.stopImmediatePropagation();
|
|
157
|
-
const t = M.current, o =
|
|
157
|
+
const t = M.current, o = B.current;
|
|
158
158
|
if (t >= 0 && t < o.length)
|
|
159
159
|
k.current(o[t]);
|
|
160
160
|
else {
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const l = o.find((h) => h.toLowerCase() === c.toLowerCase());
|
|
162
|
+
l ? k.current(l) : j();
|
|
163
163
|
}
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
@@ -190,25 +190,25 @@ const O = te((r, f) => {
|
|
|
190
190
|
{
|
|
191
191
|
ref: L,
|
|
192
192
|
className: `w-full h-full flex items-center ag-cell-inner-padding in-ag-editable-cell-highlight ${z ?? ""}`,
|
|
193
|
-
onKeyDownCapture: a ?
|
|
193
|
+
onKeyDownCapture: a ? T : void 0,
|
|
194
194
|
children: [
|
|
195
195
|
/* @__PURE__ */ m(
|
|
196
196
|
"div",
|
|
197
197
|
{
|
|
198
|
-
className: `flex w-full items-center rounded-[8px] bg-canvas-elevated px-1.5 h-7 ${
|
|
198
|
+
className: `flex w-full items-center rounded-[8px] bg-canvas-elevated px-1.5 h-7 ${u ? "justify-end text-right" : ""}`,
|
|
199
199
|
children: /* @__PURE__ */ m(
|
|
200
200
|
"input",
|
|
201
201
|
{
|
|
202
202
|
ref: i,
|
|
203
203
|
type: G,
|
|
204
204
|
onChange: X,
|
|
205
|
-
onKeyDown: a ? void 0 :
|
|
205
|
+
onKeyDown: a ? void 0 : T,
|
|
206
206
|
onBlur: Y,
|
|
207
|
-
placeholder:
|
|
208
|
-
className: `flex h-full w-full bg-transparent p-0 text-sm font-medium text-content outline-none placeholder:font-medium placeholder:text-content-empty ${
|
|
209
|
-
min: a ? void 0 :
|
|
210
|
-
max: a ? void 0 :
|
|
211
|
-
step: a ? void 0 :
|
|
207
|
+
placeholder: x,
|
|
208
|
+
className: `flex h-full w-full bg-transparent p-0 text-sm font-medium text-content outline-none placeholder:font-medium placeholder:text-content-empty ${u ? "text-right" : ""}`,
|
|
209
|
+
min: a ? void 0 : F,
|
|
210
|
+
max: a ? void 0 : U,
|
|
211
|
+
step: a ? void 0 : _
|
|
212
212
|
}
|
|
213
213
|
)
|
|
214
214
|
}
|
|
@@ -218,7 +218,7 @@ const O = te((r, f) => {
|
|
|
218
218
|
"div",
|
|
219
219
|
{
|
|
220
220
|
ref: A,
|
|
221
|
-
className: "fixed z-[9999] overflow-hidden rounded-[12px] bg-
|
|
221
|
+
className: "fixed z-[9999] overflow-hidden rounded-[12px] bg-canvas-elevated text-base shadow-elevation-select focus:outline-none sm:text-sm flex flex-col border-none",
|
|
222
222
|
style: { top: R.top, left: R.left, width: R.width, maxHeight: 250 },
|
|
223
223
|
children: /* @__PURE__ */ m(
|
|
224
224
|
"div",
|
|
@@ -227,10 +227,10 @@ const O = te((r, f) => {
|
|
|
227
227
|
style: { maxHeight: 240, overscrollBehavior: "contain" },
|
|
228
228
|
role: "listbox",
|
|
229
229
|
onMouseLeave: () => {
|
|
230
|
-
g.current = "mouse",
|
|
230
|
+
g.current = "mouse", v(-1);
|
|
231
231
|
},
|
|
232
|
-
children: s.length === 0 ? /* @__PURE__ */ m("div", { className: "flex items-center justify-center py-6 text-sm text-
|
|
233
|
-
const o = t === b,
|
|
232
|
+
children: s.length === 0 ? /* @__PURE__ */ m("div", { className: "flex items-center justify-center py-6 text-sm text-content-secondary", children: "No options found" }) : s.map((e, t) => {
|
|
233
|
+
const o = t === b, l = e === String(W ?? "");
|
|
234
234
|
return /* @__PURE__ */ m(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
@@ -241,10 +241,10 @@ const O = te((r, f) => {
|
|
|
241
241
|
"data-autocomplete-item": !0,
|
|
242
242
|
role: "option",
|
|
243
243
|
"aria-selected": o,
|
|
244
|
-
className: `cursor-default select-none py-[6px] px-3 flex items-center ${
|
|
244
|
+
className: `cursor-default select-none py-[6px] px-3 flex items-center ${u ? "justify-end text-right" : "justify-between"} transition-colors rounded-md ${o && g.current === "keyboard" ? "ring-2 ring-inset ring-primary bg-accent text-content" : o && g.current === "mouse" ? "bg-muted text-content" : l ? "bg-accent text-content" : "text-content hover:bg-muted cursor-pointer"}`,
|
|
245
245
|
"data-autocomplete-value": e,
|
|
246
246
|
onMouseEnter: () => {
|
|
247
|
-
g.current = "mouse",
|
|
247
|
+
g.current = "mouse", v(t);
|
|
248
248
|
},
|
|
249
249
|
children: /* @__PURE__ */ m("span", { className: "text-sm", children: e })
|
|
250
250
|
}
|
|
@@ -263,8 +263,8 @@ const O = te((r, f) => {
|
|
|
263
263
|
}
|
|
264
264
|
);
|
|
265
265
|
});
|
|
266
|
-
|
|
267
|
-
const se = ee.memo(
|
|
266
|
+
K.displayName = "InputCellEditor";
|
|
267
|
+
const se = ee.memo(K, () => !0);
|
|
268
268
|
export {
|
|
269
269
|
se as InputCellEditor
|
|
270
270
|
};
|
|
@@ -1,127 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useState as F, useImperativeHandle as B, useEffect as H, useMemo as L, useCallback as M } from "react";
|
|
3
|
+
import { resolveValueFormatter as q, applyValueFormatter as J, resolveCellEditable as I } from "../cell-renderer-utils.js";
|
|
4
|
+
import { initializeSplitCellFocusSession as Q } from "./split-cell-focus.js";
|
|
5
|
+
function X() {
|
|
5
6
|
return document;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
function Y(p, w, a, u, r) {
|
|
9
|
+
const n = a, s = typeof u?.editable == "boolean" ? u.editable : void 0, f = p[w], i = f?.field?.split(".")?.pop(), l = i ? r?.[i] : void 0;
|
|
10
|
+
return I(s, f?.editable, n, l);
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
-
const { splits:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
const h = Y().__splitCellLastClickY;
|
|
28
|
-
if (h == null)
|
|
29
|
-
return { index: e, wasEditable: t, clearClickY: a, activeIndex: o };
|
|
30
|
-
const w = d.getBoundingClientRect(), K = h - w.top, E = w.height / l.length, F = Math.floor(K / E);
|
|
31
|
-
return e = Math.max(0, Math.min(F, l.length - 1)), a = !0, o = e, t = A(l, e, r, i, n), { index: e, wasEditable: t, clearClickY: a, activeIndex: o };
|
|
32
|
-
} catch {
|
|
33
|
-
return { index: 0, wasEditable: !0, clearClickY: !1, activeIndex: void 0 };
|
|
34
|
-
}
|
|
35
|
-
}, [l, g, S, r, i, n]);
|
|
36
|
-
R(() => {
|
|
37
|
-
const e = Y();
|
|
38
|
-
v.clearClickY && (e.__splitCellLastClickY = void 0), v.activeIndex != null && (e.__splitCellLastActiveIndex = v.activeIndex), e.__splitCellLastWasEditable = v.wasEditable;
|
|
39
|
-
}, [v]);
|
|
40
|
-
const k = v.index, y = x(() => {
|
|
41
|
-
if (!l?.length) return !1;
|
|
42
|
-
const e = l[k];
|
|
43
|
-
if (!e) return !1;
|
|
44
|
-
const t = r, a = typeof i?.editable == "boolean" ? i.editable : void 0, o = e.field?.split(".")?.pop(), d = o ? n?.[o] : void 0;
|
|
45
|
-
return !D(a, e.editable, t, d);
|
|
46
|
-
}, [l, k, r, i, n]) || S && !M;
|
|
47
|
-
B(_, () => ({
|
|
12
|
+
const Z = z((p, w) => {
|
|
13
|
+
const { splits: a, commonParams: u, data: r, node: n, api: s, column: f, context: i, value: l, colDef: o, valueFormatter: U, eventKey: D } = p, [N] = F(() => {
|
|
14
|
+
const e = p.eGridCell;
|
|
15
|
+
return Q({
|
|
16
|
+
cellElement: e,
|
|
17
|
+
splits: a,
|
|
18
|
+
eventKey: D,
|
|
19
|
+
data: r,
|
|
20
|
+
colDef: o,
|
|
21
|
+
value: l,
|
|
22
|
+
documentState: X(),
|
|
23
|
+
resolveSplitEditable: Y
|
|
24
|
+
});
|
|
25
|
+
}), { targetSplitIndex: k, isKeyboardEntry: A, lastWasEditable: P, targetIsNonEditable: R } = N, v = R || A && !P;
|
|
26
|
+
B(w, () => ({
|
|
48
27
|
getValue() {
|
|
49
|
-
const e =
|
|
50
|
-
return e &&
|
|
28
|
+
const e = o?.field;
|
|
29
|
+
return e && n?.data ? n.data[e] : l;
|
|
51
30
|
},
|
|
52
31
|
isCancelBeforeStart() {
|
|
53
|
-
return
|
|
32
|
+
return v;
|
|
54
33
|
},
|
|
55
34
|
isCancelAfterEnd() {
|
|
56
35
|
return !1;
|
|
57
36
|
}
|
|
58
|
-
}), [
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
}), [o, n, l, v]), H(() => {
|
|
38
|
+
v && setTimeout(() => {
|
|
39
|
+
s?.stopEditing();
|
|
61
40
|
}, 0);
|
|
62
|
-
}, [
|
|
63
|
-
const j =
|
|
64
|
-
const t = e?.field?.split(".")?.pop() ?? "",
|
|
65
|
-
return { valueKey: t, field: e.field, newValue:
|
|
66
|
-
}) ?? [], [
|
|
67
|
-
const t =
|
|
68
|
-
if (!t || !
|
|
69
|
-
const
|
|
70
|
-
if (String(t.newValue ?? "") === String(
|
|
41
|
+
}, [v, s]);
|
|
42
|
+
const j = L(() => a?.map((e) => {
|
|
43
|
+
const t = e?.field?.split(".")?.pop() ?? "", d = l?.[t]?.value;
|
|
44
|
+
return { valueKey: t, field: e.field, newValue: d };
|
|
45
|
+
}) ?? [], [a, l]), [g, O] = F(j), $ = M((e) => {
|
|
46
|
+
const t = g.find((b) => b.field === e);
|
|
47
|
+
if (!t || !o.field) return;
|
|
48
|
+
const d = l?.[t.valueKey]?.value;
|
|
49
|
+
if (String(t.newValue ?? "") === String(d ?? ""))
|
|
71
50
|
return;
|
|
72
51
|
document.__splitCellLastWasEditable = !0;
|
|
73
|
-
const
|
|
74
|
-
api:
|
|
75
|
-
colDef:
|
|
76
|
-
column:
|
|
77
|
-
context:
|
|
52
|
+
const c = {
|
|
53
|
+
api: s,
|
|
54
|
+
colDef: o,
|
|
55
|
+
column: f,
|
|
56
|
+
context: i,
|
|
78
57
|
data: r,
|
|
79
|
-
field:
|
|
80
|
-
node:
|
|
81
|
-
rowIndex:
|
|
82
|
-
rowPinned:
|
|
58
|
+
field: o.field,
|
|
59
|
+
node: n,
|
|
60
|
+
rowIndex: n?.rowIndex ?? null,
|
|
61
|
+
rowPinned: n?.rowPinned ?? void 0,
|
|
83
62
|
source: "edit",
|
|
84
63
|
type: "cellValueChanged",
|
|
85
64
|
currentCellUpdate: t,
|
|
86
65
|
newValue: { [t.valueKey]: { value: t.newValue } },
|
|
87
|
-
oldValue: { [t.valueKey]: { value:
|
|
66
|
+
oldValue: { [t.valueKey]: { value: l?.[t.valueKey]?.value } },
|
|
88
67
|
value: { [t.valueKey]: { value: t.newValue } }
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
}, [
|
|
68
|
+
}, m = l?.[t.valueKey] ?? {};
|
|
69
|
+
n.setDataValue(o.field, { ...l, [t.valueKey]: { ...m, value: t.newValue } }), i?.onCellUpdate?.(c);
|
|
70
|
+
}, [g, s, o, f, i, r, n, l]), G = (e) => {
|
|
92
71
|
if (typeof e == "string") {
|
|
93
|
-
const t =
|
|
94
|
-
return
|
|
72
|
+
const t = s?.getGridOption("components");
|
|
73
|
+
return i?.frameworkComponents?.[e] || t?.[e];
|
|
95
74
|
}
|
|
96
75
|
return e;
|
|
97
76
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
|
|
77
|
+
return /* @__PURE__ */ C("div", { style: { display: "grid", gridTemplateRows: `repeat(${a?.length}, 1fr)`, height: "100%", width: "100%" }, children: a?.map((e, t) => {
|
|
78
|
+
const d = e?.field?.split(".")?.pop();
|
|
79
|
+
if (!d) return null;
|
|
80
|
+
const c = l?.[d], m = c?.value, b = r, V = q(c, b, e?.valueFormatter, U ?? null), h = V ? J(V, m) : m?.toString(), T = typeof o?.editable == "boolean" ? o.editable : void 0, y = I(T, e.editable, b, c), W = t === k && y, E = y ? u?.cellEditor ?? u?.cellRenderer : u?.cellRenderer ?? void 0, S = E ? G(E) : void 0;
|
|
81
|
+
return /* @__PURE__ */ C("div", { className: "flex items-center max-h-full overflow-hidden", children: S ? /* @__PURE__ */ C(
|
|
82
|
+
S,
|
|
104
83
|
{
|
|
105
|
-
context:
|
|
84
|
+
context: i,
|
|
106
85
|
data: r,
|
|
107
|
-
value:
|
|
108
|
-
onValueChange: (
|
|
109
|
-
const
|
|
110
|
-
|
|
86
|
+
value: c,
|
|
87
|
+
onValueChange: (x) => {
|
|
88
|
+
const K = g.find((_) => _.field === e.field);
|
|
89
|
+
K ? K.newValue = x : O([...g, { valueKey: d, field: e.field, newValue: x }]);
|
|
111
90
|
},
|
|
112
|
-
valueFormatted:
|
|
113
|
-
colDef: { ...e, editable:
|
|
91
|
+
valueFormatted: h ?? void 0,
|
|
92
|
+
colDef: { ...e, editable: y },
|
|
114
93
|
stopEditing: () => {
|
|
115
|
-
|
|
94
|
+
$(e.field);
|
|
116
95
|
},
|
|
117
|
-
node:
|
|
118
|
-
suppressAutoFocus: !
|
|
119
|
-
className: t !==
|
|
96
|
+
node: n,
|
|
97
|
+
suppressAutoFocus: !W,
|
|
98
|
+
className: t !== a.length - 1 ? "border-b border-stroke-hairline" : ""
|
|
120
99
|
}
|
|
121
|
-
) : /* @__PURE__ */
|
|
100
|
+
) : /* @__PURE__ */ C("div", { className: "w-full h-full flex items-center ag-cell-inner-padding overflow-hidden text-ellipsis whitespace-nowrap", children: String(h ?? m ?? "") }) }, `${e.field}-${t}`);
|
|
122
101
|
}) });
|
|
123
102
|
});
|
|
124
|
-
|
|
103
|
+
Z.displayName = "SplitCellEditor";
|
|
125
104
|
export {
|
|
126
|
-
|
|
105
|
+
Z as SplitCellEditor
|
|
127
106
|
};
|