@nova-design-system/nova-react 3.14.0 → 3.16.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/{collapse.animation-acda1bf5-BuORVmQv.js → collapse.animation-6e0b08df-AHWzNGm_.js} +4 -1
- package/dist/cjs/{constants-d0f19e7b-s0SCO_vi.js → constants-69bafca2-DpB_ghPF.js} +9 -0
- package/dist/cjs/{fade.animation-eb454088-Bma0SpTf.js → fade.animation-9b939939-DV--bM4S.js} +2 -2
- package/dist/cjs/{index-CKAZvszR.js → index-7K7BV1CP.js} +4676 -1345
- package/dist/cjs/index.js +10 -2
- package/dist/cjs/{nv-accordion-item.entry-CjBcmF8t.js → nv-accordion-item.entry-C-9tYw-c.js} +6 -5
- package/dist/cjs/{nv-accordion.entry-CRk2Wvt3.js → nv-accordion.entry-BA3mTIdj.js} +7 -6
- package/dist/cjs/{nv-alert.entry-D5qB5xZg.js → nv-alert.entry-Bic-YGW1.js} +13 -12
- package/dist/cjs/nv-avatar.entry-C-yd0YlD.js +68 -0
- package/dist/cjs/{nv-badge_2.entry-BDuX1qOQ.js → nv-badge_2.entry-B_8yvNXL.js} +11 -10
- package/dist/cjs/{nv-breadcrumb.entry-BE9U6AF_.js → nv-breadcrumb.entry-BCTbG942.js} +3 -2
- package/dist/cjs/{nv-breadcrumbs.entry-DJXqtmMR.js → nv-breadcrumbs.entry-C9B5Baf7.js} +2 -1
- package/dist/cjs/nv-button.entry-DgX8Bwmq.js +165 -0
- package/dist/cjs/{nv-buttongroup.entry-C0Zc2lOi.js → nv-buttongroup.entry-CKhZN_Yf.js} +2 -1
- package/dist/cjs/{nv-calendar.entry-NbVLStMN.js → nv-calendar.entry-E6Pk83WA.js} +8 -7
- package/dist/cjs/{nv-col.entry-ahFf8a1Z.js → nv-col.entry-CkZpukX9.js} +2 -1
- package/dist/cjs/{nv-datagrid.entry-C-MJXEdi.js → nv-datagrid.entry-RsfP7vbC.js} +183 -15
- package/dist/cjs/{nv-datagridcolumn.entry-CxU7soW7.js → nv-datagridcolumn.entry-D4VrDWo9.js} +2 -1
- package/dist/cjs/{nv-dialog.entry-WlnaC-w2.js → nv-dialog.entry-BhtWpYHl.js} +34 -30
- package/dist/cjs/{nv-dialogfooter_2.entry-CEWmTnJc.js → nv-dialogfooter_2.entry-BXLYmzYl.js} +6 -5
- package/dist/cjs/{nv-fieldcheckbox.entry-BYhFVrYb.js → nv-fieldcheckbox.entry-D96Nm6DZ.js} +3 -2
- package/dist/cjs/{nv-fielddate.entry-DVVnRiOT.js → nv-fielddate.entry-ty37R9jF.js} +52 -26
- package/dist/cjs/{nv-fielddaterange.entry-Cb4X5Q-C.js → nv-fielddaterange.entry-BSIRu_mq.js} +69 -42
- package/dist/cjs/{nv-fielddropdown.entry-D2PKGkpx.js → nv-fielddropdown.entry-CUzvIoZZ.js} +34 -7
- package/dist/cjs/{nv-fielddropdownitem.entry-BqgMRnIc.js → nv-fielddropdownitem.entry-D-GTxLNk.js} +2 -1
- package/dist/cjs/{nv-fieldmultiselect.entry-Dzw4c9wO.js → nv-fieldmultiselect.entry-DFY2bf6s.js} +188 -156
- package/dist/cjs/{nv-fieldnumber.entry-Cm5g6tw7.js → nv-fieldnumber.entry-CILclJ7Q.js} +3 -2
- package/dist/cjs/{nv-fieldpassword.entry-BMI5M4RR.js → nv-fieldpassword.entry-CdR-NM8e.js} +3 -2
- package/dist/cjs/{nv-fieldradio.entry-BrCJvkMR.js → nv-fieldradio.entry-lC4scIvU.js} +3 -2
- package/dist/cjs/{nv-fieldselect.entry-Cz76Y4Fb.js → nv-fieldselect.entry-CYu6870F.js} +3 -2
- package/dist/cjs/{nv-fieldslider.entry-C2ynnMK8.js → nv-fieldslider.entry-DOuJAR6P.js} +3 -2
- package/dist/cjs/{nv-fieldtext.entry-B6ciu2fU.js → nv-fieldtext.entry-BFLUiPa4.js} +3 -2
- package/dist/cjs/{nv-fieldtextarea.entry-BL_gMvTp.js → nv-fieldtextarea.entry-BeI0k97G.js} +3 -2
- package/dist/cjs/{nv-fieldtime.entry-Be5fujXA.js → nv-fieldtime.entry-C28EAKki.js} +82 -68
- package/dist/cjs/nv-icon.entry-BXgjUpe_.js +80 -0
- package/dist/cjs/{nv-iconbutton_2.entry-Dlk96yHi.js → nv-iconbutton_2.entry-CpIkxrp9.js} +3 -2
- package/dist/cjs/{nv-menu.entry-CDn1Tk9J.js → nv-menu.entry-as-NOsF-.js} +25 -9
- package/dist/cjs/{nv-menuitem.entry-DIkQnha9.js → nv-menuitem.entry-D8KAh6nr.js} +2 -1
- package/dist/cjs/nv-notification.entry-C-_jV-DL.js +262 -0
- package/dist/cjs/nv-notificationcontainer.entry-CMn42loT.js +41 -0
- package/dist/cjs/{nv-popover.entry-Bz9ZWGlN.js → nv-popover.entry--BhEBSir.js} +72 -65
- package/dist/cjs/{nv-row.entry-iJGXINmZ.js → nv-row.entry-BxhcK9aY.js} +3 -2
- package/dist/cjs/{nv-stack.entry-CifEjR2g.js → nv-stack.entry-C3DF9jJZ.js} +3 -2
- package/dist/cjs/nv-table.entry-pfEGt2KH.js +245 -0
- package/dist/cjs/nv-toggle.entry-ChpqtQtn.js +80 -0
- package/dist/cjs/{nv-togglebutton.entry-X4eLeP-C.js → nv-togglebutton.entry-DE7CKmeN.js} +3 -2
- package/dist/cjs/{nv-togglebuttongroup.entry-BYO58vql.js → nv-togglebuttongroup.entry-BJPjdmHD.js} +3 -2
- package/dist/cjs/{nv-tooltip.entry-DaxjQSt1.js → nv-tooltip.entry-D9-Fga6C.js} +3 -2
- package/dist/components/NvDatatable.js +45 -0
- package/dist/generated/components.js +10 -10
- package/dist/generated/components.server.js +9 -17
- package/dist/index.js +2 -0
- package/dist/providers/NotificationProvider.js +83 -0
- package/dist/types/components/NvDatatable.d.ts +25 -0
- package/dist/types/generated/components.d.ts +5 -12
- package/dist/types/generated/components.server.d.ts +5 -12
- package/dist/types/index.d.ts +2 -0
- package/dist/types/providers/NotificationProvider.d.ts +36 -0
- package/package.json +7 -3
- package/dist/cjs/dom.utils-ac71e0ef-CmIwRr6O.js +0 -168
- package/dist/cjs/nv-avatar.entry-CuNYdZl_.js +0 -67
- package/dist/cjs/nv-button.entry-CF5IDcG3.js +0 -164
- package/dist/cjs/nv-icon.entry-C-wbfOy3.js +0 -79
- package/dist/cjs/nv-notification.entry-BiwnZCkF.js +0 -178
- package/dist/cjs/nv-table.entry-Dxg0j3fe.js +0 -338
- package/dist/cjs/nv-tablecolumn.entry--29MFEe9.js +0 -18
- package/dist/cjs/nv-toggle.entry-D0eQoEqf.js +0 -79
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
require('react');
|
|
6
|
+
require('react-dom');
|
|
6
7
|
|
|
7
|
-
const nvIconbuttonCss = "nv-iconbutton.root{display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:
|
|
8
|
+
const nvIconbuttonCss = "nv-iconbutton.root{display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:var(--font-weight-medium-emphasis);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;transition:background-color 150ms ease-out;height:fit-content;width:fit-content}nv-iconbutton.size-xs{padding:var(--button-xs-icon-button-padding);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-iconbutton.size-sm{padding:var(--button-sm-icon-button-padding);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-iconbutton.size-md{padding:var(--button-md-icon-button-padding);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-iconbutton.size-lg{padding:var(--button-lg-icon-button-padding);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-iconbutton.emphasis-high{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-iconbutton.emphasis-high:hover{background:var(--components-button-high-background-hover);color:var(--components-button-high-text-hover)}nv-iconbutton.emphasis-high:focus,nv-iconbutton.emphasis-high:focus-within{outline:none}nv-iconbutton.emphasis-high:focus-visible,nv-iconbutton.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-iconbutton.emphasis-high:disabled{background:var(--components-button-high-background);color:var(--components-button-high-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-high nv-icon>svg{color:var(--components-button-high-icon)}nv-iconbutton.emphasis-medium{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-iconbutton.emphasis-medium:hover{background:var(--components-button-medium-background-hover);color:var(--components-button-medium-text-hover)}nv-iconbutton.emphasis-medium:focus,nv-iconbutton.emphasis-medium:focus-within{outline:none}nv-iconbutton.emphasis-medium:focus-visible,nv-iconbutton.emphasis-medium:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-medium:disabled{background:var(--components-button-medium-background);color:var(--components-button-medium-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-medium nv-icon>svg{color:var(--components-button-medium-icon)}nv-iconbutton.emphasis-low{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-iconbutton.emphasis-low:hover{background:var(--components-button-low-background-hover);color:var(--components-button-low-text-hover)}nv-iconbutton.emphasis-low:focus,nv-iconbutton.emphasis-low:focus-within{outline:none}nv-iconbutton.emphasis-low:focus-visible,nv-iconbutton.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-iconbutton.emphasis-low:disabled{background:var(--components-button-low-background);color:var(--components-button-low-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-low nv-icon>svg{color:var(--components-button-low-icon)}nv-iconbutton.emphasis-lower{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-iconbutton.emphasis-lower:hover{background:var(--components-button-lower-background-hover);color:var(--components-button-lower-text-hover)}nv-iconbutton.emphasis-lower:focus,nv-iconbutton.emphasis-lower:focus-within{outline:none}nv-iconbutton.emphasis-lower:focus-visible,nv-iconbutton.emphasis-lower:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-lower:disabled{background:var(--components-button-lower-background);color:var(--components-button-lower-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-lower nv-icon>svg{color:var(--components-button-lower-icon)}nv-iconbutton.loading [slot=leading-icon]{display:none}nv-iconbutton.shape-rounded{border-radius:var(--radius-rounded-full)}";
|
|
8
9
|
const NvIconbuttonStyle0 = nvIconbuttonCss;
|
|
9
10
|
|
|
10
11
|
const NvIconbutton = class {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
6
7
|
const nvMenuCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}nv-menu{display:inline-block;position:relative}nv-menu:has([fluid]:not([fluid=false])){display:block}nv-menu nv-popover{display:unset}nv-menu nv-popover [data-scope=popover]{background-color:transparent !important;padding:0 !important}nv-menu [slot=content]{padding:var(--menu-contextual-padding-y) var(--menu-contextual-padding-x);border-radius:var(--menu-contextual-radius);gap:var(--menu-contextual-gap-y);background-color:var(--components-menu-contextual-background);border-color:var(--components-menu-contextual-border);display:flex;flex-direction:column}nv-menu nv-menu[open]:not([open=false])>nv-menuitem{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menu hr{display:block;margin:var(--menu-contextual-divider-padding-top) var(--menu-contextual-divider-padding-x) var(--menu-contextual-divider-padding-bottom) var(--menu-contextual-divider-padding-x)}";
|
|
7
8
|
const NvMenuStyle0 = nvMenuCss;
|
|
@@ -67,6 +68,24 @@ const NvMenu = class {
|
|
|
67
68
|
async close() {
|
|
68
69
|
this.open = false;
|
|
69
70
|
}
|
|
71
|
+
focusFirstItem() {
|
|
72
|
+
const firstButton = this.popoverElement.querySelector('nv-menuitem');
|
|
73
|
+
if (firstButton) {
|
|
74
|
+
requestAnimationFrame(() => firstButton.focus());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//#endregion EVENTS
|
|
78
|
+
/****************************************************************************/
|
|
79
|
+
//#region WATCHERS
|
|
80
|
+
handleOpenChange(newOpen) {
|
|
81
|
+
// React to external changes, e.g., focus first item if opened externally
|
|
82
|
+
if (newOpen) {
|
|
83
|
+
this.focusFirstItem();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//#endregion WATCHERS
|
|
87
|
+
/****************************************************************************/
|
|
88
|
+
//#region LISTENERS
|
|
70
89
|
handleMenuItemSelect(event) {
|
|
71
90
|
if (this.disableCloseOnSelect)
|
|
72
91
|
return;
|
|
@@ -179,13 +198,7 @@ const NvMenu = class {
|
|
|
179
198
|
if (triggerHasFocus && triggerHasFocusVisible)
|
|
180
199
|
this.focusFirstItem();
|
|
181
200
|
}
|
|
182
|
-
|
|
183
|
-
const firstButton = this.popoverElement.querySelector('nv-menuitem');
|
|
184
|
-
if (firstButton) {
|
|
185
|
-
requestAnimationFrame(() => firstButton.focus());
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
//#endregion EVENTS
|
|
201
|
+
//#endregion LISTENERS
|
|
189
202
|
/****************************************************************************/
|
|
190
203
|
//#region LIFECYCLE
|
|
191
204
|
componentWillLoad() {
|
|
@@ -194,9 +207,12 @@ const NvMenu = class {
|
|
|
194
207
|
});
|
|
195
208
|
}
|
|
196
209
|
render() {
|
|
197
|
-
return (index.h(index.Host, { key: '
|
|
210
|
+
return (index.h(index.Host, { key: '9c580e2085804dead07f60f3ce4494bed123a58e' }, index.h("slot", { key: '87740cf4b003379eb7a4d011b2b80640e9d7c24f', name: "trigger" }), index.h("nv-popover", { key: '102ebedefdc1b6ac5f10900a82c904b12e4cddb1', ref: el => (this.popoverElement = el), triggerMode: "click", triggerElement: this.triggerElement, placement: this.placement, nested: this.nested, open: this.open }, this.items ? (index.h("ul", { slot: "content" }, this.renderMenuItems())) : (index.h("slot", { name: "content" })))));
|
|
198
211
|
}
|
|
199
212
|
get el() { return index.getElement(this); }
|
|
213
|
+
static get watchers() { return {
|
|
214
|
+
"open": ["handleOpenChange"]
|
|
215
|
+
}; }
|
|
200
216
|
};
|
|
201
217
|
NvMenu.style = NvMenuStyle0;
|
|
202
218
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
6
7
|
const nvMenuitemCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}";
|
|
7
8
|
const NvMenuitemStyle0 = nvMenuitemCss;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
|
+
var constants69bafca2 = require('./constants-69bafca2-DpB_ghPF.js');
|
|
5
|
+
var collapse_animation6e0b08df = require('./collapse.animation-6e0b08df-AHWzNGm_.js');
|
|
6
|
+
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
7
|
+
var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
8
|
+
var timeline_animation79215cd4 = require('./timeline.animation-79215cd4-KteJaZPb.js');
|
|
9
|
+
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
10
|
+
require('react');
|
|
11
|
+
require('react-dom');
|
|
12
|
+
|
|
13
|
+
const useSlide = (node, { duration } = { duration: 200 }) => {
|
|
14
|
+
const nodeStyler = fade_animation9b939939.index(node);
|
|
15
|
+
/**
|
|
16
|
+
* Will animate the translateX property.
|
|
17
|
+
*
|
|
18
|
+
* @param {object} options - The options for the animation.
|
|
19
|
+
* @param {number} options.from - The starting value for the translateX property.
|
|
20
|
+
* @param {number} options.to - The ending value for the translateX property.
|
|
21
|
+
* @returns {Promise<void>} - A promise that resolves when the animation is
|
|
22
|
+
* complete.
|
|
23
|
+
*/
|
|
24
|
+
const slideX = (options = { from: 0, to: 100 }) => () => {
|
|
25
|
+
return new Promise(resolve => {
|
|
26
|
+
styleValueTypes_esF5d10b79.animate({
|
|
27
|
+
from: { x: options.from },
|
|
28
|
+
to: { x: options.to },
|
|
29
|
+
ease: styleValueTypes_esF5d10b79.easeOut,
|
|
30
|
+
duration,
|
|
31
|
+
onUpdate(latest) {
|
|
32
|
+
nodeStyler.set({ transform: `translateX(${latest.x}%)` });
|
|
33
|
+
},
|
|
34
|
+
onComplete() {
|
|
35
|
+
resolve();
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Will animate the translateY property.
|
|
42
|
+
*
|
|
43
|
+
* @param {object} options - The options for the animation.
|
|
44
|
+
* @param {number} options.from - The starting value for the translateY property.
|
|
45
|
+
* @param {number} options.to - The ending value for the translateY property.
|
|
46
|
+
* @returns {Promise<void>} - A promise that resolves when the animation is
|
|
47
|
+
* complete.
|
|
48
|
+
*/
|
|
49
|
+
const slideY = (options = { from: 0, to: 100 }) => () => {
|
|
50
|
+
return new Promise(resolve => {
|
|
51
|
+
styleValueTypes_esF5d10b79.animate({
|
|
52
|
+
from: { y: options.from },
|
|
53
|
+
to: { y: options.to },
|
|
54
|
+
ease: styleValueTypes_esF5d10b79.easeOut,
|
|
55
|
+
duration,
|
|
56
|
+
onUpdate(latest) {
|
|
57
|
+
nodeStyler.set({ transform: `translateY(${latest.y}%)` });
|
|
58
|
+
},
|
|
59
|
+
onComplete() {
|
|
60
|
+
resolve();
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Applies the slideX styles without animating, useful when initial state
|
|
67
|
+
* is slid out.
|
|
68
|
+
*
|
|
69
|
+
* @param {number} amount - The amount to translate the element by.
|
|
70
|
+
* @returns {function} - A function that applies the slideX styles.
|
|
71
|
+
*/
|
|
72
|
+
const setSlideX = (amount = 100) => nodeStyler.set({ transform: `translateX(${amount}%)` });
|
|
73
|
+
/**
|
|
74
|
+
* Applies the slideY styles without animating, useful when initial state
|
|
75
|
+
* is slid out.
|
|
76
|
+
*
|
|
77
|
+
* @param {number} amount - The amount to translate the element by.
|
|
78
|
+
* @returns {function} - A function that applies the slideY styles.
|
|
79
|
+
*/
|
|
80
|
+
const setSlideY = (amount = 100) => nodeStyler.set({ transform: `translateY(${amount}%)` });
|
|
81
|
+
/**
|
|
82
|
+
* Applies the slideIn styles without animating, useful when initial state
|
|
83
|
+
* is slid in.
|
|
84
|
+
*/
|
|
85
|
+
function setSlideReset() {
|
|
86
|
+
nodeStyler.set({ transform: `translateX(${0}%) translateY(${0}%)` });
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
slideX,
|
|
90
|
+
slideY,
|
|
91
|
+
setSlideX,
|
|
92
|
+
setSlideY,
|
|
93
|
+
setSlideReset,
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const nvNotificationCss = "nv-notification{display:block}nv-notification [data-scope=container]{display:flex;position:relative;max-width:512px;width:100%;padding:var(--notification-padding);align-items:flex-start;gap:var(--notification-gap-x);border-radius:var(--notification-radius);border-style:solid;box-shadow:0 var(--shadow-y-axis-lg-1, 4px) var(--shadow-blur-lg-1, 6px) var(--shadow-spread-lg-1, -2px) var(--shadow-color-opacity-1, rgba(14, 14, 14, 0.06)), 0 var(--shadow-y-axis-lg-2, 10px) var(--shadow-blur-lg-2, 15px) var(--shadow-spread-lg-2, -3px) var(--shadow-color-opacity-2, rgba(14, 14, 14, 0.1))}nv-notification [data-scope=container] [data-scope=icon]{flex-shrink:0}nv-notification [data-scope=container] [data-scope=dismiss]{padding:var(--button-sm-icon-button-padding, 8px);justify-content:center;align-items:center;gap:var(--button-sm-gap, 6px);display:flex;position:absolute;right:8px;top:8px;border-radius:var(--button-sm-border-radius, 4px);background:var(--components-button-lower-background, rgba(255, 255, 255, 0));color:var(--components-button-lower-icon)}nv-notification [data-scope=container] [data-scope=content]{display:flex;padding-right:var(--notification-padding-right);flex-direction:column;align-items:flex-start;gap:var(--notification-gap-y);flex:1 0 0}nv-notification [data-scope=container] [data-scope=content] [data-scope=heading]{display:flex;align-items:flex-start;gap:var(--notification-gap-x);align-self:stretch;color:var(--components-notification-content-title);font-size:var(--notification-title-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:20px;}nv-notification [data-scope=container] [data-scope=content] [data-scope=message]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--notification-gap-y);align-self:stretch;color:var(--components-notification-content-description);font-variant-numeric:lining-nums tabular-nums slashed-zero;font-size:var(--font-size-sm, 14px);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--line-height-sm, 20px)}nv-notification [data-scope=container] [data-scope=content] [data-scope=actions]{display:flex;padding:var(--spacing-2, 8px) 0;padding-bottom:0px;align-items:flex-start;gap:var(--notification-gap-x);align-self:stretch;margin-left:calc(-1 * var(--button-sm-padding-x))}nv-notification[feedback=information] [data-scope=container]{background-color:var(--components-notification-information-background);border-color:var(--components-notification-information-border)}nv-notification[feedback=information] [data-scope=container] [data-scope=icon]{color:var(--components-notification-information-icon)}nv-notification[feedback=information]>[data-scope=close]:focus,nv-notification[feedback=information]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=information]>[data-scope=close]:focus-visible,nv-notification[feedback=information]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-information-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=warning] [data-scope=container]{background-color:var(--components-notification-warning-background);border-color:var(--components-notification-warning-border)}nv-notification[feedback=warning] [data-scope=container] [data-scope=icon]{color:var(--components-notification-warning-icon)}nv-notification[feedback=warning]>[data-scope=close]:focus,nv-notification[feedback=warning]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=warning]>[data-scope=close]:focus-visible,nv-notification[feedback=warning]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-warning-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=error] [data-scope=container]{background-color:var(--components-notification-error-background);border-color:var(--components-notification-error-border)}nv-notification[feedback=error] [data-scope=container] [data-scope=icon]{color:var(--components-notification-error-icon)}nv-notification[feedback=error]>[data-scope=close]:focus,nv-notification[feedback=error]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=error]>[data-scope=close]:focus-visible,nv-notification[feedback=error]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-error-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=success] [data-scope=container]{background-color:var(--components-notification-success-background);border-color:var(--components-notification-success-border)}nv-notification[feedback=success] [data-scope=container] [data-scope=icon]{color:var(--components-notification-success-icon)}nv-notification[feedback=success]>[data-scope=close]:focus,nv-notification[feedback=success]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=success]>[data-scope=close]:focus-visible,nv-notification[feedback=success]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-success-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=neutral] [data-scope=container]{background-color:var(--components-notification-neutral-background);border-color:var(--components-notification-neutral-border)}nv-notification[feedback=neutral] [data-scope=container] [data-scope=icon]{color:var(--components-notification-neutral-icon)}nv-notification[feedback=neutral]>[data-scope=close]:focus,nv-notification[feedback=neutral]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=neutral]>[data-scope=close]:focus-visible,nv-notification[feedback=neutral]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-neutral-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[emphasis=high] [data-scope=container]{border-width:1px;border-left-width:var(--notification-border-width-high-emphasis);padding-left:calc(var(--notification-padding) - var(--notification-border-width-high-emphasis) + 1px)}nv-notification[emphasis=medium] [data-scope=container]{border-width:var(--notification-border-width-low-emphasis);border-color:var(--color-content-low-border, #E3E3E3)}";
|
|
98
|
+
const NvNotificationStyle0 = nvNotificationCss;
|
|
99
|
+
|
|
100
|
+
const NvNotification = class {
|
|
101
|
+
constructor(hostRef) {
|
|
102
|
+
index.registerInstance(this, hostRef);
|
|
103
|
+
this.hiddenChanged = index.createEvent(this, "hiddenChanged");
|
|
104
|
+
/****************************************************************************/
|
|
105
|
+
//#region PROPERTIES
|
|
106
|
+
/**
|
|
107
|
+
* Set a unique ID for the notification. Used for aria attributes and managing
|
|
108
|
+
* multiple notifications.
|
|
109
|
+
*/
|
|
110
|
+
this.uid = v4A79185f4.v4();
|
|
111
|
+
/**
|
|
112
|
+
* Specifies the notification type which determines the color and default icon.
|
|
113
|
+
*/
|
|
114
|
+
this.feedback = 'information';
|
|
115
|
+
/**
|
|
116
|
+
* Adjusts the emphasis to make the notification more or less visually
|
|
117
|
+
* prominent to users. Use this to draw attention to important actions or
|
|
118
|
+
* reduce focus on less critical ones
|
|
119
|
+
*/
|
|
120
|
+
this.emphasis = 'medium';
|
|
121
|
+
/**
|
|
122
|
+
* Allows the notification to be dismissed via a close button (x). The
|
|
123
|
+
* notification is not dismissible unless explicitly enabled.
|
|
124
|
+
*/
|
|
125
|
+
this.dismissible = false;
|
|
126
|
+
/**
|
|
127
|
+
* Controls the visibility of the notification.
|
|
128
|
+
*/
|
|
129
|
+
this.hidden = false; // eslint-disable-line @stencil-community/reserved-member-names
|
|
130
|
+
/**
|
|
131
|
+
* When true, the notification will be hidden initially, but internal changes
|
|
132
|
+
* will not be in a controlled state. Good for animating the notification in.
|
|
133
|
+
*/
|
|
134
|
+
this.initiallyHidden = false;
|
|
135
|
+
//#endregion EVENTS
|
|
136
|
+
/****************************************************************************/
|
|
137
|
+
//#region INTERNAL
|
|
138
|
+
this.iconByFeedback = {
|
|
139
|
+
[constants69bafca2.FeedbackColors.Warning]: 'alert-circle',
|
|
140
|
+
[constants69bafca2.FeedbackColors.Information]: 'info-circle',
|
|
141
|
+
[constants69bafca2.FeedbackColors.Success]: 'circle-check',
|
|
142
|
+
[constants69bafca2.FeedbackColors.Error]: 'alert-triangle',
|
|
143
|
+
[constants69bafca2.FeedbackColors.Neutral]: 'help',
|
|
144
|
+
};
|
|
145
|
+
this.roleByFeedback = {
|
|
146
|
+
[constants69bafca2.FeedbackColors.Error]: 'alert',
|
|
147
|
+
[constants69bafca2.FeedbackColors.Warning]: 'alert',
|
|
148
|
+
[constants69bafca2.FeedbackColors.Information]: 'status',
|
|
149
|
+
[constants69bafca2.FeedbackColors.Success]: 'status',
|
|
150
|
+
[constants69bafca2.FeedbackColors.Neutral]: 'status',
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//#endregion PROPERTIES
|
|
154
|
+
/****************************************************************************/
|
|
155
|
+
//#region METHODS
|
|
156
|
+
/**
|
|
157
|
+
* Dismisses the notification with an animation, after the animation is
|
|
158
|
+
* complete, the hiddenChanged event will be emitted with the value of true,
|
|
159
|
+
* and the hidden prop will be set to true.
|
|
160
|
+
*/
|
|
161
|
+
async dismiss() {
|
|
162
|
+
await this.dismissAnimation();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Sets the hidden prop to false, and shows the notification with an
|
|
166
|
+
* animation, after the animation is complete, the hiddenChanged event will be
|
|
167
|
+
* emitted with the value of false.
|
|
168
|
+
*/
|
|
169
|
+
async show() {
|
|
170
|
+
await this.showAnimation();
|
|
171
|
+
}
|
|
172
|
+
getDefaultIcon() {
|
|
173
|
+
var _a;
|
|
174
|
+
return (_a = this.iconByFeedback[this.feedback]) !== null && _a !== void 0 ? _a : 'info-circle';
|
|
175
|
+
}
|
|
176
|
+
getAriaRole() {
|
|
177
|
+
var _a;
|
|
178
|
+
return (_a = this.roleByFeedback[this.feedback]) !== null && _a !== void 0 ? _a : 'status';
|
|
179
|
+
}
|
|
180
|
+
getAriaLive() {
|
|
181
|
+
return this.getAriaRole() === 'alert' ? 'assertive' : 'polite';
|
|
182
|
+
}
|
|
183
|
+
getHeadingId() {
|
|
184
|
+
return this.heading ? `nv-notification-${this.uid}-heading` : null;
|
|
185
|
+
}
|
|
186
|
+
getMessageId() {
|
|
187
|
+
return this.message ? `nv-notification-${this.uid}-message` : null;
|
|
188
|
+
}
|
|
189
|
+
async showAnimation() {
|
|
190
|
+
this.hidden = false;
|
|
191
|
+
const { setFadeIn } = fade_animation9b939939.useFade(this.container);
|
|
192
|
+
const { expand } = collapse_animation6e0b08df.useCollapse(this.el, {
|
|
193
|
+
duration: 300,
|
|
194
|
+
overflow: 'visible',
|
|
195
|
+
});
|
|
196
|
+
const { slideY, setSlideY } = useSlide(this.container, {
|
|
197
|
+
duration: 300,
|
|
198
|
+
});
|
|
199
|
+
setSlideY(-100);
|
|
200
|
+
setFadeIn();
|
|
201
|
+
await timeline_animation79215cd4.parallel(slideY({ from: -100, to: 0 }), expand).start();
|
|
202
|
+
this.hiddenChanged.emit(false);
|
|
203
|
+
}
|
|
204
|
+
getSlideDestination(pos) {
|
|
205
|
+
switch (pos) {
|
|
206
|
+
case constants69bafca2.NotificationPosition.TopRight:
|
|
207
|
+
case constants69bafca2.NotificationPosition.BottomRight:
|
|
208
|
+
return { axis: 'x', to: 100 }; // right
|
|
209
|
+
case constants69bafca2.NotificationPosition.TopLeft:
|
|
210
|
+
case constants69bafca2.NotificationPosition.BottomLeft:
|
|
211
|
+
return { axis: 'x', to: -100 }; // left
|
|
212
|
+
case constants69bafca2.NotificationPosition.TopCenter:
|
|
213
|
+
return { axis: 'y', to: -100 }; // up
|
|
214
|
+
case constants69bafca2.NotificationPosition.BottomCenter:
|
|
215
|
+
return { axis: 'y', to: 100 }; // down
|
|
216
|
+
default:
|
|
217
|
+
return { axis: 'x', to: 100 }; // fallback
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async dismissAnimation() {
|
|
221
|
+
var _a;
|
|
222
|
+
const position = (_a = this.el
|
|
223
|
+
.closest('nv-notificationcontainer')) === null || _a === void 0 ? void 0 : _a.getAttribute('position');
|
|
224
|
+
const destination = this.getSlideDestination(position);
|
|
225
|
+
const { fadeOut } = fade_animation9b939939.useFade(this.container, { duration: 300 });
|
|
226
|
+
const { slideX, slideY, setSlideReset } = useSlide(this.container, {
|
|
227
|
+
duration: 500,
|
|
228
|
+
});
|
|
229
|
+
const { collapse } = collapse_animation6e0b08df.useCollapse(this.el, {
|
|
230
|
+
duration: 500,
|
|
231
|
+
overflow: 'visible',
|
|
232
|
+
});
|
|
233
|
+
const slide = destination.axis === 'x'
|
|
234
|
+
? slideX({ from: 0, to: destination.to })
|
|
235
|
+
: slideY({ from: 0, to: destination.to });
|
|
236
|
+
setSlideReset();
|
|
237
|
+
await timeline_animation79215cd4.parallel(fadeOut, slide, collapse).start();
|
|
238
|
+
this.hidden = true;
|
|
239
|
+
this.hiddenChanged.emit(true);
|
|
240
|
+
}
|
|
241
|
+
//#endregion INTERNAL
|
|
242
|
+
/****************************************************************************/
|
|
243
|
+
//#region LIFECYCLE
|
|
244
|
+
componentWillLoad() {
|
|
245
|
+
this.headingSlot = this.el.querySelector('[slot="heading"]');
|
|
246
|
+
this.messageSlot = this.el.querySelector('[slot="content"]');
|
|
247
|
+
this.actionsSlot = this.el.querySelector('[slot="actions"]');
|
|
248
|
+
if (this.initiallyHidden)
|
|
249
|
+
this.hidden = true;
|
|
250
|
+
}
|
|
251
|
+
//#endregion LIFECYCLE
|
|
252
|
+
/****************************************************************************/
|
|
253
|
+
//#region RENDER
|
|
254
|
+
render() {
|
|
255
|
+
var _a, _b, _c;
|
|
256
|
+
return (index.h(index.Host, { key: '6e0b8abd9cbcb62b0b133db77520aa5aaa4173c9', role: this.getAriaRole(), "aria-live": this.getAriaLive(), "aria-atomic": true, "aria-labelledby": (_a = this.getHeadingId()) !== null && _a !== void 0 ? _a : null, "aria-describedby": (_b = this.getMessageId()) !== null && _b !== void 0 ? _b : null, tabindex: "-1" }, index.h("div", { key: '41b2ad35bf5220333e132d61f8843d1136cb1f40', "data-scope": "container", ref: el => (this.container = el) }, this.dismissible && (index.h("button", { key: '63116f239f7108ae945845c247c712827d8ae8a6', "data-scope": "dismiss", type: "button", onClick: this.dismiss.bind(this) }, index.h("nv-icon", { key: 'dc19bf166c6d2eccd3d40384d43206457f0d03f0', name: "x", size: "sm" }))), index.h("nv-icon", { key: 'e673ac1cc78300bc3425018a0cdfc4b90c679796', name: (_c = this.icon) !== null && _c !== void 0 ? _c : this.getDefaultIcon(), size: "md", "data-scope": "icon" }), index.h("div", { key: '95cb6ec06d89cda8e5170f9ff0f863b6b0b7e32d', "data-scope": "content" }, (this.heading || this.headingSlot) && (index.h("p", { key: 'ed654c0271d2ff8538295d8f7bf58a9754abb4c9', id: this.getHeadingId(), "data-scope": "heading" }, index.h("slot", { key: '00cc14a709059b9caf2117174ef7fcc310f5965f', name: "heading" }, this.heading))), (this.message || this.messageSlot) && (index.h("p", { key: 'c7c0bcbc2b54fdfdf8280af6a377929bf17fd688', id: this.getMessageId(), "data-scope": "message" }, index.h("slot", { key: '946db5aeb667b67f52f51adbb1b8f600325f937e', name: "content" }, this.message))), this.actionsSlot && (index.h("div", { key: 'd94560b658507a515a1360057121e933b95e6fe6', "data-scope": "actions" }, index.h("slot", { key: 'db185d3924c7d1fbeb30578992f2375e92a0d4bc', name: "actions" })))))));
|
|
257
|
+
}
|
|
258
|
+
get el() { return index.getElement(this); }
|
|
259
|
+
};
|
|
260
|
+
NvNotification.style = NvNotificationStyle0;
|
|
261
|
+
|
|
262
|
+
exports.nv_notification = NvNotification;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('react-dom');
|
|
6
|
+
|
|
7
|
+
const nvNotificationcontainerCss = "nv-notificationcontainer{position:fixed;display:flex;flex-direction:column;padding:var(--spacing-2);padding-top:0;z-index:9999;pointer-events:none;width:100%;max-width:512px}nv-notificationcontainer.position-top-right{top:0;right:0}nv-notificationcontainer.position-top-right nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-top-left{top:0;left:0}nv-notificationcontainer.position-top-left nv-notification{margin-bottom:var(--spacing-2)}nv-notificationcontainer.position-top-center{top:0;left:50%;transform:translateX(-50%)}nv-notificationcontainer.position-top-center nv-notification{margin-bottom:var(--spacing-2)}nv-notificationcontainer.position-bottom-right{bottom:0;right:0;flex-direction:column-reverse}nv-notificationcontainer.position-bottom-right nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-bottom-left{bottom:0;left:0;flex-direction:column-reverse}nv-notificationcontainer.position-bottom-left nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-bottom-center{bottom:0;left:50%;transform:translateX(-50%);flex-direction:column-reverse}nv-notificationcontainer.position-bottom-center nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer>*{pointer-events:auto}";
|
|
8
|
+
const NvNotificationcontainerStyle0 = nvNotificationcontainerCss;
|
|
9
|
+
|
|
10
|
+
const NvNotificationContainer = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
/****************************************************************************/
|
|
14
|
+
//#region PROPERTIES
|
|
15
|
+
/**
|
|
16
|
+
* Position of the notification container on the screen.
|
|
17
|
+
*/
|
|
18
|
+
this.position = 'top-right';
|
|
19
|
+
}
|
|
20
|
+
//#endregion PROPERTIES
|
|
21
|
+
/****************************************************************************/
|
|
22
|
+
//#region METHODS
|
|
23
|
+
//#endregion METHODS
|
|
24
|
+
/****************************************************************************/
|
|
25
|
+
//#region WATCHERS
|
|
26
|
+
//#endregion WATCHERS
|
|
27
|
+
/****************************************************************************/
|
|
28
|
+
//#region LIFECYCLE
|
|
29
|
+
//#endregion LIFECYCLE
|
|
30
|
+
/****************************************************************************/
|
|
31
|
+
//#region EVENTS
|
|
32
|
+
//#endregion EVENTS
|
|
33
|
+
/****************************************************************************/
|
|
34
|
+
//#region RENDER
|
|
35
|
+
render() {
|
|
36
|
+
return (index.h(index.Host, { key: 'db4005459b926bcfef55e76f61bff0b5635f2872', class: `position-${this.position}` }, index.h("slot", { key: '518909541ca3e9e82168436a43d5362c414c0ec3' })));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
NvNotificationContainer.style = NvNotificationcontainerStyle0;
|
|
40
|
+
|
|
41
|
+
exports.nv_notificationcontainer = NvNotificationContainer;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
|
+
var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
|
|
5
5
|
var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
|
|
6
6
|
var events_utilsFe1d907f = require('./events.utils-fe1d907f-01N__3wY.js');
|
|
7
7
|
require('react');
|
|
8
|
+
require('react-dom');
|
|
8
9
|
|
|
9
10
|
const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) => {
|
|
10
|
-
const nodeStyler =
|
|
11
|
+
const nodeStyler = fade_animation9b939939.index(node);
|
|
11
12
|
/**
|
|
12
13
|
* Will animate the scale and optionally the opacity to make the element grow and fade in,
|
|
13
14
|
* and removes the scale and opacity style attributes once complete.
|
|
@@ -1658,6 +1659,50 @@ const NvPopover = class {
|
|
|
1658
1659
|
index.registerInstance(this, hostRef);
|
|
1659
1660
|
this.openChanged = index.createEvent(this, "openChanged");
|
|
1660
1661
|
this.eventsAttached = false;
|
|
1662
|
+
this.isAnimating = false;
|
|
1663
|
+
this.clickEvents = [
|
|
1664
|
+
['click', () => (this.open = !this.open)],
|
|
1665
|
+
];
|
|
1666
|
+
this.hoverEvents = [
|
|
1667
|
+
[
|
|
1668
|
+
'focus',
|
|
1669
|
+
() => {
|
|
1670
|
+
clearTimeout(this.hideTimeout);
|
|
1671
|
+
this.showTimeout = setTimeout(() => (this.open = true), this.enterDelay);
|
|
1672
|
+
},
|
|
1673
|
+
],
|
|
1674
|
+
[
|
|
1675
|
+
'blur',
|
|
1676
|
+
() => {
|
|
1677
|
+
clearTimeout(this.showTimeout);
|
|
1678
|
+
this.hideTimeout = setTimeout(() => (this.open = false), 50);
|
|
1679
|
+
},
|
|
1680
|
+
],
|
|
1681
|
+
[
|
|
1682
|
+
'mouseenter',
|
|
1683
|
+
() => {
|
|
1684
|
+
clearTimeout(this.hideTimeout);
|
|
1685
|
+
this.showTimeout = setTimeout(() => (this.open = true), this.enterDelay);
|
|
1686
|
+
},
|
|
1687
|
+
],
|
|
1688
|
+
[
|
|
1689
|
+
'mouseleave',
|
|
1690
|
+
() => {
|
|
1691
|
+
clearTimeout(this.showTimeout);
|
|
1692
|
+
this.hideTimeout = setTimeout(() => (this.open = false), 100);
|
|
1693
|
+
},
|
|
1694
|
+
],
|
|
1695
|
+
];
|
|
1696
|
+
this.closeEvents = [
|
|
1697
|
+
[
|
|
1698
|
+
'keydown',
|
|
1699
|
+
(e) => {
|
|
1700
|
+
if (e.key === 'Escape') {
|
|
1701
|
+
this.open = false;
|
|
1702
|
+
}
|
|
1703
|
+
},
|
|
1704
|
+
],
|
|
1705
|
+
];
|
|
1661
1706
|
/**
|
|
1662
1707
|
* Use this prop to toggle the visibility of the popover. Set to true to show
|
|
1663
1708
|
* the popover and false to hide it.
|
|
@@ -1727,57 +1772,13 @@ const NvPopover = class {
|
|
|
1727
1772
|
return;
|
|
1728
1773
|
this.open = false;
|
|
1729
1774
|
};
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1775
|
+
//#endregion METHODS
|
|
1776
|
+
/****************************************************************************/
|
|
1777
|
+
//#region HELPERS
|
|
1733
1778
|
this.outsideClickEvents = [
|
|
1734
1779
|
['click', this.handleClickOutside],
|
|
1735
1780
|
['touchstart', this.handleClickOutside],
|
|
1736
1781
|
];
|
|
1737
|
-
this.hoverEvents = [
|
|
1738
|
-
[
|
|
1739
|
-
'focus',
|
|
1740
|
-
() => {
|
|
1741
|
-
clearTimeout(this.hideTimeout);
|
|
1742
|
-
this.showTimeout = setTimeout(() => (this.open = true), this.enterDelay);
|
|
1743
|
-
},
|
|
1744
|
-
],
|
|
1745
|
-
[
|
|
1746
|
-
'blur',
|
|
1747
|
-
() => {
|
|
1748
|
-
clearTimeout(this.showTimeout);
|
|
1749
|
-
this.hideTimeout = setTimeout(() => (this.open = false), 50);
|
|
1750
|
-
},
|
|
1751
|
-
],
|
|
1752
|
-
[
|
|
1753
|
-
'mouseenter',
|
|
1754
|
-
() => {
|
|
1755
|
-
clearTimeout(this.hideTimeout);
|
|
1756
|
-
this.showTimeout = setTimeout(() => (this.open = true), this.enterDelay);
|
|
1757
|
-
},
|
|
1758
|
-
],
|
|
1759
|
-
[
|
|
1760
|
-
'mouseleave',
|
|
1761
|
-
() => {
|
|
1762
|
-
clearTimeout(this.showTimeout);
|
|
1763
|
-
this.hideTimeout = setTimeout(() => (this.open = false), 100);
|
|
1764
|
-
},
|
|
1765
|
-
],
|
|
1766
|
-
];
|
|
1767
|
-
this.closeEvents = [
|
|
1768
|
-
[
|
|
1769
|
-
'keydown',
|
|
1770
|
-
(e) => {
|
|
1771
|
-
if (e.key === 'Escape') {
|
|
1772
|
-
this.open = false;
|
|
1773
|
-
}
|
|
1774
|
-
},
|
|
1775
|
-
],
|
|
1776
|
-
];
|
|
1777
|
-
//#endregion EVENTS
|
|
1778
|
-
/****************************************************************************/
|
|
1779
|
-
//#region WATCHERS
|
|
1780
|
-
this.isAnimating = false;
|
|
1781
1782
|
}
|
|
1782
1783
|
//#endregion PROPERTIES
|
|
1783
1784
|
/****************************************************************************/
|
|
@@ -1871,18 +1872,9 @@ const NvPopover = class {
|
|
|
1871
1872
|
}
|
|
1872
1873
|
});
|
|
1873
1874
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
return;
|
|
1878
|
-
if (this.nested)
|
|
1879
|
-
return;
|
|
1880
|
-
if ((_a = event.target) === null || _a === void 0 ? void 0 : _a.hasAttribute('nested'))
|
|
1881
|
-
return;
|
|
1882
|
-
// This popover should close when another one is opened.
|
|
1883
|
-
if (event.target !== this.el && event.detail === true)
|
|
1884
|
-
this.open = false;
|
|
1885
|
-
}
|
|
1875
|
+
//#endregion EVENTS
|
|
1876
|
+
/****************************************************************************/
|
|
1877
|
+
//#region WATCHERS
|
|
1886
1878
|
async handleOpenChange(open) {
|
|
1887
1879
|
// Prevent multiple animations from running at the same time.
|
|
1888
1880
|
while (this.isAnimating) {
|
|
@@ -1902,7 +1894,7 @@ const NvPopover = class {
|
|
|
1902
1894
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1903
1895
|
amount: 0.85,
|
|
1904
1896
|
});
|
|
1905
|
-
const { fadeOut } =
|
|
1897
|
+
const { fadeOut } = fade_animation9b939939.useFade(this.popoverElement, {
|
|
1906
1898
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1907
1899
|
});
|
|
1908
1900
|
if (open === true) {
|
|
@@ -1924,6 +1916,21 @@ const NvPopover = class {
|
|
|
1924
1916
|
}
|
|
1925
1917
|
//#endregion WATCHERS
|
|
1926
1918
|
/****************************************************************************/
|
|
1919
|
+
//#region LISTENERS
|
|
1920
|
+
handleOpenChanged(event) {
|
|
1921
|
+
var _a;
|
|
1922
|
+
if (this.triggerMode === 'controlled')
|
|
1923
|
+
return;
|
|
1924
|
+
if (this.nested)
|
|
1925
|
+
return;
|
|
1926
|
+
if ((_a = event.target) === null || _a === void 0 ? void 0 : _a.hasAttribute('nested'))
|
|
1927
|
+
return;
|
|
1928
|
+
// This popover should close when another one is opened.
|
|
1929
|
+
if (event.target !== this.el && event.detail === true)
|
|
1930
|
+
this.open = false;
|
|
1931
|
+
}
|
|
1932
|
+
//#endregion LISTENERS
|
|
1933
|
+
/****************************************************************************/
|
|
1927
1934
|
//#region LIFECYCLE
|
|
1928
1935
|
componentWillLoad() {
|
|
1929
1936
|
if (!this.triggerElement)
|
|
@@ -1939,7 +1946,7 @@ const NvPopover = class {
|
|
|
1939
1946
|
setGrowOut();
|
|
1940
1947
|
}
|
|
1941
1948
|
else {
|
|
1942
|
-
const { setFadeIn } =
|
|
1949
|
+
const { setFadeIn } = fade_animation9b939939.useFade(this.popoverElement);
|
|
1943
1950
|
setFadeIn();
|
|
1944
1951
|
this.popoverElement.removeAttribute('hidden');
|
|
1945
1952
|
}
|
|
@@ -1967,7 +1974,7 @@ const NvPopover = class {
|
|
|
1967
1974
|
/****************************************************************************/
|
|
1968
1975
|
//#region RENDER
|
|
1969
1976
|
render() {
|
|
1970
|
-
return (index.h(index.Host, { key: '
|
|
1977
|
+
return (index.h(index.Host, { key: '0644e319053ca1f216aac89f5737805008b097be' }, index.h("slot", { key: '7f03080c300378be09e6fce9a44fa2a4a8730f40', name: "trigger" }), index.h("div", { key: '801b7f1dd8c87db5eb06bcabddda8936c89a6ab2', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: 'd8e40589a4c53d4ac0c313f3d97cf61ef928f56d', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: 'af0743b1a94c44dd161712e080dbf54a69c9d4a4', name: "content" }))));
|
|
1971
1978
|
}
|
|
1972
1979
|
get el() { return index.getElement(this); }
|
|
1973
1980
|
static get watchers() { return {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-7K7BV1CP.js');
|
|
4
4
|
require('react');
|
|
5
|
+
require('react-dom');
|
|
5
6
|
|
|
6
7
|
const nvRowCss = "nv-row{display:flex;flex-wrap:wrap;margin-right:calc(var(--spacing-4) * -1);margin-left:calc(var(--spacing-4) * -1);row-gap:var(--spacing-4)}";
|
|
7
8
|
const NvRowStyle0 = nvRowCss;
|
|
@@ -13,7 +14,7 @@ const NvRow = class {
|
|
|
13
14
|
/****************************************************************************/
|
|
14
15
|
//#region RENDER
|
|
15
16
|
render() {
|
|
16
|
-
return (index.h(index.Host, { key: '
|
|
17
|
+
return (index.h(index.Host, { key: '9623a4c73a5a2557b2ba7eb346ae0740ca7291c5' }, index.h("slot", { key: '502ea804deec9e91057bfaf6f2fa4fdb4a5822c3' })));
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
NvRow.style = NvRowStyle0;
|