@nova-design-system/nova-react 3.29.0 → 3.31.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 +35 -1
- package/dist/cjs/index-BRxlcrvE.js +10395 -0
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/{nv-accordion-item.entry-D1o0gC5w.js → nv-accordion-item.entry-DWi_bEQx.js} +3 -3
- package/dist/cjs/{nv-accordion.entry-DYJtq9Az.js → nv-accordion.entry-Bgn2CRYE.js} +2 -2
- package/dist/cjs/{nv-alert.entry-CMtCdHmk.js → nv-alert.entry-tkzdxYo4.js} +8 -8
- package/dist/cjs/{nv-avatar.entry-B6e7aG4W.js → nv-avatar.entry-C6xqQhws.js} +8 -8
- package/dist/cjs/{nv-badge_2.entry-RD3j0bJM.js → nv-badge_2.entry-poMKx9km.js} +5 -5
- package/dist/cjs/{nv-breadcrumb.entry-DgpqY2fr.js → nv-breadcrumb.entry-BTBUN3X8.js} +2 -2
- package/dist/cjs/{nv-breadcrumbs.entry-CZgcDUw5.js → nv-breadcrumbs.entry-DXdb_Gzf.js} +2 -2
- package/dist/cjs/{nv-button.entry-DR9NaRxG.js → nv-button.entry-IYrV4dVV.js} +7 -7
- package/dist/cjs/{nv-buttongroup.entry-qO8r7WqG.js → nv-buttongroup.entry-DpMhGqzQ.js} +2 -2
- package/dist/cjs/{nv-calendar.entry-DRlv3Xph.js → nv-calendar.entry-Clp-qYdU.js} +9 -9
- package/dist/cjs/{nv-col.entry-B7utJttP.js → nv-col.entry-BgIpEdn6.js} +2 -2
- package/dist/cjs/{nv-datagrid.entry-digYmlnA.js → nv-datagrid.entry-CmnSlQEN.js} +8 -8
- package/dist/cjs/{nv-datagridcolumn.entry-UwaDi-Hr.js → nv-datagridcolumn.entry-CfaOqHSs.js} +2 -2
- package/dist/cjs/{nv-datetest.entry-BJtWaM2T.js → nv-datetest.entry-DL0WPAUH.js} +2 -2
- package/dist/cjs/{nv-datetimetest.entry-WaNPcHxh.js → nv-datetimetest.entry-DoABznI1.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-BI_mFT2G.js → nv-dialog.entry-C95UrJIU.js} +3 -3
- package/dist/cjs/{nv-dialogfooter_2.entry-DU2ClBUR.js → nv-dialogfooter_2.entry-Ccml86Uw.js} +6 -6
- package/dist/cjs/{nv-drawer.entry-BKF4CyOt.js → nv-drawer.entry-cXCjYVTV.js} +3 -3
- package/dist/cjs/{nv-drawerfooter_2.entry-BSyUs7_4.js → nv-drawerfooter_2.entry-Dq0IblnH.js} +6 -6
- package/dist/cjs/{nv-fieldcheckbox.entry-l5FWToQi.js → nv-fieldcheckbox.entry-CnP54xin.js} +5 -5
- package/dist/cjs/{nv-fielddate.entry-BfviesNp.js → nv-fielddate.entry-DZY75-mm.js} +7 -7
- package/dist/cjs/{nv-fielddaterange.entry-BvDkPLXG.js → nv-fielddaterange.entry-DkouN3iA.js} +7 -7
- package/dist/cjs/{nv-fielddropdown.entry-B-nYjuMt.js → nv-fielddropdown.entry-Bc3bobvr.js} +101 -23
- package/dist/cjs/{nv-fielddropdownitem.entry-Dxqyb9DN.js → nv-fielddropdownitem.entry-CmdskK1s.js} +2 -2
- package/dist/cjs/{nv-fieldmultiselect.entry-CgO1RP0W.js → nv-fieldmultiselect.entry-Bc6YFUA_.js} +1 -1
- package/dist/cjs/{nv-fieldnumber.entry-stgdLi7x.js → nv-fieldnumber.entry-DwvjJfV9.js} +5 -5
- package/dist/cjs/{nv-fieldpassword.entry-CHA3JAUd.js → nv-fieldpassword.entry-CUI2Jm-V.js} +5 -5
- package/dist/cjs/{nv-fieldradio.entry-DHavVjB-.js → nv-fieldradio.entry-CnLCvLBh.js} +4 -4
- package/dist/cjs/{nv-fieldselect.entry-Dq5AsOFt.js → nv-fieldselect.entry-DunLjNwe.js} +45 -7
- package/dist/cjs/{nv-fieldslider.entry-SlF3BBUW.js → nv-fieldslider.entry-Cp-6fToR.js} +4 -4
- package/dist/cjs/{nv-fieldtext.entry-BYCc8SyD.js → nv-fieldtext.entry-FJk12WoX.js} +5 -5
- package/dist/cjs/{nv-fieldtextarea.entry-96JCOb9L.js → nv-fieldtextarea.entry-Ci9B5-DX.js} +4 -4
- package/dist/cjs/{nv-fieldtime.entry-BdzjxkaK.js → nv-fieldtime.entry-DCSdECWn.js} +44 -44
- package/dist/cjs/{nv-icon.entry-CSRxi6BH.js → nv-icon.entry-DB18IDaU.js} +9 -9
- package/dist/cjs/{nv-iconbutton_2.entry-BtDxwMFD.js → nv-iconbutton_2.entry-CNR_poEm.js} +3 -3
- package/dist/cjs/{nv-menu.entry-aX39SPH8.js → nv-menu.entry-CxXHuTq3.js} +2 -2
- package/dist/cjs/{nv-menuitem.entry-DzSp52G2.js → nv-menuitem.entry-44XD7nfl.js} +2 -2
- package/dist/cjs/{nv-notification-bullet.entry-D2yOXj46.js → nv-notification-bullet.entry-Cn2OELYw.js} +1 -1
- package/dist/cjs/{nv-notification.entry-BRXHbtT8.js → nv-notification.entry-C8beqUzI.js} +19 -19
- package/dist/cjs/{nv-notificationcontainer.entry-YNIM2_ah.js → nv-notificationcontainer.entry-DgEstiLX.js} +2 -2
- package/dist/cjs/{nv-pagination-nav.entry-uY1nT9aT.js → nv-pagination-nav.entry-CIZPwFeF.js} +2 -2
- package/dist/cjs/{nv-paginationtable.entry-mr5KYXVC.js → nv-paginationtable.entry-woQZpVmb.js} +19 -3
- package/dist/cjs/{nv-popover.entry-_9ARKM70.js → nv-popover.entry-rHUUSzR-.js} +2 -2
- package/dist/cjs/{nv-row.entry-BMQvcqlU.js → nv-row.entry-DaERf8TD.js} +2 -2
- package/dist/cjs/nv-sidebar.entry-BI9me_HP.js +355 -0
- package/dist/cjs/{nv-sidebarcontent.entry-llnRwVuj.js → nv-sidebarcontent.entry-CtARsnjy.js} +2 -2
- package/dist/cjs/{nv-sidebardivider.entry--rQv8d5T.js → nv-sidebardivider.entry-C15Xk11m.js} +2 -2
- package/dist/cjs/{nv-sidebarfooter.entry-C5R0sUI_.js → nv-sidebarfooter.entry-DFMMvv_Q.js} +2 -2
- package/dist/cjs/{nv-sidebargroup.entry-DdrpLbU7.js → nv-sidebargroup.entry-DeWOA-0I.js} +2 -2
- package/dist/cjs/{nv-sidebarheader.entry-HuBPIsyf.js → nv-sidebarheader.entry-HtvbpvnX.js} +2 -2
- package/dist/cjs/{nv-sidebarlogo.entry-TZNPoqnA.js → nv-sidebarlogo.entry-Zxbpttzr.js} +2 -2
- package/dist/cjs/{nv-sidebarnavitem.entry-BWc3mF5I.js → nv-sidebarnavitem.entry-u4rbC1el.js} +3 -3
- package/dist/cjs/{nv-sidebarnavsubitem.entry-DekANwO8.js → nv-sidebarnavsubitem.entry-UouMn7hU.js} +2 -2
- package/dist/cjs/{nv-split.entry-BOwOB8FW.js → nv-split.entry-CUMbQNQB.js} +2 -2
- package/dist/cjs/{nv-stack.entry-CaTiSLGN.js → nv-stack.entry-D_F42KTD.js} +2 -2
- package/dist/cjs/nv-statusindicator.entry-BdRvU3iW.js +42 -0
- package/dist/cjs/{nv-table.entry-LFZaS0Dy.js → nv-table.entry-CKVH76OE.js} +3 -3
- package/dist/cjs/{nv-tableheader.entry-CK50S8xW.js → nv-tableheader.entry-btKwE14F.js} +2 -2
- package/dist/cjs/nv-tag.entry-BxYC7Lgo.js +85 -0
- package/dist/cjs/{nv-timetest.entry-A9elKwkf.js → nv-timetest.entry-CxXMIDZ_.js} +2 -2
- package/dist/cjs/{nv-toggle.entry-BGu-6rEs.js → nv-toggle.entry-C4uo7RRt.js} +3 -3
- package/dist/cjs/{nv-togglebutton.entry-BzAcBOgN.js → nv-togglebutton.entry-DJ-s5lgO.js} +2 -2
- package/dist/cjs/{nv-togglebuttongroup.entry-CIWp7IXc.js → nv-togglebuttongroup.entry-DJOCL_Qx.js} +2 -2
- package/dist/cjs/{nv-tooltip.entry-CoGkSHpv.js → nv-tooltip.entry-DndZWT1U.js} +2 -2
- package/dist/components/NvDatatable/NvDatatable.js +178 -61
- 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 +25 -2
- package/dist/generated/components.server.js +33 -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 +17 -1
- package/dist/types/generated/components.d.ts +14 -1
- package/dist/types/generated/components.server.d.ts +14 -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
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-DgKzi_Pd.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 .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
|
-
|
|
10
|
-
const NvSidebar = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.openChanged = index.createEvent(this, "openChanged", 3);
|
|
14
|
-
/****************************************************************************/
|
|
15
|
-
//#region PROPERTIES
|
|
16
|
-
/**
|
|
17
|
-
* The type of sidebar behavior.
|
|
18
|
-
* - collapsible: Can be toggled open/closed
|
|
19
|
-
* - persistent: Always visible
|
|
20
|
-
*/
|
|
21
|
-
this.type = 'persistent';
|
|
22
|
-
/**
|
|
23
|
-
* Whether the sidebar is currently open (only applies to collapsible type).
|
|
24
|
-
*/
|
|
25
|
-
// eslint-disable-next-line @stencil-community/ban-default-true
|
|
26
|
-
this.open = true;
|
|
27
|
-
/**
|
|
28
|
-
* Determines the type of notification bullets in the sidebar.
|
|
29
|
-
* - neutral: Uses neutral colors (gray)
|
|
30
|
-
* - brand: Uses brand colors (orange/teal depending on theme)
|
|
31
|
-
*/
|
|
32
|
-
this.notificationIntention = 'brand';
|
|
33
|
-
/**
|
|
34
|
-
* Determines the emphasis of notification bullets in the sidebar.
|
|
35
|
-
* - high: More prominent appearance
|
|
36
|
-
* - low: Less prominent appearance
|
|
37
|
-
*/
|
|
38
|
-
this.notificationEmphasis = 'high';
|
|
39
|
-
//#endregion EVENTS
|
|
40
|
-
/****************************************************************************/
|
|
41
|
-
//#region METHODS
|
|
42
|
-
this.handleToggle = () => {
|
|
43
|
-
if (this.type === 'collapsible') {
|
|
44
|
-
// Changing open will trigger @Watch which emits the event
|
|
45
|
-
this.open = !this.open;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Sets the active state of navigation items based on activePath
|
|
50
|
-
*/
|
|
51
|
-
this.setActiveNavItems = () => {
|
|
52
|
-
if (!this.activePath)
|
|
53
|
-
return;
|
|
54
|
-
// First, check all subitems to find if any matches exactly
|
|
55
|
-
const activeSubitemHrefs = new Set();
|
|
56
|
-
this.el.querySelectorAll('nv-sidebarnavsubitem').forEach(subItem => {
|
|
57
|
-
const link = subItem.querySelector('a');
|
|
58
|
-
const href = link?.getAttribute('href');
|
|
59
|
-
if (href) {
|
|
60
|
-
const isActive = this.activePath === href;
|
|
61
|
-
subItem.active = isActive;
|
|
62
|
-
if (isActive) {
|
|
63
|
-
activeSubitemHrefs.add(href);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
// Then, set nav items active only if:
|
|
68
|
-
// 1. Exact match with activePath AND no subitem matches
|
|
69
|
-
// 2. OR the navitem has no subitems and activePath starts with its href
|
|
70
|
-
this.el.querySelectorAll('nv-sidebarnavitem').forEach(navItem => {
|
|
71
|
-
const link = navItem.querySelector(':scope > a, :scope > .nv-sidebarnavitem-trigger a, .nv-sidebarnavitem-content > a');
|
|
72
|
-
const href = link?.getAttribute('href');
|
|
73
|
-
const hasSubitems = navItem.querySelector('nv-sidebarnavsubitem') !== null;
|
|
74
|
-
if (href) {
|
|
75
|
-
if (hasSubitems) {
|
|
76
|
-
// Parent with subitems: only active if exact match (not when subitem is active)
|
|
77
|
-
navItem.active = this.activePath === href;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
// Item without subitems: active on exact match
|
|
81
|
-
navItem.active = this.activePath === href;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
this.pendingActiveUpdate = null;
|
|
87
|
-
/**
|
|
88
|
-
* Sets up the MutationObserver to watch for changes in child elements.
|
|
89
|
-
* Only triggers on new nav items being added, not on attribute changes.
|
|
90
|
-
*/
|
|
91
|
-
this.setupMutationObserver = () => {
|
|
92
|
-
this.mutationObserver = new MutationObserver(mutations => {
|
|
93
|
-
// Only react to new nav items being added, ignore other mutations
|
|
94
|
-
const hasNewNavItems = mutations.some(mutation => {
|
|
95
|
-
if (mutation.type !== 'childList')
|
|
96
|
-
return false;
|
|
97
|
-
return Array.from(mutation.addedNodes).some(node => {
|
|
98
|
-
if (node.nodeType !== Node.ELEMENT_NODE)
|
|
99
|
-
return false;
|
|
100
|
-
const el = node;
|
|
101
|
-
return (el.tagName.toLowerCase() === 'nv-sidebarnavitem' ||
|
|
102
|
-
el.tagName.toLowerCase() === 'nv-sidebarnavsubitem' ||
|
|
103
|
-
el.querySelector('nv-sidebarnavitem, nv-sidebarnavsubitem'));
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
if (hasNewNavItems) {
|
|
107
|
-
// Debounce to prevent multiple rapid calls
|
|
108
|
-
if (this.pendingActiveUpdate) {
|
|
109
|
-
clearTimeout(this.pendingActiveUpdate);
|
|
110
|
-
}
|
|
111
|
-
this.pendingActiveUpdate = window.setTimeout(() => {
|
|
112
|
-
this.setActiveNavItems();
|
|
113
|
-
this.pendingActiveUpdate = null;
|
|
114
|
-
}, 50);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
this.mutationObserver.observe(this.el, {
|
|
118
|
-
childList: true,
|
|
119
|
-
subtree: true,
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
handleCollapsedSideEffects(isCollapsed) {
|
|
124
|
-
if (!isCollapsed) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
this.el.querySelectorAll('nv-sidebarnavitem[open]').forEach(navItem => {
|
|
128
|
-
navItem.open = false;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
//#endregion METHODS
|
|
132
|
-
/****************************************************************************/
|
|
133
|
-
//#region WATCHERS
|
|
134
|
-
onActivePathChanged() {
|
|
135
|
-
this.setActiveNavItems();
|
|
136
|
-
}
|
|
137
|
-
onOpenChanged(newValue, oldValue) {
|
|
138
|
-
this.handleCollapsedSideEffects(this.type === 'collapsible' && !newValue);
|
|
139
|
-
// Only emit event when open state actually changes (not on re-render with same value)
|
|
140
|
-
if (this.type === 'collapsible' && newValue !== oldValue) {
|
|
141
|
-
this.openChanged.emit(newValue);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
//#endregion WATCHERS
|
|
145
|
-
/****************************************************************************/
|
|
146
|
-
//#region LIFECYCLE
|
|
147
|
-
componentWillLoad() {
|
|
148
|
-
this.setActiveNavItems();
|
|
149
|
-
this.setupMutationObserver();
|
|
150
|
-
this.handleCollapsedSideEffects(this.type === 'collapsible' && !this.open);
|
|
151
|
-
}
|
|
152
|
-
disconnectedCallback() {
|
|
153
|
-
if (this.mutationObserver) {
|
|
154
|
-
this.mutationObserver.disconnect();
|
|
155
|
-
}
|
|
156
|
-
if (this.pendingActiveUpdate) {
|
|
157
|
-
clearTimeout(this.pendingActiveUpdate);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
//#endregion LIFECYCLE
|
|
161
|
-
/****************************************************************************/
|
|
162
|
-
//#region RENDER
|
|
163
|
-
render() {
|
|
164
|
-
const isCollapsed = this.type === 'collapsible' && !this.open;
|
|
165
|
-
return (index.h(index.Host, { key: '7c77dc107335664b3844b38579f53c8805de09ca', 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: '00e9958d45d311168ab3024eda4d0a45813a8152', class: "nv-sidebar-container" }, index.h("slot", { key: '047f6bda1730f65c403f6aefe52b7c06192001c3' })), this.type === 'collapsible' && (index.h("button", { key: '51174b4f74614dc1eb1bfc78aacc542d8c938a02', class: "nv-sidebar-toggle", onClick: this.handleToggle, "aria-label": this.open ? 'Collapse sidebar' : 'Expand sidebar' }, index.h("nv-icon", { key: '75fc4ce9ac319be982534d502d5c019ff7d8ebdf', name: this.open
|
|
166
|
-
? 'layout-sidebar-left-collapse'
|
|
167
|
-
: 'layout-sidebar-right-collapse', size: "sm" })))));
|
|
168
|
-
}
|
|
169
|
-
get el() { return index.getElement(this); }
|
|
170
|
-
static get watchers() { return {
|
|
171
|
-
"activePath": [{
|
|
172
|
-
"onActivePathChanged": 0
|
|
173
|
-
}],
|
|
174
|
-
"open": [{
|
|
175
|
-
"onOpenChanged": 0
|
|
176
|
-
}]
|
|
177
|
-
}; }
|
|
178
|
-
};
|
|
179
|
-
NvSidebar.style = nvSidebarCss();
|
|
180
|
-
|
|
181
|
-
exports.nv_sidebar = NvSidebar;
|