@nova-design-system/nova-react 3.19.0 → 3.20.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 +3 -20
- package/dist/cjs/{index-C12eD0Qt.js → index-BObVnP12.js} +89 -54
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/{nv-accordion-item.entry-99OJUl7m.js → nv-accordion-item.entry-BBAGkmLI.js} +1 -1
- package/dist/cjs/{nv-accordion.entry-D8jaknF9.js → nv-accordion.entry-CvvtdLIz.js} +1 -1
- package/dist/cjs/{nv-alert.entry-D_uvQxc9.js → nv-alert.entry-w5XeFsrC.js} +1 -1
- package/dist/cjs/{nv-avatar.entry-B2zfDM3w.js → nv-avatar.entry-BxUZg-8h.js} +1 -1
- package/dist/cjs/{nv-badge_2.entry-Fnq2K2Ul.js → nv-badge_2.entry-DdSIFlJf.js} +1 -1
- package/dist/cjs/{nv-breadcrumb.entry-CEN2iYUQ.js → nv-breadcrumb.entry-CmbqGw3C.js} +1 -1
- package/dist/cjs/{nv-breadcrumbs.entry-Bq8qINNk.js → nv-breadcrumbs.entry-DFHxtPKv.js} +1 -1
- package/dist/cjs/{nv-button.entry-CmpagMPP.js → nv-button.entry-Dyks6_mF.js} +1 -1
- package/dist/cjs/{nv-buttongroup.entry-CbTXVSWL.js → nv-buttongroup.entry-wn9zFd_M.js} +1 -1
- package/dist/cjs/{nv-calendar.entry-DNkXS4ll.js → nv-calendar.entry-Dldsa6dz.js} +1 -1
- package/dist/cjs/{nv-col.entry-Dlrdqper.js → nv-col.entry-DnG79KM1.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-Z5GHfOvp.js → nv-datagrid.entry-C2ML-e47.js} +1 -1
- package/dist/cjs/{nv-datagridcolumn.entry-DvSFVguN.js → nv-datagridcolumn.entry-DcMPUtQS.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-BV6QBtx2.js → nv-dialog.entry-C0Vx7dQc.js} +1 -1
- package/dist/cjs/{nv-dialogfooter_2.entry-Ci1C_E-2.js → nv-dialogfooter_2.entry-BGq8Jiib.js} +1 -1
- package/dist/cjs/{nv-fieldcheckbox.entry-BD9ETFVV.js → nv-fieldcheckbox.entry-CAPwYnSU.js} +1 -1
- package/dist/cjs/{nv-fielddate.entry-C06n2Hri.js → nv-fielddate.entry-Byt5cmQi.js} +1 -1
- package/dist/cjs/{nv-fielddaterange.entry-DFlaA4gv.js → nv-fielddaterange.entry-CCFeFP2q.js} +1 -1
- package/dist/cjs/{nv-fielddropdown.entry-ONwdJHOm.js → nv-fielddropdown.entry-BFp_2vBC.js} +1 -1
- package/dist/cjs/{nv-fielddropdownitem.entry-CDKQtEra.js → nv-fielddropdownitem.entry-D_4KdBY1.js} +1 -1
- package/dist/cjs/{nv-fieldmultiselect.entry-BHJC59Mw.js → nv-fieldmultiselect.entry-BaUD7Dcr.js} +1 -1
- package/dist/cjs/{nv-fieldnumber.entry-CmL1LPom.js → nv-fieldnumber.entry-DOmhBrDv.js} +25 -8
- package/dist/cjs/{nv-fieldpassword.entry-Bqbf_LJJ.js → nv-fieldpassword.entry-hogiPC5z.js} +1 -1
- package/dist/cjs/{nv-fieldradio.entry-RzSCysif.js → nv-fieldradio.entry-CKbyWpIK.js} +1 -1
- package/dist/cjs/{nv-fieldselect.entry-COTE8Ntn.js → nv-fieldselect.entry-tpURNUEP.js} +1 -1
- package/dist/cjs/{nv-fieldslider.entry-BVfmpUhc.js → nv-fieldslider.entry-v0d92XEY.js} +4 -2
- package/dist/cjs/{nv-fieldtext.entry-DO0lmw9C.js → nv-fieldtext.entry-DNYrOAhj.js} +1 -1
- package/dist/cjs/{nv-fieldtextarea.entry-CzVq8gjw.js → nv-fieldtextarea.entry-cRsjPwwR.js} +1 -1
- package/dist/cjs/{nv-fieldtime.entry-CRNYbeMY.js → nv-fieldtime.entry-BpGBUfKr.js} +1 -1
- package/dist/cjs/{nv-icon.entry-FoRJzCHm.js → nv-icon.entry-BfmyacWA.js} +1 -1
- package/dist/cjs/{nv-iconbutton_2.entry-0lnnCk0B.js → nv-iconbutton_2.entry-DOv1RrkS.js} +1 -1
- package/dist/cjs/{nv-menu.entry-BjXa70qP.js → nv-menu.entry-C2L8F-nG.js} +1 -1
- package/dist/cjs/{nv-menuitem.entry-CSPwpUWz.js → nv-menuitem.entry-DuDZTlJ1.js} +1 -1
- package/dist/cjs/{nv-notification.entry-BYHTrzUz.js → nv-notification.entry-DxAj-mc7.js} +1 -1
- package/dist/cjs/{nv-notificationcontainer.entry-BBjrL7gt.js → nv-notificationcontainer.entry-CUnTicXF.js} +1 -1
- package/dist/cjs/{nv-popover.entry-J_M8_rLL.js → nv-popover.entry-DVwa4DvW.js} +1 -1
- package/dist/cjs/{nv-row.entry-CmOypCPp.js → nv-row.entry-iLk2UglX.js} +1 -1
- package/dist/cjs/{nv-split.entry-BqBytQZn.js → nv-split.entry-BrMHK6TS.js} +1 -1
- package/dist/cjs/{nv-stack.entry-BKPf62wy.js → nv-stack.entry-C8jLJ5Ki.js} +1 -1
- package/dist/cjs/{nv-table.entry-DSL_jd5Y.js → nv-table.entry-D6o4g9Vo.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-DbQQdp5m.js → nv-toggle.entry-9iwmu7qi.js} +1 -1
- package/dist/cjs/{nv-togglebutton.entry-DNG6SFTU.js → nv-togglebutton.entry-N7_CSvzS.js} +1 -1
- package/dist/cjs/{nv-togglebuttongroup.entry-Bl43CVZN.js → nv-togglebuttongroup.entry-DWCytOhV.js} +1 -1
- package/dist/cjs/{nv-tooltip.entry-CV841nfI.js → nv-tooltip.entry-BMxnZVYA.js} +1 -1
- package/dist/components/NvDatatable.js +17 -2
- package/dist/types/components/NvDatatable.d.ts +26 -19
- package/dist/types/generated/components.d.ts +1 -1
- package/dist/types/generated/components.server.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,26 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
**Nova Components React** provides an easy way to use [Nova’s native Web Components](https://www.npmjs.com/package/@nova-design-system/nova-webcomponents) within your React applications.
|
|
4
4
|
|
|
5
|
-
- [Nova Components React](#nova-components-react)
|
|
6
|
-
- [Key Features](#key-features)
|
|
7
|
-
- [Installation](#installation)
|
|
8
|
-
- [Setting up Tailwind](#setting-up-tailwind)
|
|
9
|
-
- [About Tailwind and the Nova Plugin](#about-tailwind-and-the-nova-plugin)
|
|
10
|
-
- [1. Install Tailwind CSS and the Vite Plugin](#1-install-tailwind-css-and-the-vite-plugin)
|
|
11
|
-
- [2. Configure the Vite Plugin](#2-configure-the-vite-plugin)
|
|
12
|
-
- [3. Create `tailwind.config.ts`](#3-create-tailwindconfigts)
|
|
13
|
-
- [4. Configure Tailwind and Nova Plugin in `index.css`](#4-configure-tailwind-and-nova-plugin-in-indexcss)
|
|
14
|
-
- [5. Include the Nova Tokens (Spark or Ocean)](#5-include-the-nova-tokens-spark-or-ocean)
|
|
15
|
-
- [6. Use Nova Components with Tailwind Utilities](#6-use-nova-components-with-tailwind-utilities)
|
|
16
|
-
- [7. Setup the Nova Font](#7-setup-the-nova-font)
|
|
17
|
-
- [Creating Your Own Style Components with Tailwind](#creating-your-own-style-components-with-tailwind)
|
|
18
|
-
- [Nova Font Pro Integration](#nova-font-pro-integration)
|
|
19
|
-
- [Option 1: Import in Global CSS (Recommended)](#option-1-import-in-global-css-recommended)
|
|
20
|
-
- [Option 2: HTML Integration](#option-2-html-integration)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
5
|
## Key Features
|
|
26
6
|
|
|
27
7
|
- **Lightweight Integration**: Leverage Nova Web Components with minimal configuration in React.
|
|
@@ -35,6 +15,9 @@
|
|
|
35
15
|
|
|
36
16
|
Install the necessary packages using the package manager of your choice:
|
|
37
17
|
|
|
18
|
+
> [!IMPORTANT]
|
|
19
|
+
> If you want to set it up in NextJS, please refer to the [NextJS Integration Guide](/docs/guides-next-js-integration--docs).
|
|
20
|
+
|
|
38
21
|
```bash
|
|
39
22
|
npm install @nova-design-system/nova-webcomponents @nova-design-system/nova-base @nova-design-system/nova-react
|
|
40
23
|
```
|
|
@@ -22755,7 +22755,15 @@ const NvFieldnumber$2 = /*@__PURE__*/ proxyCustomElement(class NvFieldnumber ext
|
|
|
22755
22755
|
//#region METHODS
|
|
22756
22756
|
this.handleInput = (event) => {
|
|
22757
22757
|
const input = event.target;
|
|
22758
|
-
|
|
22758
|
+
if (input.value === '') {
|
|
22759
|
+
this.value = null;
|
|
22760
|
+
return;
|
|
22761
|
+
}
|
|
22762
|
+
const nextValue = input.valueAsNumber;
|
|
22763
|
+
if (Number.isNaN(nextValue)) {
|
|
22764
|
+
return;
|
|
22765
|
+
}
|
|
22766
|
+
this.value = nextValue;
|
|
22759
22767
|
};
|
|
22760
22768
|
this.handleInputContainerClick = () => {
|
|
22761
22769
|
this.inputElement.focus();
|
|
@@ -22773,17 +22781,26 @@ const NvFieldnumber$2 = /*@__PURE__*/ proxyCustomElement(class NvFieldnumber ext
|
|
|
22773
22781
|
event.preventDefault();
|
|
22774
22782
|
};
|
|
22775
22783
|
this.isMinValueReached = () => {
|
|
22776
|
-
return this.min !== undefined &&
|
|
22784
|
+
return (this.min !== undefined &&
|
|
22785
|
+
typeof this.value === 'number' &&
|
|
22786
|
+
this.value <= this.min);
|
|
22777
22787
|
};
|
|
22778
22788
|
this.isMaxValueReached = () => {
|
|
22779
|
-
return this.max !== undefined &&
|
|
22789
|
+
return (this.max !== undefined &&
|
|
22790
|
+
typeof this.value === 'number' &&
|
|
22791
|
+
this.value >= this.max);
|
|
22780
22792
|
};
|
|
22781
22793
|
}
|
|
22782
22794
|
//#endregion EVENTS
|
|
22783
22795
|
/****************************************************************************/
|
|
22784
22796
|
//#region WATCHERS
|
|
22785
22797
|
watchValueHandler(newValue) {
|
|
22786
|
-
|
|
22798
|
+
const normalized = typeof newValue === 'number' && !Number.isNaN(newValue) ? newValue : null;
|
|
22799
|
+
if (this.lastEmittedValue === normalized) {
|
|
22800
|
+
return;
|
|
22801
|
+
}
|
|
22802
|
+
this.lastEmittedValue = normalized;
|
|
22803
|
+
this.valueChanged.emit(normalized);
|
|
22787
22804
|
}
|
|
22788
22805
|
//#endregion METHODS
|
|
22789
22806
|
/****************************************************************************/
|
|
@@ -22801,9 +22818,9 @@ const NvFieldnumber$2 = /*@__PURE__*/ proxyCustomElement(class NvFieldnumber ext
|
|
|
22801
22818
|
/****************************************************************************/
|
|
22802
22819
|
//#region RENDER
|
|
22803
22820
|
render() {
|
|
22804
|
-
return (h$1(Host$1, { key: '
|
|
22805
|
-
this.el.querySelector('[slot="description"]')) && (h$1("div", { key: '
|
|
22806
|
-
this.el.querySelector('[slot="error-description"]')) && (h$1("div", { key: '
|
|
22821
|
+
return (h$1(Host$1, { key: '9b3239f09e6aace03f79f07399723fdbf557f070' }, (this.label || this.el.querySelector('[slot="label"]')) && (h$1("label", { key: '322478abbaf477a33debcd828387402299ce6762', htmlFor: this.inputId }, h$1("slot", { key: '75b791ca0fb7eec55faaf966a32733e37b87fb90', name: "label" }, this.label))), h$1("div", { key: '5ce6c27db2b6b0ba8618ed2eac1f61abf8177793', class: "input-wrapper" }, h$1("slot", { key: '3a4a86e358d575fc312d27ee5ffba68474904bd4', name: "before-input" }), h$1("div", { key: '8e07c3c37ea4869aa309fba913663e1d225e21fd', class: "input-container", onClick: this.handleInputContainerClick }, h$1("slot", { key: '91e7c82e46d3268493669e6dd121f643be86a6be', name: "leading-input" }), h$1("input", { key: '3dcbd9d10e4425ebb29b16b1157845ea4ee7bdef', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: typeof this.value === 'number' ? this.value : undefined, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), h$1("slot", { key: '7d0d4a77d121433f4feb8aa2139be8e94f8e57a5', name: "trailing-input" }), this.error && (h$1("nv-icon", { key: '2a3969e56de0fc3911901c9540e300caf2b6d681', name: "alert-circle", class: "validation", size: "md" })), this.success && (h$1("nv-icon", { key: '8964d7ffaa2cc2a70caf781a37e66383234c6895', name: "circle-check", class: "validation", size: "md" })), h$1("div", { key: '1ca2fd7095afbc12a1a54c8b09551f28fe5a3579', class: "stepper" }, h$1("nv-iconbutton", { key: '1c3f9200c5409bc05fab9061dff3847a92298d45', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }), h$1("nv-iconbutton", { key: 'eb65687b3c31d2ac8bdb534f5ca300a1ada9cd64', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }))), h$1("slot", { key: '01006c0c2487bce4f908104d263acb0231cdb701', name: "after-input" })), (this.description ||
|
|
22822
|
+
this.el.querySelector('[slot="description"]')) && (h$1("div", { key: '9db93a8aa6bb002a3286763909118e9c7a1661c0', class: "description" }, h$1("slot", { key: '13b0f797bace74e641cdd658bb798bccbfec70dc', name: "description" }, this.description))), (this.errorDescription ||
|
|
22823
|
+
this.el.querySelector('[slot="error-description"]')) && (h$1("div", { key: '4ca240bc22fb83a283637e60384e59d687d67e9e', hidden: !this.error, class: "error-description" }, h$1("slot", { key: '145b68572a38e91559431ff51ec38a64027d4978', name: "error-description" }, this.errorDescription)))));
|
|
22807
22824
|
}
|
|
22808
22825
|
static get formAssociated() { return true; }
|
|
22809
22826
|
get el() { return this; }
|
|
@@ -23801,7 +23818,9 @@ const FieldInput = props => {
|
|
|
23801
23818
|
const handleValueChanged = (event) => {
|
|
23802
23819
|
event.stopPropagation();
|
|
23803
23820
|
const newValue = event.detail;
|
|
23804
|
-
|
|
23821
|
+
// Accept null as a valid value (when field is cleared)
|
|
23822
|
+
// Only reject NaN numbers
|
|
23823
|
+
if (typeof newValue === 'number' && Number.isNaN(newValue)) {
|
|
23805
23824
|
return;
|
|
23806
23825
|
}
|
|
23807
23826
|
onInput({
|
|
@@ -28229,179 +28248,179 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
28229
28248
|
case 'nv-accordion':
|
|
28230
28249
|
return Promise.resolve().then(function () { return require(
|
|
28231
28250
|
/* webpackMode: "lazy" */
|
|
28232
|
-
'./nv-accordion.entry-
|
|
28251
|
+
'./nv-accordion.entry-CvvtdLIz.js'); }).then(processMod, consoleError);
|
|
28233
28252
|
case 'nv-alert':
|
|
28234
28253
|
return Promise.resolve().then(function () { return require(
|
|
28235
28254
|
/* webpackMode: "lazy" */
|
|
28236
|
-
'./nv-alert.entry-
|
|
28255
|
+
'./nv-alert.entry-w5XeFsrC.js'); }).then(processMod, consoleError);
|
|
28237
28256
|
case 'nv-avatar':
|
|
28238
28257
|
return Promise.resolve().then(function () { return require(
|
|
28239
28258
|
/* webpackMode: "lazy" */
|
|
28240
|
-
'./nv-avatar.entry-
|
|
28259
|
+
'./nv-avatar.entry-BxUZg-8h.js'); }).then(processMod, consoleError);
|
|
28241
28260
|
case 'nv-breadcrumb':
|
|
28242
28261
|
return Promise.resolve().then(function () { return require(
|
|
28243
28262
|
/* webpackMode: "lazy" */
|
|
28244
|
-
'./nv-breadcrumb.entry-
|
|
28263
|
+
'./nv-breadcrumb.entry-CmbqGw3C.js'); }).then(processMod, consoleError);
|
|
28245
28264
|
case 'nv-breadcrumbs':
|
|
28246
28265
|
return Promise.resolve().then(function () { return require(
|
|
28247
28266
|
/* webpackMode: "lazy" */
|
|
28248
|
-
'./nv-breadcrumbs.entry-
|
|
28267
|
+
'./nv-breadcrumbs.entry-DFHxtPKv.js'); }).then(processMod, consoleError);
|
|
28249
28268
|
case 'nv-buttongroup':
|
|
28250
28269
|
return Promise.resolve().then(function () { return require(
|
|
28251
28270
|
/* webpackMode: "lazy" */
|
|
28252
|
-
'./nv-buttongroup.entry-
|
|
28271
|
+
'./nv-buttongroup.entry-wn9zFd_M.js'); }).then(processMod, consoleError);
|
|
28253
28272
|
case 'nv-col':
|
|
28254
28273
|
return Promise.resolve().then(function () { return require(
|
|
28255
28274
|
/* webpackMode: "lazy" */
|
|
28256
|
-
'./nv-col.entry-
|
|
28275
|
+
'./nv-col.entry-DnG79KM1.js'); }).then(processMod, consoleError);
|
|
28257
28276
|
case 'nv-datagrid':
|
|
28258
28277
|
return Promise.resolve().then(function () { return require(
|
|
28259
28278
|
/* webpackMode: "lazy" */
|
|
28260
|
-
'./nv-datagrid.entry-
|
|
28279
|
+
'./nv-datagrid.entry-C2ML-e47.js'); }).then(processMod, consoleError);
|
|
28261
28280
|
case 'nv-datagridcolumn':
|
|
28262
28281
|
return Promise.resolve().then(function () { return require(
|
|
28263
28282
|
/* webpackMode: "lazy" */
|
|
28264
|
-
'./nv-datagridcolumn.entry-
|
|
28283
|
+
'./nv-datagridcolumn.entry-DcMPUtQS.js'); }).then(processMod, consoleError);
|
|
28265
28284
|
case 'nv-dialog':
|
|
28266
28285
|
return Promise.resolve().then(function () { return require(
|
|
28267
28286
|
/* webpackMode: "lazy" */
|
|
28268
|
-
'./nv-dialog.entry-
|
|
28287
|
+
'./nv-dialog.entry-C0Vx7dQc.js'); }).then(processMod, consoleError);
|
|
28269
28288
|
case 'nv-fielddate':
|
|
28270
28289
|
return Promise.resolve().then(function () { return require(
|
|
28271
28290
|
/* webpackMode: "lazy" */
|
|
28272
|
-
'./nv-fielddate.entry-
|
|
28291
|
+
'./nv-fielddate.entry-Byt5cmQi.js'); }).then(processMod, consoleError);
|
|
28273
28292
|
case 'nv-fielddaterange':
|
|
28274
28293
|
return Promise.resolve().then(function () { return require(
|
|
28275
28294
|
/* webpackMode: "lazy" */
|
|
28276
|
-
'./nv-fielddaterange.entry-
|
|
28295
|
+
'./nv-fielddaterange.entry-CCFeFP2q.js'); }).then(processMod, consoleError);
|
|
28277
28296
|
case 'nv-fielddropdown':
|
|
28278
28297
|
return Promise.resolve().then(function () { return require(
|
|
28279
28298
|
/* webpackMode: "lazy" */
|
|
28280
|
-
'./nv-fielddropdown.entry-
|
|
28299
|
+
'./nv-fielddropdown.entry-BFp_2vBC.js'); }).then(processMod, consoleError);
|
|
28281
28300
|
case 'nv-fieldmultiselect':
|
|
28282
28301
|
return Promise.resolve().then(function () { return require(
|
|
28283
28302
|
/* webpackMode: "lazy" */
|
|
28284
|
-
'./nv-fieldmultiselect.entry-
|
|
28303
|
+
'./nv-fieldmultiselect.entry-BaUD7Dcr.js'); }).then(processMod, consoleError);
|
|
28285
28304
|
case 'nv-fieldpassword':
|
|
28286
28305
|
return Promise.resolve().then(function () { return require(
|
|
28287
28306
|
/* webpackMode: "lazy" */
|
|
28288
|
-
'./nv-fieldpassword.entry-
|
|
28307
|
+
'./nv-fieldpassword.entry-hogiPC5z.js'); }).then(processMod, consoleError);
|
|
28289
28308
|
case 'nv-fieldradio':
|
|
28290
28309
|
return Promise.resolve().then(function () { return require(
|
|
28291
28310
|
/* webpackMode: "lazy" */
|
|
28292
|
-
'./nv-fieldradio.entry-
|
|
28311
|
+
'./nv-fieldradio.entry-CKbyWpIK.js'); }).then(processMod, consoleError);
|
|
28293
28312
|
case 'nv-fieldselect':
|
|
28294
28313
|
return Promise.resolve().then(function () { return require(
|
|
28295
28314
|
/* webpackMode: "lazy" */
|
|
28296
|
-
'./nv-fieldselect.entry-
|
|
28315
|
+
'./nv-fieldselect.entry-tpURNUEP.js'); }).then(processMod, consoleError);
|
|
28297
28316
|
case 'nv-fieldslider':
|
|
28298
28317
|
return Promise.resolve().then(function () { return require(
|
|
28299
28318
|
/* webpackMode: "lazy" */
|
|
28300
|
-
'./nv-fieldslider.entry-
|
|
28319
|
+
'./nv-fieldslider.entry-v0d92XEY.js'); }).then(processMod, consoleError);
|
|
28301
28320
|
case 'nv-fieldtextarea':
|
|
28302
28321
|
return Promise.resolve().then(function () { return require(
|
|
28303
28322
|
/* webpackMode: "lazy" */
|
|
28304
|
-
'./nv-fieldtextarea.entry-
|
|
28323
|
+
'./nv-fieldtextarea.entry-cRsjPwwR.js'); }).then(processMod, consoleError);
|
|
28305
28324
|
case 'nv-fieldtime':
|
|
28306
28325
|
return Promise.resolve().then(function () { return require(
|
|
28307
28326
|
/* webpackMode: "lazy" */
|
|
28308
|
-
'./nv-fieldtime.entry-
|
|
28327
|
+
'./nv-fieldtime.entry-BpGBUfKr.js'); }).then(processMod, consoleError);
|
|
28309
28328
|
case 'nv-notification':
|
|
28310
28329
|
return Promise.resolve().then(function () { return require(
|
|
28311
28330
|
/* webpackMode: "lazy" */
|
|
28312
|
-
'./nv-notification.entry-
|
|
28331
|
+
'./nv-notification.entry-DxAj-mc7.js'); }).then(processMod, consoleError);
|
|
28313
28332
|
case 'nv-notificationcontainer':
|
|
28314
28333
|
return Promise.resolve().then(function () { return require(
|
|
28315
28334
|
/* webpackMode: "lazy" */
|
|
28316
|
-
'./nv-notificationcontainer.entry-
|
|
28335
|
+
'./nv-notificationcontainer.entry-CUnTicXF.js'); }).then(processMod, consoleError);
|
|
28317
28336
|
case 'nv-row':
|
|
28318
28337
|
return Promise.resolve().then(function () { return require(
|
|
28319
28338
|
/* webpackMode: "lazy" */
|
|
28320
|
-
'./nv-row.entry-
|
|
28339
|
+
'./nv-row.entry-iLk2UglX.js'); }).then(processMod, consoleError);
|
|
28321
28340
|
case 'nv-split':
|
|
28322
28341
|
return Promise.resolve().then(function () { return require(
|
|
28323
28342
|
/* webpackMode: "lazy" */
|
|
28324
|
-
'./nv-split.entry-
|
|
28343
|
+
'./nv-split.entry-BrMHK6TS.js'); }).then(processMod, consoleError);
|
|
28325
28344
|
case 'nv-stack':
|
|
28326
28345
|
return Promise.resolve().then(function () { return require(
|
|
28327
28346
|
/* webpackMode: "lazy" */
|
|
28328
|
-
'./nv-stack.entry-
|
|
28347
|
+
'./nv-stack.entry-C8jLJ5Ki.js'); }).then(processMod, consoleError);
|
|
28329
28348
|
case 'nv-table':
|
|
28330
28349
|
return Promise.resolve().then(function () { return require(
|
|
28331
28350
|
/* webpackMode: "lazy" */
|
|
28332
|
-
'./nv-table.entry-
|
|
28351
|
+
'./nv-table.entry-D6o4g9Vo.js'); }).then(processMod, consoleError);
|
|
28333
28352
|
case 'nv-toggle':
|
|
28334
28353
|
return Promise.resolve().then(function () { return require(
|
|
28335
28354
|
/* webpackMode: "lazy" */
|
|
28336
|
-
'./nv-toggle.entry-
|
|
28355
|
+
'./nv-toggle.entry-9iwmu7qi.js'); }).then(processMod, consoleError);
|
|
28337
28356
|
case 'nv-togglebutton':
|
|
28338
28357
|
return Promise.resolve().then(function () { return require(
|
|
28339
28358
|
/* webpackMode: "lazy" */
|
|
28340
|
-
'./nv-togglebutton.entry-
|
|
28359
|
+
'./nv-togglebutton.entry-N7_CSvzS.js'); }).then(processMod, consoleError);
|
|
28341
28360
|
case 'nv-togglebuttongroup':
|
|
28342
28361
|
return Promise.resolve().then(function () { return require(
|
|
28343
28362
|
/* webpackMode: "lazy" */
|
|
28344
|
-
'./nv-togglebuttongroup.entry-
|
|
28363
|
+
'./nv-togglebuttongroup.entry-DWCytOhV.js'); }).then(processMod, consoleError);
|
|
28345
28364
|
case 'nv-accordion-item':
|
|
28346
28365
|
return Promise.resolve().then(function () { return require(
|
|
28347
28366
|
/* webpackMode: "lazy" */
|
|
28348
|
-
'./nv-accordion-item.entry-
|
|
28367
|
+
'./nv-accordion-item.entry-BBAGkmLI.js'); }).then(processMod, consoleError);
|
|
28349
28368
|
case 'nv-badge_2':
|
|
28350
28369
|
return Promise.resolve().then(function () { return require(
|
|
28351
28370
|
/* webpackMode: "lazy" */
|
|
28352
|
-
'./nv-badge_2.entry-
|
|
28371
|
+
'./nv-badge_2.entry-DdSIFlJf.js'); }).then(processMod, consoleError);
|
|
28353
28372
|
case 'nv-dialogfooter_2':
|
|
28354
28373
|
return Promise.resolve().then(function () { return require(
|
|
28355
28374
|
/* webpackMode: "lazy" */
|
|
28356
|
-
'./nv-dialogfooter_2.entry-
|
|
28375
|
+
'./nv-dialogfooter_2.entry-BGq8Jiib.js'); }).then(processMod, consoleError);
|
|
28357
28376
|
case 'nv-fielddropdownitem':
|
|
28358
28377
|
return Promise.resolve().then(function () { return require(
|
|
28359
28378
|
/* webpackMode: "lazy" */
|
|
28360
|
-
'./nv-fielddropdownitem.entry-
|
|
28379
|
+
'./nv-fielddropdownitem.entry-D_4KdBY1.js'); }).then(processMod, consoleError);
|
|
28361
28380
|
case 'nv-fieldnumber':
|
|
28362
28381
|
return Promise.resolve().then(function () { return require(
|
|
28363
28382
|
/* webpackMode: "lazy" */
|
|
28364
|
-
'./nv-fieldnumber.entry-
|
|
28383
|
+
'./nv-fieldnumber.entry-DOmhBrDv.js'); }).then(processMod, consoleError);
|
|
28365
28384
|
case 'nv-fieldtext':
|
|
28366
28385
|
return Promise.resolve().then(function () { return require(
|
|
28367
28386
|
/* webpackMode: "lazy" */
|
|
28368
|
-
'./nv-fieldtext.entry-
|
|
28387
|
+
'./nv-fieldtext.entry-DNYrOAhj.js'); }).then(processMod, consoleError);
|
|
28369
28388
|
case 'nv-menu':
|
|
28370
28389
|
return Promise.resolve().then(function () { return require(
|
|
28371
28390
|
/* webpackMode: "lazy" */
|
|
28372
|
-
'./nv-menu.entry-
|
|
28391
|
+
'./nv-menu.entry-C2L8F-nG.js'); }).then(processMod, consoleError);
|
|
28373
28392
|
case 'nv-menuitem':
|
|
28374
28393
|
return Promise.resolve().then(function () { return require(
|
|
28375
28394
|
/* webpackMode: "lazy" */
|
|
28376
|
-
'./nv-menuitem.entry-
|
|
28395
|
+
'./nv-menuitem.entry-DuDZTlJ1.js'); }).then(processMod, consoleError);
|
|
28377
28396
|
case 'nv-tooltip':
|
|
28378
28397
|
return Promise.resolve().then(function () { return require(
|
|
28379
28398
|
/* webpackMode: "lazy" */
|
|
28380
|
-
'./nv-tooltip.entry-
|
|
28399
|
+
'./nv-tooltip.entry-BMxnZVYA.js'); }).then(processMod, consoleError);
|
|
28381
28400
|
case 'nv-button':
|
|
28382
28401
|
return Promise.resolve().then(function () { return require(
|
|
28383
28402
|
/* webpackMode: "lazy" */
|
|
28384
|
-
'./nv-button.entry-
|
|
28403
|
+
'./nv-button.entry-Dyks6_mF.js'); }).then(processMod, consoleError);
|
|
28385
28404
|
case 'nv-calendar':
|
|
28386
28405
|
return Promise.resolve().then(function () { return require(
|
|
28387
28406
|
/* webpackMode: "lazy" */
|
|
28388
|
-
'./nv-calendar.entry-
|
|
28407
|
+
'./nv-calendar.entry-Dldsa6dz.js'); }).then(processMod, consoleError);
|
|
28389
28408
|
case 'nv-fieldcheckbox':
|
|
28390
28409
|
return Promise.resolve().then(function () { return require(
|
|
28391
28410
|
/* webpackMode: "lazy" */
|
|
28392
|
-
'./nv-fieldcheckbox.entry-
|
|
28411
|
+
'./nv-fieldcheckbox.entry-CAPwYnSU.js'); }).then(processMod, consoleError);
|
|
28393
28412
|
case 'nv-popover':
|
|
28394
28413
|
return Promise.resolve().then(function () { return require(
|
|
28395
28414
|
/* webpackMode: "lazy" */
|
|
28396
|
-
'./nv-popover.entry-
|
|
28415
|
+
'./nv-popover.entry-DVwa4DvW.js'); }).then(processMod, consoleError);
|
|
28397
28416
|
case 'nv-iconbutton_2':
|
|
28398
28417
|
return Promise.resolve().then(function () { return require(
|
|
28399
28418
|
/* webpackMode: "lazy" */
|
|
28400
|
-
'./nv-iconbutton_2.entry-
|
|
28419
|
+
'./nv-iconbutton_2.entry-DOv1RrkS.js'); }).then(processMod, consoleError);
|
|
28401
28420
|
case 'nv-icon':
|
|
28402
28421
|
return Promise.resolve().then(function () { return require(
|
|
28403
28422
|
/* webpackMode: "lazy" */
|
|
28404
|
-
'./nv-icon.entry-
|
|
28423
|
+
'./nv-icon.entry-BfmyacWA.js'); }).then(processMod, consoleError);
|
|
28405
28424
|
}
|
|
28406
28425
|
}
|
|
28407
28426
|
return import(
|
|
@@ -33773,7 +33792,7 @@ function useReactTable(options) {
|
|
|
33773
33792
|
return tableRef.current;
|
|
33774
33793
|
}
|
|
33775
33794
|
|
|
33776
|
-
|
|
33795
|
+
function NvDatatable({ columns, rows, pagination, renderPagination, stickyHeader, ...htmlProps }) {
|
|
33777
33796
|
const [paginationState, setPaginationState] = React.useState({
|
|
33778
33797
|
pageIndex: 0,
|
|
33779
33798
|
pageSize: pagination?.initialPageSize || 10,
|
|
@@ -33783,6 +33802,16 @@ const NvDatatable = ({ columns, rows, pagination, renderPagination, stickyHeader
|
|
|
33783
33802
|
.filter((col) => !col.hidden)
|
|
33784
33803
|
.map((col) => ({
|
|
33785
33804
|
accessorKey: col.field,
|
|
33805
|
+
accessorFn: col.valueFormatter
|
|
33806
|
+
? (row) => {
|
|
33807
|
+
const rawValue = row[col.field];
|
|
33808
|
+
return col.valueFormatter({
|
|
33809
|
+
value: rawValue,
|
|
33810
|
+
row,
|
|
33811
|
+
field: col.field,
|
|
33812
|
+
});
|
|
33813
|
+
}
|
|
33814
|
+
: undefined,
|
|
33786
33815
|
header: col.headerName || String(col.field),
|
|
33787
33816
|
size: col.width,
|
|
33788
33817
|
enableResizing: col.resizable ?? true,
|
|
@@ -33915,8 +33944,13 @@ const NvDatatable = ({ columns, rows, pagination, renderPagination, stickyHeader
|
|
|
33915
33944
|
return (React.createElement("tr", { key: row.id, "data-testid": `datatable-row-${row.id}`, ref: isLastRow ? lastRowRef : undefined }, row.getVisibleCells().map((cell) => (React.createElement("td", { key: cell.id, "data-testid": `datatable-cell-${cell.id}` }, flexRender(cell.column.columnDef.cell, cell.getContext()))))));
|
|
33916
33945
|
})))),
|
|
33917
33946
|
paginationAPI && renderPagination && renderPagination(paginationAPI)));
|
|
33918
|
-
}
|
|
33947
|
+
}
|
|
33919
33948
|
NvDatatable.displayName = 'NvDatatable';
|
|
33949
|
+
function makeColumn() {
|
|
33950
|
+
return function define(col) {
|
|
33951
|
+
return col;
|
|
33952
|
+
};
|
|
33953
|
+
}
|
|
33920
33954
|
|
|
33921
33955
|
exports.CUSTOM_DAY_NAMES = CUSTOM_DAY_NAMES;
|
|
33922
33956
|
exports.CUSTOM_MONTH_NAMES = CUSTOM_MONTH_NAMES;
|
|
@@ -33978,5 +34012,6 @@ exports.forceUpdate = forceUpdate;
|
|
|
33978
34012
|
exports.getElement = getElement;
|
|
33979
34013
|
exports.getRenderingRef = getRenderingRef;
|
|
33980
34014
|
exports.h = h;
|
|
34015
|
+
exports.makeColumn = makeColumn;
|
|
33981
34016
|
exports.registerInstance = registerInstance;
|
|
33982
34017
|
exports.useNotifications = useNotifications;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('react-dom');
|
|
6
6
|
|
|
@@ -127,4 +127,5 @@ Object.defineProperty(exports, "ToggleButtonSize", {
|
|
|
127
127
|
});
|
|
128
128
|
exports.WEEK_ABBREVIATIONS = index.WEEK_ABBREVIATIONS;
|
|
129
129
|
exports.defineCustomElements = index.defineCustomElements;
|
|
130
|
+
exports.makeColumn = index.makeColumn;
|
|
130
131
|
exports.useNotifications = index.useNotifications;
|
package/dist/cjs/{nv-accordion-item.entry-99OJUl7m.js → nv-accordion-item.entry-BBAGkmLI.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
5
5
|
require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
6
6
|
require('react');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
6
6
|
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
6
6
|
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
5
5
|
var _commonjsHelpers1789f0cf = require('./_commonjsHelpers-1789f0cf-BJu3ubxk.js');
|
|
6
6
|
require('react');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var events_utilsFe1d907f = require('./events.utils-fe1d907f-01N__3wY.js');
|
|
5
5
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
6
6
|
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -70,7 +70,15 @@ const NvFieldnumber = class {
|
|
|
70
70
|
//#region METHODS
|
|
71
71
|
this.handleInput = (event) => {
|
|
72
72
|
const input = event.target;
|
|
73
|
-
|
|
73
|
+
if (input.value === '') {
|
|
74
|
+
this.value = null;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const nextValue = input.valueAsNumber;
|
|
78
|
+
if (Number.isNaN(nextValue)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.value = nextValue;
|
|
74
82
|
};
|
|
75
83
|
this.handleInputContainerClick = () => {
|
|
76
84
|
this.inputElement.focus();
|
|
@@ -88,17 +96,26 @@ const NvFieldnumber = class {
|
|
|
88
96
|
event.preventDefault();
|
|
89
97
|
};
|
|
90
98
|
this.isMinValueReached = () => {
|
|
91
|
-
return this.min !== undefined &&
|
|
99
|
+
return (this.min !== undefined &&
|
|
100
|
+
typeof this.value === 'number' &&
|
|
101
|
+
this.value <= this.min);
|
|
92
102
|
};
|
|
93
103
|
this.isMaxValueReached = () => {
|
|
94
|
-
return this.max !== undefined &&
|
|
104
|
+
return (this.max !== undefined &&
|
|
105
|
+
typeof this.value === 'number' &&
|
|
106
|
+
this.value >= this.max);
|
|
95
107
|
};
|
|
96
108
|
}
|
|
97
109
|
//#endregion EVENTS
|
|
98
110
|
/****************************************************************************/
|
|
99
111
|
//#region WATCHERS
|
|
100
112
|
watchValueHandler(newValue) {
|
|
101
|
-
|
|
113
|
+
const normalized = typeof newValue === 'number' && !Number.isNaN(newValue) ? newValue : null;
|
|
114
|
+
if (this.lastEmittedValue === normalized) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.lastEmittedValue = normalized;
|
|
118
|
+
this.valueChanged.emit(normalized);
|
|
102
119
|
}
|
|
103
120
|
//#endregion METHODS
|
|
104
121
|
/****************************************************************************/
|
|
@@ -116,9 +133,9 @@ const NvFieldnumber = class {
|
|
|
116
133
|
/****************************************************************************/
|
|
117
134
|
//#region RENDER
|
|
118
135
|
render() {
|
|
119
|
-
return (index.h(index.Host, { key: '
|
|
120
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
121
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
136
|
+
return (index.h(index.Host, { key: '9b3239f09e6aace03f79f07399723fdbf557f070' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '322478abbaf477a33debcd828387402299ce6762', htmlFor: this.inputId }, index.h("slot", { key: '75b791ca0fb7eec55faaf966a32733e37b87fb90', name: "label" }, this.label))), index.h("div", { key: '5ce6c27db2b6b0ba8618ed2eac1f61abf8177793', class: "input-wrapper" }, index.h("slot", { key: '3a4a86e358d575fc312d27ee5ffba68474904bd4', name: "before-input" }), index.h("div", { key: '8e07c3c37ea4869aa309fba913663e1d225e21fd', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '91e7c82e46d3268493669e6dd121f643be86a6be', name: "leading-input" }), index.h("input", { key: '3dcbd9d10e4425ebb29b16b1157845ea4ee7bdef', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: typeof this.value === 'number' ? this.value : undefined, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), index.h("slot", { key: '7d0d4a77d121433f4feb8aa2139be8e94f8e57a5', name: "trailing-input" }), this.error && (index.h("nv-icon", { key: '2a3969e56de0fc3911901c9540e300caf2b6d681', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '8964d7ffaa2cc2a70caf781a37e66383234c6895', name: "circle-check", class: "validation", size: "md" })), index.h("div", { key: '1ca2fd7095afbc12a1a54c8b09551f28fe5a3579', class: "stepper" }, index.h("nv-iconbutton", { key: '1c3f9200c5409bc05fab9061dff3847a92298d45', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }), index.h("nv-iconbutton", { key: 'eb65687b3c31d2ac8bdb534f5ca300a1ada9cd64', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }))), index.h("slot", { key: '01006c0c2487bce4f908104d263acb0231cdb701', name: "after-input" })), (this.description ||
|
|
137
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '9db93a8aa6bb002a3286763909118e9c7a1661c0', class: "description" }, index.h("slot", { key: '13b0f797bace74e641cdd658bb798bccbfec70dc', name: "description" }, this.description))), (this.errorDescription ||
|
|
138
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '4ca240bc22fb83a283637e60384e59d687d67e9e', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '145b68572a38e91559431ff51ec38a64027d4978', name: "error-description" }, this.errorDescription)))));
|
|
122
139
|
}
|
|
123
140
|
static get formAssociated() { return true; }
|
|
124
141
|
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-BObVnP12.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
6
6
|
require('react');
|
|
@@ -231,7 +231,9 @@ const FieldInput = props => {
|
|
|
231
231
|
const handleValueChanged = (event) => {
|
|
232
232
|
event.stopPropagation();
|
|
233
233
|
const newValue = event.detail;
|
|
234
|
-
|
|
234
|
+
// Accept null as a valid value (when field is cleared)
|
|
235
|
+
// Only reject NaN numbers
|
|
236
|
+
if (typeof newValue === 'number' && Number.isNaN(newValue)) {
|
|
235
237
|
return;
|
|
236
238
|
}
|
|
237
239
|
onInput({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.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');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BObVnP12.js');
|
|
4
4
|
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
5
5
|
var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
6
6
|
var events_utilsFe1d907f = require('./events.utils-fe1d907f-01N__3wY.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useRef, } from 'react';
|
|
2
2
|
import { flexRender, getCoreRowModel, getPaginationRowModel, useReactTable, } from '@tanstack/react-table';
|
|
3
3
|
import { NvTable } from '../generated/components';
|
|
4
|
-
|
|
4
|
+
function NvDatatable({ columns, rows, pagination, renderPagination, stickyHeader, ...htmlProps }) {
|
|
5
5
|
const [paginationState, setPaginationState] = useState({
|
|
6
6
|
pageIndex: 0,
|
|
7
7
|
pageSize: pagination?.initialPageSize || 10,
|
|
@@ -11,6 +11,16 @@ const NvDatatable = ({ columns, rows, pagination, renderPagination, stickyHeader
|
|
|
11
11
|
.filter((col) => !col.hidden)
|
|
12
12
|
.map((col) => ({
|
|
13
13
|
accessorKey: col.field,
|
|
14
|
+
accessorFn: col.valueFormatter
|
|
15
|
+
? (row) => {
|
|
16
|
+
const rawValue = row[col.field];
|
|
17
|
+
return col.valueFormatter({
|
|
18
|
+
value: rawValue,
|
|
19
|
+
row,
|
|
20
|
+
field: col.field,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
: undefined,
|
|
14
24
|
header: col.headerName || String(col.field),
|
|
15
25
|
size: col.width,
|
|
16
26
|
enableResizing: col.resizable ?? true,
|
|
@@ -143,6 +153,11 @@ const NvDatatable = ({ columns, rows, pagination, renderPagination, stickyHeader
|
|
|
143
153
|
return (React.createElement("tr", { key: row.id, "data-testid": `datatable-row-${row.id}`, ref: isLastRow ? lastRowRef : undefined }, row.getVisibleCells().map((cell) => (React.createElement("td", { key: cell.id, "data-testid": `datatable-cell-${cell.id}` }, flexRender(cell.column.columnDef.cell, cell.getContext()))))));
|
|
144
154
|
})))),
|
|
145
155
|
paginationAPI && renderPagination && renderPagination(paginationAPI)));
|
|
146
|
-
}
|
|
156
|
+
}
|
|
147
157
|
NvDatatable.displayName = 'NvDatatable';
|
|
148
158
|
export { NvDatatable };
|
|
159
|
+
export function makeColumn() {
|
|
160
|
+
return function define(col) {
|
|
161
|
+
return col;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React, { type ComponentProps } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { type NoInfer } from '@tanstack/react-table';
|
|
3
|
+
declare function NvDatatable<T>({ columns, rows, pagination, renderPagination, stickyHeader, ...htmlProps }: NvDatatableProps<T>): React.JSX.Element;
|
|
4
|
+
declare namespace NvDatatable {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
6
7
|
export { NvDatatable };
|
|
8
|
+
export declare function makeColumn<Row>(): <K extends keyof Row, F = Row[K]>(col: NvDatatableColumn<Row, K, F>) => NvDatatableColumn<Row, keyof Row, Row[keyof Row]>;
|
|
7
9
|
export type NvDatatableProps<T> = {
|
|
8
10
|
columns: Array<NvDatatableColumn<T>>;
|
|
9
11
|
rows: Array<T>;
|
|
@@ -11,6 +13,26 @@ export type NvDatatableProps<T> = {
|
|
|
11
13
|
renderPagination?: (api: NvDatatableRenderPaginationAPI) => React.ReactNode;
|
|
12
14
|
stickyHeader?: boolean;
|
|
13
15
|
} & Pick<ComponentProps<'div'>, 'className' | 'style'>;
|
|
16
|
+
export interface NvDatatableColumn<Row, K extends keyof Row = keyof Row, F = Row[K]> {
|
|
17
|
+
field: K;
|
|
18
|
+
headerName?: string;
|
|
19
|
+
width?: number;
|
|
20
|
+
resizable?: boolean;
|
|
21
|
+
hidden?: boolean;
|
|
22
|
+
valueFormatter?: (params: NvTableValueFormatterParams<Row, Row[K], K>) => F;
|
|
23
|
+
renderCell?: (params: NvTableRenderCellParams<Row, F, K>) => React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface NvTableRenderCellParams<Row, Value, Field> {
|
|
26
|
+
value: Value | NoInfer<Value>;
|
|
27
|
+
row: Row;
|
|
28
|
+
field: Field;
|
|
29
|
+
rowIndex: number;
|
|
30
|
+
}
|
|
31
|
+
export interface NvTableValueFormatterParams<Row, Value, Field> {
|
|
32
|
+
value: Value;
|
|
33
|
+
row: Row;
|
|
34
|
+
field: Field;
|
|
35
|
+
}
|
|
14
36
|
export interface NvDatatablePaginationConfig {
|
|
15
37
|
mode: 'client' | 'server' | 'infinite';
|
|
16
38
|
initialPageSize?: number;
|
|
@@ -42,18 +64,3 @@ export interface NvDatatableRenderPaginationAPI {
|
|
|
42
64
|
isLoading?: boolean;
|
|
43
65
|
hasMore?: boolean;
|
|
44
66
|
}
|
|
45
|
-
export interface NvDatatableColumn<T> {
|
|
46
|
-
field: keyof T;
|
|
47
|
-
headerName?: string;
|
|
48
|
-
width?: number;
|
|
49
|
-
resizable?: boolean;
|
|
50
|
-
hidden?: boolean;
|
|
51
|
-
renderCell?: (params: NvTableRenderCellParams<T, T[keyof T]>) => React.ReactNode;
|
|
52
|
-
}
|
|
53
|
-
export type NvDatatableRow = Record<string, string | number | boolean | null | undefined | typeof Date>;
|
|
54
|
-
export interface NvTableRenderCellParams<T, V> {
|
|
55
|
-
value: V;
|
|
56
|
-
row: T;
|
|
57
|
-
field: keyof T;
|
|
58
|
-
rowIndex: number;
|
|
59
|
-
}
|
|
@@ -159,7 +159,7 @@ export type NvFieldmultiselectEvents = {
|
|
|
159
159
|
};
|
|
160
160
|
export declare const NvFieldmultiselect: StencilReactComponent<NvFieldmultiselectElement, NvFieldmultiselectEvents>;
|
|
161
161
|
export type NvFieldnumberEvents = {
|
|
162
|
-
onValueChanged: EventName<CustomEvent<number>>;
|
|
162
|
+
onValueChanged: EventName<CustomEvent<number | null>>;
|
|
163
163
|
};
|
|
164
164
|
export declare const NvFieldnumber: StencilReactComponent<NvFieldnumberElement, NvFieldnumberEvents>;
|
|
165
165
|
export type NvFieldpasswordEvents = {
|
|
@@ -161,7 +161,7 @@ export type NvFieldmultiselectEvents = {
|
|
|
161
161
|
};
|
|
162
162
|
export declare const NvFieldmultiselect: StencilReactComponent<NvFieldmultiselectElement, NvFieldmultiselectEvents>;
|
|
163
163
|
export type NvFieldnumberEvents = {
|
|
164
|
-
onValueChanged: EventName<CustomEvent<number>>;
|
|
164
|
+
onValueChanged: EventName<CustomEvent<number | null>>;
|
|
165
165
|
};
|
|
166
166
|
export declare const NvFieldnumber: StencilReactComponent<NvFieldnumberElement, NvFieldnumberEvents>;
|
|
167
167
|
export type NvFieldpasswordEvents = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nova-design-system/nova-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.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",
|