@nova-design-system/nova-react 3.24.0 → 3.26.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 +1 -0
- package/dist/cjs/dom.utils-CuXVGECR-8VY5SfMZ.js +177 -0
- package/dist/cjs/generated/components.server.js +82 -62
- package/dist/cjs/index-BeFrXZol.js +9699 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/{nv-accordion-item.entry-Bu1tAcCq.js → nv-accordion-item.entry-DtzjLTCo.js} +8 -7
- package/dist/cjs/{nv-accordion.entry-jWjLdX8w.js → nv-accordion.entry-DRcTfezT.js} +10 -8
- package/dist/cjs/{nv-alert.entry-E9ZJay_K.js → nv-alert.entry-86bfoXVx.js} +6 -4
- package/dist/cjs/nv-avatar.entry-mp2LJ6RA.js +68 -0
- package/dist/cjs/nv-badge_2.entry-BrDaHeqh.js +220 -0
- package/dist/cjs/nv-breadcrumb.entry-B2q7jJy2.js +49 -0
- package/dist/cjs/nv-breadcrumbs.entry-DKzST1uS.js +21 -0
- package/dist/cjs/nv-button.entry-CVgcU-bi.js +166 -0
- package/dist/cjs/{nv-buttongroup.entry-CuZCRsnV.js → nv-buttongroup.entry-CvuBGaGK.js} +12 -6
- package/dist/cjs/{nv-calendar.entry-CT3mASW6.js → nv-calendar.entry-BCcGhxzJ.js} +27 -19
- package/dist/cjs/{nv-col.entry--pCxkaTh.js → nv-col.entry-CzTahRVr.js} +3 -3
- package/dist/cjs/{nv-datagrid.entry-CGCEhO8C.js → nv-datagrid.entry-DWZxNqTE.js} +47 -184
- package/dist/cjs/{nv-datagridcolumn.entry-Fsqc7CT_.js → nv-datagridcolumn.entry-CzCzmdQl.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-B6OYcZxQ.js → nv-dialog.entry-ByVD02QB.js} +19 -20
- package/dist/cjs/{nv-dialogfooter_2.entry-C4fP_n2-.js → nv-dialogfooter_2.entry-BmQcYJsD.js} +11 -29
- package/dist/cjs/{nv-drawer.entry-C5O4KvHU.js → nv-drawer.entry-C15JRJ3N.js} +19 -19
- package/dist/cjs/{nv-drawerfooter_2.entry-C-reYJXG.js → nv-drawerfooter_2.entry-DuDac_Os.js} +11 -29
- package/dist/cjs/nv-fieldcheckbox.entry-CwDOQzSW.js +179 -0
- package/dist/cjs/{nv-fielddate.entry-dqZDBVmm.js → nv-fielddate.entry-DKICGwc0.js} +15 -13
- package/dist/cjs/{nv-fielddaterange.entry-wNRasXky.js → nv-fielddaterange.entry-DGEK8F9p.js} +15 -14
- package/dist/cjs/{nv-fielddropdown.entry-BA15piWa.js → nv-fielddropdown.entry-BLS7lRzD.js} +33 -31
- package/dist/cjs/nv-fielddropdownitem.entry-Bbfi3A8C.js +69 -0
- package/dist/cjs/{nv-fieldmultiselect.entry-BWY5xOAd.js → nv-fieldmultiselect.entry-Cpy7HzlZ.js} +28 -24
- package/dist/cjs/nv-fieldnumber.entry-SbNb4hKr.js +189 -0
- package/dist/cjs/nv-fieldpassword.entry-CPsgagjY.js +167 -0
- package/dist/cjs/nv-fieldradio.entry-DLP-rmKU.js +105 -0
- package/dist/cjs/{nv-fieldselect.entry-uUIZ6hmN.js → nv-fieldselect.entry-DOOO03kM.js} +20 -12
- package/dist/cjs/{nv-fieldslider.entry-DnvmxxYY.js → nv-fieldslider.entry-CpVbxkpo.js} +33 -15
- package/dist/cjs/nv-fieldtext.entry-BpbG4WHv.js +163 -0
- package/dist/cjs/nv-fieldtextarea.entry-BA_RApYN.js +245 -0
- package/dist/cjs/{nv-fieldtime.entry-DlMNDTht.js → nv-fieldtime.entry-DaJfwQtC.js} +15 -9
- package/dist/cjs/{nv-icon.entry-CnUkRzaA.js → nv-icon.entry-DIi792yJ.js} +4 -4
- package/dist/cjs/nv-iconbutton_2.entry-B4xB5WtE.js +171 -0
- package/dist/cjs/{nv-menu.entry-Dc_FvIx7.js → nv-menu.entry-DHWhkWeB.js} +9 -13
- package/dist/cjs/nv-menuitem.entry-CQApuT2D.js +59 -0
- package/dist/cjs/nv-notification-bullet.entry-CnYVWE_Z.js +76 -0
- package/dist/cjs/{nv-notification.entry-C3m5p5BL.js → nv-notification.entry-DraOvzsu.js} +4 -4
- package/dist/cjs/nv-notificationcontainer.entry-BDo-rQLL.js +41 -0
- package/dist/cjs/nv-paginationtable.entry-CS7BhAVe.js +231 -0
- package/dist/cjs/{nv-popover.entry-B0c-2rO4.js → nv-popover.entry-DSyKCLtF.js} +105 -33
- package/dist/cjs/nv-row.entry-D21zN2Vr.js +22 -0
- package/dist/cjs/{nv-sidebar.entry-CiN813gQ.js → nv-sidebar.entry-DpKgnjsJ.js} +10 -6
- package/dist/cjs/nv-sidebarcontent.entry-BWFDcui8.js +22 -0
- package/dist/cjs/{nv-sidebardivider.entry-B4EMyca5.js → nv-sidebardivider.entry-BSzLq-h3.js} +4 -4
- package/dist/cjs/{nv-sidebarfooter.entry-CHi4qOFe.js → nv-sidebarfooter.entry-C3DLHPSQ.js} +4 -4
- package/dist/cjs/nv-sidebargroup.entry-BMYLbCql.js +23 -0
- package/dist/cjs/{nv-sidebarheader.entry-_7ch0O3G.js → nv-sidebarheader.entry-CkUGD-Tw.js} +4 -4
- package/dist/cjs/{nv-sidebarlogo.entry-Ch9F-JnT.js → nv-sidebarlogo.entry-BX1-1S1v.js} +4 -4
- package/dist/cjs/{nv-sidebarnavitem.entry-DVrafSMr.js → nv-sidebarnavitem.entry-CPwt0Njh.js} +9 -7
- package/dist/cjs/nv-sidebarnavsubitem.entry-HZOTB6Tl.js +35 -0
- package/dist/cjs/{nv-split.entry-0HTslRAX.js → nv-split.entry-DdtzktvN.js} +10 -6
- package/dist/cjs/nv-stack.entry-BMLt30Nt.js +31 -0
- package/dist/cjs/{nv-table.entry-DH85n8Mc.js → nv-table.entry-RTiqKRKM.js} +6 -4
- package/dist/cjs/{nv-tableheader.entry-CKfocdxD.js → nv-tableheader.entry-Ci4qo8eY.js} +4 -4
- package/dist/cjs/nv-toggle.entry-s8B7-8P7.js +82 -0
- package/dist/cjs/nv-togglebutton.entry-CyHgU4Wl.js +66 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-C0NLbsq7.js → nv-togglebuttongroup.entry-Bn_9DsdP.js} +13 -9
- package/dist/cjs/nv-tooltip.entry-D6kxXLO-.js +56 -0
- package/dist/components/NvDatatable/NvDatatable.js +29 -8
- package/dist/generated/components.js +11 -0
- package/dist/generated/components.server.js +81 -62
- package/dist/providers/NotificationProvider.js +9 -8
- package/dist/types/components/NvDatatable/types.d.ts +6 -0
- package/dist/types/generated/components.d.ts +52 -46
- package/dist/types/generated/components.server.d.ts +52 -46
- package/package.json +7 -4
- package/dist/cjs/index-kU2nW5aN.js +0 -40286
- package/dist/cjs/nv-avatar.entry-CUX7u0kR.js +0 -68
- package/dist/cjs/nv-badge_2.entry-bxpV5gxE.js +0 -213
- package/dist/cjs/nv-breadcrumb.entry-Cbbb9Qeh.js +0 -46
- package/dist/cjs/nv-breadcrumbs.entry-BTqnp9zO.js +0 -21
- package/dist/cjs/nv-button.entry-upWH19y6.js +0 -162
- package/dist/cjs/nv-fieldcheckbox.entry-bk7UNQny.js +0 -177
- package/dist/cjs/nv-fielddropdownitem.entry-DEWaf9dC.js +0 -72
- package/dist/cjs/nv-fieldnumber.entry-DoYORd0d.js +0 -187
- package/dist/cjs/nv-fieldpassword.entry-CPaLj9aD.js +0 -165
- package/dist/cjs/nv-fieldradio.entry-CvUmEaCa.js +0 -103
- package/dist/cjs/nv-fieldtext.entry-BYAJp3n_.js +0 -163
- package/dist/cjs/nv-fieldtextarea.entry-DU2bWYeg.js +0 -237
- package/dist/cjs/nv-iconbutton_2.entry-hqp4AcRq.js +0 -167
- package/dist/cjs/nv-menuitem.entry-DzMhx6c_.js +0 -60
- package/dist/cjs/nv-notification-bullet.entry-BwhHCMQF.js +0 -76
- package/dist/cjs/nv-notificationcontainer.entry-DTRNn7VE.js +0 -41
- package/dist/cjs/nv-row.entry-CdcjVGZv.js +0 -22
- package/dist/cjs/nv-sidebarcontent.entry-D9hpAhK8.js +0 -22
- package/dist/cjs/nv-sidebargroup.entry-RVqrsyIU.js +0 -23
- package/dist/cjs/nv-sidebarnavsubitem.entry-C0XDAzma.js +0 -35
- package/dist/cjs/nv-stack.entry-CqO7uTQf.js +0 -31
- package/dist/cjs/nv-toggle.entry-BHUl76Im.js +0 -80
- package/dist/cjs/nv-togglebutton.entry-D_9COjY-.js +0 -67
- package/dist/cjs/nv-tooltip.entry-BfViGE_U.js +0 -55
- /package/dist/cjs/{i18n.utils-IlwlcG9l-ku0bScip.js → i18n.utils-CR9MpYzU-ku0bScip.js} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BeFrXZol.js');
|
|
4
|
+
require('@stencil/react-output-target/runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
|
|
8
|
+
const nvTooltipCss = () => `nv-tooltip{display:inline-block;vertical-align:top;position:relative;user-select:none}nv-tooltip:has([fluid]:not([fluid=false])){display:block}nv-tooltip nv-popover{display:block;height:0;min-height:0;overflow:visible}nv-tooltip nv-popover>[data-scope=popover]{background:var(--components-tooltip-background);color:var(--components-tooltip-text);font-weight:var(--font-weight-medium-emphasis);padding:var(--tooltip-padding-y) var(--tooltip-padding-x);font-size:var(--tooltip-font-size);border-radius:var(--tooltip-radius);border:none;box-shadow:0px var(--shadow-y-axis-lg-1) var(--shadow-blur-lg-1) var(--shadow-spread-lg-1) var(--shadow-color-opacity-1), 0px var(--shadow-y-axis-lg-2) var(--shadow-blur-lg-2) var(--shadow-spread-lg-2) var(--shadow-color-opacity-2)}nv-tooltip nv-popover>[data-scope=popover] [data-scope=arrow]{background:var(--components-tooltip-background);box-shadow:none;border:none}`;
|
|
9
|
+
|
|
10
|
+
const NvTooltip = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.openChanged = index.createEvent(this, "openChanged", 3);
|
|
14
|
+
this.defaultSlot = null;
|
|
15
|
+
this.popoverElement = null;
|
|
16
|
+
/**
|
|
17
|
+
* Decides where the tooltip shows up next to the element it’s linked to
|
|
18
|
+
* (above, below, to the sides). If there isn’t enough room, it will adjust
|
|
19
|
+
* it's position on the axis to fit on the screen, so users can always see it.
|
|
20
|
+
*/
|
|
21
|
+
this.placement = 'bottom';
|
|
22
|
+
/**
|
|
23
|
+
* Controls how long (in milliseconds) the tooltip waits to show after you
|
|
24
|
+
* hover over or focus on an element. If you move away before the delay is up,
|
|
25
|
+
* the tooltip won't appear.
|
|
26
|
+
*/
|
|
27
|
+
this.enterDelay = 0;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the positioning strategy for the tooltip. Options include:
|
|
30
|
+
* - `absolute`: Positions the tooltip relative to the trigger element
|
|
31
|
+
* (default).
|
|
32
|
+
* - `fixed`: Positions the tooltip relative to the viewport, useful when you
|
|
33
|
+
* need the tooltip to break out of overflow hidden containers, it will not
|
|
34
|
+
* scroll inside a scroll container due to the fixed positioning.
|
|
35
|
+
*/
|
|
36
|
+
this.strategy = 'absolute';
|
|
37
|
+
}
|
|
38
|
+
//#endregion EVENTS
|
|
39
|
+
/****************************************************************************/
|
|
40
|
+
//#region LIFECYCLE
|
|
41
|
+
componentDidRender() {
|
|
42
|
+
if (this.triggerElement || !this.defaultSlot)
|
|
43
|
+
return;
|
|
44
|
+
this.popoverElement.triggerElement = this.defaultSlot?.nextSibling;
|
|
45
|
+
}
|
|
46
|
+
//#endregion LIFECYCLE
|
|
47
|
+
/****************************************************************************/
|
|
48
|
+
//#region RENDER
|
|
49
|
+
render() {
|
|
50
|
+
return (index.h(index.Host, { key: 'bda9ba58186add585457f8fdf4a8e1d6389da01a' }, index.h("nv-popover", { key: 'ac67ea44cebbc8abb9ff4e190668093bb7179222', ref: el => (this.popoverElement = el), triggerMode: "hover", hasArrow: true, placement: this.placement, strategy: this.strategy, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay, onOpenChanged: e => this.openChanged.emit(e.detail) }, index.h("p", { key: 'b677689d4a73462b7d16ff7d9f31bfd61e7f47eb', slot: "content" }, this.message), index.h("slot", { key: 'bd1540db065fdeceb89d09d69e1dbf7ad4de728d', name: "content" })), index.h("slot", { key: '648d3c3125b0528cd8e88675122d775ad7cc40d9', ref: el => (this.defaultSlot = el) })));
|
|
51
|
+
}
|
|
52
|
+
get el() { return index.getElement(this); }
|
|
53
|
+
};
|
|
54
|
+
NvTooltip.style = nvTooltipCss();
|
|
55
|
+
|
|
56
|
+
exports.nv_tooltip = NvTooltip;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useRef, useCallback, } from 'react';
|
|
2
2
|
import { flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, useReactTable, } from '@tanstack/react-table';
|
|
3
|
-
import { NvTable, NvTableheader } from '../../generated/components';
|
|
3
|
+
import { NvTable, NvTableheader, NvPaginationtable, } from '../../generated/components';
|
|
4
|
+
import { defineCustomElement as defineNvPaginationtable } from '@nova-design-system/nova-webcomponents/dist/components/nv-paginationtable.js';
|
|
5
|
+
if (typeof window !== 'undefined' &&
|
|
6
|
+
!customElements.get('nv-paginationtable')) {
|
|
7
|
+
defineNvPaginationtable();
|
|
8
|
+
}
|
|
4
9
|
function NvDatatable({ mode = 'client', columns, rows, pagination, sorting, filtering, renderPagination, renderFiltering, stickyHeader, ...htmlProps }) {
|
|
5
10
|
const isInfiniteScroll = pagination?.infinite && mode === 'server';
|
|
6
11
|
const [paginationState, setPaginationState] = useState({
|
|
@@ -142,12 +147,11 @@ function NvDatatable({ mode = 'client', columns, rows, pagination, sorting, filt
|
|
|
142
147
|
return {
|
|
143
148
|
...baseConfig,
|
|
144
149
|
getPaginationRowModel: getPaginationRowModel(),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
pageSize: pagination.initialPageSize || 10,
|
|
149
|
-
},
|
|
150
|
+
state: {
|
|
151
|
+
...(baseConfig.state || {}),
|
|
152
|
+
pagination: paginationState,
|
|
150
153
|
},
|
|
154
|
+
onPaginationChange: setPaginationState,
|
|
151
155
|
};
|
|
152
156
|
}
|
|
153
157
|
if (mode === 'server' && !pagination.infinite) {
|
|
@@ -224,7 +228,7 @@ function NvDatatable({ mode = 'client', columns, rows, pagination, sorting, filt
|
|
|
224
228
|
const rowCount = mode === 'server' && !pagination.infinite
|
|
225
229
|
? pagination.totalRowCount || rows.length
|
|
226
230
|
: rows.length;
|
|
227
|
-
|
|
231
|
+
const api = {
|
|
228
232
|
pageIndex: tablePaginationState.pageIndex,
|
|
229
233
|
pageSize: tablePaginationState.pageSize,
|
|
230
234
|
pageCount,
|
|
@@ -240,6 +244,7 @@ function NvDatatable({ mode = 'client', columns, rows, pagination, sorting, filt
|
|
|
240
244
|
isLoading: isInfiniteScroll ? pagination.isLoading : undefined,
|
|
241
245
|
hasMore: isInfiniteScroll ? pagination.hasMore : undefined,
|
|
242
246
|
};
|
|
247
|
+
return api;
|
|
243
248
|
}, [
|
|
244
249
|
pagination,
|
|
245
250
|
table,
|
|
@@ -249,6 +254,17 @@ function NvDatatable({ mode = 'client', columns, rows, pagination, sorting, filt
|
|
|
249
254
|
isInfiniteScroll,
|
|
250
255
|
]);
|
|
251
256
|
const tableRows = table.getRowModel().rows;
|
|
257
|
+
const renderDefaultPagination = (api) => {
|
|
258
|
+
const labelProps = {};
|
|
259
|
+
if (pagination?.labels?.page)
|
|
260
|
+
labelProps.labelPage = pagination.labels.page;
|
|
261
|
+
if (pagination?.labels?.total)
|
|
262
|
+
labelProps.labelTotal = pagination.labels.total;
|
|
263
|
+
if (pagination?.labels?.pageSizeOption)
|
|
264
|
+
labelProps.labelPageSizeOption = pagination.labels.pageSizeOption;
|
|
265
|
+
return (React.createElement("div", { "data-testid": "default-pagination-wrapper", style: { marginTop: '16px' } },
|
|
266
|
+
React.createElement(NvPaginationtable, { pageIndex: api.pageIndex, pageSize: api.pageSize, pageCount: api.pageCount, rowCount: api.rowCount, ...labelProps, onPageIndexChanged: (e) => api.setPageIndex(e.detail), onPageSizeChanged: (e) => api.setPageSize(e.detail) })));
|
|
267
|
+
};
|
|
252
268
|
const filteringAPI = useMemo(() => {
|
|
253
269
|
if (!filtering) {
|
|
254
270
|
return null;
|
|
@@ -288,7 +304,12 @@ function NvDatatable({ mode = 'client', columns, rows, pagination, sorting, filt
|
|
|
288
304
|
const isLastRow = isInfiniteScroll && index === tableRows.length - 1;
|
|
289
305
|
return (React.createElement("tr", { key: row.id, "data-testid": `datatable-row-${index}`, ref: isLastRow ? lastRowRef : undefined }, row.getVisibleCells().map((cell) => (React.createElement("td", { key: cell.id, "data-testid": `datatable-cell-${cell.column.id}` }, flexRender(cell.column.columnDef.cell, cell.getContext()))))));
|
|
290
306
|
})))),
|
|
291
|
-
paginationAPI &&
|
|
307
|
+
paginationAPI &&
|
|
308
|
+
(renderPagination
|
|
309
|
+
? renderPagination(paginationAPI)
|
|
310
|
+
: mode === 'client' && !pagination?.infinite
|
|
311
|
+
? renderDefaultPagination(paginationAPI)
|
|
312
|
+
: null)));
|
|
292
313
|
}
|
|
293
314
|
NvDatatable.displayName = 'NvDatatable';
|
|
294
315
|
export { NvDatatable };
|
|
@@ -41,6 +41,7 @@ import { NvMenuitem as NvMenuitemElement, defineCustomElement as defineNvMenuite
|
|
|
41
41
|
import { NvNotificationBullet as NvNotificationBulletElement, defineCustomElement as defineNvNotificationBullet } from "@nova-design-system/nova-webcomponents/dist/components/nv-notification-bullet.js";
|
|
42
42
|
import { NvNotification as NvNotificationElement, defineCustomElement as defineNvNotification } from "@nova-design-system/nova-webcomponents/dist/components/nv-notification.js";
|
|
43
43
|
import { NvNotificationcontainer as NvNotificationcontainerElement, defineCustomElement as defineNvNotificationcontainer } from "@nova-design-system/nova-webcomponents/dist/components/nv-notificationcontainer.js";
|
|
44
|
+
import { NvPaginationtable as NvPaginationtableElement, defineCustomElement as defineNvPaginationtable } from "@nova-design-system/nova-webcomponents/dist/components/nv-paginationtable.js";
|
|
44
45
|
import { NvPopover as NvPopoverElement, defineCustomElement as defineNvPopover } from "@nova-design-system/nova-webcomponents/dist/components/nv-popover.js";
|
|
45
46
|
import { NvRow as NvRowElement, defineCustomElement as defineNvRow } from "@nova-design-system/nova-webcomponents/dist/components/nv-row.js";
|
|
46
47
|
import { NvSidebar as NvSidebarElement, defineCustomElement as defineNvSidebar } from "@nova-design-system/nova-webcomponents/dist/components/nv-sidebar.js";
|
|
@@ -389,6 +390,16 @@ export const NvNotificationcontainer = createComponent({
|
|
|
389
390
|
events: {},
|
|
390
391
|
defineCustomElement: defineNvNotificationcontainer
|
|
391
392
|
});
|
|
393
|
+
export const NvPaginationtable = createComponent({
|
|
394
|
+
tagName: 'nv-paginationtable',
|
|
395
|
+
elementClass: NvPaginationtableElement,
|
|
396
|
+
react: React,
|
|
397
|
+
events: {
|
|
398
|
+
onPageIndexChanged: 'pageIndexChanged',
|
|
399
|
+
onPageSizeChanged: 'pageSizeChanged'
|
|
400
|
+
},
|
|
401
|
+
defineCustomElement: defineNvPaginationtable
|
|
402
|
+
});
|
|
392
403
|
export const NvPopover = createComponent({
|
|
393
404
|
tagName: 'nv-popover',
|
|
394
405
|
elementClass: NvPopoverElement,
|