@nova-design-system/nova-react 3.23.0 → 3.25.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/events.utils-B6GgGra--01N__3wY.js +23 -0
- package/dist/cjs/generated/components.server.js +124 -58
- package/dist/cjs/{grow.animation-CvHGHBL4-DDIEYBK-.js → grow.animation-D7ep_aVl-BuXEDSK-.js} +0 -21
- package/dist/cjs/{i18n.utils-DOZbXX2L-BizoXo6c.js → i18n.utils-IlwlcG9l-ku0bScip.js} +14 -18
- package/dist/cjs/index-DUlunl9a.js +9696 -0
- package/dist/cjs/{nv-dialog.entry-O47Eol_7.js → index.esm-D3eWMME9-CG1TVKfu.js} +1 -296
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/{nv-accordion-item.entry-B_l0-ux0.js → nv-accordion-item.entry-CqnjIt4R.js} +8 -7
- package/dist/cjs/{nv-accordion.entry-BX8_YuZF.js → nv-accordion.entry-Dx7FmGg_.js} +11 -14
- package/dist/cjs/{nv-alert.entry-DCWYR0OK.js → nv-alert.entry-BL3Pdcxd.js} +7 -6
- package/dist/cjs/nv-avatar.entry-2dFR4I9_.js +68 -0
- package/dist/cjs/nv-badge_2.entry-5FShR2Ax.js +218 -0
- package/dist/cjs/nv-breadcrumb.entry-Cfi32bBT.js +49 -0
- package/dist/cjs/nv-breadcrumbs.entry-BSgn3KUO.js +21 -0
- package/dist/cjs/nv-button.entry-BdQQ_LE7.js +166 -0
- package/dist/cjs/{nv-buttongroup.entry-BZaTKN_n.js → nv-buttongroup.entry-BM8CwXFK.js} +13 -7
- package/dist/cjs/{nv-calendar.entry-D9ESuu7C.js → nv-calendar.entry-CeKsMGOa.js} +39 -32
- package/dist/cjs/nv-col.entry-D-h2PGcz.js +38 -0
- package/dist/cjs/{nv-datagrid.entry-DcB5q2oC.js → nv-datagrid.entry-nOBIfqOS.js} +113 -255
- package/dist/cjs/{nv-datagridcolumn.entry-BhKOzXA6.js → nv-datagridcolumn.entry-BAzTU_KM.js} +2 -2
- package/dist/cjs/nv-dialog.entry-Bi2ZVSe2.js +299 -0
- package/dist/cjs/{nv-dialogfooter_2.entry-Dn16bI8a.js → nv-dialogfooter_2.entry-D6lzC-3S.js} +11 -29
- package/dist/cjs/nv-drawer.entry-Dp4AfBiF.js +445 -0
- package/dist/cjs/nv-drawerfooter_2.entry-DpWSsq6d.js +128 -0
- package/dist/cjs/nv-fieldcheckbox.entry-COA3LXnX.js +179 -0
- package/dist/cjs/{nv-fielddate.entry-B4P0U8QG.js → nv-fielddate.entry-B8r5RFXd.js} +20 -21
- package/dist/cjs/{nv-fielddaterange.entry-BORwYJ-k.js → nv-fielddaterange.entry-C6_Kq93P.js} +20 -19
- package/dist/cjs/{nv-fielddropdown.entry-DzBAIynY.js → nv-fielddropdown.entry-B2Dr5zHd.js} +51 -58
- package/dist/cjs/nv-fielddropdownitem.entry-DapivVnR.js +69 -0
- package/dist/cjs/{nv-fieldmultiselect.entry-DiqRreWh.js → nv-fieldmultiselect.entry-DSpQeiPx.js} +45 -49
- package/dist/cjs/nv-fieldnumber.entry-BwxR9sRr.js +189 -0
- package/dist/cjs/nv-fieldpassword.entry-BOSU-Skh.js +167 -0
- package/dist/cjs/nv-fieldradio.entry-ZFafNY5_.js +105 -0
- package/dist/cjs/nv-fieldselect.entry-CfWjQAd9.js +405 -0
- package/dist/cjs/{nv-fieldslider.entry-CozmnUfN.js → nv-fieldslider.entry-dDPcWUxs.js} +34 -16
- package/dist/cjs/nv-fieldtext.entry-Yaa-mkjJ.js +163 -0
- package/dist/cjs/{nv-fieldtextarea.entry-7UrKWDHg.js → nv-fieldtextarea.entry-Dp_l2pKZ.js} +18 -13
- package/dist/cjs/{nv-fieldtime.entry-DakOlLiO.js → nv-fieldtime.entry-CWxi4Uel.js} +38 -40
- package/dist/cjs/{nv-icon.entry-Db00kB2u.js → nv-icon.entry-Dci11W9S.js} +5 -5
- package/dist/cjs/nv-iconbutton_2.entry-A6FKFJT_.js +171 -0
- package/dist/cjs/{nv-menu.entry-CK2HdmBt.js → nv-menu.entry-BHaYP-9M.js} +11 -16
- package/dist/cjs/nv-menuitem.entry-Cm1vvN25.js +59 -0
- package/dist/cjs/nv-notification-bullet.entry-DRlS3Ybc.js +76 -0
- package/dist/cjs/nv-notification.entry-BeDmR-XC.js +176 -0
- package/dist/cjs/nv-notificationcontainer.entry-C3p_87Dg.js +41 -0
- package/dist/cjs/nv-paginationtable.entry-BzEqQOBa.js +231 -0
- package/dist/cjs/{nv-popover.entry-mLdLSp6n.js → nv-popover.entry-D2oFn9vL.js} +118 -46
- package/dist/cjs/nv-row.entry-hV1kxmrr.js +22 -0
- package/dist/cjs/{nv-sidebar.entry-inDVNJ4s.js → nv-sidebar.entry-BJrqJ8K7.js} +12 -8
- package/dist/cjs/nv-sidebarcontent.entry-CPfGF7nx.js +22 -0
- package/dist/cjs/{nv-sidebardivider.entry-D_yern0R.js → nv-sidebardivider.entry-D2wmzHCO.js} +4 -4
- package/dist/cjs/{nv-sidebarfooter.entry-Rkkn9TB_.js → nv-sidebarfooter.entry-C7fqCzjH.js} +4 -4
- package/dist/cjs/nv-sidebargroup.entry-qkXnxhs_.js +23 -0
- package/dist/cjs/{nv-sidebarheader.entry-CYpD_4pI.js → nv-sidebarheader.entry-DBsOmyQ0.js} +4 -4
- package/dist/cjs/{nv-sidebarlogo.entry-BgK03M1v.js → nv-sidebarlogo.entry-902Ht3UR.js} +4 -4
- package/dist/cjs/{nv-sidebarnavitem.entry-DglvcCOD.js → nv-sidebarnavitem.entry-CICrllp8.js} +11 -10
- package/dist/cjs/nv-sidebarnavsubitem.entry-Q9jjU_7D.js +35 -0
- package/dist/cjs/{nv-split.entry-mzg2F66T.js → nv-split.entry-BYIsE2wp.js} +51 -45
- package/dist/cjs/nv-stack.entry-DgE5ASGH.js +31 -0
- package/dist/cjs/{nv-table.entry-DkbNgxtI.js → nv-table.entry-DHXBu2n1.js} +9 -11
- package/dist/cjs/{nv-tableheader.entry-CRVFTQA-.js → nv-tableheader.entry-BijgOxcO.js} +5 -5
- package/dist/cjs/nv-toggle.entry-CMI1WdvV.js +82 -0
- package/dist/cjs/nv-togglebutton.entry-DAPETEmF.js +66 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-BYXX5ejg.js → nv-togglebuttongroup.entry-CzDI1XCr.js} +14 -11
- package/dist/cjs/nv-tooltip.entry-DPoUP9iL.js +56 -0
- package/dist/cjs/slide.animation-CmH5d1of-BZuw607U.js +90 -0
- package/dist/components/NvDatatable/NvDatatable.js +69 -32
- package/dist/generated/components.js +38 -0
- package/dist/generated/components.server.js +120 -58
- package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
- package/dist/types/components/NvDatatable/types.d.ts +13 -3
- package/dist/types/generated/components.d.ts +63 -43
- package/dist/types/generated/components.server.d.ts +63 -43
- package/package.json +2 -2
- package/dist/cjs/index-CtjeeUI-.js +0 -39617
- package/dist/cjs/nv-avatar.entry-C_xZD3Lp.js +0 -68
- package/dist/cjs/nv-badge_2.entry-JjqANStV.js +0 -213
- package/dist/cjs/nv-breadcrumb.entry-DQZDn6cm.js +0 -46
- package/dist/cjs/nv-breadcrumbs.entry-Bz0GjhY_.js +0 -21
- package/dist/cjs/nv-button.entry-Br1DH9Vj.js +0 -164
- package/dist/cjs/nv-col.entry-CfgPMMxS.js +0 -38
- package/dist/cjs/nv-fieldcheckbox.entry-Bx6ArV_b.js +0 -177
- package/dist/cjs/nv-fielddropdownitem.entry-C_17isWd.js +0 -73
- package/dist/cjs/nv-fieldnumber.entry-C9O4UPp3.js +0 -187
- package/dist/cjs/nv-fieldpassword.entry-BfVJNT0A.js +0 -165
- package/dist/cjs/nv-fieldradio.entry-CG22oETM.js +0 -103
- package/dist/cjs/nv-fieldselect.entry-BPQEtrv2.js +0 -397
- package/dist/cjs/nv-fieldtext.entry-BD-z01ru.js +0 -163
- package/dist/cjs/nv-iconbutton_2.entry-CaKCa8NT.js +0 -168
- package/dist/cjs/nv-menuitem.entry-mKMqCAdz.js +0 -60
- package/dist/cjs/nv-notification-bullet.entry-DtbjtFxs.js +0 -77
- package/dist/cjs/nv-notification.entry-CLb0gNu3.js +0 -262
- package/dist/cjs/nv-notificationcontainer.entry-Cijivlm6.js +0 -41
- package/dist/cjs/nv-row.entry-C2C94fcv.js +0 -22
- package/dist/cjs/nv-sidebarcontent.entry-DxoljE15.js +0 -22
- package/dist/cjs/nv-sidebargroup.entry-C1p9qqxr.js +0 -23
- package/dist/cjs/nv-sidebarnavsubitem.entry-Dt1jKmC-.js +0 -35
- package/dist/cjs/nv-stack.entry-nnvjTrBy.js +0 -31
- package/dist/cjs/nv-toggle.entry-oC9TVkr1.js +0 -80
- package/dist/cjs/nv-togglebutton.entry-BTWCzbS9.js +0 -67
- package/dist/cjs/nv-tooltip.entry-OJGxfJEh.js +0 -55
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
|
+
require('@stencil/react-output-target/runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Pagination table utility functions for nv-paginationtable component
|
|
10
|
+
*
|
|
11
|
+
* This module contains pure utility functions for label interpolation
|
|
12
|
+
* and pagination calculations.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Interpolates a template string by replacing placeholders with values.
|
|
16
|
+
* Placeholders are defined using curly braces: {key}
|
|
17
|
+
*
|
|
18
|
+
* @param {string} template - The template string with placeholders
|
|
19
|
+
* @param {InterpolationValues} values - Object containing key-value pairs for replacement
|
|
20
|
+
* @param {string} [fallback] - Optional fallback template if template is undefined/null
|
|
21
|
+
* @returns {string} The interpolated string, or empty string if no template and no fallback
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* interpolate('Page {pageIndex} of {pageCount}', { pageIndex: 1, pageCount: 14 })
|
|
25
|
+
* // Returns: 'Page 1 of 14'
|
|
26
|
+
*/
|
|
27
|
+
function interpolate(template, values, fallback) {
|
|
28
|
+
const effectiveTemplate = template ?? fallback ?? '';
|
|
29
|
+
if (!effectiveTemplate)
|
|
30
|
+
return '';
|
|
31
|
+
return effectiveTemplate.replace(/\{(\w+)\}/g, (match, key) => {
|
|
32
|
+
return key in values ? String(values[key]) : match;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Checks if navigation to the first/previous page is possible
|
|
37
|
+
* @param {number} pageIndex - Current page index (zero-based)
|
|
38
|
+
* @returns {boolean} True if at the first page
|
|
39
|
+
*/
|
|
40
|
+
function isFirstPage(pageIndex) {
|
|
41
|
+
return pageIndex === 0;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Checks if navigation to the last/next page is possible
|
|
45
|
+
* @param {number} pageIndex - Current page index (zero-based)
|
|
46
|
+
* @param {number} pageCount - Total number of pages
|
|
47
|
+
* @returns {boolean} True if at the last page
|
|
48
|
+
*/
|
|
49
|
+
function isLastPage(pageIndex, pageCount) {
|
|
50
|
+
return pageIndex >= pageCount - 1;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Default page size values
|
|
54
|
+
*/
|
|
55
|
+
const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
|
|
56
|
+
/**
|
|
57
|
+
* Generates page size options with translated labels.
|
|
58
|
+
* @param {string} labelTemplate - Template string for the label (e.g., '{pageSize} per page')
|
|
59
|
+
* @param {number[]} sizes - Array of page size values
|
|
60
|
+
* @returns {PageSizeOption[]} Array of page size options with interpolated labels
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* generatePageSizeOptions('{pageSize} per page', [10, 25, 50])
|
|
64
|
+
* // Returns: [{ label: '10 per page', value: '10' }, { label: '25 per page', value: '25' }, ...]
|
|
65
|
+
*/
|
|
66
|
+
function generatePageSizeOptions(labelTemplate, sizes = DEFAULT_PAGE_SIZES) {
|
|
67
|
+
return sizes.map(size => ({
|
|
68
|
+
label: interpolate(labelTemplate, { pageSize: size }),
|
|
69
|
+
value: String(size),
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const nvPaginationtableCss = () => `nv-paginationtable{display:flex;align-items:center;color:var(--color-content-medium-text);gap:var(--pagination-table-gap-x);user-select:none;font-size:var(--pagination-table-font-size);font-weight:400}nv-paginationtable nv-fieldselect .select-wrapper .select-container{border-color:transparent}nv-paginationtable nv-fieldselect .select-wrapper .select-container select{font-size:var(--pagination-table-font-size);font-weight:400;color:var(--color-content-medium-text)}`;
|
|
74
|
+
|
|
75
|
+
const NvPaginationtable = class {
|
|
76
|
+
constructor(hostRef) {
|
|
77
|
+
index.registerInstance(this, hostRef);
|
|
78
|
+
this.pageIndexChanged = index.createEvent(this, "pageIndexChanged", 3);
|
|
79
|
+
this.pageSizeChanged = index.createEvent(this, "pageSizeChanged", 3);
|
|
80
|
+
/****************************************************************************/
|
|
81
|
+
//#region PROPERTIES
|
|
82
|
+
/**
|
|
83
|
+
* Indicates which page of table results is currently being shown, using a
|
|
84
|
+
* zero-based index.
|
|
85
|
+
*/
|
|
86
|
+
this.pageIndex = 0;
|
|
87
|
+
/**
|
|
88
|
+
* Sets how many results appear at once before moving to the next page.
|
|
89
|
+
*/
|
|
90
|
+
this.pageSize = 10;
|
|
91
|
+
/**
|
|
92
|
+
* Total number of pages available.
|
|
93
|
+
*/
|
|
94
|
+
this.pageCount = 0;
|
|
95
|
+
/**
|
|
96
|
+
* Total number of rows in the dataset.
|
|
97
|
+
*/
|
|
98
|
+
this.rowCount = 0;
|
|
99
|
+
/**
|
|
100
|
+
* Hides all arrow navigation controls when set to true.
|
|
101
|
+
* By default, all controls are visible.
|
|
102
|
+
*/
|
|
103
|
+
this.hideControls = false;
|
|
104
|
+
/**
|
|
105
|
+
* Hides the previous/next arrow controls when set to true.
|
|
106
|
+
*/
|
|
107
|
+
this.hidePrevNext = false;
|
|
108
|
+
/**
|
|
109
|
+
* Hides the first/last arrow controls when set to true.
|
|
110
|
+
*/
|
|
111
|
+
this.hideFirstLast = false;
|
|
112
|
+
/**
|
|
113
|
+
* Label template for the page indicator.
|
|
114
|
+
* Supports placeholders: {pageIndex}, {pageCount}.
|
|
115
|
+
* Note: {pageIndex} is displayed as 1-based to users (internally 0-based).
|
|
116
|
+
* @example 'Page {pageIndex} of {pageCount}' → 'Page 1 of 14'
|
|
117
|
+
*/
|
|
118
|
+
this.labelPage = 'Page {pageIndex} of {pageCount}';
|
|
119
|
+
/**
|
|
120
|
+
* Label template for the total row count display.
|
|
121
|
+
* Supports placeholder: {rowCount}.
|
|
122
|
+
* @example 'Total: {rowCount} rows' → 'Total: 254 rows'
|
|
123
|
+
*/
|
|
124
|
+
this.labelTotal = 'Total: {rowCount} rows';
|
|
125
|
+
/**
|
|
126
|
+
* Label template for the page size dropdown options.
|
|
127
|
+
* Supports placeholder: {pageSize}.
|
|
128
|
+
* @example '{pageSize} per page' → '10 per page'
|
|
129
|
+
*/
|
|
130
|
+
this.labelPageSizeOption = '{pageSize} per page';
|
|
131
|
+
/**
|
|
132
|
+
* Handles the page size change from the dropdown.
|
|
133
|
+
* @param {CustomEvent<string>} event - The value changed event from nv-fieldselect.
|
|
134
|
+
*/
|
|
135
|
+
this.handlePageSizeChange = (event) => {
|
|
136
|
+
const newSize = Number(event.detail);
|
|
137
|
+
if (newSize > 0) {
|
|
138
|
+
this.pageSize = newSize;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//#endregion PROPERTIES
|
|
143
|
+
/****************************************************************************/
|
|
144
|
+
//#region METHODS
|
|
145
|
+
/**
|
|
146
|
+
* Navigates to the first page.
|
|
147
|
+
*/
|
|
148
|
+
async firstPage() {
|
|
149
|
+
this.pageIndex = 0;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Navigates to the previous page.
|
|
153
|
+
*/
|
|
154
|
+
async previousPage() {
|
|
155
|
+
if (this.pageIndex > 0) {
|
|
156
|
+
this.pageIndex = this.pageIndex - 1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Navigates to the next page.
|
|
161
|
+
*/
|
|
162
|
+
async nextPage() {
|
|
163
|
+
if (this.pageIndex < this.pageCount - 1) {
|
|
164
|
+
this.pageIndex = this.pageIndex + 1;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Navigates to the last page.
|
|
169
|
+
*/
|
|
170
|
+
async lastPage() {
|
|
171
|
+
this.pageIndex = this.pageCount - 1;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Navigates to a specific page by index.
|
|
175
|
+
* @param {number} index The zero-based page index to navigate to.
|
|
176
|
+
*/
|
|
177
|
+
async setPageIndex(index) {
|
|
178
|
+
if (index >= 0 && index < this.pageCount) {
|
|
179
|
+
this.pageIndex = index;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Changes the number of rows displayed per page.
|
|
184
|
+
* @param {number} size The new page size.
|
|
185
|
+
*/
|
|
186
|
+
async setPageSize(size) {
|
|
187
|
+
if (size > 0) {
|
|
188
|
+
this.pageSize = size;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//#endregion METHODS
|
|
192
|
+
/****************************************************************************/
|
|
193
|
+
//#region WATCHERS
|
|
194
|
+
/**
|
|
195
|
+
* Watches for changes to pageIndex and emits the pageIndexChanged event.
|
|
196
|
+
* @param {number} newValue The new page index value.
|
|
197
|
+
*/
|
|
198
|
+
onPageIndexChange(newValue) {
|
|
199
|
+
this.pageIndexChanged.emit(newValue);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Watches for changes to pageSize and emits the pageSizeChanged event.
|
|
203
|
+
* @param {number} newValue The new page size value.
|
|
204
|
+
*/
|
|
205
|
+
onPageSizeChange(newValue) {
|
|
206
|
+
this.pageSizeChanged.emit(newValue);
|
|
207
|
+
}
|
|
208
|
+
//#endregion EVENTS
|
|
209
|
+
/****************************************************************************/
|
|
210
|
+
//#region RENDER
|
|
211
|
+
render() {
|
|
212
|
+
const atFirstPage = isFirstPage(this.pageIndex);
|
|
213
|
+
const atLastPage = isLastPage(this.pageIndex, this.pageCount);
|
|
214
|
+
// Use fallback values to handle undefined props (can happen when frameworks pass undefined explicitly)
|
|
215
|
+
const pageLabel = interpolate(this.labelPage, { pageIndex: this.pageIndex + 1, pageCount: this.pageCount }, 'Page {pageIndex} of {pageCount}');
|
|
216
|
+
const totalLabel = interpolate(this.labelTotal, { rowCount: this.rowCount }, 'Total: {rowCount} rows');
|
|
217
|
+
const pageSizeOptions = generatePageSizeOptions(this.labelPageSizeOption ?? '{pageSize} per page');
|
|
218
|
+
return (index.h(index.Host, { key: '1c032ac283f0b259804d05df2d82c496a4ba2590' }, !this.hideControls && (index.h("div", { key: '3d1bdf1d99583a1dfeef2c9b2f8d120862e5f771', "data-scope": "controls" }, !this.hideFirstLast && (index.h("nv-iconbutton", { key: '353464b98b5af27b9932f7ada5358a5fe3886ca5', name: "chevrons-left", emphasis: "lower", size: "sm", disabled: atFirstPage, onClick: () => this.firstPage() })), !this.hidePrevNext && (index.h("nv-iconbutton", { key: '3196094e7ccff072e292c4e7ba7fe1d23d9a74f9', name: "chevron-left", emphasis: "lower", size: "sm", disabled: atFirstPage, onClick: () => this.previousPage() })), !this.hidePrevNext && (index.h("nv-iconbutton", { key: 'c9a82233745d41c812ba9d18ac133e54dd183435', name: "chevron-right", emphasis: "lower", size: "sm", disabled: atLastPage, onClick: () => this.nextPage() })), !this.hideFirstLast && (index.h("nv-iconbutton", { key: '649b89169098230931ec30f205548104342e4d8c', name: "chevrons-right", emphasis: "lower", size: "sm", disabled: atLastPage, onClick: () => this.lastPage() })))), index.h("span", { key: '3e1311af13227e797ad6914ab70274e554a2f8b2', "data-scope": "page-label" }, pageLabel), index.h("span", { key: '63d020bd24a353d47dc3097146b2afd9b31de612', "data-scope": "total" }, totalLabel), index.h("div", { key: '046597be91d6d83551557592aedb799e3d86da4c', "data-scope": "per-page" }, index.h("nv-fieldselect", { key: '8d661cb40826a34d323d07bb994b5019eb0127fc', value: String(this.pageSize), onValueChanged: this.handlePageSizeChange, options: pageSizeOptions })), index.h("slot", { key: '385e77f742cb4501d26706b08986825d817fd725' })));
|
|
219
|
+
}
|
|
220
|
+
static get watchers() { return {
|
|
221
|
+
"pageIndex": [{
|
|
222
|
+
"onPageIndexChange": 0
|
|
223
|
+
}],
|
|
224
|
+
"pageSize": [{
|
|
225
|
+
"onPageSizeChange": 0
|
|
226
|
+
}]
|
|
227
|
+
}; }
|
|
228
|
+
};
|
|
229
|
+
NvPaginationtable.style = nvPaginationtableCss();
|
|
230
|
+
|
|
231
|
+
exports.nv_paginationtable = NvPaginationtable;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
4
|
var fade_animationDcRL9lcm = require('./fade.animation-DcRL9lcm-DAZeHoKN.js');
|
|
5
|
-
var
|
|
5
|
+
var grow_animationD7ep_aVl = require('./grow.animation-D7ep_aVl-BuXEDSK-.js');
|
|
6
6
|
require('./style-value-types.es-xlgmw4x8-B1vLqX9m.js');
|
|
7
|
+
var events_utilsB6GgGra_ = require('./events.utils-B6GgGra--01N__3wY.js');
|
|
8
|
+
var dom_utilsCuXVGECR = require('./dom.utils-CuXVGECR-8VY5SfMZ.js');
|
|
7
9
|
require('@stencil/react-output-target/runtime');
|
|
8
10
|
require('react');
|
|
9
11
|
require('react-dom');
|
|
@@ -1379,12 +1381,13 @@ const computePosition = (reference, floating, options) => {
|
|
|
1379
1381
|
};
|
|
1380
1382
|
|
|
1381
1383
|
const appendToMap = (map, propName, value) => {
|
|
1382
|
-
|
|
1383
|
-
if (!
|
|
1384
|
-
|
|
1384
|
+
let refs = map.get(propName);
|
|
1385
|
+
if (!refs) {
|
|
1386
|
+
refs = [];
|
|
1387
|
+
map.set(propName, refs);
|
|
1385
1388
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1389
|
+
if (!refs.some((ref) => ref.deref() === value)) {
|
|
1390
|
+
refs.push(new WeakRef(value));
|
|
1388
1391
|
}
|
|
1389
1392
|
};
|
|
1390
1393
|
const debounce = (fn, ms) => {
|
|
@@ -1412,33 +1415,54 @@ const debounce = (fn, ms) => {
|
|
|
1412
1415
|
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
1413
1416
|
const cleanupElements = debounce((map) => {
|
|
1414
1417
|
for (let key of map.keys()) {
|
|
1415
|
-
|
|
1418
|
+
const refs = map.get(key).filter((ref) => {
|
|
1419
|
+
const elm = ref.deref();
|
|
1420
|
+
return elm && isConnected(elm);
|
|
1421
|
+
});
|
|
1422
|
+
map.set(key, refs);
|
|
1416
1423
|
}
|
|
1417
1424
|
}, 2_000);
|
|
1425
|
+
const core = index.StencilCore;
|
|
1426
|
+
const forceUpdate = core.forceUpdate;
|
|
1427
|
+
const getRenderingRef = core.getRenderingRef;
|
|
1418
1428
|
const stencilSubscription = () => {
|
|
1419
|
-
if (typeof
|
|
1429
|
+
if (typeof getRenderingRef !== 'function' || typeof forceUpdate !== 'function') {
|
|
1420
1430
|
// If we are not in a stencil project, we do nothing.
|
|
1421
1431
|
// This function is not really exported by @stencil/core.
|
|
1422
1432
|
return {};
|
|
1423
1433
|
}
|
|
1434
|
+
const ensureForceUpdate = forceUpdate;
|
|
1435
|
+
const ensureGetRenderingRef = getRenderingRef;
|
|
1424
1436
|
const elmsToUpdate = new Map();
|
|
1425
1437
|
return {
|
|
1426
1438
|
dispose: () => elmsToUpdate.clear(),
|
|
1427
1439
|
get: (propName) => {
|
|
1428
|
-
const elm =
|
|
1440
|
+
const elm = ensureGetRenderingRef();
|
|
1429
1441
|
if (elm) {
|
|
1430
1442
|
appendToMap(elmsToUpdate, propName, elm);
|
|
1431
1443
|
}
|
|
1432
1444
|
},
|
|
1433
1445
|
set: (propName) => {
|
|
1434
|
-
const
|
|
1435
|
-
if (
|
|
1436
|
-
|
|
1446
|
+
const refs = elmsToUpdate.get(propName);
|
|
1447
|
+
if (refs) {
|
|
1448
|
+
const nextRefs = refs.filter((ref) => {
|
|
1449
|
+
const elm = ref.deref();
|
|
1450
|
+
if (!elm)
|
|
1451
|
+
return false;
|
|
1452
|
+
return ensureForceUpdate(elm);
|
|
1453
|
+
});
|
|
1454
|
+
elmsToUpdate.set(propName, nextRefs);
|
|
1437
1455
|
}
|
|
1438
1456
|
cleanupElements(elmsToUpdate);
|
|
1439
1457
|
},
|
|
1440
1458
|
reset: () => {
|
|
1441
|
-
elmsToUpdate.forEach((
|
|
1459
|
+
elmsToUpdate.forEach((refs) => {
|
|
1460
|
+
refs.forEach((ref) => {
|
|
1461
|
+
const elm = ref.deref();
|
|
1462
|
+
if (elm)
|
|
1463
|
+
ensureForceUpdate(elm);
|
|
1464
|
+
});
|
|
1465
|
+
});
|
|
1442
1466
|
cleanupElements(elmsToUpdate);
|
|
1443
1467
|
},
|
|
1444
1468
|
};
|
|
@@ -1446,8 +1470,11 @@ const stencilSubscription = () => {
|
|
|
1446
1470
|
|
|
1447
1471
|
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
|
1448
1472
|
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1473
|
+
const resolveDefaultState = () => (unwrap(defaultState) ?? {});
|
|
1474
|
+
const initialState = resolveDefaultState();
|
|
1475
|
+
let states = new Map(Object.entries(initialState));
|
|
1476
|
+
const proxyAvailable = typeof Proxy !== 'undefined';
|
|
1477
|
+
const plainState = proxyAvailable ? null : {};
|
|
1451
1478
|
const handlers = {
|
|
1452
1479
|
dispose: [],
|
|
1453
1480
|
get: [],
|
|
@@ -1459,7 +1486,10 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
|
|
|
1459
1486
|
const reset = () => {
|
|
1460
1487
|
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
|
1461
1488
|
// otherwise, the state won't be properly reset
|
|
1462
|
-
states = new Map(Object.entries(
|
|
1489
|
+
states = new Map(Object.entries(resolveDefaultState()));
|
|
1490
|
+
if (!proxyAvailable) {
|
|
1491
|
+
syncPlainStateKeys();
|
|
1492
|
+
}
|
|
1463
1493
|
handlers.reset.forEach((cb) => cb());
|
|
1464
1494
|
};
|
|
1465
1495
|
const dispose = () => {
|
|
@@ -1476,12 +1506,14 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
|
|
|
1476
1506
|
const oldValue = states.get(propName);
|
|
1477
1507
|
if (shouldUpdate(value, oldValue, propName)) {
|
|
1478
1508
|
states.set(propName, value);
|
|
1509
|
+
if (!proxyAvailable) {
|
|
1510
|
+
ensurePlainProperty(propName);
|
|
1511
|
+
}
|
|
1479
1512
|
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
1480
1513
|
}
|
|
1481
1514
|
};
|
|
1482
|
-
const state = (
|
|
1483
|
-
? {
|
|
1484
|
-
: new Proxy(unwrappedState, {
|
|
1515
|
+
const state = (proxyAvailable
|
|
1516
|
+
? new Proxy(initialState, {
|
|
1485
1517
|
get(_, propName) {
|
|
1486
1518
|
return get(propName);
|
|
1487
1519
|
},
|
|
@@ -1501,7 +1533,11 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
|
|
|
1501
1533
|
set(propName, value);
|
|
1502
1534
|
return true;
|
|
1503
1535
|
},
|
|
1504
|
-
})
|
|
1536
|
+
})
|
|
1537
|
+
: (() => {
|
|
1538
|
+
syncPlainStateKeys();
|
|
1539
|
+
return plainState;
|
|
1540
|
+
})());
|
|
1505
1541
|
const on = (eventName, callback) => {
|
|
1506
1542
|
handlers[eventName].push(callback);
|
|
1507
1543
|
return () => {
|
|
@@ -1514,7 +1550,10 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
|
|
|
1514
1550
|
cb(newValue);
|
|
1515
1551
|
}
|
|
1516
1552
|
};
|
|
1517
|
-
const resetHandler = () =>
|
|
1553
|
+
const resetHandler = () => {
|
|
1554
|
+
const snapshot = resolveDefaultState();
|
|
1555
|
+
cb(snapshot[propName]);
|
|
1556
|
+
};
|
|
1518
1557
|
// Register the handlers
|
|
1519
1558
|
const unSet = on('set', setHandler);
|
|
1520
1559
|
const unReset = on('reset', resetHandler);
|
|
@@ -1557,6 +1596,38 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
|
|
|
1557
1596
|
changeListeners.delete(listener);
|
|
1558
1597
|
}
|
|
1559
1598
|
};
|
|
1599
|
+
function ensurePlainProperty(key) {
|
|
1600
|
+
if (proxyAvailable || !plainState) {
|
|
1601
|
+
return;
|
|
1602
|
+
}
|
|
1603
|
+
if (Object.prototype.hasOwnProperty.call(plainState, key)) {
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
Object.defineProperty(plainState, key, {
|
|
1607
|
+
configurable: true,
|
|
1608
|
+
enumerable: true,
|
|
1609
|
+
get() {
|
|
1610
|
+
return get(key);
|
|
1611
|
+
},
|
|
1612
|
+
set(value) {
|
|
1613
|
+
set(key, value);
|
|
1614
|
+
},
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
function syncPlainStateKeys() {
|
|
1618
|
+
if (proxyAvailable || !plainState) {
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
const knownKeys = new Set(states.keys());
|
|
1622
|
+
for (const key of Object.keys(plainState)) {
|
|
1623
|
+
if (!knownKeys.has(key)) {
|
|
1624
|
+
delete plainState[key];
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
for (const key of knownKeys) {
|
|
1628
|
+
ensurePlainProperty(key);
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1560
1631
|
return {
|
|
1561
1632
|
state,
|
|
1562
1633
|
get,
|
|
@@ -1584,7 +1655,7 @@ const createStore = (defaultState, shouldUpdate) => {
|
|
|
1584
1655
|
return map;
|
|
1585
1656
|
};
|
|
1586
1657
|
|
|
1587
|
-
const nvPopoverCss =
|
|
1658
|
+
const nvPopoverCss = () => `nv-popover{display:inline-block;position:relative}nv-popover:has([fluid]:not([fluid=false])){display:block}nv-popover[strategy=fixed]{position:static}nv-popover>[data-scope=popover]{width:max-content;background-color:var(--components-popover-background);border-color:var(--components-popover-border);font-weight:var(--font-weight-medium-emphasis);border-width:1px;border-style:solid;border-radius:var(--popover-radius);padding:var(--popover-padding-y) var(--popover-padding-x);position:absolute;top:0;left:0;z-index:1;box-shadow:var(--popover-shadow-1-x) var(--popover-shadow-1-y) var(--popover-shadow-1-blur) -2px var(--popover-shadow-1-opacity), var(--popover-shadow-2-x) var(--popover-shadow-2-y) var(--popover-shadow-2-blur) var(--shadow-spread-lg-2) var(--popover-shadow-2-opacity)}nv-popover>[data-scope=popover][hidden]:not([hidden=false]){display:none}nv-popover>[data-scope=popover][data-strategy=fixed]{position:fixed;z-index:9999}nv-popover>[data-scope=popover]>[data-scope=arrow]{background-color:var(--components-popover-background);position:absolute;border-color:var(--components-popover-border);border-width:1px;border-style:solid;border-bottom-color:transparent;border-right-color:transparent;width:8px;height:8px;transform:rotate(45deg);border-radius:1px}nv-popover>[data-scope=popover]>[slot=content]{position:relative;z-index:1}nv-popover>slot-fb{display:none}`;
|
|
1588
1659
|
|
|
1589
1660
|
const { state } = createStore({
|
|
1590
1661
|
groups: new Map(),
|
|
@@ -1699,11 +1770,10 @@ const NvPopover = class {
|
|
|
1699
1770
|
* @param {MouseEvent | TouchEvent} event - The event object.
|
|
1700
1771
|
*/
|
|
1701
1772
|
this.handleClickOutside = (event) => {
|
|
1702
|
-
var _a;
|
|
1703
1773
|
// This popover should close when the user clicks outside of it.
|
|
1704
1774
|
if (this.el.contains(event.target))
|
|
1705
1775
|
return;
|
|
1706
|
-
if (
|
|
1776
|
+
if (this.triggerElement?.contains(event.target))
|
|
1707
1777
|
return;
|
|
1708
1778
|
this.open = false;
|
|
1709
1779
|
};
|
|
@@ -1743,14 +1813,14 @@ const NvPopover = class {
|
|
|
1743
1813
|
*/
|
|
1744
1814
|
attachEventListeners() {
|
|
1745
1815
|
if (this.triggerElement && !this.eventsAttached) {
|
|
1746
|
-
|
|
1816
|
+
events_utilsB6GgGra_.addEventListeners(this.closeEvents, document, this);
|
|
1747
1817
|
if (this.triggerMode === 'click') {
|
|
1748
|
-
|
|
1818
|
+
events_utilsB6GgGra_.addEventListeners(this.clickEvents, this.triggerElement, this);
|
|
1749
1819
|
// Add document click and touch listeners
|
|
1750
|
-
|
|
1820
|
+
events_utilsB6GgGra_.addEventListeners(this.outsideClickEvents, document, this);
|
|
1751
1821
|
}
|
|
1752
1822
|
if (this.triggerMode === 'hover') {
|
|
1753
|
-
|
|
1823
|
+
events_utilsB6GgGra_.addEventListeners(this.hoverEvents, this.triggerElement, this);
|
|
1754
1824
|
}
|
|
1755
1825
|
this.eventsAttached = true;
|
|
1756
1826
|
}
|
|
@@ -1762,7 +1832,7 @@ const NvPopover = class {
|
|
|
1762
1832
|
positionPopover() {
|
|
1763
1833
|
if (!this.triggerElement)
|
|
1764
1834
|
return;
|
|
1765
|
-
computePosition(this.triggerElement, this.popoverElement, {
|
|
1835
|
+
computePosition(dom_utilsCuXVGECR.asElement(this.triggerElement), this.popoverElement, {
|
|
1766
1836
|
placement: this.placement,
|
|
1767
1837
|
strategy: this.strategy,
|
|
1768
1838
|
middleware: [
|
|
@@ -1825,7 +1895,7 @@ const NvPopover = class {
|
|
|
1825
1895
|
state.groups.delete(this.groupName);
|
|
1826
1896
|
if (this.groupName && open)
|
|
1827
1897
|
state.groups.set(this.groupName, { openedBy: this.el });
|
|
1828
|
-
const { growIn } =
|
|
1898
|
+
const { growIn } = grow_animationD7ep_aVl.useGrow(this.popoverElement, {
|
|
1829
1899
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1830
1900
|
amount: 0.85,
|
|
1831
1901
|
});
|
|
@@ -1852,17 +1922,16 @@ const NvPopover = class {
|
|
|
1852
1922
|
//#endregion WATCHERS
|
|
1853
1923
|
/****************************************************************************/
|
|
1854
1924
|
//#region LIFECYCLE
|
|
1855
|
-
|
|
1856
|
-
if (!this.triggerElement)
|
|
1857
|
-
this.triggerElement =
|
|
1858
|
-
|
|
1859
|
-
componentWillUpdate() {
|
|
1925
|
+
componentWillRender() {
|
|
1926
|
+
if (!this.triggerElement) {
|
|
1927
|
+
this.triggerElement = this.el.querySelector('[slot="trigger"]');
|
|
1928
|
+
}
|
|
1860
1929
|
this.attachEventListeners();
|
|
1861
1930
|
}
|
|
1862
1931
|
componentDidLoad() {
|
|
1863
1932
|
// Initial inline style setup
|
|
1864
1933
|
if (!this.open) {
|
|
1865
|
-
const { setGrowOut } =
|
|
1934
|
+
const { setGrowOut } = grow_animationD7ep_aVl.useGrow(this.popoverElement);
|
|
1866
1935
|
setGrowOut();
|
|
1867
1936
|
}
|
|
1868
1937
|
else {
|
|
@@ -1871,17 +1940,16 @@ const NvPopover = class {
|
|
|
1871
1940
|
this.popoverElement.removeAttribute('hidden');
|
|
1872
1941
|
}
|
|
1873
1942
|
this.positionPopover();
|
|
1874
|
-
this.attachEventListeners();
|
|
1875
1943
|
}
|
|
1876
1944
|
disconnectedCallback() {
|
|
1877
|
-
|
|
1945
|
+
events_utilsB6GgGra_.removeEventListeners(this.closeEvents, document, this);
|
|
1878
1946
|
if (this.triggerMode === 'click') {
|
|
1879
|
-
|
|
1947
|
+
events_utilsB6GgGra_.removeEventListeners(this.clickEvents, this.triggerElement, this);
|
|
1880
1948
|
// Remove document listeners
|
|
1881
|
-
|
|
1949
|
+
events_utilsB6GgGra_.removeEventListeners(this.outsideClickEvents, document, this);
|
|
1882
1950
|
}
|
|
1883
1951
|
if (this.triggerMode === 'hover')
|
|
1884
|
-
|
|
1952
|
+
events_utilsB6GgGra_.removeEventListeners(this.hoverEvents, this.triggerElement, this);
|
|
1885
1953
|
// Reset flag so events can be reattached if component is reconnected
|
|
1886
1954
|
this.eventsAttached = false;
|
|
1887
1955
|
// Clean up any pending timeouts
|
|
@@ -1894,14 +1962,18 @@ const NvPopover = class {
|
|
|
1894
1962
|
/****************************************************************************/
|
|
1895
1963
|
//#region RENDER
|
|
1896
1964
|
render() {
|
|
1897
|
-
return (index.h(index.Host, { key: '
|
|
1965
|
+
return (index.h(index.Host, { key: 'd6fef7eff8bcf37038c615eb3a382c2213b8df57' }, index.h("slot", { key: '849d6563e00d899fe0d1740139e510f5a53a6160', name: "trigger" }), index.h("div", { key: '3d187af80792aa571039fa5966cc5a38ad65c447', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: 'cc06755e1ffe17280d847ec78f760fb87e491bea', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: '015e92df5937b852b5e9fe4ef5bbf56a4a21e802', name: "content" }))));
|
|
1898
1966
|
}
|
|
1899
1967
|
get el() { return index.getElement(this); }
|
|
1900
1968
|
static get watchers() { return {
|
|
1901
|
-
"open": [
|
|
1902
|
-
|
|
1969
|
+
"open": [{
|
|
1970
|
+
"handleOpenChange": 0
|
|
1971
|
+
}],
|
|
1972
|
+
"strategy": [{
|
|
1973
|
+
"handleStrategyChange": 0
|
|
1974
|
+
}]
|
|
1903
1975
|
}; }
|
|
1904
1976
|
};
|
|
1905
|
-
NvPopover.style = nvPopoverCss;
|
|
1977
|
+
NvPopover.style = nvPopoverCss();
|
|
1906
1978
|
|
|
1907
1979
|
exports.nv_popover = NvPopover;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
|
+
require('@stencil/react-output-target/runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
|
|
8
|
+
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)}`;
|
|
9
|
+
|
|
10
|
+
const NvRow = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
}
|
|
14
|
+
/****************************************************************************/
|
|
15
|
+
//#region RENDER
|
|
16
|
+
render() {
|
|
17
|
+
return (index.h(index.Host, { key: 'a0f1533d6bec697a7a1abed6444b7be7d4141000' }, index.h("slot", { key: '76b28afb465d755f85e7b297b13aaed00cd65a9e' })));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
NvRow.style = nvRowCss();
|
|
21
|
+
|
|
22
|
+
exports.nv_row = NvRow;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
7
7
|
|
|
8
|
-
const nvSidebarCss =
|
|
8
|
+
const nvSidebarCss = () => `nv-sidebarnavitem a,nv-sidebarnavitem a:link,nv-sidebarnavitem a:visited,nv-sidebarnavitem a:hover,nv-sidebarnavitem a:active,nv-sidebarnavsubitem a,nv-sidebarnavsubitem a:link,nv-sidebarnavsubitem a:visited,nv-sidebarnavsubitem a:hover,nv-sidebarnavsubitem a:active{color:inherit !important;text-decoration:none !important}nv-sidebar{display:flex;flex-direction:column;position:relative;height:100vh;background-color:var(--components-sidebar-background);border-right:var(--sidebar-divider-size) solid var(--components-sidebar-border);transition:width 0.3s ease;width:var(--sidebar-width)}nv-sidebar[collapsed]{width:var(--sidebar-width-collapsed)}nv-sidebar[collapsed] [data-hide-on-collapsed]{display:none !important}nv-sidebar[collapsed] .nv-sidebar-container{padding:var(--sidebar-padding-y) var(--sidebar-padding-x-collapsed)}nv-sidebar .nv-sidebar-container{display:flex;flex-direction:column;flex:1;overflow:hidden;padding:var(--sidebar-padding-y) var(--sidebar-padding-x);gap:var(--sidebar-gap-y)}nv-sidebar .nv-sidebar-toggle{position:absolute;top:var(--sidebar-collapsible-button-position-top);right:calc(-1 * var(--sidebar-collapsible-button-position-right));display:flex;align-items:center;justify-content:center;padding:var(--sidebar-collapsible-button-padding);background-color:var(--components-sidebar-background);border:1px solid var(--color-content-low-border);border-radius:var(--radius-rounded-full);cursor:pointer;transition:transform 0.2s ease;z-index:10}nv-sidebar .nv-sidebar-toggle:hover{background-color:var(--color-interaction-container-neutral-background-hover)}nv-sidebar .nv-sidebar-toggle:focus,nv-sidebar .nv-sidebar-toggle:focus-within{outline:none}nv-sidebar .nv-sidebar-toggle:focus-visible,nv-sidebar .nv-sidebar-toggle:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-sidebar .nv-sidebar-toggle nv-icon{width:var(--sidebar-collapsible-button-icon-size);height:var(--sidebar-collapsible-button-icon-size);color:var(--color-interaction-container-neutral-icon)}nv-sidebar .nv-sidebar-toggle nv-icon:hover{color:var(--color-interaction-container-neutral-icon-hover)}`;
|
|
9
9
|
|
|
10
10
|
const NvSidebar = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -55,7 +55,7 @@ const NvSidebar = class {
|
|
|
55
55
|
const activeSubitemHrefs = new Set();
|
|
56
56
|
this.el.querySelectorAll('nv-sidebarnavsubitem').forEach(subItem => {
|
|
57
57
|
const link = subItem.querySelector('a');
|
|
58
|
-
const href = link
|
|
58
|
+
const href = link?.getAttribute('href');
|
|
59
59
|
if (href) {
|
|
60
60
|
const isActive = this.activePath === href;
|
|
61
61
|
subItem.active = isActive;
|
|
@@ -69,7 +69,7 @@ const NvSidebar = class {
|
|
|
69
69
|
// 2. OR the navitem has no subitems and activePath starts with its href
|
|
70
70
|
this.el.querySelectorAll('nv-sidebarnavitem').forEach(navItem => {
|
|
71
71
|
const link = navItem.querySelector(':scope > a, :scope > .nv-sidebarnavitem-trigger a, .nv-sidebarnavitem-content > a');
|
|
72
|
-
const href = link
|
|
72
|
+
const href = link?.getAttribute('href');
|
|
73
73
|
const hasSubitems = navItem.querySelector('nv-sidebarnavsubitem') !== null;
|
|
74
74
|
if (href) {
|
|
75
75
|
if (hasSubitems) {
|
|
@@ -162,16 +162,20 @@ const NvSidebar = class {
|
|
|
162
162
|
//#region RENDER
|
|
163
163
|
render() {
|
|
164
164
|
const isCollapsed = this.type === 'collapsible' && !this.open;
|
|
165
|
-
return (index.h(index.Host, { key: '
|
|
165
|
+
return (index.h(index.Host, { key: 'b186709db49756c2cbc7266ef9dfb1cdaf63c9bd', role: "navigation", collapsed: isCollapsed ? true : undefined, "notification-intention": this.notificationIntention, "notification-emphasis": this.notificationEmphasis, "aria-expanded": this.type === 'collapsible' ? String(this.open) : undefined }, index.h("div", { key: '9b415f173b9097aceda8619b061d9e7533030e57', class: "nv-sidebar-container" }, index.h("slot", { key: 'e60dbe6ea59f72caab1d519bf0a84afe9a9f0829' })), this.type === 'collapsible' && (index.h("button", { key: 'cc63ad46951876de82efccef404366a04393bb4b', class: "nv-sidebar-toggle", onClick: this.handleToggle, "aria-label": this.open ? 'Collapse sidebar' : 'Expand sidebar' }, index.h("nv-icon", { key: '7f44dbfe4e1b351c789ea558e735b9da00b03e19', name: this.open
|
|
166
166
|
? 'layout-sidebar-left-collapse'
|
|
167
167
|
: 'layout-sidebar-right-collapse', size: "sm" })))));
|
|
168
168
|
}
|
|
169
169
|
get el() { return index.getElement(this); }
|
|
170
170
|
static get watchers() { return {
|
|
171
|
-
"activePath": [
|
|
172
|
-
|
|
171
|
+
"activePath": [{
|
|
172
|
+
"onActivePathChanged": 0
|
|
173
|
+
}],
|
|
174
|
+
"open": [{
|
|
175
|
+
"onOpenChanged": 0
|
|
176
|
+
}]
|
|
173
177
|
}; }
|
|
174
178
|
};
|
|
175
|
-
NvSidebar.style = nvSidebarCss;
|
|
179
|
+
NvSidebar.style = nvSidebarCss();
|
|
176
180
|
|
|
177
181
|
exports.nv_sidebar = NvSidebar;
|