@nova-design-system/nova-react 3.29.0 → 3.30.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/dist/cjs/{constants-BReL3Lsa-DpB_ghPF.js → constants-gOKBmbgZ-CSoZ8z-G.js} +5 -0
- package/dist/cjs/generated/components.server.js +33 -1
- package/dist/cjs/index-DXwd3F_r.js +10391 -0
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/{nv-accordion-item.entry-D1o0gC5w.js → nv-accordion-item.entry-CTbduehY.js} +3 -3
- package/dist/cjs/{nv-accordion.entry-DYJtq9Az.js → nv-accordion.entry-DeaPwIUP.js} +2 -2
- package/dist/cjs/{nv-alert.entry-CMtCdHmk.js → nv-alert.entry-B5k8RXXD.js} +8 -8
- package/dist/cjs/{nv-avatar.entry-B6e7aG4W.js → nv-avatar.entry-CJh9bGfN.js} +8 -8
- package/dist/cjs/{nv-badge_2.entry-RD3j0bJM.js → nv-badge_2.entry-BnPPW4rW.js} +5 -5
- package/dist/cjs/{nv-breadcrumb.entry-DgpqY2fr.js → nv-breadcrumb.entry-DS5GJVCJ.js} +2 -2
- package/dist/cjs/{nv-breadcrumbs.entry-CZgcDUw5.js → nv-breadcrumbs.entry-CJ835Ba8.js} +2 -2
- package/dist/cjs/{nv-button.entry-DR9NaRxG.js → nv-button.entry-8U0o_X3d.js} +7 -7
- package/dist/cjs/{nv-buttongroup.entry-qO8r7WqG.js → nv-buttongroup.entry-D5I5d9y0.js} +2 -2
- package/dist/cjs/{nv-calendar.entry-DRlv3Xph.js → nv-calendar.entry-C0ggIM3A.js} +9 -9
- package/dist/cjs/{nv-col.entry-B7utJttP.js → nv-col.entry-tIk723nS.js} +2 -2
- package/dist/cjs/{nv-datagrid.entry-digYmlnA.js → nv-datagrid.entry-Cal_usTi.js} +8 -8
- package/dist/cjs/{nv-datagridcolumn.entry-UwaDi-Hr.js → nv-datagridcolumn.entry-BLbpwW7Q.js} +2 -2
- package/dist/cjs/{nv-datetest.entry-BJtWaM2T.js → nv-datetest.entry-NQzySOox.js} +2 -2
- package/dist/cjs/{nv-datetimetest.entry-WaNPcHxh.js → nv-datetimetest.entry-Br6j4eAR.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-BI_mFT2G.js → nv-dialog.entry-GTDQJaoQ.js} +3 -3
- package/dist/cjs/{nv-dialogfooter_2.entry-DU2ClBUR.js → nv-dialogfooter_2.entry-CHY36NHl.js} +6 -6
- package/dist/cjs/{nv-drawer.entry-BKF4CyOt.js → nv-drawer.entry-C-TZDi4-.js} +3 -3
- package/dist/cjs/{nv-drawerfooter_2.entry-BSyUs7_4.js → nv-drawerfooter_2.entry-DTY4qAnd.js} +6 -6
- package/dist/cjs/{nv-fieldcheckbox.entry-l5FWToQi.js → nv-fieldcheckbox.entry-Qf4gdEnq.js} +5 -5
- package/dist/cjs/{nv-fielddate.entry-BfviesNp.js → nv-fielddate.entry-D1aJmKbh.js} +7 -7
- package/dist/cjs/{nv-fielddaterange.entry-BvDkPLXG.js → nv-fielddaterange.entry-Vc-gHwf8.js} +7 -7
- package/dist/cjs/{nv-fielddropdown.entry-B-nYjuMt.js → nv-fielddropdown.entry-BVVsM71m.js} +5 -5
- package/dist/cjs/{nv-fielddropdownitem.entry-Dxqyb9DN.js → nv-fielddropdownitem.entry-DTRonCZJ.js} +2 -2
- package/dist/cjs/{nv-fieldmultiselect.entry-CgO1RP0W.js → nv-fieldmultiselect.entry-Cvsh_jn7.js} +1 -1
- package/dist/cjs/{nv-fieldnumber.entry-stgdLi7x.js → nv-fieldnumber.entry-jVFZ0wj3.js} +5 -5
- package/dist/cjs/{nv-fieldpassword.entry-CHA3JAUd.js → nv-fieldpassword.entry-CQKbWqMe.js} +5 -5
- package/dist/cjs/{nv-fieldradio.entry-DHavVjB-.js → nv-fieldradio.entry-FPGOqFBo.js} +4 -4
- package/dist/cjs/{nv-fieldselect.entry-Dq5AsOFt.js → nv-fieldselect.entry-DJmW4pff.js} +6 -6
- package/dist/cjs/{nv-fieldslider.entry-SlF3BBUW.js → nv-fieldslider.entry-D71HjSto.js} +4 -4
- package/dist/cjs/{nv-fieldtext.entry-BYCc8SyD.js → nv-fieldtext.entry-BxgbvxEW.js} +5 -5
- package/dist/cjs/{nv-fieldtextarea.entry-96JCOb9L.js → nv-fieldtextarea.entry-BDS37zhJ.js} +4 -4
- package/dist/cjs/{nv-fieldtime.entry-BdzjxkaK.js → nv-fieldtime.entry-DkWokxdT.js} +44 -44
- package/dist/cjs/{nv-icon.entry-CSRxi6BH.js → nv-icon.entry-CUemAv89.js} +8 -8
- package/dist/cjs/{nv-iconbutton_2.entry-BtDxwMFD.js → nv-iconbutton_2.entry-BLdJr3QV.js} +3 -3
- package/dist/cjs/{nv-menu.entry-aX39SPH8.js → nv-menu.entry-z4cDNCeX.js} +2 -2
- package/dist/cjs/{nv-menuitem.entry-DzSp52G2.js → nv-menuitem.entry-4XdONuGl.js} +2 -2
- package/dist/cjs/{nv-notification-bullet.entry-D2yOXj46.js → nv-notification-bullet.entry-B1EK4G_X.js} +1 -1
- package/dist/cjs/{nv-notification.entry-BRXHbtT8.js → nv-notification.entry-BBAQ72f7.js} +19 -19
- package/dist/cjs/{nv-notificationcontainer.entry-YNIM2_ah.js → nv-notificationcontainer.entry-CtFunFA9.js} +2 -2
- package/dist/cjs/{nv-pagination-nav.entry-uY1nT9aT.js → nv-pagination-nav.entry-DbzEBjoa.js} +2 -2
- package/dist/cjs/{nv-paginationtable.entry-mr5KYXVC.js → nv-paginationtable.entry-DRGsk0DH.js} +19 -3
- package/dist/cjs/{nv-popover.entry-_9ARKM70.js → nv-popover.entry-w9o3Y_vT.js} +2 -2
- package/dist/cjs/{nv-row.entry-BMQvcqlU.js → nv-row.entry-Cop4QB1Y.js} +2 -2
- package/dist/cjs/nv-sidebar.entry-96HyTMt9.js +355 -0
- package/dist/cjs/{nv-sidebarcontent.entry-llnRwVuj.js → nv-sidebarcontent.entry-RCkZZp9I.js} +2 -2
- package/dist/cjs/{nv-sidebardivider.entry--rQv8d5T.js → nv-sidebardivider.entry-DY25WqI7.js} +2 -2
- package/dist/cjs/{nv-sidebarfooter.entry-C5R0sUI_.js → nv-sidebarfooter.entry-9BFpNPLP.js} +2 -2
- package/dist/cjs/{nv-sidebargroup.entry-DdrpLbU7.js → nv-sidebargroup.entry-Cj52DXba.js} +2 -2
- package/dist/cjs/{nv-sidebarheader.entry-HuBPIsyf.js → nv-sidebarheader.entry-_WZgNwoi.js} +2 -2
- package/dist/cjs/{nv-sidebarlogo.entry-TZNPoqnA.js → nv-sidebarlogo.entry-4Zy6k3V5.js} +2 -2
- package/dist/cjs/{nv-sidebarnavitem.entry-BWc3mF5I.js → nv-sidebarnavitem.entry-fQ9sqxDj.js} +3 -3
- package/dist/cjs/{nv-sidebarnavsubitem.entry-DekANwO8.js → nv-sidebarnavsubitem.entry-1iBobkME.js} +2 -2
- package/dist/cjs/{nv-split.entry-BOwOB8FW.js → nv-split.entry-Dfzpge0r.js} +2 -2
- package/dist/cjs/{nv-stack.entry-CaTiSLGN.js → nv-stack.entry-BnCput1S.js} +2 -2
- package/dist/cjs/nv-statusindicator.entry-ClPHcTkz.js +42 -0
- package/dist/cjs/{nv-table.entry-LFZaS0Dy.js → nv-table.entry-DsllD6Bz.js} +3 -3
- package/dist/cjs/{nv-tableheader.entry-CK50S8xW.js → nv-tableheader.entry-AWCKrpLj.js} +2 -2
- package/dist/cjs/nv-tag.entry-BwENpoSV.js +85 -0
- package/dist/cjs/{nv-timetest.entry-A9elKwkf.js → nv-timetest.entry-BQsV7Qb2.js} +2 -2
- package/dist/cjs/{nv-toggle.entry-BGu-6rEs.js → nv-toggle.entry-a0tSJ6GE.js} +3 -3
- package/dist/cjs/{nv-togglebutton.entry-BzAcBOgN.js → nv-togglebutton.entry-CT8fZr74.js} +2 -2
- package/dist/cjs/{nv-togglebuttongroup.entry-CIWp7IXc.js → nv-togglebuttongroup.entry-BN7WkQ_L.js} +2 -2
- package/dist/cjs/{nv-tooltip.entry-CoGkSHpv.js → nv-tooltip.entry-xpFqRgZM.js} +2 -2
- package/dist/components/NvDatatable/NvDatatable.js +176 -59
- package/dist/components/NvDatatable/expandState.js +8 -0
- package/dist/components/NvDatatable/expandState.test.js +41 -0
- package/dist/components/NvDatatable/paginationState.js +9 -0
- package/dist/components/NvDatatable/paginationState.test.js +84 -0
- package/dist/generated/components.js +20 -1
- package/dist/generated/components.server.js +31 -1
- package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
- package/dist/types/components/NvDatatable/expandState.d.ts +5 -0
- package/dist/types/components/NvDatatable/expandState.test.d.ts +1 -0
- package/dist/types/components/NvDatatable/paginationState.d.ts +9 -0
- package/dist/types/components/NvDatatable/paginationState.test.d.ts +1 -0
- package/dist/types/components/NvDatatable/types.d.ts +16 -1
- package/dist/types/generated/components.d.ts +12 -1
- package/dist/types/generated/components.server.d.ts +12 -1
- package/package.json +1 -1
- package/dist/cjs/index-DgKzi_Pd.js +0 -10208
- package/dist/cjs/nv-sidebar.entry-C4HTjJmz.js +0 -181
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
|
+
require('@stencil/react-output-target/runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
|
|
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[resizing]{transition:none}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)}nv-sidebar .nv-sidebar-resize-handle{position:absolute;top:0;right:calc(-1 * var(--sidebar-divider-size));width:4px;height:100%;cursor:col-resize;background-color:transparent;transition:background-color 0.15s ease;z-index:9;user-select:none;touch-action:none}nv-sidebar .nv-sidebar-resize-handle:hover,nv-sidebar .nv-sidebar-resize-handle:focus-visible{background-color:var(--color-interaction-container-branded-high-background)}nv-sidebar .nv-sidebar-resize-handle:focus,nv-sidebar .nv-sidebar-resize-handle:focus-within{outline:none}nv-sidebar .nv-sidebar-resize-handle:focus-visible,nv-sidebar .nv-sidebar-resize-handle:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}`;
|
|
9
|
+
|
|
10
|
+
const KEYBOARD_STEP = 8;
|
|
11
|
+
const NvSidebar = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.openChanged = index.createEvent(this, "openChanged", 3);
|
|
15
|
+
this.widthChanged = index.createEvent(this, "widthChanged", 3);
|
|
16
|
+
this.resizeStartX = 0;
|
|
17
|
+
this.resizeStartWidth = 0;
|
|
18
|
+
/****************************************************************************/
|
|
19
|
+
//#region PROPERTIES
|
|
20
|
+
/**
|
|
21
|
+
* The type of sidebar behavior.
|
|
22
|
+
* - collapsible: Can be toggled open/closed
|
|
23
|
+
* - persistent: Always visible
|
|
24
|
+
*/
|
|
25
|
+
this.type = 'persistent';
|
|
26
|
+
/**
|
|
27
|
+
* Whether the sidebar is currently open (only applies to collapsible type).
|
|
28
|
+
*/
|
|
29
|
+
// eslint-disable-next-line @stencil-community/ban-default-true
|
|
30
|
+
this.open = true;
|
|
31
|
+
/**
|
|
32
|
+
* Determines the type of notification bullets in the sidebar.
|
|
33
|
+
* - neutral: Uses neutral colors (gray)
|
|
34
|
+
* - brand: Uses brand colors (orange/teal depending on theme)
|
|
35
|
+
*/
|
|
36
|
+
this.notificationIntention = 'brand';
|
|
37
|
+
/**
|
|
38
|
+
* Determines the emphasis of notification bullets in the sidebar.
|
|
39
|
+
* - high: More prominent appearance
|
|
40
|
+
* - low: Less prominent appearance
|
|
41
|
+
*/
|
|
42
|
+
this.notificationEmphasis = 'high';
|
|
43
|
+
/**
|
|
44
|
+
* When true, the sidebar can be resized horizontally by dragging its right edge.
|
|
45
|
+
* Only active when the sidebar is open (not collapsed).
|
|
46
|
+
*/
|
|
47
|
+
this.resizable = false;
|
|
48
|
+
/**
|
|
49
|
+
* Minimum width in pixels when resizing.
|
|
50
|
+
*/
|
|
51
|
+
this.minWidth = 200;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum width in pixels when resizing.
|
|
54
|
+
*/
|
|
55
|
+
this.maxWidth = 480;
|
|
56
|
+
//#endregion PROPERTIES
|
|
57
|
+
/****************************************************************************/
|
|
58
|
+
//#region STATE
|
|
59
|
+
this.resizing = false;
|
|
60
|
+
//#endregion EVENTS
|
|
61
|
+
/****************************************************************************/
|
|
62
|
+
//#region METHODS
|
|
63
|
+
this.handleToggle = () => {
|
|
64
|
+
if (this.type === 'collapsible') {
|
|
65
|
+
// Changing open will trigger @Watch which emits the event
|
|
66
|
+
this.open = !this.open;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
this.handleResizeStart = (event) => {
|
|
70
|
+
if (event.button !== 0)
|
|
71
|
+
return;
|
|
72
|
+
if (this.resizing)
|
|
73
|
+
return;
|
|
74
|
+
if (!this.canResize())
|
|
75
|
+
return;
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
this.resizing = true;
|
|
78
|
+
this.resizeStartX = event.clientX;
|
|
79
|
+
// clientWidth excludes the border, matching the CSS width that drives `--sidebar-width`
|
|
80
|
+
this.resizeStartWidth = this.el.clientWidth;
|
|
81
|
+
// Pointer capture routes subsequent pointer events to the handle even when
|
|
82
|
+
// the pointer leaves it, so releasing outside the window still fires pointerup
|
|
83
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
84
|
+
};
|
|
85
|
+
this.handleResizeMove = (event) => {
|
|
86
|
+
if (!this.resizing || !this.canResize())
|
|
87
|
+
return;
|
|
88
|
+
const delta = event.clientX - this.resizeStartX;
|
|
89
|
+
this.width = this.clampWidth(this.resizeStartWidth + delta);
|
|
90
|
+
};
|
|
91
|
+
this.handleResizeEnd = (event) => {
|
|
92
|
+
if (!this.resizing)
|
|
93
|
+
return;
|
|
94
|
+
this.releasePointerCapture(event);
|
|
95
|
+
this.resizing = false;
|
|
96
|
+
if (this.width != null) {
|
|
97
|
+
this.widthChanged.emit(this.width);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
this.handleResizeCancel = (event) => {
|
|
101
|
+
// Pointer cancel means the interaction was aborted (browser gesture, system
|
|
102
|
+
// event). Release capture and drop the drag, but do not emit widthChanged
|
|
103
|
+
// since the value was not committed by the user.
|
|
104
|
+
if (!this.resizing)
|
|
105
|
+
return;
|
|
106
|
+
this.releasePointerCapture(event);
|
|
107
|
+
this.resizing = false;
|
|
108
|
+
};
|
|
109
|
+
this.cancelResize = () => {
|
|
110
|
+
if (!this.resizing)
|
|
111
|
+
return;
|
|
112
|
+
this.resizing = false;
|
|
113
|
+
};
|
|
114
|
+
this.handleResizeKeyDown = (event) => {
|
|
115
|
+
if (!this.canResize())
|
|
116
|
+
return;
|
|
117
|
+
const [min, max] = this.getBounds();
|
|
118
|
+
const current = this.width ?? this.el.clientWidth;
|
|
119
|
+
let next = null;
|
|
120
|
+
switch (event.key) {
|
|
121
|
+
case 'ArrowLeft':
|
|
122
|
+
next = current - KEYBOARD_STEP;
|
|
123
|
+
break;
|
|
124
|
+
case 'ArrowRight':
|
|
125
|
+
next = current + KEYBOARD_STEP;
|
|
126
|
+
break;
|
|
127
|
+
case 'Home':
|
|
128
|
+
next = min;
|
|
129
|
+
break;
|
|
130
|
+
case 'End':
|
|
131
|
+
next = max;
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
const currentClamped = this.clampWidth(current);
|
|
138
|
+
const nextClamped = this.clampWidth(next);
|
|
139
|
+
if (nextClamped === currentClamped)
|
|
140
|
+
return;
|
|
141
|
+
this.width = nextClamped;
|
|
142
|
+
this.widthChanged.emit(this.width);
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Sets the active state of navigation items based on activePath
|
|
146
|
+
*/
|
|
147
|
+
this.setActiveNavItems = () => {
|
|
148
|
+
if (!this.activePath)
|
|
149
|
+
return;
|
|
150
|
+
// First, check all subitems to find if any matches exactly
|
|
151
|
+
const activeSubitemHrefs = new Set();
|
|
152
|
+
this.el.querySelectorAll('nv-sidebarnavsubitem').forEach(subItem => {
|
|
153
|
+
const link = subItem.querySelector('a');
|
|
154
|
+
const href = link?.getAttribute('href');
|
|
155
|
+
if (href) {
|
|
156
|
+
const isActive = this.activePath === href;
|
|
157
|
+
subItem.active = isActive;
|
|
158
|
+
if (isActive) {
|
|
159
|
+
activeSubitemHrefs.add(href);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
// Then, set nav items active only if:
|
|
164
|
+
// 1. Exact match with activePath AND no subitem matches
|
|
165
|
+
// 2. OR the navitem has no subitems and activePath starts with its href
|
|
166
|
+
this.el.querySelectorAll('nv-sidebarnavitem').forEach(navItem => {
|
|
167
|
+
const link = navItem.querySelector(':scope > a, :scope > .nv-sidebarnavitem-trigger a, .nv-sidebarnavitem-content > a');
|
|
168
|
+
const href = link?.getAttribute('href');
|
|
169
|
+
const hasSubitems = navItem.querySelector('nv-sidebarnavsubitem') !== null;
|
|
170
|
+
if (href) {
|
|
171
|
+
if (hasSubitems) {
|
|
172
|
+
// Parent with subitems: only active if exact match (not when subitem is active)
|
|
173
|
+
navItem.active = this.activePath === href;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// Item without subitems: active on exact match
|
|
177
|
+
navItem.active = this.activePath === href;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
this.pendingActiveUpdate = null;
|
|
183
|
+
/**
|
|
184
|
+
* Sets up the MutationObserver to watch for changes in child elements.
|
|
185
|
+
* Only triggers on new nav items being added, not on attribute changes.
|
|
186
|
+
*/
|
|
187
|
+
this.setupMutationObserver = () => {
|
|
188
|
+
this.mutationObserver = new MutationObserver(mutations => {
|
|
189
|
+
// Only react to new nav items being added, ignore other mutations
|
|
190
|
+
const hasNewNavItems = mutations.some(mutation => {
|
|
191
|
+
if (mutation.type !== 'childList')
|
|
192
|
+
return false;
|
|
193
|
+
return Array.from(mutation.addedNodes).some(node => {
|
|
194
|
+
if (node.nodeType !== Node.ELEMENT_NODE)
|
|
195
|
+
return false;
|
|
196
|
+
const el = node;
|
|
197
|
+
return (el.tagName.toLowerCase() === 'nv-sidebarnavitem' ||
|
|
198
|
+
el.tagName.toLowerCase() === 'nv-sidebarnavsubitem' ||
|
|
199
|
+
el.querySelector('nv-sidebarnavitem, nv-sidebarnavsubitem'));
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
if (hasNewNavItems) {
|
|
203
|
+
// Debounce to prevent multiple rapid calls
|
|
204
|
+
if (this.pendingActiveUpdate) {
|
|
205
|
+
clearTimeout(this.pendingActiveUpdate);
|
|
206
|
+
}
|
|
207
|
+
this.pendingActiveUpdate = window.setTimeout(() => {
|
|
208
|
+
this.setActiveNavItems();
|
|
209
|
+
this.pendingActiveUpdate = null;
|
|
210
|
+
}, 50);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
this.mutationObserver.observe(this.el, {
|
|
214
|
+
childList: true,
|
|
215
|
+
subtree: true,
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
getBounds() {
|
|
220
|
+
// Fall back to the built-in defaults if a consumer passes a non-finite bound
|
|
221
|
+
const rawMin = Number.isFinite(this.minWidth) ? this.minWidth : 200;
|
|
222
|
+
const rawMax = Number.isFinite(this.maxWidth) ? this.maxWidth : 480;
|
|
223
|
+
return [Math.min(rawMin, rawMax), Math.max(rawMin, rawMax)];
|
|
224
|
+
}
|
|
225
|
+
clampWidth(value) {
|
|
226
|
+
const [min, max] = this.getBounds();
|
|
227
|
+
return Math.round(Math.min(Math.max(value, min), max));
|
|
228
|
+
}
|
|
229
|
+
canResize() {
|
|
230
|
+
return this.resizable && !(this.type === 'collapsible' && !this.open);
|
|
231
|
+
}
|
|
232
|
+
getAriaValueNow() {
|
|
233
|
+
if (this.width != null)
|
|
234
|
+
return this.clampWidth(this.width);
|
|
235
|
+
const [min] = this.getBounds();
|
|
236
|
+
return this.clampWidth(this.el?.clientWidth || min);
|
|
237
|
+
}
|
|
238
|
+
applyWidthStyle() {
|
|
239
|
+
if (this.width == null) {
|
|
240
|
+
this.el.style.removeProperty('--sidebar-width');
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (!Number.isFinite(this.width)) {
|
|
244
|
+
// Guard against NaN/Infinity which would otherwise loop through @Watch('width') forever
|
|
245
|
+
this.width = undefined;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const clamped = this.clampWidth(this.width);
|
|
249
|
+
if (clamped !== this.width) {
|
|
250
|
+
this.width = clamped;
|
|
251
|
+
return; // @Watch('width') will re-enter and apply the clamped value
|
|
252
|
+
}
|
|
253
|
+
this.el.style.setProperty('--sidebar-width', `${clamped}px`);
|
|
254
|
+
}
|
|
255
|
+
releasePointerCapture(event) {
|
|
256
|
+
const target = event.currentTarget;
|
|
257
|
+
if (target?.hasPointerCapture(event.pointerId)) {
|
|
258
|
+
target.releasePointerCapture(event.pointerId);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
handleCollapsedSideEffects(isCollapsed) {
|
|
262
|
+
if (!isCollapsed) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.el.querySelectorAll('nv-sidebarnavitem[open]').forEach(navItem => {
|
|
266
|
+
navItem.open = false;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
//#endregion METHODS
|
|
270
|
+
/****************************************************************************/
|
|
271
|
+
//#region WATCHERS
|
|
272
|
+
onActivePathChanged() {
|
|
273
|
+
this.setActiveNavItems();
|
|
274
|
+
}
|
|
275
|
+
onOpenChanged(newValue, oldValue) {
|
|
276
|
+
this.handleCollapsedSideEffects(this.type === 'collapsible' && !newValue);
|
|
277
|
+
// Cancel any in-progress resize if the sidebar is programmatically collapsed
|
|
278
|
+
if (this.type === 'collapsible' && !newValue) {
|
|
279
|
+
this.cancelResize();
|
|
280
|
+
}
|
|
281
|
+
// Only emit event when open state actually changes (not on re-render with same value)
|
|
282
|
+
if (this.type === 'collapsible' && newValue !== oldValue) {
|
|
283
|
+
this.openChanged.emit(newValue);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
onWidthChanged() {
|
|
287
|
+
this.applyWidthStyle();
|
|
288
|
+
}
|
|
289
|
+
onBoundsChanged() {
|
|
290
|
+
// Re-clamp the current width against the new bounds so visuals and ARIA stay within range
|
|
291
|
+
if (this.width != null) {
|
|
292
|
+
const clamped = this.clampWidth(this.width);
|
|
293
|
+
if (clamped !== this.width) {
|
|
294
|
+
this.width = clamped;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
onResizableChanged(newValue) {
|
|
299
|
+
if (!newValue) {
|
|
300
|
+
this.cancelResize();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
//#endregion WATCHERS
|
|
304
|
+
/****************************************************************************/
|
|
305
|
+
//#region LIFECYCLE
|
|
306
|
+
componentWillLoad() {
|
|
307
|
+
this.setActiveNavItems();
|
|
308
|
+
this.setupMutationObserver();
|
|
309
|
+
this.handleCollapsedSideEffects(this.type === 'collapsible' && !this.open);
|
|
310
|
+
this.applyWidthStyle();
|
|
311
|
+
}
|
|
312
|
+
disconnectedCallback() {
|
|
313
|
+
if (this.mutationObserver) {
|
|
314
|
+
this.mutationObserver.disconnect();
|
|
315
|
+
}
|
|
316
|
+
if (this.pendingActiveUpdate) {
|
|
317
|
+
clearTimeout(this.pendingActiveUpdate);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
//#endregion LIFECYCLE
|
|
321
|
+
/****************************************************************************/
|
|
322
|
+
//#region RENDER
|
|
323
|
+
render() {
|
|
324
|
+
const isCollapsed = this.type === 'collapsible' && !this.open;
|
|
325
|
+
const showResizeHandle = this.resizable && !isCollapsed;
|
|
326
|
+
const [ariaValueMin, ariaValueMax] = this.getBounds();
|
|
327
|
+
return (index.h(index.Host, { key: '24fa9b232e27fe864d6984bf947d9720ffd1804d', role: "navigation", collapsed: isCollapsed ? true : undefined, resizing: this.resizing ? true : undefined, "notification-intention": this.notificationIntention, "notification-emphasis": this.notificationEmphasis, "aria-expanded": this.type === 'collapsible' ? String(this.open) : undefined }, index.h("div", { key: 'c9d15e38ab0b18c34858fca91376439f300e2f61', class: "nv-sidebar-container" }, index.h("slot", { key: 'fe732ec38f8848dfc3516ee2a601d8ceb313b559' })), this.type === 'collapsible' && (index.h("button", { key: '53f9de5d7318cdea02abe6928dda4b488d43e0a8', class: "nv-sidebar-toggle", onClick: this.handleToggle, "aria-label": this.open ? 'Collapse sidebar' : 'Expand sidebar' }, index.h("nv-icon", { key: 'ea42dca24abed9ec5981027b0f5ac5ae9aaa3b1f', name: this.open
|
|
328
|
+
? 'layout-sidebar-left-collapse'
|
|
329
|
+
: 'layout-sidebar-right-collapse', size: "sm" }))), showResizeHandle && (index.h("div", { key: '1f28ce72b3eb61223d708d519761ab9eef182f2e', class: "nv-sidebar-resize-handle", role: "separator", "aria-orientation": "vertical", "aria-label": "Resize sidebar", "aria-valuenow": this.getAriaValueNow(), "aria-valuemin": ariaValueMin, "aria-valuemax": ariaValueMax, tabIndex: 0, onPointerDown: this.handleResizeStart, onPointerMove: this.handleResizeMove, onPointerUp: this.handleResizeEnd, onPointerCancel: this.handleResizeCancel, onKeyDown: this.handleResizeKeyDown }))));
|
|
330
|
+
}
|
|
331
|
+
get el() { return index.getElement(this); }
|
|
332
|
+
static get watchers() { return {
|
|
333
|
+
"activePath": [{
|
|
334
|
+
"onActivePathChanged": 0
|
|
335
|
+
}],
|
|
336
|
+
"open": [{
|
|
337
|
+
"onOpenChanged": 0
|
|
338
|
+
}],
|
|
339
|
+
"width": [{
|
|
340
|
+
"onWidthChanged": 0
|
|
341
|
+
}],
|
|
342
|
+
"minWidth": [{
|
|
343
|
+
"onBoundsChanged": 0
|
|
344
|
+
}],
|
|
345
|
+
"maxWidth": [{
|
|
346
|
+
"onBoundsChanged": 0
|
|
347
|
+
}],
|
|
348
|
+
"resizable": [{
|
|
349
|
+
"onResizableChanged": 0
|
|
350
|
+
}]
|
|
351
|
+
}; }
|
|
352
|
+
};
|
|
353
|
+
NvSidebar.style = nvSidebarCss();
|
|
354
|
+
|
|
355
|
+
exports.nv_sidebar = NvSidebar;
|
package/dist/cjs/{nv-sidebarcontent.entry-llnRwVuj.js → nv-sidebarcontent.entry-RCkZZp9I.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -14,7 +14,7 @@ const NvSidebarcontent = class {
|
|
|
14
14
|
/****************************************************************************/
|
|
15
15
|
//#region RENDER
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h(index.Host, { key: '
|
|
17
|
+
return (index.h(index.Host, { key: '85b6fd48dca4c6889c16453ba53e6bdcb692782a', role: "list" }, index.h("slot", { key: 'f2a2860c6bcd8a1196f191f6af2f3be28713d792' })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
NvSidebarcontent.style = nvSidebarcontentCss();
|
package/dist/cjs/{nv-sidebardivider.entry--rQv8d5T.js → nv-sidebardivider.entry-DY25WqI7.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -14,7 +14,7 @@ const NvSidebardivider = class {
|
|
|
14
14
|
/****************************************************************************/
|
|
15
15
|
//#region RENDER
|
|
16
16
|
render() {
|
|
17
|
-
return index.h(index.Host, { key: '
|
|
17
|
+
return index.h(index.Host, { key: '31125496c90eb141cd70a69ac24f5d2b2165821c', role: "separator", "aria-orientation": "horizontal" });
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
NvSidebardivider.style = nvSidebardividerCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -14,7 +14,7 @@ const NvSidebarfooter = class {
|
|
|
14
14
|
/****************************************************************************/
|
|
15
15
|
//#region RENDER
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h(index.Host, { key: '
|
|
17
|
+
return (index.h(index.Host, { key: '1d281299e81cf2081b6e77f3a47e75c8efe699fa' }, index.h("slot", { key: 'd0211b2b36ae6dc31f1a63e82eb8cc7c58c8e56a' })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
NvSidebarfooter.style = nvSidebarfooterCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -15,7 +15,7 @@ const NvSidebargroup = class {
|
|
|
15
15
|
/****************************************************************************/
|
|
16
16
|
//#region RENDER
|
|
17
17
|
render() {
|
|
18
|
-
return (index.h(index.Host, { key: '
|
|
18
|
+
return (index.h(index.Host, { key: '039c251fd46c3c178d1fc5329cbf676947f9f736', role: "group", "aria-label": this.label }, this.label && index.h("div", { key: 'f2fc7cbbe469ab8f71caa86ec62ed98347c1072a', class: "nv-sidebargroup-label" }, this.label), index.h("slot", { key: '67cf9ff6aa2f61feaf1c3966e7975fbf5273229c' })));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
NvSidebargroup.style = nvSidebargroupCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -14,7 +14,7 @@ const NvSidebarheader = class {
|
|
|
14
14
|
/****************************************************************************/
|
|
15
15
|
//#region RENDER
|
|
16
16
|
render() {
|
|
17
|
-
return (index.h(index.Host, { key: '
|
|
17
|
+
return (index.h(index.Host, { key: 'f29fff2d903edbcea70de45e3aca5e7049872464' }, index.h("slot", { key: 'e5854558583d51d0dba078da41311fedcaeb9bc5' })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
NvSidebarheader.style = nvSidebarheaderCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -24,7 +24,7 @@ const NvSidebarlogo = class {
|
|
|
24
24
|
render() {
|
|
25
25
|
const logoSrc = this.logo || this.defaultLogo;
|
|
26
26
|
const collapsedLogoSrc = this.collapsedLogo || this.defaultCollapsedLogo;
|
|
27
|
-
return (index.h(index.Host, { key: '
|
|
27
|
+
return (index.h(index.Host, { key: '6c8f69d79da3f6f308489b440951c4c70bbf1607' }, index.h("div", { key: '614c4925f8e26fbcb53387f0d166d51435a67759', class: "nv-sidebarlogo-container" }, index.h("img", { key: 'e6e6d3b5a024179c7e0042a3fd2be330379fd1c5', src: logoSrc, alt: this.label || 'Logo', class: "nv-sidebarlogo-full" }), index.h("img", { key: 'f58059a9ec0ddc7840e77fcd3ec64d1e30b87a13', src: collapsedLogoSrc, alt: this.label || 'Logo', class: "nv-sidebarlogo-collapsed" }), index.h("slot", { key: '2f895cfb6487af387d501bb0d22f39967a08b83a', name: "label" }), this.label && index.h("span", { key: 'df6039eb0a010bc547a3017ca50be61b9929337d', class: "nv-sidebarlogo-title" }, this.label))));
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
NvSidebarlogo.style = nvSidebarlogoCss();
|
package/dist/cjs/{nv-sidebarnavitem.entry-BWc3mF5I.js → nv-sidebarnavitem.entry-fQ9sqxDj.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -276,7 +276,7 @@ const NvSidebarnavitem = class {
|
|
|
276
276
|
render() {
|
|
277
277
|
const showNotificationBullet = this.notificationCount !== undefined && this.notificationCount > 0;
|
|
278
278
|
const notificationSize = this.isSidebarCollapsed ? 'reduced' : 'default';
|
|
279
|
-
return (index.h(index.Host, { key: '
|
|
279
|
+
return (index.h(index.Host, { key: '5d7b7d92812e20fa0ff6765506afc26965bcad19', role: "listitem" }, index.h("div", { key: '080e96026b2b1d8ed1edfe3b291aea27b3ef6a29', class: "nv-sidebarnavitem-trigger", onClick: this.handleToggle, "aria-expanded": this.collapsible ? String(this.open) : undefined, "aria-current": this.active && !this.collapsible ? 'page' : undefined }, this.icon && (index.h("div", { key: 'e97b9141eaf73fb363374227b59317bdf40289a3', class: "nv-sidebarnavitem-icon" }, index.h("nv-icon", { key: '1c7f7bbf4fd36963873b70a65786e4f89463e636', name: this.icon, size: "md" }), showNotificationBullet && this.isSidebarCollapsed && (index.h("nv-notification-bullet", { key: '53151726d69a262a40e3eae7751757081e7cc70e', count: this.notificationCount, size: notificationSize, contrastingBorder: true })))), index.h("div", { key: '1a0a208300d3d17e7c1ecce3db5a307167be730e', class: "nv-sidebarnavitem-content" }, index.h("slot", { key: 'e92c48e3d9c71d767fe7e775c97d6da678f132e5' })), index.h("div", { key: '0f436e17da2cfadb01096eaa7854ad2c2ed2a4b3', class: "nv-sidebarnavitem-trailing" }, index.h("slot", { key: '71d23bd377b11c2bf5eaf17c25e26df33b4d9b53', name: "trailing" }), showNotificationBullet && !this.isSidebarCollapsed && (index.h("nv-notification-bullet", { key: '1d6c4ab8f326d39bd7b452d8b0fe44577369b9f4', count: this.notificationCount, size: notificationSize })), this.collapsible && (index.h("nv-icon", { key: '13f4eb6174a76790bac429227d05de1beae4b4ee', name: "chevron-down", size: "sm", class: "nv-sidebarnavitem-chevron" })))), this.collapsible && this.hasSubitems && (index.h("div", { key: '6d5a87e10c7394663237f466d36871fe7cce48ae', class: "nv-sidebarnavitem-subitems", ref: el => {
|
|
280
280
|
// Only update ref and initialize if element changed or not yet initialized
|
|
281
281
|
if (el !== this.subitemsRef) {
|
|
282
282
|
this.subitemsRef = el;
|
|
@@ -291,7 +291,7 @@ const NvSidebarnavitem = class {
|
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
} }, index.h("slot", { key: '
|
|
294
|
+
} }, index.h("slot", { key: '6790db049f61ca41292bfd865884548a5a5da5d0', name: "subitems" })))));
|
|
295
295
|
}
|
|
296
296
|
get el() { return index.getElement(this); }
|
|
297
297
|
static get watchers() { return {
|
package/dist/cjs/{nv-sidebarnavsubitem.entry-DekANwO8.js → nv-sidebarnavsubitem.entry-1iBobkME.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -27,7 +27,7 @@ const NvSidebarnavsubitem = class {
|
|
|
27
27
|
/****************************************************************************/
|
|
28
28
|
//#region RENDER
|
|
29
29
|
render() {
|
|
30
|
-
return (index.h(index.Host, { key: '
|
|
30
|
+
return (index.h(index.Host, { key: '868adf5adb19818ca6caab0f866bfd9c2bf1c6f6', role: "listitem", "aria-current": this.active ? 'page' : undefined }, index.h("div", { key: '212d3e04dde99a698081e8ffc3aa39e696883794', class: "nv-sidebarnavsubitem-indicator" }), index.h("div", { key: '2ac964d11cdc914e329a0b6edcc6753d8182e60d', class: "nv-sidebarnavsubitem-content" }, index.h("slot", { key: 'be2a8d0b2e81f6f299ae9574c1358cfba28ed1a9' })), index.h("div", { key: '62e4e65e5c502c379851201cf038c6ca49ec051d', class: "nv-sidebarnavsubitem-trailing" }, index.h("slot", { key: '45cb80e9cbc0ab886ff7124035e781ae7f616f75', name: "trailing" }))));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
NvSidebarnavsubitem.style = nvSidebarnavsubitemCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -326,7 +326,7 @@ const NvSplit = class {
|
|
|
326
326
|
/****************************************************************************/
|
|
327
327
|
//#region RENDER
|
|
328
328
|
render() {
|
|
329
|
-
return (index.h(index.Host, { key: '
|
|
329
|
+
return (index.h(index.Host, { key: '91f106634a9f04a3b6aced262ea84e75b294255e', "data-dragging": this.isDragging.toString() }, index.h("slot", { key: '17fb1041dc82b510d8c303208891a2eb455b885a', name: "pane" }), index.h("slot", { key: '4900d19af850f103a191769ef23c0cd5d2531375', name: "gutter" }), index.h("slot", { key: 'bfad8d859270f46094655103f10182c25c2c94fe' })));
|
|
330
330
|
}
|
|
331
331
|
get el() { return index.getElement(this); }
|
|
332
332
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
5
|
require('@stencil/react-output-target/runtime');
|
|
6
6
|
require('react');
|
|
@@ -23,7 +23,7 @@ const NvStack = class {
|
|
|
23
23
|
/****************************************************************************/
|
|
24
24
|
//#region RENDER
|
|
25
25
|
render() {
|
|
26
|
-
return (index.h(index.Host, { key: '
|
|
26
|
+
return (index.h(index.Host, { key: 'fb4c34f7f678b980d4caceb71c420dc6de5d0322', class: clsxChV9xqsO.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: '2a5b1b24802d9527f5d076a316401f2bb403c979' })));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
NvStack.style = nvStackCss();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
|
+
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
|
+
require('@stencil/react-output-target/runtime');
|
|
6
|
+
require('react');
|
|
7
|
+
require('react-dom');
|
|
8
|
+
|
|
9
|
+
const nvStatusindicatorCss = () => `nv-statusindicator{display:inline-flex;align-items:center;gap:var(--status-indicator-gap-x);padding:var(--status-indicator-padding-y) var(--status-indicator-padding-x);height:var(--status-indicator-height);border-radius:var(--status-indicator-radius);border:1px solid;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--status-indicator-label-size);font-weight:var(--font-weight-medium-emphasis);line-height:var(--status-indicator-label-line-height);width:fit-content;vertical-align:middle}nv-statusindicator.status-success{color:var(--color-feedback-success-low-text);border-color:var(--color-feedback-success-low-border)}nv-statusindicator.status-success nv-icon{color:var(--color-feedback-success-low-icon)}nv-statusindicator.status-success.emphasis-high{background-color:var(--color-feedback-success-low-background);border-color:var(--color-feedback-success-low-border-subtle)}nv-statusindicator.status-warning{color:var(--color-feedback-warning-low-text);border-color:var(--color-feedback-warning-low-border)}nv-statusindicator.status-warning nv-icon{color:var(--color-feedback-warning-low-icon)}nv-statusindicator.status-warning.emphasis-high{background-color:var(--color-feedback-warning-low-background);border-color:var(--color-feedback-warning-low-border-subtle)}nv-statusindicator.status-error{color:var(--color-feedback-error-low-text);border-color:var(--color-feedback-error-low-border)}nv-statusindicator.status-error nv-icon{color:var(--color-feedback-error-low-icon)}nv-statusindicator.status-error.emphasis-high{background-color:var(--color-feedback-error-low-background);border-color:var(--color-feedback-error-low-border-subtle)}nv-statusindicator.status-information{color:var(--color-feedback-information-low-text);border-color:var(--color-feedback-information-low-border)}nv-statusindicator.status-information nv-icon{color:var(--color-feedback-information-low-icon)}nv-statusindicator.status-information.emphasis-high{background-color:var(--color-feedback-information-low-background);border-color:var(--color-feedback-information-low-border-subtle)}nv-statusindicator.status-neutral{color:var(--color-feedback-neutral-low-text);border-color:var(--color-feedback-neutral-low-border)}nv-statusindicator.status-neutral nv-icon{color:var(--color-feedback-neutral-low-icon)}nv-statusindicator.status-neutral.emphasis-high{background-color:var(--color-feedback-neutral-low-background);border-color:var(--color-feedback-neutral-low-border-subtle)}nv-statusindicator .nv-statusindicator-label{white-space:nowrap}`;
|
|
10
|
+
|
|
11
|
+
const STATUS_ICONS = {
|
|
12
|
+
success: 'circle-check',
|
|
13
|
+
warning: 'alert-triangle',
|
|
14
|
+
error: 'alert-circle',
|
|
15
|
+
information: 'info-circle',
|
|
16
|
+
neutral: 'help',
|
|
17
|
+
};
|
|
18
|
+
const NvStatusindicator = class {
|
|
19
|
+
constructor(hostRef) {
|
|
20
|
+
index.registerInstance(this, hostRef);
|
|
21
|
+
/****************************************************************************/
|
|
22
|
+
//#region PROPERTIES
|
|
23
|
+
/**
|
|
24
|
+
* The status variant of the indicator.
|
|
25
|
+
*/
|
|
26
|
+
this.status = 'neutral';
|
|
27
|
+
/**
|
|
28
|
+
* The visual emphasis of the indicator.
|
|
29
|
+
*/
|
|
30
|
+
this.emphasis = 'low';
|
|
31
|
+
}
|
|
32
|
+
//#endregion PROPERTIES
|
|
33
|
+
/****************************************************************************/
|
|
34
|
+
//#region RENDER
|
|
35
|
+
render() {
|
|
36
|
+
const hasLabel = Boolean(this.label);
|
|
37
|
+
return (index.h(index.Host, { key: '2f1e9277152efca4f2f3ba95b44934427555854f', class: clsxChV9xqsO.clsx(`status-${this.status}`, `emphasis-${this.emphasis}`), ...(!hasLabel ? { 'aria-label': this.status } : {}) }, index.h("nv-icon", { key: '55ba1905d8cde217be9156401c4075522b1e022b', name: STATUS_ICONS[this.status], size: "xs", "aria-hidden": "true" }), hasLabel && index.h("span", { key: 'a55382c27c4a40dbf7c800c1f1127f31f47f2852', class: "nv-statusindicator-label" }, this.label)));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
NvStatusindicator.style = nvStatusindicatorCss();
|
|
41
|
+
|
|
42
|
+
exports.nv_statusindicator = NvStatusindicator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DXwd3F_r.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -180,7 +180,7 @@ function updateCellWidthFromResize(state, event, minWidth = TABLE_CONSTANTS.MIN_
|
|
|
180
180
|
setCellWidth(state.resizingCell, newWidth);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
const nvTableCss = () => `nv-table table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;min-width:100%;background:var(--color-level-00-background)}nv-table table thead{background:var(--components-datagrid-header-background)}nv-table table tbody tr.nv-datatable-row-clickable{cursor:pointer}nv-table table tbody tr.nv-datatable-row-clickable td{transition:background-color 120ms ease-in-out}nv-table table tbody tr.nv-datatable-row-clickable:focus-visible{outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-table table tbody tr
|
|
183
|
+
const nvTableCss = () => `nv-table table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;min-width:100%;background:var(--color-level-00-background)}nv-table table thead{background:var(--components-datagrid-header-background)}nv-table table tbody tr:hover{background:var(--components-datagrid-body-background-hover)}nv-table table tbody tr[data-selected]{background:var(--components-datagrid-body-background-active)}nv-table table tbody tr[data-selected]:hover{background:var(--components-datagrid-body-background-active)}nv-table table tbody tr.nv-datatable-row-clickable{cursor:pointer}nv-table table tbody tr.nv-datatable-row-clickable td{transition:background-color 120ms ease-in-out}nv-table table tbody tr.nv-datatable-row-clickable:focus-visible{outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-table table tbody tr.nv-datatable-expanded-row>td{padding:0;height:auto;border-bottom:1px solid var(--components-datagrid-expander-border);background:var(--components-datagrid-expander-expander-background)}nv-table table tbody .nv-datatable-expanded-content{position:sticky;left:0;width:0;min-width:100%;padding:var(--datagrid-cell-body-padding-y) var(--datagrid-cell-body-padding-x);box-sizing:border-box}nv-table table[data-row-click-enabled=true] tbody tr.nv-datatable-row-clickable:hover td{background:var(--components-datagrid-body-background-hover)}nv-table table[data-row-click-enabled=false]>tbody>tr:hover:not([data-selected]){cursor:default}nv-table table[data-row-click-enabled=false]>tbody>tr:hover:not([data-selected])>td{background:var(--components-datagrid-body-background-default) !important}nv-table table td{height:var(--spacing-16);padding:var(--datagrid-cell-body-padding-y) var(--datagrid-cell-body-padding-x) var(--spacing-2) var(--datagrid-cell-body-padding-x);font-size:var(--font-size-md);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--line-height-base);background:var(--components-datagrid-body-background-default);border-bottom:1px solid var(--components-datagrid-body-border)}nv-table table th{position:relative;text-align:left;padding:var(--datagrid-cell-header-padding-y) var(--datagrid-cell-header-padding-right) var(--datagrid-cell-header-padding-y) var(--datagrid-cell-header-padding-x);padding-right:calc(var(--datagrid-cell-header-padding-right) + 12px);color:var(--color-content-low-text);font-variant-numeric:lining-nums tabular-nums slashed-zero;font-size:var(--font-size-md);font-style:normal;font-weight:var(--font-weight-high-emphasis);line-height:var(--line-height-base);min-width:40px;border-bottom:1px solid var(--components-datagrid-header-border);background:var(--components-datagrid-header-background)}nv-table table th::after{content:"";position:absolute;top:0;right:0;width:12px;height:50%;transform:translateY(50%);cursor:col-resize;background:linear-gradient(90deg, transparent 0%, transparent calc(50% - 1px), var(--components-datagrid-header-border), calc(50% - 1px), var(--components-datagrid-header-border) calc(50% + 1px), transparent calc(50% + 1px), transparent 100%);opacity:0;transition:opacity 0.05s ease-in-out}nv-table table th[data-grow]{width:unset}nv-table table th:hover::after{opacity:1}nv-table table th[data-no-resize]::after{display:none}nv-table [data-sticky-left]{position:sticky;z-index:1;background:var(--color-level-00-background);left:0;top:0}nv-table [data-sticky-right]{position:sticky;z-index:1;background:var(--color-level-00-background);right:0;top:0}nv-table [data-sticky-top] th{position:sticky;z-index:1;background:var(--color-level-00-background);top:0}`;
|
|
184
184
|
|
|
185
185
|
const NvTable = class {
|
|
186
186
|
constructor(hostRef) {
|
|
@@ -236,7 +236,7 @@ const NvTable = class {
|
|
|
236
236
|
/****************************************************************************/
|
|
237
237
|
//#region RENDER
|
|
238
238
|
render() {
|
|
239
|
-
return (index.h(index.Host, { key: '
|
|
239
|
+
return (index.h(index.Host, { key: 'bc442df56ece833f6a3b6a4af24e0e67e430aefd' }, index.h("slot", { key: '9f0deb196b2a1bfca8d30a05a752e446068f3f3c' })));
|
|
240
240
|
}
|
|
241
241
|
get host() { return index.getElement(this); }
|
|
242
242
|
};
|