@nova-design-system/nova-react 3.21.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/grow.animation-24ad5cf8-LUp_ITEx.js +111 -0
- package/dist/cjs/{index-yxDlFA78.js → index-WPRkQD3O.js} +475 -178
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{nv-accordion-item.entry-5DF2ffDE.js → nv-accordion-item.entry-BuTvA6w9.js} +1 -1
- package/dist/cjs/{nv-accordion.entry-CPB1HBT1.js → nv-accordion.entry-Dtsfw6He.js} +1 -1
- package/dist/cjs/{nv-alert.entry-jPxt1obA.js → nv-alert.entry-TIdfdU7Y.js} +1 -1
- package/dist/cjs/{nv-avatar.entry-zmnREEN-.js → nv-avatar.entry-CaxrhPuw.js} +1 -1
- package/dist/cjs/{nv-badge_2.entry-DtkQx_M9.js → nv-badge_2.entry-CfYvTZxX.js} +2 -2
- package/dist/cjs/{nv-breadcrumb.entry-DHAe5FxQ.js → nv-breadcrumb.entry-BCZ4MmfD.js} +1 -1
- package/dist/cjs/{nv-breadcrumbs.entry-C7XepUqF.js → nv-breadcrumbs.entry-DwzCE7F6.js} +1 -1
- package/dist/cjs/{nv-button.entry-Dg1knj3Y.js → nv-button.entry-Cr_86bcZ.js} +1 -1
- package/dist/cjs/{nv-buttongroup.entry-Dlim9p8N.js → nv-buttongroup.entry-CWjRoHY1.js} +1 -1
- package/dist/cjs/{nv-calendar.entry-rL5_GdQg.js → nv-calendar.entry-CXfwNt6G.js} +1 -1
- package/dist/cjs/{nv-col.entry-CnbFx7h1.js → nv-col.entry-CJLDS3LY.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-CjUfR4ha.js → nv-datagrid.entry-Cns8XSud.js} +1 -1
- package/dist/cjs/{nv-datagridcolumn.entry-BiuYIp4q.js → nv-datagridcolumn.entry-CFFAipHF.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-fDywe5i2.js → nv-dialog.entry-CDSK9pUH.js} +54 -20
- package/dist/cjs/{nv-dialogfooter_2.entry-CckfZ_QW.js → nv-dialogfooter_2.entry-To_dGUn4.js} +3 -3
- package/dist/cjs/{nv-fieldcheckbox.entry-WmfLxGad.js → nv-fieldcheckbox.entry-fdonR07Z.js} +5 -5
- package/dist/cjs/{nv-fielddate.entry-GLGb7tzu.js → nv-fielddate.entry-C3pXtMHL.js} +15 -18
- package/dist/cjs/{nv-fielddaterange.entry-C8gXNY2P.js → nv-fielddaterange.entry-CjVVPEK_.js} +8 -10
- package/dist/cjs/{nv-fielddropdown.entry-BX1V8Uef.js → nv-fielddropdown.entry-C9mXuNNj.js} +15 -6
- package/dist/cjs/{nv-fielddropdownitem.entry-BMVFbA1v.js → nv-fielddropdownitem.entry-Dah-PaE8.js} +3 -3
- package/dist/cjs/{nv-fieldmultiselect.entry-BuV-qWbu.js → nv-fieldmultiselect.entry-BMLjhqoJ.js} +2 -2
- package/dist/cjs/{nv-fieldnumber.entry-qM1ct5SM.js → nv-fieldnumber.entry-DBdJviXu.js} +4 -4
- package/dist/cjs/{nv-fieldpassword.entry-BnGWErFQ.js → nv-fieldpassword.entry-Cim_usSM.js} +4 -4
- package/dist/cjs/{nv-fieldradio.entry-EliQYldW.js → nv-fieldradio.entry-X_2VT1Dj.js} +4 -4
- package/dist/cjs/{nv-fieldselect.entry-BfPVPmaZ.js → nv-fieldselect.entry-pSp-2rNn.js} +6 -6
- package/dist/cjs/{nv-fieldslider.entry-DBPpL94x.js → nv-fieldslider.entry-pZf7zzLU.js} +4 -4
- package/dist/cjs/{nv-fieldtext.entry-BnabKYgq.js → nv-fieldtext.entry-DlI_ExaV.js} +4 -4
- package/dist/cjs/{nv-fieldtextarea.entry-HaELAnJb.js → nv-fieldtextarea.entry-t3Ixxi23.js} +4 -4
- package/dist/cjs/{nv-fieldtime.entry-CWQM7fza.js → nv-fieldtime.entry-DY7D5_6K.js} +4 -4
- package/dist/cjs/{nv-icon.entry-B5cWNyvf.js → nv-icon.entry-6oYPSf4c.js} +2 -2
- package/dist/cjs/{nv-iconbutton_2.entry-CP1o9IVZ.js → nv-iconbutton_2.entry-ChULGovr.js} +3 -3
- package/dist/cjs/{nv-menu.entry-wMwI_sZ3.js → nv-menu.entry-sd0tatWq.js} +2 -2
- package/dist/cjs/{nv-menuitem.entry-C53TrB0_.js → nv-menuitem.entry-CCOqR7UF.js} +2 -2
- package/dist/cjs/{nv-notification.entry-BPyEusqt.js → nv-notification.entry-Cc3zE3yY.js} +2 -2
- package/dist/cjs/{nv-notificationcontainer.entry-MRIJURIS.js → nv-notificationcontainer.entry-DV4D6oOH.js} +2 -2
- package/dist/cjs/{nv-popover.entry-fj50OLMu.js → nv-popover.entry-DQSwI2jT.js} +14 -98
- package/dist/cjs/{nv-row.entry-T0OlcSij.js → nv-row.entry-UUuMSAY5.js} +2 -2
- package/dist/cjs/{nv-split.entry-DlI7I6Tb.js → nv-split.entry-CYP2bTTM.js} +2 -2
- package/dist/cjs/{nv-stack.entry-991A3rOk.js → nv-stack.entry-D35-75Vw.js} +2 -2
- package/dist/cjs/{nv-table.entry-ClSU3-cR.js → nv-table.entry-DevWJBnL.js} +2 -2
- package/dist/cjs/{nv-tableheader.entry-DzvbPDBN.js → nv-tableheader.entry-Hs7nUSOC.js} +2 -2
- package/dist/cjs/{nv-toggle.entry-Dq5hAoVB.js → nv-toggle.entry-Eje9d--6.js} +3 -3
- package/dist/cjs/{nv-togglebutton.entry-DI8HQ5Ou.js → nv-togglebutton.entry-LGI7pIeK.js} +2 -2
- package/dist/cjs/{nv-togglebuttongroup.entry-DzGOSBF7.js → nv-togglebuttongroup.entry-CWN_Ucry.js} +2 -2
- package/dist/cjs/{nv-tooltip.entry-CF0-gdZL.js → nv-tooltip.entry-BGkKDEFg.js} +2 -2
- package/dist/components/NvDatatable/NvDatatable.js +77 -4
- package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
- package/dist/types/components/NvDatatable/types.d.ts +17 -1
- package/package.json +1 -1
- package/dist/cjs/events.utils-fe1d907f-01N__3wY.js +0 -23
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
5
5
|
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
6
6
|
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
@@ -253,7 +253,7 @@ const NvNotification = class {
|
|
|
253
253
|
//#region RENDER
|
|
254
254
|
render() {
|
|
255
255
|
var _a, _b, _c;
|
|
256
|
-
return (index.h(index.Host, { key: '
|
|
256
|
+
return (index.h(index.Host, { key: '10e49ace93a23660383f9bbfb45460e610320db3', role: this.getAriaRole(), "aria-live": this.getAriaLive(), "aria-atomic": true, "aria-labelledby": (_a = this.getHeadingId()) !== null && _a !== void 0 ? _a : null, "aria-describedby": (_b = this.getMessageId()) !== null && _b !== void 0 ? _b : null, tabindex: "-1" }, index.h("div", { key: '1cce0d5c025e404ad641eed3c0ff07045db12de6', "data-scope": "container", ref: el => (this.container = el) }, this.dismissible && (index.h("button", { key: '64a9e8f95f51908ed82f5c832d5a9738420b574b', "data-scope": "dismiss", type: "button", onClick: this.dismiss.bind(this) }, index.h("nv-icon", { key: 'f4f5a742b862a52ebf7e2edc320e4521ad575a29', name: "x", size: "sm" }))), index.h("nv-icon", { key: 'a85552d6f9d81f67643f4a8c428464ed7af2ff90', name: (_c = this.icon) !== null && _c !== void 0 ? _c : this.getDefaultIcon(), size: "md", "data-scope": "icon" }), index.h("div", { key: 'bb7fd2fd626191f53b59507c3d5003369aaa2d70', "data-scope": "content" }, (this.heading || this.headingSlot) && (index.h("p", { key: 'ce333015dc488c8371d2dc90b97461888a28174e', id: this.getHeadingId(), "data-scope": "heading" }, index.h("slot", { key: '32c9d8c3c5a85a60e3993a5963ed019f5900e6c3', name: "heading" }, this.heading))), (this.message || this.messageSlot) && (index.h("p", { key: '08d57bf3058e3efcaf6d95de5754c34405ddddfb', id: this.getMessageId(), "data-scope": "message" }, index.h("slot", { key: 'f930fb38f00addf2911fc5401d906ee7c52b0920', name: "content" }, this.message))), this.actionsSlot && (index.h("div", { key: '983c60ec7fdf1ed85d2ef9d1a5c327d0aaf78013', "data-scope": "actions" }, index.h("slot", { key: '521bd4d20db65dc6025a9fb285599dbd7643bed0', name: "actions" })))))));
|
|
257
257
|
}
|
|
258
258
|
get el() { return index.getElement(this); }
|
|
259
259
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ const NvNotificationContainer = class {
|
|
|
33
33
|
/****************************************************************************/
|
|
34
34
|
//#region RENDER
|
|
35
35
|
render() {
|
|
36
|
-
return (index.h(index.Host, { key: '
|
|
36
|
+
return (index.h(index.Host, { key: 'bf0b7cd02e0d214516f352eb7016d6060d6959c5', class: `position-${this.position}` }, index.h("slot", { key: 'f042e3f11b4d2af4b47aadeba04a332c57889616' })));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
NvNotificationContainer.style = NvNotificationcontainerStyle0;
|
|
@@ -1,96 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
5
|
-
var
|
|
6
|
-
|
|
5
|
+
var grow_animation24ad5cf8 = require('./grow.animation-24ad5cf8-LUp_ITEx.js');
|
|
6
|
+
require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('react-dom');
|
|
9
9
|
|
|
10
|
-
const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) => {
|
|
11
|
-
const nodeStyler = fade_animation9b939939.index(node);
|
|
12
|
-
/**
|
|
13
|
-
* Will animate the scale and optionally the opacity to make the element grow and fade in,
|
|
14
|
-
* and removes the scale and opacity style attributes once complete.
|
|
15
|
-
*/
|
|
16
|
-
function growIn() {
|
|
17
|
-
return new Promise(resolve => {
|
|
18
|
-
styleValueTypes_esF5d10b79.animate({
|
|
19
|
-
from: { opacity: hasFade ? 0 : 1, scale: amount },
|
|
20
|
-
to: { opacity: 1, scale: 1 },
|
|
21
|
-
duration,
|
|
22
|
-
onUpdate(latest) {
|
|
23
|
-
const updates = {
|
|
24
|
-
scale: latest.scale,
|
|
25
|
-
};
|
|
26
|
-
if (hasFade) {
|
|
27
|
-
updates['opacity'] = latest.opacity;
|
|
28
|
-
}
|
|
29
|
-
nodeStyler.set(updates);
|
|
30
|
-
},
|
|
31
|
-
onComplete() {
|
|
32
|
-
resolve();
|
|
33
|
-
if (hasFade) {
|
|
34
|
-
node.style.removeProperty('opacity');
|
|
35
|
-
}
|
|
36
|
-
node.style.removeProperty('transform');
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Applies the growOut styles without animating, useful when the initial
|
|
43
|
-
* state is hidden.
|
|
44
|
-
*/
|
|
45
|
-
function setGrowOut() {
|
|
46
|
-
node.style.transform = `scale(${amount})`;
|
|
47
|
-
if (hasFade) {
|
|
48
|
-
node.style.opacity = '0';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Applies the growIn styles without animating, useful when the initial
|
|
53
|
-
* state is visible.
|
|
54
|
-
*/
|
|
55
|
-
function setGrowIn() {
|
|
56
|
-
node.style.transform = `scale(1)`;
|
|
57
|
-
if (hasFade) {
|
|
58
|
-
node.style.opacity = '1';
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Will animate the scale and optionally the opacity to make the element shrink and fade out,
|
|
63
|
-
* leaving the scale and opacity styles on the element.
|
|
64
|
-
*/
|
|
65
|
-
function growOut() {
|
|
66
|
-
return new Promise(resolve => {
|
|
67
|
-
styleValueTypes_esF5d10b79.animate({
|
|
68
|
-
from: { opacity: 1, scale: 1 },
|
|
69
|
-
to: { opacity: hasFade ? 0 : 1, scale: amount },
|
|
70
|
-
duration,
|
|
71
|
-
onUpdate(latest) {
|
|
72
|
-
const updates = {
|
|
73
|
-
scale: latest.scale,
|
|
74
|
-
};
|
|
75
|
-
if (hasFade) {
|
|
76
|
-
updates['opacity'] = latest.opacity;
|
|
77
|
-
}
|
|
78
|
-
nodeStyler.set(updates);
|
|
79
|
-
},
|
|
80
|
-
onComplete() {
|
|
81
|
-
resolve();
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
growIn,
|
|
88
|
-
growOut,
|
|
89
|
-
setGrowOut,
|
|
90
|
-
setGrowIn,
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
|
|
94
10
|
const min = Math.min;
|
|
95
11
|
const max = Math.max;
|
|
96
12
|
const round = Math.round;
|
|
@@ -1808,14 +1724,14 @@ const NvPopover = class {
|
|
|
1808
1724
|
*/
|
|
1809
1725
|
attachEventListeners() {
|
|
1810
1726
|
if (this.triggerElement && !this.eventsAttached) {
|
|
1811
|
-
|
|
1727
|
+
grow_animation24ad5cf8.addEventListeners(this.closeEvents, document, this);
|
|
1812
1728
|
if (this.triggerMode === 'click') {
|
|
1813
|
-
|
|
1729
|
+
grow_animation24ad5cf8.addEventListeners(this.clickEvents, this.triggerElement, this);
|
|
1814
1730
|
// Add document click and touch listeners
|
|
1815
|
-
|
|
1731
|
+
grow_animation24ad5cf8.addEventListeners(this.outsideClickEvents, document, this);
|
|
1816
1732
|
}
|
|
1817
1733
|
if (this.triggerMode === 'hover') {
|
|
1818
|
-
|
|
1734
|
+
grow_animation24ad5cf8.addEventListeners(this.hoverEvents, this.triggerElement, this);
|
|
1819
1735
|
}
|
|
1820
1736
|
this.eventsAttached = true;
|
|
1821
1737
|
}
|
|
@@ -1890,7 +1806,7 @@ const NvPopover = class {
|
|
|
1890
1806
|
state.groups.delete(this.groupName);
|
|
1891
1807
|
if (this.groupName && open)
|
|
1892
1808
|
state.groups.set(this.groupName, { openedBy: this.el });
|
|
1893
|
-
const { growIn } = useGrow(this.popoverElement, {
|
|
1809
|
+
const { growIn } = grow_animation24ad5cf8.useGrow(this.popoverElement, {
|
|
1894
1810
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1895
1811
|
amount: 0.85,
|
|
1896
1812
|
});
|
|
@@ -1942,7 +1858,7 @@ const NvPopover = class {
|
|
|
1942
1858
|
componentDidLoad() {
|
|
1943
1859
|
// Initial inline style setup
|
|
1944
1860
|
if (!this.open) {
|
|
1945
|
-
const { setGrowOut } = useGrow(this.popoverElement);
|
|
1861
|
+
const { setGrowOut } = grow_animation24ad5cf8.useGrow(this.popoverElement);
|
|
1946
1862
|
setGrowOut();
|
|
1947
1863
|
}
|
|
1948
1864
|
else {
|
|
@@ -1954,14 +1870,14 @@ const NvPopover = class {
|
|
|
1954
1870
|
this.attachEventListeners();
|
|
1955
1871
|
}
|
|
1956
1872
|
disconnectedCallback() {
|
|
1957
|
-
|
|
1873
|
+
grow_animation24ad5cf8.removeEventListeners(this.closeEvents, document, this);
|
|
1958
1874
|
if (this.triggerMode === 'click') {
|
|
1959
|
-
|
|
1875
|
+
grow_animation24ad5cf8.removeEventListeners(this.clickEvents, this.triggerElement, this);
|
|
1960
1876
|
// Remove document listeners
|
|
1961
|
-
|
|
1877
|
+
grow_animation24ad5cf8.removeEventListeners(this.outsideClickEvents, document, this);
|
|
1962
1878
|
}
|
|
1963
1879
|
if (this.triggerMode === 'hover')
|
|
1964
|
-
|
|
1880
|
+
grow_animation24ad5cf8.removeEventListeners(this.hoverEvents, this.triggerElement, this);
|
|
1965
1881
|
// Reset flag so events can be reattached if component is reconnected
|
|
1966
1882
|
this.eventsAttached = false;
|
|
1967
1883
|
// Clean up any pending timeouts
|
|
@@ -1974,7 +1890,7 @@ const NvPopover = class {
|
|
|
1974
1890
|
/****************************************************************************/
|
|
1975
1891
|
//#region RENDER
|
|
1976
1892
|
render() {
|
|
1977
|
-
return (index.h(index.Host, { key: '
|
|
1893
|
+
return (index.h(index.Host, { key: 'c54fc90b90bbe48b0410c750bf4ba97e51eb24e5' }, index.h("slot", { key: 'd957fba61d4e91d8afd85f14b602290c88e5128a', name: "trigger" }), index.h("div", { key: '548c798fc047d41c06d8a84cc9a4f65a4cbf75b5', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: 'd3c6e110e2c3f45ba0ed5c69b99f0a60413cbb39', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: '20c2d8e3ff0ed3d3b9957513e19586e4aa4a39ca', name: "content" }))));
|
|
1978
1894
|
}
|
|
1979
1895
|
get el() { return index.getElement(this); }
|
|
1980
1896
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ const NvRow = class {
|
|
|
14
14
|
/****************************************************************************/
|
|
15
15
|
//#region RENDER
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h(index.Host, { key: '
|
|
17
|
+
return (index.h(index.Host, { key: '8415bdad0106bd3d836996c617a749294e0c19e2' }, index.h("slot", { key: '77c069ced0dc25c4169945877c388f30d27fdc4f' })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
NvRow.style = NvRowStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -324,7 +324,7 @@ const NvSplit = class {
|
|
|
324
324
|
/****************************************************************************/
|
|
325
325
|
//#region RENDER
|
|
326
326
|
render() {
|
|
327
|
-
return (index.h(index.Host, { key: '
|
|
327
|
+
return (index.h(index.Host, { key: '6b1fd4447295f209a9b0ea95b7d2a07200204504', "data-dragging": this.isDragging.toString() }, index.h("slot", { key: '67089b66457c4ad64abb80749d64ca67c881a1c0', name: "pane" }), index.h("slot", { key: '2fe9da5dd2aa2ff5b14bdd9ea99e9f0fa027931d', name: "gutter" })));
|
|
328
328
|
}
|
|
329
329
|
get el() { return index.getElement(this); }
|
|
330
330
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -23,7 +23,7 @@ const NvStack = class {
|
|
|
23
23
|
/****************************************************************************/
|
|
24
24
|
//#region RENDER
|
|
25
25
|
render() {
|
|
26
|
-
return (index.h(index.Host, { key: '
|
|
26
|
+
return (index.h(index.Host, { key: '65adeb492f9eb9b709c809d65b52f4447d1c938d', class: clsx297c1ffe.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: '09773d6affbc9bf3c18e75162d9c096dd31a48e7' })));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
NvStack.style = NvStackStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -236,7 +236,7 @@ const NvTable = class {
|
|
|
236
236
|
/****************************************************************************/
|
|
237
237
|
//#region RENDER
|
|
238
238
|
render() {
|
|
239
|
-
return (index.h(index.Host, { key: '
|
|
239
|
+
return (index.h(index.Host, { key: '684a51e016d83eeb0ab76f07fe6d26a06bf00457' }, index.h("slot", { key: '420b9cbcb641692ed95d54ec2e0af1c0b09776c3' })));
|
|
240
240
|
}
|
|
241
241
|
get host() { return index.getElement(this); }
|
|
242
242
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -62,7 +62,7 @@ const NvTableheader = class {
|
|
|
62
62
|
/****************************************************************************/
|
|
63
63
|
//#region RENDER
|
|
64
64
|
render() {
|
|
65
|
-
return (index.h(index.Host, { key: '
|
|
65
|
+
return (index.h(index.Host, { key: '03d7e74c19c0c1ef54f4d6f53eab0964af821f57', role: "columnheader", "aria-sort": this.ariaSort, tabindex: this.sortable ? 0 : undefined, onKeyDown: this.handleKeyDown.bind(this), onClick: this.cycleSortDirection.bind(this) }, index.h("slot", { key: '7408d11ba38b59f05bcdcffcb55d11ae36f93a34' }), this.sortable && (index.h("span", { key: 'c76ddbf61861d9cd45eb7b0d8c59095947677135', class: "sort-icon-wrap", "aria-hidden": "true" }, index.h("nv-iconbutton", { key: '6d59b4b14dfe588142ccba2e1dc452754ea5a2f7', disableTabindex: true, name: "arrow-up", size: "xs", emphasis: this.sortDirection === 'none' ? 'lower' : 'low',
|
|
66
66
|
// prevent mousedown from selecting text
|
|
67
67
|
onMouseDown: (e) => e.preventDefault(), class: {
|
|
68
68
|
'is-none': this.sortDirection === 'none',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
6
6
|
require('react');
|
|
@@ -66,8 +66,8 @@ const NvToggle = class {
|
|
|
66
66
|
/****************************************************************************/
|
|
67
67
|
//#region RENDER
|
|
68
68
|
render() {
|
|
69
|
-
return (index.h(index.Host, { key: '
|
|
70
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
69
|
+
return (index.h(index.Host, { key: 'c4307e84431894271a4fbe3ccd236f8b26d8d499', class: clsx297c1ffe.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: 'edb8c0ba8d92aa3864ff778a037bfb148601663a', class: "input-container" }, index.h("input", { key: 'f8be6f1936b390acdfaab0a87acea69d479e7a5a', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), index.h("div", { key: 'c9dae62cda7d33fcd3dc4e1a2fd8173295a32ed3', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '365ed61ccd3ca72372998b4a3fc58d36de944f3a', htmlFor: this.inputId, class: clsx297c1ffe.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: '77ee33f84756787e0f34507da294abb9514b703d', name: "label" }, this.label))), (this.description ||
|
|
70
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '5076c7b3cbf9f820592bb339df3251e280a9be9c', class: "description" }, index.h("slot", { key: '75f461109ac021aa51e6717ab56b1319a2b7f6ca', name: "description" }, this.description))))));
|
|
71
71
|
}
|
|
72
72
|
static get formAssociated() { return true; }
|
|
73
73
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -48,7 +48,7 @@ const NvTogglebutton = class {
|
|
|
48
48
|
/****************************************************************************/
|
|
49
49
|
//#region RENDER
|
|
50
50
|
render() {
|
|
51
|
-
return (index.h(index.Host, { key: '
|
|
51
|
+
return (index.h(index.Host, { key: 'ef2adf60f4a453ba0c5c7bd83d3fc52d5c37f5d8', role: "button", tabindex: "0", "aria-pressed": String(this.active), onClick: this.handleClick }, index.h("slot", { key: '242d30a2d6f3d0cbaba1ee8cfb4abb2e607b66c4' })));
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
NvTogglebutton.style = NvTogglebuttonStyle0;
|
package/dist/cjs/{nv-togglebuttongroup.entry-DzGOSBF7.js → nv-togglebuttongroup.entry-CWN_Ucry.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -156,7 +156,7 @@ const NvTogglebuttongroup = class {
|
|
|
156
156
|
/****************************************************************************/
|
|
157
157
|
//#region RENDER
|
|
158
158
|
render() {
|
|
159
|
-
return (index.h(index.Host, { key: '
|
|
159
|
+
return (index.h(index.Host, { key: '8b42c5392c429b249ccc8be4f97fa6eccf4e2383' }, index.h("slot", { key: '78046dc23352a3fab760cc3c1b53edc47e16d48b' })));
|
|
160
160
|
}
|
|
161
161
|
get el() { return index.getElement(this); }
|
|
162
162
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-WPRkQD3O.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -46,7 +46,7 @@ const NvTooltip = class {
|
|
|
46
46
|
/****************************************************************************/
|
|
47
47
|
//#region RENDER
|
|
48
48
|
render() {
|
|
49
|
-
return (index.h(index.Host, { key: '
|
|
49
|
+
return (index.h(index.Host, { key: 'f0560549d1168fed22c4e48a2e11be5dda49f005' }, index.h("slot", { key: '698227e9bea7ea94eff00ff72f124656ed11624d' }), index.h("nv-popover", { key: 'df4ddd77e40b4998a32e166710a2ff27a1e0c216', triggerMode: "hover", hasArrow: true, placement: this.placement, strategy: this.strategy, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, index.h("p", { key: 'b8fc42997671fafc15173bce2fdf7dec667d76e5', slot: "content" }, this.message), index.h("slot", { key: '5b8a27ff474367ba2e5771deb62137e40f5d911d', name: "content" }))));
|
|
50
50
|
}
|
|
51
51
|
get el() { return index.getElement(this); }
|
|
52
52
|
};
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
import React, { useMemo, useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
|
|
1
|
+
import React, { useMemo, useState, useEffect, useRef, useCallback, } from 'react';
|
|
2
|
+
import { flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, useReactTable, } from '@tanstack/react-table';
|
|
3
3
|
import { NvTable, NvTableheader } from '../../generated/components';
|
|
4
|
-
function NvDatatable({ columns, rows, pagination, sorting, renderPagination, stickyHeader, ...htmlProps }) {
|
|
4
|
+
function NvDatatable({ columns, rows, pagination, sorting, filtering, renderPagination, renderFiltering, stickyHeader, ...htmlProps }) {
|
|
5
5
|
const [paginationState, setPaginationState] = useState({
|
|
6
6
|
pageIndex: 0,
|
|
7
7
|
pageSize: pagination?.initialPageSize || 10,
|
|
8
8
|
});
|
|
9
9
|
const [sortingState, setSortingState] = useState(sorting?.sortState || []);
|
|
10
|
+
const [globalFilterState, setGlobalFilterState] = useState(filtering?.filterState);
|
|
10
11
|
const lastRowRef = useRef(null);
|
|
12
|
+
const debouncedSetFilter = useRef(null);
|
|
13
|
+
const setGlobalFilterDebounced = useCallback((value) => {
|
|
14
|
+
const debounceMs = filtering?.debounceMs ?? 300;
|
|
15
|
+
if (debouncedSetFilter.current) {
|
|
16
|
+
clearTimeout(debouncedSetFilter.current);
|
|
17
|
+
}
|
|
18
|
+
debouncedSetFilter.current = setTimeout(() => {
|
|
19
|
+
setGlobalFilterState(value);
|
|
20
|
+
if (filtering?.mode === 'server' && filtering.onFilterChange) {
|
|
21
|
+
filtering.onFilterChange(value);
|
|
22
|
+
}
|
|
23
|
+
}, debounceMs);
|
|
24
|
+
}, [filtering]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
return () => {
|
|
27
|
+
if (debouncedSetFilter.current) {
|
|
28
|
+
clearTimeout(debouncedSetFilter.current);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (filtering?.filterState !== undefined) {
|
|
34
|
+
setGlobalFilterState(filtering.filterState);
|
|
35
|
+
}
|
|
36
|
+
}, [filtering?.filterState]);
|
|
11
37
|
const tableColumns = useMemo(() => columns
|
|
12
38
|
.filter((col) => !col.hidden)
|
|
13
39
|
.map((col) => {
|
|
@@ -64,6 +90,7 @@ function NvDatatable({ columns, rows, pagination, sorting, renderPagination, sti
|
|
|
64
90
|
...(sorting && {
|
|
65
91
|
state: {
|
|
66
92
|
sorting: sorting.sortState || sortingState,
|
|
93
|
+
...(filtering && { globalFilter: globalFilterState }),
|
|
67
94
|
},
|
|
68
95
|
onSortingChange: sorting.mode === 'server'
|
|
69
96
|
? (updater) => {
|
|
@@ -83,6 +110,23 @@ function NvDatatable({ columns, rows, pagination, sorting, renderPagination, sti
|
|
|
83
110
|
isMultiSortEvent: sorting.enableMultiSort ? () => true : undefined,
|
|
84
111
|
getSortedRowModel: sorting.mode === 'client' ? getSortedRowModel() : undefined,
|
|
85
112
|
}),
|
|
113
|
+
...(filtering && {
|
|
114
|
+
state: {
|
|
115
|
+
...(sorting && { sorting: sorting.sortState || sortingState }),
|
|
116
|
+
globalFilter: globalFilterState,
|
|
117
|
+
},
|
|
118
|
+
onGlobalFilterChange: (updater) => {
|
|
119
|
+
const newFilter = typeof updater === 'function'
|
|
120
|
+
? updater(globalFilterState)
|
|
121
|
+
: updater;
|
|
122
|
+
setGlobalFilterState(newFilter);
|
|
123
|
+
if (filtering.mode === 'server' && filtering.onFilterChange) {
|
|
124
|
+
filtering.onFilterChange(newFilter);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
globalFilterFn: filtering.globalFilterFn,
|
|
128
|
+
getFilteredRowModel: filtering.mode === 'client' ? getFilteredRowModel() : undefined,
|
|
129
|
+
}),
|
|
86
130
|
};
|
|
87
131
|
if (!pagination) {
|
|
88
132
|
return baseConfig;
|
|
@@ -120,7 +164,16 @@ function NvDatatable({ columns, rows, pagination, sorting, renderPagination, sti
|
|
|
120
164
|
};
|
|
121
165
|
}
|
|
122
166
|
return baseConfig;
|
|
123
|
-
}, [
|
|
167
|
+
}, [
|
|
168
|
+
rows,
|
|
169
|
+
tableColumns,
|
|
170
|
+
pagination,
|
|
171
|
+
paginationState,
|
|
172
|
+
sorting,
|
|
173
|
+
sortingState,
|
|
174
|
+
filtering,
|
|
175
|
+
globalFilterState,
|
|
176
|
+
]);
|
|
124
177
|
const table = useReactTable(tableConfig);
|
|
125
178
|
useEffect(() => {
|
|
126
179
|
if (pagination?.mode === 'server' && pagination.onPaginationChange) {
|
|
@@ -180,7 +233,27 @@ function NvDatatable({ columns, rows, pagination, sorting, renderPagination, sti
|
|
|
180
233
|
}, [pagination, table, rows.length, tablePaginationState]);
|
|
181
234
|
const tableRows = table.getRowModel().rows;
|
|
182
235
|
const isInfiniteScroll = pagination?.mode === 'infinite';
|
|
236
|
+
const filteringAPI = useMemo(() => {
|
|
237
|
+
if (!filtering) {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
const preFilteredRowModel = table.getPreFilteredRowModel();
|
|
241
|
+
const filteredRowModel = table.getFilteredRowModel();
|
|
242
|
+
return {
|
|
243
|
+
filterState: globalFilterState,
|
|
244
|
+
setGlobalFilter: setGlobalFilterDebounced,
|
|
245
|
+
resetFilters: () => {
|
|
246
|
+
setGlobalFilterState(undefined);
|
|
247
|
+
if (filtering.onFilterChange) {
|
|
248
|
+
filtering.onFilterChange(undefined);
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
totalRows: preFilteredRowModel.rows.length,
|
|
252
|
+
filteredRows: filteredRowModel.rows.length,
|
|
253
|
+
};
|
|
254
|
+
}, [filtering, globalFilterState, table, setGlobalFilterDebounced]);
|
|
183
255
|
return (React.createElement(React.Fragment, null,
|
|
256
|
+
filteringAPI && renderFiltering && renderFiltering(filteringAPI),
|
|
184
257
|
React.createElement(NvTable, { ...htmlProps },
|
|
185
258
|
React.createElement("table", null,
|
|
186
259
|
React.createElement("thead", { "data-sticky-top": stickyHeader ? 'true' : undefined }, table.getHeaderGroups().map((headerGroup) => (React.createElement("tr", { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NvDatatableProps } from './types';
|
|
3
|
-
declare function NvDatatable<T>({ columns, rows, pagination, sorting, renderPagination, stickyHeader, ...htmlProps }: NvDatatableProps<T>): React.JSX.Element;
|
|
3
|
+
declare function NvDatatable<T>({ columns, rows, pagination, sorting, filtering, renderPagination, renderFiltering, stickyHeader, ...htmlProps }: NvDatatableProps<T>): React.JSX.Element;
|
|
4
4
|
declare namespace NvDatatable {
|
|
5
5
|
var displayName: string;
|
|
6
6
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
import type { SortingFn, NoInfer, SortingState } from '@tanstack/react-table';
|
|
2
|
+
import type { SortingFn, NoInfer, SortingState, Row } from '@tanstack/react-table';
|
|
3
3
|
export type NvDatatableProps<T> = {
|
|
4
4
|
columns: Array<NvDatatableColumn<T>>;
|
|
5
5
|
rows: Array<T>;
|
|
6
6
|
pagination?: NvDatatablePaginationConfig;
|
|
7
7
|
sorting?: NvDatatableSortingConfig;
|
|
8
|
+
filtering?: NvDatatableFilteringConfig<T>;
|
|
8
9
|
renderPagination?: (api: NvDatatableRenderPaginationAPI) => React.ReactNode;
|
|
10
|
+
renderFiltering?: (api: NvDatatableRenderFilteringAPI) => React.ReactNode;
|
|
9
11
|
stickyHeader?: boolean;
|
|
10
12
|
} & Pick<ComponentProps<'div'>, 'className' | 'style'>;
|
|
11
13
|
export interface NvDatatableColumn<Row, K extends keyof Row = keyof Row, F = Row[K]> {
|
|
@@ -74,3 +76,17 @@ export interface NvDatatableSortingConfig {
|
|
|
74
76
|
sortState?: NvDataTableSortingState;
|
|
75
77
|
onSortingChange?: (sorting: SortingState) => void;
|
|
76
78
|
}
|
|
79
|
+
export interface NvDatatableFilteringConfig<T> {
|
|
80
|
+
mode: 'client' | 'server';
|
|
81
|
+
filterState?: unknown;
|
|
82
|
+
onFilterChange?: (filterState: unknown) => void;
|
|
83
|
+
globalFilterFn?: (row: Row<T>, columnId: string, filterValue: unknown) => boolean;
|
|
84
|
+
debounceMs?: number;
|
|
85
|
+
}
|
|
86
|
+
export interface NvDatatableRenderFilteringAPI {
|
|
87
|
+
filterState: unknown;
|
|
88
|
+
setGlobalFilter: (value: unknown) => void;
|
|
89
|
+
resetFilters: () => void;
|
|
90
|
+
totalRows: number;
|
|
91
|
+
filteredRows: number;
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nova-design-system/nova-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.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",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adds a set of event listeners to the given target.
|
|
5
|
-
* @param {EventsAndListeners} events - The events and listeners to add.
|
|
6
|
-
* @param {Element | Window | Document} target - The target element or window to add the event listeners to.
|
|
7
|
-
* @param {T} context - The class context to bind the event listeners to.
|
|
8
|
-
*/
|
|
9
|
-
function addEventListeners(events, target, context) {
|
|
10
|
-
events.forEach(([event, listener]) => target.addEventListener(event, listener.bind(context)));
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Removes a set of event listeners from the given target.
|
|
14
|
-
* @param {EventsAndListeners} events - The events and listeners to remove.
|
|
15
|
-
* @param {Element | Window | Document} target - The target element or window to remove the event listeners from.
|
|
16
|
-
* @param {T} context - The class context to bind the event listeners to.
|
|
17
|
-
*/
|
|
18
|
-
function removeEventListeners(events, target, context) {
|
|
19
|
-
events.forEach(([event, listener]) => target.removeEventListener(event, listener.bind(context)));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.addEventListeners = addEventListeners;
|
|
23
|
-
exports.removeEventListeners = removeEventListeners;
|