@nova-design-system/nova-react 3.4.0 → 3.6.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/{timeline.animation-1b88f052-B8-vCVrY.js → collapse.animation-16e3af45-CChx_tQJ.js} +4 -25
- package/dist/cjs/fade.animation-71e8e34c-BAw_TYsB.js +68 -0
- package/dist/cjs/{index-CrgVjOZF.js → index-E_eTmclZ.js} +3380 -2813
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/nv-accordion-item.entry-B9iMQoRk.js +178 -0
- package/dist/cjs/nv-accordion.entry-2oOEkDVq.js +191 -0
- package/dist/cjs/{nv-alert.entry-CW72ajnD.js → nv-alert.entry-CJcHACkm.js} +10 -8
- package/dist/cjs/{nv-avatar.entry-D9wUCu5K.js → nv-avatar.entry-COkIaFDp.js} +2 -2
- package/dist/cjs/{nv-badge_2.entry-CQs2Sf6G.js → nv-badge_2.entry-CQHT-nck.js} +14 -12
- package/dist/cjs/{nv-breadcrumb.entry-CGrSsjAL.js → nv-breadcrumb.entry-DElOQJUD.js} +2 -2
- package/dist/cjs/{nv-breadcrumbs.entry-HStUGnwu.js → nv-breadcrumbs.entry-CDfxiMbp.js} +2 -2
- package/dist/cjs/{nv-button.entry-BJfYc4Ow.js → nv-button.entry-CTJT4SzB.js} +2 -2
- package/dist/cjs/{nv-calendar.entry-Co8f_3E5.js → nv-calendar.entry-BU2OBf6g.js} +60 -51
- package/dist/cjs/{nv-col.entry-PJML3P46.js → nv-col.entry-Bsz14pxY.js} +2 -2
- package/dist/cjs/{nv-datagrid.entry-Bpwt9yDb.js → nv-datagrid.entry-2DyB7G5f.js} +3 -3
- package/dist/cjs/{nv-datagridcolumn.entry-Dfifeiia.js → nv-datagridcolumn.entry-DquF2Cc1.js} +2 -2
- package/dist/cjs/{nv-dialog.entry-eUEzDdrS.js → nv-dialog.entry-QzImh4AV.js} +20 -7
- package/dist/cjs/{nv-dialogfooter_2.entry-HQyyE6VN.js → nv-dialogfooter_2.entry-MikGtnGi.js} +3 -3
- package/dist/cjs/{nv-fieldcheckbox.entry-C5AMgttR.js → nv-fieldcheckbox.entry-DKhH58rn.js} +5 -5
- package/dist/cjs/{nv-fielddate.entry-Dkqz-UqJ.js → nv-fielddate.entry-Dj_oMJ2a.js} +101 -36
- package/dist/cjs/{nv-fielddaterange.entry-D6QmyWHp.js → nv-fielddaterange.entry-CWwH83ug.js} +7 -7
- package/dist/cjs/{nv-fielddropdown.entry-BpZz90ob.js → nv-fielddropdown.entry-CPD-1tGj.js} +4 -4
- package/dist/cjs/{nv-fielddropdownitem.entry-BbJ9SKGo.js → nv-fielddropdownitem.entry-CM5Fogll.js} +2 -2
- package/dist/cjs/{nv-fieldmultiselect.entry-mnYvhkj0.js → nv-fieldmultiselect.entry-DodoLrhv.js} +86 -101
- package/dist/cjs/{nv-fieldnumber.entry-B5ED8fCU.js → nv-fieldnumber.entry-063nS6p_.js} +4 -4
- package/dist/cjs/{nv-fieldpassword.entry-ohASip15.js → nv-fieldpassword.entry-CreA_Yx8.js} +4 -4
- package/dist/cjs/{nv-fieldradio.entry-BPipemAC.js → nv-fieldradio.entry-Y8YSlQbK.js} +4 -4
- package/dist/cjs/{nv-fieldselect.entry-BWZX6L-B.js → nv-fieldselect.entry-B1X8kT8-.js} +6 -6
- package/dist/cjs/{nv-fieldslider.entry-nmE8TjBA.js → nv-fieldslider.entry-CJlQWgFy.js} +54 -10
- package/dist/cjs/{nv-fieldtext.entry-DxoznMYV.js → nv-fieldtext.entry-Cib7Q9Wi.js} +4 -4
- package/dist/cjs/{nv-fieldtextarea.entry-BccBiMKe.js → nv-fieldtextarea.entry-QYIEAbAM.js} +4 -4
- package/dist/cjs/{nv-fieldtime.entry-BmQ5DFbN.js → nv-fieldtime.entry-D6jX_bbE.js} +10 -10
- package/dist/cjs/nv-icon.entry-DyYPxO1l.js +79 -0
- package/dist/cjs/{nv-iconbutton_2.entry-DguqeTa3.js → nv-iconbutton_2.entry-BDpYysUa.js} +3 -3
- package/dist/cjs/{nv-menu.entry-UTPRtlti.js → nv-menu.entry-EY6i9-lW.js} +2 -2
- package/dist/cjs/{nv-menuitem.entry-CaRqhVtk.js → nv-menuitem.entry-D3_V7wz6.js} +2 -2
- package/dist/cjs/{nv-popover.entry-ByFhVB2j.js → nv-popover.entry-VI0JSWEK.js} +9 -8
- package/dist/cjs/{nv-row.entry-BIwxIl3Q.js → nv-row.entry-Da5sYAGY.js} +2 -2
- package/dist/cjs/{nv-stack.entry-xDwyG0Xr.js → nv-stack.entry-CQ8A3wKB.js} +2 -2
- package/dist/cjs/{nv-table.entry-DCMcpbpc.js → nv-table.entry-DkALs4J_.js} +3 -3
- package/dist/cjs/{nv-tablecolumn.entry-D_kTZ7Mp.js → nv-tablecolumn.entry-C_9y9_Tk.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-tds7tIzF.js → nv-toggle.entry-CPvuKc2f.js} +3 -3
- package/dist/cjs/{nv-tooltip.entry-PfQ2HgFG.js → nv-tooltip.entry-dvTSw6dq.js} +4 -3
- package/dist/cjs/{fade.animation-2a077983-aKN0EDTo.js → stylefire.es-74da334a-y0piPjlz.js} +0 -64
- package/dist/cjs/timeline.animation-adf35ecb-CE6Dsdxr.js +23 -0
- package/dist/generated/components.js +18 -2
- package/dist/generated/components.server.js +721 -0
- package/dist/types/generated/components.d.ts +56 -43
- package/dist/types/generated/components.server.d.ts +229 -0
- package/package.json +2 -2
- package/dist/cjs/nv-icon.entry-DE-sMmDp.js +0 -79
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
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)}";
|
|
@@ -49,7 +49,7 @@ const NvMenuitem = class {
|
|
|
49
49
|
/****************************************************************************/
|
|
50
50
|
//#region RENDER
|
|
51
51
|
render() {
|
|
52
|
-
return (index.h(index.Host, { key: '
|
|
52
|
+
return (index.h(index.Host, { key: 'c008da503776b85bec237b25e321e4bba02d153f', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && index.h("nv-icon", { key: '66341d40e68409b4c0ab6595a67eed1e4354d6ba', name: this.icon }), index.h("slot", { key: 'e3960af26ffbc703a5702981e948013179b1a83b' }), this.label && index.h("span", { key: '9633388dcbad3080b54b83845ced54f9b9d05061', "data-scope": "text" }, this.label), this.shortcut && !this.hasSubmenu && index.h("kbd", { key: 'da358858336a86a7a49bbd4a52b5f628aadc1c29' }, this.shortcut), this.hasSubmenu && index.h("nv-icon", { key: '36a85c271a5dbe2c41eefac33209e5d9a909ae04', name: "chevron-right" })));
|
|
53
53
|
}
|
|
54
54
|
get el() { return index.getElement(this); }
|
|
55
55
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
|
+
var stylefire_es74da334a = require('./stylefire.es-74da334a-y0piPjlz.js');
|
|
5
|
+
var fade_animation71e8e34c = require('./fade.animation-71e8e34c-BAw_TYsB.js');
|
|
5
6
|
var events_utilsFe1d907f = require('./events.utils-fe1d907f-01N__3wY.js');
|
|
6
7
|
require('react');
|
|
7
8
|
|
|
8
9
|
const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) => {
|
|
9
|
-
const nodeStyler =
|
|
10
|
+
const nodeStyler = stylefire_es74da334a.index(node);
|
|
10
11
|
/**
|
|
11
12
|
* Will animate the scale and optionally the opacity to make the element grow and fade in,
|
|
12
13
|
* and removes the scale and opacity style attributes once complete.
|
|
13
14
|
*/
|
|
14
15
|
function growIn() {
|
|
15
16
|
return new Promise(resolve => {
|
|
16
|
-
|
|
17
|
+
stylefire_es74da334a.animate({
|
|
17
18
|
from: { opacity: hasFade ? 0 : 1, scale: amount },
|
|
18
19
|
to: { opacity: 1, scale: 1 },
|
|
19
20
|
duration,
|
|
@@ -62,7 +63,7 @@ const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) =>
|
|
|
62
63
|
*/
|
|
63
64
|
function growOut() {
|
|
64
65
|
return new Promise(resolve => {
|
|
65
|
-
|
|
66
|
+
stylefire_es74da334a.animate({
|
|
66
67
|
from: { opacity: 1, scale: 1 },
|
|
67
68
|
to: { opacity: hasFade ? 0 : 1, scale: amount },
|
|
68
69
|
duration,
|
|
@@ -1890,7 +1891,7 @@ const NvPopover = class {
|
|
|
1890
1891
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1891
1892
|
amount: 0.85,
|
|
1892
1893
|
});
|
|
1893
|
-
const { fadeOut } =
|
|
1894
|
+
const { fadeOut } = fade_animation71e8e34c.useFade(this.popoverElement, {
|
|
1894
1895
|
duration: isOtherMemberOpen ? 0 : 100,
|
|
1895
1896
|
});
|
|
1896
1897
|
if (open === true) {
|
|
@@ -1922,7 +1923,7 @@ const NvPopover = class {
|
|
|
1922
1923
|
setGrowOut();
|
|
1923
1924
|
}
|
|
1924
1925
|
else {
|
|
1925
|
-
const { setFadeIn } =
|
|
1926
|
+
const { setFadeIn } = fade_animation71e8e34c.useFade(this.popoverElement);
|
|
1926
1927
|
setFadeIn();
|
|
1927
1928
|
this.popoverElement.removeAttribute('hidden');
|
|
1928
1929
|
}
|
|
@@ -1950,7 +1951,7 @@ const NvPopover = class {
|
|
|
1950
1951
|
/****************************************************************************/
|
|
1951
1952
|
//#region RENDER
|
|
1952
1953
|
render() {
|
|
1953
|
-
return (index.h(index.Host, { key: '
|
|
1954
|
+
return (index.h(index.Host, { key: '843ac572358b402d6338945d671446fec1c51a6d' }, index.h("slot", { key: '090f01aea3932cb95357985766a20112c63c4992', name: "trigger" }), index.h("div", { key: '737822dd1539381bb485a389670f09a071441365', "data-scope": "popover", hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: '9d268df3f0e1df7b2a2264154143c3db14619661', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: '432aae053b25d2e7d6594203ad0ff3ecee26c059', name: "content" }))));
|
|
1954
1955
|
}
|
|
1955
1956
|
get el() { return index.getElement(this); }
|
|
1956
1957
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
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)}";
|
|
@@ -13,7 +13,7 @@ const NvRow = class {
|
|
|
13
13
|
/****************************************************************************/
|
|
14
14
|
//#region RENDER
|
|
15
15
|
render() {
|
|
16
|
-
return (index.h(index.Host, { key: '
|
|
16
|
+
return (index.h(index.Host, { key: '20e40e37c82b00712ed3d60d46d460f5f877e10a' }, index.h("slot", { key: '80ba27becb4d56ff0785054597d88c728fb3eca5' })));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
NvRow.style = NvRowStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ const NvStack = class {
|
|
|
22
22
|
/****************************************************************************/
|
|
23
23
|
//#region RENDER
|
|
24
24
|
render() {
|
|
25
|
-
return (index.h(index.Host, { key: '
|
|
25
|
+
return (index.h(index.Host, { key: '24cca0f7101de5f37d30884983da28a839df9bee', class: clsx297c1ffe.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: '3521e5dd684d2c6185fd434711ae85a6ea0b68ab' })));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
NvStack.style = NvStackStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
4
|
var dom_utilsAc71e0ef = require('./dom.utils-ac71e0ef-CmIwRr6O.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -314,14 +314,14 @@ const NvTable = class {
|
|
|
314
314
|
const rows = !this.table || this.table === undefined || this.parsedData.length === 0
|
|
315
315
|
? []
|
|
316
316
|
: this.table.data;
|
|
317
|
-
return (index.h(index.Host, { key: '
|
|
317
|
+
return (index.h(index.Host, { key: '0e7b7e03592f9f68b9158e8374986986e0f155d4' }, index.h("div", { key: 'eeebf671dde65fcd725fbbe78099816d1c07c65f', class: "hidden" }, index.h("slot", { key: '2ac114cec120874bb0f7bf6ddde9ec9c88d978cf' })), index.h("slot", { key: 'b8dea8ff4c987b679ab78e73c4b7698a608c1ee3', name: "before" }), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (index.h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (index.h("table", { class: "table" }, this.parsedColumns.length > 0 && headerGroups.length > 0 && (index.h("thead", { class: "table-header" }, index.h("tr", null, headerGroups &&
|
|
318
318
|
headerGroups.map(col => {
|
|
319
319
|
return (index.h("th", { key: col.name }, this.renderTemplate(this.headerTemplateCache.get(col.name), {}) || col.header));
|
|
320
320
|
})))), index.h("tbody", { class: "table-body" }, !rows || rows.length === 0 ? (index.h("tr", null, index.h("td", { colSpan: headerGroups.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => (index.h("tr", { key: JSON.stringify(row) }, headerGroups.map(col => {
|
|
321
321
|
var _a;
|
|
322
322
|
return (index.h("td", null, this.renderTemplate(this.templateCache.get(col.name), row) ||
|
|
323
323
|
((_a = row[col.name]) !== null && _a !== void 0 ? _a : this.fallbackValue)));
|
|
324
|
-
})))))))), index.h("slot", { key: '
|
|
324
|
+
})))))))), index.h("slot", { key: '4dc0404a05946bc942f65af599fea186166cde9c', name: "after" })));
|
|
325
325
|
}
|
|
326
326
|
get el() { return index.getElement(this); }
|
|
327
327
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
6
6
|
require('react');
|
|
@@ -65,8 +65,8 @@ const NvToggle = class {
|
|
|
65
65
|
/****************************************************************************/
|
|
66
66
|
//#region RENDER
|
|
67
67
|
render() {
|
|
68
|
-
return (index.h(index.Host, { key: '
|
|
69
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
68
|
+
return (index.h(index.Host, { key: '9b3a2c50180d17241f514ebfecb2d959d6aaf263', class: clsx297c1ffe.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '70420566c51bb19c3ef9b8718ba0069bd739fd26', class: "input-container" }, index.h("input", { key: '5c1cfd0858a14cf1854de5a09b2daa55c4e781ba', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), index.h("div", { key: 'f4678a7ed5a7e58397aadfe5155b95a395f39fba', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '4d25373b9c782d3016da002d1fa22dd551a1597a', htmlFor: this.inputId, class: clsx297c1ffe.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: 'f297abef15befddc6b180edffe3ab7b0bb39d223', name: "label" }, this.label))), (this.description ||
|
|
69
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '97f2b1045c5152fb66da582c7fcf2975cbe10e68', class: "description" }, index.h("slot", { key: 'fae238400ac3a106079a7e361d179598a99363a4', name: "description" }, this.description))))));
|
|
70
70
|
}
|
|
71
71
|
static get formAssociated() { return true; }
|
|
72
72
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-E_eTmclZ.js');
|
|
4
4
|
require('react');
|
|
5
5
|
|
|
6
6
|
const nvTooltipCss = "nv-tooltip{display:inline-block;position:relative;user-select:none}nv-tooltip:has([fluid]:not([fluid=false])){display:block}nv-tooltip [data-scope=popover]{background:var(--components-tooltip-background);color:var(--components-tooltip-text);font-weight:var(--font-weight-medium-emphasis);padding:var(--tooltip-padding-y) var(--tooltip-padding-x);font-size:var(--tooltip-font-size);border-radius:var(--tooltip-radius);border:none;box-shadow:0px var(--shadow-y-axis-lg-1) var(--shadow-blur-lg-1) var(--shadow-spread-lg-1) var(--shadow-color-opacity-1), 0px var(--shadow-y-axis-lg-2) var(--shadow-blur-lg-2) var(--shadow-spread-lg-2) var(--shadow-color-opacity-2)}nv-tooltip [data-scope=popover] [data-scope=arrow]{background:var(--components-tooltip-background);box-shadow:none;border:none}";
|
|
@@ -9,6 +9,7 @@ const NvTooltipStyle0 = nvTooltipCss;
|
|
|
9
9
|
const NvTooltip = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
+
this.openChanged = index.createEvent(this, "openChanged");
|
|
12
13
|
/**
|
|
13
14
|
* Decides where the tooltip shows up next to the element it’s linked to
|
|
14
15
|
* (above, below, to the sides). If there isn’t enough room, it will adjust
|
|
@@ -22,7 +23,7 @@ const NvTooltip = class {
|
|
|
22
23
|
*/
|
|
23
24
|
this.enterDelay = 0;
|
|
24
25
|
}
|
|
25
|
-
//#endregion
|
|
26
|
+
//#endregion EVENTS
|
|
26
27
|
/****************************************************************************/
|
|
27
28
|
//#region LIFECYCLE
|
|
28
29
|
componentWillLoad() {
|
|
@@ -35,7 +36,7 @@ const NvTooltip = class {
|
|
|
35
36
|
/****************************************************************************/
|
|
36
37
|
//#region RENDER
|
|
37
38
|
render() {
|
|
38
|
-
return (index.h(index.Host, { key: '
|
|
39
|
+
return (index.h(index.Host, { key: 'eb3e25818bb1e57340ac169d1c40a0e4e9c56668' }, index.h("slot", { key: '7937859bff530ff10a0de9076a77c92afa9ec9e7' }), index.h("nv-popover", { key: 'e825c93c7d90f5598416f1f081c95517c7a27883', triggerMode: "hover", hasArrow: true, placement: this.placement, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, index.h("p", { key: '5a5987e3a04f02be104e5f8fcca2f40b75938a97', slot: "content" }, this.message), index.h("slot", { key: 'd7efc512e29969e7c8c1a693f2fb15f9319e1fa8', name: "content" }))));
|
|
39
40
|
}
|
|
40
41
|
get el() { return index.getElement(this); }
|
|
41
42
|
};
|
|
@@ -1764,69 +1764,5 @@ function index(nodeOrSelector, props) {
|
|
|
1764
1764
|
return getStyler(node, props);
|
|
1765
1765
|
}
|
|
1766
1766
|
|
|
1767
|
-
const useFade = (node, { duration } = { duration: 200 }) => {
|
|
1768
|
-
const nodeStyler = index(node);
|
|
1769
|
-
/**
|
|
1770
|
-
* Will animate the opacity to 1, and removes the opacity style attribute once
|
|
1771
|
-
* complete.
|
|
1772
|
-
*/
|
|
1773
|
-
function fadeIn() {
|
|
1774
|
-
return new Promise(resolve => {
|
|
1775
|
-
animate({
|
|
1776
|
-
from: { opacity: 0 },
|
|
1777
|
-
to: { opacity: 1 },
|
|
1778
|
-
duration,
|
|
1779
|
-
onUpdate(latest) {
|
|
1780
|
-
nodeStyler.set({ opacity: latest.opacity });
|
|
1781
|
-
},
|
|
1782
|
-
onComplete() {
|
|
1783
|
-
resolve();
|
|
1784
|
-
node.style.removeProperty('opacity');
|
|
1785
|
-
},
|
|
1786
|
-
});
|
|
1787
|
-
});
|
|
1788
|
-
}
|
|
1789
|
-
/**
|
|
1790
|
-
* Applies the fadeOut styles without animating, useful when initial state
|
|
1791
|
-
* is hidden.
|
|
1792
|
-
*/
|
|
1793
|
-
function setFadeOut() {
|
|
1794
|
-
node.style.opacity = '0';
|
|
1795
|
-
}
|
|
1796
|
-
/**
|
|
1797
|
-
* Applies the fadeIn styles without animating, useful when initial state
|
|
1798
|
-
* is visible.
|
|
1799
|
-
*/
|
|
1800
|
-
function setFadeIn() {
|
|
1801
|
-
node.style.opacity = '1';
|
|
1802
|
-
}
|
|
1803
|
-
/**
|
|
1804
|
-
* Will animate the opacity to 0, once complete, the opacity style attribute
|
|
1805
|
-
* will stay on the element.
|
|
1806
|
-
*/
|
|
1807
|
-
function fadeOut() {
|
|
1808
|
-
return new Promise(resolve => {
|
|
1809
|
-
animate({
|
|
1810
|
-
from: { opacity: 1 },
|
|
1811
|
-
to: { opacity: 0 },
|
|
1812
|
-
duration,
|
|
1813
|
-
onUpdate(latest) {
|
|
1814
|
-
nodeStyler.set({ opacity: latest.opacity });
|
|
1815
|
-
},
|
|
1816
|
-
onComplete() {
|
|
1817
|
-
resolve();
|
|
1818
|
-
},
|
|
1819
|
-
});
|
|
1820
|
-
});
|
|
1821
|
-
}
|
|
1822
|
-
return {
|
|
1823
|
-
fadeIn,
|
|
1824
|
-
fadeOut,
|
|
1825
|
-
setFadeOut,
|
|
1826
|
-
setFadeIn,
|
|
1827
|
-
};
|
|
1828
|
-
};
|
|
1829
|
-
|
|
1830
1767
|
exports.animate = animate;
|
|
1831
1768
|
exports.index = index;
|
|
1832
|
-
exports.useFade = useFade;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Will execute a series of animation promises in sequence.
|
|
5
|
+
* This is useful for chaining animations where each step depends on the
|
|
6
|
+
* previous one completing before starting the next.
|
|
7
|
+
*
|
|
8
|
+
* @param {Array<() => Promise<void>>} animations - The array of animation functions.
|
|
9
|
+
* @returns {Object} - An object with a `start` method to begin the timeline.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { fadeOut } = useFade(this.ref);
|
|
13
|
+
* const { collapse } = useCollapse(this.ref);
|
|
14
|
+
*
|
|
15
|
+
* timeline(fadeOut, collapse).start();
|
|
16
|
+
*/
|
|
17
|
+
const timeline = (...animations) => ({
|
|
18
|
+
start: () => {
|
|
19
|
+
return animations.reduce((promise, animation) => promise.then(() => animation()), Promise.resolve());
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
exports.timeline = timeline;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { NvAccordionItem as NvAccordionItemElement, defineCustomElement as defineNvAccordionItem } from "@nova-design-system/nova-webcomponents/dist/components/nv-accordion-item.js";
|
|
3
|
+
import { NvAccordion as NvAccordionElement, defineCustomElement as defineNvAccordion } from "@nova-design-system/nova-webcomponents/dist/components/nv-accordion.js";
|
|
2
4
|
import { NvAlert as NvAlertElement, defineCustomElement as defineNvAlert } from "@nova-design-system/nova-webcomponents/dist/components/nv-alert.js";
|
|
3
5
|
import { NvAvatar as NvAvatarElement, defineCustomElement as defineNvAvatar } from "@nova-design-system/nova-webcomponents/dist/components/nv-avatar.js";
|
|
4
6
|
import { NvBadge as NvBadgeElement, defineCustomElement as defineNvBadge } from "@nova-design-system/nova-webcomponents/dist/components/nv-badge.js";
|
|
@@ -41,6 +43,20 @@ import { NvToggle as NvToggleElement, defineCustomElement as defineNvToggle } fr
|
|
|
41
43
|
import { NvTooltip as NvTooltipElement, defineCustomElement as defineNvTooltip } from "@nova-design-system/nova-webcomponents/dist/components/nv-tooltip.js";
|
|
42
44
|
import { createComponent } from '@stencil/react-output-target/runtime';
|
|
43
45
|
import React from 'react';
|
|
46
|
+
export const NvAccordion = createComponent({
|
|
47
|
+
tagName: 'nv-accordion',
|
|
48
|
+
elementClass: NvAccordionElement,
|
|
49
|
+
react: React,
|
|
50
|
+
events: { onNvChange: 'nvChange' },
|
|
51
|
+
defineCustomElement: defineNvAccordion
|
|
52
|
+
});
|
|
53
|
+
export const NvAccordionItem = createComponent({
|
|
54
|
+
tagName: 'nv-accordion-item',
|
|
55
|
+
elementClass: NvAccordionItemElement,
|
|
56
|
+
react: React,
|
|
57
|
+
events: { onItemToggle: 'itemToggle' },
|
|
58
|
+
defineCustomElement: defineNvAccordionItem
|
|
59
|
+
});
|
|
44
60
|
export const NvAlert = createComponent({
|
|
45
61
|
tagName: 'nv-alert',
|
|
46
62
|
elementClass: NvAlertElement,
|
|
@@ -205,7 +221,7 @@ export const NvFieldmultiselect = createComponent({
|
|
|
205
221
|
react: React,
|
|
206
222
|
events: {
|
|
207
223
|
onValueChanged: 'valueChanged',
|
|
208
|
-
|
|
224
|
+
onFilterTextChanged: 'filterTextChanged'
|
|
209
225
|
},
|
|
210
226
|
defineCustomElement: defineNvFieldmultiselect
|
|
211
227
|
});
|
|
@@ -346,6 +362,6 @@ export const NvTooltip = createComponent({
|
|
|
346
362
|
tagName: 'nv-tooltip',
|
|
347
363
|
elementClass: NvTooltipElement,
|
|
348
364
|
react: React,
|
|
349
|
-
events: {},
|
|
365
|
+
events: { onOpenChanged: 'openChanged' },
|
|
350
366
|
defineCustomElement: defineNvTooltip
|
|
351
367
|
});
|