@nova-design-system/nova-react 3.0.0-beta.41 → 3.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/cjs/_commonjsHelpers-1789f0cf-BJu3ubxk.js +10 -0
  2. package/dist/cjs/clsx-297c1ffe-BtxeOLZW.js +5 -0
  3. package/dist/cjs/constants-98e2dcc2-C0SBCapP.js +250 -0
  4. package/dist/cjs/dom.utils-ac71e0ef-CmIwRr6O.js +168 -0
  5. package/dist/cjs/events.utils-fe1d907f-01N__3wY.js +23 -0
  6. package/dist/cjs/fade.animation-2a077983-aKN0EDTo.js +1832 -0
  7. package/dist/cjs/index-C8UfzrMI.js +26405 -0
  8. package/dist/cjs/index-CinzsZ8D.js +26405 -0
  9. package/dist/cjs/index.js +48 -0
  10. package/dist/cjs/inputmask-edcad3c1-B9Omti4z.js +3749 -0
  11. package/dist/cjs/nv-alert.entry-8esWDUyU.js +173 -0
  12. package/dist/cjs/nv-alert.entry-BVY_rxey.js +173 -0
  13. package/dist/cjs/nv-avatar.entry-CO6bt4k6.js +67 -0
  14. package/dist/cjs/nv-avatar.entry-pREKtiv2.js +67 -0
  15. package/dist/cjs/nv-badge_2.entry-wDuiCwys.js +195 -0
  16. package/dist/cjs/nv-badge_2.entry-xfXsesV0.js +195 -0
  17. package/dist/cjs/nv-base.entry-BO-6krwg.js +71 -0
  18. package/dist/cjs/nv-base.entry-DwtTXK_n.js +71 -0
  19. package/dist/cjs/nv-breadcrumb.entry-B0hIeE83.js +45 -0
  20. package/dist/cjs/nv-breadcrumb.entry-DTwjCmMI.js +45 -0
  21. package/dist/cjs/nv-breadcrumbs.entry-Cq0LsIFs.js +20 -0
  22. package/dist/cjs/nv-breadcrumbs.entry-jn5hRjpQ.js +20 -0
  23. package/dist/cjs/nv-button.entry-DaSGnB1L.js +162 -0
  24. package/dist/cjs/nv-button.entry-DxzA6-My.js +162 -0
  25. package/dist/cjs/nv-calendar.entry-BC6NDsVl.js +1036 -0
  26. package/dist/cjs/nv-calendar.entry-DKz-iBnp.js +1036 -0
  27. package/dist/cjs/nv-col.entry-DNUY559i.js +37 -0
  28. package/dist/cjs/nv-col.entry-X7jkNThH.js +37 -0
  29. package/dist/cjs/nv-datagrid.entry-Cp8RCSEv.js +3671 -0
  30. package/dist/cjs/nv-datagrid.entry-DL-Fyo4l.js +3671 -0
  31. package/dist/cjs/nv-datagridcolumn.entry-CR9_1fsZ.js +18 -0
  32. package/dist/cjs/nv-datagridcolumn.entry-CyTG5E7M.js +18 -0
  33. package/dist/cjs/nv-dialog.entry-BjTJ5FFL.js +784 -0
  34. package/dist/cjs/nv-dialog.entry-Do_uALC6.js +784 -0
  35. package/dist/cjs/nv-dialogfooter_2.entry-DJ8qS9q6.js +134 -0
  36. package/dist/cjs/nv-dialogfooter_2.entry-DJkKzEgO.js +134 -0
  37. package/dist/cjs/nv-fieldcheckbox.entry-C0DmeqXD.js +137 -0
  38. package/dist/cjs/nv-fieldcheckbox.entry-DoGQX-5D.js +137 -0
  39. package/dist/cjs/nv-fielddate.entry-D-PjbYaA.js +278 -0
  40. package/dist/cjs/nv-fielddate.entry-DRX2mfZL.js +278 -0
  41. package/dist/cjs/nv-fielddaterange.entry-BrC5jKLp.js +355 -0
  42. package/dist/cjs/nv-fielddaterange.entry-ka3JiDvT.js +355 -0
  43. package/dist/cjs/nv-fielddropdown.entry-DUAKFYgw.js +391 -0
  44. package/dist/cjs/nv-fielddropdown.entry-MsUR1kVe.js +391 -0
  45. package/dist/cjs/nv-fielddropdownitem.entry-BsbvJERH.js +70 -0
  46. package/dist/cjs/nv-fielddropdownitem.entry-DRM-Zljt.js +70 -0
  47. package/dist/cjs/nv-fieldmultiselect.entry-DFr-ZICs.js +1060 -0
  48. package/dist/cjs/nv-fieldmultiselect.entry-Dr8FfT_W.js +1060 -0
  49. package/dist/cjs/nv-fieldnumber.entry-DZsM1vmO.js +126 -0
  50. package/dist/cjs/nv-fieldnumber.entry-ezdDvJh_.js +126 -0
  51. package/dist/cjs/nv-fieldpassword.entry-Biw__M2W.js +115 -0
  52. package/dist/cjs/nv-fieldpassword.entry-D4a8SnGr.js +115 -0
  53. package/dist/cjs/nv-fieldradio.entry-Co7WX2vI.js +102 -0
  54. package/dist/cjs/nv-fieldradio.entry-ZL7KgEZ7.js +102 -0
  55. package/dist/cjs/nv-fieldselect.entry-D6eRsM9T.js +365 -0
  56. package/dist/cjs/nv-fieldselect.entry-sTbv_flF.js +365 -0
  57. package/dist/cjs/nv-fieldtext.entry-DKdxC2cG.js +119 -0
  58. package/dist/cjs/nv-fieldtext.entry-DRPCH6Sf.js +119 -0
  59. package/dist/cjs/nv-fieldtextarea.entry-BwJCUiVW.js +194 -0
  60. package/dist/cjs/nv-fieldtextarea.entry-Dc_TGlmI.js +194 -0
  61. package/dist/cjs/nv-fieldtime.entry-CXRtpWt1.js +1011 -0
  62. package/dist/cjs/nv-fieldtime.entry-uU-IET2k.js +1011 -0
  63. package/dist/cjs/nv-icon.entry-iipuvT3D.js +79 -0
  64. package/dist/cjs/nv-icon.entry-xltjoSa2.js +79 -0
  65. package/dist/cjs/nv-iconbutton_2.entry-BsXvYbCi.js +163 -0
  66. package/dist/cjs/nv-iconbutton_2.entry-Dx4usGkY.js +163 -0
  67. package/dist/cjs/nv-menu.entry-D3qvf_0H.js +227 -0
  68. package/dist/cjs/nv-menu.entry-DFEYw_KZ.js +227 -0
  69. package/dist/cjs/nv-menuitem.entry-3t6TixM7.js +58 -0
  70. package/dist/cjs/nv-menuitem.entry-BeTXOtir.js +58 -0
  71. package/dist/cjs/nv-popover.entry-Bv6kuTK_.js +1960 -0
  72. package/dist/cjs/nv-popover.entry-Zt25YeAv.js +1960 -0
  73. package/dist/cjs/nv-row.entry-BPK1Li7w.js +21 -0
  74. package/dist/cjs/nv-row.entry-Bwzlub3i.js +21 -0
  75. package/dist/cjs/nv-stack.entry-ByaO-0TJ.js +30 -0
  76. package/dist/cjs/nv-stack.entry-bhess4lQ.js +30 -0
  77. package/dist/cjs/nv-table.entry-C7Hd57Iq.js +338 -0
  78. package/dist/cjs/nv-table.entry-D3U4dFcw.js +338 -0
  79. package/dist/cjs/nv-tablecolumn.entry-BDCw_45v.js +18 -0
  80. package/dist/cjs/nv-tablecolumn.entry-BzwWPlLf.js +18 -0
  81. package/dist/cjs/nv-toggle.entry-BTqGH_H0.js +79 -0
  82. package/dist/cjs/nv-toggle.entry-DXpNGkbz.js +79 -0
  83. package/dist/cjs/nv-tooltip.entry-BDZfrLHv.js +44 -0
  84. package/dist/cjs/nv-tooltip.entry-CvCZZV88.js +44 -0
  85. package/dist/cjs/timeline.animation-1b88f052-B8-vCVrY.js +105 -0
  86. package/dist/cjs/v4-a79185f4-2n0dOd_Y.js +56 -0
  87. package/dist/generated/components.js +16 -0
  88. package/dist/types/generated/components.d.ts +19 -3
  89. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }
8
+
9
+ exports.commonjsGlobal = commonjsGlobal;
10
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
4
+
5
+ exports.clsx = clsx;
@@ -0,0 +1,250 @@
1
+ 'use strict';
2
+
3
+ exports.FeedbackColors = void 0;
4
+ (function (FeedbackColors) {
5
+ FeedbackColors["Information"] = "information";
6
+ FeedbackColors["Warning"] = "warning";
7
+ FeedbackColors["Success"] = "success";
8
+ FeedbackColors["Error"] = "error";
9
+ FeedbackColors["Neutral"] = "neutral";
10
+ })(exports.FeedbackColors || (exports.FeedbackColors = {}));
11
+ var DeprecatedSemanticColors;
12
+ (function (DeprecatedSemanticColors) {
13
+ DeprecatedSemanticColors["Neutral"] = "neutral";
14
+ DeprecatedSemanticColors["Primary"] = "primary";
15
+ DeprecatedSemanticColors["Secondary"] = "secondary";
16
+ DeprecatedSemanticColors["Success"] = "success";
17
+ DeprecatedSemanticColors["Error"] = "error";
18
+ })(DeprecatedSemanticColors || (DeprecatedSemanticColors = {}));
19
+ exports.SemanticSizes = void 0;
20
+ (function (SemanticSizes) {
21
+ SemanticSizes["ExtraSmall"] = "xs";
22
+ SemanticSizes["Small"] = "sm";
23
+ SemanticSizes["Medium"] = "md";
24
+ SemanticSizes["Large"] = "lg";
25
+ SemanticSizes["ExtraLarge"] = "xl";
26
+ })(exports.SemanticSizes || (exports.SemanticSizes = {}));
27
+ exports.ButtonSize = void 0;
28
+ (function (ButtonSize) {
29
+ ButtonSize["ExtraSmall"] = "xs";
30
+ ButtonSize["Small"] = "sm";
31
+ ButtonSize["Medium"] = "md";
32
+ ButtonSize["Large"] = "lg";
33
+ })(exports.ButtonSize || (exports.ButtonSize = {}));
34
+ var ButtonEmphasis;
35
+ (function (ButtonEmphasis) {
36
+ ButtonEmphasis["High"] = "high";
37
+ ButtonEmphasis["Medium"] = "medium";
38
+ ButtonEmphasis["Low"] = "low";
39
+ ButtonEmphasis["Lower"] = "lower";
40
+ })(ButtonEmphasis || (ButtonEmphasis = {}));
41
+ exports.ButtonType = void 0;
42
+ (function (ButtonType) {
43
+ ButtonType["Submit"] = "submit";
44
+ ButtonType["Reset"] = "reset";
45
+ ButtonType["Button"] = "button";
46
+ })(exports.ButtonType || (exports.ButtonType = {}));
47
+ var IconButtonShape;
48
+ (function (IconButtonShape) {
49
+ IconButtonShape["Square"] = "square";
50
+ IconButtonShape["Rounded"] = "rounded";
51
+ })(IconButtonShape || (IconButtonShape = {}));
52
+ var LoaderColors;
53
+ (function (LoaderColors) {
54
+ LoaderColors["High"] = "brand";
55
+ LoaderColors["Low"] = "white";
56
+ })(LoaderColors || (LoaderColors = {}));
57
+ var LabelPlacement;
58
+ (function (LabelPlacement) {
59
+ LabelPlacement["Before"] = "before";
60
+ LabelPlacement["After"] = "after";
61
+ })(LabelPlacement || (LabelPlacement = {}));
62
+ var TextInputAutocomplete;
63
+ (function (TextInputAutocomplete) {
64
+ TextInputAutocomplete["On"] = "on";
65
+ TextInputAutocomplete["Off"] = "off";
66
+ TextInputAutocomplete["Section"] = "section-*";
67
+ TextInputAutocomplete["Shipping"] = "shipping";
68
+ TextInputAutocomplete["Billing"] = "billing";
69
+ TextInputAutocomplete["Home"] = "home";
70
+ TextInputAutocomplete["Work"] = "work";
71
+ TextInputAutocomplete["Mobile"] = "mobile";
72
+ TextInputAutocomplete["Fax"] = "fax";
73
+ TextInputAutocomplete["Pager"] = "pager";
74
+ TextInputAutocomplete["Tel"] = "tel";
75
+ TextInputAutocomplete["TelCountryCode"] = "tel-country-code";
76
+ TextInputAutocomplete["TelNational"] = "tel-national";
77
+ TextInputAutocomplete["TelAreaCode"] = "tel-area-code";
78
+ TextInputAutocomplete["TelLocal"] = "tel-local";
79
+ TextInputAutocomplete["TelLocalPrefix"] = "tel-local-prefix";
80
+ TextInputAutocomplete["TelLocalSuffix"] = "tel-local-suffix";
81
+ TextInputAutocomplete["TelExtension"] = "tel-extension";
82
+ TextInputAutocomplete["Email"] = "email";
83
+ TextInputAutocomplete["IMProtocol"] = "impp";
84
+ TextInputAutocomplete["Name"] = "name";
85
+ TextInputAutocomplete["HonorificPrefix"] = "honorific-prefix";
86
+ TextInputAutocomplete["GivenName"] = "given-name";
87
+ TextInputAutocomplete["AdditionalName"] = "additional-name";
88
+ TextInputAutocomplete["FamilyName"] = "family-name";
89
+ TextInputAutocomplete["HonorificSuffix"] = "honorific-suffix";
90
+ TextInputAutocomplete["Nickname"] = "nickname";
91
+ TextInputAutocomplete["Username"] = "username";
92
+ TextInputAutocomplete["NewPassword"] = "new-password";
93
+ TextInputAutocomplete["CurrentPassword"] = "current-password";
94
+ TextInputAutocomplete["OneTimeCode"] = "one-time-code";
95
+ TextInputAutocomplete["OrganizationTitle"] = "organization-title";
96
+ TextInputAutocomplete["Organization"] = "organization";
97
+ TextInputAutocomplete["StreetAddress"] = "street-address";
98
+ TextInputAutocomplete["AddressLine1"] = "address-line1";
99
+ TextInputAutocomplete["AddressLine2"] = "address-line2";
100
+ TextInputAutocomplete["AddressLine3"] = "address-line3";
101
+ TextInputAutocomplete["AddressLevel4"] = "address-level4";
102
+ TextInputAutocomplete["AddressLevel3"] = "address-level3";
103
+ TextInputAutocomplete["AddressLevel2"] = "address-level2";
104
+ TextInputAutocomplete["AddressLevel1"] = "address-level1";
105
+ TextInputAutocomplete["Country"] = "country";
106
+ TextInputAutocomplete["CountryName"] = "country-name";
107
+ TextInputAutocomplete["PostalCode"] = "postal-code";
108
+ TextInputAutocomplete["CCName"] = "cc-name";
109
+ TextInputAutocomplete["CCGivenName"] = "cc-given-name";
110
+ TextInputAutocomplete["CCAdditionalName"] = "cc-additional-name";
111
+ TextInputAutocomplete["CCFamilyName"] = "cc-family-name";
112
+ TextInputAutocomplete["CCNumber"] = "cc-number";
113
+ TextInputAutocomplete["CCExp"] = "cc-exp";
114
+ TextInputAutocomplete["CCExpMonth"] = "cc-exp-month";
115
+ TextInputAutocomplete["CCExpYear"] = "cc-exp-year";
116
+ TextInputAutocomplete["CCCSC"] = "cc-csc";
117
+ TextInputAutocomplete["CCType"] = "cc-type";
118
+ TextInputAutocomplete["TransactionCurrency"] = "transaction-currency";
119
+ TextInputAutocomplete["TransactionAmount"] = "transaction-amount";
120
+ TextInputAutocomplete["Language"] = "language";
121
+ TextInputAutocomplete["Bday"] = "bday";
122
+ TextInputAutocomplete["BdayDay"] = "bday-day";
123
+ TextInputAutocomplete["BdayMonth"] = "bday-month";
124
+ TextInputAutocomplete["BdayYear"] = "bday-year";
125
+ TextInputAutocomplete["Sex"] = "sex";
126
+ TextInputAutocomplete["Url"] = "url";
127
+ TextInputAutocomplete["Photo"] = "photo";
128
+ })(TextInputAutocomplete || (TextInputAutocomplete = {}));
129
+ exports.TimeType = void 0;
130
+ (function (TimeType) {
131
+ TimeType["Hours"] = "hours";
132
+ TimeType["Minutes"] = "minutes";
133
+ TimeType["Seconds"] = "seconds";
134
+ })(exports.TimeType || (exports.TimeType = {}));
135
+ const WEEK_ABBREVIATIONS = {
136
+ 'fr-FR': 'Sem', // Semaine
137
+ 'fr-BE': 'Sem', // Semaine
138
+ 'nl-BE': 'W', // Week
139
+ 'en-BE': 'W', // Week
140
+ 'en-US': 'W', // Week
141
+ 'en-GB': 'W', // Week
142
+ 'es-ES': 'Sem', // Semana
143
+ 'de-DE': 'KW', // Kalenderwoche
144
+ 'it-IT': 'Set', // Settimana
145
+ 'pt-PT': 'Sem', // Semana
146
+ 'nl-NL': 'W', // Week
147
+ 'pl-PL': 'Tyd', // Tydzień
148
+ 'ru-RU': 'Нед', // Неделя
149
+ 'ja-JP': '週', // Shū
150
+ 'zh-CN': '周', // Zhōu
151
+ 'ko-KR': '주', // Ju
152
+ };
153
+ const CUSTOM_DAY_NAMES = {
154
+ 'fr-BE': ['Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa', 'Di'],
155
+ 'nl-BE': ['Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za', 'Zo'],
156
+ 'de-DE': ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'],
157
+ 'en-BE': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
158
+ 'en-US': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
159
+ 'en-GB': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
160
+ };
161
+ const CUSTOM_MONTH_NAMES = {
162
+ 'fr-BE': [
163
+ 'Jan',
164
+ 'Fev',
165
+ 'Mar',
166
+ 'Avr',
167
+ 'Mai',
168
+ 'Jun',
169
+ 'Jul',
170
+ 'Aou',
171
+ 'Sep',
172
+ 'Oct',
173
+ 'Nov',
174
+ 'Dec',
175
+ ],
176
+ 'nl-BE': [
177
+ 'Jan',
178
+ 'Feb',
179
+ 'Maa',
180
+ 'Apr',
181
+ 'Mei',
182
+ 'Jun',
183
+ 'Jul',
184
+ 'Aug',
185
+ 'Sep',
186
+ 'Okt',
187
+ 'Nov',
188
+ 'Dec',
189
+ ],
190
+ 'de-DE': [
191
+ 'Jan',
192
+ 'Feb',
193
+ 'Mär',
194
+ 'Apr',
195
+ 'Mai',
196
+ 'Jun',
197
+ 'Jul',
198
+ 'Aug',
199
+ 'Sep',
200
+ 'Okt',
201
+ 'Nov',
202
+ 'Dez',
203
+ ],
204
+ 'en-BE': [
205
+ 'Jan',
206
+ 'Feb',
207
+ 'Mar',
208
+ 'Apr',
209
+ 'May',
210
+ 'Jun',
211
+ 'Jul',
212
+ 'Aug',
213
+ 'Sep',
214
+ 'Oct',
215
+ 'Nov',
216
+ 'Dec',
217
+ ],
218
+ 'en-US': [
219
+ 'Jan',
220
+ 'Feb',
221
+ 'Mar',
222
+ 'Apr',
223
+ 'May',
224
+ 'Jun',
225
+ 'Jul',
226
+ 'Aug',
227
+ 'Sep',
228
+ 'Oct',
229
+ 'Nov',
230
+ 'Dec',
231
+ ],
232
+ 'en-GB': [
233
+ 'Jan',
234
+ 'Feb',
235
+ 'Mar',
236
+ 'Apr',
237
+ 'May',
238
+ 'Jun',
239
+ 'Jul',
240
+ 'Aug',
241
+ 'Sep',
242
+ 'Oct',
243
+ 'Nov',
244
+ 'Dec',
245
+ ],
246
+ };
247
+
248
+ exports.CUSTOM_DAY_NAMES = CUSTOM_DAY_NAMES;
249
+ exports.CUSTOM_MONTH_NAMES = CUSTOM_MONTH_NAMES;
250
+ exports.WEEK_ABBREVIATIONS = WEEK_ABBREVIATIONS;
@@ -0,0 +1,168 @@
1
+ 'use strict';
2
+
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
4
+ /**
5
+ * All properties that should be excluded from the deep copy of an HTML element.
6
+ */
7
+ const excludedProps = new Set([
8
+ // Text and content-related properties
9
+ 'textContent',
10
+ 'innerText',
11
+ 'outerText',
12
+ 'innerHTML',
13
+ 'outerHTML',
14
+ 'text',
15
+ // Form element properties
16
+ 'value',
17
+ 'defaultValue',
18
+ 'checked',
19
+ 'defaultChecked',
20
+ 'selectionStart',
21
+ 'selectionEnd',
22
+ 'selectionDirection',
23
+ 'form',
24
+ 'willValidate',
25
+ 'validity',
26
+ 'validationMessage',
27
+ 'labels',
28
+ 'list',
29
+ 'maxLength',
30
+ 'minLength',
31
+ 'valueAsDate',
32
+ 'valueAsNumber',
33
+ // Editability and namespaces
34
+ 'contentEditable',
35
+ 'isContentEditable',
36
+ 'namespaceURI',
37
+ // Child-related properties (handled recursively)
38
+ 'attributes',
39
+ 'children',
40
+ 'childNodes',
41
+ 'firstChild',
42
+ 'lastChild',
43
+ // Blazor-related properties
44
+ 'origin',
45
+ 'dataset',
46
+ 'attributeStyleMap',
47
+ 'prefix',
48
+ 'localName',
49
+ 'tagName',
50
+ 'shadowRoot',
51
+ 'assignedSlot',
52
+ 'scrollWidth',
53
+ 'scrollHeight',
54
+ 'clientTop',
55
+ 'clientLeft',
56
+ 'clientWidth',
57
+ 'clientHeight',
58
+ 'firstElementChild',
59
+ 'lastElementChild',
60
+ 'childElementCount',
61
+ 'previousElementSibling',
62
+ 'nextElementSibling',
63
+ 'currentCSSZoom',
64
+ 'nodeType',
65
+ 'nodeName',
66
+ 'baseURI',
67
+ 'isConnected',
68
+ 'ownerDocument',
69
+ 'parentNode',
70
+ 'parentElement',
71
+ 'previousSibling',
72
+ 'nextSibling',
73
+ 'ELEMENT_NODE',
74
+ 'ATTRIBUTE_NODE',
75
+ 'TEXT_NODE',
76
+ 'CDATA_SECTION_NODE',
77
+ 'ENTITY_REFERENCE_NODE',
78
+ 'ENTITY_NODE',
79
+ 'PROCESSING_INSTRUCTION_NODE',
80
+ 'COMMENT_NODE',
81
+ 'DOCUMENT_NODE',
82
+ 'DOCUMENT_TYPE_NODE',
83
+ 'DOCUMENT_FRAGMENT_NODE',
84
+ 'NOTATION_NODE',
85
+ 'DOCUMENT_POSITION_DISCONNECTED',
86
+ 'DOCUMENT_POSITION_PRECEDING',
87
+ 'DOCUMENT_POSITION_FOLLOWING',
88
+ 'DOCUMENT_POSITION_CONTAINS',
89
+ 'DOCUMENT_POSITION_CONTAINED_BY',
90
+ 'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
91
+ ]);
92
+ /**
93
+ * Deep copy an HTML element with all its attributes, properties, and child nodes.
94
+ * This method is useful for creating a clone of an element that can be safely modified without affecting the original.
95
+ * @param {HTMLElement} element - The HTML element to copy.
96
+ * @returns {HTMLElement} - A deep copy of the HTML element.
97
+ * @example const copy = deepCopyElement(document.getElementById('myElement'));
98
+ */
99
+ function deepCopyElement(element) {
100
+ const copy = document.createElement(element.tagName);
101
+ // ✅ Copy attributes
102
+ Array.from(element.attributes).forEach(attr => {
103
+ copy.setAttribute(attr.name, attr.value);
104
+ });
105
+ // ✅ Dynamically extract relevant properties
106
+ const properties = new Set();
107
+ // Collect only own enumerable properties
108
+ Object.keys(element).forEach(key => properties.add(key));
109
+ // Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
110
+ let proto = Object.getPrototypeOf(element);
111
+ while (proto && proto !== HTMLElement.prototype) {
112
+ Object.keys(proto).forEach(key => properties.add(key));
113
+ proto = Object.getPrototypeOf(proto);
114
+ }
115
+ // ✅ Filter and copy only non-function properties (methods are excluded) and non-event listeners
116
+ properties.forEach(prop => {
117
+ if (typeof element[prop] !== 'function' && // Ignore methods
118
+ !prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
119
+ !excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
120
+ ) {
121
+ try {
122
+ copy[prop] = element[prop];
123
+ }
124
+ catch (error) {
125
+ console.warn(`Could not copy property ${prop}:`, error.message);
126
+ }
127
+ }
128
+ });
129
+ // ✅ Copy dataset separately
130
+ Object.assign(copy.dataset, element.dataset);
131
+ // ✅ Handle form elements specifically
132
+ if (element instanceof HTMLInputElement) {
133
+ copy.value = element.value;
134
+ copy.checked = element.checked;
135
+ copy.defaultValue = element.defaultValue;
136
+ copy.defaultChecked = element.defaultChecked;
137
+ copy.selectionStart = element.selectionStart;
138
+ copy.selectionEnd = element.selectionEnd;
139
+ copy.selectionDirection = element.selectionDirection;
140
+ }
141
+ else if (element instanceof HTMLTextAreaElement) {
142
+ copy.value = element.value;
143
+ copy.defaultValue = element.defaultValue;
144
+ copy.selectionStart = element.selectionStart;
145
+ copy.selectionEnd = element.selectionEnd;
146
+ copy.selectionDirection =
147
+ element.selectionDirection;
148
+ }
149
+ else if (element instanceof HTMLSelectElement) {
150
+ copy.value = element.value;
151
+ copy.selectedIndex = element.selectedIndex;
152
+ }
153
+ // ✅ Recursively copy child nodes (prevent duplicates)
154
+ element.childNodes.forEach(child => {
155
+ let childCopy;
156
+ if (child.nodeType === Node.ELEMENT_NODE) {
157
+ childCopy = deepCopyElement(child);
158
+ }
159
+ else {
160
+ childCopy = child.cloneNode(true);
161
+ }
162
+ copy.appendChild(childCopy);
163
+ });
164
+ return copy;
165
+ }
166
+
167
+ exports.deepCopyElement = deepCopyElement;
168
+ exports.excludedProps = excludedProps;
@@ -0,0 +1,23 @@
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;