@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
package/README.md
CHANGED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
/**
|
|
5
|
+
* All properties that should be excluded from the deep copy of an HTML element.
|
|
6
|
+
*/
|
|
7
|
+
const excludedProps = new Set([
|
|
8
|
+
// Text and content-related properties
|
|
9
|
+
'textContent',
|
|
10
|
+
'innerText',
|
|
11
|
+
'outerText',
|
|
12
|
+
'innerHTML',
|
|
13
|
+
'outerHTML',
|
|
14
|
+
'text',
|
|
15
|
+
// Form element properties
|
|
16
|
+
'value',
|
|
17
|
+
'defaultValue',
|
|
18
|
+
'checked',
|
|
19
|
+
'defaultChecked',
|
|
20
|
+
'selectionStart',
|
|
21
|
+
'selectionEnd',
|
|
22
|
+
'selectionDirection',
|
|
23
|
+
'form',
|
|
24
|
+
'willValidate',
|
|
25
|
+
'validity',
|
|
26
|
+
'validationMessage',
|
|
27
|
+
'labels',
|
|
28
|
+
'list',
|
|
29
|
+
'maxLength',
|
|
30
|
+
'minLength',
|
|
31
|
+
'valueAsDate',
|
|
32
|
+
'valueAsNumber',
|
|
33
|
+
// Editability and namespaces
|
|
34
|
+
'contentEditable',
|
|
35
|
+
'isContentEditable',
|
|
36
|
+
'namespaceURI',
|
|
37
|
+
// Child-related properties (handled recursively)
|
|
38
|
+
'attributes',
|
|
39
|
+
'children',
|
|
40
|
+
'childNodes',
|
|
41
|
+
'firstChild',
|
|
42
|
+
'lastChild',
|
|
43
|
+
// Blazor-related properties
|
|
44
|
+
'origin',
|
|
45
|
+
'dataset',
|
|
46
|
+
'attributeStyleMap',
|
|
47
|
+
'prefix',
|
|
48
|
+
'localName',
|
|
49
|
+
'tagName',
|
|
50
|
+
'shadowRoot',
|
|
51
|
+
'assignedSlot',
|
|
52
|
+
'scrollWidth',
|
|
53
|
+
'scrollHeight',
|
|
54
|
+
'clientTop',
|
|
55
|
+
'clientLeft',
|
|
56
|
+
'clientWidth',
|
|
57
|
+
'clientHeight',
|
|
58
|
+
'firstElementChild',
|
|
59
|
+
'lastElementChild',
|
|
60
|
+
'childElementCount',
|
|
61
|
+
'previousElementSibling',
|
|
62
|
+
'nextElementSibling',
|
|
63
|
+
'currentCSSZoom',
|
|
64
|
+
'nodeType',
|
|
65
|
+
'nodeName',
|
|
66
|
+
'baseURI',
|
|
67
|
+
'isConnected',
|
|
68
|
+
'ownerDocument',
|
|
69
|
+
'parentNode',
|
|
70
|
+
'parentElement',
|
|
71
|
+
'previousSibling',
|
|
72
|
+
'nextSibling',
|
|
73
|
+
'ELEMENT_NODE',
|
|
74
|
+
'ATTRIBUTE_NODE',
|
|
75
|
+
'TEXT_NODE',
|
|
76
|
+
'CDATA_SECTION_NODE',
|
|
77
|
+
'ENTITY_REFERENCE_NODE',
|
|
78
|
+
'ENTITY_NODE',
|
|
79
|
+
'PROCESSING_INSTRUCTION_NODE',
|
|
80
|
+
'COMMENT_NODE',
|
|
81
|
+
'DOCUMENT_NODE',
|
|
82
|
+
'DOCUMENT_TYPE_NODE',
|
|
83
|
+
'DOCUMENT_FRAGMENT_NODE',
|
|
84
|
+
'NOTATION_NODE',
|
|
85
|
+
'DOCUMENT_POSITION_DISCONNECTED',
|
|
86
|
+
'DOCUMENT_POSITION_PRECEDING',
|
|
87
|
+
'DOCUMENT_POSITION_FOLLOWING',
|
|
88
|
+
'DOCUMENT_POSITION_CONTAINS',
|
|
89
|
+
'DOCUMENT_POSITION_CONTAINED_BY',
|
|
90
|
+
'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
|
|
91
|
+
]);
|
|
92
|
+
/**
|
|
93
|
+
* Casts a node to an element, or returns null if the node is not an element.
|
|
94
|
+
* @param {ChildNode | Element | null} node - The node to cast.
|
|
95
|
+
* @returns {Element | null} - The casted element, or null if the node is not an element.
|
|
96
|
+
*/
|
|
97
|
+
function asElement(node) {
|
|
98
|
+
return node instanceof Element ? node : null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Deep copy an HTML element with all its attributes, properties, and child nodes.
|
|
102
|
+
* This method is useful for creating a clone of an element that can be safely modified without affecting the original.
|
|
103
|
+
* @param {HTMLElement} element - The HTML element to copy.
|
|
104
|
+
* @returns {HTMLElement} - A deep copy of the HTML element.
|
|
105
|
+
* @example const copy = deepCopyElement(document.getElementById('myElement'));
|
|
106
|
+
*/
|
|
107
|
+
function deepCopyElement(element) {
|
|
108
|
+
const copy = document.createElement(element.tagName);
|
|
109
|
+
// ✅ Copy attributes
|
|
110
|
+
Array.from(element.attributes).forEach(attr => {
|
|
111
|
+
copy.setAttribute(attr.name, attr.value);
|
|
112
|
+
});
|
|
113
|
+
// ✅ Dynamically extract relevant properties
|
|
114
|
+
const properties = new Set();
|
|
115
|
+
// Collect only own enumerable properties
|
|
116
|
+
Object.keys(element).forEach(key => properties.add(key));
|
|
117
|
+
// Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
|
|
118
|
+
let proto = Object.getPrototypeOf(element);
|
|
119
|
+
while (proto && proto !== HTMLElement.prototype) {
|
|
120
|
+
Object.keys(proto).forEach(key => properties.add(key));
|
|
121
|
+
proto = Object.getPrototypeOf(proto);
|
|
122
|
+
}
|
|
123
|
+
// ✅ Filter and copy only non-function properties (methods are excluded) and non-event listeners
|
|
124
|
+
properties.forEach(prop => {
|
|
125
|
+
if (typeof element[prop] !== 'function' && // Ignore methods
|
|
126
|
+
!prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
|
|
127
|
+
!excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
|
|
128
|
+
) {
|
|
129
|
+
try {
|
|
130
|
+
copy[prop] = element[prop];
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
console.warn(`Could not copy property ${prop}:`, error.message);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
// ✅ Copy dataset separately
|
|
138
|
+
Object.assign(copy.dataset, element.dataset);
|
|
139
|
+
// ✅ Handle form elements specifically
|
|
140
|
+
if (element instanceof HTMLInputElement) {
|
|
141
|
+
copy.value = element.value;
|
|
142
|
+
copy.checked = element.checked;
|
|
143
|
+
copy.defaultValue = element.defaultValue;
|
|
144
|
+
copy.defaultChecked = element.defaultChecked;
|
|
145
|
+
copy.selectionStart = element.selectionStart;
|
|
146
|
+
copy.selectionEnd = element.selectionEnd;
|
|
147
|
+
copy.selectionDirection = element.selectionDirection;
|
|
148
|
+
}
|
|
149
|
+
else if (element instanceof HTMLTextAreaElement) {
|
|
150
|
+
copy.value = element.value;
|
|
151
|
+
copy.defaultValue = element.defaultValue;
|
|
152
|
+
copy.selectionStart = element.selectionStart;
|
|
153
|
+
copy.selectionEnd = element.selectionEnd;
|
|
154
|
+
copy.selectionDirection =
|
|
155
|
+
element.selectionDirection;
|
|
156
|
+
}
|
|
157
|
+
else if (element instanceof HTMLSelectElement) {
|
|
158
|
+
copy.value = element.value;
|
|
159
|
+
copy.selectedIndex = element.selectedIndex;
|
|
160
|
+
}
|
|
161
|
+
// ✅ Recursively copy child nodes (prevent duplicates)
|
|
162
|
+
element.childNodes.forEach(child => {
|
|
163
|
+
let childCopy;
|
|
164
|
+
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
165
|
+
childCopy = deepCopyElement(child);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
childCopy = child.cloneNode(true);
|
|
169
|
+
}
|
|
170
|
+
copy.appendChild(childCopy);
|
|
171
|
+
});
|
|
172
|
+
return copy;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
exports.asElement = asElement;
|
|
176
|
+
exports.deepCopyElement = deepCopyElement;
|
|
177
|
+
exports.excludedProps = excludedProps;
|