@xplortech/apollo-react 2.9.0 → 2.11.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/css/apollo.css +2338 -1902
- package/dist/components/stencil-generated/components.d.ts +347 -0
- package/dist/components/stencil-generated/components.js +638 -0
- package/dist/components/stencil-generated/components.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
- package/dist/components.d.ts +0 -70
- package/dist/components.js +0 -73
- package/dist/components.js.map +0 -1
- package/dist/react-component-lib/createComponent.d.ts +0 -10
- package/dist/react-component-lib/createComponent.js +0 -65
- package/dist/react-component-lib/createComponent.js.map +0 -1
- package/dist/react-component-lib/createOverlayComponent.d.ts +0 -21
- package/dist/react-component-lib/createOverlayComponent.js +0 -86
- package/dist/react-component-lib/createOverlayComponent.js.map +0 -1
- package/dist/react-component-lib/index.d.ts +0 -2
- package/dist/react-component-lib/index.js +0 -3
- package/dist/react-component-lib/index.js.map +0 -1
- package/dist/react-component-lib/interfaces.d.ts +0 -29
- package/dist/react-component-lib/interfaces.js +0 -2
- package/dist/react-component-lib/interfaces.js.map +0 -1
- package/dist/react-component-lib/utils/attachProps.d.ts +0 -9
- package/dist/react-component-lib/utils/attachProps.js +0 -92
- package/dist/react-component-lib/utils/attachProps.js.map +0 -1
- package/dist/react-component-lib/utils/case.d.ts +0 -2
- package/dist/react-component-lib/utils/case.js +0 -7
- package/dist/react-component-lib/utils/case.js.map +0 -1
- package/dist/react-component-lib/utils/dev.d.ts +0 -2
- package/dist/react-component-lib/utils/dev.js +0 -13
- package/dist/react-component-lib/utils/dev.js.map +0 -1
- package/dist/react-component-lib/utils/index.d.ts +0 -10
- package/dist/react-component-lib/utils/index.js +0 -32
- package/dist/react-component-lib/utils/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './components';
|
|
1
|
+
export * from './components/stencil-generated/components';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components';
|
|
1
|
+
export * from './components/stencil-generated/components';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xplortech/apollo-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -30,9 +30,7 @@
|
|
|
30
30
|
"node": ">=18"
|
|
31
31
|
},
|
|
32
32
|
"sideEffects": [
|
|
33
|
-
"*.css"
|
|
34
|
-
"./dist/components.js",
|
|
35
|
-
"./src/components.ts"
|
|
33
|
+
"*.css"
|
|
36
34
|
],
|
|
37
35
|
"files": [
|
|
38
36
|
"AGENTS.md",
|
|
@@ -48,21 +46,22 @@
|
|
|
48
46
|
"devDependencies": {
|
|
49
47
|
"@types/jest": "^29.5.14",
|
|
50
48
|
"@types/node": "^18.14.1",
|
|
51
|
-
"@types/react": "
|
|
52
|
-
"@types/react-dom": "
|
|
49
|
+
"@types/react": "19.2.17",
|
|
50
|
+
"@types/react-dom": "19.2.3",
|
|
53
51
|
"jest": "^29.7.0",
|
|
54
52
|
"np": "^11.2.0",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
53
|
+
"react": "^19.2.7",
|
|
54
|
+
"react-dom": "^19.2.7",
|
|
57
55
|
"typescript": "^5.5.3"
|
|
58
56
|
},
|
|
59
57
|
"dependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"@xplortech/apollo-
|
|
58
|
+
"@stencil/react-output-target": "1.6.0",
|
|
59
|
+
"@xplortech/apollo-core": "2.11.0",
|
|
60
|
+
"@xplortech/apollo-icons": "0.4.1"
|
|
62
61
|
},
|
|
63
62
|
"peerDependencies": {
|
|
64
|
-
"react": "
|
|
65
|
-
"react-dom": "
|
|
63
|
+
"react": "^18 || ^19",
|
|
64
|
+
"react-dom": "^18 || ^19",
|
|
66
65
|
"typescript": ">=5"
|
|
67
66
|
},
|
|
68
67
|
"jest": {
|
package/dist/components.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { JSX } from '@xplortech/apollo-core';
|
|
2
|
-
export declare const XplAccordion: import("react").ForwardRefExoticComponent<JSX.XplAccordion & Omit<import("react").HTMLAttributes<HTMLXplAccordionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplAccordionElement>>;
|
|
3
|
-
export declare const XplApplicationShell: import("react").ForwardRefExoticComponent<JSX.XplApplicationShell & Omit<import("react").HTMLAttributes<HTMLXplApplicationShellElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplApplicationShellElement>>;
|
|
4
|
-
export declare const XplAvatar: import("react").ForwardRefExoticComponent<JSX.XplAvatar & Omit<import("react").HTMLAttributes<HTMLXplAvatarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplAvatarElement>>;
|
|
5
|
-
export declare const XplBackdrop: import("react").ForwardRefExoticComponent<JSX.XplBackdrop & Omit<import("react").HTMLAttributes<HTMLXplBackdropElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplBackdropElement>>;
|
|
6
|
-
export declare const XplBadge: import("react").ForwardRefExoticComponent<JSX.XplBadge & Omit<import("react").HTMLAttributes<HTMLXplBadgeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplBadgeElement>>;
|
|
7
|
-
export declare const XplBanner: import("react").ForwardRefExoticComponent<JSX.XplBanner & Omit<import("react").HTMLAttributes<HTMLXplBannerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplBannerElement>>;
|
|
8
|
-
export declare const XplBreadcrumbItem: import("react").ForwardRefExoticComponent<JSX.XplBreadcrumbItem & Omit<import("react").HTMLAttributes<HTMLXplBreadcrumbItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplBreadcrumbItemElement>>;
|
|
9
|
-
export declare const XplBreadcrumbs: import("react").ForwardRefExoticComponent<JSX.XplBreadcrumbs & Omit<import("react").HTMLAttributes<HTMLXplBreadcrumbsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplBreadcrumbsElement>>;
|
|
10
|
-
export declare const XplButton: import("react").ForwardRefExoticComponent<JSX.XplButton & Omit<import("react").HTMLAttributes<HTMLXplButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplButtonElement>>;
|
|
11
|
-
export declare const XplButtonRow: import("react").ForwardRefExoticComponent<JSX.XplButtonRow & Omit<import("react").HTMLAttributes<HTMLXplButtonRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplButtonRowElement>>;
|
|
12
|
-
export declare const XplCalendar: import("react").ForwardRefExoticComponent<JSX.XplCalendar & Omit<import("react").HTMLAttributes<HTMLXplCalendarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplCalendarElement>>;
|
|
13
|
-
export declare const XplCheckbox: import("react").ForwardRefExoticComponent<JSX.XplCheckbox & Omit<import("react").HTMLAttributes<HTMLXplCheckboxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplCheckboxElement>>;
|
|
14
|
-
export declare const XplChoicelist: import("react").ForwardRefExoticComponent<JSX.XplChoicelist & Omit<import("react").HTMLAttributes<HTMLXplChoicelistElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplChoicelistElement>>;
|
|
15
|
-
export declare const XplContentArea: import("react").ForwardRefExoticComponent<JSX.XplContentArea & Omit<import("react").HTMLAttributes<HTMLXplContentAreaElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplContentAreaElement>>;
|
|
16
|
-
export declare const XplDashboard: import("react").ForwardRefExoticComponent<JSX.XplDashboard & Omit<import("react").HTMLAttributes<HTMLXplDashboardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDashboardElement>>;
|
|
17
|
-
export declare const XplDataCard: import("react").ForwardRefExoticComponent<JSX.XplDataCard & Omit<import("react").HTMLAttributes<HTMLXplDataCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDataCardElement>>;
|
|
18
|
-
export declare const XplDivider: import("react").ForwardRefExoticComponent<JSX.XplDivider & Omit<import("react").HTMLAttributes<HTMLXplDividerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDividerElement>>;
|
|
19
|
-
export declare const XplDropdown: import("react").ForwardRefExoticComponent<JSX.XplDropdown & Omit<import("react").HTMLAttributes<HTMLXplDropdownElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDropdownElement>>;
|
|
20
|
-
export declare const XplDropdownGroup: import("react").ForwardRefExoticComponent<JSX.XplDropdownGroup & Omit<import("react").HTMLAttributes<HTMLXplDropdownGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDropdownGroupElement>>;
|
|
21
|
-
export declare const XplDropdownHeading: import("react").ForwardRefExoticComponent<JSX.XplDropdownHeading & Omit<import("react").HTMLAttributes<HTMLXplDropdownHeadingElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDropdownHeadingElement>>;
|
|
22
|
-
export declare const XplDropdownOption: import("react").ForwardRefExoticComponent<JSX.XplDropdownOption & Omit<import("react").HTMLAttributes<HTMLXplDropdownOptionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDropdownOptionElement>>;
|
|
23
|
-
export declare const XplDynamicTable: import("react").ForwardRefExoticComponent<JSX.XplDynamicTable & Omit<import("react").HTMLAttributes<HTMLXplDynamicTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDynamicTableElement>>;
|
|
24
|
-
export declare const XplDynamicTableCell: import("react").ForwardRefExoticComponent<JSX.XplDynamicTableCell & Omit<import("react").HTMLAttributes<HTMLXplDynamicTableCellElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDynamicTableCellElement>>;
|
|
25
|
-
export declare const XplDynamicTableRow: import("react").ForwardRefExoticComponent<JSX.XplDynamicTableRow & Omit<import("react").HTMLAttributes<HTMLXplDynamicTableRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplDynamicTableRowElement>>;
|
|
26
|
-
export declare const XplGrid: import("react").ForwardRefExoticComponent<JSX.XplGrid & Omit<import("react").HTMLAttributes<HTMLXplGridElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplGridElement>>;
|
|
27
|
-
export declare const XplGridItem: import("react").ForwardRefExoticComponent<JSX.XplGridItem & Omit<import("react").HTMLAttributes<HTMLXplGridItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplGridItemElement>>;
|
|
28
|
-
export declare const XplHeaderAccordion: import("react").ForwardRefExoticComponent<JSX.XplHeaderAccordion & Omit<import("react").HTMLAttributes<HTMLXplHeaderAccordionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplHeaderAccordionElement>>;
|
|
29
|
-
export declare const XplIcon: import("react").ForwardRefExoticComponent<JSX.XplIcon & Omit<import("react").HTMLAttributes<HTMLXplIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplIconElement>>;
|
|
30
|
-
export declare const XplInput: import("react").ForwardRefExoticComponent<JSX.XplInput & Omit<import("react").HTMLAttributes<HTMLXplInputElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputElement>>;
|
|
31
|
-
export declare const XplInputColor: import("react").ForwardRefExoticComponent<JSX.XplInputColor & Omit<import("react").HTMLAttributes<HTMLXplInputColorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputColorElement>>;
|
|
32
|
-
export declare const XplInputDate: import("react").ForwardRefExoticComponent<JSX.XplInputDate & Omit<import("react").HTMLAttributes<HTMLXplInputDateElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputDateElement>>;
|
|
33
|
-
export declare const XplInputFile: import("react").ForwardRefExoticComponent<JSX.XplInputFile & Omit<import("react").HTMLAttributes<HTMLXplInputFileElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputFileElement>>;
|
|
34
|
-
export declare const XplInputPhone: import("react").ForwardRefExoticComponent<JSX.XplInputPhone & Omit<import("react").HTMLAttributes<HTMLXplInputPhoneElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputPhoneElement>>;
|
|
35
|
-
export declare const XplInputSearch: import("react").ForwardRefExoticComponent<JSX.XplInputSearch & Omit<import("react").HTMLAttributes<HTMLXplInputSearchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputSearchElement>>;
|
|
36
|
-
export declare const XplInputTime: import("react").ForwardRefExoticComponent<JSX.XplInputTime & Omit<import("react").HTMLAttributes<HTMLXplInputTimeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplInputTimeElement>>;
|
|
37
|
-
export declare const XplLargeCard: import("react").ForwardRefExoticComponent<JSX.XplLargeCard & Omit<import("react").HTMLAttributes<HTMLXplLargeCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplLargeCardElement>>;
|
|
38
|
-
export declare const XplList: import("react").ForwardRefExoticComponent<JSX.XplList & Omit<import("react").HTMLAttributes<HTMLXplListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplListElement>>;
|
|
39
|
-
export declare const XplListItem: import("react").ForwardRefExoticComponent<JSX.XplListItem & Omit<import("react").HTMLAttributes<HTMLXplListItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplListItemElement>>;
|
|
40
|
-
export declare const XplMainNav: import("react").ForwardRefExoticComponent<JSX.XplMainNav & Omit<import("react").HTMLAttributes<HTMLXplMainNavElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplMainNavElement>>;
|
|
41
|
-
export declare const XplModal: import("react").ForwardRefExoticComponent<JSX.XplModal & Omit<import("react").HTMLAttributes<HTMLXplModalElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplModalElement>>;
|
|
42
|
-
export declare const XplNavHeaderMenu: import("react").ForwardRefExoticComponent<JSX.XplNavHeaderMenu & Omit<import("react").HTMLAttributes<HTMLXplNavHeaderMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplNavHeaderMenuElement>>;
|
|
43
|
-
export declare const XplNavItem: import("react").ForwardRefExoticComponent<JSX.XplNavItem & Omit<import("react").HTMLAttributes<HTMLXplNavItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplNavItemElement>>;
|
|
44
|
-
export declare const XplPagination: import("react").ForwardRefExoticComponent<JSX.XplPagination & Omit<import("react").HTMLAttributes<HTMLXplPaginationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplPaginationElement>>;
|
|
45
|
-
export declare const XplPanel: import("react").ForwardRefExoticComponent<JSX.XplPanel & Omit<import("react").HTMLAttributes<HTMLXplPanelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplPanelElement>>;
|
|
46
|
-
export declare const XplPopover: import("react").ForwardRefExoticComponent<JSX.XplPopover & Omit<import("react").HTMLAttributes<HTMLXplPopoverElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplPopoverElement>>;
|
|
47
|
-
export declare const XplProgressBar: import("react").ForwardRefExoticComponent<JSX.XplProgressBar & Omit<import("react").HTMLAttributes<HTMLXplProgressBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplProgressBarElement>>;
|
|
48
|
-
export declare const XplProgressIndicator: import("react").ForwardRefExoticComponent<JSX.XplProgressIndicator & Omit<import("react").HTMLAttributes<HTMLXplProgressIndicatorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplProgressIndicatorElement>>;
|
|
49
|
-
export declare const XplRadio: import("react").ForwardRefExoticComponent<JSX.XplRadio & Omit<import("react").HTMLAttributes<HTMLXplRadioElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplRadioElement>>;
|
|
50
|
-
export declare const XplSecondaryNav: import("react").ForwardRefExoticComponent<JSX.XplSecondaryNav & Omit<import("react").HTMLAttributes<HTMLXplSecondaryNavElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSecondaryNavElement>>;
|
|
51
|
-
export declare const XplSelect: import("react").ForwardRefExoticComponent<JSX.XplSelect & Omit<import("react").HTMLAttributes<HTMLXplSelectElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSelectElement>>;
|
|
52
|
-
export declare const XplSideNav: import("react").ForwardRefExoticComponent<JSX.XplSideNav & Omit<import("react").HTMLAttributes<HTMLXplSideNavElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSideNavElement>>;
|
|
53
|
-
export declare const XplSideNavItem: import("react").ForwardRefExoticComponent<JSX.XplSideNavItem & Omit<import("react").HTMLAttributes<HTMLXplSideNavItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSideNavItemElement>>;
|
|
54
|
-
export declare const XplSkeleton: import("react").ForwardRefExoticComponent<JSX.XplSkeleton & Omit<import("react").HTMLAttributes<HTMLXplSkeletonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSkeletonElement>>;
|
|
55
|
-
export declare const XplSlideout: import("react").ForwardRefExoticComponent<JSX.XplSlideout & Omit<import("react").HTMLAttributes<HTMLXplSlideoutElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSlideoutElement>>;
|
|
56
|
-
export declare const XplSpotlight: import("react").ForwardRefExoticComponent<JSX.XplSpotlight & Omit<import("react").HTMLAttributes<HTMLXplSpotlightElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplSpotlightElement>>;
|
|
57
|
-
export declare const XplTab: import("react").ForwardRefExoticComponent<JSX.XplTab & Omit<import("react").HTMLAttributes<HTMLXplTabElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTabElement>>;
|
|
58
|
-
export declare const XplTabPanel: import("react").ForwardRefExoticComponent<JSX.XplTabPanel & Omit<import("react").HTMLAttributes<HTMLXplTabPanelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTabPanelElement>>;
|
|
59
|
-
export declare const XplTable: import("react").ForwardRefExoticComponent<JSX.XplTable & Omit<import("react").HTMLAttributes<HTMLXplTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTableElement>>;
|
|
60
|
-
export declare const XplTableHeader: import("react").ForwardRefExoticComponent<JSX.XplTableHeader & Omit<import("react").HTMLAttributes<HTMLXplTableHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTableHeaderElement>>;
|
|
61
|
-
export declare const XplTableHeaderCell: import("react").ForwardRefExoticComponent<JSX.XplTableHeaderCell & Omit<import("react").HTMLAttributes<HTMLXplTableHeaderCellElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTableHeaderCellElement>>;
|
|
62
|
-
export declare const XplTabs: import("react").ForwardRefExoticComponent<JSX.XplTabs & Omit<import("react").HTMLAttributes<HTMLXplTabsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTabsElement>>;
|
|
63
|
-
export declare const XplTag: import("react").ForwardRefExoticComponent<JSX.XplTag & Omit<import("react").HTMLAttributes<HTMLXplTagElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTagElement>>;
|
|
64
|
-
export declare const XplToast: import("react").ForwardRefExoticComponent<JSX.XplToast & Omit<import("react").HTMLAttributes<HTMLXplToastElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplToastElement>>;
|
|
65
|
-
export declare const XplToggle: import("react").ForwardRefExoticComponent<JSX.XplToggle & Omit<import("react").HTMLAttributes<HTMLXplToggleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplToggleElement>>;
|
|
66
|
-
export declare const XplToolbar: import("react").ForwardRefExoticComponent<JSX.XplToolbar & Omit<import("react").HTMLAttributes<HTMLXplToolbarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplToolbarElement>>;
|
|
67
|
-
export declare const XplTooltip: import("react").ForwardRefExoticComponent<JSX.XplTooltip & Omit<import("react").HTMLAttributes<HTMLXplTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTooltipElement>>;
|
|
68
|
-
export declare const XplTopNav: import("react").ForwardRefExoticComponent<JSX.XplTopNav & Omit<import("react").HTMLAttributes<HTMLXplTopNavElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTopNavElement>>;
|
|
69
|
-
export declare const XplTopNavItem: import("react").ForwardRefExoticComponent<JSX.XplTopNavItem & Omit<import("react").HTMLAttributes<HTMLXplTopNavItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplTopNavItemElement>>;
|
|
70
|
-
export declare const XplUtilityBar: import("react").ForwardRefExoticComponent<JSX.XplUtilityBar & Omit<import("react").HTMLAttributes<HTMLXplUtilityBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplUtilityBarElement>>;
|
package/dist/components.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createReactComponent } from './react-component-lib';
|
|
2
|
-
import { defineCustomElements } from '@xplortech/apollo-core/loader';
|
|
3
|
-
defineCustomElements();
|
|
4
|
-
export const XplAccordion = createReactComponent('xpl-accordion');
|
|
5
|
-
export const XplApplicationShell = createReactComponent('xpl-application-shell');
|
|
6
|
-
export const XplAvatar = createReactComponent('xpl-avatar');
|
|
7
|
-
export const XplBackdrop = createReactComponent('xpl-backdrop');
|
|
8
|
-
export const XplBadge = createReactComponent('xpl-badge');
|
|
9
|
-
export const XplBanner = createReactComponent('xpl-banner');
|
|
10
|
-
export const XplBreadcrumbItem = createReactComponent('xpl-breadcrumb-item');
|
|
11
|
-
export const XplBreadcrumbs = createReactComponent('xpl-breadcrumbs');
|
|
12
|
-
export const XplButton = createReactComponent('xpl-button');
|
|
13
|
-
export const XplButtonRow = createReactComponent('xpl-button-row');
|
|
14
|
-
export const XplCalendar = createReactComponent('xpl-calendar');
|
|
15
|
-
export const XplCheckbox = createReactComponent('xpl-checkbox');
|
|
16
|
-
export const XplChoicelist = createReactComponent('xpl-choicelist');
|
|
17
|
-
export const XplContentArea = createReactComponent('xpl-content-area');
|
|
18
|
-
export const XplDashboard = createReactComponent('xpl-dashboard');
|
|
19
|
-
export const XplDataCard = createReactComponent('xpl-data-card');
|
|
20
|
-
export const XplDivider = createReactComponent('xpl-divider');
|
|
21
|
-
export const XplDropdown = createReactComponent('xpl-dropdown');
|
|
22
|
-
export const XplDropdownGroup = createReactComponent('xpl-dropdown-group');
|
|
23
|
-
export const XplDropdownHeading = createReactComponent('xpl-dropdown-heading');
|
|
24
|
-
export const XplDropdownOption = createReactComponent('xpl-dropdown-option');
|
|
25
|
-
export const XplDynamicTable = createReactComponent('xpl-dynamic-table');
|
|
26
|
-
export const XplDynamicTableCell = createReactComponent('xpl-dynamic-table-cell');
|
|
27
|
-
export const XplDynamicTableRow = createReactComponent('xpl-dynamic-table-row');
|
|
28
|
-
export const XplGrid = createReactComponent('xpl-grid');
|
|
29
|
-
export const XplGridItem = createReactComponent('xpl-grid-item');
|
|
30
|
-
export const XplHeaderAccordion = createReactComponent('xpl-header-accordion');
|
|
31
|
-
export const XplIcon = createReactComponent('xpl-icon');
|
|
32
|
-
export const XplInput = createReactComponent('xpl-input');
|
|
33
|
-
export const XplInputColor = createReactComponent('xpl-input-color');
|
|
34
|
-
export const XplInputDate = createReactComponent('xpl-input-date');
|
|
35
|
-
export const XplInputFile = createReactComponent('xpl-input-file');
|
|
36
|
-
export const XplInputPhone = createReactComponent('xpl-input-phone');
|
|
37
|
-
export const XplInputSearch = createReactComponent('xpl-input-search');
|
|
38
|
-
export const XplInputTime = createReactComponent('xpl-input-time');
|
|
39
|
-
export const XplLargeCard = createReactComponent('xpl-large-card');
|
|
40
|
-
export const XplList = createReactComponent('xpl-list');
|
|
41
|
-
export const XplListItem = createReactComponent('xpl-list-item');
|
|
42
|
-
export const XplMainNav = createReactComponent('xpl-main-nav');
|
|
43
|
-
export const XplModal = createReactComponent('xpl-modal');
|
|
44
|
-
export const XplNavHeaderMenu = createReactComponent('xpl-nav-header-menu');
|
|
45
|
-
export const XplNavItem = createReactComponent('xpl-nav-item');
|
|
46
|
-
export const XplPagination = createReactComponent('xpl-pagination');
|
|
47
|
-
export const XplPanel = createReactComponent('xpl-panel');
|
|
48
|
-
export const XplPopover = createReactComponent('xpl-popover');
|
|
49
|
-
export const XplProgressBar = createReactComponent('xpl-progress-bar');
|
|
50
|
-
export const XplProgressIndicator = createReactComponent('xpl-progress-indicator');
|
|
51
|
-
export const XplRadio = createReactComponent('xpl-radio');
|
|
52
|
-
export const XplSecondaryNav = createReactComponent('xpl-secondary-nav');
|
|
53
|
-
export const XplSelect = createReactComponent('xpl-select');
|
|
54
|
-
export const XplSideNav = createReactComponent('xpl-side-nav');
|
|
55
|
-
export const XplSideNavItem = createReactComponent('xpl-side-nav-item');
|
|
56
|
-
export const XplSkeleton = createReactComponent('xpl-skeleton');
|
|
57
|
-
export const XplSlideout = createReactComponent('xpl-slideout');
|
|
58
|
-
export const XplSpotlight = createReactComponent('xpl-spotlight');
|
|
59
|
-
export const XplTab = createReactComponent('xpl-tab');
|
|
60
|
-
export const XplTabPanel = createReactComponent('xpl-tab-panel');
|
|
61
|
-
export const XplTable = createReactComponent('xpl-table');
|
|
62
|
-
export const XplTableHeader = createReactComponent('xpl-table-header');
|
|
63
|
-
export const XplTableHeaderCell = createReactComponent('xpl-table-header-cell');
|
|
64
|
-
export const XplTabs = createReactComponent('xpl-tabs');
|
|
65
|
-
export const XplTag = createReactComponent('xpl-tag');
|
|
66
|
-
export const XplToast = createReactComponent('xpl-toast');
|
|
67
|
-
export const XplToggle = createReactComponent('xpl-toggle');
|
|
68
|
-
export const XplToolbar = createReactComponent('xpl-toolbar');
|
|
69
|
-
export const XplTooltip = createReactComponent('xpl-tooltip');
|
|
70
|
-
export const XplTopNav = createReactComponent('xpl-top-nav');
|
|
71
|
-
export const XplTopNavItem = createReactComponent('xpl-top-nav-item');
|
|
72
|
-
export const XplUtilityBar = createReactComponent('xpl-utility-bar');
|
|
73
|
-
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,oBAAoB,EAAE,CAAC;AACvB,MAAM,CAAC,MAAM,YAAY,GAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,MAAM,CAAC,MAAM,mBAAmB,GAAgB,oBAAoB,CAA0D,uBAAuB,CAAC,CAAC;AACvJ,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,WAAW,GAAgB,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,iBAAiB,GAAgB,oBAAoB,CAAsD,qBAAqB,CAAC,CAAC;AAC/I,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,iBAAiB,CAAC,CAAC;AAClI,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,YAAY,GAAgB,oBAAoB,CAA4C,gBAAgB,C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AAM,OAAO,GAAgB,oBAAoB,CAAkC,UAAU,CAAC,CAAC;AACtG,MAAM,CAAC,MAAM,MAAM,GAAgB,oBAAoB,CAAgC,SAAS,CAAC,CAAC;AAClG,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,UAAU,GAAgB,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,MAAM,UAAU,GAAgB,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,aAAa,CAAC,CAAC;AAC/G,MAAM,CAAC,MAAM,aAAa,GAAgB,oBAAoB,CAA8C,kBAAkB,CAAC,CAAC;AAChI,MAAM,CAAC,MAAM,aAAa,GAAgB,oBAAoB,CAA8C,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface HTMLStencilElement extends HTMLElement {
|
|
3
|
-
componentOnReady(): Promise<this>;
|
|
4
|
-
}
|
|
5
|
-
interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
|
|
6
|
-
forwardedRef: React.RefObject<ElementType>;
|
|
7
|
-
ref?: React.Ref<any>;
|
|
8
|
-
}
|
|
9
|
-
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
10
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
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, { createElement } from 'react';
|
|
13
|
-
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
14
|
-
export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
|
|
15
|
-
if (defineCustomElement !== undefined) {
|
|
16
|
-
defineCustomElement();
|
|
17
|
-
}
|
|
18
|
-
const displayName = dashToPascalCase(tagName);
|
|
19
|
-
const ReactComponent = class extends React.Component {
|
|
20
|
-
constructor(props) {
|
|
21
|
-
super(props);
|
|
22
|
-
this.setComponentElRef = (element) => {
|
|
23
|
-
this.componentEl = element;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
componentDidMount() {
|
|
27
|
-
this.componentDidUpdate(this.props);
|
|
28
|
-
}
|
|
29
|
-
componentDidUpdate(prevProps) {
|
|
30
|
-
attachProps(this.componentEl, this.props, prevProps);
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
34
|
-
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
35
|
-
const value = cProps[name];
|
|
36
|
-
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
37
|
-
const eventName = name.substring(2).toLowerCase();
|
|
38
|
-
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
39
|
-
acc[name] = value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const type = typeof value;
|
|
44
|
-
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
45
|
-
acc[camelToDashCase(name)] = value;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return acc;
|
|
49
|
-
}, {});
|
|
50
|
-
if (manipulatePropsFunction) {
|
|
51
|
-
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
52
|
-
}
|
|
53
|
-
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
|
|
54
|
-
return createElement(tagName, newProps, children);
|
|
55
|
-
}
|
|
56
|
-
static get displayName() {
|
|
57
|
-
return displayName;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
if (ReactComponentContext) {
|
|
61
|
-
ReactComponent.contextType = ReactComponentContext;
|
|
62
|
-
}
|
|
63
|
-
return createForwardRef(ReactComponent, displayName);
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=createComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWxH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAMlC,OAAe,EACf,qBAAuD,EACvD,uBAGuB,EACvB,mBAAgC,EAChC,EAAE;IACF,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,mBAAmB,EAAE,CAAC;I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BACH,CAAC;qBAAM,CAAC;oBAGN,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;oBAE1B,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;wBACjE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;oBACrC,CAAC;gBACH,CAAC;gBACD,OAAO,GAAG,CAAC;YACb,CAAC,EAAE,EAAwB,CAAC,CAAC;YAE7B,IAAI,uBAAuB,EAAE,CAAC;gBAC5B,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACjE,CAAC;YAED,MAAM,QAAQ,mCACT,WAAW,KACd,GAAG,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,EACpD,KAAK,GACN,CAAC;YASF,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,KAAK,WAAW;YACpB,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAGF,IAAI,qBAAqB,EAAE,CAAC;QAC1B,cAAc,CAAC,WAAW,GAAG,qBAAqB,CAAC;IACrD,CAAC;IAED,OAAO,gBAAgB,CAAwB,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9E,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { OverlayEventDetail } from './interfaces';
|
|
3
|
-
import { StencilReactForwardedRef } from './utils';
|
|
4
|
-
interface OverlayElement extends HTMLElement {
|
|
5
|
-
present: () => Promise<void>;
|
|
6
|
-
dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
|
|
7
|
-
}
|
|
8
|
-
export interface ReactOverlayProps {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
isOpen: boolean;
|
|
11
|
-
onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
12
|
-
onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
13
|
-
onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
14
|
-
onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
15
|
-
}
|
|
16
|
-
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
|
|
17
|
-
create: (options: any) => Promise<OverlayType>;
|
|
18
|
-
}, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
19
|
-
forwardedRef?: StencilReactForwardedRef<OverlayType>;
|
|
20
|
-
}> & React.RefAttributes<OverlayType>>;
|
|
21
|
-
export {};
|
|
@@ -1,86 +0,0 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import ReactDOM from 'react-dom';
|
|
15
|
-
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
16
|
-
export const createOverlayComponent = (tagName, controller, customElement) => {
|
|
17
|
-
defineCustomElement(tagName, customElement);
|
|
18
|
-
const displayName = dashToPascalCase(tagName);
|
|
19
|
-
const didDismissEventName = `on${displayName}DidDismiss`;
|
|
20
|
-
const didPresentEventName = `on${displayName}DidPresent`;
|
|
21
|
-
const willDismissEventName = `on${displayName}WillDismiss`;
|
|
22
|
-
const willPresentEventName = `on${displayName}WillPresent`;
|
|
23
|
-
let isDismissing = false;
|
|
24
|
-
class Overlay extends React.Component {
|
|
25
|
-
constructor(props) {
|
|
26
|
-
super(props);
|
|
27
|
-
if (typeof document !== 'undefined') {
|
|
28
|
-
this.el = document.createElement('div');
|
|
29
|
-
}
|
|
30
|
-
this.handleDismiss = this.handleDismiss.bind(this);
|
|
31
|
-
}
|
|
32
|
-
static get displayName() {
|
|
33
|
-
return displayName;
|
|
34
|
-
}
|
|
35
|
-
componentDidMount() {
|
|
36
|
-
if (this.props.isOpen) {
|
|
37
|
-
this.present();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
componentWillUnmount() {
|
|
41
|
-
if (this.overlay) {
|
|
42
|
-
this.overlay.dismiss();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
handleDismiss(event) {
|
|
46
|
-
if (this.props.onDidDismiss) {
|
|
47
|
-
this.props.onDidDismiss(event);
|
|
48
|
-
}
|
|
49
|
-
setRef(this.props.forwardedRef, null);
|
|
50
|
-
}
|
|
51
|
-
shouldComponentUpdate(nextProps) {
|
|
52
|
-
if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
|
|
53
|
-
isDismissing = true;
|
|
54
|
-
}
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
async componentDidUpdate(prevProps) {
|
|
58
|
-
if (this.overlay) {
|
|
59
|
-
attachProps(this.overlay, this.props, prevProps);
|
|
60
|
-
}
|
|
61
|
-
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
|
|
62
|
-
this.present(prevProps);
|
|
63
|
-
}
|
|
64
|
-
if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
|
|
65
|
-
await this.overlay.dismiss();
|
|
66
|
-
isDismissing = false;
|
|
67
|
-
this.forceUpdate();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async present(prevProps) {
|
|
71
|
-
const _a = this.props, { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent } = _a, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
|
|
72
|
-
const elementProps = Object.assign(Object.assign({}, cProps), { ref: this.props.forwardedRef, [didDismissEventName]: this.handleDismiss, [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e), [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e), [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e) });
|
|
73
|
-
this.overlay = await controller.create(Object.assign(Object.assign({}, elementProps), { component: this.el, componentProps: {} }));
|
|
74
|
-
setRef(this.props.forwardedRef, this.overlay);
|
|
75
|
-
attachProps(this.overlay, elementProps, prevProps);
|
|
76
|
-
await this.overlay.present();
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return React.forwardRef((props, ref) => {
|
|
83
|
-
return _jsx(Overlay, Object.assign({}, props, { forwardedRef: ref }));
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=createOverlayComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EAA4B,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAgB/G,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,UAA8D,EAC9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;AACL,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface EventEmitter<T = any> {
|
|
2
|
-
emit: (data?: T) => CustomEvent<T>;
|
|
3
|
-
}
|
|
4
|
-
export interface StyleReactProps {
|
|
5
|
-
class?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
style?: {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export interface OverlayEventDetail<T = any> {
|
|
12
|
-
data?: T;
|
|
13
|
-
role?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface OverlayInterface {
|
|
16
|
-
el: HTMLElement;
|
|
17
|
-
animated: boolean;
|
|
18
|
-
keyboardClose: boolean;
|
|
19
|
-
overlayIndex: number;
|
|
20
|
-
presented: boolean;
|
|
21
|
-
enterAnimation?: any;
|
|
22
|
-
leaveAnimation?: any;
|
|
23
|
-
didPresent: EventEmitter<void>;
|
|
24
|
-
willPresent: EventEmitter<void>;
|
|
25
|
-
willDismiss: EventEmitter<OverlayEventDetail>;
|
|
26
|
-
didDismiss: EventEmitter<OverlayEventDetail>;
|
|
27
|
-
present(): Promise<void>;
|
|
28
|
-
dismiss(data?: any, role?: string): Promise<boolean>;
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/react-component-lib/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
|
-
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
|
3
|
-
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
|
4
|
-
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
|
5
|
-
export declare const syncEvent: (node: Element & {
|
|
6
|
-
__events?: {
|
|
7
|
-
[key: string]: ((e: Event) => any) | undefined;
|
|
8
|
-
};
|
|
9
|
-
}, eventName: string, newEventHandler?: (e: Event) => any) => void;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { camelToDashCase } from './case';
|
|
2
|
-
export const attachProps = (node, newProps, oldProps = {}) => {
|
|
3
|
-
if (node instanceof Element) {
|
|
4
|
-
const className = getClassName(node.classList, newProps, oldProps);
|
|
5
|
-
if (className !== '') {
|
|
6
|
-
node.className = className;
|
|
7
|
-
}
|
|
8
|
-
Object.keys(newProps).forEach((name) => {
|
|
9
|
-
if (name === 'children' ||
|
|
10
|
-
name === 'style' ||
|
|
11
|
-
name === 'ref' ||
|
|
12
|
-
name === 'class' ||
|
|
13
|
-
name === 'className' ||
|
|
14
|
-
name === 'forwardedRef') {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
18
|
-
const eventName = name.substring(2);
|
|
19
|
-
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
20
|
-
if (!isCoveredByReact(eventNameLc)) {
|
|
21
|
-
syncEvent(node, eventNameLc, newProps[name]);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
node[name] = newProps[name];
|
|
26
|
-
const propType = typeof newProps[name];
|
|
27
|
-
if (propType === 'string') {
|
|
28
|
-
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
export const getClassName = (classList, newProps, oldProps) => {
|
|
35
|
-
const newClassProp = newProps.className || newProps.class;
|
|
36
|
-
const oldClassProp = oldProps.className || oldProps.class;
|
|
37
|
-
const currentClasses = arrayToMap(classList);
|
|
38
|
-
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
39
|
-
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
40
|
-
const finalClassNames = [];
|
|
41
|
-
currentClasses.forEach((currentClass) => {
|
|
42
|
-
if (incomingPropClasses.has(currentClass)) {
|
|
43
|
-
finalClassNames.push(currentClass);
|
|
44
|
-
incomingPropClasses.delete(currentClass);
|
|
45
|
-
}
|
|
46
|
-
else if (!oldPropClasses.has(currentClass)) {
|
|
47
|
-
finalClassNames.push(currentClass);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
51
|
-
return finalClassNames.join(' ');
|
|
52
|
-
};
|
|
53
|
-
export const transformReactEventName = (eventNameSuffix) => {
|
|
54
|
-
switch (eventNameSuffix) {
|
|
55
|
-
case 'doubleclick':
|
|
56
|
-
return 'dblclick';
|
|
57
|
-
}
|
|
58
|
-
return eventNameSuffix;
|
|
59
|
-
};
|
|
60
|
-
export const isCoveredByReact = (eventNameSuffix) => {
|
|
61
|
-
if (typeof document === 'undefined') {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
const eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
66
|
-
let isSupported = eventName in document;
|
|
67
|
-
if (!isSupported) {
|
|
68
|
-
const element = document.createElement('div');
|
|
69
|
-
element.setAttribute(eventName, 'return;');
|
|
70
|
-
isSupported = typeof element[eventName] === 'function';
|
|
71
|
-
}
|
|
72
|
-
return isSupported;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
export const syncEvent = (node, eventName, newEventHandler) => {
|
|
76
|
-
const eventStore = node.__events || (node.__events = {});
|
|
77
|
-
const oldEventHandler = eventStore[eventName];
|
|
78
|
-
if (oldEventHandler) {
|
|
79
|
-
node.removeEventListener(eventName, oldEventHandler);
|
|
80
|
-
}
|
|
81
|
-
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
|
82
|
-
if (newEventHandler) {
|
|
83
|
-
newEventHandler.call(this, e);
|
|
84
|
-
}
|
|
85
|
-
}));
|
|
86
|
-
};
|
|
87
|
-
const arrayToMap = (arr) => {
|
|
88
|
-
const map = new Map();
|
|
89
|
-
arr.forEach((s) => map.set(s, s));
|
|
90
|
-
return map;
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=attachProps.js.map
|