impact-nova 2.5.17 → 2.6.0-alpha.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/README.md +27 -25
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +28 -1
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +0 -3
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +31 -38
- package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +9 -0
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +22 -0
- package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +20 -0
- package/dist/components/data/ag-grid-react/chat/chat-column.js +81 -0
- package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +10 -0
- package/dist/components/data/ag-grid-react/chat/chat-composer.js +352 -0
- package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +17 -0
- package/dist/components/data/ag-grid-react/chat/chat-constants.js +22 -0
- package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +41 -0
- package/dist/components/data/ag-grid-react/chat/chat-format.js +94 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +10 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.js +651 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +2 -0
- package/dist/components/data/ag-grid-react/chat/chat-html.js +40 -0
- package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-identity.js +24 -0
- package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-menu.js +15 -0
- package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +17 -0
- package/dist/components/data/ag-grid-react/chat/chat-notify.js +124 -0
- package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-persist.js +34 -0
- package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-priority.js +79 -0
- package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +2 -0
- package/dist/components/data/ag-grid-react/chat/chat-summaries.js +24 -0
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +72 -0
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +713 -0
- package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +6 -0
- package/dist/components/data/ag-grid-react/chat/chat-toggle.js +25 -0
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +26 -0
- package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +14 -0
- package/dist/components/data/ag-grid-react/chat/chat-window.js +82 -0
- package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +91 -0
- package/dist/components/data/ag-grid-react/chat/chat-workspace.js +555 -0
- package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +319 -0
- package/dist/components/data/ag-grid-react/chat/index.d.ts +6 -0
- package/dist/components/data/ag-grid-react/chat/index.js +24 -0
- package/dist/components/data/ag-grid-react/chat.story-data.d.ts +34 -0
- package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +4 -0
- package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +4 -0
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +6 -0
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +29 -0
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +8 -0
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +16 -0
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +26 -0
- package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +12 -0
- package/dist/components/data/ag-grid-react/comments/comments-constants.js +21 -0
- package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +20 -0
- package/dist/components/data/ag-grid-react/comments/comments-format.js +49 -0
- package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +14 -0
- package/dist/components/data/ag-grid-react/comments/comments-generation.js +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +10 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.js +343 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +7 -0
- package/dist/components/data/ag-grid-react/comments/comments-identity.js +20 -0
- package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +29 -0
- package/dist/components/data/ag-grid-react/comments/comments-menu.js +35 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +22 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +98 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +21 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay.js +406 -0
- package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +9 -0
- package/dist/components/data/ag-grid-react/comments/comments-panel.js +272 -0
- package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-persist.js +19 -0
- package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-reveal.js +31 -0
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +22 -0
- package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +10 -0
- package/dist/components/data/ag-grid-react/comments/comments-window.js +62 -0
- package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +178 -0
- package/dist/components/data/ag-grid-react/comments/index.d.ts +5 -0
- package/dist/components/data/ag-grid-react/comments/index.js +15 -0
- package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +25 -0
- package/dist/components/data/ag-grid-react/comments.story-data.d.ts +37 -0
- package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +11 -0
- package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +21 -0
- package/dist/components/data/ag-grid-react/grid-cell-address.js +21 -0
- package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +34 -0
- package/dist/components/data/ag-grid-react/grid-row-reveal.js +33 -0
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +75 -65
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +54 -54
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +122 -119
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +2 -1
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +25 -20
- package/dist/components/data/ag-grid-react/headers/utils/filter-utils.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +481 -254
- package/dist/components/data/ag-grid-react/notes/index.d.ts +2 -0
- package/dist/components/data/ag-grid-react/notes/index.js +1 -0
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +25 -0
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +32 -0
- package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +2 -0
- package/dist/components/data/ag-grid-react/notes/notes-constants.js +4 -0
- package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +12 -0
- package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +7 -0
- package/dist/components/data/ag-grid-react/nova-system-column.d.ts +7 -0
- package/dist/components/data/ag-grid-react/nova-system-column.js +18 -0
- package/dist/components/data/ag-grid-react/theme.js +6 -2
- package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +4 -0
- package/dist/components/data/ag-grid-react/value-formatters.d.ts +0 -19
- package/dist/components/data/ag-grid-react/value-formatters.js +88 -90
- package/dist/components/data/data-table/build-column-tree-from-grid.js +14 -13
- package/dist/components/data/data-table/data-table-column-def-pin.js +34 -31
- package/dist/components/data/data-table/data-table-context.js +5 -5
- package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
- package/dist/components/data/data-table/data-table-sheet.js +2 -1
- package/dist/components/data-display/calendar/calendar-config.js +22 -21
- package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +36 -35
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +50 -62
- package/dist/components/data-display/calendar/calendar.js +138 -137
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +23 -22
- package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +1 -0
- package/dist/components/data-display/calendar/use-calendar-i18n.js +10 -9
- package/dist/components/data-display/chart/chart.js +72 -72
- package/dist/components/data-display/chart/chart.utils.d.ts +1 -1
- package/dist/components/data-display/chart/chart.utils.js +40 -31
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/toast/toast.d.ts +1 -1
- package/dist/components/feedback/toast/toast.variants.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.js +65 -64
- package/dist/components/flows/filter-panel/filter-panel.types.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.js +125 -126
- package/dist/components/forms/date-picker/date-range-picker.js +191 -192
- package/dist/components/forms/date-picker/multi-date-picker.js +66 -67
- package/dist/components/forms/date-picker/multi-week-picker.js +82 -83
- package/dist/components/forms/date-picker/use-picker-i18n.d.ts +6 -0
- package/dist/components/forms/date-picker/use-picker-i18n.js +11 -0
- package/dist/components/forms/date-picker/week-picker.js +146 -147
- package/dist/components/forms/date-picker/week-range-picker.js +158 -159
- package/dist/components/ui/local-raster-icons/message3d.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +1 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.js +27 -25
- package/dist/form-react/Fields/WeekRangePicker.js +16 -16
- package/dist/form-react/fields.d.ts +0 -3
- package/dist/form-react/fields.js +29 -35
- package/dist/i18n/defaultMessages.d.ts +144 -0
- package/dist/i18n/defaultMessages.js +161 -19
- package/dist/i18n/format/collator.d.ts +1 -0
- package/dist/i18n/format/collator.js +7 -0
- package/dist/i18n/format/date-pattern.d.ts +5 -0
- package/dist/i18n/format/date-pattern.js +20 -0
- package/dist/i18n/format/format-date.d.ts +9 -0
- package/dist/i18n/format/format-date.js +56 -0
- package/dist/i18n/format/format-number.d.ts +20 -0
- package/dist/i18n/format/format-number.js +68 -0
- package/dist/i18n/format/formatter-cache.d.ts +9 -0
- package/dist/i18n/format/formatter-cache.js +66 -0
- package/dist/i18n/format/index.d.ts +6 -0
- package/dist/i18n/format/parse-number.d.ts +6 -0
- package/dist/i18n/format/parse-number.js +53 -0
- package/dist/i18n/getDateFnsLocale.d.ts +5 -4
- package/dist/i18n/getDateFnsLocale.js +46 -16
- package/dist/i18n/i18n.types.d.ts +13 -0
- package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
- package/dist/i18n/impact-nova-i18n-context.js +33 -25
- package/dist/i18n/impact-nova-i18n-defaults.js +8 -6
- package/dist/i18n/index.d.ts +4 -1
- package/dist/i18n/index.js +41 -16
- package/dist/i18n/locale-config.d.ts +28 -0
- package/dist/i18n/locale-config.js +32 -0
- package/dist/i18n/locales/de.js +142 -0
- package/dist/i18n/locales/es.js +142 -0
- package/dist/i18n/locales/hi.js +142 -0
- package/dist/i18n/locales/kn.js +142 -0
- package/dist/i18n/week-start.d.ts +6 -0
- package/dist/i18n/week-start.js +30 -0
- package/dist/impact-nova-components.css +249 -0
- package/dist/impact-nova-tokens.scss +6 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +624 -601
- package/dist/llms/index.js +26 -2
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/data-table-chat.js +1 -0
- package/dist/llms/rules/data-table-comments.js +1 -0
- package/dist/llms/rules/data-table-notes.js +1 -0
- 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/llms/rules/troubleshooting.js +1 -1
- package/dist/providers/app-providers.d.ts +3 -1
- package/dist/providers/app-providers.js +22 -11
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -221,52 +221,54 @@ export const CustomAction = ({ analyticsId, ...props }: CustomActionProps) => {
|
|
|
221
221
|
|
|
222
222
|
### Internationalization (i18n)
|
|
223
223
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
**Locale packs** (German, Spanish, Hindi, Kannada) are exported so you can use them as-is or override only the strings you need:
|
|
224
|
+
Formatting locales are BCP 47 tags, not a closed enum. UI copy is a separate opt-in pack. Wrap the app with `ImpactNovaProviders` from `impact-nova/form` (or `ImpactNovaI18nProvider` from `impact-nova/i18n`).
|
|
227
225
|
|
|
228
226
|
```tsx
|
|
229
|
-
import {
|
|
227
|
+
import { ImpactNovaProviders } from "impact-nova/form";
|
|
228
|
+
import { de } from "impact-nova/locale/de";
|
|
229
|
+
import { formatDate, formatNumber, formatCurrency } from "impact-nova/i18n";
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<ImpactNovaI18nProvider locale="de" messages={de}>
|
|
235
|
-
<MyApp />
|
|
236
|
-
</ImpactNovaI18nProvider>
|
|
237
|
-
);
|
|
238
|
-
}
|
|
231
|
+
<ImpactNovaProviders locale="de-DE" messages={de}>
|
|
232
|
+
<MyApp />
|
|
233
|
+
</ImpactNovaProviders>
|
|
239
234
|
```
|
|
240
235
|
|
|
241
|
-
|
|
236
|
+
Independent date and number locales:
|
|
242
237
|
|
|
243
238
|
```tsx
|
|
244
|
-
|
|
239
|
+
<ImpactNovaProviders
|
|
240
|
+
locale="de-DE"
|
|
241
|
+
dateLocale="en-GB"
|
|
242
|
+
numberLocale="en-US"
|
|
243
|
+
messages={de}
|
|
244
|
+
>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Override only a few keys** by spreading a locale pack:
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
import { de } from "impact-nova/locale/de";
|
|
245
251
|
|
|
246
|
-
// German with custom labels for calendar only
|
|
247
252
|
const messages = {
|
|
248
253
|
...de,
|
|
249
254
|
calendar: { ...de.calendar, apply: "Übernehmen", cancel: "Schließen" },
|
|
250
255
|
};
|
|
251
|
-
|
|
252
|
-
<ImpactNovaI18nProvider locale="de" messages={messages}>
|
|
253
|
-
<MyApp />
|
|
254
|
-
</ImpactNovaI18nProvider>;
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
**Tree-shakeable locale
|
|
258
|
+
**Tree-shakeable locale packs:**
|
|
258
259
|
|
|
259
260
|
```tsx
|
|
260
261
|
import { de } from "impact-nova/locale/de";
|
|
261
|
-
// or
|
|
262
262
|
import { de, es, hi, kn } from "impact-nova/locale";
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
- **`locale`**: BCP 47
|
|
266
|
-
- **`
|
|
267
|
-
-
|
|
265
|
+
- **`locale`**: BCP 47 language locale and default for formatting (e.g. `'de-DE'`). Default `'en'`.
|
|
266
|
+
- **`dateLocale` / `numberLocale`**: optional overrides; each falls back to `locale`. `en-GB` is not rewritten to `en-US`.
|
|
267
|
+
- **`messages`**: optional pack. `locale="de-DE"` does not auto-load German copy.
|
|
268
|
+
- Format with `formatDate` / `formatNumber` / `formatCurrency` from `impact-nova/i18n`. Currency is always an explicit ISO code.
|
|
269
|
+
- Explicit `format`, `weekStartsOn`, and `colDef.locale` still win.
|
|
268
270
|
|
|
269
|
-
|
|
271
|
+
See Storybook **Locale Lab** and `impact-nova://i18n` (MCP) for the full contract.
|
|
270
272
|
|
|
271
273
|
---
|
|
272
274
|
|
|
@@ -2,6 +2,9 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { ColDef, ColGroupDef, IHeaderParams, IHeaderGroupParams, Column, ValueFormatterParams } from 'ag-grid-community';
|
|
3
3
|
import { Theme } from 'ag-grid-enterprise';
|
|
4
4
|
import { AgGridReactProps } from 'ag-grid-react';
|
|
5
|
+
import { DataTableCommentsConfig } from './comments/comments.types';
|
|
6
|
+
import { DataTableNotesConfig } from './notes/notes.types';
|
|
7
|
+
import { DataTableChatConfig } from './chat/chat.types';
|
|
5
8
|
/** ColDef extended with Impact Nova runtime metadata set during column processing */
|
|
6
9
|
export interface ImpactNovaColDef<TData = unknown> extends ColDef<TData> {
|
|
7
10
|
/** Original column-level editable before addRowDataEditableCheck wraps the callback */
|
|
@@ -42,7 +45,7 @@ export interface ExtendedHeaderComponentParams extends Partial<IHeaderParams> {
|
|
|
42
45
|
enableDateParsing?: boolean;
|
|
43
46
|
/** Which picker to render for date columns. Default: 'date' */
|
|
44
47
|
datePickerVariant?: 'date' | 'month' | 'week';
|
|
45
|
-
/** Display format for dates in this column (date-fns token string).
|
|
48
|
+
/** Display format for dates in this column (date-fns token string). Omitted → locale-derived pattern. */
|
|
46
49
|
dateDisplayFormat?: string;
|
|
47
50
|
/** Fiscal calendar configuration for week/month picker */
|
|
48
51
|
fiscalConfig?: {
|
|
@@ -143,6 +146,30 @@ export interface AgGridWrapperProps<TData = unknown> extends Omit<AgGridReactPro
|
|
|
143
146
|
* Application code must rely on document CSS variables and the default theme.
|
|
144
147
|
*/
|
|
145
148
|
themeOverride?: Theme;
|
|
149
|
+
/**
|
|
150
|
+
* Opt-in cell comments. When omitted the grid is unchanged (no comments
|
|
151
|
+
* overlay or mouse-handler wrap). Requires `getRowId`.
|
|
152
|
+
* Import helpers from `impact-nova/ag-grid-react/comments`.
|
|
153
|
+
*
|
|
154
|
+
* Optional `locateRow` loads SSRM / server-paged rows that are not in memory.
|
|
155
|
+
*/
|
|
156
|
+
comments?: DataTableCommentsConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Opt-in AG Grid cell notes. When omitted the grid does not pass `notesDataSource`.
|
|
159
|
+
* Requires `getRowId`. Import types from `impact-nova/ag-grid-react/notes`.
|
|
160
|
+
*
|
|
161
|
+
* Notes are AG Grid-owned (text on a cell). Comments remain a separate conversation.
|
|
162
|
+
*/
|
|
163
|
+
notes?: DataTableNotesConfig;
|
|
164
|
+
/**
|
|
165
|
+
* Opt-in row Chat. When omitted the grid is unchanged (no Chat column,
|
|
166
|
+
* host, listeners, or fetch). Requires `getRowId`.
|
|
167
|
+
* Import helpers from `impact-nova/ag-grid-react/chat`.
|
|
168
|
+
*
|
|
169
|
+
* Identity is the stable row id. Optional `locateRow` loads SSRM /
|
|
170
|
+
* server-paged rows that are not in memory.
|
|
171
|
+
*/
|
|
172
|
+
chat?: DataTableChatConfig;
|
|
146
173
|
}
|
|
147
174
|
/**
|
|
148
175
|
* Filter operators for advanced filtering.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { ICellRendererParams } from 'ag-grid-community';
|
|
2
2
|
export interface DateDisplayRendererProps extends ICellRendererParams {
|
|
3
|
-
/** Date format type: 'date' | 'datetime-local' | 'time' */
|
|
4
3
|
dateType?: 'date' | 'datetime-local' | 'time';
|
|
5
|
-
/** Placeholder text when no date is selected */
|
|
6
4
|
placeholder?: string;
|
|
7
|
-
/** Whether the field is disabled */
|
|
8
5
|
disabled?: boolean;
|
|
9
6
|
}
|
|
10
7
|
/**
|
|
@@ -1,57 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Calendar as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
}, x = (t) => {
|
|
22
|
-
const {
|
|
23
|
-
valueFormatted: i,
|
|
24
|
-
value: e,
|
|
25
|
-
dateType: m = "date",
|
|
26
|
-
placeholder: g = "Select date...",
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { Calendar as w } from "impact-nova-icons";
|
|
3
|
+
import { useImpactNovaI18n as v } from "../../../../i18n/use-impact-nova-i18n.js";
|
|
4
|
+
import { DEFAULT_LOCALE as j } from "../../../../i18n/locale-config.js";
|
|
5
|
+
import { formatTime as L, formatDateTime as N, formatDate as E } from "../../../../i18n/format/format-date.js";
|
|
6
|
+
function F(e) {
|
|
7
|
+
const l = e.context;
|
|
8
|
+
return e.colDef?.locale || l?.dateLocale || l?.locale || j;
|
|
9
|
+
}
|
|
10
|
+
const M = (e, l, o) => e == null || e === "" ? "" : l === "time" ? L(e, o) : l === "datetime-local" ? N(e, o) : E(e, o, {
|
|
11
|
+
year: "numeric",
|
|
12
|
+
month: "short",
|
|
13
|
+
day: "numeric"
|
|
14
|
+
}), _ = (e) => {
|
|
15
|
+
const { t: l } = v(), o = F(e), {
|
|
16
|
+
valueFormatted: p,
|
|
17
|
+
value: t,
|
|
18
|
+
dateType: b = "date",
|
|
19
|
+
placeholder: h,
|
|
27
20
|
disabled: s,
|
|
28
|
-
colDef:
|
|
29
|
-
data:
|
|
30
|
-
} =
|
|
21
|
+
colDef: n,
|
|
22
|
+
data: i
|
|
23
|
+
} = e, D = h ?? l("datePicker.selectDate"), c = t && typeof t == "object" && "cellMetadata" in t ? t.cellMetadata?._isDisabled : void 0, d = i && typeof i == "object" && "rowMetadata" in i ? i.rowMetadata?._isDisabled : void 0;
|
|
31
24
|
let a = !1;
|
|
32
25
|
if (!s) {
|
|
33
|
-
const
|
|
34
|
-
|
|
26
|
+
const x = n?._originalEditable;
|
|
27
|
+
n?.editable === !1 ? a = !1 : c === !1 ? a = !0 : c === !0 ? a = !1 : d === !1 ? a = !0 : d === !0 ? a = !1 : a = x === !0 || n?.editable === !0;
|
|
35
28
|
}
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
29
|
+
const f = t && typeof t == "object" && "value" in t, y = f ? t.value : t, m = (f ? null : p) ?? M(y, b, o), u = !m;
|
|
30
|
+
return /* @__PURE__ */ r(
|
|
38
31
|
"div",
|
|
39
32
|
{
|
|
40
33
|
className: `w-full h-full flex items-center ag-cell-inner-padding ${s ? "opacity-60 cursor-not-allowed" : a ? "in-ag-editable-cell-highlight" : ""}`,
|
|
41
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ g(
|
|
42
35
|
"div",
|
|
43
36
|
{
|
|
44
37
|
className: `flex w-full items-center justify-between rounded-[8px] px-1.5 h-7 ${a ? "bg-canvas-elevated cursor-pointer" : "bg-inherit"}`,
|
|
45
38
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
a && /* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ r("span", { className: `truncate text-sm font-medium text-content ${u ? "text-content-empty" : ""}`, children: u ? D : m }),
|
|
40
|
+
a && /* @__PURE__ */ r("span", { className: "h-3.5 w-3.5 shrink-0 text-content-icon", children: /* @__PURE__ */ r(w, { className: "h-3.5 w-3.5" }) })
|
|
48
41
|
]
|
|
49
42
|
}
|
|
50
43
|
)
|
|
51
44
|
}
|
|
52
45
|
);
|
|
53
46
|
};
|
|
54
|
-
|
|
47
|
+
_.displayName = "DateDisplayRenderer";
|
|
55
48
|
export {
|
|
56
|
-
|
|
49
|
+
_ as DateDisplayRenderer
|
|
57
50
|
};
|
|
@@ -29,7 +29,7 @@ export interface InputDisplayRendererProps extends ICellRendererParams {
|
|
|
29
29
|
* singleClickEdit: true,
|
|
30
30
|
* cellRendererParams: { placeholder: '0.00', isNumeric: true },
|
|
31
31
|
* cellEditorParams: { inputType: 'number', min: 0, step: 0.01 },
|
|
32
|
-
* valueFormatter: (p) => p.value ?
|
|
32
|
+
* valueFormatter: (p) => p.value ? formatNumber(p.value, p.context?.numberLocale ?? 'en') : '',
|
|
33
33
|
* }
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatAction, ChatActionContext, ChatCapabilities, DataTableChatConfig } from './chat.types';
|
|
2
|
+
export declare const DEFAULT_CHAT_CAPABILITIES: ChatCapabilities;
|
|
3
|
+
export declare function resolveChatCapabilities(getCapabilities: ((rowId: string) => ChatCapabilities) | undefined, rowId: string): ChatCapabilities;
|
|
4
|
+
/**
|
|
5
|
+
* Nova asks. The consumer answers.
|
|
6
|
+
* `can` returning `undefined` falls through to getCapabilities + listPeople.
|
|
7
|
+
* Invite/remove default to off when `listPeople` is omitted (read-only roster).
|
|
8
|
+
*/
|
|
9
|
+
export declare function chatAllows(config: Pick<DataTableChatConfig, "getCapabilities" | "can" | "listPeople">, action: ChatAction, context: ChatActionContext): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const n = {
|
|
2
|
+
canView: !0,
|
|
3
|
+
canCreate: !0,
|
|
4
|
+
canEdit: !1,
|
|
5
|
+
canDelete: !1
|
|
6
|
+
};
|
|
7
|
+
function l(r, e) {
|
|
8
|
+
return r?.(e) ?? n;
|
|
9
|
+
}
|
|
10
|
+
function i(r, e, a) {
|
|
11
|
+
const t = l(r.getCapabilities, a.rowId);
|
|
12
|
+
return e === "view" ? t.canView : e === "create" ? t.canCreate : e === "edit" ? t.canEdit : e === "delete" ? t.canDelete : t.canCreate && r.listPeople != null;
|
|
13
|
+
}
|
|
14
|
+
function u(r, e, a) {
|
|
15
|
+
const t = r.can?.(e, a);
|
|
16
|
+
return typeof t == "boolean" ? t : i(r, e, a);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
n as DEFAULT_CHAT_CAPABILITIES,
|
|
20
|
+
u as chatAllows,
|
|
21
|
+
l as resolveChatCapabilities
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ColDef, ColGroupDef, ICellRendererComp } from 'ag-grid-community';
|
|
2
|
+
import { ChatPriority, DataTableChatConfig } from './chat.types';
|
|
3
|
+
export declare function resolveChatColumnId(config: DataTableChatConfig): string | undefined;
|
|
4
|
+
export declare function shouldInjectChatColumn(config: DataTableChatConfig): boolean;
|
|
5
|
+
type ChatCellPresence = {
|
|
6
|
+
hasConversation: (rowId: string) => boolean;
|
|
7
|
+
unreadCount: (rowId: string) => number;
|
|
8
|
+
priority: (rowId: string) => ChatPriority | undefined;
|
|
9
|
+
label: (rowId: string, unread: number) => string;
|
|
10
|
+
};
|
|
11
|
+
export declare function createChatCellRenderer(read: () => ChatCellPresence): new () => ICellRendererComp;
|
|
12
|
+
export declare function createChatSystemColumn(args: {
|
|
13
|
+
headerName: string;
|
|
14
|
+
cellRenderer: ColDef["cellRenderer"];
|
|
15
|
+
pinned?: "left" | "right" | null;
|
|
16
|
+
width?: number;
|
|
17
|
+
}): ColDef;
|
|
18
|
+
export declare function columnDefsIncludeColId(columnDefs: (ColDef | ColGroupDef)[] | undefined, colId: string): boolean;
|
|
19
|
+
export declare function appendChatSystemColumn(columnDefs: (ColDef | ColGroupDef)[] | undefined, chatColumn: ColDef): (ColDef | ColGroupDef)[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { IV_CHAT_COL_ID as o, IV_CHAT_COL_WIDTH as h } from "./chat-constants.js";
|
|
2
|
+
const m = new URL("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M3.88867%204H17.1113C17.3481%204.00006%2017.5748%204.09396%2017.7412%204.25977C17.9074%204.42549%2018%204.65002%2018%204.88281V14.2939C18%2014.5268%2017.9075%2014.7513%2017.7412%2014.917C17.5748%2015.0828%2017.3481%2015.1767%2017.1113%2015.1768H6.4082C5.78401%2015.1768%205.17582%2015.3782%204.67578%2015.752L3%2017.0039V4.88281C3%204.65002%203.09261%204.42549%203.25879%204.25977C3.42517%204.09396%203.65189%204.00006%203.88867%204Z'%20stroke='url(%23iv-chat-message-stroke)'%20stroke-width='2'/%3e%3cdefs%3e%3clinearGradient%20id='iv-chat-message-stroke'%20x1='19'%20y1='11'%20x2='2'%20y2='11'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%234259EE'/%3e%3cstop%20offset='1'%20stop-color='%23F19579'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", import.meta.url).href;
|
|
3
|
+
function v(e) {
|
|
4
|
+
return e.column === !1 ? e.colId : e.colId ?? o;
|
|
5
|
+
}
|
|
6
|
+
function l(e, r, t, n) {
|
|
7
|
+
const i = t.node?.id;
|
|
8
|
+
if (!i) {
|
|
9
|
+
e.hidden = !0, e.removeAttribute("data-row-id"), e.removeAttribute("data-iv-chat-active"), e.removeAttribute("data-iv-chat-priority"), e.removeAttribute("aria-label"), r.remove();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const a = n(), s = Math.max(0, a.unreadCount(i)), u = a.hasConversation(i);
|
|
13
|
+
e.hidden = !1, e.setAttribute("data-row-id", i), e.setAttribute("aria-label", a.label(i, s)), u ? e.setAttribute("data-iv-chat-active", "") : e.removeAttribute("data-iv-chat-active");
|
|
14
|
+
const c = a.priority(i);
|
|
15
|
+
c ? e.setAttribute("data-iv-chat-priority", c) : e.removeAttribute("data-iv-chat-priority"), s > 0 ? (r.textContent = s > 99 ? "99+" : String(s), r.isConnected || (e.querySelector(".iv-chat-cell-icon") ?? e).append(r)) : r.remove();
|
|
16
|
+
}
|
|
17
|
+
function A(e) {
|
|
18
|
+
return class {
|
|
19
|
+
button = document.createElement("button");
|
|
20
|
+
badge = document.createElement("span");
|
|
21
|
+
init(t) {
|
|
22
|
+
this.button.type = "button", this.button.className = "iv-chat-cell-button", this.button.setAttribute("data-iv-chat-cell", "");
|
|
23
|
+
const n = document.createElement("span");
|
|
24
|
+
n.className = "iv-chat-cell-icon", n.setAttribute("aria-hidden", "true");
|
|
25
|
+
const i = document.createElement("img");
|
|
26
|
+
i.src = m, i.alt = "", i.width = 21, i.height = 21, n.append(i), this.button.append(n), this.badge.className = "iv-chat-unread", l(this.button, this.badge, t, e);
|
|
27
|
+
}
|
|
28
|
+
getGui() {
|
|
29
|
+
return this.button;
|
|
30
|
+
}
|
|
31
|
+
refresh(t) {
|
|
32
|
+
return l(this.button, this.badge, t, e), !0;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function b(e) {
|
|
37
|
+
const r = e.width ?? h, t = e.pinned === void 0 ? "right" : e.pinned;
|
|
38
|
+
return {
|
|
39
|
+
colId: o,
|
|
40
|
+
headerName: e.headerName,
|
|
41
|
+
width: r,
|
|
42
|
+
minWidth: r,
|
|
43
|
+
maxWidth: r,
|
|
44
|
+
pinned: t,
|
|
45
|
+
lockPosition: t === "left" ? "left" : "right",
|
|
46
|
+
lockPinned: !0,
|
|
47
|
+
suppressMovable: !0,
|
|
48
|
+
suppressAutoSize: !0,
|
|
49
|
+
sortable: !1,
|
|
50
|
+
filter: !1,
|
|
51
|
+
resizable: !1,
|
|
52
|
+
suppressHeaderMenuButton: !0,
|
|
53
|
+
suppressColumnsToolPanel: !0,
|
|
54
|
+
context: { ivSystemColumn: !0 },
|
|
55
|
+
cellRenderer: e.cellRenderer,
|
|
56
|
+
valueGetter: () => ""
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function d(e, r) {
|
|
60
|
+
if (!e) return !1;
|
|
61
|
+
for (const t of e) {
|
|
62
|
+
if ("children" in t && Array.isArray(t.children)) {
|
|
63
|
+
if (d(t.children, r)) return !0;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const n = t;
|
|
67
|
+
if ((n.colId ?? n.field) === r) return !0;
|
|
68
|
+
}
|
|
69
|
+
return !1;
|
|
70
|
+
}
|
|
71
|
+
function y(e, r) {
|
|
72
|
+
const t = e ?? [];
|
|
73
|
+
return d(t, o) ? t : [...t, r];
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
y as appendChatSystemColumn,
|
|
77
|
+
d as columnDefsIncludeColId,
|
|
78
|
+
A as createChatCellRenderer,
|
|
79
|
+
b as createChatSystemColumn,
|
|
80
|
+
v as resolveChatColumnId
|
|
81
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChatComposerRenderProps, ChatComposerToolContext, DataTableChatConfig } from './chat.types';
|
|
2
|
+
export declare function ChatSendIcon(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ChatComposer({ value, onChange, onSave, disabled, saving, author, placeholder, render, tools, toolContext, hideSend, hideChrome, priority, onPriorityChange, attachments, onAttachmentsChange, }: ChatComposerRenderProps & {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
render?: DataTableChatConfig["renderComposer"];
|
|
6
|
+
tools?: DataTableChatConfig["composerTools"];
|
|
7
|
+
toolContext?: ChatComposerToolContext;
|
|
8
|
+
hideSend?: boolean;
|
|
9
|
+
hideChrome?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|