@nova-design-system/nova-react 3.23.0 → 3.24.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/events.utils-B6GgGra--01N__3wY.js +23 -0
- package/dist/cjs/generated/components.server.js +47 -0
- 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-CtjeeUI-.js → index-kU2nW5aN.js} +1589 -920
- package/dist/cjs/{nv-dialog.entry-O47Eol_7.js → index.esm-D3eWMME9-CG1TVKfu.js} +1 -296
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/{nv-accordion-item.entry-B_l0-ux0.js → nv-accordion-item.entry-Bu1tAcCq.js} +1 -1
- package/dist/cjs/{nv-accordion.entry-BX8_YuZF.js → nv-accordion.entry-jWjLdX8w.js} +3 -8
- package/dist/cjs/{nv-alert.entry-DCWYR0OK.js → nv-alert.entry-E9ZJay_K.js} +2 -3
- package/dist/cjs/{nv-avatar.entry-C_xZD3Lp.js → nv-avatar.entry-CUX7u0kR.js} +1 -1
- package/dist/cjs/{nv-badge_2.entry-JjqANStV.js → nv-badge_2.entry-bxpV5gxE.js} +2 -2
- package/dist/cjs/{nv-breadcrumb.entry-DQZDn6cm.js → nv-breadcrumb.entry-Cbbb9Qeh.js} +1 -1
- package/dist/cjs/{nv-breadcrumbs.entry-Bz0GjhY_.js → nv-breadcrumbs.entry-BTqnp9zO.js} +1 -1
- package/dist/cjs/{nv-button.entry-Br1DH9Vj.js → nv-button.entry-upWH19y6.js} +4 -6
- package/dist/cjs/{nv-buttongroup.entry-BZaTKN_n.js → nv-buttongroup.entry-CuZCRsnV.js} +1 -1
- package/dist/cjs/{nv-calendar.entry-D9ESuu7C.js → nv-calendar.entry-CT3mASW6.js} +15 -25
- package/dist/cjs/{nv-col.entry-CfgPMMxS.js → nv-col.entry--pCxkaTh.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-DcB5q2oC.js → nv-datagrid.entry-CGCEhO8C.js} +68 -73
- package/dist/cjs/{nv-datagridcolumn.entry-BhKOzXA6.js → nv-datagridcolumn.entry-Fsqc7CT_.js} +1 -1
- package/dist/cjs/nv-dialog.entry-B6OYcZxQ.js +300 -0
- package/dist/cjs/{nv-dialogfooter_2.entry-Dn16bI8a.js → nv-dialogfooter_2.entry-C4fP_n2-.js} +1 -1
- package/dist/cjs/nv-drawer.entry-C5O4KvHU.js +445 -0
- package/dist/cjs/nv-drawerfooter_2.entry-C-reYJXG.js +146 -0
- package/dist/cjs/{nv-fieldcheckbox.entry-Bx6ArV_b.js → nv-fieldcheckbox.entry-bk7UNQny.js} +7 -7
- package/dist/cjs/{nv-fielddate.entry-B4P0U8QG.js → nv-fielddate.entry-dqZDBVmm.js} +13 -16
- package/dist/cjs/{nv-fielddaterange.entry-BORwYJ-k.js → nv-fielddaterange.entry-wNRasXky.js} +13 -14
- package/dist/cjs/{nv-fielddropdown.entry-DzBAIynY.js → nv-fielddropdown.entry-BA15piWa.js} +40 -49
- package/dist/cjs/{nv-fielddropdownitem.entry-C_17isWd.js → nv-fielddropdownitem.entry-DEWaf9dC.js} +3 -4
- package/dist/cjs/{nv-fieldmultiselect.entry-DiqRreWh.js → nv-fieldmultiselect.entry-BWY5xOAd.js} +35 -43
- package/dist/cjs/{nv-fieldnumber.entry-C9O4UPp3.js → nv-fieldnumber.entry-DoYORd0d.js} +7 -7
- package/dist/cjs/{nv-fieldpassword.entry-BfVJNT0A.js → nv-fieldpassword.entry-CPaLj9aD.js} +7 -7
- package/dist/cjs/{nv-fieldradio.entry-CG22oETM.js → nv-fieldradio.entry-CvUmEaCa.js} +5 -5
- package/dist/cjs/{nv-fieldselect.entry-BPQEtrv2.js → nv-fieldselect.entry-uUIZ6hmN.js} +9 -9
- package/dist/cjs/{nv-fieldslider.entry-CozmnUfN.js → nv-fieldslider.entry-DnvmxxYY.js} +6 -6
- package/dist/cjs/{nv-fieldtext.entry-BD-z01ru.js → nv-fieldtext.entry-BYAJp3n_.js} +7 -7
- package/dist/cjs/{nv-fieldtextarea.entry-7UrKWDHg.js → nv-fieldtextarea.entry-DU2bWYeg.js} +7 -8
- package/dist/cjs/{nv-fieldtime.entry-DakOlLiO.js → nv-fieldtime.entry-DlMNDTht.js} +28 -36
- package/dist/cjs/{nv-icon.entry-Db00kB2u.js → nv-icon.entry-CnUkRzaA.js} +3 -3
- package/dist/cjs/{nv-iconbutton_2.entry-CaKCa8NT.js → nv-iconbutton_2.entry-hqp4AcRq.js} +6 -7
- package/dist/cjs/{nv-menu.entry-CK2HdmBt.js → nv-menu.entry-Dc_FvIx7.js} +4 -5
- package/dist/cjs/{nv-menuitem.entry-mKMqCAdz.js → nv-menuitem.entry-DzMhx6c_.js} +2 -2
- package/dist/cjs/{nv-notification-bullet.entry-DtbjtFxs.js → nv-notification-bullet.entry-BwhHCMQF.js} +2 -3
- package/dist/cjs/{nv-notification.entry-CLb0gNu3.js → nv-notification.entry-C3m5p5BL.js} +11 -97
- package/dist/cjs/{nv-notificationcontainer.entry-Cijivlm6.js → nv-notificationcontainer.entry-DTRNn7VE.js} +2 -2
- package/dist/cjs/{nv-popover.entry-mLdLSp6n.js → nv-popover.entry-B0c-2rO4.js} +15 -15
- package/dist/cjs/{nv-row.entry-C2C94fcv.js → nv-row.entry-CdcjVGZv.js} +2 -2
- package/dist/cjs/{nv-sidebar.entry-inDVNJ4s.js → nv-sidebar.entry-CiN813gQ.js} +4 -4
- package/dist/cjs/{nv-sidebarcontent.entry-DxoljE15.js → nv-sidebarcontent.entry-D9hpAhK8.js} +2 -2
- package/dist/cjs/{nv-sidebardivider.entry-D_yern0R.js → nv-sidebardivider.entry-B4EMyca5.js} +2 -2
- package/dist/cjs/{nv-sidebarfooter.entry-Rkkn9TB_.js → nv-sidebarfooter.entry-CHi4qOFe.js} +2 -2
- package/dist/cjs/{nv-sidebargroup.entry-C1p9qqxr.js → nv-sidebargroup.entry-RVqrsyIU.js} +2 -2
- package/dist/cjs/{nv-sidebarheader.entry-CYpD_4pI.js → nv-sidebarheader.entry-_7ch0O3G.js} +2 -2
- package/dist/cjs/{nv-sidebarlogo.entry-BgK03M1v.js → nv-sidebarlogo.entry-Ch9F-JnT.js} +2 -2
- package/dist/cjs/{nv-sidebarnavitem.entry-DglvcCOD.js → nv-sidebarnavitem.entry-DVrafSMr.js} +5 -6
- package/dist/cjs/{nv-sidebarnavsubitem.entry-Dt1jKmC-.js → nv-sidebarnavsubitem.entry-C0XDAzma.js} +2 -2
- package/dist/cjs/{nv-split.entry-mzg2F66T.js → nv-split.entry-0HTslRAX.js} +44 -42
- package/dist/cjs/{nv-stack.entry-nnvjTrBy.js → nv-stack.entry-CqO7uTQf.js} +2 -2
- package/dist/cjs/{nv-table.entry-DkbNgxtI.js → nv-table.entry-DH85n8Mc.js} +7 -9
- package/dist/cjs/{nv-tableheader.entry-CRVFTQA-.js → nv-tableheader.entry-CKfocdxD.js} +3 -3
- package/dist/cjs/{nv-toggle.entry-oC9TVkr1.js → nv-toggle.entry-BHUl76Im.js} +3 -3
- package/dist/cjs/nv-togglebutton.entry-D_9COjY-.js +67 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-BYXX5ejg.js → nv-togglebuttongroup.entry-C0NLbsq7.js} +4 -5
- package/dist/cjs/{nv-tooltip.entry-OJGxfJEh.js → nv-tooltip.entry-BfViGE_U.js} +2 -2
- package/dist/cjs/slide.animation-CmH5d1of-BZuw607U.js +90 -0
- package/dist/components/NvDatatable/NvDatatable.js +40 -24
- package/dist/generated/components.js +27 -0
- package/dist/generated/components.server.js +44 -0
- package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
- package/dist/types/components/NvDatatable/types.d.ts +8 -3
- package/dist/types/generated/components.d.ts +14 -0
- package/dist/types/generated/components.server.d.ts +14 -0
- package/package.json +1 -1
- package/dist/cjs/nv-togglebutton.entry-BTWCzbS9.js +0 -67
package/dist/cjs/{nv-sidebarnavitem.entry-DglvcCOD.js → nv-sidebarnavitem.entry-DVrafSMr.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -42,7 +42,7 @@ const NvSidebarnavitem = class {
|
|
|
42
42
|
if (this.isSidebarCollapsed) {
|
|
43
43
|
// Find the first link that is NOT inside subitems
|
|
44
44
|
const link = this.el.querySelector('.nv-sidebarnavitem-content a, :scope > a');
|
|
45
|
-
if (link
|
|
45
|
+
if (link?.href) {
|
|
46
46
|
// Check if click was directly on the link - if so, let it handle naturally
|
|
47
47
|
if (target.closest('a')) {
|
|
48
48
|
return;
|
|
@@ -119,10 +119,9 @@ const NvSidebarnavitem = class {
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
this.checkSidebarCollapsed = () => {
|
|
122
|
-
var _a;
|
|
123
122
|
const sidebar = this.el.closest('nv-sidebar');
|
|
124
123
|
const wasCollapsed = this.isSidebarCollapsed;
|
|
125
|
-
this.isSidebarCollapsed =
|
|
124
|
+
this.isSidebarCollapsed = sidebar?.hasAttribute('collapsed') ?? false;
|
|
126
125
|
// When sidebar collapse state changes, update active state based on subitems
|
|
127
126
|
if (wasCollapsed !== this.isSidebarCollapsed) {
|
|
128
127
|
this.updateActiveFromSubitems();
|
|
@@ -270,7 +269,7 @@ const NvSidebarnavitem = class {
|
|
|
270
269
|
render() {
|
|
271
270
|
const showNotificationBullet = this.notificationCount !== undefined && this.notificationCount > 0;
|
|
272
271
|
const notificationSize = this.isSidebarCollapsed ? 'reduced' : 'default';
|
|
273
|
-
return (index.h(index.Host, { key: '
|
|
272
|
+
return (index.h(index.Host, { key: '7a3523c68080b90ef262a2fa3fa63f1f34baaaf1', role: "listitem" }, index.h("div", { key: '21abd8cf4e5d4a368b25db79306cb0ac747edfce', 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: '8255f2f75b751e5005b4bbb7178e553123c7c109', class: "nv-sidebarnavitem-icon" }, index.h("nv-icon", { key: '5396567c08fc46084f085b544aeee3f874b7b439', name: this.icon, size: "md" }), showNotificationBullet && this.isSidebarCollapsed && (index.h("nv-notification-bullet", { key: '63dfbd2a986124a9c1ba1741e4d1079ec2b38a18', count: this.notificationCount, size: notificationSize, contrastingBorder: true })))), index.h("div", { key: 'a4d8df28b532018d6961d6d779d77ba88bbea756', class: "nv-sidebarnavitem-content" }, index.h("slot", { key: '7394c3534de567f9230ff872b57b4211939bc142' })), index.h("div", { key: 'c8f8451e9ebc42e6ee16407a5ba9c6f6c32f4a66', class: "nv-sidebarnavitem-trailing" }, index.h("slot", { key: '2e901538498c62fe5a5bc21c76c66b493c215e32', name: "trailing" }), showNotificationBullet && !this.isSidebarCollapsed && (index.h("nv-notification-bullet", { key: '9a7c172f0b7dbf78068135344e469d261b80d368', count: this.notificationCount, size: notificationSize })), this.collapsible && (index.h("nv-icon", { key: 'f1caa3750edb35376d8b45121ffb443b033735d4', name: "chevron-down", size: "sm", class: "nv-sidebarnavitem-chevron" })))), this.collapsible && this.hasSubitems && (index.h("div", { key: '4b141fd9639afd78351b01df146866d4d091381f', class: "nv-sidebarnavitem-subitems", ref: el => {
|
|
274
273
|
// Only update ref and initialize if element changed or not yet initialized
|
|
275
274
|
if (el !== this.subitemsRef) {
|
|
276
275
|
this.subitemsRef = el;
|
|
@@ -285,7 +284,7 @@ const NvSidebarnavitem = class {
|
|
|
285
284
|
});
|
|
286
285
|
}
|
|
287
286
|
}
|
|
288
|
-
} }, index.h("slot", { key: '
|
|
287
|
+
} }, index.h("slot", { key: '6a38e07d0559b6eaf2fafb4c9928047a9cfd19b4', name: "subitems" })))));
|
|
289
288
|
}
|
|
290
289
|
get el() { return index.getElement(this); }
|
|
291
290
|
static get watchers() { return {
|
package/dist/cjs/{nv-sidebarnavsubitem.entry-Dt1jKmC-.js → nv-sidebarnavsubitem.entry-C0XDAzma.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.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: '7e9b3aaf42bc7ca19cc3ceeed4afc74058ea48f2', role: "listitem", "aria-current": this.active ? 'page' : undefined }, index.h("div", { key: 'd865d9cff0e9632dd0ca5f97334e09ae3ad6ddf8', class: "nv-sidebarnavsubitem-indicator" }), index.h("div", { key: '28bddb32eea17dbc3b33f2e1c3ef6744e6646cbe', class: "nv-sidebarnavsubitem-content" }, index.h("slot", { key: '0f58fbe30b054e42ac3f431cb8cafe0374994856' })), index.h("div", { key: '3b1b74c67b1e338e158a67dab828941f40f3a147', class: "nv-sidebarnavsubitem-trailing" }, index.h("slot", { key: '98ad3fde4a5295f6835ba6b15ac832fc0426b75b', name: "trailing" }))));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
NvSidebarnavsubitem.style = nvSidebarnavsubitemCss;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
7
7
|
|
|
8
|
-
const nvSplitCss = "nv-split{display:flex;width:100%;height:100%;position:relative}nv-split[direction=horizontal]{flex-direction:row}nv-split[direction=vertical]{flex-direction:column}nv-split .nv-split-gutter{position:absolute;z-index:10;background:transparent;display:flex;align-items:center;justify-content:center;flex:0 0 auto;transition:background-color 0.2s ease}nv-split .nv-split-gutter::after{content:\"\";position:absolute;background:var(--components-splitter-line-background);transition:background-color 0.2s ease}nv-split .nv-split-gutter:hover::after{background:var(--components-splitter-line-background-hover)}nv-split .nv-split-gutter::before{content:\"\";background:var(--components-splitter-handle-background);position:absolute;background-repeat:no-repeat;background-position:center;transition:all 0.2s ease;pointer-events:none}nv-split[direction=horizontal]>.nv-split-gutter{width:var(--splitter-gutter);top:0;bottom:0;transform:translateX(-50%);cursor:col-resize}nv-split[direction=horizontal]>.nv-split-gutter::after{width:var(--splitter-line-width);background-color:var(--components-splitter-line-background);height:100%;left:50%;top:0%;transform:translateX(-50%)}nv-split[direction=horizontal]>.nv-split-gutter:hover::after{background-color:var(--components-splitter-line-background-hover)}nv-split[direction=horizontal]>.nv-split-gutter:active::after{background-color:var(--components-splitter-line-background-active)}nv-split[direction=horizontal]>.nv-split-gutter::before{background-color:var(--components-splitter-handle-background);width:var(--splitter-handle-wide);height:var(--splitter-handle-long);border-radius:var(--splitter-handle-radius);z-index:11;transition:all 0.2s ease}nv-split[direction=horizontal]>.nv-split-gutter:hover::before{background-color:var(--components-splitter-handle-background-hover)}nv-split[direction=horizontal]>.nv-split-gutter:active::before{background-color:var(--components-splitter-handle-background-active)}nv-split[direction=vertical]>.nv-split-gutter{height:var(--splitter-gutter);left:0;right:0;transform:translateY(-50%);cursor:row-resize}nv-split[direction=vertical]>.nv-split-gutter::after{height:var(--splitter-line-width);background-color:var(--components-splitter-line-background);width:100%;top:50%;left:0%;transform:translateY(-50%)}nv-split[direction=vertical]>.nv-split-gutter:hover::after{background-color:var(--components-splitter-line-background-hover)}nv-split[direction=vertical]>.nv-split-gutter:active::after{background-color:var(--components-splitter-line-background-active)}nv-split[direction=vertical]>.nv-split-gutter::before{background-color:var(--components-splitter-handle-background);width:var(--splitter-handle-long);height:var(--splitter-handle-wide);border-radius:var(--splitter-handle-radius);z-index:11;transition:all 0.2s ease}nv-split[direction=vertical]>.nv-split-gutter:hover::before{background-color:var(--components-splitter-handle-background-hover)}nv-split[direction=vertical]>.nv-split-gutter:active::before{background-color:var(--components-splitter-handle-background-active)}nv-split[data-dragging=true]>.nv-split-gutter::after{background:var(--components-splitter-line-background-active)}nv-split>[slot=pane]{flex:1 1 auto;overflow:hidden;min-width:0;min-height:0;display:flex;flex-direction:column}nv-split>[slot=pane]>nv-split{flex:1 1 auto;width:100%;height:100%}";
|
|
8
|
+
const nvSplitCss = "nv-split{display:flex;width:100%;height:100%;position:relative}nv-split[direction=horizontal]{flex-direction:row}nv-split[direction=vertical]{flex-direction:column}nv-split .nv-split-gutter{position:absolute;z-index:10;background:transparent;display:flex;align-items:center;justify-content:center;flex:0 0 auto;transition:background-color 0.2s ease}nv-split .nv-split-gutter::after{content:\"\";position:absolute;background:var(--components-splitter-line-background);transition:background-color 0.2s ease}nv-split .nv-split-gutter:hover::after{background:var(--components-splitter-line-background-hover)}nv-split .nv-split-gutter::before{content:\"\";background:var(--components-splitter-handle-background);position:absolute;background-repeat:no-repeat;background-position:center;transition:all 0.2s ease;pointer-events:none}nv-split[direction=horizontal]>.nv-split-gutter{width:var(--splitter-gutter);top:0;bottom:0;transform:translateX(-50%);cursor:col-resize}nv-split[direction=horizontal]>.nv-split-gutter::after{width:var(--splitter-line-width);background-color:var(--components-splitter-line-background);height:100%;left:50%;top:0%;transform:translateX(-50%)}nv-split[direction=horizontal]>.nv-split-gutter:hover::after{background-color:var(--components-splitter-line-background-hover)}nv-split[direction=horizontal]>.nv-split-gutter:active::after{background-color:var(--components-splitter-line-background-active)}nv-split[direction=horizontal]>.nv-split-gutter::before{background-color:var(--components-splitter-handle-background);width:var(--splitter-handle-wide);height:var(--splitter-handle-long);border-radius:var(--splitter-handle-radius);z-index:11;transition:all 0.2s ease}nv-split[direction=horizontal]>.nv-split-gutter:hover::before{background-color:var(--components-splitter-handle-background-hover)}nv-split[direction=horizontal]>.nv-split-gutter:active::before{background-color:var(--components-splitter-handle-background-active)}nv-split[direction=vertical]>.nv-split-gutter{height:var(--splitter-gutter);left:0;right:0;transform:translateY(-50%);cursor:row-resize}nv-split[direction=vertical]>.nv-split-gutter::after{height:var(--splitter-line-width);background-color:var(--components-splitter-line-background);width:100%;top:50%;left:0%;transform:translateY(-50%)}nv-split[direction=vertical]>.nv-split-gutter:hover::after{background-color:var(--components-splitter-line-background-hover)}nv-split[direction=vertical]>.nv-split-gutter:active::after{background-color:var(--components-splitter-line-background-active)}nv-split[direction=vertical]>.nv-split-gutter::before{background-color:var(--components-splitter-handle-background);width:var(--splitter-handle-long);height:var(--splitter-handle-wide);border-radius:var(--splitter-handle-radius);z-index:11;transition:all 0.2s ease}nv-split[direction=vertical]>.nv-split-gutter:hover::before{background-color:var(--components-splitter-handle-background-hover)}nv-split[direction=vertical]>.nv-split-gutter:active::before{background-color:var(--components-splitter-handle-background-active)}nv-split[data-dragging=true]>.nv-split-gutter::after{background:var(--components-splitter-line-background-active)}nv-split>[slot=pane]{box-sizing:border-box;flex:1 1 auto;overflow:hidden;min-width:0;min-height:0;display:flex;flex-direction:column;margin:0 !important}nv-split>[slot=pane]>nv-split{flex:1 1 auto;width:100%;height:100%}";
|
|
9
9
|
|
|
10
10
|
const NvSplit = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -38,7 +38,7 @@ const NvSplit = class {
|
|
|
38
38
|
this.startPos = 0;
|
|
39
39
|
this.startSizes = [];
|
|
40
40
|
// Handlers stored to be able to detach them
|
|
41
|
-
this.onDocMove = (
|
|
41
|
+
this.onDocMove = (e) => this.handleMouseMove(e);
|
|
42
42
|
this.onDocUp = () => this.stopDragging();
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
@@ -59,18 +59,20 @@ const NvSplit = class {
|
|
|
59
59
|
componentDidLoad() {
|
|
60
60
|
// Initialization (once)
|
|
61
61
|
this.ensureGutters();
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
// Defer applySizes to ensure CSS (margins, padding) is computed
|
|
63
|
+
requestAnimationFrame(() => {
|
|
64
|
+
this.applySizes();
|
|
65
|
+
this.positionGutters();
|
|
66
|
+
});
|
|
67
|
+
// Observer: reposition gutters when resized
|
|
65
68
|
this.ro = new ResizeObserver(() => this.positionGutters());
|
|
66
69
|
this.ro.observe(this.el);
|
|
67
70
|
window.addEventListener('resize', () => this.positionGutters());
|
|
68
71
|
}
|
|
69
72
|
disconnectedCallback() {
|
|
70
|
-
var _a;
|
|
71
73
|
// Security cleanup (in case a drag was in progress)
|
|
72
74
|
this.detachDocumentListeners();
|
|
73
|
-
|
|
75
|
+
this.ro?.disconnect();
|
|
74
76
|
this.ro = undefined;
|
|
75
77
|
}
|
|
76
78
|
//#endregion
|
|
@@ -118,13 +120,12 @@ const NvSplit = class {
|
|
|
118
120
|
* @returns {Promise<void>}
|
|
119
121
|
*/
|
|
120
122
|
async destroy() {
|
|
121
|
-
var _a;
|
|
122
123
|
this.sizes = [];
|
|
123
124
|
this.isDragging = false;
|
|
124
125
|
this.dragIndex = -1;
|
|
125
126
|
this.removeOwnGutters();
|
|
126
127
|
this.detachDocumentListeners();
|
|
127
|
-
|
|
128
|
+
this.ro?.disconnect();
|
|
128
129
|
}
|
|
129
130
|
//#endregion
|
|
130
131
|
/****************************************************************************/
|
|
@@ -199,15 +200,14 @@ const NvSplit = class {
|
|
|
199
200
|
this.sizes = Array(n).fill(100 / n);
|
|
200
201
|
}
|
|
201
202
|
panes.forEach((pane, i) => {
|
|
202
|
-
|
|
203
|
-
const size = Math.max(0, (_a = this.sizes[i]) !== null && _a !== void 0 ? _a : 100 / n);
|
|
204
|
-
// Flex-basis via flex shorthand (https://developer.mozilla.org/en-US/docs/Web/CSS/flex)
|
|
203
|
+
const size = Math.max(0, this.sizes[i] ?? 100 / n);
|
|
205
204
|
pane.style.flex = `0 0 ${size}%`;
|
|
206
205
|
pane.style.minWidth = '0';
|
|
207
206
|
pane.style.minHeight = '0';
|
|
208
|
-
pane.style.overflow = 'hidden';
|
|
207
|
+
pane.style.overflow = 'hidden';
|
|
209
208
|
pane.style.display = 'flex';
|
|
210
209
|
pane.style.flexDirection = 'column';
|
|
210
|
+
pane.style.boxSizing = 'border-box';
|
|
211
211
|
});
|
|
212
212
|
this.positionGutters();
|
|
213
213
|
}
|
|
@@ -229,7 +229,6 @@ const NvSplit = class {
|
|
|
229
229
|
* Positions the gutters based on the current sizes of the panes.
|
|
230
230
|
*/
|
|
231
231
|
positionGutters() {
|
|
232
|
-
var _a, _b;
|
|
233
232
|
const panes = this.getPanes();
|
|
234
233
|
const gutters = this.getOwnGutters();
|
|
235
234
|
if (panes.length <= 1 || gutters.length === 0)
|
|
@@ -237,7 +236,7 @@ const NvSplit = class {
|
|
|
237
236
|
const horizontal = this.direction === 'horizontal';
|
|
238
237
|
let cumPct = 0;
|
|
239
238
|
for (let i = 0; i < gutters.length; i++) {
|
|
240
|
-
const sizePct =
|
|
239
|
+
const sizePct = this.sizes?.[i] ?? 100 / panes.length;
|
|
241
240
|
cumPct += sizePct;
|
|
242
241
|
const g = gutters[i];
|
|
243
242
|
g.style.position = 'absolute';
|
|
@@ -246,68 +245,70 @@ const NvSplit = class {
|
|
|
246
245
|
g.style.top = '0';
|
|
247
246
|
g.style.bottom = '0';
|
|
248
247
|
g.style.height = '100%';
|
|
248
|
+
g.style.transform = 'translateX(-50%)';
|
|
249
249
|
}
|
|
250
250
|
else {
|
|
251
251
|
g.style.top = `${cumPct}%`;
|
|
252
252
|
g.style.left = '0';
|
|
253
253
|
g.style.right = '0';
|
|
254
254
|
g.style.width = '100%';
|
|
255
|
+
g.style.transform = 'translateY(-50%)';
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
/**
|
|
259
260
|
* Starts the dragging process.
|
|
260
|
-
* @param {MouseEvent}
|
|
261
|
+
* @param {MouseEvent} e - The mouse event.
|
|
261
262
|
* @param {number} index - The index of the gutter.
|
|
262
263
|
*/
|
|
263
|
-
startDragging(
|
|
264
|
+
startDragging(e, index) {
|
|
265
|
+
e.preventDefault();
|
|
264
266
|
this.isDragging = true;
|
|
265
267
|
this.dragIndex = index;
|
|
266
|
-
this.startPos = this.direction === 'horizontal' ?
|
|
268
|
+
this.startPos = this.direction === 'horizontal' ? e.clientX : e.clientY;
|
|
267
269
|
this.startSizes = [...this.sizes];
|
|
268
270
|
this.attachDocumentListeners();
|
|
271
|
+
this.sizesChanged.emit([...this.sizes]);
|
|
269
272
|
}
|
|
270
273
|
/**
|
|
271
274
|
* Handles the mouse movement during dragging.
|
|
272
|
-
* @param {MouseEvent}
|
|
275
|
+
* @param {MouseEvent} e - The mouse event.
|
|
273
276
|
*/
|
|
274
|
-
handleMouseMove(
|
|
275
|
-
var _a, _b, _c, _d;
|
|
277
|
+
handleMouseMove(e) {
|
|
276
278
|
if (!this.isDragging || this.dragIndex < 0)
|
|
277
279
|
return;
|
|
278
280
|
const panes = this.getPanes();
|
|
279
281
|
if (panes.length < 2)
|
|
280
282
|
return;
|
|
281
283
|
const rect = this.el.getBoundingClientRect();
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const deltaPx = (this.direction === 'horizontal' ? ev.clientX : ev.clientY) -
|
|
286
|
-
this.startPos;
|
|
284
|
+
const horizontal = this.direction === 'horizontal';
|
|
285
|
+
const totalPx = Math.max(horizontal ? rect.width : rect.height, 1);
|
|
286
|
+
const deltaPx = (horizontal ? e.clientX : e.clientY) - this.startPos;
|
|
287
287
|
const deltaPct = (deltaPx / totalPx) * 100;
|
|
288
288
|
const i = this.dragIndex;
|
|
289
289
|
const j = i + 1;
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
const startLeft = this.startSizes[i];
|
|
291
|
+
const startRight = this.startSizes[j];
|
|
292
292
|
// minSizes (px) -> %
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const k = targetSum / (pairSum || 1);
|
|
302
|
-
left *= k;
|
|
303
|
-
right *= k;
|
|
293
|
+
let minLeftPct = ((this.minSizes?.[i] ?? 0) / totalPx) * 100;
|
|
294
|
+
let minRightPct = ((this.minSizes?.[j] ?? 0) / totalPx) * 100;
|
|
295
|
+
const minSum = minLeftPct + minRightPct;
|
|
296
|
+
const availableSum = startLeft + startRight;
|
|
297
|
+
if (minSum > availableSum) {
|
|
298
|
+
const scale = availableSum / minSum;
|
|
299
|
+
minLeftPct *= scale;
|
|
300
|
+
minRightPct *= scale;
|
|
304
301
|
}
|
|
302
|
+
const minDelta = minLeftPct - startLeft;
|
|
303
|
+
const maxDelta = startRight - minRightPct;
|
|
304
|
+
const clampedDelta = Math.min(Math.max(deltaPct, minDelta), maxDelta);
|
|
305
|
+
const left = startLeft + clampedDelta;
|
|
306
|
+
const right = startRight - clampedDelta;
|
|
305
307
|
const next = [...this.startSizes];
|
|
306
308
|
next[i] = left;
|
|
307
309
|
next[j] = right;
|
|
308
310
|
this.sizes = next;
|
|
309
311
|
this.applySizes();
|
|
310
|
-
this.sizesChanged.emit([...this.sizes]);
|
|
311
312
|
this.positionGutters();
|
|
312
313
|
}
|
|
313
314
|
/**
|
|
@@ -319,12 +320,13 @@ const NvSplit = class {
|
|
|
319
320
|
this.isDragging = false;
|
|
320
321
|
this.dragIndex = -1;
|
|
321
322
|
this.detachDocumentListeners();
|
|
323
|
+
this.sizesChanged.emit([...this.sizes]);
|
|
322
324
|
}
|
|
323
325
|
//#endregion
|
|
324
326
|
/****************************************************************************/
|
|
325
327
|
//#region RENDER
|
|
326
328
|
render() {
|
|
327
|
-
return (index.h(index.Host, { key: '
|
|
329
|
+
return (index.h(index.Host, { key: '850cf8fb9d492e1da39da0037c1fd8d414960d28', "data-dragging": this.isDragging.toString() }, index.h("slot", { key: '4d2f540ca147abe4778bcc0d02be2e87ee2cf3b4', name: "pane" }), index.h("slot", { key: '1ceb2dc6375c50fe7786ba03fb2a753f852980ba', name: "gutter" })));
|
|
328
330
|
}
|
|
329
331
|
get el() { return index.getElement(this); }
|
|
330
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-kU2nW5aN.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: '7b44b30e42b8df1c456f70b1f3be986e2fce1617', 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: 'd38b6f0c043959ed97b3e90d21309ab832713b4e' })));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
NvStack.style = nvStackCss;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -68,7 +68,7 @@ function calculateNewWidth(startWidth, delta, minWidth = TABLE_CONSTANTS.MIN_W)
|
|
|
68
68
|
* @returns {element is HTMLTableCellElement} Type guard for table cell elements
|
|
69
69
|
*/
|
|
70
70
|
function isValidTableCell(element) {
|
|
71
|
-
return
|
|
71
|
+
return element?.tagName === 'TH' || element?.tagName === 'TD';
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Finds the closest table cell element from an event target
|
|
@@ -88,12 +88,11 @@ function getClosestTableCell(target) {
|
|
|
88
88
|
* @returns {boolean} True if capture was successfully set
|
|
89
89
|
*/
|
|
90
90
|
function setPointerCapture(cell, pointerId) {
|
|
91
|
-
var _a;
|
|
92
91
|
try {
|
|
93
|
-
|
|
92
|
+
cell.setPointerCapture?.(pointerId);
|
|
94
93
|
return true;
|
|
95
94
|
}
|
|
96
|
-
catch
|
|
95
|
+
catch {
|
|
97
96
|
return false;
|
|
98
97
|
}
|
|
99
98
|
}
|
|
@@ -104,12 +103,11 @@ function setPointerCapture(cell, pointerId) {
|
|
|
104
103
|
* @returns {boolean} True if release was successful
|
|
105
104
|
*/
|
|
106
105
|
function releasePointerCapture(cell, pointerId) {
|
|
107
|
-
var _a;
|
|
108
106
|
try {
|
|
109
|
-
|
|
107
|
+
cell.releasePointerCapture?.(pointerId);
|
|
110
108
|
return true;
|
|
111
109
|
}
|
|
112
|
-
catch
|
|
110
|
+
catch {
|
|
113
111
|
return false;
|
|
114
112
|
}
|
|
115
113
|
}
|
|
@@ -236,7 +234,7 @@ const NvTable = class {
|
|
|
236
234
|
/****************************************************************************/
|
|
237
235
|
//#region RENDER
|
|
238
236
|
render() {
|
|
239
|
-
return (index.h(index.Host, { key: '
|
|
237
|
+
return (index.h(index.Host, { key: '6d13efcd059cca60b2f6bc092b75b65e36738913' }, index.h("slot", { key: '33c715acec9e561586c9059f20e77b403307c134' })));
|
|
240
238
|
}
|
|
241
239
|
get host() { return index.getElement(this); }
|
|
242
240
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -31,7 +31,7 @@ const NvTableheader = class {
|
|
|
31
31
|
cycleSortDirection(e) {
|
|
32
32
|
if (!this.sortable)
|
|
33
33
|
return;
|
|
34
|
-
e
|
|
34
|
+
e?.preventDefault();
|
|
35
35
|
const next = {
|
|
36
36
|
none: 'asc',
|
|
37
37
|
asc: 'desc',
|
|
@@ -62,7 +62,7 @@ const NvTableheader = class {
|
|
|
62
62
|
/****************************************************************************/
|
|
63
63
|
//#region RENDER
|
|
64
64
|
render() {
|
|
65
|
-
return (index.h(index.Host, { key: '
|
|
65
|
+
return (index.h(index.Host, { key: 'ae56ba389e554b3b555a1f29dba6a2c434e4a0ea', role: "columnheader", "aria-sort": this.ariaSort, tabindex: this.sortable ? 0 : undefined, onKeyDown: this.handleKeyDown.bind(this), onClick: this.cycleSortDirection.bind(this) }, index.h("slot", { key: '55efe6331ebcbde6b9b37f7d8dec610e444dc4b1' }), this.sortable && (index.h("span", { key: 'ecde17447218e6d462504cb10bdc8b95266ce402', class: "sort-icon-wrap", "aria-hidden": "true" }, index.h("nv-iconbutton", { key: 'c6e18e4149d2805cb16d5a79ec29db85a656b42c', disableTabindex: true, name: "arrow-up", size: "xs", emphasis: this.sortDirection === 'none' ? 'lower' : 'low',
|
|
66
66
|
// prevent mousedown from selecting text
|
|
67
67
|
onMouseDown: (e) => e.preventDefault(), class: {
|
|
68
68
|
'is-none': this.sortDirection === 'none',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
5
|
var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
|
|
6
6
|
require('@stencil/react-output-target/runtime');
|
|
@@ -66,8 +66,8 @@ const NvToggle = class {
|
|
|
66
66
|
/****************************************************************************/
|
|
67
67
|
//#region RENDER
|
|
68
68
|
render() {
|
|
69
|
-
return (index.h(index.Host, { key: '
|
|
70
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
69
|
+
return (index.h(index.Host, { key: 'bf104d1513a3cf741c6b42ab48554c40d19263d1', class: clsxChV9xqsO.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '8c7e9684887e0d454a69101fb83f290d26236841', class: "input-container" }, index.h("input", { key: '5771d8999e03247600a2b98d0eae985ff0345e28', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), index.h("div", { key: '8c95821037235c2eab053bce5bb7a0dc15173ea4', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '36c1d110f4c9151e1d05c665546f01f323999b15', htmlFor: this.inputId, class: clsxChV9xqsO.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: '4fe3f5fab8c1a20480c9eba085221afc36caae73', name: "label" }, this.label))), (this.description ||
|
|
70
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '63dc983d3b09327f57bd62feb7a25865f90390a7', class: "description" }, index.h("slot", { key: 'e85b616e8bf1301e53f62a2c4e1ea87675b1dcff', name: "description" }, this.description))))));
|
|
71
71
|
}
|
|
72
72
|
static get formAssociated() { return true; }
|
|
73
73
|
get el() { return index.getElement(this); }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
|
+
require('@stencil/react-output-target/runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
|
|
8
|
+
const nvTogglebuttonCss = "nv-togglebutton{display:inline-flex;justify-content:center;align-items:center}nv-togglebutton:focus-visible,nv-togglebutton:has(:focus-visible){z-index:1}nv-togglebutton[size=xs]{padding:var(--button-xs-padding-y) var(--button-xs-padding-x);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);height:var(--button-xs-height);font-size:var(--button-xs-font-size)}nv-togglebutton[size=xs] nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-togglebutton[size=xs]{padding-top:calc(var(--togglegroup-xs-button-padding-y) - var(--togglegroup-stroke));padding-bottom:calc(var(--togglegroup-xs-button-padding-y) - var(--togglegroup-stroke));border-radius:var(--togglegroup-xs-button-radius);height:calc((var(--togglegroup-xs-height)) - var(--togglegroup-inner-space));border-width:0}nv-togglebutton[size=sm]{padding:var(--button-sm-padding-y) var(--button-sm-padding-x);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);height:var(--button-sm-height);font-size:var(--button-sm-font-size)}nv-togglebutton[size=sm] nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-togglebutton[size=sm]{padding-top:calc(var(--togglegroup-sm-button-padding-y) - var(--togglegroup-stroke));padding-bottom:calc(var(--togglegroup-sm-button-padding-y) - var(--togglegroup-stroke));border-radius:calc(var(--togglegroup-sm-button-radius) + 1px);height:calc((var(--togglegroup-sm-height)) - var(--togglegroup-inner-space));border-width:0}nv-togglebutton[size=md]{padding:var(--button-md-padding-y) var(--button-md-padding-x);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);height:var(--button-md-height);font-size:var(--button-md-font-size)}nv-togglebutton[size=md] nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-togglebutton[size=md]{padding-top:calc(var(--togglegroup-md-button-padding-y) - var(--togglegroup-stroke));padding-bottom:calc(var(--togglegroup-md-button-padding-y) - var(--togglegroup-stroke));border-radius:calc(var(--togglegroup-md-button-radius) + 1px);height:calc((var(--togglegroup-md-height)) - var(--togglegroup-inner-space));border-width:0}nv-togglebutton[size=lg]{padding:var(--button-lg-padding-y) var(--button-lg-padding-x);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);height:var(--button-lg-height);font-size:var(--button-lg-font-size)}nv-togglebutton[size=lg] nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-togglebutton[size=lg]{padding-top:calc(var(--togglegroup-lg-button-padding-y) - var(--togglegroup-stroke));padding-bottom:calc(var(--togglegroup-lg-button-padding-y) - var(--togglegroup-stroke));border-radius:calc(var(--togglegroup-lg-button-radius) + 1px);height:calc((var(--togglegroup-lg-height)) - var(--togglegroup-inner-space));border-width:0}nv-togglebutton[emphasis=high]{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-togglebutton[emphasis=high]:hover{background:var(--components-button-low-background-hover);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text-hover)}nv-togglebutton[emphasis=high]:active{background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-togglebutton[emphasis=high]:focus,nv-togglebutton[emphasis=high]:focus-within{outline:none}nv-togglebutton[emphasis=high]:focus-visible,nv-togglebutton[emphasis=high]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-togglebutton[emphasis=high]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-togglebutton[emphasis=high][active]:not([active=false]){background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-togglebutton[emphasis=low]{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-togglebutton[emphasis=low]:hover{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}nv-togglebutton[emphasis=low]:active{background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-togglebutton[emphasis=low]:focus,nv-togglebutton[emphasis=low]:focus-within{outline:none}nv-togglebutton[emphasis=low]:focus-visible,nv-togglebutton[emphasis=low]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-togglebutton[emphasis=low]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-togglebutton[emphasis=low][active]:not([active=false]),nv-togglebutton[emphasis=low]:active{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}";
|
|
9
|
+
|
|
10
|
+
const NvTogglebutton = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.toggled = index.createEvent(this, "toggled", 7);
|
|
14
|
+
/****************************************************************************/
|
|
15
|
+
//#region PROPERTIES
|
|
16
|
+
/**
|
|
17
|
+
* Determines how large or small the togglebutton appears, allowing for
|
|
18
|
+
* customization of the togglebutton's dimensions to fit different design
|
|
19
|
+
* specifications and user needs.
|
|
20
|
+
*/
|
|
21
|
+
this.size = 'md';
|
|
22
|
+
/**
|
|
23
|
+
* Prevents all interaction, rendering the toggle in a non-interactive state.
|
|
24
|
+
*/
|
|
25
|
+
this.disabled = false;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the button is active or not. Will not toggle automatically but
|
|
28
|
+
* needs to be controlled externally.
|
|
29
|
+
*/
|
|
30
|
+
this.active = false;
|
|
31
|
+
/**
|
|
32
|
+
* Make it more or less visually prominent to users.
|
|
33
|
+
*/
|
|
34
|
+
this.emphasis = 'high';
|
|
35
|
+
//#endregion PROPERTIES
|
|
36
|
+
/****************************************************************************/
|
|
37
|
+
//#region METHODS
|
|
38
|
+
this.handleClick = () => {
|
|
39
|
+
if (this.disabled)
|
|
40
|
+
return;
|
|
41
|
+
this.toggled.emit({
|
|
42
|
+
value: this.value,
|
|
43
|
+
active: this.active,
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion METHODS
|
|
48
|
+
/****************************************************************************/
|
|
49
|
+
//#region LISTENERS
|
|
50
|
+
handleKeyDown(event) {
|
|
51
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
this.el.click();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/* eslint-enable nova/event-bubbling */
|
|
57
|
+
//#endregion EVENTS
|
|
58
|
+
/****************************************************************************/
|
|
59
|
+
//#region RENDER
|
|
60
|
+
render() {
|
|
61
|
+
return (index.h(index.Host, { key: 'af68f5f4887be35f48bb74f15f597e7fe575b3fd', role: "button", tabindex: "0", "aria-pressed": String(this.active), onClick: this.handleClick }, index.h("slot", { key: '624ab0edc86bf9b5686f3f99097adf82ea972764' })));
|
|
62
|
+
}
|
|
63
|
+
get el() { return index.getElement(this); }
|
|
64
|
+
};
|
|
65
|
+
NvTogglebutton.style = nvTogglebuttonCss;
|
|
66
|
+
|
|
67
|
+
exports.nv_togglebutton = NvTogglebutton;
|
package/dist/cjs/{nv-togglebuttongroup.entry-BYXX5ejg.js → nv-togglebuttongroup.entry-C0NLbsq7.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
7
7
|
|
|
8
|
-
const nvTogglebuttongroupCss = "nv-togglebuttongroup{display:flex;gap:var(--togglegroup-lg-gap);border-radius:var(--togglegroup-lg-radius);width:fit-content;padding:var(--togglegroup-lg-gap)}nv-togglebuttongroup[emphasis=high]{border:1px solid var(--components-togglegroup-high-border)}nv-togglebuttongroup[emphasis=low]{border:1px solid var(--components-togglegroup-low-border)}nv-togglebuttongroup[size=xs]{padding:calc(var(--togglegroup-xs-padding) - 1px);gap:var(--togglegroup-xs-gap);border-radius:var(--togglegroup-xs-radius)}nv-togglebuttongroup[size=sm]{padding:calc(var(--togglegroup-sm-padding) - 1px);gap:var(--togglegroup-sm-gap);border-radius:var(--togglegroup-sm-radius)}nv-togglebuttongroup[size=md]{padding:calc(var(--togglegroup-md-padding) - 1px);gap:var(--togglegroup-md-gap);border-radius:var(--togglegroup-md-radius)}nv-togglebuttongroup[size=lg]{padding:calc(var(--togglegroup-lg-padding) - 1px);gap:var(--togglegroup-lg-gap);border-radius:var(--togglegroup-lg-radius)}";
|
|
8
|
+
const nvTogglebuttongroupCss = "nv-togglebuttongroup{display:flex;gap:var(--togglegroup-lg-gap);border-radius:var(--togglegroup-lg-radius);width:fit-content;padding:var(--togglegroup-lg-gap)}nv-togglebuttongroup[emphasis=high]{border:1px solid var(--components-togglegroup-high-border)}nv-togglebuttongroup[emphasis=low]{border:1px solid var(--components-togglegroup-low-border)}nv-togglebuttongroup[size=xs]{padding:calc(var(--togglegroup-xs-padding) - 1px);gap:var(--togglegroup-xs-gap);border-radius:var(--togglegroup-xs-radius);height:var(--togglegroup-xs-height)}nv-togglebuttongroup[size=sm]{padding:calc(var(--togglegroup-sm-padding) - 1px);gap:var(--togglegroup-sm-gap);border-radius:var(--togglegroup-sm-radius);height:var(--togglegroup-sm-height)}nv-togglebuttongroup[size=md]{padding:calc(var(--togglegroup-md-padding) - 1px);gap:var(--togglegroup-md-gap);border-radius:var(--togglegroup-md-radius);height:var(--togglegroup-md-height)}nv-togglebuttongroup[size=lg]{padding:calc(var(--togglegroup-lg-padding) - 1px);gap:var(--togglegroup-lg-gap);border-radius:var(--togglegroup-lg-radius);height:var(--togglegroup-lg-height)}";
|
|
9
9
|
|
|
10
10
|
const NvTogglebuttongroup = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -38,11 +38,10 @@ const NvTogglebuttongroup = class {
|
|
|
38
38
|
*/
|
|
39
39
|
this.setActiveToggleButtons = () => {
|
|
40
40
|
this.el.querySelectorAll('nv-togglebutton').forEach(toggleButtonEl => {
|
|
41
|
-
var _a;
|
|
42
41
|
const btn = NvTogglebuttongroup.asToggleButton(toggleButtonEl);
|
|
43
42
|
if (!btn)
|
|
44
43
|
return;
|
|
45
|
-
btn.active = (
|
|
44
|
+
btn.active = (this.value ?? []).includes(btn.value);
|
|
46
45
|
});
|
|
47
46
|
};
|
|
48
47
|
/**
|
|
@@ -159,7 +158,7 @@ const NvTogglebuttongroup = class {
|
|
|
159
158
|
/****************************************************************************/
|
|
160
159
|
//#region RENDER
|
|
161
160
|
render() {
|
|
162
|
-
return (index.h(index.Host, { key: '
|
|
161
|
+
return (index.h(index.Host, { key: '2d4f46a06045c84018b0a5c296b2eb19c2803d7a' }, index.h("slot", { key: '4f387071fe030057df13c6b3ff5e6f480fcd339b' })));
|
|
163
162
|
}
|
|
164
163
|
get el() { return index.getElement(this); }
|
|
165
164
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -46,7 +46,7 @@ const NvTooltip = class {
|
|
|
46
46
|
/****************************************************************************/
|
|
47
47
|
//#region RENDER
|
|
48
48
|
render() {
|
|
49
|
-
return (index.h(index.Host, { key: '
|
|
49
|
+
return (index.h(index.Host, { key: '3b0a7e6159b2e0a23af58ad0e8e3567f05373954' }, index.h("slot", { key: 'bfb982166e2f6f96c11cc745905a3c0ffd8f575e' }), index.h("nv-popover", { key: 'c14b0fa83f861ae828b14ab16cbd562dde6032ba', triggerMode: "hover", hasArrow: true, placement: this.placement, strategy: this.strategy, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay, onOpenChanged: e => this.openChanged.emit(e.detail) }, index.h("p", { key: '67701f81afc4c2e36f8ab7266aee3f2e457a4755', slot: "content" }, this.message), index.h("slot", { key: 'c57c2463744e2e2afc5bbd64c4838a733a77aca9', name: "content" }))));
|
|
50
50
|
}
|
|
51
51
|
get el() { return index.getElement(this); }
|
|
52
52
|
};
|