@nova-design-system/nova-webcomponents 3.31.2-beta.4 → 3.33.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/THIRD_PARTY_NOTICES.txt +89925 -90780
- package/dist/cjs/events.utils-CIlm7hGM.js +47 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{index.esm-CG1TVKfu.js → index.esm-D5HbQDBa.js} +48 -30
- package/dist/cjs/nv-calendar.cjs.entry.js +2 -2
- package/dist/cjs/nv-dialog.cjs.entry.js +35 -14
- package/dist/cjs/nv-drawer.cjs.entry.js +6 -6
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddate.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldradio.cjs.entry.js +21 -6
- package/dist/cjs/nv-fieldselect.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldslider.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldtext.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +1 -1
- package/dist/cjs/nv-notification.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +182 -136
- package/dist/cjs/nv-toggle.cjs.entry.js +1 -1
- package/dist/cjs/v4-_2BfiRUa.js +52 -0
- package/dist/collection/components/nv-dialog/nv-dialog.css +8 -7
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +7 -0
- package/dist/collection/components/nv-dialog/nv-dialog.js +30 -9
- package/dist/collection/components/nv-drawer/nv-drawer.js +2 -2
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js +10 -0
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +20 -5
- package/dist/collection/components/nv-popover/nv-popover.js +13 -7
- package/dist/collection/utils/events.utils.js +28 -10
- package/dist/components/index.js +1 -1
- package/dist/components/nv-accordion-item.js +1 -1
- package/dist/components/nv-accordion.js +1 -1
- package/dist/components/nv-alert.js +1 -1
- package/dist/components/nv-avatar.js +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-breadcrumb.js +1 -1
- package/dist/components/nv-calendar.js +1 -1
- package/dist/components/nv-datagrid.js +1 -1
- package/dist/components/nv-dialog.js +1 -1
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-drawer.js +1 -1
- package/dist/components/nv-drawerfooter.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -1
- package/dist/components/nv-fielddate.js +1 -1
- package/dist/components/nv-fielddaterange.js +1 -1
- package/dist/components/nv-fielddropdown.js +1 -1
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fielddropdownitemcheck.js +1 -1
- package/dist/components/nv-fieldmultiselect.js +1 -1
- package/dist/components/nv-fieldnumber.js +1 -1
- package/dist/components/nv-fieldpassword.js +1 -1
- package/dist/components/nv-fieldradio.js +1 -1
- package/dist/components/nv-fieldselect.js +1 -1
- package/dist/components/nv-fieldslider.js +1 -1
- package/dist/components/nv-fieldtext.js +1 -1
- package/dist/components/nv-fieldtextarea.js +1 -1
- package/dist/components/nv-fieldtime.js +1 -1
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-menu.js +1 -1
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-notification.js +1 -1
- package/dist/components/nv-pagination-nav.js +1 -1
- package/dist/components/nv-paginationtable.js +1 -1
- package/dist/components/nv-pill.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-sidebar.js +1 -1
- package/dist/components/nv-sidebarnavitem.js +1 -1
- package/dist/components/nv-statusindicator.js +1 -1
- package/dist/components/nv-tableheader.js +1 -1
- package/dist/components/nv-tag.js +1 -1
- package/dist/components/nv-toggle.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-m37Anefm.js → p-8N4lU0iY.js} +1 -1
- package/dist/components/p-B0u4Ixsb.js +1 -0
- package/dist/components/{p-BWRw4xPL.js → p-B4Bj7woW.js} +1 -1
- package/dist/components/{p-DiZ4PH5U.js → p-BO1b1Va8.js} +1 -1
- package/dist/components/{p-p6cOkAo9.js → p-BRGkbQcZ.js} +1 -1
- package/dist/components/{p-DCP9DeqM.js → p-Bb6b1l7X.js} +1 -1
- package/dist/components/p-BysSxG1C.js +1 -0
- package/dist/components/p-C4Gisby9.js +1 -0
- package/dist/components/{p-CHBitkH2.js → p-C5hX9g5W.js} +1 -1
- package/dist/components/p-CK3_k8jD.js +1 -0
- package/dist/components/p-DBTxpXCn.js +5 -0
- package/dist/components/{p-CM4DYhll.js → p-DNND0rYo.js} +1 -1
- package/dist/components/{p-C0sYXnfw.js → p-DnFgexAD.js} +1 -1
- package/dist/components/{p-151La_Re.js → p-DtrETIc3.js} +1 -1
- package/dist/components/{p-BLVk95gn.js → p-DyrYhAHY.js} +1 -1
- package/dist/components/p-S0RrRAAC.js +1 -0
- package/dist/components/{p-N_OyEprf.js → p-XZ5yyea3.js} +1 -1
- package/dist/components/{p-MJEiA0Bq.js → p-Z4Q7ZQYs.js} +1 -1
- package/dist/components/{p-6T2ybMzE.js → p-iZAJ4_uI.js} +1 -1
- package/dist/components/{p-DQwzzl-e.js → p-vcF-XOKu.js} +1 -1
- package/dist/esm/events.utils-BysSxG1C.js +43 -0
- package/dist/esm/{index.esm-D3eWMME9.js → index.esm-DBTxpXCn.js} +48 -30
- package/dist/esm/index.js +1 -1
- package/dist/esm/nv-calendar.entry.js +2 -2
- package/dist/esm/nv-dialog.entry.js +35 -14
- package/dist/esm/nv-drawer.entry.js +6 -6
- package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
- package/dist/esm/nv-fielddate.entry.js +1 -1
- package/dist/esm/nv-fielddaterange.entry.js +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +1 -1
- package/dist/esm/nv-fieldmultiselect.entry.js +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +1 -1
- package/dist/esm/nv-fieldpassword.entry.js +1 -1
- package/dist/esm/nv-fieldradio.entry.js +21 -6
- package/dist/esm/nv-fieldselect.entry.js +1 -1
- package/dist/esm/nv-fieldslider.entry.js +1 -1
- package/dist/esm/nv-fieldtext.entry.js +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +1 -1
- package/dist/esm/nv-fieldtime.entry.js +1 -1
- package/dist/esm/nv-icon.entry.js +1 -1
- package/dist/esm/nv-notification.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +182 -136
- package/dist/esm/nv-toggle.entry.js +1 -1
- package/dist/esm/v4-CK3_k8jD.js +50 -0
- package/dist/native/index.esm.js +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/p-003aae89.entry.js +1 -0
- package/dist/native/p-0a067f5d.entry.js +1 -0
- package/dist/native/{p-7a2189fd.entry.js → p-0cfa2a12.entry.js} +1 -1
- package/dist/native/{p-29283b5d.entry.js → p-0e1f410b.entry.js} +1 -1
- package/dist/native/{p-f49dac2e.entry.js → p-1a77f957.entry.js} +1 -1
- package/dist/native/{p-fde8def2.entry.js → p-25e0f795.entry.js} +1 -1
- package/dist/native/p-2808c51d.entry.js +1 -0
- package/dist/native/{p-a14356a2.entry.js → p-3ad4b348.entry.js} +1 -1
- package/dist/native/{p-84069455.entry.js → p-5084e62a.entry.js} +1 -1
- package/dist/native/{p-f551703a.entry.js → p-59bab8ca.entry.js} +1 -1
- package/dist/native/p-67c4583d.entry.js +1 -0
- package/dist/native/{p-9ae86283.entry.js → p-6c200454.entry.js} +1 -1
- package/dist/native/{p-282f27a8.entry.js → p-96debbf0.entry.js} +1 -1
- package/dist/native/p-9d4f3fa8.entry.js +1 -0
- package/dist/native/p-BysSxG1C.js +1 -0
- package/dist/native/p-CK3_k8jD.js +1 -0
- package/dist/native/p-DBTxpXCn.js +5 -0
- package/dist/native/p-ab22c992.entry.js +1 -0
- package/dist/native/{p-f35cfcf7.entry.js → p-ade6d065.entry.js} +1 -1
- package/dist/native/{p-006b0662.entry.js → p-c0cb8fbd.entry.js} +1 -1
- package/dist/native/{p-35cca4d2.entry.js → p-c59cbcf7.entry.js} +1 -1
- package/dist/native/{p-0be43863.entry.js → p-dd636420.entry.js} +1 -1
- package/dist/native/{p-9cb72554.entry.js → p-fe8e022f.entry.js} +1 -1
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +10 -0
- package/dist/types/components/nv-fieldradio/nv-fieldradio.d.ts +2 -0
- package/dist/types/utils/events.utils.d.ts +29 -8
- package/hydrate/index.js +358 -245
- package/hydrate/index.mjs +358 -245
- package/package.json +2 -2
- package/dist/cjs/events.utils-BE6R5q9C.js +0 -30
- package/dist/cjs/v4-C1vaJ4yP.js +0 -56
- package/dist/components/p-B4EbX_RC.js +0 -1
- package/dist/components/p-B6GgGra-.js +0 -1
- package/dist/components/p-BdYh22OP.js +0 -1
- package/dist/components/p-CtKp5aji.js +0 -1
- package/dist/components/p-D3eWMME9.js +0 -5
- package/dist/components/p-hklkrJsV.js +0 -1
- package/dist/esm/events.utils-B6GgGra-.js +0 -26
- package/dist/esm/v4-BdYh22OP.js +0 -54
- package/dist/native/p-11ae498c.entry.js +0 -1
- package/dist/native/p-193d5813.entry.js +0 -1
- package/dist/native/p-38b731e1.entry.js +0 -1
- package/dist/native/p-45191d81.entry.js +0 -1
- package/dist/native/p-520e5d0d.entry.js +0 -1
- package/dist/native/p-B6GgGra-.js +0 -1
- package/dist/native/p-BdYh22OP.js +0 -1
- package/dist/native/p-D3eWMME9.js +0 -5
- package/dist/native/p-ba32c793.entry.js +0 -1
|
@@ -7,7 +7,7 @@ var fade_animation = require('./fade.animation-BQSqXXOJ.js');
|
|
|
7
7
|
require('./style-value-types.es-B1vLqX9m.js');
|
|
8
8
|
var slide_animation = require('./slide.animation-Cb3tpLQv.js');
|
|
9
9
|
var timeline_animation = require('./timeline.animation-KteJaZPb.js');
|
|
10
|
-
var v4 = require('./v4-
|
|
10
|
+
var v4 = require('./v4-_2BfiRUa.js');
|
|
11
11
|
|
|
12
12
|
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)}`;
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@ var index = require('./index-BfQyuDYm.js');
|
|
|
4
4
|
var fade_animation = require('./fade.animation-BQSqXXOJ.js');
|
|
5
5
|
var grow_animation = require('./grow.animation-ynu_HmA_.js');
|
|
6
6
|
require('./style-value-types.es-B1vLqX9m.js');
|
|
7
|
-
var events_utils = require('./events.utils-
|
|
7
|
+
var events_utils = require('./events.utils-CIlm7hGM.js');
|
|
8
8
|
var dom_utils = require('./dom.utils-8VY5SfMZ.js');
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,10 +25,6 @@ const oppositeSideMap = {
|
|
|
25
25
|
bottom: 'top',
|
|
26
26
|
top: 'bottom'
|
|
27
27
|
};
|
|
28
|
-
const oppositeAlignmentMap = {
|
|
29
|
-
start: 'end',
|
|
30
|
-
end: 'start'
|
|
31
|
-
};
|
|
32
28
|
function clamp(start, value, end) {
|
|
33
29
|
return max(start, min(value, end));
|
|
34
30
|
}
|
|
@@ -48,7 +44,8 @@ function getAxisLength(axis) {
|
|
|
48
44
|
return axis === 'y' ? 'height' : 'width';
|
|
49
45
|
}
|
|
50
46
|
function getSideAxis(placement) {
|
|
51
|
-
|
|
47
|
+
const firstChar = placement[0];
|
|
48
|
+
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
|
|
52
49
|
}
|
|
53
50
|
function getAlignmentAxis(placement) {
|
|
54
51
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -71,21 +68,21 @@ function getExpandedPlacements(placement) {
|
|
|
71
68
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
72
69
|
}
|
|
73
70
|
function getOppositeAlignmentPlacement(placement) {
|
|
74
|
-
return placement.replace(
|
|
71
|
+
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
|
75
72
|
}
|
|
73
|
+
const lrPlacement = ['left', 'right'];
|
|
74
|
+
const rlPlacement = ['right', 'left'];
|
|
75
|
+
const tbPlacement = ['top', 'bottom'];
|
|
76
|
+
const btPlacement = ['bottom', 'top'];
|
|
76
77
|
function getSideList(side, isStart, rtl) {
|
|
77
|
-
const lr = ['left', 'right'];
|
|
78
|
-
const rl = ['right', 'left'];
|
|
79
|
-
const tb = ['top', 'bottom'];
|
|
80
|
-
const bt = ['bottom', 'top'];
|
|
81
78
|
switch (side) {
|
|
82
79
|
case 'top':
|
|
83
80
|
case 'bottom':
|
|
84
|
-
if (rtl) return isStart ?
|
|
85
|
-
return isStart ?
|
|
81
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
82
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
86
83
|
case 'left':
|
|
87
84
|
case 'right':
|
|
88
|
-
return isStart ?
|
|
85
|
+
return isStart ? tbPlacement : btPlacement;
|
|
89
86
|
default:
|
|
90
87
|
return [];
|
|
91
88
|
}
|
|
@@ -102,7 +99,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
102
99
|
return list;
|
|
103
100
|
}
|
|
104
101
|
function getOppositePlacement(placement) {
|
|
105
|
-
|
|
102
|
+
const side = getSide(placement);
|
|
103
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
106
104
|
}
|
|
107
105
|
function expandPaddingObject(padding) {
|
|
108
106
|
return {
|
|
@@ -196,6 +194,74 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
196
194
|
return coords;
|
|
197
195
|
}
|
|
198
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
199
|
+
* element is overflowing a given clipping boundary on each side.
|
|
200
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
201
|
+
* - negative = how many pixels left before it will overflow
|
|
202
|
+
* - 0 = lies flush with the boundary
|
|
203
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
204
|
+
*/
|
|
205
|
+
async function detectOverflow(state, options) {
|
|
206
|
+
var _await$platform$isEle;
|
|
207
|
+
if (options === void 0) {
|
|
208
|
+
options = {};
|
|
209
|
+
}
|
|
210
|
+
const {
|
|
211
|
+
x,
|
|
212
|
+
y,
|
|
213
|
+
platform,
|
|
214
|
+
rects,
|
|
215
|
+
elements,
|
|
216
|
+
strategy
|
|
217
|
+
} = state;
|
|
218
|
+
const {
|
|
219
|
+
boundary = 'clippingAncestors',
|
|
220
|
+
rootBoundary = 'viewport',
|
|
221
|
+
elementContext = 'floating',
|
|
222
|
+
altBoundary = false,
|
|
223
|
+
padding = 0
|
|
224
|
+
} = evaluate(options, state);
|
|
225
|
+
const paddingObject = getPaddingObject(padding);
|
|
226
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
227
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
228
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
229
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
230
|
+
boundary,
|
|
231
|
+
rootBoundary,
|
|
232
|
+
strategy
|
|
233
|
+
}));
|
|
234
|
+
const rect = elementContext === 'floating' ? {
|
|
235
|
+
x,
|
|
236
|
+
y,
|
|
237
|
+
width: rects.floating.width,
|
|
238
|
+
height: rects.floating.height
|
|
239
|
+
} : rects.reference;
|
|
240
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
241
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
242
|
+
x: 1,
|
|
243
|
+
y: 1
|
|
244
|
+
} : {
|
|
245
|
+
x: 1,
|
|
246
|
+
y: 1
|
|
247
|
+
};
|
|
248
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
249
|
+
elements,
|
|
250
|
+
rect,
|
|
251
|
+
offsetParent,
|
|
252
|
+
strategy
|
|
253
|
+
}) : rect);
|
|
254
|
+
return {
|
|
255
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
256
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
257
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
258
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Maximum number of resets that can occur before bailing to avoid infinite reset loops.
|
|
263
|
+
const MAX_RESET_COUNT = 50;
|
|
264
|
+
|
|
199
265
|
/**
|
|
200
266
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
201
267
|
* next to a given reference element.
|
|
@@ -210,7 +276,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
210
276
|
middleware = [],
|
|
211
277
|
platform
|
|
212
278
|
} = config;
|
|
213
|
-
const
|
|
279
|
+
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
280
|
+
...platform,
|
|
281
|
+
detectOverflow
|
|
282
|
+
};
|
|
214
283
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
215
284
|
let rects = await platform.getElementRects({
|
|
216
285
|
reference,
|
|
@@ -222,13 +291,17 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
222
291
|
y
|
|
223
292
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
224
293
|
let statefulPlacement = placement;
|
|
225
|
-
let middlewareData = {};
|
|
226
294
|
let resetCount = 0;
|
|
227
|
-
|
|
295
|
+
const middlewareData = {};
|
|
296
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
297
|
+
const currentMiddleware = middleware[i];
|
|
298
|
+
if (!currentMiddleware) {
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
228
301
|
const {
|
|
229
302
|
name,
|
|
230
303
|
fn
|
|
231
|
-
} =
|
|
304
|
+
} = currentMiddleware;
|
|
232
305
|
const {
|
|
233
306
|
x: nextX,
|
|
234
307
|
y: nextY,
|
|
@@ -242,7 +315,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
242
315
|
strategy,
|
|
243
316
|
middlewareData,
|
|
244
317
|
rects,
|
|
245
|
-
platform,
|
|
318
|
+
platform: platformWithDetectOverflow,
|
|
246
319
|
elements: {
|
|
247
320
|
reference,
|
|
248
321
|
floating
|
|
@@ -250,14 +323,11 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
250
323
|
});
|
|
251
324
|
x = nextX != null ? nextX : x;
|
|
252
325
|
y = nextY != null ? nextY : y;
|
|
253
|
-
middlewareData = {
|
|
254
|
-
...middlewareData,
|
|
255
|
-
|
|
256
|
-
...middlewareData[name],
|
|
257
|
-
...data
|
|
258
|
-
}
|
|
326
|
+
middlewareData[name] = {
|
|
327
|
+
...middlewareData[name],
|
|
328
|
+
...data
|
|
259
329
|
};
|
|
260
|
-
if (reset && resetCount
|
|
330
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
261
331
|
resetCount++;
|
|
262
332
|
if (typeof reset === 'object') {
|
|
263
333
|
if (reset.placement) {
|
|
@@ -287,71 +357,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
287
357
|
};
|
|
288
358
|
};
|
|
289
359
|
|
|
290
|
-
/**
|
|
291
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
292
|
-
* element is overflowing a given clipping boundary on each side.
|
|
293
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
294
|
-
* - negative = how many pixels left before it will overflow
|
|
295
|
-
* - 0 = lies flush with the boundary
|
|
296
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
297
|
-
*/
|
|
298
|
-
async function detectOverflow(state, options) {
|
|
299
|
-
var _await$platform$isEle;
|
|
300
|
-
if (options === void 0) {
|
|
301
|
-
options = {};
|
|
302
|
-
}
|
|
303
|
-
const {
|
|
304
|
-
x,
|
|
305
|
-
y,
|
|
306
|
-
platform,
|
|
307
|
-
rects,
|
|
308
|
-
elements,
|
|
309
|
-
strategy
|
|
310
|
-
} = state;
|
|
311
|
-
const {
|
|
312
|
-
boundary = 'clippingAncestors',
|
|
313
|
-
rootBoundary = 'viewport',
|
|
314
|
-
elementContext = 'floating',
|
|
315
|
-
altBoundary = false,
|
|
316
|
-
padding = 0
|
|
317
|
-
} = evaluate(options, state);
|
|
318
|
-
const paddingObject = getPaddingObject(padding);
|
|
319
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
320
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
321
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
322
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
323
|
-
boundary,
|
|
324
|
-
rootBoundary,
|
|
325
|
-
strategy
|
|
326
|
-
}));
|
|
327
|
-
const rect = elementContext === 'floating' ? {
|
|
328
|
-
x,
|
|
329
|
-
y,
|
|
330
|
-
width: rects.floating.width,
|
|
331
|
-
height: rects.floating.height
|
|
332
|
-
} : rects.reference;
|
|
333
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
334
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
335
|
-
x: 1,
|
|
336
|
-
y: 1
|
|
337
|
-
} : {
|
|
338
|
-
x: 1,
|
|
339
|
-
y: 1
|
|
340
|
-
};
|
|
341
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
342
|
-
elements,
|
|
343
|
-
rect,
|
|
344
|
-
offsetParent,
|
|
345
|
-
strategy
|
|
346
|
-
}) : rect);
|
|
347
|
-
return {
|
|
348
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
349
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
350
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
351
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
360
|
/**
|
|
356
361
|
* Provides data to position an inner element of the floating element so that it
|
|
357
362
|
* appears centered to the reference element.
|
|
@@ -475,14 +480,16 @@ const flip$1 = function (options) {
|
|
|
475
480
|
return {};
|
|
476
481
|
}
|
|
477
482
|
const side = getSide(placement);
|
|
483
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
478
484
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
479
485
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
480
486
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
481
|
-
|
|
487
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
488
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
482
489
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
483
490
|
}
|
|
484
491
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
485
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
492
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
486
493
|
const overflows = [];
|
|
487
494
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
488
495
|
if (checkMainAxis) {
|
|
@@ -503,16 +510,22 @@ const flip$1 = function (options) {
|
|
|
503
510
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
504
511
|
const nextPlacement = placements[nextIndex];
|
|
505
512
|
if (nextPlacement) {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
514
|
+
if (!ignoreCrossAxisOverflow ||
|
|
515
|
+
// We leave the current main axis only if every placement on that axis
|
|
516
|
+
// overflows the main axis.
|
|
517
|
+
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
518
|
+
// Try next placement and re-run the lifecycle.
|
|
519
|
+
return {
|
|
520
|
+
data: {
|
|
521
|
+
index: nextIndex,
|
|
522
|
+
overflows: overflowsData
|
|
523
|
+
},
|
|
524
|
+
reset: {
|
|
525
|
+
placement: nextPlacement
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
}
|
|
516
529
|
}
|
|
517
530
|
|
|
518
531
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -524,8 +537,17 @@ const flip$1 = function (options) {
|
|
|
524
537
|
switch (fallbackStrategy) {
|
|
525
538
|
case 'bestFit':
|
|
526
539
|
{
|
|
527
|
-
var _overflowsData$
|
|
528
|
-
const placement = (_overflowsData$
|
|
540
|
+
var _overflowsData$filter2;
|
|
541
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
542
|
+
if (hasFallbackAxisSideDirection) {
|
|
543
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
544
|
+
return currentSideAxis === initialSideAxis ||
|
|
545
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
546
|
+
// reading directions favoring greater width.
|
|
547
|
+
currentSideAxis === 'y';
|
|
548
|
+
}
|
|
549
|
+
return true;
|
|
550
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
529
551
|
if (placement) {
|
|
530
552
|
resetPlacement = placement;
|
|
531
553
|
}
|
|
@@ -549,6 +571,8 @@ const flip$1 = function (options) {
|
|
|
549
571
|
};
|
|
550
572
|
};
|
|
551
573
|
|
|
574
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
575
|
+
|
|
552
576
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
553
577
|
// Derivable.
|
|
554
578
|
|
|
@@ -562,7 +586,7 @@ async function convertValueToCoords(state, options) {
|
|
|
562
586
|
const side = getSide(placement);
|
|
563
587
|
const alignment = getAlignment(placement);
|
|
564
588
|
const isVertical = getSideAxis(placement) === 'y';
|
|
565
|
-
const mainAxisMulti =
|
|
589
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
566
590
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
567
591
|
const rawValue = evaluate(options, state);
|
|
568
592
|
|
|
@@ -576,10 +600,9 @@ async function convertValueToCoords(state, options) {
|
|
|
576
600
|
crossAxis: 0,
|
|
577
601
|
alignmentAxis: null
|
|
578
602
|
} : {
|
|
579
|
-
mainAxis: 0,
|
|
580
|
-
crossAxis: 0,
|
|
581
|
-
alignmentAxis:
|
|
582
|
-
...rawValue
|
|
603
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
604
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
605
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
583
606
|
};
|
|
584
607
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
585
608
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -650,7 +673,8 @@ const shift$1 = function (options) {
|
|
|
650
673
|
const {
|
|
651
674
|
x,
|
|
652
675
|
y,
|
|
653
|
-
placement
|
|
676
|
+
placement,
|
|
677
|
+
platform
|
|
654
678
|
} = state;
|
|
655
679
|
const {
|
|
656
680
|
mainAxis: checkMainAxis = true,
|
|
@@ -673,7 +697,7 @@ const shift$1 = function (options) {
|
|
|
673
697
|
x,
|
|
674
698
|
y
|
|
675
699
|
};
|
|
676
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
700
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
677
701
|
const crossAxis = getSideAxis(getSide(placement));
|
|
678
702
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
679
703
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -701,7 +725,11 @@ const shift$1 = function (options) {
|
|
|
701
725
|
...limitedCoords,
|
|
702
726
|
data: {
|
|
703
727
|
x: limitedCoords.x - x,
|
|
704
|
-
y: limitedCoords.y - y
|
|
728
|
+
y: limitedCoords.y - y,
|
|
729
|
+
enabled: {
|
|
730
|
+
[mainAxis]: checkMainAxis,
|
|
731
|
+
[crossAxis]: checkCrossAxis
|
|
732
|
+
}
|
|
705
733
|
}
|
|
706
734
|
};
|
|
707
735
|
}
|
|
@@ -759,26 +787,35 @@ function isOverflowElement(element) {
|
|
|
759
787
|
overflowY,
|
|
760
788
|
display
|
|
761
789
|
} = getComputedStyle(element);
|
|
762
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) &&
|
|
790
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
|
|
763
791
|
}
|
|
764
792
|
function isTableElement(element) {
|
|
765
|
-
return
|
|
793
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
766
794
|
}
|
|
767
795
|
function isTopLayer(element) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
return
|
|
771
|
-
} catch (e) {
|
|
772
|
-
return false;
|
|
796
|
+
try {
|
|
797
|
+
if (element.matches(':popover-open')) {
|
|
798
|
+
return true;
|
|
773
799
|
}
|
|
774
|
-
})
|
|
800
|
+
} catch (_e) {
|
|
801
|
+
// no-op
|
|
802
|
+
}
|
|
803
|
+
try {
|
|
804
|
+
return element.matches(':modal');
|
|
805
|
+
} catch (_e) {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
775
808
|
}
|
|
809
|
+
const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
810
|
+
const containRe = /paint|layout|strict|content/;
|
|
811
|
+
const isNotNone = value => !!value && value !== 'none';
|
|
812
|
+
let isWebKitValue;
|
|
776
813
|
function isContainingBlock(elementOrCss) {
|
|
777
|
-
const webkit = isWebKit();
|
|
778
814
|
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
779
815
|
|
|
780
816
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
781
|
-
|
|
817
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
818
|
+
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
|
|
782
819
|
}
|
|
783
820
|
function getContainingBlock(element) {
|
|
784
821
|
let currentNode = getParentNode(element);
|
|
@@ -793,11 +830,13 @@ function getContainingBlock(element) {
|
|
|
793
830
|
return null;
|
|
794
831
|
}
|
|
795
832
|
function isWebKit() {
|
|
796
|
-
if (
|
|
797
|
-
|
|
833
|
+
if (isWebKitValue == null) {
|
|
834
|
+
isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
|
|
835
|
+
}
|
|
836
|
+
return isWebKitValue;
|
|
798
837
|
}
|
|
799
838
|
function isLastTraversableNode(node) {
|
|
800
|
-
return
|
|
839
|
+
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
801
840
|
}
|
|
802
841
|
function getComputedStyle(element) {
|
|
803
842
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -849,8 +888,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
849
888
|
const win = getWindow(scrollableAncestor);
|
|
850
889
|
if (isBody) {
|
|
851
890
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], []);
|
|
891
|
+
} else {
|
|
892
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
|
|
852
893
|
}
|
|
853
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
|
|
854
894
|
}
|
|
855
895
|
function getFrameElement(win) {
|
|
856
896
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
@@ -1939,14 +1979,20 @@ const NvPopover = class {
|
|
|
1939
1979
|
this.positionPopover();
|
|
1940
1980
|
}
|
|
1941
1981
|
disconnectedCallback() {
|
|
1942
|
-
events_utils.removeEventListeners(this.closeEvents, document
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1982
|
+
events_utils.removeEventListeners(this.closeEvents, document);
|
|
1983
|
+
switch (this.triggerMode) {
|
|
1984
|
+
case 'click':
|
|
1985
|
+
if (this.triggerElement) {
|
|
1986
|
+
events_utils.removeEventListeners(this.clickEvents, this.triggerElement);
|
|
1987
|
+
}
|
|
1988
|
+
events_utils.removeEventListeners(this.outsideClickEvents, document);
|
|
1989
|
+
break;
|
|
1990
|
+
case 'hover':
|
|
1991
|
+
if (this.triggerElement) {
|
|
1992
|
+
events_utils.removeEventListeners(this.hoverEvents, this.triggerElement);
|
|
1993
|
+
}
|
|
1994
|
+
break;
|
|
1947
1995
|
}
|
|
1948
|
-
if (this.triggerMode === 'hover')
|
|
1949
|
-
events_utils.removeEventListeners(this.hoverEvents, this.triggerElement, this);
|
|
1950
1996
|
// Reset flag so events can be reattached if component is reconnected
|
|
1951
1997
|
this.eventsAttached = false;
|
|
1952
1998
|
// Clean up any pending timeouts
|
|
@@ -1959,7 +2005,7 @@ const NvPopover = class {
|
|
|
1959
2005
|
/****************************************************************************/
|
|
1960
2006
|
//#region RENDER
|
|
1961
2007
|
render() {
|
|
1962
|
-
return (index.h(index.Host, { key: '
|
|
2008
|
+
return (index.h(index.Host, { key: '1ed63615950c6e634f62130a0b44968b33a672fb' }, index.h("slot", { key: '46f7ca5bd0f86e79f847d1120d4bb37f6392fd58', name: "trigger" }), index.h("div", { key: 'b7324fde30b5dccb51a206ac334636bb8161760a', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: 'ce765381a3d2708afa5cef63d8f8c156555eb903', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: '7412a6e56a216bb7ea06b69d1c349f68d6bb1aa1', name: "content" }))));
|
|
1963
2009
|
}
|
|
1964
2010
|
get el() { return index.getElement(this); }
|
|
1965
2011
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-BfQyuDYm.js');
|
|
4
4
|
var clsx = require('./clsx-BtxeOLZW.js');
|
|
5
|
-
var v4 = require('./v4-
|
|
5
|
+
var v4 = require('./v4-_2BfiRUa.js');
|
|
6
6
|
|
|
7
7
|
const nvToggleCss = () => `@charset "UTF-8";nv-toggle{display:inline-flex;align-items:flex-start;gap:var(--form-gap-x);position:relative}nv-toggle:not([disabled],[readonly]) input,nv-toggle:not([disabled],[readonly]) label{cursor:pointer}nv-toggle.label-placement-before{flex-direction:row-reverse}nv-toggle[disabled]{opacity:0.5}nv-toggle label{align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-toggle label.visually-hidden{position:absolute;padding:0;border:0;overflow:hidden;white-space:nowrap;width:1px;height:1px;margin:-1px;clip:rect(0, 0, 0, 0)}nv-toggle .input-container{position:relative;color:var(--components-form-shape-foreground-default)}nv-toggle .input-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--components-form-shape-foreground-disabled)}nv-toggle .input-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-toggle-width);height:var(--form-toggle-height);flex-direction:column;align-items:flex-start;border-radius:var(--form-toggle-radius);border-width:var(--form-toggle-border-width);border-style:solid;border-color:var(--components-toggle-border-default);background:var(--components-toggle-background-default)}nv-toggle .input-container input[type=checkbox]::after{content:"";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-toggle-shape-default);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:25%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:hover{border-color:var(--components-toggle-border-hover)}nv-toggle .input-container input[type=checkbox]:hover::after{background-color:var(--components-toggle-shape-hover)}nv-toggle .input-container input[type=checkbox]:focus{border-color:var(--components-toggle-border-default)}nv-toggle .input-container input[type=checkbox]:focus::after{background-color:var(--components-toggle-shape-default)}nv-toggle .input-container input[type=checkbox]:focus,nv-toggle .input-container input[type=checkbox]:focus-within{outline:none}nv-toggle .input-container input[type=checkbox]:focus-visible,nv-toggle .input-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-toggle .input-container input[type=checkbox]:checked{background:var(--components-toggle-background-default-checked);border-color:var(--components-toggle-border-default-checked)}nv-toggle .input-container input[type=checkbox]:checked::after{content:"";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-toggle-shape-default-checked);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:75%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:checked:focus{background:var(--components-toggle-background-default-checked);border-color:var(--components-toggle-border-default-checked)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]){box-shadow:unset;background:var(--components-toggle-background-disabled);border-color:var(--components-toggle-border-default)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]):checked{background:var(--components-toggle-background-disabled-checked);border-color:var(--components-toggle-border-disabled-checked)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]):checked::after{background-color:var(--components-toggle-shape-disabled-checked)}@media print{nv-toggle .input-container input[type=checkbox]::after{content:"●";top:calc(50% - 3.5px);width:auto;height:auto;background:none;color:var(--components-toggle-border-default);font-size:calc(var(--form-toggle-switch-dot-default) * 3);line-height:1}nv-toggle .input-container input[type=checkbox]:checked{background:transparent;border-color:var(--components-toggle-border-default-checked)}nv-toggle .input-container input[type=checkbox]:checked::after{content:"●";top:calc(50% - 3.5px);width:auto;height:auto;left:75%;background:none;color:var(--components-toggle-border-default-checked)}}nv-toggle .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:450;line-height:var(--form-description-line-height)}nv-toggle .text-container{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}`;
|
|
8
8
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const byteToHex = [];
|
|
4
|
+
for (let i = 0; i < 256; ++i) {
|
|
5
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
6
|
+
}
|
|
7
|
+
function unsafeStringify(arr, offset = 0) {
|
|
8
|
+
return (byteToHex[arr[offset + 0]] +
|
|
9
|
+
byteToHex[arr[offset + 1]] +
|
|
10
|
+
byteToHex[arr[offset + 2]] +
|
|
11
|
+
byteToHex[arr[offset + 3]] +
|
|
12
|
+
'-' +
|
|
13
|
+
byteToHex[arr[offset + 4]] +
|
|
14
|
+
byteToHex[arr[offset + 5]] +
|
|
15
|
+
'-' +
|
|
16
|
+
byteToHex[arr[offset + 6]] +
|
|
17
|
+
byteToHex[arr[offset + 7]] +
|
|
18
|
+
'-' +
|
|
19
|
+
byteToHex[arr[offset + 8]] +
|
|
20
|
+
byteToHex[arr[offset + 9]] +
|
|
21
|
+
'-' +
|
|
22
|
+
byteToHex[arr[offset + 10]] +
|
|
23
|
+
byteToHex[arr[offset + 11]] +
|
|
24
|
+
byteToHex[arr[offset + 12]] +
|
|
25
|
+
byteToHex[arr[offset + 13]] +
|
|
26
|
+
byteToHex[arr[offset + 14]] +
|
|
27
|
+
byteToHex[arr[offset + 15]]).toLowerCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const rnds8 = new Uint8Array(16);
|
|
31
|
+
function rng() {
|
|
32
|
+
return crypto.getRandomValues(rnds8);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function v4(options, buf, offset) {
|
|
36
|
+
if (crypto.randomUUID) {
|
|
37
|
+
return crypto.randomUUID();
|
|
38
|
+
}
|
|
39
|
+
return _v4(options);
|
|
40
|
+
}
|
|
41
|
+
function _v4(options, buf, offset) {
|
|
42
|
+
options = options || {};
|
|
43
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
44
|
+
if (rnds.length < 16) {
|
|
45
|
+
throw new Error('Random bytes length must be >= 16');
|
|
46
|
+
}
|
|
47
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
48
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
49
|
+
return unsafeStringify(rnds);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
exports.v4 = v4;
|
|
@@ -12,10 +12,11 @@ nv-dialog dialog {
|
|
|
12
12
|
max-height: unset;
|
|
13
13
|
max-width: unset;
|
|
14
14
|
padding: 0;
|
|
15
|
+
border: none;
|
|
15
16
|
background: color-mix(in srgb, var(--components-overlay-background) 70%, transparent);
|
|
16
17
|
backdrop-filter: blur(4px);
|
|
17
18
|
}
|
|
18
|
-
nv-dialog dialog.full .content {
|
|
19
|
+
nv-dialog dialog.full > .backdrop > .content {
|
|
19
20
|
min-width: 90vw;
|
|
20
21
|
width: 90vw;
|
|
21
22
|
max-width: 90vw;
|
|
@@ -27,7 +28,7 @@ nv-dialog .backdrop {
|
|
|
27
28
|
/* shadow/2xl */
|
|
28
29
|
box-shadow: 0px var(--shadow-y-axis-2xl) var(--shadow-blur-2xl) var(--shadow-spread-2xl) var(--shadow-color-opacity-3) var(--shadow-color-opacity-3);
|
|
29
30
|
}
|
|
30
|
-
nv-dialog .backdrop .content {
|
|
31
|
+
nv-dialog .backdrop > .content {
|
|
31
32
|
border-radius: var(--radius-rounded-2xl);
|
|
32
33
|
background: var(--color-level-00-background);
|
|
33
34
|
min-width: min(90vw, 400px);
|
|
@@ -40,7 +41,7 @@ nv-dialog .backdrop .content {
|
|
|
40
41
|
height: fit-content;
|
|
41
42
|
position: relative;
|
|
42
43
|
}
|
|
43
|
-
nv-dialog .backdrop .content nv-button.close-button {
|
|
44
|
+
nv-dialog .backdrop > .content nv-button.close-button {
|
|
44
45
|
position: absolute;
|
|
45
46
|
top: var(--dialog-dismissible-position-top);
|
|
46
47
|
right: var(--dialog-dismissible-position-right);
|
|
@@ -50,19 +51,19 @@ nv-dialog .backdrop .content nv-button.close-button {
|
|
|
50
51
|
align-items: flex-start;
|
|
51
52
|
gap: 10px;
|
|
52
53
|
}
|
|
53
|
-
nv-dialog .backdrop .content .content-body::-webkit-scrollbar {
|
|
54
|
+
nv-dialog .backdrop > .content .content-body::-webkit-scrollbar {
|
|
54
55
|
width: 6px;
|
|
55
56
|
height: 6px;
|
|
56
57
|
}
|
|
57
|
-
nv-dialog .backdrop .content .content-body::-webkit-scrollbar-track {
|
|
58
|
+
nv-dialog .backdrop > .content .content-body::-webkit-scrollbar-track {
|
|
58
59
|
background-color: var(--color-level-10-background);
|
|
59
60
|
border-radius: 9999px;
|
|
60
61
|
}
|
|
61
|
-
nv-dialog .backdrop .content .content-body::-webkit-scrollbar-thumb {
|
|
62
|
+
nv-dialog .backdrop > .content .content-body::-webkit-scrollbar-thumb {
|
|
62
63
|
background-color: var(--color-gray-200);
|
|
63
64
|
border-radius: 9999px;
|
|
64
65
|
}
|
|
65
|
-
nv-dialog .backdrop .content .content-body {
|
|
66
|
+
nv-dialog .backdrop > .content .content-body {
|
|
66
67
|
box-sizing: border-box;
|
|
67
68
|
padding: var(--dialog-body-padding-y) var(--dialog-body-padding-x);
|
|
68
69
|
scrollbar-gutter: stable both-edges;
|