@nova-design-system/nova-react 3.21.0 → 3.22.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.
Files changed (53) hide show
  1. package/dist/cjs/grow.animation-24ad5cf8-LUp_ITEx.js +111 -0
  2. package/dist/cjs/{index-yxDlFA78.js → index-WPRkQD3O.js} +475 -178
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/{nv-accordion-item.entry-5DF2ffDE.js → nv-accordion-item.entry-BuTvA6w9.js} +1 -1
  5. package/dist/cjs/{nv-accordion.entry-CPB1HBT1.js → nv-accordion.entry-Dtsfw6He.js} +1 -1
  6. package/dist/cjs/{nv-alert.entry-jPxt1obA.js → nv-alert.entry-TIdfdU7Y.js} +1 -1
  7. package/dist/cjs/{nv-avatar.entry-zmnREEN-.js → nv-avatar.entry-CaxrhPuw.js} +1 -1
  8. package/dist/cjs/{nv-badge_2.entry-DtkQx_M9.js → nv-badge_2.entry-CfYvTZxX.js} +2 -2
  9. package/dist/cjs/{nv-breadcrumb.entry-DHAe5FxQ.js → nv-breadcrumb.entry-BCZ4MmfD.js} +1 -1
  10. package/dist/cjs/{nv-breadcrumbs.entry-C7XepUqF.js → nv-breadcrumbs.entry-DwzCE7F6.js} +1 -1
  11. package/dist/cjs/{nv-button.entry-Dg1knj3Y.js → nv-button.entry-Cr_86bcZ.js} +1 -1
  12. package/dist/cjs/{nv-buttongroup.entry-Dlim9p8N.js → nv-buttongroup.entry-CWjRoHY1.js} +1 -1
  13. package/dist/cjs/{nv-calendar.entry-rL5_GdQg.js → nv-calendar.entry-CXfwNt6G.js} +1 -1
  14. package/dist/cjs/{nv-col.entry-CnbFx7h1.js → nv-col.entry-CJLDS3LY.js} +1 -1
  15. package/dist/cjs/{nv-datagrid.entry-CjUfR4ha.js → nv-datagrid.entry-Cns8XSud.js} +1 -1
  16. package/dist/cjs/{nv-datagridcolumn.entry-BiuYIp4q.js → nv-datagridcolumn.entry-CFFAipHF.js} +1 -1
  17. package/dist/cjs/{nv-dialog.entry-fDywe5i2.js → nv-dialog.entry-CDSK9pUH.js} +54 -20
  18. package/dist/cjs/{nv-dialogfooter_2.entry-CckfZ_QW.js → nv-dialogfooter_2.entry-To_dGUn4.js} +3 -3
  19. package/dist/cjs/{nv-fieldcheckbox.entry-WmfLxGad.js → nv-fieldcheckbox.entry-fdonR07Z.js} +5 -5
  20. package/dist/cjs/{nv-fielddate.entry-GLGb7tzu.js → nv-fielddate.entry-C3pXtMHL.js} +15 -18
  21. package/dist/cjs/{nv-fielddaterange.entry-C8gXNY2P.js → nv-fielddaterange.entry-CjVVPEK_.js} +8 -10
  22. package/dist/cjs/{nv-fielddropdown.entry-BX1V8Uef.js → nv-fielddropdown.entry-C9mXuNNj.js} +15 -6
  23. package/dist/cjs/{nv-fielddropdownitem.entry-BMVFbA1v.js → nv-fielddropdownitem.entry-Dah-PaE8.js} +3 -3
  24. package/dist/cjs/{nv-fieldmultiselect.entry-BuV-qWbu.js → nv-fieldmultiselect.entry-BMLjhqoJ.js} +2 -2
  25. package/dist/cjs/{nv-fieldnumber.entry-qM1ct5SM.js → nv-fieldnumber.entry-DBdJviXu.js} +4 -4
  26. package/dist/cjs/{nv-fieldpassword.entry-BnGWErFQ.js → nv-fieldpassword.entry-Cim_usSM.js} +4 -4
  27. package/dist/cjs/{nv-fieldradio.entry-EliQYldW.js → nv-fieldradio.entry-X_2VT1Dj.js} +4 -4
  28. package/dist/cjs/{nv-fieldselect.entry-BfPVPmaZ.js → nv-fieldselect.entry-pSp-2rNn.js} +6 -6
  29. package/dist/cjs/{nv-fieldslider.entry-DBPpL94x.js → nv-fieldslider.entry-pZf7zzLU.js} +4 -4
  30. package/dist/cjs/{nv-fieldtext.entry-BnabKYgq.js → nv-fieldtext.entry-DlI_ExaV.js} +4 -4
  31. package/dist/cjs/{nv-fieldtextarea.entry-HaELAnJb.js → nv-fieldtextarea.entry-t3Ixxi23.js} +4 -4
  32. package/dist/cjs/{nv-fieldtime.entry-CWQM7fza.js → nv-fieldtime.entry-DY7D5_6K.js} +4 -4
  33. package/dist/cjs/{nv-icon.entry-B5cWNyvf.js → nv-icon.entry-6oYPSf4c.js} +2 -2
  34. package/dist/cjs/{nv-iconbutton_2.entry-CP1o9IVZ.js → nv-iconbutton_2.entry-ChULGovr.js} +3 -3
  35. package/dist/cjs/{nv-menu.entry-wMwI_sZ3.js → nv-menu.entry-sd0tatWq.js} +2 -2
  36. package/dist/cjs/{nv-menuitem.entry-C53TrB0_.js → nv-menuitem.entry-CCOqR7UF.js} +2 -2
  37. package/dist/cjs/{nv-notification.entry-BPyEusqt.js → nv-notification.entry-Cc3zE3yY.js} +2 -2
  38. package/dist/cjs/{nv-notificationcontainer.entry-MRIJURIS.js → nv-notificationcontainer.entry-DV4D6oOH.js} +2 -2
  39. package/dist/cjs/{nv-popover.entry-fj50OLMu.js → nv-popover.entry-DQSwI2jT.js} +14 -98
  40. package/dist/cjs/{nv-row.entry-T0OlcSij.js → nv-row.entry-UUuMSAY5.js} +2 -2
  41. package/dist/cjs/{nv-split.entry-DlI7I6Tb.js → nv-split.entry-CYP2bTTM.js} +2 -2
  42. package/dist/cjs/{nv-stack.entry-991A3rOk.js → nv-stack.entry-D35-75Vw.js} +2 -2
  43. package/dist/cjs/{nv-table.entry-ClSU3-cR.js → nv-table.entry-DevWJBnL.js} +2 -2
  44. package/dist/cjs/{nv-tableheader.entry-DzvbPDBN.js → nv-tableheader.entry-Hs7nUSOC.js} +2 -2
  45. package/dist/cjs/{nv-toggle.entry-Dq5hAoVB.js → nv-toggle.entry-Eje9d--6.js} +3 -3
  46. package/dist/cjs/{nv-togglebutton.entry-DI8HQ5Ou.js → nv-togglebutton.entry-LGI7pIeK.js} +2 -2
  47. package/dist/cjs/{nv-togglebuttongroup.entry-DzGOSBF7.js → nv-togglebuttongroup.entry-CWN_Ucry.js} +2 -2
  48. package/dist/cjs/{nv-tooltip.entry-CF0-gdZL.js → nv-tooltip.entry-BGkKDEFg.js} +2 -2
  49. package/dist/components/NvDatatable/NvDatatable.js +77 -4
  50. package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
  51. package/dist/types/components/NvDatatable/types.d.ts +17 -1
  52. package/package.json +1 -1
  53. package/dist/cjs/events.utils-fe1d907f-01N__3wY.js +0 -23
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+
3
+ var fade_animation9b939939 = require('./fade.animation-9b939939-DV--bM4S.js');
4
+ var styleValueTypes_esF5d10b79 = require('./style-value-types.es-f5d10b79-D0QCM8OB.js');
5
+
6
+ /**
7
+ * Adds a set of event listeners to the given target.
8
+ * @param {EventsAndListeners} events - The events and listeners to add.
9
+ * @param {Element | Window | Document} target - The target element or window to add the event listeners to.
10
+ * @param {T} context - The class context to bind the event listeners to.
11
+ */
12
+ function addEventListeners(events, target, context) {
13
+ events.forEach(([event, listener]) => target.addEventListener(event, listener.bind(context)));
14
+ }
15
+ /**
16
+ * Removes a set of event listeners from the given target.
17
+ * @param {EventsAndListeners} events - The events and listeners to remove.
18
+ * @param {Element | Window | Document} target - The target element or window to remove the event listeners from.
19
+ * @param {T} context - The class context to bind the event listeners to.
20
+ */
21
+ function removeEventListeners(events, target, context) {
22
+ events.forEach(([event, listener]) => target.removeEventListener(event, listener.bind(context)));
23
+ }
24
+
25
+ const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) => {
26
+ const nodeStyler = fade_animation9b939939.index(node);
27
+ /**
28
+ * Will animate the scale and optionally the opacity to make the element grow and fade in,
29
+ * and removes the scale and opacity style attributes once complete.
30
+ */
31
+ function growIn() {
32
+ return new Promise(resolve => {
33
+ styleValueTypes_esF5d10b79.animate({
34
+ from: { opacity: hasFade ? 0 : 1, scale: amount },
35
+ to: { opacity: 1, scale: 1 },
36
+ duration,
37
+ onUpdate(latest) {
38
+ const updates = {
39
+ scale: latest.scale,
40
+ };
41
+ if (hasFade) {
42
+ updates['opacity'] = latest.opacity;
43
+ }
44
+ nodeStyler.set(updates);
45
+ },
46
+ onComplete() {
47
+ resolve();
48
+ if (hasFade) {
49
+ node.style.removeProperty('opacity');
50
+ }
51
+ node.style.removeProperty('transform');
52
+ },
53
+ });
54
+ });
55
+ }
56
+ /**
57
+ * Applies the growOut styles without animating, useful when the initial
58
+ * state is hidden.
59
+ */
60
+ function setGrowOut() {
61
+ node.style.transform = `scale(${amount})`;
62
+ if (hasFade) {
63
+ node.style.opacity = '0';
64
+ }
65
+ }
66
+ /**
67
+ * Applies the growIn styles without animating, useful when the initial
68
+ * state is visible.
69
+ */
70
+ function setGrowIn() {
71
+ node.style.transform = `scale(1)`;
72
+ if (hasFade) {
73
+ node.style.opacity = '1';
74
+ }
75
+ }
76
+ /**
77
+ * Will animate the scale and optionally the opacity to make the element shrink and fade out,
78
+ * leaving the scale and opacity styles on the element.
79
+ */
80
+ function growOut() {
81
+ return new Promise(resolve => {
82
+ styleValueTypes_esF5d10b79.animate({
83
+ from: { opacity: 1, scale: 1 },
84
+ to: { opacity: hasFade ? 0 : 1, scale: amount },
85
+ duration,
86
+ onUpdate(latest) {
87
+ const updates = {
88
+ scale: latest.scale,
89
+ };
90
+ if (hasFade) {
91
+ updates['opacity'] = latest.opacity;
92
+ }
93
+ nodeStyler.set(updates);
94
+ },
95
+ onComplete() {
96
+ resolve();
97
+ },
98
+ });
99
+ });
100
+ }
101
+ return {
102
+ growIn,
103
+ growOut,
104
+ setGrowOut,
105
+ setGrowIn,
106
+ };
107
+ };
108
+
109
+ exports.addEventListeners = addEventListeners;
110
+ exports.removeEventListeners = removeEventListeners;
111
+ exports.useGrow = useGrow;