@nova-design-system/nova-react 3.0.0-beta.43 → 3.0.0-beta.45

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 (81) hide show
  1. package/dist/cjs/{index-CinzsZ8D.js → index-S09Gr7Tw.js} +180 -218
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/{nv-alert.entry-BVY_rxey.js → nv-alert.entry-DH8Qd2s2.js} +1 -1
  4. package/dist/cjs/{nv-avatar.entry-pREKtiv2.js → nv-avatar.entry-B3-elLZC.js} +1 -1
  5. package/dist/cjs/{nv-badge_2.entry-wDuiCwys.js → nv-badge_2.entry-D15EDzX0.js} +2 -2
  6. package/dist/cjs/{nv-base.entry-DwtTXK_n.js → nv-base.entry-D-_RUZTX.js} +1 -1
  7. package/dist/cjs/{nv-breadcrumb.entry-B0hIeE83.js → nv-breadcrumb.entry-DG49Nj1L.js} +2 -2
  8. package/dist/cjs/{nv-breadcrumbs.entry-Cq0LsIFs.js → nv-breadcrumbs.entry-BqJO5pbN.js} +1 -1
  9. package/dist/cjs/{nv-button.entry-DaSGnB1L.js → nv-button.entry-CN9kB98T.js} +6 -4
  10. package/dist/cjs/{nv-calendar.entry-BC6NDsVl.js → nv-calendar.entry-CMEgSU64.js} +6 -6
  11. package/dist/cjs/{nv-col.entry-DNUY559i.js → nv-col.entry-wcZ9HHAb.js} +1 -1
  12. package/dist/cjs/{nv-datagrid.entry-Cp8RCSEv.js → nv-datagrid.entry-GCLeN2qT.js} +32 -5
  13. package/dist/cjs/{nv-datagridcolumn.entry-CR9_1fsZ.js → nv-datagridcolumn.entry-lgIz71UU.js} +1 -1
  14. package/dist/cjs/{nv-dialog.entry-BjTJ5FFL.js → nv-dialog.entry-DfY0TaYp.js} +17 -13
  15. package/dist/cjs/{nv-dialogfooter_2.entry-DJkKzEgO.js → nv-dialogfooter_2.entry-OByWsulH.js} +6 -6
  16. package/dist/cjs/{nv-fieldcheckbox.entry-C0DmeqXD.js → nv-fieldcheckbox.entry-Bqpe9BK3.js} +2 -2
  17. package/dist/cjs/{nv-fielddate.entry-DRX2mfZL.js → nv-fielddate.entry-DJePv6tR.js} +1 -1
  18. package/dist/cjs/{nv-fielddaterange.entry-ka3JiDvT.js → nv-fielddaterange.entry--YC750sX.js} +1 -1
  19. package/dist/cjs/{nv-fielddropdown.entry-DUAKFYgw.js → nv-fielddropdown.entry-BPlTlc_S.js} +45 -75
  20. package/dist/cjs/{nv-fielddropdownitem.entry-BsbvJERH.js → nv-fielddropdownitem.entry-zwoGySum.js} +7 -9
  21. package/dist/cjs/{nv-fieldmultiselect.entry-DFr-ZICs.js → nv-fieldmultiselect.entry-Bg_v0LUF.js} +7 -49
  22. package/dist/cjs/{nv-fieldnumber.entry-ezdDvJh_.js → nv-fieldnumber.entry-BLNaq7yr.js} +1 -1
  23. package/dist/cjs/{nv-fieldpassword.entry-D4a8SnGr.js → nv-fieldpassword.entry-iSEdS5R8.js} +1 -1
  24. package/dist/cjs/{nv-fieldradio.entry-Co7WX2vI.js → nv-fieldradio.entry-Dov4vZkh.js} +1 -1
  25. package/dist/cjs/{nv-fieldselect.entry-sTbv_flF.js → nv-fieldselect.entry-NmpesarX.js} +1 -1
  26. package/dist/cjs/{nv-fieldtext.entry-DRPCH6Sf.js → nv-fieldtext.entry-r6oQajRS.js} +1 -1
  27. package/dist/cjs/{nv-fieldtextarea.entry-BwJCUiVW.js → nv-fieldtextarea.entry-CJ2yQkfi.js} +1 -1
  28. package/dist/cjs/{nv-fieldtime.entry-uU-IET2k.js → nv-fieldtime.entry-Bxoj6N53.js} +1 -1
  29. package/dist/cjs/nv-icon.entry-CWKRt8F0.js +79 -0
  30. package/dist/cjs/{nv-iconbutton_2.entry-Dx4usGkY.js → nv-iconbutton_2.entry-CnbscpNn.js} +1 -1
  31. package/dist/cjs/{nv-menu.entry-D3qvf_0H.js → nv-menu.entry-wC7oSruP.js} +1 -1
  32. package/dist/cjs/{nv-menuitem.entry-3t6TixM7.js → nv-menuitem.entry-BVSa1vrS.js} +1 -1
  33. package/dist/cjs/{nv-popover.entry-Bv6kuTK_.js → nv-popover.entry-ChP1we3l.js} +12 -10
  34. package/dist/cjs/{nv-row.entry-BPK1Li7w.js → nv-row.entry-D6FeFpzG.js} +1 -1
  35. package/dist/cjs/{nv-stack.entry-ByaO-0TJ.js → nv-stack.entry-zjJmztkO.js} +1 -1
  36. package/dist/cjs/{nv-table.entry-C7Hd57Iq.js → nv-table.entry-CGX0jsR3.js} +2 -2
  37. package/dist/cjs/{nv-tablecolumn.entry-BDCw_45v.js → nv-tablecolumn.entry-Cwdmo_RY.js} +1 -1
  38. package/dist/cjs/{nv-toggle.entry-BTqGH_H0.js → nv-toggle.entry-BvToMkI2.js} +2 -2
  39. package/dist/cjs/{nv-tooltip.entry-BDZfrLHv.js → nv-tooltip.entry-DZ7_lB-p.js} +2 -2
  40. package/dist/generated/components.js +3 -3
  41. package/dist/types/generated/components.d.ts +3 -5
  42. package/package.json +1 -1
  43. package/dist/cjs/index-C8UfzrMI.js +0 -26405
  44. package/dist/cjs/nv-alert.entry-8esWDUyU.js +0 -173
  45. package/dist/cjs/nv-avatar.entry-CO6bt4k6.js +0 -67
  46. package/dist/cjs/nv-badge_2.entry-xfXsesV0.js +0 -195
  47. package/dist/cjs/nv-base.entry-BO-6krwg.js +0 -71
  48. package/dist/cjs/nv-breadcrumb.entry-DTwjCmMI.js +0 -45
  49. package/dist/cjs/nv-breadcrumbs.entry-jn5hRjpQ.js +0 -20
  50. package/dist/cjs/nv-button.entry-DxzA6-My.js +0 -162
  51. package/dist/cjs/nv-calendar.entry-DKz-iBnp.js +0 -1036
  52. package/dist/cjs/nv-col.entry-X7jkNThH.js +0 -37
  53. package/dist/cjs/nv-datagrid.entry-DL-Fyo4l.js +0 -3671
  54. package/dist/cjs/nv-datagridcolumn.entry-CyTG5E7M.js +0 -18
  55. package/dist/cjs/nv-dialog.entry-Do_uALC6.js +0 -784
  56. package/dist/cjs/nv-dialogfooter_2.entry-DJ8qS9q6.js +0 -134
  57. package/dist/cjs/nv-fieldcheckbox.entry-DoGQX-5D.js +0 -137
  58. package/dist/cjs/nv-fielddate.entry-D-PjbYaA.js +0 -278
  59. package/dist/cjs/nv-fielddaterange.entry-BrC5jKLp.js +0 -355
  60. package/dist/cjs/nv-fielddropdown.entry-MsUR1kVe.js +0 -391
  61. package/dist/cjs/nv-fielddropdownitem.entry-DRM-Zljt.js +0 -70
  62. package/dist/cjs/nv-fieldmultiselect.entry-Dr8FfT_W.js +0 -1060
  63. package/dist/cjs/nv-fieldnumber.entry-DZsM1vmO.js +0 -126
  64. package/dist/cjs/nv-fieldpassword.entry-Biw__M2W.js +0 -115
  65. package/dist/cjs/nv-fieldradio.entry-ZL7KgEZ7.js +0 -102
  66. package/dist/cjs/nv-fieldselect.entry-D6eRsM9T.js +0 -365
  67. package/dist/cjs/nv-fieldtext.entry-DKdxC2cG.js +0 -119
  68. package/dist/cjs/nv-fieldtextarea.entry-Dc_TGlmI.js +0 -194
  69. package/dist/cjs/nv-fieldtime.entry-CXRtpWt1.js +0 -1011
  70. package/dist/cjs/nv-icon.entry-iipuvT3D.js +0 -79
  71. package/dist/cjs/nv-icon.entry-xltjoSa2.js +0 -79
  72. package/dist/cjs/nv-iconbutton_2.entry-BsXvYbCi.js +0 -163
  73. package/dist/cjs/nv-menu.entry-DFEYw_KZ.js +0 -227
  74. package/dist/cjs/nv-menuitem.entry-BeTXOtir.js +0 -58
  75. package/dist/cjs/nv-popover.entry-Zt25YeAv.js +0 -1960
  76. package/dist/cjs/nv-row.entry-Bwzlub3i.js +0 -21
  77. package/dist/cjs/nv-stack.entry-bhess4lQ.js +0 -30
  78. package/dist/cjs/nv-table.entry-D3U4dFcw.js +0 -338
  79. package/dist/cjs/nv-tablecolumn.entry-BzwWPlLf.js +0 -18
  80. package/dist/cjs/nv-toggle.entry-DXpNGkbz.js +0 -79
  81. package/dist/cjs/nv-tooltip.entry-CvCZZV88.js +0 -44
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CinzsZ8D.js');
4
- require('react');
5
-
6
- const nvRowCss = "nv-row{display:flex;flex-wrap:wrap;margin-right:calc(var(--spacing-4) * -1);margin-left:calc(var(--spacing-4) * -1);row-gap:var(--spacing-4)}";
7
- const NvRowStyle0 = nvRowCss;
8
-
9
- const NvRow = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- }
13
- /****************************************************************************/
14
- //#region RENDER
15
- render() {
16
- return (index.h(index.Host, { key: 'd6f9bbc1ed59bfc59a97728896c0443c8e104e59' }, index.h("slot", { key: '3d9c1c809524d0a4b9d8ad541ead8978d246c998' })));
17
- }
18
- };
19
- NvRow.style = NvRowStyle0;
20
-
21
- exports.nv_row = NvRow;
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-C8UfzrMI.js');
4
- var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
5
- require('react');
6
-
7
- const nvStackCss = "nv-stack{display:flex;align-items:center;justify-content:flex-start;flex-direction:row}nv-stack nv-col{display:flex}nv-stack:not(nv-row){flex-wrap:nowrap}nv-stack>.nv-stack-item-flex{flex-shrink:1;flex-grow:1}nv-stack>.nv-stack-item-lead{margin-right:auto}nv-stack>.nv-stack-item-lead+*{margin-left:0}nv-stack>.nv-stack-item-center{margin-right:auto;margin-left:auto}nv-stack>.nv-stack-item-tail{margin-left:auto}nv-stack>.nv-stack-nowrap{white-space:nowrap}nv-stack.nv-stack-vertical{align-items:stretch;flex-direction:column}nv-stack.nv-stack-vertical>.nv-stack-item-lead{margin-right:0;margin-bottom:auto}nv-stack.nv-stack-vertical>.nv-stack-item-lead+*{margin-top:0}nv-stack.nv-stack-vertical>.nv-stack-item-tail{margin-left:0;margin-top:auto}nv-stack.nv-stack-vertical>.nv-stack-item-center{margin:auto 0}nv-stack.nv-stack-flex>*{flex-shrink:1;flex-grow:1}nv-stack.nv-stack-fill>*{height:100%}nv-stack.nv-stack-fill.nv-stack-vertical>*{height:auto;width:100%}";
8
- const NvStackStyle0 = nvStackCss;
9
-
10
- const NvStack = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- /****************************************************************************/
14
- //#region PROPERTIES
15
- /**
16
- * Gutter refers to the space that exists between children components inside
17
- * the stack container.
18
- */
19
- this.gutter = 2;
20
- }
21
- //#endregion PROPERTIES
22
- /****************************************************************************/
23
- //#region RENDER
24
- render() {
25
- return (index.h(index.Host, { key: 'aef0e6f873f68880d20b5ae9f4f56ece40e8a0ee', class: clsx297c1ffe.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gutter-x-${this.gutter}`, this.gutter && this.vertical && `gutter-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: 'd003e23ec3c9b4a5c4496bc9f4c170af467b311e' })));
26
- }
27
- };
28
- NvStack.style = NvStackStyle0;
29
-
30
- exports.nv_stack = NvStack;
@@ -1,338 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CinzsZ8D.js');
4
- var dom_utilsAc71e0ef = require('./dom.utils-ac71e0ef-CmIwRr6O.js');
5
- require('react');
6
-
7
- const nvTableCss = "nv-table{display:block}nv-table .hidden{display:none}nv-table table{border-collapse:collapse;border-color:inherit;text-indent:0;width:100%}nv-table th{text-align:left;border-bottom:1px solid var(--components-datagrid-border-header);height:var(--spacing-12);padding:var(--spacing-3) var(--spacing-4);font-size:var(--font-size-md);font-weight:700;color:var(--components-datagrid-content-header)}nv-table td{border-bottom:1px solid var(--components-datagrid-border-body);height:var(--spacing-12);max-height:var(--spacing-14);padding:var(--spacing-2) var(--spacing-4);font-size:var(--font-size-md);font-weight:400;color:var(--components-datagrid-content-text);white-space:nowrap;text-overflow:ellipsis}nv-table tbody>tr:hover{background:var(--color-interaction-container-neutral-background-hover)}";
8
- const NvTableStyle0 = nvTableCss;
9
-
10
- const NvTable = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.action = index.createEvent(this, "action");
14
- this.templateCache = new Map();
15
- this.headerTemplateCache = new Map();
16
- /****************************************************************************/
17
- //#region STATES
18
- this.parsedColumns = [];
19
- this.parsedData = [];
20
- this.table = null;
21
- //#endregion STATES
22
- /****************************************************************************/
23
- //#region PROPERTIES
24
- /**
25
- * Data to be displayed in the table
26
- */
27
- this.data = [];
28
- /**
29
- * Configuration of the columns of the table
30
- */
31
- this.columnsConfig = [];
32
- /**
33
- * Fallback value to be displayed when data is not available
34
- */
35
- this.fallbackValue = 'N/A';
36
- /**
37
- * Message to be displayed when no data is available
38
- */
39
- this.noDataMessage = 'No data available';
40
- /**
41
- * The message to display when there are no columns or data available.
42
- * @default 'No data or columns available to display.'
43
- */
44
- this.noColumnsNoDataMessage = 'No data or columns available to display.';
45
- }
46
- //#endregion PROPERTIES
47
- /****************************************************************************/
48
- //#region METHODS
49
- /**
50
- * Caches templates for cells and headers upfront to improve performance.
51
- */
52
- cacheTemplates() {
53
- const columns = Array.from(this.el.querySelectorAll('nv-tablecolumn'));
54
- columns.forEach((col) => {
55
- const key = col.name;
56
- const cellSlot = col.querySelector('[slot="cell"]');
57
- if (cellSlot) {
58
- const element = dom_utilsAc71e0ef.deepCopyElement(cellSlot);
59
- this.templateCache.set(key, element);
60
- }
61
- const headerSlot = col.querySelector('[slot="header"]');
62
- if (headerSlot) {
63
- const element = dom_utilsAc71e0ef.deepCopyElement(headerSlot);
64
- this.headerTemplateCache.set(key, element);
65
- }
66
- else {
67
- const header = col.header;
68
- if (header) {
69
- const headerDiv = document.createElement('div');
70
- headerDiv.textContent = header;
71
- this.headerTemplateCache.set(key, headerDiv);
72
- }
73
- }
74
- });
75
- }
76
- parseDataAndColumns() {
77
- if (this.dataJson) {
78
- this.parseJsonData(this.dataJson);
79
- }
80
- else if (this.data && this.data.length > 0) {
81
- this.parseDataArray(this.data, this.parsedData);
82
- }
83
- if (this.columnsConfigJson) {
84
- this.parseJsonColumns(this.columnsConfigJson, this.parsedColumns);
85
- }
86
- else if (this.columnsConfig && this.columnsConfig.length > 0) {
87
- this.parseColumnsArray(this.columnsConfig, this.parsedColumns);
88
- }
89
- else if (this.headerTemplateCache.size > 0) {
90
- const headerKeys = Array.from(this.headerTemplateCache.keys());
91
- const arrayColumnsConfig = headerKeys.map(key => (Object.assign({}, { name: key, header: key ? key.charAt(0).toUpperCase() + key.slice(1) : '' })));
92
- this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
93
- }
94
- else if (this.parsedData.length > 0) {
95
- const firstRow = this.parsedData[0];
96
- const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
97
- name: key,
98
- header: key.charAt(0).toUpperCase() + key.slice(1),
99
- }));
100
- this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
101
- }
102
- }
103
- deepEqual(a, b) {
104
- return JSON.stringify(a) === JSON.stringify(b);
105
- }
106
- /**
107
- * Parses the data array and sets the state accordingly
108
- * @param {any[]} newValue - New value of the data array
109
- * @param {any[]} oldValue - Old value of the data array
110
- * @returns {void}
111
- */
112
- parseDataArray(newValue, oldValue) {
113
- // Ensure both are arrays for proper comparison
114
- const safeNewValue = Array.isArray(newValue) ? newValue : [];
115
- const safeOldValue = Array.isArray(oldValue) ? oldValue : [];
116
- if (this.deepEqual(safeNewValue, safeOldValue)) {
117
- return; // Deep comparison
118
- }
119
- this.parsedData = Array.isArray(newValue) ? newValue : [];
120
- }
121
- /**
122
- * Parses the columns array and sets the state accordingly
123
- * @param {ColumnConfig[]} newValue - New value of the columns array
124
- * @param {ColumnConfig[]} oldValue - Old value of the columns array
125
- * @returns {void}
126
- */
127
- parseColumnsArray(newValue, oldValue) {
128
- // Ensure both are arrays for proper comparison
129
- const safeNewValue = Array.isArray(newValue) ? newValue : [];
130
- const safeOldValue = Array.isArray(oldValue) ? oldValue : [];
131
- // Use a proper deep comparison function (e.g., Lodash's isEqual)
132
- if (this.deepEqual(safeNewValue, safeOldValue)) {
133
- return;
134
- }
135
- // Assign only after confirming changes
136
- this.parsedColumns = safeNewValue;
137
- }
138
- initializeTable() {
139
- // Clear the previous table instance (if any)
140
- this.table = null;
141
- if (this.parsedColumns.length > 0) {
142
- this.table = {
143
- columns: this.parsedColumns,
144
- data: this.getTableData(),
145
- };
146
- }
147
- else {
148
- this.table = null;
149
- }
150
- }
151
- getTableData() {
152
- if (this.parsedData &&
153
- Array.isArray(this.parsedData) &&
154
- this.parsedData.length > 0) {
155
- return [...this.parsedData];
156
- }
157
- else {
158
- return [];
159
- }
160
- }
161
- // Helper function to get nested property value
162
- replaceKeyWithValue(obj, path) {
163
- var _a;
164
- return ((_a = path
165
- .split('.')
166
- .reduce((acc, key) => (acc && acc[key] !== undefined ? acc[key] : undefined), obj)) !== null && _a !== void 0 ? _a : this.fallbackValue);
167
- }
168
- renderTemplate(template, row) {
169
- if (!template) {
170
- return null;
171
- }
172
- // Handle <template> elements correctly
173
- const templateContent = template instanceof HTMLTemplateElement ? template.content : template;
174
- const element = dom_utilsAc71e0ef.deepCopyElement(templateContent);
175
- // Replace placeholders in text content, attributes, and properties
176
- element.querySelectorAll('*').forEach(el => {
177
- // Replace placeholders in text content
178
- this.replacePlaceholdersTextContent(el, row);
179
- // Replace placeholders in attributes
180
- this.replacePlaceholdersAttributes(el, row);
181
- // Replace placeholders in properties
182
- this.replacePlaceholdersProperties(el, row);
183
- });
184
- // Handle `data-bind-event`
185
- element.querySelectorAll('[data-bind-event]').forEach(el => {
186
- const bindEvent = el.getAttribute('data-bind-event') || '';
187
- const splitted = bindEvent.split(':');
188
- if (!bindEvent.includes(':') || splitted.length < 2) {
189
- console.warn('Invalid data-bind-event format:', bindEvent);
190
- return;
191
- }
192
- const eventType = splitted[0];
193
- const keyAction = splitted[1];
194
- const details = splitted.length > 2 ? splitted[2] : null;
195
- el.addEventListener(eventType, () => {
196
- var _a;
197
- const keys = (_a = details === null || details === void 0 ? void 0 : details.split(',')) !== null && _a !== void 0 ? _a : [];
198
- // Convert keys into a single object instead of an array of objects
199
- const keyValue = keys.reduce((acc, key) => {
200
- acc[key] = row === null || row === void 0 ? void 0 : row[key];
201
- return acc;
202
- }, {});
203
- const action = { keyAction, details: keyValue };
204
- this.action.emit(action);
205
- });
206
- });
207
- // Ensure Web Components are properly connected
208
- setTimeout(() => {
209
- element.querySelectorAll('*').forEach(child => {
210
- if (typeof child.connectedCallback === 'function') {
211
- child.connectedCallback();
212
- }
213
- });
214
- }, 0);
215
- return (index.h("div", { ref: el => {
216
- if (el) {
217
- el.innerHTML = ''; // Remove existing content
218
- el.appendChild(element); // Append new element
219
- }
220
- } }));
221
- }
222
- replacePlaceholdersTextContent(element, row) {
223
- // ✅ Replace placeholders in text content
224
- element.childNodes.forEach(node => {
225
- if (node.nodeType === Node.TEXT_NODE) {
226
- node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(row, key));
227
- }
228
- });
229
- }
230
- replacePlaceholdersAttributes(element, row) {
231
- // ✅ Replace placeholders in attributes
232
- Array.from(element.attributes).forEach(attr => {
233
- if (attr.value.includes('__')) {
234
- attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(row, key));
235
- }
236
- });
237
- }
238
- replacePlaceholdersProperties(element, row) {
239
- // ✅ Dynamically extract relevant properties
240
- const properties = new Set();
241
- // Collect only own enumerable properties
242
- Object.keys(element).forEach(key => properties.add(key));
243
- // Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
244
- let proto = Object.getPrototypeOf(element);
245
- while (proto && proto !== HTMLElement.prototype) {
246
- Object.keys(proto).forEach(key => properties.add(key));
247
- proto = Object.getPrototypeOf(proto);
248
- }
249
- // ✅ Filter and copy only non-function properties and exclude irrelevant ones
250
- properties.forEach(prop => {
251
- if (typeof element[prop] !== 'function' && // Ignore methods
252
- !prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
253
- !dom_utilsAc71e0ef.excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
254
- ) {
255
- try {
256
- const value = element[prop];
257
- // ✅ Replace placeholders only if the value is a string
258
- if (typeof value === 'string' && value.includes('__')) {
259
- element[prop] = value.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(row, key)); // ✅ TypeScript safe
260
- }
261
- }
262
- catch (error) {
263
- console.warn(`Could not assign property ${prop}:`, error.message);
264
- }
265
- }
266
- });
267
- }
268
- //#endregion METHODS
269
- /****************************************************************************/
270
- //#region WATCHERS
271
- parseColumns(newValue, oldValue) {
272
- this.parseColumnsArray(newValue, oldValue);
273
- }
274
- parseJsonColumns(newValue, oldValue) {
275
- try {
276
- const newItems = newValue ? JSON.parse(newValue) : [];
277
- this.parseColumnsArray(newItems, oldValue);
278
- }
279
- catch (e) {
280
- console.error('Invalid JSON format for columnsConfigJson:', e.message);
281
- this.parsedColumns = [];
282
- }
283
- }
284
- parseData(newValue, oldValue) {
285
- this.parseDataArray(newValue, oldValue);
286
- }
287
- parseJsonData(newValue) {
288
- try {
289
- const newItems = newValue ? JSON.parse(newValue) : [];
290
- this.parseDataArray(newItems, this.parsedData);
291
- }
292
- catch (e) {
293
- console.error('Invalid JSON format for dataJson:', e.message);
294
- this.parsedData = [];
295
- }
296
- }
297
- handleParsedChange() {
298
- this.initializeTable();
299
- }
300
- //#endregion WATCHERS
301
- /****************************************************************************/
302
- //#region LIFECYCLE
303
- componentWillLoad() {
304
- this.cacheTemplates();
305
- this.parseDataAndColumns();
306
- }
307
- //#endregion EVENTS
308
- /****************************************************************************/
309
- //#region RENDER
310
- render() {
311
- const headerGroups = !this.table || this.table === undefined || this.parsedColumns.length === 0
312
- ? []
313
- : this.table.columns;
314
- const rows = !this.table || this.table === undefined || this.parsedData.length === 0
315
- ? []
316
- : this.table.data;
317
- return (index.h(index.Host, { key: 'bf96a7c40a0960fc68778c33ec63a1d574993408' }, index.h("div", { key: '77e4ace0a9925ef6f5f7e1f51a2abc0c381d8ba5', class: "hidden" }, index.h("slot", { key: 'cdeb4abdd65d0e5de7064af63b1a39e661d4b49b' })), index.h("slot", { key: '4322aeb2858716be200a8d6851ef1d47ee0c44bb', name: "before" }), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (index.h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (index.h("table", { class: "table" }, this.parsedColumns.length > 0 && headerGroups.length > 0 && (index.h("thead", { class: "table-header" }, index.h("tr", null, headerGroups &&
318
- headerGroups.map(col => {
319
- return (index.h("th", { key: col.name }, this.renderTemplate(this.headerTemplateCache.get(col.name), {}) || col.header));
320
- })))), index.h("tbody", { class: "table-body" }, !rows || rows.length === 0 ? (index.h("tr", null, index.h("td", { colSpan: headerGroups.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => (index.h("tr", { key: JSON.stringify(row) }, headerGroups.map(col => {
321
- var _a;
322
- return (index.h("td", null, this.renderTemplate(this.templateCache.get(col.name), row) ||
323
- ((_a = row[col.name]) !== null && _a !== void 0 ? _a : this.fallbackValue)));
324
- })))))))), index.h("slot", { key: 'e5e490de2ff568c962368f39dbcd5c119e814b0d', name: "after" })));
325
- }
326
- get el() { return index.getElement(this); }
327
- static get watchers() { return {
328
- "columnsConfig": ["parseColumns"],
329
- "columnsConfigJson": ["parseJsonColumns"],
330
- "data": ["parseData"],
331
- "dataJson": ["parseJsonData"],
332
- "parsedColumns": ["handleParsedChange"],
333
- "parsedData": ["handleParsedChange"]
334
- }; }
335
- };
336
- NvTable.style = NvTableStyle0;
337
-
338
- exports.nv_table = NvTable;
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CinzsZ8D.js');
4
- require('react');
5
-
6
- const NvTablecolumn = class {
7
- constructor(hostRef) {
8
- index.registerInstance(this, hostRef);
9
- }
10
- //#endregion PROPERTIES
11
- /****************************************************************************/
12
- //#region RENDER
13
- render() {
14
- return null;
15
- }
16
- };
17
-
18
- exports.nv_tablecolumn = NvTablecolumn;
@@ -1,79 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CinzsZ8D.js');
4
- var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
5
- var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
6
- require('react');
7
-
8
- const nvToggleCss = "nv-toggle{display:inline-flex;align-items:flex-start;gap:var(--form-gap-x);position:relative}nv-toggle:not([disabled],[readonly]) input,nv-toggle:not([disabled],[readonly]) label{cursor:pointer}nv-toggle.label-placement-before{flex-direction:row-reverse}nv-toggle[disabled]{opacity:0.5}nv-toggle label{align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-toggle .input-container{position:relative;color:var(--components-form-shape-foreground-default)}nv-toggle .input-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--components-form-shape-foreground-disabled)}nv-toggle .input-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-toggle-width);height:var(--form-toggle-height);flex-direction:column;align-items:flex-start;border-radius:var(--form-toggle-radius);border-width:var(--form-toggle-border-width);border-style:solid;border-color:var(--components-form-field-border-default);background:var(--components-form-field-background-default)}nv-toggle .input-container input[type=checkbox]::after{content:\"\";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-form-shape-foreground-switch-dot);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:25%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:hover{border-color:var(--components-form-field-border-hover)}nv-toggle .input-container input[type=checkbox]:focus{border-color:var(--components-form-field-border-default)}nv-toggle .input-container input[type=checkbox]:focus,nv-toggle .input-container input[type=checkbox]:focus-within{outline:none}nv-toggle .input-container input[type=checkbox]:focus-visible,nv-toggle .input-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-toggle .input-container input[type=checkbox]:checked{background:var(--components-form-field-background-checked);border-color:var(--components-form-field-background-checked)}nv-toggle .input-container input[type=checkbox]:checked::after{content:\"\";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-form-shape-foreground-default);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:75%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:checked:focus{background:var(--components-form-field-background-checked);border-color:var(--components-form-field-border-focus)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]){box-shadow:unset;background:var(--components-form-field-background-disabled);border-color:var(--components-form-field-border-default)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]):checked::after{background-color:var(--components-form-shape-foreground-disabled)}nv-toggle .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:450;line-height:var(--form-description-line-height)}nv-toggle .text-container{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}";
9
- const NvToggleStyle0 = nvToggleCss;
10
-
11
- const NvToggle = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.checkedChanged = index.createEvent(this, "checkedChanged");
15
- /****************************************************************************/
16
- //#region PROPERTIES
17
- /**
18
- * Sets the ID for the radio button’s input element and the for attribute of
19
- * the associated label. If no ID is provided, a random one will be
20
- * automatically generated to ensure unique identification, facilitating
21
- * proper label association and accessibility.
22
- */
23
- this.inputId = v4A79185f4.v4();
24
- /**
25
- * Hides the label visually while still keeping it available for screen
26
- * readers.
27
- */
28
- this.hideLabel = false;
29
- /** Indicates whether the toggle is checked or not. */
30
- this.checked = false;
31
- /** Disables the toggle, preventing user interaction. */
32
- this.disabled = false;
33
- /**
34
- * Sets the toggle to read-only, preventing user changes but still allowing
35
- * focus and selection of text.
36
- */
37
- this.readonly = false;
38
- }
39
- //#endregion EVENTS
40
- /****************************************************************************/
41
- //#region WATCHERS
42
- /**
43
- * Watches for changes to the checked state and emits the new value.
44
- * @param {boolean} checked - The new value of the checked state.
45
- */
46
- onCheckedChanged(checked) {
47
- this.checkedChanged.emit(checked);
48
- }
49
- /**
50
- * Listens for the change event on the toggle input element and updates the checked state.
51
- * the checked state of the host elements.
52
- * @param {Event} event - The change event.
53
- */
54
- handleChange(event) {
55
- const target = event.target;
56
- if (target.type === 'checkbox' && target.id === this.inputId) {
57
- if (this.readonly || this.disabled) {
58
- event.preventDefault();
59
- return;
60
- }
61
- this.checked = target.checked;
62
- }
63
- }
64
- //#endregion WATCHERS
65
- /****************************************************************************/
66
- //#region RENDER
67
- render() {
68
- return (index.h(index.Host, { key: '6728159c0c7f622fbcc5017a116ec0dd1fe28b39', class: clsx297c1ffe.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '2155eacf39771790ca730f264f9c490f6e93794b', class: "input-container" }, index.h("input", { key: '588a638b678c7d26fd0050a54fbd86ab029c18d0', 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: 'ba543a1282f8244449c3682bc43c8481d0c588dd', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'beab39ef75d445e43bf4d127ea9f0c7130bae25f', htmlFor: this.inputId, class: clsx297c1ffe.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: 'fd60c679cf1514fc2d01c39a8e13e6dc6fd3287e', name: "label" }, this.label))), (this.description ||
69
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '42582783ac08557d55bf8f80fa68f2f565f7208f', class: "description" }, index.h("slot", { key: '889f7408fd401816ffb6dff0c264e265911e3b79', name: "description" }, this.description))))));
70
- }
71
- static get formAssociated() { return true; }
72
- get el() { return index.getElement(this); }
73
- static get watchers() { return {
74
- "checked": ["onCheckedChanged"]
75
- }; }
76
- };
77
- NvToggle.style = NvToggleStyle0;
78
-
79
- exports.nv_toggle = NvToggle;
@@ -1,44 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CinzsZ8D.js');
4
- require('react');
5
-
6
- const nvTooltipCss = "nv-tooltip{display:inline-block;position:relative}nv-tooltip:has([fluid]:not([fluid=false])){display:block}nv-tooltip [data-scope=popover]{background:var(--components-tooltip-background);color:var(--components-tooltip-text);font-weight:var(--font-weight-medium-emphasis);padding:var(--tooltip-padding-y) var(--tooltip-padding-x);font-size:var(--tooltip-font-size);border-radius:var(--tooltip-radius);border:none;box-shadow:0px var(--shadow-y-axis-lg-1) var(--shadow-blur-lg-1) var(--shadow-spread-lg-1) var(--shadow-color-opacity-1), 0px var(--shadow-y-axis-lg-2) var(--shadow-blur-lg-2) var(--shadow-spread-lg-2) var(--shadow-color-opacity-2)}nv-tooltip [data-scope=popover] [data-scope=arrow]{background:var(--components-tooltip-background);box-shadow:none;border:none}";
7
- const NvTooltipStyle0 = nvTooltipCss;
8
-
9
- const NvTooltip = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- /**
13
- * Decides where the tooltip shows up next to the element it’s linked to
14
- * (above, below, to the sides). If there isn’t enough room, it will adjust
15
- * it's position on the axis to fit on the screen, so users can always see it.
16
- */
17
- this.placement = 'bottom';
18
- /**
19
- * Controls how long (in milliseconds) the tooltip waits to show after you
20
- * hover over or focus on an element. If you move away before the delay is up,
21
- * the tooltip won’t appear.
22
- */
23
- this.enterDelay = 0;
24
- }
25
- //#endregion PROPERTIES
26
- /****************************************************************************/
27
- //#region LIFECYCLE
28
- componentWillLoad() {
29
- if (!this.triggerElement)
30
- this.triggerElement = Array.from(this.el.children).find(child => {
31
- return child.getAttribute('slot') === null;
32
- });
33
- }
34
- //#endregion LIFECYCLE
35
- /****************************************************************************/
36
- //#region RENDER
37
- render() {
38
- return (index.h(index.Host, { key: '58df5290d4cfe97638f0f0f0796dcb318b3c3871' }, index.h("slot", { key: '49592f157bf2a0369df4ee70bf1ba003a694cd9e' }), index.h("nv-popover", { key: 'e47234d1b2cb4be5f8cfc5e1c797dc7769eed11e', triggerMode: "hover", hasArrow: true, placement: this.placement, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, index.h("p", { key: '798b50640a27acbea723d6404fb41265454e9648', slot: "content" }, this.message), index.h("slot", { key: '8122e778c2453d16924be738120a570f0c0474fb', name: "content" }))));
39
- }
40
- get el() { return index.getElement(this); }
41
- };
42
- NvTooltip.style = NvTooltipStyle0;
43
-
44
- exports.nv_tooltip = NvTooltip;