@globalpayments/vega-react 2.50.0 → 2.86.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/LICENSE +9 -17
- package/README.md +1 -1
- package/dist/components.d.ts +12 -2
- package/dist/components.js +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/overrides/vega-popover/index.d.ts +7 -0
- package/dist/overrides/vega-popover/index.js +151 -0
- package/dist/overrides/vega-popover/test/vega-popover.test.d.ts +6 -0
- package/dist/overrides/vega-popover/test/vega-popover.test.js +108 -0
- package/dist/package.json +17 -0
- package/dist/testing/utils.d.ts +13 -0
- package/dist/testing/utils.js +9 -0
- package/dist/utils/spec-utils.d.ts +11 -0
- package/dist/utils/spec-utils.js +22 -0
- package/package.json +16 -4
package/LICENSE
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
Company Proprietary License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Global Payments Inc. All rights reserved.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
5
|
+
This software and associated documentation files (the "Software") are the proprietary property of Global Payments Inc. and are protected by copyright law.
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
copies or substantial portions of the Software.
|
|
7
|
+
Permission is hereby granted to Global Payments Inc. employees and authorized contractors to use, copy, modify, and distribute the Software within Global Payments Inc. for internal purposes only, subject to the following conditions:
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
9
|
+
1. The Software may not be used, copied, modified, or distributed outside of Global Payments Inc. without prior written permission from Global Payments Inc.
|
|
10
|
+
2. The Software may not be used for commercial purposes outside of Global Payments Inc.
|
|
11
|
+
3. Unauthorized use, reproduction, or distribution of the Software is strictly prohibited.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL GLOBAL PAYMENTS INC. BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# Vega React
|
|
2
2
|
> React specific wrapper for [@heartlandone/vega](https://www.npmjs.com/package/@heartlandone/vega)
|
|
3
3
|
|
|
4
|
-
For installation guidance, please refer to https://vega.
|
|
4
|
+
For installation guidance, please refer to https://vega.globalpayments.com/guides/getting-started-developers#react
|
package/dist/components.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { JSX } from '@globalpayments/vega';
|
|
3
2
|
export declare const VegaAccordion: import("react").ForwardRefExoticComponent<JSX.VegaAccordion & Omit<import("react").HTMLAttributes<HTMLVegaAccordionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaAccordionElement>>;
|
|
4
3
|
export declare const VegaAppFooter: import("react").ForwardRefExoticComponent<JSX.VegaAppFooter & Omit<import("react").HTMLAttributes<HTMLVegaAppFooterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaAppFooterElement>>;
|
|
5
|
-
export declare const VegaAppHeaderButton: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaAppHeaderButton, Omit<import("react").HTMLAttributes<HTMLVegaAppHeaderButtonElement>, "style">, "onClick"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaAppHeaderButtonElement>>;
|
|
4
|
+
export declare const VegaAppHeaderButton: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaAppHeaderButton, Omit<import("react").HTMLAttributes<HTMLVegaAppHeaderButtonElement>, "style">, "onClick"|"onReset"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaAppHeaderButtonElement>>;
|
|
6
5
|
export declare const VegaBackdrop: import("react").ForwardRefExoticComponent<JSX.VegaBackdrop & Omit<import("react").HTMLAttributes<HTMLVegaBackdropElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBackdropElement>>;
|
|
7
6
|
export declare const VegaBanner: import("react").ForwardRefExoticComponent<JSX.VegaBanner & Omit<import("react").HTMLAttributes<HTMLVegaBannerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBannerElement>>;
|
|
8
7
|
export declare const VegaBarChart: import("react").ForwardRefExoticComponent<JSX.VegaBarChart & Omit<import("react").HTMLAttributes<HTMLVegaBarChartElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBarChartElement>>;
|
|
@@ -16,6 +15,7 @@ export declare const VegaButtonGroupItem: import("react").ForwardRefExoticCompon
|
|
|
16
15
|
export declare const VegaButtonLink: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaButtonLink, Omit<import("react").HTMLAttributes<HTMLVegaButtonLinkElement>, "style">, "onClick"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaButtonLinkElement>>;
|
|
17
16
|
export declare const VegaCalendar: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaCalendar, Omit<import("react").HTMLAttributes<HTMLVegaCalendarElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCalendarElement>>;
|
|
18
17
|
export declare const VegaCalendarEvent: import("react").ForwardRefExoticComponent<JSX.VegaCalendarEvent & Omit<import("react").HTMLAttributes<HTMLVegaCalendarEventElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCalendarEventElement>>;
|
|
18
|
+
export declare const VegaCalendarEventPreview: import("react").ForwardRefExoticComponent<JSX.VegaCalendarEventPreview & Omit<import("react").HTMLAttributes<HTMLVegaCalendarEventPreviewElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCalendarEventPreviewElement>>;
|
|
19
19
|
export declare const VegaCalendarEventSlot: import("react").ForwardRefExoticComponent<JSX.VegaCalendarEventSlot & Omit<import("react").HTMLAttributes<HTMLVegaCalendarEventSlotElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCalendarEventSlotElement>>;
|
|
20
20
|
export declare const VegaCard: import("react").ForwardRefExoticComponent<JSX.VegaCard & Omit<import("react").HTMLAttributes<HTMLVegaCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCardElement>>;
|
|
21
21
|
export declare const VegaCarousel: import("react").ForwardRefExoticComponent<JSX.VegaCarousel & Omit<import("react").HTMLAttributes<HTMLVegaCarouselElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCarouselElement>>;
|
|
@@ -24,6 +24,8 @@ export declare const VegaCheckboxGroup: import("react").ForwardRefExoticComponen
|
|
|
24
24
|
export declare const VegaChip: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaChip, Omit<import("react").HTMLAttributes<HTMLVegaChipElement>, "style">, "onClick"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaChipElement>>;
|
|
25
25
|
export declare const VegaCodeBlock: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaCodeBlock, Omit<import("react").HTMLAttributes<HTMLVegaCodeBlockElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCodeBlockElement>>;
|
|
26
26
|
export declare const VegaColorPicker: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaColorPicker, Omit<import("react").HTMLAttributes<HTMLVegaColorPickerElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaColorPickerElement>>;
|
|
27
|
+
export declare const VegaColorSwatch: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaColorSwatch, Omit<import("react").HTMLAttributes<HTMLVegaColorSwatchElement>, "style">, "onClick"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaColorSwatchElement>>;
|
|
28
|
+
export declare const VegaColorSwatchPicker: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaColorSwatchPicker, Omit<import("react").HTMLAttributes<HTMLVegaColorSwatchPickerElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaColorSwatchPickerElement>>;
|
|
27
29
|
export declare const VegaComboBox: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaComboBox, Omit<import("react").HTMLAttributes<HTMLVegaComboBoxElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaComboBoxElement>>;
|
|
28
30
|
export declare const VegaCounterBadge: import("react").ForwardRefExoticComponent<JSX.VegaCounterBadge & Omit<import("react").HTMLAttributes<HTMLVegaCounterBadgeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaCounterBadgeElement>>;
|
|
29
31
|
export declare const VegaDatePicker: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaDatePicker, Omit<import("react").HTMLAttributes<HTMLVegaDatePickerElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaDatePickerElement>>;
|
|
@@ -48,6 +50,7 @@ export declare const VegaImageUploader: import("react").ForwardRefExoticComponen
|
|
|
48
50
|
export declare const VegaInput: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInput, Omit<import("react").HTMLAttributes<HTMLVegaInputElement>, "style">, "onChange"|"onFocus"|"onBlur"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputElement>>;
|
|
49
51
|
export declare const VegaInputCreditCard: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInputCreditCard, Omit<import("react").HTMLAttributes<HTMLVegaInputCreditCardElement>, "style">, "onChange"|"onBlur"|"onFocus"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputCreditCardElement>>;
|
|
50
52
|
export declare const VegaInputNumeric: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInputNumeric, Omit<import("react").HTMLAttributes<HTMLVegaInputNumericElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputNumericElement>>;
|
|
53
|
+
export declare const VegaInputPasscode: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInputPasscode, Omit<import("react").HTMLAttributes<HTMLVegaInputPasscodeElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputPasscodeElement>>;
|
|
51
54
|
export declare const VegaInputPhoneNumber: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInputPhoneNumber, Omit<import("react").HTMLAttributes<HTMLVegaInputPhoneNumberElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputPhoneNumberElement>>;
|
|
52
55
|
export declare const VegaInputRange: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInputRange, Omit<import("react").HTMLAttributes<HTMLVegaInputRangeElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputRangeElement>>;
|
|
53
56
|
export declare const VegaInputSelect: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaInputSelect, Omit<import("react").HTMLAttributes<HTMLVegaInputSelectElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaInputSelectElement>>;
|
|
@@ -70,6 +73,7 @@ export declare const VegaPieChart: import("react").ForwardRefExoticComponent<JSX
|
|
|
70
73
|
export declare const VegaPopover: import("react").ForwardRefExoticComponent<JSX.VegaPopover & Omit<import("react").HTMLAttributes<HTMLVegaPopoverElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaPopoverElement>>;
|
|
71
74
|
export declare const VegaPopoverContentBox: import("react").ForwardRefExoticComponent<JSX.VegaPopoverContentBox & Omit<import("react").HTMLAttributes<HTMLVegaPopoverContentBoxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaPopoverContentBoxElement>>;
|
|
72
75
|
export declare const VegaProgressTracker: import("react").ForwardRefExoticComponent<JSX.VegaProgressTracker & Omit<import("react").HTMLAttributes<HTMLVegaProgressTrackerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaProgressTrackerElement>>;
|
|
76
|
+
export declare const VegaProgressTrackerStep: import("react").ForwardRefExoticComponent<JSX.VegaProgressTrackerStep & Omit<import("react").HTMLAttributes<HTMLVegaProgressTrackerStepElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaProgressTrackerStepElement>>;
|
|
73
77
|
export declare const VegaRadio: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaRadio, Omit<import("react").HTMLAttributes<HTMLVegaRadioElement>, "style">, "onChange"|"onFocus"|"onBlur"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRadioElement>>;
|
|
74
78
|
export declare const VegaRadioGroup: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaRadioGroup, Omit<import("react").HTMLAttributes<HTMLVegaRadioGroupElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRadioGroupElement>>;
|
|
75
79
|
export declare const VegaRichTextContent: import("react").ForwardRefExoticComponent<JSX.VegaRichTextContent & Omit<import("react").HTMLAttributes<HTMLVegaRichTextContentElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextContentElement>>;
|
|
@@ -77,6 +81,9 @@ export declare const VegaRichTextEditor: import("react").ForwardRefExoticCompone
|
|
|
77
81
|
export declare const VegaRichTextEditorToolbarButton: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaRichTextEditorToolbarButton, Omit<import("react").HTMLAttributes<HTMLVegaRichTextEditorToolbarButtonElement>, "style">, "onClick"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextEditorToolbarButtonElement>>;
|
|
78
82
|
export declare const VegaRichTextImageEditor: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaRichTextImageEditor, Omit<import("react").HTMLAttributes<HTMLVegaRichTextImageEditorElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextImageEditorElement>>;
|
|
79
83
|
export declare const VegaRichTextLinkEditor: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaRichTextLinkEditor, Omit<import("react").HTMLAttributes<HTMLVegaRichTextLinkEditorElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextLinkEditorElement>>;
|
|
84
|
+
export declare const VegaRichTextTableProperties: import("react").ForwardRefExoticComponent<JSX.VegaRichTextTableProperties & Omit<import("react").HTMLAttributes<HTMLVegaRichTextTablePropertiesElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextTablePropertiesElement>>;
|
|
85
|
+
export declare const VegaRichTextTableSelectionWidget: import("react").ForwardRefExoticComponent<JSX.VegaRichTextTableSelectionWidget & Omit<import("react").HTMLAttributes<HTMLVegaRichTextTableSelectionWidgetElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextTableSelectionWidgetElement>>;
|
|
86
|
+
export declare const VegaRichTextTableSetting: import("react").ForwardRefExoticComponent<JSX.VegaRichTextTableSetting & Omit<import("react").HTMLAttributes<HTMLVegaRichTextTableSettingElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaRichTextTableSettingElement>>;
|
|
80
87
|
export declare const VegaSectionTitle: import("react").ForwardRefExoticComponent<JSX.VegaSectionTitle & Omit<import("react").HTMLAttributes<HTMLVegaSectionTitleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaSectionTitleElement>>;
|
|
81
88
|
export declare const VegaSegmentControl: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaSegmentControl, Omit<import("react").HTMLAttributes<HTMLVegaSegmentControlElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaSegmentControlElement>>;
|
|
82
89
|
export declare const VegaSelectionChip: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaSelectionChip, Omit<import("react").HTMLAttributes<HTMLVegaSelectionChipElement>, "style">, "onChange"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaSelectionChipElement>>;
|
|
@@ -96,6 +103,9 @@ export declare const VegaTable: import("react").ForwardRefExoticComponent<VegaRe
|
|
|
96
103
|
export declare const VegaTableBody: import("react").ForwardRefExoticComponent<JSX.VegaTableBody & Omit<import("react").HTMLAttributes<HTMLVegaTableBodyElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableBodyElement>>;
|
|
97
104
|
export declare const VegaTableCell: import("react").ForwardRefExoticComponent<JSX.VegaTableCell & Omit<import("react").HTMLAttributes<HTMLVegaTableCellElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableCellElement>>;
|
|
98
105
|
export declare const VegaTableExpandRow: import("react").ForwardRefExoticComponent<JSX.VegaTableExpandRow & Omit<import("react").HTMLAttributes<HTMLVegaTableExpandRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableExpandRowElement>>;
|
|
106
|
+
export declare const VegaTableFoot: import("react").ForwardRefExoticComponent<JSX.VegaTableFoot & Omit<import("react").HTMLAttributes<HTMLVegaTableFootElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableFootElement>>;
|
|
107
|
+
export declare const VegaTableFootCell: import("react").ForwardRefExoticComponent<JSX.VegaTableFootCell & Omit<import("react").HTMLAttributes<HTMLVegaTableFootCellElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableFootCellElement>>;
|
|
108
|
+
export declare const VegaTableFootRow: import("react").ForwardRefExoticComponent<JSX.VegaTableFootRow & Omit<import("react").HTMLAttributes<HTMLVegaTableFootRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableFootRowElement>>;
|
|
99
109
|
export declare const VegaTableHead: import("react").ForwardRefExoticComponent<JSX.VegaTableHead & Omit<import("react").HTMLAttributes<HTMLVegaTableHeadElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableHeadElement>>;
|
|
100
110
|
export declare const VegaTableHeadCell: import("react").ForwardRefExoticComponent<VegaReactComponentWithNativeEvent<JSX.VegaTableHeadCell, Omit<import("react").HTMLAttributes<HTMLVegaTableHeadCellElement>, "style">, "onClick"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableHeadCellElement>>;
|
|
101
111
|
export declare const VegaTableHeadRow: import("react").ForwardRefExoticComponent<JSX.VegaTableHeadRow & Omit<import("react").HTMLAttributes<HTMLVegaTableHeadRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaTableHeadRowElement>>;
|
package/dist/components.js
CHANGED
|
@@ -22,6 +22,7 @@ export const VegaButtonGroupItem = /*@__PURE__*/ createReactComponent('vega-butt
|
|
|
22
22
|
export const VegaButtonLink = /*@__PURE__*/ createReactComponent('vega-button-link');
|
|
23
23
|
export const VegaCalendar = /*@__PURE__*/ createReactComponent('vega-calendar');
|
|
24
24
|
export const VegaCalendarEvent = /*@__PURE__*/ createReactComponent('vega-calendar-event');
|
|
25
|
+
export const VegaCalendarEventPreview = /*@__PURE__*/ createReactComponent('vega-calendar-event-preview');
|
|
25
26
|
export const VegaCalendarEventSlot = /*@__PURE__*/ createReactComponent('vega-calendar-event-slot');
|
|
26
27
|
export const VegaCard = /*@__PURE__*/ createReactComponent('vega-card');
|
|
27
28
|
export const VegaCarousel = /*@__PURE__*/ createReactComponent('vega-carousel');
|
|
@@ -30,6 +31,8 @@ export const VegaCheckboxGroup = /*@__PURE__*/ createReactComponent('vega-checkb
|
|
|
30
31
|
export const VegaChip = /*@__PURE__*/ createReactComponent('vega-chip');
|
|
31
32
|
export const VegaCodeBlock = /*@__PURE__*/ createReactComponent('vega-code-block');
|
|
32
33
|
export const VegaColorPicker = /*@__PURE__*/ createReactComponent('vega-color-picker');
|
|
34
|
+
export const VegaColorSwatch = /*@__PURE__*/ createReactComponent('vega-color-swatch');
|
|
35
|
+
export const VegaColorSwatchPicker = /*@__PURE__*/ createReactComponent('vega-color-swatch-picker');
|
|
33
36
|
export const VegaComboBox = /*@__PURE__*/ createReactComponent('vega-combo-box');
|
|
34
37
|
export const VegaCounterBadge = /*@__PURE__*/ createReactComponent('vega-counter-badge');
|
|
35
38
|
export const VegaDatePicker = /*@__PURE__*/ createReactComponent('vega-date-picker');
|
|
@@ -54,6 +57,7 @@ export const VegaImageUploader = /*@__PURE__*/ createReactComponent('vega-image-
|
|
|
54
57
|
export const VegaInput = /*@__PURE__*/ createReactComponent('vega-input');
|
|
55
58
|
export const VegaInputCreditCard = /*@__PURE__*/ createReactComponent('vega-input-credit-card');
|
|
56
59
|
export const VegaInputNumeric = /*@__PURE__*/ createReactComponent('vega-input-numeric');
|
|
60
|
+
export const VegaInputPasscode = /*@__PURE__*/ createReactComponent('vega-input-passcode');
|
|
57
61
|
export const VegaInputPhoneNumber = /*@__PURE__*/ createReactComponent('vega-input-phone-number');
|
|
58
62
|
export const VegaInputRange = /*@__PURE__*/ createReactComponent('vega-input-range');
|
|
59
63
|
export const VegaInputSelect = /*@__PURE__*/ createReactComponent('vega-input-select');
|
|
@@ -76,6 +80,7 @@ export const VegaPieChart = /*@__PURE__*/ createReactComponent('vega-pie-chart')
|
|
|
76
80
|
export const VegaPopover = /*@__PURE__*/ createReactComponent('vega-popover');
|
|
77
81
|
export const VegaPopoverContentBox = /*@__PURE__*/ createReactComponent('vega-popover-content-box');
|
|
78
82
|
export const VegaProgressTracker = /*@__PURE__*/ createReactComponent('vega-progress-tracker');
|
|
83
|
+
export const VegaProgressTrackerStep = /*@__PURE__*/ createReactComponent('vega-progress-tracker-step');
|
|
79
84
|
export const VegaRadio = /*@__PURE__*/ createReactComponent('vega-radio');
|
|
80
85
|
export const VegaRadioGroup = /*@__PURE__*/ createReactComponent('vega-radio-group');
|
|
81
86
|
export const VegaRichTextContent = /*@__PURE__*/ createReactComponent('vega-rich-text-content');
|
|
@@ -83,6 +88,9 @@ export const VegaRichTextEditor = /*@__PURE__*/ createReactComponent('vega-rich-
|
|
|
83
88
|
export const VegaRichTextEditorToolbarButton = /*@__PURE__*/ createReactComponent('vega-rich-text-editor-toolbar-button');
|
|
84
89
|
export const VegaRichTextImageEditor = /*@__PURE__*/ createReactComponent('vega-rich-text-image-editor');
|
|
85
90
|
export const VegaRichTextLinkEditor = /*@__PURE__*/ createReactComponent('vega-rich-text-link-editor');
|
|
91
|
+
export const VegaRichTextTableProperties = /*@__PURE__*/ createReactComponent('vega-rich-text-table-properties');
|
|
92
|
+
export const VegaRichTextTableSelectionWidget = /*@__PURE__*/ createReactComponent('vega-rich-text-table-selection-widget');
|
|
93
|
+
export const VegaRichTextTableSetting = /*@__PURE__*/ createReactComponent('vega-rich-text-table-setting');
|
|
86
94
|
export const VegaSectionTitle = /*@__PURE__*/ createReactComponent('vega-section-title');
|
|
87
95
|
export const VegaSegmentControl = /*@__PURE__*/ createReactComponent('vega-segment-control');
|
|
88
96
|
export const VegaSelectionChip = /*@__PURE__*/ createReactComponent('vega-selection-chip');
|
|
@@ -102,6 +110,9 @@ export const VegaTable = /*@__PURE__*/ createReactComponent('vega-table');
|
|
|
102
110
|
export const VegaTableBody = /*@__PURE__*/ createReactComponent('vega-table-body');
|
|
103
111
|
export const VegaTableCell = /*@__PURE__*/ createReactComponent('vega-table-cell');
|
|
104
112
|
export const VegaTableExpandRow = /*@__PURE__*/ createReactComponent('vega-table-expand-row');
|
|
113
|
+
export const VegaTableFoot = /*@__PURE__*/ createReactComponent('vega-table-foot');
|
|
114
|
+
export const VegaTableFootCell = /*@__PURE__*/ createReactComponent('vega-table-foot-cell');
|
|
115
|
+
export const VegaTableFootRow = /*@__PURE__*/ createReactComponent('vega-table-foot-row');
|
|
105
116
|
export const VegaTableHead = /*@__PURE__*/ createReactComponent('vega-table-head');
|
|
106
117
|
export const VegaTableHeadCell = /*@__PURE__*/ createReactComponent('vega-table-head-cell');
|
|
107
118
|
export const VegaTableHeadRow = /*@__PURE__*/ createReactComponent('vega-table-head-row');
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StencilReactExternalProps } from "../../react-component-lib/utils";
|
|
3
|
+
import type { JSX } from "@globalpayments/vega";
|
|
4
|
+
declare type VegaPopoverProps = React.PropsWithChildren<StencilReactExternalProps<JSX.VegaPopover, HTMLVegaPopoverElement>>;
|
|
5
|
+
declare type VegaPopoverComponent = React.ForwardRefExoticComponent<React.PropsWithoutRef<VegaPopoverProps> & React.RefAttributes<HTMLVegaPopoverElement>>;
|
|
6
|
+
export declare const VegaPopover: VegaPopoverComponent;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import ReactDOM from "react-dom";
|
|
14
|
+
import { createReactComponent } from "../../react-component-lib";
|
|
15
|
+
import { setRef, } from "../../react-component-lib/utils";
|
|
16
|
+
const VegaPopoverBase = createReactComponent("vega-popover");
|
|
17
|
+
/** Splits children into `[slot="popover"]` overlay nodes and all others (trigger etc.). */
|
|
18
|
+
function splitChildren(children) {
|
|
19
|
+
const popover = [];
|
|
20
|
+
const other = [];
|
|
21
|
+
React.Children.forEach(children, (child) => {
|
|
22
|
+
if (!React.isValidElement(child)) {
|
|
23
|
+
other.push(child);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const slot = child.props
|
|
27
|
+
.slot;
|
|
28
|
+
(slot === "popover" ? popover : other).push(child);
|
|
29
|
+
});
|
|
30
|
+
return [popover, other];
|
|
31
|
+
}
|
|
32
|
+
class VegaPopoverInner extends React.PureComponent {
|
|
33
|
+
constructor(props) {
|
|
34
|
+
super(props);
|
|
35
|
+
this.host = null;
|
|
36
|
+
this.popoverMount = null;
|
|
37
|
+
this.contentBox = null;
|
|
38
|
+
this.contentBoxObserver = null;
|
|
39
|
+
this.isUnmounting = false;
|
|
40
|
+
this.disconnectContentBoxObserver = () => {
|
|
41
|
+
if (this.contentBoxObserver) {
|
|
42
|
+
this.contentBoxObserver.disconnect();
|
|
43
|
+
this.contentBoxObserver = null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
this.syncContentBox = () => {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
const nextContentBox = (_c = (_b = (_a = this.host) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("vega-popover-content-box")) !== null && _c !== void 0 ? _c : null;
|
|
49
|
+
if (this.contentBox === nextContentBox) {
|
|
50
|
+
this.ensurePopoverMount();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.contentBox = nextContentBox;
|
|
54
|
+
this.ensurePopoverMount();
|
|
55
|
+
};
|
|
56
|
+
this.ensurePopoverMount = () => {
|
|
57
|
+
if (!this.contentBox || !this.popoverMount) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (this.popoverMount.parentElement !== this.contentBox) {
|
|
61
|
+
this.contentBox.appendChild(this.popoverMount);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
this.attachContentBoxObserver = (host) => {
|
|
65
|
+
this.disconnectContentBoxObserver();
|
|
66
|
+
if (typeof MutationObserver === "undefined" || !host.shadowRoot) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.contentBoxObserver = new MutationObserver(() => {
|
|
70
|
+
this.syncContentBox();
|
|
71
|
+
});
|
|
72
|
+
this.contentBoxObserver.observe(host.shadowRoot, {
|
|
73
|
+
childList: true,
|
|
74
|
+
subtree: true,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
this.connectHost = (host) => {
|
|
78
|
+
// Reset the unmounting flag so re-connections work after React 18 StrictMode
|
|
79
|
+
// simulates unmount+remount on the same class instance.
|
|
80
|
+
this.isUnmounting = false;
|
|
81
|
+
// Re-create popoverMount if componentWillUnmount destroyed it (StrictMode remount).
|
|
82
|
+
let needsRender = false;
|
|
83
|
+
if (!this.popoverMount && typeof document !== "undefined") {
|
|
84
|
+
this.popoverMount = document.createElement("div");
|
|
85
|
+
this.popoverMount.setAttribute("slot", "popover");
|
|
86
|
+
needsRender = true;
|
|
87
|
+
}
|
|
88
|
+
const ready = typeof host.componentOnReady === "function"
|
|
89
|
+
? host.componentOnReady()
|
|
90
|
+
: Promise.resolve();
|
|
91
|
+
void ready.then(() => {
|
|
92
|
+
if (this.host !== host || this.isUnmounting) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.syncContentBox();
|
|
96
|
+
this.attachContentBoxObserver(host);
|
|
97
|
+
// If popoverMount was recreated we need a new render pass so the portal
|
|
98
|
+
// picks up the fresh mount node.
|
|
99
|
+
if (needsRender) {
|
|
100
|
+
this.forceUpdate();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
this.setHostRef = (el) => {
|
|
105
|
+
const { forwardedRef } = this.props;
|
|
106
|
+
setRef(forwardedRef, el);
|
|
107
|
+
if (this.host === el) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (el === null && this.host !== null && !this.isUnmounting) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (this.host && el !== this.host) {
|
|
114
|
+
this.disconnectContentBoxObserver();
|
|
115
|
+
}
|
|
116
|
+
this.host = el;
|
|
117
|
+
if (el) {
|
|
118
|
+
this.connectHost(el);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.contentBox = null;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
if (typeof document !== "undefined") {
|
|
125
|
+
this.popoverMount = document.createElement("div");
|
|
126
|
+
this.popoverMount.setAttribute("slot", "popover");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
componentWillUnmount() {
|
|
130
|
+
var _a;
|
|
131
|
+
this.isUnmounting = true;
|
|
132
|
+
this.disconnectContentBoxObserver();
|
|
133
|
+
if ((_a = this.popoverMount) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
134
|
+
this.popoverMount.parentElement.removeChild(this.popoverMount);
|
|
135
|
+
}
|
|
136
|
+
this.host = null;
|
|
137
|
+
this.popoverMount = null;
|
|
138
|
+
this.contentBox = null;
|
|
139
|
+
}
|
|
140
|
+
render() {
|
|
141
|
+
const _a = this.props, { children, forwardedRef } = _a, restProps = __rest(_a, ["children", "forwardedRef"]);
|
|
142
|
+
const [popoverChildren, otherChildren] = splitChildren(children);
|
|
143
|
+
return (React.createElement(React.Fragment, null,
|
|
144
|
+
React.createElement(VegaPopoverBase, Object.assign({}, restProps, { ref: this.setHostRef }), otherChildren),
|
|
145
|
+
popoverChildren.length > 0 &&
|
|
146
|
+
this.popoverMount &&
|
|
147
|
+
ReactDOM.createPortal(popoverChildren, this.popoverMount)));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export const VegaPopover = React.forwardRef((props, ref) => React.createElement(VegaPopoverInner, Object.assign({}, props, { forwardedRef: ref })));
|
|
151
|
+
VegaPopover.displayName = "VegaPopover";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* NOTE: This test file is for vega-popover React wrapper.
|
|
12
|
+
* It validates portal wrapping and slot-based child routing.
|
|
13
|
+
* Tests use the real VegaPopover component with mocked Shadow DOM support.
|
|
14
|
+
*/
|
|
15
|
+
import "jest";
|
|
16
|
+
import React from "react";
|
|
17
|
+
import ReactDOM from "react-dom";
|
|
18
|
+
import { VegaPopover } from "../index";
|
|
19
|
+
// @ts-ignore - @testing-library/react is installed and resolved by jest, but TypeScript LSP may not find it
|
|
20
|
+
import { render, waitFor } from "@testing-library/react";
|
|
21
|
+
jest.mock("@globalpayments/vega", () => ({
|
|
22
|
+
FeatureFlag: {
|
|
23
|
+
isEnabled: () => false,
|
|
24
|
+
},
|
|
25
|
+
}), { virtual: true });
|
|
26
|
+
/**
|
|
27
|
+
* Helper to inject a mocked Shadow DOM structure into an element.
|
|
28
|
+
* Used for jsdom compatibility where native Shadow DOM is not supported.
|
|
29
|
+
*/
|
|
30
|
+
function injectShadowRootMock(element) {
|
|
31
|
+
if (!element.shadowRoot) {
|
|
32
|
+
const contentBox = document.createElement("vega-popover-content-box");
|
|
33
|
+
Object.defineProperty(element, "shadowRoot", {
|
|
34
|
+
configurable: true,
|
|
35
|
+
value: {
|
|
36
|
+
querySelector: (selector) => {
|
|
37
|
+
return selector === "vega-popover-content-box" ? contentBox : null;
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
element.componentOnReady = () => Promise.resolve(element);
|
|
42
|
+
}
|
|
43
|
+
return element;
|
|
44
|
+
}
|
|
45
|
+
describe("VegaPopover (React portal wrapper)", () => {
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
// Mock createElement to inject shadowRoot on vega-popover elements
|
|
48
|
+
const originalCreateElement = document.createElement;
|
|
49
|
+
jest
|
|
50
|
+
.spyOn(document, "createElement")
|
|
51
|
+
.mockImplementation(function (tagName, ...args) {
|
|
52
|
+
const element = originalCreateElement.call(document, tagName, ...args);
|
|
53
|
+
if (tagName.toLowerCase() === "vega-popover") {
|
|
54
|
+
injectShadowRootMock(element);
|
|
55
|
+
}
|
|
56
|
+
return element;
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
afterEach(() => {
|
|
60
|
+
jest.restoreAllMocks();
|
|
61
|
+
document.body.innerHTML = "";
|
|
62
|
+
});
|
|
63
|
+
test("creates host and content-box portals for trigger and popover content", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
var _a;
|
|
65
|
+
const createPortalSpy = jest.spyOn(ReactDOM, "createPortal");
|
|
66
|
+
createPortalSpy.mockImplementation((children) => children);
|
|
67
|
+
render(React.createElement(VegaPopover, { placement: "top", alignment: "start" },
|
|
68
|
+
React.createElement("button", { slot: "popover-content" }, "Click Me"),
|
|
69
|
+
React.createElement("div", { slot: "popover" }, "Popover Content")));
|
|
70
|
+
const host = document.querySelector("vega-popover");
|
|
71
|
+
const contentBox = (_a = host === null || host === void 0 ? void 0 : host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("vega-popover-content-box");
|
|
72
|
+
expect(host).toBeTruthy();
|
|
73
|
+
expect(contentBox).toBeTruthy();
|
|
74
|
+
yield waitFor(() => {
|
|
75
|
+
expect(createPortalSpy).toHaveBeenCalled();
|
|
76
|
+
const containers = createPortalSpy.mock.calls.map((call) => call[1]);
|
|
77
|
+
expect(containers).toContain(host);
|
|
78
|
+
expect(containers).toContain(contentBox);
|
|
79
|
+
});
|
|
80
|
+
}));
|
|
81
|
+
test("routes children by slot to the expected portal container", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
+
var _b;
|
|
83
|
+
const createPortalSpy = jest.spyOn(ReactDOM, "createPortal");
|
|
84
|
+
createPortalSpy.mockImplementation((children) => children);
|
|
85
|
+
render(React.createElement(VegaPopover, { placement: "top", alignment: "start" },
|
|
86
|
+
React.createElement("button", { slot: "popover-content" }, "Trigger Button"),
|
|
87
|
+
React.createElement("div", { slot: "popover" }, "Popover Body")));
|
|
88
|
+
const host = document.querySelector("vega-popover");
|
|
89
|
+
const contentBox = (_b = host === null || host === void 0 ? void 0 : host.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("vega-popover-content-box");
|
|
90
|
+
yield waitFor(() => {
|
|
91
|
+
expect(createPortalSpy.mock.calls.length).toBeGreaterThanOrEqual(2);
|
|
92
|
+
});
|
|
93
|
+
const hostPortalCall = createPortalSpy.mock.calls.find((call) => call[1] === host);
|
|
94
|
+
const contentPortalCall = createPortalSpy.mock.calls.find((call) => call[1] === contentBox);
|
|
95
|
+
expect(hostPortalCall).toBeTruthy();
|
|
96
|
+
expect(contentPortalCall).toBeTruthy();
|
|
97
|
+
const hostChildren = hostPortalCall
|
|
98
|
+
? React.Children.toArray(hostPortalCall[0])
|
|
99
|
+
: [];
|
|
100
|
+
const contentChildren = contentPortalCall
|
|
101
|
+
? React.Children.toArray(contentPortalCall[0])
|
|
102
|
+
: [];
|
|
103
|
+
if (hostChildren[0] && contentChildren[0]) {
|
|
104
|
+
expect(hostChildren[0].props.children).toBe("Trigger Button");
|
|
105
|
+
expect(contentChildren[0].props.children).toBe("Popover Body");
|
|
106
|
+
}
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@globalpayments/vega-react",
|
|
3
|
+
"version": "2.85.0",
|
|
4
|
+
"description": "React specific wrapper for @globalpayments/vega",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"module": "./index.js",
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@globalpayments/vega": "2.85.0"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"react": ">=16.7.0",
|
|
15
|
+
"react-dom": ">=16.7.0"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/testing/utils.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import type { RenderResult } from "@testing-library/react";
|
|
2
2
|
export declare type Nullable<T> = T | undefined | null;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated This utility is deprecated. Use `waitForVega` from `@heartlandone/vega-testing-library` directly.
|
|
5
|
+
* The `vega-testing-library` package supports Jest fake timers and does not require a `RenderResult` argument.
|
|
6
|
+
* Install it separately: `npm install @heartlandone/vega-testing-library`
|
|
7
|
+
*/
|
|
3
8
|
export declare function waitForVegaReady(renderResult: RenderResult, delay?: number): Promise<RenderResult>;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated This type is deprecated. Use `MockedResizeObserverController` from `@heartlandone/vega-testing-library` directly.
|
|
11
|
+
* Install it separately: `npm install @heartlandone/vega-testing-library`
|
|
12
|
+
*/
|
|
4
13
|
export declare type MockedResizeObserverController = {
|
|
5
14
|
hide: (selector: string, container?: HTMLElement) => void;
|
|
6
15
|
show: (selector: string, container?: HTMLElement) => void;
|
|
7
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated This function is deprecated. Use `mockResizeObserver` from `@heartlandone/vega-testing-library` directly.
|
|
19
|
+
* Install it separately: `npm install @heartlandone/vega-testing-library`
|
|
20
|
+
*/
|
|
8
21
|
export declare function mockResizeObserver(): MockedResizeObserverController;
|
package/dist/testing/utils.js
CHANGED
|
@@ -8,6 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { waitForVega } from "@globalpayments/vega";
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated This utility is deprecated. Use `waitForVega` from `@heartlandone/vega-testing-library` directly.
|
|
13
|
+
* The `vega-testing-library` package supports Jest fake timers and does not require a `RenderResult` argument.
|
|
14
|
+
* Install it separately: `npm install @heartlandone/vega-testing-library`
|
|
15
|
+
*/
|
|
11
16
|
export function waitForVegaReady(renderResult, delay = 300) {
|
|
12
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13
18
|
yield waitForVega();
|
|
@@ -22,6 +27,10 @@ export function waitForVegaReady(renderResult, delay = 300) {
|
|
|
22
27
|
return renderResult;
|
|
23
28
|
});
|
|
24
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated This function is deprecated. Use `mockResizeObserver` from `@heartlandone/vega-testing-library` directly.
|
|
32
|
+
* Install it separately: `npm install @heartlandone/vega-testing-library`
|
|
33
|
+
*/
|
|
25
34
|
export function mockResizeObserver() {
|
|
26
35
|
const resizeObserverElementMap = new Map();
|
|
27
36
|
global.ResizeObserver = class {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE: This utility is only for **SPEC** test cases.
|
|
3
|
+
*
|
|
4
|
+
* Mocked MutationObserver for testing in jsdom environment.
|
|
5
|
+
* Provides observe, disconnect, and trigger methods for controlling
|
|
6
|
+
* mutation observations in tests.
|
|
7
|
+
*
|
|
8
|
+
* @callback MutationCallback - The callback function triggered when mutations occur
|
|
9
|
+
* @returns {jest.Mock} - A Jest mock function constructor for MutationObserver
|
|
10
|
+
*/
|
|
11
|
+
export declare const MockedMutationObserver: jest.Mock;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE: This utility is only for **SPEC** test cases.
|
|
3
|
+
*
|
|
4
|
+
* Mocked MutationObserver for testing in jsdom environment.
|
|
5
|
+
* Provides observe, disconnect, and trigger methods for controlling
|
|
6
|
+
* mutation observations in tests.
|
|
7
|
+
*
|
|
8
|
+
* @callback MutationCallback - The callback function triggered when mutations occur
|
|
9
|
+
* @returns {jest.Mock} - A Jest mock function constructor for MutationObserver
|
|
10
|
+
*/
|
|
11
|
+
export const MockedMutationObserver = jest.fn(function MutationObserver(callback) {
|
|
12
|
+
this.observe = jest.fn();
|
|
13
|
+
this.disconnect = jest.fn();
|
|
14
|
+
/**
|
|
15
|
+
* Mock the trigger for spec test to trigger observer callback
|
|
16
|
+
*
|
|
17
|
+
* @param {MutationRecord[]} mutations - mocked MutationObserver entries
|
|
18
|
+
*/
|
|
19
|
+
this.trigger = (mutations) => {
|
|
20
|
+
callback(mutations, this);
|
|
21
|
+
};
|
|
22
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalpayments/vega-react",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.86.0",
|
|
5
5
|
"description": "React specific wrapper for @globalpayments/vega",
|
|
6
|
+
"license": "UNLICENSED",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"stencil-postbuild": "node ./src/scripts/stencil-post-build-script.js",
|
|
8
|
-
"build": "npm run clean && npm run compile && npm run override-type",
|
|
9
|
+
"build": "npm run clean && npm run compile && npm run override-type && npm run create-dist-package-json",
|
|
9
10
|
"clean": "rm -rf dist",
|
|
10
11
|
"compile": "npm run tsc",
|
|
11
12
|
"tsc": "tsc -p .",
|
|
@@ -15,6 +16,8 @@
|
|
|
15
16
|
"publish:minor": "node ../scripts/publish-version.js minor",
|
|
16
17
|
"publish:major": "node ../scripts/publish-version.js major",
|
|
17
18
|
"override-type": "node ./src/scripts/override-component-native-event-type.js",
|
|
19
|
+
"create-dist-package-json": "node ./src/scripts/create-dist-package-json.js",
|
|
20
|
+
"test": "jest",
|
|
18
21
|
"pr-codesandbox-auto": "node ../scripts/pr-codesandbox-auto/change-package-name.js"
|
|
19
22
|
},
|
|
20
23
|
"main": "./dist/index.js",
|
|
@@ -37,10 +40,11 @@
|
|
|
37
40
|
"np": "^3.1.0",
|
|
38
41
|
"react": "^16.7.0",
|
|
39
42
|
"react-dom": "^16.7.0",
|
|
43
|
+
"ts-jest": "^23.10.5",
|
|
40
44
|
"typescript": "^4.0.0"
|
|
41
45
|
},
|
|
42
46
|
"dependencies": {
|
|
43
|
-
"@globalpayments/vega": "2.
|
|
47
|
+
"@globalpayments/vega": "2.86.0"
|
|
44
48
|
},
|
|
45
49
|
"peerDependencies": {
|
|
46
50
|
"react": ">=16.7.0",
|
|
@@ -52,6 +56,14 @@
|
|
|
52
56
|
"testPathIgnorePatterns": [
|
|
53
57
|
"node_modules",
|
|
54
58
|
"dist"
|
|
55
|
-
]
|
|
59
|
+
],
|
|
60
|
+
"globals": {
|
|
61
|
+
"ts-jest": {
|
|
62
|
+
"tsConfig": "tsconfig.test.json"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"resolutions": {
|
|
67
|
+
"yargs-parser": "^21.1.1"
|
|
56
68
|
}
|
|
57
69
|
}
|