@nova-design-system/nova-react 3.23.0 → 3.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/dom.utils-CuXVGECR-8VY5SfMZ.js +177 -0
- package/dist/cjs/events.utils-B6GgGra--01N__3wY.js +23 -0
- package/dist/cjs/generated/components.server.js +124 -58
- package/dist/cjs/{grow.animation-CvHGHBL4-DDIEYBK-.js → grow.animation-D7ep_aVl-BuXEDSK-.js} +0 -21
- package/dist/cjs/{i18n.utils-DOZbXX2L-BizoXo6c.js → i18n.utils-IlwlcG9l-ku0bScip.js} +14 -18
- package/dist/cjs/index-DUlunl9a.js +9696 -0
- package/dist/cjs/{nv-dialog.entry-O47Eol_7.js → index.esm-D3eWMME9-CG1TVKfu.js} +1 -296
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/{nv-accordion-item.entry-B_l0-ux0.js → nv-accordion-item.entry-CqnjIt4R.js} +8 -7
- package/dist/cjs/{nv-accordion.entry-BX8_YuZF.js → nv-accordion.entry-Dx7FmGg_.js} +11 -14
- package/dist/cjs/{nv-alert.entry-DCWYR0OK.js → nv-alert.entry-BL3Pdcxd.js} +7 -6
- package/dist/cjs/nv-avatar.entry-2dFR4I9_.js +68 -0
- package/dist/cjs/nv-badge_2.entry-5FShR2Ax.js +218 -0
- package/dist/cjs/nv-breadcrumb.entry-Cfi32bBT.js +49 -0
- package/dist/cjs/nv-breadcrumbs.entry-BSgn3KUO.js +21 -0
- package/dist/cjs/nv-button.entry-BdQQ_LE7.js +166 -0
- package/dist/cjs/{nv-buttongroup.entry-BZaTKN_n.js → nv-buttongroup.entry-BM8CwXFK.js} +13 -7
- package/dist/cjs/{nv-calendar.entry-D9ESuu7C.js → nv-calendar.entry-CeKsMGOa.js} +39 -32
- package/dist/cjs/nv-col.entry-D-h2PGcz.js +38 -0
- package/dist/cjs/{nv-datagrid.entry-DcB5q2oC.js → nv-datagrid.entry-nOBIfqOS.js} +113 -255
- package/dist/cjs/{nv-datagridcolumn.entry-BhKOzXA6.js → nv-datagridcolumn.entry-BAzTU_KM.js} +2 -2
- package/dist/cjs/nv-dialog.entry-Bi2ZVSe2.js +299 -0
- package/dist/cjs/{nv-dialogfooter_2.entry-Dn16bI8a.js → nv-dialogfooter_2.entry-D6lzC-3S.js} +11 -29
- package/dist/cjs/nv-drawer.entry-Dp4AfBiF.js +445 -0
- package/dist/cjs/nv-drawerfooter_2.entry-DpWSsq6d.js +128 -0
- package/dist/cjs/nv-fieldcheckbox.entry-COA3LXnX.js +179 -0
- package/dist/cjs/{nv-fielddate.entry-B4P0U8QG.js → nv-fielddate.entry-B8r5RFXd.js} +20 -21
- package/dist/cjs/{nv-fielddaterange.entry-BORwYJ-k.js → nv-fielddaterange.entry-C6_Kq93P.js} +20 -19
- package/dist/cjs/{nv-fielddropdown.entry-DzBAIynY.js → nv-fielddropdown.entry-B2Dr5zHd.js} +51 -58
- package/dist/cjs/nv-fielddropdownitem.entry-DapivVnR.js +69 -0
- package/dist/cjs/{nv-fieldmultiselect.entry-DiqRreWh.js → nv-fieldmultiselect.entry-DSpQeiPx.js} +45 -49
- package/dist/cjs/nv-fieldnumber.entry-BwxR9sRr.js +189 -0
- package/dist/cjs/nv-fieldpassword.entry-BOSU-Skh.js +167 -0
- package/dist/cjs/nv-fieldradio.entry-ZFafNY5_.js +105 -0
- package/dist/cjs/nv-fieldselect.entry-CfWjQAd9.js +405 -0
- package/dist/cjs/{nv-fieldslider.entry-CozmnUfN.js → nv-fieldslider.entry-dDPcWUxs.js} +34 -16
- package/dist/cjs/nv-fieldtext.entry-Yaa-mkjJ.js +163 -0
- package/dist/cjs/{nv-fieldtextarea.entry-7UrKWDHg.js → nv-fieldtextarea.entry-Dp_l2pKZ.js} +18 -13
- package/dist/cjs/{nv-fieldtime.entry-DakOlLiO.js → nv-fieldtime.entry-CWxi4Uel.js} +38 -40
- package/dist/cjs/{nv-icon.entry-Db00kB2u.js → nv-icon.entry-Dci11W9S.js} +5 -5
- package/dist/cjs/nv-iconbutton_2.entry-A6FKFJT_.js +171 -0
- package/dist/cjs/{nv-menu.entry-CK2HdmBt.js → nv-menu.entry-BHaYP-9M.js} +11 -16
- package/dist/cjs/nv-menuitem.entry-Cm1vvN25.js +59 -0
- package/dist/cjs/nv-notification-bullet.entry-DRlS3Ybc.js +76 -0
- package/dist/cjs/nv-notification.entry-BeDmR-XC.js +176 -0
- package/dist/cjs/nv-notificationcontainer.entry-C3p_87Dg.js +41 -0
- package/dist/cjs/nv-paginationtable.entry-BzEqQOBa.js +231 -0
- package/dist/cjs/{nv-popover.entry-mLdLSp6n.js → nv-popover.entry-D2oFn9vL.js} +118 -46
- package/dist/cjs/nv-row.entry-hV1kxmrr.js +22 -0
- package/dist/cjs/{nv-sidebar.entry-inDVNJ4s.js → nv-sidebar.entry-BJrqJ8K7.js} +12 -8
- package/dist/cjs/nv-sidebarcontent.entry-CPfGF7nx.js +22 -0
- package/dist/cjs/{nv-sidebardivider.entry-D_yern0R.js → nv-sidebardivider.entry-D2wmzHCO.js} +4 -4
- package/dist/cjs/{nv-sidebarfooter.entry-Rkkn9TB_.js → nv-sidebarfooter.entry-C7fqCzjH.js} +4 -4
- package/dist/cjs/nv-sidebargroup.entry-qkXnxhs_.js +23 -0
- package/dist/cjs/{nv-sidebarheader.entry-CYpD_4pI.js → nv-sidebarheader.entry-DBsOmyQ0.js} +4 -4
- package/dist/cjs/{nv-sidebarlogo.entry-BgK03M1v.js → nv-sidebarlogo.entry-902Ht3UR.js} +4 -4
- package/dist/cjs/{nv-sidebarnavitem.entry-DglvcCOD.js → nv-sidebarnavitem.entry-CICrllp8.js} +11 -10
- package/dist/cjs/nv-sidebarnavsubitem.entry-Q9jjU_7D.js +35 -0
- package/dist/cjs/{nv-split.entry-mzg2F66T.js → nv-split.entry-BYIsE2wp.js} +51 -45
- package/dist/cjs/nv-stack.entry-DgE5ASGH.js +31 -0
- package/dist/cjs/{nv-table.entry-DkbNgxtI.js → nv-table.entry-DHXBu2n1.js} +9 -11
- package/dist/cjs/{nv-tableheader.entry-CRVFTQA-.js → nv-tableheader.entry-BijgOxcO.js} +5 -5
- package/dist/cjs/nv-toggle.entry-CMI1WdvV.js +82 -0
- package/dist/cjs/nv-togglebutton.entry-DAPETEmF.js +66 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-BYXX5ejg.js → nv-togglebuttongroup.entry-CzDI1XCr.js} +14 -11
- package/dist/cjs/nv-tooltip.entry-DPoUP9iL.js +56 -0
- package/dist/cjs/slide.animation-CmH5d1of-BZuw607U.js +90 -0
- package/dist/components/NvDatatable/NvDatatable.js +69 -32
- package/dist/generated/components.js +38 -0
- package/dist/generated/components.server.js +120 -58
- package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
- package/dist/types/components/NvDatatable/types.d.ts +13 -3
- package/dist/types/generated/components.d.ts +63 -43
- package/dist/types/generated/components.server.d.ts +63 -43
- package/package.json +2 -2
- package/dist/cjs/index-CtjeeUI-.js +0 -39617
- package/dist/cjs/nv-avatar.entry-C_xZD3Lp.js +0 -68
- package/dist/cjs/nv-badge_2.entry-JjqANStV.js +0 -213
- package/dist/cjs/nv-breadcrumb.entry-DQZDn6cm.js +0 -46
- package/dist/cjs/nv-breadcrumbs.entry-Bz0GjhY_.js +0 -21
- package/dist/cjs/nv-button.entry-Br1DH9Vj.js +0 -164
- package/dist/cjs/nv-col.entry-CfgPMMxS.js +0 -38
- package/dist/cjs/nv-fieldcheckbox.entry-Bx6ArV_b.js +0 -177
- package/dist/cjs/nv-fielddropdownitem.entry-C_17isWd.js +0 -73
- package/dist/cjs/nv-fieldnumber.entry-C9O4UPp3.js +0 -187
- package/dist/cjs/nv-fieldpassword.entry-BfVJNT0A.js +0 -165
- package/dist/cjs/nv-fieldradio.entry-CG22oETM.js +0 -103
- package/dist/cjs/nv-fieldselect.entry-BPQEtrv2.js +0 -397
- package/dist/cjs/nv-fieldtext.entry-BD-z01ru.js +0 -163
- package/dist/cjs/nv-iconbutton_2.entry-CaKCa8NT.js +0 -168
- package/dist/cjs/nv-menuitem.entry-mKMqCAdz.js +0 -60
- package/dist/cjs/nv-notification-bullet.entry-DtbjtFxs.js +0 -77
- package/dist/cjs/nv-notification.entry-CLb0gNu3.js +0 -262
- package/dist/cjs/nv-notificationcontainer.entry-Cijivlm6.js +0 -41
- package/dist/cjs/nv-row.entry-C2C94fcv.js +0 -22
- package/dist/cjs/nv-sidebarcontent.entry-DxoljE15.js +0 -22
- package/dist/cjs/nv-sidebargroup.entry-C1p9qqxr.js +0 -23
- package/dist/cjs/nv-sidebarnavsubitem.entry-Dt1jKmC-.js +0 -35
- package/dist/cjs/nv-stack.entry-nnvjTrBy.js +0 -31
- package/dist/cjs/nv-toggle.entry-oC9TVkr1.js +0 -80
- package/dist/cjs/nv-togglebutton.entry-BTWCzbS9.js +0 -67
- package/dist/cjs/nv-tooltip.entry-OJGxfJEh.js +0 -55
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-CtjeeUI-.js');
|
|
4
|
-
var grow_animationCvHGHBL4 = require('./grow.animation-CvHGHBL4-DDIEYBK-.js');
|
|
5
|
-
var fade_animationDcRL9lcm = require('./fade.animation-DcRL9lcm-DAZeHoKN.js');
|
|
6
|
-
require('./style-value-types.es-xlgmw4x8-B1vLqX9m.js');
|
|
7
|
-
var timeline_animationCgHCo_Ho = require('./timeline.animation-CgHCo_Ho-KteJaZPb.js');
|
|
8
|
-
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
9
|
-
var constantsBReL3Lsa = require('./constants-BReL3Lsa-DpB_ghPF.js');
|
|
10
|
-
var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
|
|
11
|
-
require('@stencil/react-output-target/runtime');
|
|
12
|
-
require('react');
|
|
13
|
-
require('react-dom');
|
|
14
|
-
|
|
15
3
|
/*!
|
|
16
4
|
* tabbable 6.2.0
|
|
17
5
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
@@ -546,287 +534,4 @@ var tabbable = function tabbable(container, options) {
|
|
|
546
534
|
return sortByOrder(candidates);
|
|
547
535
|
};
|
|
548
536
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
const NvDialog = class {
|
|
552
|
-
constructor(hostRef) {
|
|
553
|
-
index.registerInstance(this, hostRef);
|
|
554
|
-
this.openChanged = index.createEvent(this, "openChanged", 3);
|
|
555
|
-
this.eventsAttached = false;
|
|
556
|
-
this.triggerClickEvents = [
|
|
557
|
-
['click', this.show],
|
|
558
|
-
[
|
|
559
|
-
'keydown',
|
|
560
|
-
(e) => {
|
|
561
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
562
|
-
e.preventDefault();
|
|
563
|
-
this.show();
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
],
|
|
567
|
-
];
|
|
568
|
-
/**
|
|
569
|
-
* Use this prop to toggle the visibility of the dialog. Set to true to show
|
|
570
|
-
* the dialog and false to hide it.
|
|
571
|
-
*/
|
|
572
|
-
this.open = false;
|
|
573
|
-
/**
|
|
574
|
-
* If true, the dialog cannot be closed by the user.
|
|
575
|
-
*/
|
|
576
|
-
this.undismissable = false;
|
|
577
|
-
/**
|
|
578
|
-
* If true, the dialog will be closed when the backdrop is clicked.
|
|
579
|
-
*/
|
|
580
|
-
this.clickOutside = false;
|
|
581
|
-
/**
|
|
582
|
-
* If true, the dialog visibility is managed manually through methods or the
|
|
583
|
-
* open prop.
|
|
584
|
-
*/
|
|
585
|
-
this.controlled = false;
|
|
586
|
-
/**
|
|
587
|
-
* If true, the dialog takes full width styling.
|
|
588
|
-
*/
|
|
589
|
-
this.full = false;
|
|
590
|
-
/**
|
|
591
|
-
* Controls whether the dialog should automatically focus the first focusable
|
|
592
|
-
* element when opened. When disabled, prevents unwanted tooltip triggers on
|
|
593
|
-
* dialog open.
|
|
594
|
-
*/
|
|
595
|
-
this.autofocus = false;
|
|
596
|
-
/**
|
|
597
|
-
* Checks for and sets up form ID if a form is present
|
|
598
|
-
*/
|
|
599
|
-
this.checkForForm = () => {
|
|
600
|
-
if (!this.form) {
|
|
601
|
-
const formElement = this.el.querySelector('form');
|
|
602
|
-
if (formElement) {
|
|
603
|
-
this.form = this.ensureFormId(formElement);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
/**
|
|
608
|
-
* Handles the native dialog close event.
|
|
609
|
-
*/
|
|
610
|
-
this.handleDialogClose = () => {
|
|
611
|
-
if (this.open) {
|
|
612
|
-
this.close();
|
|
613
|
-
}
|
|
614
|
-
};
|
|
615
|
-
/**
|
|
616
|
-
* Handles the click event to close the dialog when clickOutside is true.
|
|
617
|
-
* @param {MouseEvent} event - The click event.
|
|
618
|
-
*/
|
|
619
|
-
this.handleDialogClick = (event) => {
|
|
620
|
-
if (!this.clickOutside || this.undismissable)
|
|
621
|
-
return;
|
|
622
|
-
if (this.checkForOpenPopovers())
|
|
623
|
-
return;
|
|
624
|
-
if (event.target === this.backdropElement) {
|
|
625
|
-
this.close();
|
|
626
|
-
event.preventDefault();
|
|
627
|
-
event.stopPropagation();
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
this.checkForOpenPopovers = () => {
|
|
631
|
-
let hasOpenPopover = false;
|
|
632
|
-
this.el.querySelectorAll('nv-popover').forEach(popover => {
|
|
633
|
-
if (popover.hasAttribute('open')) {
|
|
634
|
-
hasOpenPopover = true;
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
return hasOpenPopover;
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
//#endregion PROPERTIES
|
|
641
|
-
/****************************************************************************/
|
|
642
|
-
//#region METHODS
|
|
643
|
-
/**
|
|
644
|
-
* Call this method to show the dialog, making it visible on the screen.
|
|
645
|
-
*/
|
|
646
|
-
async show() {
|
|
647
|
-
this.open = true;
|
|
648
|
-
this.preventScroll();
|
|
649
|
-
/** It is recommended to use the .show() or .showModal() method to render
|
|
650
|
-
* dialogs, rather than the open attribute. If a <dialog> is opened using
|
|
651
|
-
* the open attribute, it is non-modal. */
|
|
652
|
-
const { setFadeOut } = fade_animationDcRL9lcm.useFade(this.dialogElement);
|
|
653
|
-
setFadeOut();
|
|
654
|
-
this.dialogElement.showModal();
|
|
655
|
-
const { setGrowIn, growIn } = grow_animationCvHGHBL4.useGrow(this.contentElement, {
|
|
656
|
-
duration: 100,
|
|
657
|
-
amount: 0.9,
|
|
658
|
-
});
|
|
659
|
-
const { fadeIn } = fade_animationDcRL9lcm.useFade(this.dialogElement, {
|
|
660
|
-
duration: 100,
|
|
661
|
-
});
|
|
662
|
-
setGrowIn();
|
|
663
|
-
await timeline_animationCgHCo_Ho.parallel(fadeIn, growIn).start();
|
|
664
|
-
}
|
|
665
|
-
/**
|
|
666
|
-
* Call this method to hide the dialog, making it disappear from view.
|
|
667
|
-
*/
|
|
668
|
-
async close() {
|
|
669
|
-
this.open = false;
|
|
670
|
-
this.allowScroll();
|
|
671
|
-
const { growOut } = grow_animationCvHGHBL4.useGrow(this.contentElement, {
|
|
672
|
-
duration: 150,
|
|
673
|
-
amount: 0.85,
|
|
674
|
-
});
|
|
675
|
-
const { fadeOut } = fade_animationDcRL9lcm.useFade(this.dialogElement, {
|
|
676
|
-
duration: 150,
|
|
677
|
-
});
|
|
678
|
-
await timeline_animationCgHCo_Ho.parallel(growOut, fadeOut).start();
|
|
679
|
-
this.dialogElement.close();
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Sets the autofocus on the first focusable element in the dialog.
|
|
683
|
-
*/
|
|
684
|
-
setAutofocus() {
|
|
685
|
-
const focusableElements = tabbable(this.dialogElement, {
|
|
686
|
-
displayCheck: 'none',
|
|
687
|
-
});
|
|
688
|
-
if (focusableElements.length > 0) {
|
|
689
|
-
// Convert to array and find element with smallest top and left position
|
|
690
|
-
let topLeftElement = focusableElements[0];
|
|
691
|
-
let topLeftRect = topLeftElement.getBoundingClientRect();
|
|
692
|
-
focusableElements.forEach(element => {
|
|
693
|
-
const rect = element.getBoundingClientRect();
|
|
694
|
-
if (rect.top < topLeftRect.top || rect.left < topLeftRect.left) {
|
|
695
|
-
topLeftElement = element;
|
|
696
|
-
topLeftRect = rect;
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
// Set autofocus attribute on the found element
|
|
700
|
-
topLeftElement.setAttribute('autofocus', 'true');
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Attaches event listeners to the dialog.
|
|
705
|
-
*/
|
|
706
|
-
attachEventListeners() {
|
|
707
|
-
if (this.triggerElement && !this.eventsAttached && !this.controlled) {
|
|
708
|
-
grow_animationCvHGHBL4.addEventListeners(this.triggerClickEvents, this.triggerElement, this);
|
|
709
|
-
this.eventsAttached = true;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
/**
|
|
713
|
-
* Prevents the body from scrolling when the dialog is open.
|
|
714
|
-
* Compensates for scrollbar width to prevent layout shift.
|
|
715
|
-
*/
|
|
716
|
-
preventScroll() {
|
|
717
|
-
// Calculate scrollbar width
|
|
718
|
-
const scrollBarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
719
|
-
// Apply overflow hidden and padding compensation
|
|
720
|
-
document.documentElement.style.overflow = 'hidden';
|
|
721
|
-
document.documentElement.style.paddingRight = `${scrollBarWidth}px`;
|
|
722
|
-
}
|
|
723
|
-
/**
|
|
724
|
-
* Allows the body to scroll when the dialog is closed.
|
|
725
|
-
* Removes the applied overflow and padding styles.
|
|
726
|
-
*/
|
|
727
|
-
allowScroll() {
|
|
728
|
-
// Remove the applied styles
|
|
729
|
-
document.documentElement.style.removeProperty('overflow');
|
|
730
|
-
document.documentElement.style.removeProperty('padding-right');
|
|
731
|
-
}
|
|
732
|
-
ensureFormId(formElement) {
|
|
733
|
-
if (!formElement.id) {
|
|
734
|
-
formElement.id = `dialog-form-${v4BdYh22OP.v4()}`;
|
|
735
|
-
}
|
|
736
|
-
return formElement.id;
|
|
737
|
-
}
|
|
738
|
-
//#endregion EVENTS
|
|
739
|
-
/****************************************************************************/
|
|
740
|
-
//#region WATCHERS
|
|
741
|
-
async handleDialogOpenChange(isOpen) {
|
|
742
|
-
if (isOpen) {
|
|
743
|
-
this.show();
|
|
744
|
-
this.openChanged.emit(isOpen);
|
|
745
|
-
}
|
|
746
|
-
else {
|
|
747
|
-
this.close();
|
|
748
|
-
this.openChanged.emit(isOpen);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
//#endregion WATCHERS
|
|
752
|
-
/****************************************************************************/
|
|
753
|
-
//#region LISTENERS
|
|
754
|
-
/**
|
|
755
|
-
* Handles the keydown event to optionally prevent the native dialog from closing when the escape key is pressed.
|
|
756
|
-
* @param {KeyboardEvent} event - The keydown event.
|
|
757
|
-
*/
|
|
758
|
-
handleKeyDown(event) {
|
|
759
|
-
if (event.key !== 'Escape')
|
|
760
|
-
return;
|
|
761
|
-
if (!this.open)
|
|
762
|
-
return;
|
|
763
|
-
event.preventDefault();
|
|
764
|
-
event.stopPropagation();
|
|
765
|
-
const hasOpenPopover = this.checkForOpenPopovers();
|
|
766
|
-
if (!this.undismissable && !hasOpenPopover) {
|
|
767
|
-
event.preventDefault();
|
|
768
|
-
event.stopPropagation();
|
|
769
|
-
this.close();
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
//#endregion LISTENERS
|
|
773
|
-
/****************************************************************************/
|
|
774
|
-
//#region LIFECYCLE
|
|
775
|
-
/**
|
|
776
|
-
* Lifecycle method that runs before the component loads.
|
|
777
|
-
* Initializes the trigger, header, and footer elements by finding them in the component's children.
|
|
778
|
-
* Elements are found either by their slot attribute or by their tag name (for dialog header/footer)
|
|
779
|
-
*/
|
|
780
|
-
componentWillLoad() {
|
|
781
|
-
this.triggerElement = Array.from(this.el.children).find(child => {
|
|
782
|
-
return child.getAttribute('slot') === 'trigger';
|
|
783
|
-
});
|
|
784
|
-
this.headerElement = Array.from(this.el.children).find(child => {
|
|
785
|
-
return (child.getAttribute('slot') === 'header' ||
|
|
786
|
-
child.tagName.toLowerCase() === 'nv-dialogheader');
|
|
787
|
-
});
|
|
788
|
-
this.footerElement = Array.from(this.el.children).find(child => {
|
|
789
|
-
return (child.getAttribute('slot') === 'footer' ||
|
|
790
|
-
child.tagName.toLowerCase() === 'nv-dialogfooter');
|
|
791
|
-
});
|
|
792
|
-
// Initial form check
|
|
793
|
-
this.checkForForm();
|
|
794
|
-
}
|
|
795
|
-
componentWillUpdate() {
|
|
796
|
-
this.attachEventListeners();
|
|
797
|
-
}
|
|
798
|
-
componentDidLoad() {
|
|
799
|
-
if (this.open) {
|
|
800
|
-
this.show();
|
|
801
|
-
}
|
|
802
|
-
// Only set autofocus if the prop is true and no element already has autofocus
|
|
803
|
-
if (this.autofocus && !this.dialogElement.querySelector('[autofocus]')) {
|
|
804
|
-
this.setAutofocus();
|
|
805
|
-
}
|
|
806
|
-
this.attachEventListeners();
|
|
807
|
-
// Additional form check in case form was added after initial load
|
|
808
|
-
this.checkForForm();
|
|
809
|
-
// this.setupContentBodyListeners();
|
|
810
|
-
}
|
|
811
|
-
disconnectedCallback() {
|
|
812
|
-
if (this.triggerElement && !this.eventsAttached && !this.controlled) {
|
|
813
|
-
grow_animationCvHGHBL4.removeEventListeners(this.triggerClickEvents, this.triggerElement, this);
|
|
814
|
-
this.eventsAttached = false;
|
|
815
|
-
}
|
|
816
|
-
this.allowScroll();
|
|
817
|
-
}
|
|
818
|
-
//#endregion LIFECYCLE
|
|
819
|
-
/****************************************************************************/
|
|
820
|
-
//#region RENDER
|
|
821
|
-
render() {
|
|
822
|
-
const hasForm = this.form || this.el.querySelector('form');
|
|
823
|
-
return (index.h(index.Host, { key: 'e1837ebe65fcf0e56880438b59a5e8c4b5873926' }, index.h("slot", { key: '543e69780f3dad15a91b4bcb1f4199153bbce1b3', name: "trigger" }), index.h("dialog", { key: 'ef1600f73c8d25744b3b69356e1c4a98e605be1e', ref: el => (this.dialogElement = el), onClose: this.handleDialogClose, onClick: this.handleDialogClick, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-header", "aria-describedby": "dialog-content", class: clsxChV9xqsO.clsx({ full: this.full }) }, index.h("div", { key: '894e91291a5ee2a1c26a658e1ca7aaf237d71069', class: "backdrop", ref: el => (this.backdropElement = el) }, index.h("div", { key: '78700c26d1ec553d67a8e62f3f3628fab8deb49a', class: "content", ref: el => (this.contentElement = el) }, !this.undismissable && (index.h("nv-button", { key: 'd042c828bc6886091128425ea3e5c73035a0cea1', class: "close-button", emphasis: "lower", size: "sm", onClick: this.handleDialogClose, "aria-label": "Close dialog" }, index.h("nv-icon", { key: '035273dd23255883a7a5feb354d230242683e00e', name: "x", size: "sm" }))), this.headerElement ? (index.h("slot", { name: "header" })) : (index.h("nv-dialogheader", { id: "dialog-header" })), index.h("div", { key: 'd86417aae675f8611312495d31ca8d0b58c2caaf', class: "content-body", id: "dialog-content" }, index.h("slot", { key: 'cb48b94b846097d04ffd98c6689cd4116e8cd9f9' })), this.footerElement ? (index.h("slot", { name: "footer" })) : (index.h("nv-dialogfooter", { form: this.form, primaryButtonType: hasForm ? constantsBReL3Lsa.ButtonType.Submit : constantsBReL3Lsa.ButtonType.Button, onDialogCanceled: this.handleDialogClose, undismissable: this.undismissable })))))));
|
|
824
|
-
}
|
|
825
|
-
get el() { return index.getElement(this); }
|
|
826
|
-
static get watchers() { return {
|
|
827
|
-
"open": ["handleDialogOpenChange"]
|
|
828
|
-
}; }
|
|
829
|
-
};
|
|
830
|
-
NvDialog.style = nvDialogCss;
|
|
831
|
-
|
|
832
|
-
exports.nv_dialog = NvDialog;
|
|
537
|
+
exports.tabbable = tabbable;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
@@ -71,6 +71,9 @@ exports.NvDatatable = index.NvDatatable;
|
|
|
71
71
|
exports.NvDialog = index.NvDialog;
|
|
72
72
|
exports.NvDialogfooter = index.NvDialogfooter;
|
|
73
73
|
exports.NvDialogheader = index.NvDialogheader;
|
|
74
|
+
exports.NvDrawer = index.NvDrawer;
|
|
75
|
+
exports.NvDrawerfooter = index.NvDrawerfooter;
|
|
76
|
+
exports.NvDrawerheader = index.NvDrawerheader;
|
|
74
77
|
exports.NvFieldcheckbox = index.NvFieldcheckbox;
|
|
75
78
|
exports.NvFielddate = index.NvFielddate;
|
|
76
79
|
exports.NvFielddaterange = index.NvFielddaterange;
|
|
@@ -94,6 +97,7 @@ exports.NvMenuitem = index.NvMenuitem;
|
|
|
94
97
|
exports.NvNotification = index.NvNotification;
|
|
95
98
|
exports.NvNotificationBullet = index.NvNotificationBullet;
|
|
96
99
|
exports.NvNotificationcontainer = index.NvNotificationcontainer;
|
|
100
|
+
exports.NvPaginationtable = index.NvPaginationtable;
|
|
97
101
|
exports.NvPopover = index.NvPopover;
|
|
98
102
|
exports.NvRow = index.NvRow;
|
|
99
103
|
exports.NvSidebar = index.NvSidebar;
|
package/dist/cjs/{nv-accordion-item.entry-B_l0-ux0.js → nv-accordion-item.entry-CqnjIt4R.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
4
|
var collapse_animationDZDm0vSK = require('./collapse.animation-DZDm0vSK-C2TOIhIK.js');
|
|
5
5
|
require('./style-value-types.es-xlgmw4x8-B1vLqX9m.js');
|
|
6
6
|
require('@stencil/react-output-target/runtime');
|
|
7
7
|
require('react');
|
|
8
8
|
require('react-dom');
|
|
9
9
|
|
|
10
|
-
const nvAccordionItemCss =
|
|
10
|
+
const nvAccordionItemCss = () => `nv-accordion-item{display:block;border-bottom:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion-item:last-child{border-bottom:none}nv-accordion-item .nv-accordion-item__header{cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-4)}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__chevron{margin-left:var(--spacing-2);flex-shrink:0}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__header-content{display:flex;flex-direction:column;gap:var(--spacing-0-5);flex:1;min-width:0}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__title{color:var(--color-content-high-text);font-size:var(--font-size-lg);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-lg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-accordion-item .nv-accordion-item__header .nv-accordion-item__subtitle{color:var(--color-content-low-text);font-size:var(--font-size-md);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-base);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-accordion-item .nv-accordion-item__content{background:var(--color-level-10-background)}nv-accordion-item .nv-accordion-item__content .nv-accordion-item__content-inner{padding:var(--spacing-4);color:var(--color-content-low-text);font-size:var(--font-size-md);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--line-height-base);}nv-accordion-item.is-disabled{opacity:var(--opacity-disabled);pointer-events:none}nv-accordion-item.is-open .nv-accordion-item__header{border-bottom:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion-item:last-child .nv-accordion-item__content{border-radius:0 0 calc(var(--radius-rounded-lg) - var(--spacing-px)) calc(var(--radius-rounded-lg) - var(--spacing-px))}`;
|
|
11
11
|
|
|
12
12
|
const NvAccordionItem = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -26,7 +26,6 @@ const NvAccordionItem = class {
|
|
|
26
26
|
* Parent expansion mode (accordion or multi)
|
|
27
27
|
*/
|
|
28
28
|
this.mode = 'accordion';
|
|
29
|
-
/* eslint-enable nova/event-bubbling */
|
|
30
29
|
//#endregion EVENTS
|
|
31
30
|
/****************************************************************************/
|
|
32
31
|
//#region STATE
|
|
@@ -197,18 +196,20 @@ const NvAccordionItem = class {
|
|
|
197
196
|
/****************************************************************************/
|
|
198
197
|
//#region RENDER
|
|
199
198
|
render() {
|
|
200
|
-
return (index.h(index.Host, { key: '
|
|
199
|
+
return (index.h(index.Host, { key: '0105972617975546456bc611209e7aa3e233833e', class: {
|
|
201
200
|
'nv-accordion-item': true,
|
|
202
201
|
'is-open': this.currentOpenState,
|
|
203
202
|
'is-disabled': this.disabled,
|
|
204
203
|
'is-animating': this.isAnimating,
|
|
205
|
-
}, role: "listitem", "aria-expanded": this.currentOpenState ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, index.h("div", { key: '
|
|
204
|
+
}, role: "listitem", "aria-expanded": this.currentOpenState ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, index.h("div", { key: 'c7475f319d5bf737fc0db2c3a127db409614440f', class: "nv-accordion-item__header", onClick: this.handleHeaderClick, "aria-controls": "content" }, index.h("slot", { key: '3bc7770b94ae5ac43bbe60bf95f54048e1b4627a', name: "header" }, index.h("div", { key: '4258d3bfba027886cc827e399c51776197312063', class: "nv-accordion-item__header-content" }, this.itemTitle && (index.h("span", { key: 'a14d303daef12c4db52c0944eba36f9aa6aeca37', class: "nv-accordion-item__title" }, this.itemTitle)), this.subtitle && (index.h("span", { key: '814dc4ae5baa839b010dcd1e229d66e2a5f7af23', class: "nv-accordion-item__subtitle" }, this.subtitle)))), index.h("nv-iconbutton", { key: 'aeec0b17000461b24ed02cfc88f220a21dde38b5', emphasis: "low", size: "sm", shape: "square", name: this.chevronIconName, tabindex: this.disabled ? -1 : 0, onClick: this.handleIconClick, onKeyDown: this.handleHeaderKeyDown, "aria-controls": "content", "aria-label": this.currentOpenState ? 'Close the section' : 'Open the section' })), index.h("div", { key: 'fcc3b286b3a49a294f50a12516ffe345c666c1ac', id: "content", class: "nv-accordion-item__content", ref: el => (this.contentRef = el) }, index.h("div", { key: 'd31933c4e3111025fcfce99f5c57e7c6d0d15fd8', class: "nv-accordion-item__content-inner" }, index.h("slot", { key: '34252e6dded7011301840d3b1b7b9af0166c9f5c', name: "content" })))));
|
|
206
205
|
}
|
|
207
206
|
get el() { return index.getElement(this); }
|
|
208
207
|
static get watchers() { return {
|
|
209
|
-
"open": [
|
|
208
|
+
"open": [{
|
|
209
|
+
"onOpenChanged": 0
|
|
210
|
+
}]
|
|
210
211
|
}; }
|
|
211
212
|
};
|
|
212
|
-
NvAccordionItem.style = nvAccordionItemCss;
|
|
213
|
+
NvAccordionItem.style = nvAccordionItemCss();
|
|
213
214
|
|
|
214
215
|
exports.nv_accordion_item = NvAccordionItem;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
4
|
require('@stencil/react-output-target/runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-dom');
|
|
7
7
|
|
|
8
|
-
const nvAccordionCss =
|
|
8
|
+
const nvAccordionCss = () => `nv-accordion{display:block;border:var(--spacing-px) solid var(--color-content-low-border);border-radius:var(--radius-rounded-lg)}nv-accordion .nv-accordion__footer{padding:var(--spacing-3);background:var(--color-level-05-background);border-radius:0 0 var(--radius-rounded-lg) var(--radius-rounded-lg);margin-top:calc(var(--spacing-px) * -1);border-top:var(--spacing-px) solid var(--color-content-low-border)}nv-accordion .nv-accordion__footer:empty{display:none}`;
|
|
9
9
|
|
|
10
10
|
const NvAccordion = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -100,7 +100,6 @@ const NvAccordion = class {
|
|
|
100
100
|
index.forceUpdate(item);
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
/* eslint-disable nova/native-event-listener */
|
|
104
103
|
/**
|
|
105
104
|
* Listens to itemToggle events from nv-accordion-item elements
|
|
106
105
|
* @param {CustomEvent<boolean>} event Event emitted by nv-accordion-item
|
|
@@ -120,7 +119,6 @@ const NvAccordion = class {
|
|
|
120
119
|
console.warn('[onItemToggle] Target item not found in items list');
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
|
-
/* eslint-enable nova/native-event-listener */
|
|
124
122
|
//#endregion METHODS
|
|
125
123
|
/****************************************************************************/
|
|
126
124
|
//#region WATCHERS
|
|
@@ -143,10 +141,9 @@ const NvAccordion = class {
|
|
|
143
141
|
}
|
|
144
142
|
}
|
|
145
143
|
async componentDidLoad() {
|
|
146
|
-
var _a;
|
|
147
144
|
const items = Array.from(this.el.querySelectorAll('nv-accordion-item'));
|
|
148
145
|
// Only initialize openIndexes from child items if no data is provided and openIndexes is not explicitly set
|
|
149
|
-
if (!
|
|
146
|
+
if (!this.data?.length &&
|
|
150
147
|
(!this.openIndexes || this.openIndexes.length === 0)) {
|
|
151
148
|
const childOpenIndexes = items
|
|
152
149
|
.map((item, i) => (item.hasAttribute('open') || item.open ? i : -1))
|
|
@@ -165,18 +162,18 @@ const NvAccordion = class {
|
|
|
165
162
|
/****************************************************************************/
|
|
166
163
|
//#region RENDER
|
|
167
164
|
render() {
|
|
168
|
-
|
|
169
|
-
return (index.h(index.Host, { key: 'b498df032480f7b961883ad963ea1c7729e964cb', role: "list", class: "nv-accordion" }, ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) ? (this.data.map((item, i) => {
|
|
170
|
-
var _a;
|
|
171
|
-
return (index.h("nv-accordion-item", { key: (_a = item.id) !== null && _a !== void 0 ? _a : i, itemTitle: item.title, disabled: item.disabled, open: (this.openIndexes || []).includes(i), mode: this.mode }, item.subtitle ? (index.h("div", { slot: "header" }, index.h("div", { class: "nv-accordion-item__header-content" }, index.h("span", { class: "nv-accordion-item__title" }, item.title), index.h("span", { class: "nv-accordion-item__subtitle" }, item.subtitle)))) : null, index.h("div", { slot: "content" }, item.content), item.footer && index.h("div", { slot: "footer" }, item.footer)));
|
|
172
|
-
})) : (index.h("slot", null))));
|
|
165
|
+
return (index.h(index.Host, { key: '20a8663e2ff17d685423567ee2ff29b96d4ddef2', role: "list", class: "nv-accordion" }, this.data?.length ? (this.data.map((item, i) => (index.h("nv-accordion-item", { key: item.id ?? i, itemTitle: item.title, disabled: item.disabled, open: (this.openIndexes || []).includes(i), mode: this.mode }, item.subtitle ? (index.h("div", { slot: "header" }, index.h("div", { class: "nv-accordion-item__header-content" }, index.h("span", { class: "nv-accordion-item__title" }, item.title), index.h("span", { class: "nv-accordion-item__subtitle" }, item.subtitle)))) : null, index.h("div", { slot: "content" }, item.content), item.footer && index.h("div", { slot: "footer" }, item.footer))))) : (index.h("slot", null))));
|
|
173
166
|
}
|
|
174
167
|
get el() { return index.getElement(this); }
|
|
175
168
|
static get watchers() { return {
|
|
176
|
-
"openIndexes": [
|
|
177
|
-
|
|
169
|
+
"openIndexes": [{
|
|
170
|
+
"onOpenIndexesChange": 0
|
|
171
|
+
}],
|
|
172
|
+
"mode": [{
|
|
173
|
+
"onModeChange": 0
|
|
174
|
+
}]
|
|
178
175
|
}; }
|
|
179
176
|
};
|
|
180
|
-
NvAccordion.style = nvAccordionCss;
|
|
177
|
+
NvAccordion.style = nvAccordionCss();
|
|
181
178
|
|
|
182
179
|
exports.nv_accordion = NvAccordion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
4
|
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
5
|
var constantsBReL3Lsa = require('./constants-BReL3Lsa-DpB_ghPF.js');
|
|
6
6
|
var collapse_animationDZDm0vSK = require('./collapse.animation-DZDm0vSK-C2TOIhIK.js');
|
|
@@ -11,7 +11,7 @@ require('@stencil/react-output-target/runtime');
|
|
|
11
11
|
require('react');
|
|
12
12
|
require('react-dom');
|
|
13
13
|
|
|
14
|
-
const nvAlertCss =
|
|
14
|
+
const nvAlertCss = () => `nv-alert{display:flex !important;align-items:flex-start;position:relative;gap:var(--alert-gap-x);border-radius:var(--alert-radius);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif}nv-alert>nv-icon{margin-left:var(--alert-icon-position-x);margin-top:var(--alert-icon-position-y)}nv-alert.hidden{display:none !important}nv-alert.feedback-information{background-color:var(--components-alert-information-background);border:1px solid var(--components-alert-information-border) !important}nv-alert.feedback-information>.close:focus,nv-alert.feedback-information>.close:focus-within{outline:none}nv-alert.feedback-information>.close:focus-visible,nv-alert.feedback-information>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-information-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-warning{background-color:var(--components-alert-warning-background);border:1px solid var(--components-alert-warning-border) !important}nv-alert.feedback-warning>.close:focus,nv-alert.feedback-warning>.close:focus-within{outline:none}nv-alert.feedback-warning>.close:focus-visible,nv-alert.feedback-warning>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-warning-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-error{background-color:var(--components-alert-error-background);border:1px solid var(--components-alert-error-border) !important}nv-alert.feedback-error>.close:focus,nv-alert.feedback-error>.close:focus-within{outline:none}nv-alert.feedback-error>.close:focus-visible,nv-alert.feedback-error>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-error-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-success{background-color:var(--components-alert-success-background);border:1px solid var(--components-alert-success-border) !important}nv-alert.feedback-success>.close:focus,nv-alert.feedback-success>.close:focus-within{outline:none}nv-alert.feedback-success>.close:focus-visible,nv-alert.feedback-success>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-success-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert.feedback-neutral{background-color:var(--components-alert-neutral-background);border:1px solid var(--components-alert-neutral-border) !important}nv-alert.feedback-neutral>.close:focus,nv-alert.feedback-neutral>.close:focus-within{outline:none}nv-alert.feedback-neutral>.close:focus-visible,nv-alert.feedback-neutral>.close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-alert-neutral-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-alert>nv-icon.icon-information{color:var(--components-alert-information-icon)}nv-alert>nv-icon.icon-warning{color:var(--components-alert-warning-icon)}nv-alert>nv-icon.icon-error{color:var(--components-alert-error-icon)}nv-alert>nv-icon.icon-success{color:var(--components-alert-success-icon)}nv-alert>nv-icon.icon-neutral{color:var(--components-alert-neutral-icon)}nv-alert>.content{display:flex;padding:var(--alert-padding);padding-right:calc(var(--alert-padding) + var(--spacing-5) + var(--spacing-1));padding-left:0;flex-direction:column;gap:var(--alert-gap-y)}nv-alert>.content>.heading{color:var(--components-alert-content-title);font-size:var(--alert-heading-font-size);line-height:var(--alert-heading-line-height);font-weight:var(--alert-heading-font-weight)}nv-alert>.content>.message{color:var(--components-alert-content-description);font-size:var(--alert-message-font-size);line-height:var(--alert-message-line-height)}nv-alert>.close{border-radius:var(--alert-radius);position:absolute;display:flex;top:var(--alert-icon-position-y);right:var(--alert-icon-position-x);padding:0;border:none;background:none;cursor:pointer}`;
|
|
15
15
|
|
|
16
16
|
const NvAlert = class {
|
|
17
17
|
constructor(hostRef) {
|
|
@@ -163,14 +163,15 @@ const NvAlert = class {
|
|
|
163
163
|
/****************************************************************************/
|
|
164
164
|
//#region RENDER
|
|
165
165
|
render() {
|
|
166
|
-
|
|
167
|
-
return (index.h(index.Host, { key: '2c89126ecbdca5e8df9c0541a4e312d2dc8a9fb3', role: "alert", class: clsxChV9xqsO.clsx('root', `feedback-${this.feedback}`) }, index.h("nv-icon", { key: '3aa514682ac670d81c7c88fa8b9b6f02e2761c45', name: (_a = this.icon) !== null && _a !== void 0 ? _a : this.getDefaultIcon(), class: `icon-${this.feedback}`, size: "md" }), index.h("div", { key: '5049bdb9d17b9ef07e15554631cc8fbd557e4b22', class: "content" }, this.heading && index.h("p", { key: '3faaa7e738f484f2f7dc543866eadaa861c0709b', class: "heading" }, this.heading), this.message && index.h("p", { key: 'abd16d9cb5bc2f28e63c534e8f9f2169e511df2f', class: "message" }, this.message), index.h("slot", { key: '0b14b616a7e6665f903f0aa6c32f706b0aa8bd27' })), this.dismissible && (index.h("button", { key: '5d35998aac73ea82ef06e1d083597a7677c0cd70', class: "close", type: "button", onClick: this.handleDismiss }, index.h("nv-icon", { key: '3088178c1152525a400d116ac07ce372dadd420b', name: "x", size: "sm" })))));
|
|
166
|
+
return (index.h(index.Host, { key: '2c89126ecbdca5e8df9c0541a4e312d2dc8a9fb3', role: "alert", class: clsxChV9xqsO.clsx('root', `feedback-${this.feedback}`) }, index.h("nv-icon", { key: '3aa514682ac670d81c7c88fa8b9b6f02e2761c45', name: this.icon ?? this.getDefaultIcon(), class: `icon-${this.feedback}`, size: "md" }), index.h("div", { key: '5049bdb9d17b9ef07e15554631cc8fbd557e4b22', class: "content" }, this.heading && index.h("p", { key: '3faaa7e738f484f2f7dc543866eadaa861c0709b', class: "heading" }, this.heading), this.message && index.h("p", { key: 'abd16d9cb5bc2f28e63c534e8f9f2169e511df2f', class: "message" }, this.message), index.h("slot", { key: '0b14b616a7e6665f903f0aa6c32f706b0aa8bd27' })), this.dismissible && (index.h("button", { key: '5d35998aac73ea82ef06e1d083597a7677c0cd70', class: "close", type: "button", onClick: this.handleDismiss }, index.h("nv-icon", { key: '3088178c1152525a400d116ac07ce372dadd420b', name: "x", size: "sm" })))));
|
|
168
167
|
}
|
|
169
168
|
get el() { return index.getElement(this); }
|
|
170
169
|
static get watchers() { return {
|
|
171
|
-
"hidden": [
|
|
170
|
+
"hidden": [{
|
|
171
|
+
"handleHiddenChange": 0
|
|
172
|
+
}]
|
|
172
173
|
}; }
|
|
173
174
|
};
|
|
174
|
-
NvAlert.style = nvAlertCss;
|
|
175
|
+
NvAlert.style = nvAlertCss();
|
|
175
176
|
|
|
176
177
|
exports.nv_alert = NvAlert;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DUlunl9a.js');
|
|
4
|
+
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
|
+
var constantsBReL3Lsa = require('./constants-BReL3Lsa-DpB_ghPF.js');
|
|
6
|
+
require('@stencil/react-output-target/runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
require('react-dom');
|
|
9
|
+
|
|
10
|
+
const nvAvatarCss = () => `nv-avatar{align-items:center !important;background-color:var(--components-avatar-background-1);border-radius:var(--radius-rounded-full) !important;display:flex !important;flex-shrink:0 !important;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-style:normal;font-weight:var(--font-weight-medium-emphasis);justify-content:center !important;leading-trim:both;line-height:1 !important;text-align:center;text-edge:cap;text-transform:uppercase}nv-avatar.avatar-color-1{background-color:var(--components-avatar-background-1);color:var(--components-avatar-content-1)}nv-avatar.avatar-color-2{background-color:var(--components-avatar-background-2);color:var(--components-avatar-content-2)}nv-avatar.avatar-color-3{background-color:var(--components-avatar-background-3);color:var(--components-avatar-content-3)}nv-avatar.avatar-color-4{background-color:var(--components-avatar-background-4);color:var(--components-avatar-content-4)}nv-avatar.avatar-color-5{background-color:var(--components-avatar-background-5);color:var(--components-avatar-content-5)}nv-avatar.avatar-color-6{background-color:var(--components-avatar-background-6);color:var(--components-avatar-content-6)}nv-avatar.avatar-color-7{background-color:var(--components-avatar-background-7);color:var(--components-avatar-content-7)}nv-avatar.avatar-color-8{background-color:var(--components-avatar-background-8);color:var(--components-avatar-content-8)}nv-avatar.avatar-color-9{background-color:var(--components-avatar-background-9);color:var(--components-avatar-content-9)}nv-avatar.avatar-color-10{background-color:var(--components-avatar-background-10);color:var(--components-avatar-content-10)}nv-avatar img{height:100%;width:100%;object-fit:cover;object-position:center;border-radius:50%}nv-avatar.avatar-xs{width:var(--avatar-xs-size);height:var(--avatar-xs-size);font-size:var(--avatar-xs-font-size);line-height:var(--avatar-xs-font-size)}nv-avatar.avatar-xs nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-avatar.avatar-sm{width:var(--avatar-sm-size);height:var(--avatar-sm-size);font-size:var(--avatar-sm-font-size);line-height:var(--avatar-sm-font-size)}nv-avatar.avatar-sm nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-avatar.avatar-md{width:var(--avatar-md-size);height:var(--avatar-md-size);font-size:var(--avatar-md-font-size);line-height:var(--avatar-md-font-size)}nv-avatar.avatar-md nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-avatar.avatar-lg{width:var(--avatar-lg-size);height:var(--avatar-lg-size);font-size:var(--avatar-lg-font-size);line-height:var(--avatar-lg-font-size)}nv-avatar.avatar-lg nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-avatar.avatar-xl{width:var(--avatar-xl-size);height:var(--avatar-xl-size);font-size:var(--avatar-xl-font-size);line-height:var(--avatar-xl-font-size)}nv-avatar.avatar-xl nv-icon>svg{width:var(--spacing-7);height:var(--spacing-7);stroke-width:1.9px}`;
|
|
11
|
+
|
|
12
|
+
const NvAvatar = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
/**
|
|
16
|
+
* Define the size of the avatar. You can use t-shirt sizes.
|
|
17
|
+
*/
|
|
18
|
+
this.size = 'md';
|
|
19
|
+
/**
|
|
20
|
+
* You can apply different colors on the Avatar.
|
|
21
|
+
* Use a string number between 1 and 10.
|
|
22
|
+
*/
|
|
23
|
+
this.color = '1';
|
|
24
|
+
}
|
|
25
|
+
componentWillRender() {
|
|
26
|
+
if (this.xsmall) {
|
|
27
|
+
this.size = constantsBReL3Lsa.SemanticSizes.ExtraSmall;
|
|
28
|
+
}
|
|
29
|
+
if (this.small) {
|
|
30
|
+
this.size = constantsBReL3Lsa.SemanticSizes.Small;
|
|
31
|
+
}
|
|
32
|
+
if (this.medium) {
|
|
33
|
+
this.size = constantsBReL3Lsa.SemanticSizes.Medium;
|
|
34
|
+
}
|
|
35
|
+
if (this.large) {
|
|
36
|
+
this.size = constantsBReL3Lsa.SemanticSizes.Large;
|
|
37
|
+
}
|
|
38
|
+
if (this.xlarge) {
|
|
39
|
+
this.size = constantsBReL3Lsa.SemanticSizes.ExtraLarge;
|
|
40
|
+
}
|
|
41
|
+
if (this.text) {
|
|
42
|
+
this.initials = this.text;
|
|
43
|
+
}
|
|
44
|
+
if (this.url) {
|
|
45
|
+
this.src = this.url;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion PROPERTIES
|
|
49
|
+
/****************************************************************************/
|
|
50
|
+
//#region METHODS
|
|
51
|
+
/**
|
|
52
|
+
* Makes sure the initials are trimmed to 2 letters.
|
|
53
|
+
* @param {string} initials - The initials to be trimmed.
|
|
54
|
+
* @returns {string} The trimmed initials.
|
|
55
|
+
*/
|
|
56
|
+
trimInitials(initials) {
|
|
57
|
+
return initials.trim().substring(0, 2);
|
|
58
|
+
}
|
|
59
|
+
//#endregion METHODS
|
|
60
|
+
/****************************************************************************/
|
|
61
|
+
//#region RENDER
|
|
62
|
+
render() {
|
|
63
|
+
return (index.h(index.Host, { key: '127d470eb9121f611f9e18f029ab9ef15a4a49df', class: clsxChV9xqsO.clsx(`avatar-${this.size}`, `avatar-color-${this.color}`), "aria-label": this.alt }, this.src ? (index.h("img", { src: this.src, alt: this.alt })) : this.initials ? (this.trimInitials(this.initials)) : (index.h("slot", { name: "icon" }, index.h("nv-icon", { name: "user" })))));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
NvAvatar.style = nvAvatarCss();
|
|
67
|
+
|
|
68
|
+
exports.nv_avatar = NvAvatar;
|