@nova-design-system/nova-react 3.15.0 → 3.17.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.
Files changed (62) hide show
  1. package/dist/cjs/generated/components.server.js +826 -0
  2. package/dist/cjs/{index-BK1_MpRZ.js → index-B0fvq6nd.js} +4818 -1376
  3. package/dist/cjs/index.js +3 -2
  4. package/dist/cjs/{nv-accordion-item.entry-BPaDkIFa.js → nv-accordion-item.entry-DSXSMuOt.js} +2 -2
  5. package/dist/cjs/{nv-accordion.entry-BaHER2iL.js → nv-accordion.entry-D2GTCEoF.js} +6 -6
  6. package/dist/cjs/{nv-alert.entry-Hv-y3Bwl.js → nv-alert.entry-CxrdJWzE.js} +2 -2
  7. package/dist/cjs/nv-avatar.entry-Boe2Bp39.js +68 -0
  8. package/dist/cjs/{nv-badge_2.entry-CwlWa72m.js → nv-badge_2.entry-Cvu8cWAm.js} +1 -1
  9. package/dist/cjs/{nv-breadcrumb.entry-BvHgDgxV.js → nv-breadcrumb.entry-IBd49U13.js} +2 -2
  10. package/dist/cjs/{nv-breadcrumbs.entry-BdptRKYA.js → nv-breadcrumbs.entry-CxDCe3pi.js} +1 -1
  11. package/dist/cjs/nv-button.entry-veszqyTF.js +159 -0
  12. package/dist/cjs/{nv-buttongroup.entry-Bh0f3bAn.js → nv-buttongroup.entry-BoqH0Kje.js} +1 -1
  13. package/dist/cjs/{nv-calendar.entry-BZLITXEC.js → nv-calendar.entry-D-Wl56-6.js} +1 -1
  14. package/dist/cjs/{nv-col.entry-I3bCSLB5.js → nv-col.entry-BhKZwFpL.js} +1 -1
  15. package/dist/cjs/{nv-datagrid.entry-BzIkgOV6.js → nv-datagrid.entry-DnMZbymp.js} +177 -10
  16. package/dist/cjs/{nv-datagridcolumn.entry-BuFhEECG.js → nv-datagridcolumn.entry-U38uoM6D.js} +1 -1
  17. package/dist/cjs/{nv-dialog.entry-DIbIIXo2.js → nv-dialog.entry-BF4VplVi.js} +32 -29
  18. package/dist/cjs/{nv-dialogfooter_2.entry-Thzk1kVd.js → nv-dialogfooter_2.entry-TqO3Mryg.js} +2 -2
  19. package/dist/cjs/{nv-fieldcheckbox.entry-mkas423y.js → nv-fieldcheckbox.entry-C_rJ7Jrf.js} +2 -2
  20. package/dist/cjs/{nv-fielddate.entry-Cek70TQM.js → nv-fielddate.entry-DZdztKCP.js} +51 -26
  21. package/dist/cjs/{nv-fielddaterange.entry-C3BYAnVq.js → nv-fielddaterange.entry-CMxpi6X9.js} +68 -42
  22. package/dist/cjs/{nv-fielddropdown.entry-Djz5-R1T.js → nv-fielddropdown.entry-T-qNo0gM.js} +33 -7
  23. package/dist/cjs/{nv-fielddropdownitem.entry-B2z13jEI.js → nv-fielddropdownitem.entry-BfIqaxW3.js} +1 -1
  24. package/dist/cjs/{nv-fieldmultiselect.entry-uJ9i2gtz.js → nv-fieldmultiselect.entry-rtKSNZ5F.js} +187 -156
  25. package/dist/cjs/{nv-fieldnumber.entry-zpWCDG_-.js → nv-fieldnumber.entry-BD-xCdb5.js} +2 -2
  26. package/dist/cjs/{nv-fieldpassword.entry-C835HE_i.js → nv-fieldpassword.entry-Dmt91T4y.js} +2 -2
  27. package/dist/cjs/{nv-fieldradio.entry-CzLMbo4W.js → nv-fieldradio.entry-CAoRufTW.js} +2 -2
  28. package/dist/cjs/{nv-fieldselect.entry-BzcYzmqe.js → nv-fieldselect.entry-2YLbIpBO.js} +2 -2
  29. package/dist/cjs/{nv-fieldslider.entry-B5vyrQZw.js → nv-fieldslider.entry-D6g_MrUd.js} +2 -2
  30. package/dist/cjs/{nv-fieldtext.entry-DnPQxVqp.js → nv-fieldtext.entry-D-SS4OPR.js} +2 -2
  31. package/dist/cjs/{nv-fieldtextarea.entry-n2MJK2Jg.js → nv-fieldtextarea.entry-L0XDrdHL.js} +2 -2
  32. package/dist/cjs/{nv-fieldtime.entry-DChhvqKi.js → nv-fieldtime.entry-Hw5VOmpK.js} +25 -12
  33. package/dist/cjs/nv-icon.entry-B7mLhu0c.js +80 -0
  34. package/dist/cjs/{nv-iconbutton_2.entry-u0l16LeW.js → nv-iconbutton_2.entry-iinBJBb6.js} +2 -2
  35. package/dist/cjs/{nv-menu.entry-OYVh6iMu.js → nv-menu.entry-BTW4XauN.js} +24 -9
  36. package/dist/cjs/{nv-menuitem.entry-Dj6N1n9X.js → nv-menuitem.entry-CIT2_Fbe.js} +1 -1
  37. package/dist/cjs/{nv-notification.entry-D1dVSEYZ.js → nv-notification.entry-CVyzCsSh.js} +2 -2
  38. package/dist/cjs/{nv-notificationcontainer.entry-Bp2NR_fe.js → nv-notificationcontainer.entry-CqoyGWAa.js} +1 -1
  39. package/dist/cjs/{nv-popover.entry-Bf2AEn9B.js → nv-popover.entry-Bf5ihsdq.js} +67 -61
  40. package/dist/cjs/{nv-row.entry-Bi9eoQEh.js → nv-row.entry-Chp5QzjD.js} +1 -1
  41. package/dist/cjs/nv-split.entry-DSB_HMU-.js +337 -0
  42. package/dist/cjs/{nv-stack.entry-Dd680LIT.js → nv-stack.entry-D6L6830W.js} +2 -2
  43. package/dist/cjs/nv-table.entry-B-UuWaI5.js +245 -0
  44. package/dist/cjs/{nv-toggle.entry-gBokGnGe.js → nv-toggle.entry-AG7sAORg.js} +2 -2
  45. package/dist/cjs/{nv-togglebutton.entry-ZpltTrQe.js → nv-togglebutton.entry-Btlxm5gO.js} +1 -1
  46. package/dist/cjs/{nv-togglebuttongroup.entry-Bu0C6Iq3.js → nv-togglebuttongroup.entry-CM3nWiUU.js} +2 -2
  47. package/dist/cjs/{nv-tooltip.entry-DR4aj5qF.js → nv-tooltip.entry-m4AYXhW3.js} +1 -1
  48. package/dist/components/NvDatatable.js +45 -0
  49. package/dist/generated/components.js +10 -10
  50. package/dist/generated/components.server.js +10 -16
  51. package/dist/index.js +1 -0
  52. package/dist/types/components/NvDatatable.d.ts +25 -0
  53. package/dist/types/generated/components.d.ts +7 -12
  54. package/dist/types/generated/components.server.d.ts +7 -12
  55. package/dist/types/index.d.ts +1 -0
  56. package/package.json +14 -6
  57. package/dist/cjs/dom.utils-ac71e0ef-CmIwRr6O.js +0 -168
  58. package/dist/cjs/nv-avatar.entry-BTmGyeGF.js +0 -68
  59. package/dist/cjs/nv-button.entry-6O39hBHY.js +0 -165
  60. package/dist/cjs/nv-icon.entry-agdqxUMS.js +0 -80
  61. package/dist/cjs/nv-table.entry-wxn9GDDo.js +0 -339
  62. package/dist/cjs/nv-tablecolumn.entry-Bo0z0XyB.js +0 -19
@@ -0,0 +1,45 @@
1
+ import React, { useMemo } from 'react';
2
+ import { flexRender, getCoreRowModel, useReactTable, } from '@tanstack/react-table';
3
+ import { NvTable } from '../generated/components';
4
+ const NvDatatable = ({ columns, rows, ...htmlProps }) => {
5
+ const tableColumns = useMemo(() => columns
6
+ .filter((col) => !col.hidden)
7
+ .map((col) => ({
8
+ accessorKey: col.field,
9
+ header: col.headerName || String(col.field),
10
+ size: col.width,
11
+ enableResizing: col.resizable ?? true,
12
+ cell: (context) => {
13
+ const value = context.getValue();
14
+ const row = context.row.original;
15
+ const rowIndex = context.row.index;
16
+ if (col.renderCell) {
17
+ return col.renderCell({
18
+ value,
19
+ row,
20
+ field: col.field,
21
+ rowIndex,
22
+ });
23
+ }
24
+ return value;
25
+ },
26
+ })), [columns]);
27
+ const table = useReactTable({
28
+ data: rows,
29
+ columns: tableColumns,
30
+ getCoreRowModel: getCoreRowModel(),
31
+ });
32
+ return (React.createElement(NvTable, { ...htmlProps },
33
+ React.createElement("table", null,
34
+ React.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (React.createElement("tr", { key: headerGroup.id }, headerGroup.headers.map((header) => (React.createElement("th", { key: header.id, "data-testid": `datatable-header-${header.id}`, style: {
35
+ width: header.column.columnDef.size + 'px',
36
+ }, "data-no-resize": header.column.columnDef.enableResizing ? null : true }, header.isPlaceholder
37
+ ? null
38
+ : flexRender(header.column.columnDef.header, header.getContext())))))))),
39
+ React.createElement("tbody", null, table.getRowModel().rows.map((row) => (React.createElement("tr", { key: row.id, "data-testid": `datatable-row-${row.id}` }, row.getVisibleCells().map((cell) => (React.createElement("td", { key: cell.id, "data-testid": `datatable-cell-${cell.id}`, style: {
40
+ padding: '8px',
41
+ borderBottom: '1px solid #eee',
42
+ } }, flexRender(cell.column.columnDef.cell, cell.getContext())))))))))));
43
+ };
44
+ NvDatatable.displayName = 'NvDatatable';
45
+ export { NvDatatable };
@@ -39,9 +39,9 @@ import { NvNotification as NvNotificationElement, defineCustomElement as defineN
39
39
  import { NvNotificationcontainer as NvNotificationcontainerElement, defineCustomElement as defineNvNotificationcontainer } from "@nova-design-system/nova-webcomponents/dist/components/nv-notificationcontainer.js";
40
40
  import { NvPopover as NvPopoverElement, defineCustomElement as defineNvPopover } from "@nova-design-system/nova-webcomponents/dist/components/nv-popover.js";
41
41
  import { NvRow as NvRowElement, defineCustomElement as defineNvRow } from "@nova-design-system/nova-webcomponents/dist/components/nv-row.js";
42
+ import { NvSplit as NvSplitElement, defineCustomElement as defineNvSplit } from "@nova-design-system/nova-webcomponents/dist/components/nv-split.js";
42
43
  import { NvStack as NvStackElement, defineCustomElement as defineNvStack } from "@nova-design-system/nova-webcomponents/dist/components/nv-stack.js";
43
44
  import { NvTable as NvTableElement, defineCustomElement as defineNvTable } from "@nova-design-system/nova-webcomponents/dist/components/nv-table.js";
44
- import { NvTablecolumn as NvTablecolumnElement, defineCustomElement as defineNvTablecolumn } from "@nova-design-system/nova-webcomponents/dist/components/nv-tablecolumn.js";
45
45
  import { NvToggle as NvToggleElement, defineCustomElement as defineNvToggle } from "@nova-design-system/nova-webcomponents/dist/components/nv-toggle.js";
46
46
  import { NvTogglebutton as NvTogglebuttonElement, defineCustomElement as defineNvTogglebutton } from "@nova-design-system/nova-webcomponents/dist/components/nv-togglebutton.js";
47
47
  import { NvTogglebuttongroup as NvTogglebuttongroupElement, defineCustomElement as defineNvTogglebuttongroup } from "@nova-design-system/nova-webcomponents/dist/components/nv-togglebuttongroup.js";
@@ -52,7 +52,7 @@ export const NvAccordion = createComponent({
52
52
  tagName: 'nv-accordion',
53
53
  elementClass: NvAccordionElement,
54
54
  react: React,
55
- events: { onOpenChanged: 'openChanged' },
55
+ events: { onOpenIndexesChanged: 'openIndexesChanged' },
56
56
  defineCustomElement: defineNvAccordion
57
57
  });
58
58
  export const NvAccordionItem = createComponent({
@@ -356,6 +356,13 @@ export const NvRow = createComponent({
356
356
  events: {},
357
357
  defineCustomElement: defineNvRow
358
358
  });
359
+ export const NvSplit = createComponent({
360
+ tagName: 'nv-split',
361
+ elementClass: NvSplitElement,
362
+ react: React,
363
+ events: { onSizesChanged: 'sizesChanged' },
364
+ defineCustomElement: defineNvSplit
365
+ });
359
366
  export const NvStack = createComponent({
360
367
  tagName: 'nv-stack',
361
368
  elementClass: NvStackElement,
@@ -367,15 +374,8 @@ export const NvTable = createComponent({
367
374
  tagName: 'nv-table',
368
375
  elementClass: NvTableElement,
369
376
  react: React,
370
- events: { onAction: 'action' },
371
- defineCustomElement: defineNvTable
372
- });
373
- export const NvTablecolumn = createComponent({
374
- tagName: 'nv-tablecolumn',
375
- elementClass: NvTablecolumnElement,
376
- react: React,
377
377
  events: {},
378
- defineCustomElement: defineNvTablecolumn
378
+ defineCustomElement: defineNvTable
379
379
  });
380
380
  export const NvToggle = createComponent({
381
381
  tagName: 'nv-toggle',
@@ -694,6 +694,15 @@ export const NvRow = createComponent({
694
694
  hydrateModule: import('@nova-design-system/nova-webcomponents/hydrate'),
695
695
  serializeShadowRoot
696
696
  });
697
+ export const NvSplit = createComponent({
698
+ tagName: 'nv-split',
699
+ properties: {
700
+ direction: 'direction',
701
+ gutterSize: 'gutter-size'
702
+ },
703
+ hydrateModule: import('@nova-design-system/nova-webcomponents/hydrate'),
704
+ serializeShadowRoot
705
+ });
697
706
  export const NvStack = createComponent({
698
707
  tagName: 'nv-stack',
699
708
  properties: {
@@ -708,22 +717,7 @@ export const NvStack = createComponent({
708
717
  });
709
718
  export const NvTable = createComponent({
710
719
  tagName: 'nv-table',
711
- properties: {
712
- dataJson: 'data-json',
713
- columnsConfigJson: 'columns-config-json',
714
- fallbackValue: 'fallback-value',
715
- noDataMessage: 'no-data-message',
716
- noColumnsNoDataMessage: 'no-columns-no-data-message'
717
- },
718
- hydrateModule: import('@nova-design-system/nova-webcomponents/hydrate'),
719
- serializeShadowRoot
720
- });
721
- export const NvTablecolumn = createComponent({
722
- tagName: 'nv-tablecolumn',
723
- properties: {
724
- name: 'name',
725
- header: 'header'
726
- },
720
+ properties: {},
727
721
  hydrateModule: import('@nova-design-system/nova-webcomponents/hydrate'),
728
722
  serializeShadowRoot
729
723
  });
package/dist/index.js CHANGED
@@ -2,3 +2,4 @@ export * from './generated/components';
2
2
  export * from '@nova-design-system/nova-webcomponents/constants';
3
3
  export { defineCustomElements } from '@nova-design-system/nova-webcomponents/loader';
4
4
  export { useNotifications, NotificationProvider, } from './providers/NotificationProvider';
5
+ export * from './components/NvDatatable';
@@ -0,0 +1,25 @@
1
+ import React, { type ComponentProps } from 'react';
2
+ declare const NvDatatable: {
3
+ <T extends NvDatatableRow = NvDatatableRow>({ columns, rows, ...htmlProps }: NvDatatableProps<T>): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export { NvDatatable };
7
+ export type NvDatatableProps<T> = {
8
+ columns: Array<NvDatatableColumn<T>>;
9
+ rows: Array<T>;
10
+ } & Pick<ComponentProps<'div'>, 'className' | 'style'>;
11
+ export interface NvDatatableColumn<T> {
12
+ field: keyof T;
13
+ headerName?: string;
14
+ width?: number;
15
+ resizable?: boolean;
16
+ hidden?: boolean;
17
+ renderCell?: (params: NvTableRenderCellParams<T, T[keyof T]>) => React.ReactNode;
18
+ }
19
+ export type NvDatatableRow = Record<string, string | number | boolean | null | undefined | typeof Date>;
20
+ export interface NvTableRenderCellParams<T, V> {
21
+ value: V;
22
+ row: T;
23
+ field: keyof T;
24
+ rowIndex: number;
25
+ }
@@ -39,18 +39,16 @@ import { NvNotification as NvNotificationElement } from "@nova-design-system/nov
39
39
  import { NvNotificationcontainer as NvNotificationcontainerElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-notificationcontainer.js";
40
40
  import { NvPopover as NvPopoverElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-popover.js";
41
41
  import { NvRow as NvRowElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-row.js";
42
+ import { NvSplit as NvSplitElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-split.js";
42
43
  import { NvStack as NvStackElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-stack.js";
43
44
  import { NvTable as NvTableElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-table.js";
44
- import { NvTablecolumn as NvTablecolumnElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-tablecolumn.js";
45
45
  import { NvToggle as NvToggleElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-toggle.js";
46
46
  import { NvTogglebutton as NvTogglebuttonElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-togglebutton.js";
47
47
  import { NvTogglebuttongroup as NvTogglebuttongroupElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-togglebuttongroup.js";
48
48
  import { NvTooltip as NvTooltipElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-tooltip.js";
49
49
  import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
50
50
  export type NvAccordionEvents = {
51
- onOpenChanged: EventName<CustomEvent<{
52
- openIndexes: number[];
53
- }>>;
51
+ onOpenIndexesChanged: EventName<CustomEvent<number[]>>;
54
52
  };
55
53
  export declare const NvAccordion: StencilReactComponent<NvAccordionElement, NvAccordionEvents>;
56
54
  export type NvAccordionItemEvents = {
@@ -219,17 +217,14 @@ export type NvPopoverEvents = {
219
217
  export declare const NvPopover: StencilReactComponent<NvPopoverElement, NvPopoverEvents>;
220
218
  export type NvRowEvents = NonNullable<unknown>;
221
219
  export declare const NvRow: StencilReactComponent<NvRowElement, NvRowEvents>;
220
+ export type NvSplitEvents = {
221
+ onSizesChanged: EventName<CustomEvent<number[]>>;
222
+ };
223
+ export declare const NvSplit: StencilReactComponent<NvSplitElement, NvSplitEvents>;
222
224
  export type NvStackEvents = NonNullable<unknown>;
223
225
  export declare const NvStack: StencilReactComponent<NvStackElement, NvStackEvents>;
224
- export type NvTableEvents = {
225
- onAction: EventName<CustomEvent<{
226
- keyAction: string;
227
- details: any;
228
- }>>;
229
- };
226
+ export type NvTableEvents = NonNullable<unknown>;
230
227
  export declare const NvTable: StencilReactComponent<NvTableElement, NvTableEvents>;
231
- export type NvTablecolumnEvents = NonNullable<unknown>;
232
- export declare const NvTablecolumn: StencilReactComponent<NvTablecolumnElement, NvTablecolumnEvents>;
233
228
  export type NvToggleEvents = {
234
229
  onCheckedChanged: EventName<CustomEvent<boolean>>;
235
230
  };
@@ -39,9 +39,9 @@ import { NvNotification as NvNotificationElement } from "@nova-design-system/nov
39
39
  import { NvNotificationcontainer as NvNotificationcontainerElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-notificationcontainer.js";
40
40
  import { NvPopover as NvPopoverElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-popover.js";
41
41
  import { NvRow as NvRowElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-row.js";
42
+ import { NvSplit as NvSplitElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-split.js";
42
43
  import { NvStack as NvStackElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-stack.js";
43
44
  import { NvTable as NvTableElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-table.js";
44
- import { NvTablecolumn as NvTablecolumnElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-tablecolumn.js";
45
45
  import { NvToggle as NvToggleElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-toggle.js";
46
46
  import { NvTogglebutton as NvTogglebuttonElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-togglebutton.js";
47
47
  import { NvTogglebuttongroup as NvTogglebuttongroupElement } from "@nova-design-system/nova-webcomponents/dist/components/nv-togglebuttongroup.js";
@@ -50,9 +50,7 @@ import type { EventName, StencilReactComponent } from '@stencil/react-output-tar
50
50
  import { type SerializeShadowRootOptions } from '@stencil/react-output-target/ssr';
51
51
  export declare const serializeShadowRoot: SerializeShadowRootOptions;
52
52
  export type NvAccordionEvents = {
53
- onOpenChanged: EventName<CustomEvent<{
54
- openIndexes: number[];
55
- }>>;
53
+ onOpenIndexesChanged: EventName<CustomEvent<number[]>>;
56
54
  };
57
55
  export declare const NvAccordion: StencilReactComponent<NvAccordionElement, NvAccordionEvents>;
58
56
  export type NvAccordionItemEvents = {
@@ -221,17 +219,14 @@ export type NvPopoverEvents = {
221
219
  export declare const NvPopover: StencilReactComponent<NvPopoverElement, NvPopoverEvents>;
222
220
  export type NvRowEvents = NonNullable<unknown>;
223
221
  export declare const NvRow: StencilReactComponent<NvRowElement, NvRowEvents>;
222
+ export type NvSplitEvents = {
223
+ onSizesChanged: EventName<CustomEvent<number[]>>;
224
+ };
225
+ export declare const NvSplit: StencilReactComponent<NvSplitElement, NvSplitEvents>;
224
226
  export type NvStackEvents = NonNullable<unknown>;
225
227
  export declare const NvStack: StencilReactComponent<NvStackElement, NvStackEvents>;
226
- export type NvTableEvents = {
227
- onAction: EventName<CustomEvent<{
228
- keyAction: string;
229
- details: any;
230
- }>>;
231
- };
228
+ export type NvTableEvents = NonNullable<unknown>;
232
229
  export declare const NvTable: StencilReactComponent<NvTableElement, NvTableEvents>;
233
- export type NvTablecolumnEvents = NonNullable<unknown>;
234
- export declare const NvTablecolumn: StencilReactComponent<NvTablecolumnElement, NvTablecolumnEvents>;
235
230
  export type NvToggleEvents = {
236
231
  onCheckedChanged: EventName<CustomEvent<boolean>>;
237
232
  };
@@ -2,3 +2,4 @@ export * from './generated/components';
2
2
  export * from '@nova-design-system/nova-webcomponents/constants';
3
3
  export { defineCustomElements } from '@nova-design-system/nova-webcomponents/loader';
4
4
  export { useNotifications, NotificationProvider, type NotificationOptions, type NotificationContextValue, type NotificationProviderProps, type Notification, } from './providers/NotificationProvider';
5
+ export * from './components/NvDatatable';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nova-design-system/nova-react",
3
- "version": "3.15.0",
3
+ "version": "3.17.0",
4
4
  "description": "Nova is a design system created by Elia Group to empower creators to efficiently build solutions that people love to use.",
5
5
  "author": "Elia Group",
6
6
  "homepage": "https://nova.eliagroup.io",
@@ -16,9 +16,16 @@
16
16
  "dist"
17
17
  ],
18
18
  "exports": {
19
- "import": "./dist/index.js",
20
- "require": "./dist/cjs/index.js",
21
- "types": "./dist/types/index.d.ts"
19
+ ".": {
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/cjs/index.js",
22
+ "types": "./dist/types/index.d.ts",
23
+ "node": "./dist/generated/components.server.js"
24
+ },
25
+ "./server": {
26
+ "import": "./dist/generated/components.server.js",
27
+ "types": "./dist/types/generated/components.server.d.ts"
28
+ }
22
29
  },
23
30
  "publishConfig": {
24
31
  "registry": "https://registry.npmjs.org/",
@@ -33,11 +40,12 @@
33
40
  "tsc:watch": "tsc -p . --outDir ./dist --declarationDir ./dist/types --declaration true --watch",
34
41
  "storybook": "storybook dev -p 6006",
35
42
  "storybook.build": "storybook build -o ../../storybook-static/react",
36
- "clean": "rimraf dist lib/generated",
43
+ "clean": "rimraf dist lib/generated lib/stories/generated",
37
44
  "typecheck": "tsc --emitDeclarationOnly false --noEmit"
38
45
  },
39
46
  "dependencies": {
40
- "@nova-design-system/nova-webcomponents": "*"
47
+ "@nova-design-system/nova-webcomponents": "*",
48
+ "@tanstack/react-table": "8.21.3"
41
49
  },
42
50
  "devDependencies": {
43
51
  "react": "^18.3.1",
@@ -1,168 +0,0 @@
1
- 'use strict';
2
-
3
- /* eslint-disable @typescript-eslint/no-explicit-any */
4
- /**
5
- * All properties that should be excluded from the deep copy of an HTML element.
6
- */
7
- const excludedProps = new Set([
8
- // Text and content-related properties
9
- 'textContent',
10
- 'innerText',
11
- 'outerText',
12
- 'innerHTML',
13
- 'outerHTML',
14
- 'text',
15
- // Form element properties
16
- 'value',
17
- 'defaultValue',
18
- 'checked',
19
- 'defaultChecked',
20
- 'selectionStart',
21
- 'selectionEnd',
22
- 'selectionDirection',
23
- 'form',
24
- 'willValidate',
25
- 'validity',
26
- 'validationMessage',
27
- 'labels',
28
- 'list',
29
- 'maxLength',
30
- 'minLength',
31
- 'valueAsDate',
32
- 'valueAsNumber',
33
- // Editability and namespaces
34
- 'contentEditable',
35
- 'isContentEditable',
36
- 'namespaceURI',
37
- // Child-related properties (handled recursively)
38
- 'attributes',
39
- 'children',
40
- 'childNodes',
41
- 'firstChild',
42
- 'lastChild',
43
- // Blazor-related properties
44
- 'origin',
45
- 'dataset',
46
- 'attributeStyleMap',
47
- 'prefix',
48
- 'localName',
49
- 'tagName',
50
- 'shadowRoot',
51
- 'assignedSlot',
52
- 'scrollWidth',
53
- 'scrollHeight',
54
- 'clientTop',
55
- 'clientLeft',
56
- 'clientWidth',
57
- 'clientHeight',
58
- 'firstElementChild',
59
- 'lastElementChild',
60
- 'childElementCount',
61
- 'previousElementSibling',
62
- 'nextElementSibling',
63
- 'currentCSSZoom',
64
- 'nodeType',
65
- 'nodeName',
66
- 'baseURI',
67
- 'isConnected',
68
- 'ownerDocument',
69
- 'parentNode',
70
- 'parentElement',
71
- 'previousSibling',
72
- 'nextSibling',
73
- 'ELEMENT_NODE',
74
- 'ATTRIBUTE_NODE',
75
- 'TEXT_NODE',
76
- 'CDATA_SECTION_NODE',
77
- 'ENTITY_REFERENCE_NODE',
78
- 'ENTITY_NODE',
79
- 'PROCESSING_INSTRUCTION_NODE',
80
- 'COMMENT_NODE',
81
- 'DOCUMENT_NODE',
82
- 'DOCUMENT_TYPE_NODE',
83
- 'DOCUMENT_FRAGMENT_NODE',
84
- 'NOTATION_NODE',
85
- 'DOCUMENT_POSITION_DISCONNECTED',
86
- 'DOCUMENT_POSITION_PRECEDING',
87
- 'DOCUMENT_POSITION_FOLLOWING',
88
- 'DOCUMENT_POSITION_CONTAINS',
89
- 'DOCUMENT_POSITION_CONTAINED_BY',
90
- 'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
91
- ]);
92
- /**
93
- * Deep copy an HTML element with all its attributes, properties, and child nodes.
94
- * This method is useful for creating a clone of an element that can be safely modified without affecting the original.
95
- * @param {HTMLElement} element - The HTML element to copy.
96
- * @returns {HTMLElement} - A deep copy of the HTML element.
97
- * @example const copy = deepCopyElement(document.getElementById('myElement'));
98
- */
99
- function deepCopyElement(element) {
100
- const copy = document.createElement(element.tagName);
101
- // ✅ Copy attributes
102
- Array.from(element.attributes).forEach(attr => {
103
- copy.setAttribute(attr.name, attr.value);
104
- });
105
- // ✅ Dynamically extract relevant properties
106
- const properties = new Set();
107
- // Collect only own enumerable properties
108
- Object.keys(element).forEach(key => properties.add(key));
109
- // Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
110
- let proto = Object.getPrototypeOf(element);
111
- while (proto && proto !== HTMLElement.prototype) {
112
- Object.keys(proto).forEach(key => properties.add(key));
113
- proto = Object.getPrototypeOf(proto);
114
- }
115
- // ✅ Filter and copy only non-function properties (methods are excluded) and non-event listeners
116
- properties.forEach(prop => {
117
- if (typeof element[prop] !== 'function' && // Ignore methods
118
- !prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
119
- !excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
120
- ) {
121
- try {
122
- copy[prop] = element[prop];
123
- }
124
- catch (error) {
125
- console.warn(`Could not copy property ${prop}:`, error.message);
126
- }
127
- }
128
- });
129
- // ✅ Copy dataset separately
130
- Object.assign(copy.dataset, element.dataset);
131
- // ✅ Handle form elements specifically
132
- if (element instanceof HTMLInputElement) {
133
- copy.value = element.value;
134
- copy.checked = element.checked;
135
- copy.defaultValue = element.defaultValue;
136
- copy.defaultChecked = element.defaultChecked;
137
- copy.selectionStart = element.selectionStart;
138
- copy.selectionEnd = element.selectionEnd;
139
- copy.selectionDirection = element.selectionDirection;
140
- }
141
- else if (element instanceof HTMLTextAreaElement) {
142
- copy.value = element.value;
143
- copy.defaultValue = element.defaultValue;
144
- copy.selectionStart = element.selectionStart;
145
- copy.selectionEnd = element.selectionEnd;
146
- copy.selectionDirection =
147
- element.selectionDirection;
148
- }
149
- else if (element instanceof HTMLSelectElement) {
150
- copy.value = element.value;
151
- copy.selectedIndex = element.selectedIndex;
152
- }
153
- // ✅ Recursively copy child nodes (prevent duplicates)
154
- element.childNodes.forEach(child => {
155
- let childCopy;
156
- if (child.nodeType === Node.ELEMENT_NODE) {
157
- childCopy = deepCopyElement(child);
158
- }
159
- else {
160
- childCopy = child.cloneNode(true);
161
- }
162
- copy.appendChild(childCopy);
163
- });
164
- return copy;
165
- }
166
-
167
- exports.deepCopyElement = deepCopyElement;
168
- exports.excludedProps = excludedProps;
@@ -1,68 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-BK1_MpRZ.js');
4
- var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
5
- var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
6
- require('react');
7
- require('react-dom');
8
-
9
- const nvAvatarCss = "nv-avatar{align-items:center !important;background-color:var(--components-avatar-background-1);border-radius:var(--radius-rounded-full) !important;display:flex !important;flex-shrink:0 !important;font-family:\"TT Norms Pro\", sans-serif;font-style:normal;font-weight:var(--font-weight-medium-emphasis);justify-content:center !important;leading-trim:both;line-height:1 !important;text-align:center;text-edge:cap;text-transform:uppercase}nv-avatar.avatar-color-1{background-color:var(--components-avatar-background-1);color:var(--components-avatar-content-1)}nv-avatar.avatar-color-2{background-color:var(--components-avatar-background-2);color:var(--components-avatar-content-2)}nv-avatar.avatar-color-3{background-color:var(--components-avatar-background-3);color:var(--components-avatar-content-3)}nv-avatar.avatar-color-4{background-color:var(--components-avatar-background-4);color:var(--components-avatar-content-4)}nv-avatar.avatar-color-5{background-color:var(--components-avatar-background-5);color:var(--components-avatar-content-5)}nv-avatar.avatar-color-6{background-color:var(--components-avatar-background-6);color:var(--components-avatar-content-6)}nv-avatar.avatar-color-7{background-color:var(--components-avatar-background-7);color:var(--components-avatar-content-7)}nv-avatar.avatar-color-8{background-color:var(--components-avatar-background-8);color:var(--components-avatar-content-8)}nv-avatar.avatar-color-9{background-color:var(--components-avatar-background-9);color:var(--components-avatar-content-9)}nv-avatar.avatar-color-10{background-color:var(--components-avatar-background-10);color:var(--components-avatar-content-10)}nv-avatar img{height:100%;width:100%;object-fit:cover;object-position:center;border-radius:50%}nv-avatar.avatar-xs{width:var(--avatar-xs-size);height:var(--avatar-xs-size);font-size:var(--avatar-xs-font-size);line-height:var(--avatar-xs-font-size)}nv-avatar.avatar-xs nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-avatar.avatar-sm{width:var(--avatar-sm-size);height:var(--avatar-sm-size);font-size:var(--avatar-sm-font-size);line-height:var(--avatar-sm-font-size)}nv-avatar.avatar-sm nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-avatar.avatar-md{width:var(--avatar-md-size);height:var(--avatar-md-size);font-size:var(--avatar-md-font-size);line-height:var(--avatar-md-font-size)}nv-avatar.avatar-md nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-avatar.avatar-lg{width:var(--avatar-lg-size);height:var(--avatar-lg-size);font-size:var(--avatar-lg-font-size);line-height:var(--avatar-lg-font-size)}nv-avatar.avatar-lg nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-avatar.avatar-xl{width:var(--avatar-xl-size);height:var(--avatar-xl-size);font-size:var(--avatar-xl-font-size);line-height:var(--avatar-xl-font-size)}nv-avatar.avatar-xl nv-icon>svg{width:var(--spacing-7);height:var(--spacing-7);stroke-width:1.9px}";
10
- const NvAvatarStyle0 = nvAvatarCss;
11
-
12
- const NvAvatar = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- /**
16
- * Define the size of the avatar. You can use t-shirt sizes.
17
- */
18
- this.size = 'md';
19
- /**
20
- * You can apply different colors on the Avatar.
21
- * Use a string number between 1 and 10.
22
- */
23
- this.color = '1';
24
- }
25
- componentWillRender() {
26
- if (this.xsmall) {
27
- this.size = constants69bafca2.SemanticSizes.ExtraSmall;
28
- }
29
- if (this.small) {
30
- this.size = constants69bafca2.SemanticSizes.Small;
31
- }
32
- if (this.medium) {
33
- this.size = constants69bafca2.SemanticSizes.Medium;
34
- }
35
- if (this.large) {
36
- this.size = constants69bafca2.SemanticSizes.Large;
37
- }
38
- if (this.xlarge) {
39
- this.size = constants69bafca2.SemanticSizes.ExtraLarge;
40
- }
41
- if (this.text) {
42
- this.initials = this.text;
43
- }
44
- if (this.url) {
45
- this.src = this.url;
46
- }
47
- }
48
- //#endregion PROPERTIES
49
- /****************************************************************************/
50
- //#region METHODS
51
- /**
52
- * Makes sure the initials are trimmed to 2 letters.
53
- * @param {string} initials - The initials to be trimmed.
54
- * @returns {string} The trimmed initials.
55
- */
56
- trimInitials(initials) {
57
- return initials.trim().substring(0, 2);
58
- }
59
- //#endregion METHODS
60
- /****************************************************************************/
61
- //#region RENDER
62
- render() {
63
- return (index.h(index.Host, { key: '127d470eb9121f611f9e18f029ab9ef15a4a49df', class: clsx297c1ffe.clsx(`avatar-${this.size}`, `avatar-color-${this.color}`), "aria-label": this.alt }, this.src ? (index.h("img", { src: this.src, alt: this.alt })) : this.initials ? (this.trimInitials(this.initials)) : (index.h("slot", { name: "icon" }, index.h("nv-icon", { name: "user" })))));
64
- }
65
- };
66
- NvAvatar.style = NvAvatarStyle0;
67
-
68
- exports.nv_avatar = NvAvatar;