@xplortech/apollo-react 1.0.0-beta.7.1 → 2.4.2
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/README.md +5 -15
- package/css/.gitkeep +0 -0
- package/css/apollo.css +6822 -0
- package/dist/components.d.ts +27 -1
- package/dist/components.js +57 -33
- package/dist/components.js.map +1 -1
- package/dist/react-component-lib/createComponent.d.ts +1 -1
- package/dist/react-component-lib/createComponent.js +15 -9
- package/dist/react-component-lib/createComponent.js.map +1 -1
- package/dist/react-component-lib/createOverlayComponent.d.ts +5 -4
- package/dist/react-component-lib/createOverlayComponent.js +18 -10
- package/dist/react-component-lib/createOverlayComponent.js.map +1 -1
- package/dist/react-component-lib/utils/attachProps.d.ts +3 -6
- package/dist/react-component-lib/utils/attachProps.js +21 -25
- package/dist/react-component-lib/utils/attachProps.js.map +1 -1
- package/dist/react-component-lib/utils/case.js.map +1 -1
- package/dist/react-component-lib/utils/dev.js.map +1 -1
- package/dist/react-component-lib/utils/index.d.ts +4 -1
- package/dist/react-component-lib/utils/index.js +14 -4
- package/dist/react-component-lib/utils/index.js.map +1 -1
- package/package.json +59 -13
- /package/{licence → LICENSE} +0 -0
package/dist/components.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
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
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
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
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>>;
|
|
@@ -8,25 +8,51 @@ export declare const XplBreadcrumbItem: import("react").ForwardRefExoticComponen
|
|
|
8
8
|
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>>;
|
|
9
9
|
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>>;
|
|
10
10
|
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>>;
|
|
11
|
+
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>>;
|
|
11
12
|
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>>;
|
|
12
13
|
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>>;
|
|
13
14
|
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>>;
|
|
15
|
+
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>>;
|
|
16
|
+
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>>;
|
|
14
17
|
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>>;
|
|
15
18
|
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>>;
|
|
16
19
|
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>>;
|
|
17
20
|
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>>;
|
|
18
21
|
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>>;
|
|
22
|
+
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>>;
|
|
23
|
+
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>>;
|
|
24
|
+
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>>;
|
|
19
25
|
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>>;
|
|
20
26
|
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>>;
|
|
27
|
+
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>>;
|
|
28
|
+
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>>;
|
|
21
29
|
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>>;
|
|
30
|
+
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>>;
|
|
31
|
+
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>>;
|
|
32
|
+
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>>;
|
|
33
|
+
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>>;
|
|
34
|
+
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>>;
|
|
22
35
|
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>>;
|
|
23
36
|
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>>;
|
|
37
|
+
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>>;
|
|
24
38
|
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>>;
|
|
25
39
|
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>>;
|
|
40
|
+
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>>;
|
|
41
|
+
export declare const XplProgress: import("react").ForwardRefExoticComponent<JSX.XplProgress & Omit<import("react").HTMLAttributes<HTMLXplProgressElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLXplProgressElement>>;
|
|
26
42
|
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>>;
|
|
27
43
|
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>>;
|
|
28
44
|
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>>;
|
|
45
|
+
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>>;
|
|
46
|
+
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>>;
|
|
47
|
+
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>>;
|
|
48
|
+
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>>;
|
|
29
49
|
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>>;
|
|
50
|
+
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>>;
|
|
51
|
+
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>>;
|
|
52
|
+
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>>;
|
|
30
53
|
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>>;
|
|
54
|
+
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>>;
|
|
31
55
|
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>>;
|
|
56
|
+
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>>;
|
|
57
|
+
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>>;
|
|
32
58
|
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
CHANGED
|
@@ -1,37 +1,61 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* auto-generated react proxies */
|
|
4
1
|
import { createReactComponent } from './react-component-lib';
|
|
5
2
|
import { defineCustomElements } from '@xplortech/apollo-core/loader';
|
|
6
3
|
defineCustomElements();
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
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 XplBreadcrumbItem = createReactComponent('xpl-breadcrumb-item');
|
|
10
|
+
export const XplBreadcrumbs = createReactComponent('xpl-breadcrumbs');
|
|
11
|
+
export const XplButton = createReactComponent('xpl-button');
|
|
12
|
+
export const XplButtonRow = createReactComponent('xpl-button-row');
|
|
13
|
+
export const XplCalendar = createReactComponent('xpl-calendar');
|
|
14
|
+
export const XplCheckbox = createReactComponent('xpl-checkbox');
|
|
15
|
+
export const XplChoicelist = createReactComponent('xpl-choicelist');
|
|
16
|
+
export const XplContentArea = createReactComponent('xpl-content-area');
|
|
17
|
+
export const XplDashboard = createReactComponent('xpl-dashboard');
|
|
18
|
+
export const XplDataCard = createReactComponent('xpl-data-card');
|
|
19
|
+
export const XplDivider = createReactComponent('xpl-divider');
|
|
20
|
+
export const XplDropdown = createReactComponent('xpl-dropdown');
|
|
21
|
+
export const XplDropdownGroup = createReactComponent('xpl-dropdown-group');
|
|
22
|
+
export const XplDropdownHeading = createReactComponent('xpl-dropdown-heading');
|
|
23
|
+
export const XplDropdownOption = createReactComponent('xpl-dropdown-option');
|
|
24
|
+
export const XplDynamicTable = createReactComponent('xpl-dynamic-table');
|
|
25
|
+
export const XplDynamicTableCell = createReactComponent('xpl-dynamic-table-cell');
|
|
26
|
+
export const XplDynamicTableRow = createReactComponent('xpl-dynamic-table-row');
|
|
27
|
+
export const XplGrid = createReactComponent('xpl-grid');
|
|
28
|
+
export const XplGridItem = createReactComponent('xpl-grid-item');
|
|
29
|
+
export const XplHeaderAccordion = createReactComponent('xpl-header-accordion');
|
|
30
|
+
export const XplIcon = createReactComponent('xpl-icon');
|
|
31
|
+
export const XplInput = createReactComponent('xpl-input');
|
|
32
|
+
export const XplInputColor = createReactComponent('xpl-input-color');
|
|
33
|
+
export const XplInputDate = createReactComponent('xpl-input-date');
|
|
34
|
+
export const XplInputFile = createReactComponent('xpl-input-file');
|
|
35
|
+
export const XplInputTime = createReactComponent('xpl-input-time');
|
|
36
|
+
export const XplLargeCard = createReactComponent('xpl-large-card');
|
|
37
|
+
export const XplList = createReactComponent('xpl-list');
|
|
38
|
+
export const XplMainNav = createReactComponent('xpl-main-nav');
|
|
39
|
+
export const XplModal = createReactComponent('xpl-modal');
|
|
40
|
+
export const XplNavItem = createReactComponent('xpl-nav-item');
|
|
41
|
+
export const XplPagination = createReactComponent('xpl-pagination');
|
|
42
|
+
export const XplPopover = createReactComponent('xpl-popover');
|
|
43
|
+
export const XplProgress = createReactComponent('xpl-progress');
|
|
44
|
+
export const XplRadio = createReactComponent('xpl-radio');
|
|
45
|
+
export const XplSecondaryNav = createReactComponent('xpl-secondary-nav');
|
|
46
|
+
export const XplSelect = createReactComponent('xpl-select');
|
|
47
|
+
export const XplSkeleton = createReactComponent('xpl-skeleton');
|
|
48
|
+
export const XplSlideout = createReactComponent('xpl-slideout');
|
|
49
|
+
export const XplTab = createReactComponent('xpl-tab');
|
|
50
|
+
export const XplTabPanel = createReactComponent('xpl-tab-panel');
|
|
51
|
+
export const XplTable = createReactComponent('xpl-table');
|
|
52
|
+
export const XplTableHeader = createReactComponent('xpl-table-header');
|
|
53
|
+
export const XplTableHeaderCell = createReactComponent('xpl-table-header-cell');
|
|
54
|
+
export const XplTabs = createReactComponent('xpl-tabs');
|
|
55
|
+
export const XplTag = createReactComponent('xpl-tag');
|
|
56
|
+
export const XplToast = createReactComponent('xpl-toast');
|
|
57
|
+
export const XplToggle = createReactComponent('xpl-toggle');
|
|
58
|
+
export const XplToolbar = createReactComponent('xpl-toolbar');
|
|
59
|
+
export const XplTooltip = createReactComponent('xpl-tooltip');
|
|
60
|
+
export const XplUtilityBar = createReactComponent('xpl-utility-bar');
|
|
37
61
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"
|
|
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,M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oB,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,aAAa,GAAgB,oBAAoB,CAA8C,iBAAiB,CAAC,CAAC"}
|
|
@@ -6,5 +6,5 @@ interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<El
|
|
|
6
6
|
forwardedRef: React.RefObject<ElementType>;
|
|
7
7
|
ref?: React.Ref<any>;
|
|
8
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) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
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
10
|
export {};
|
|
@@ -9,9 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { attachProps, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs
|
|
14
|
-
export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction) => {
|
|
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
|
+
}
|
|
15
18
|
const displayName = dashToPascalCase(tagName);
|
|
16
19
|
const ReactComponent = class extends React.Component {
|
|
17
20
|
constructor(props) {
|
|
@@ -29,28 +32,31 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
29
32
|
render() {
|
|
30
33
|
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
31
34
|
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
35
|
+
const value = cProps[name];
|
|
32
36
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
33
37
|
const eventName = name.substring(2).toLowerCase();
|
|
34
|
-
if (typeof document !== 'undefined' && isCoveredByReact(eventName
|
|
35
|
-
acc[name] =
|
|
38
|
+
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
39
|
+
acc[name] = value;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
else {
|
|
39
|
-
|
|
43
|
+
const type = typeof value;
|
|
44
|
+
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
45
|
+
acc[camelToDashCase(name)] = value;
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
return acc;
|
|
42
49
|
}, {});
|
|
43
50
|
if (manipulatePropsFunction) {
|
|
44
51
|
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
45
52
|
}
|
|
46
|
-
|
|
47
|
-
return
|
|
53
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
|
|
54
|
+
return createElement(tagName, newProps, children);
|
|
48
55
|
}
|
|
49
56
|
static get displayName() {
|
|
50
57
|
return displayName;
|
|
51
58
|
}
|
|
52
59
|
};
|
|
53
|
-
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
54
60
|
if (ReactComponentContext) {
|
|
55
61
|
ReactComponent.contextType = ReactComponentContext;
|
|
56
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
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;IACxB,CAAC;IAED,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,KAAM,SAAQ,KAAK,CAAC,SAAiD;QAO1F,YAAY,KAA6C;YACvD,KAAK,CAAC,KAAK,CAAC,CAAC;YALf,sBAAiB,GAAG,CAAC,OAAoB,EAAE,EAAE;gBAC3C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;YAC7B,C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;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,5 +1,6 @@
|
|
|
1
|
-
import { OverlayEventDetail } from './interfaces';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { OverlayEventDetail } from './interfaces';
|
|
3
|
+
import { StencilReactForwardedRef } from './utils';
|
|
3
4
|
interface OverlayElement extends HTMLElement {
|
|
4
5
|
present: () => Promise<void>;
|
|
5
6
|
dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
|
|
@@ -12,9 +13,9 @@ export interface ReactOverlayProps {
|
|
|
12
13
|
onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
13
14
|
onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
14
15
|
}
|
|
15
|
-
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(
|
|
16
|
+
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
|
|
16
17
|
create: (options: any) => Promise<OverlayType>;
|
|
17
|
-
}) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
18
|
-
forwardedRef?:
|
|
18
|
+
}, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
19
|
+
forwardedRef?: StencilReactForwardedRef<OverlayType>;
|
|
19
20
|
}> & React.RefAttributes<OverlayType>>;
|
|
20
21
|
export {};
|
|
@@ -12,16 +12,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import ReactDOM from 'react-dom';
|
|
15
|
-
import { attachProps } from './utils';
|
|
16
|
-
export const createOverlayComponent = (
|
|
15
|
+
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
16
|
+
export const createOverlayComponent = (tagName, controller, customElement) => {
|
|
17
|
+
defineCustomElement(tagName, customElement);
|
|
18
|
+
const displayName = dashToPascalCase(tagName);
|
|
17
19
|
const didDismissEventName = `on${displayName}DidDismiss`;
|
|
18
20
|
const didPresentEventName = `on${displayName}DidPresent`;
|
|
19
21
|
const willDismissEventName = `on${displayName}WillDismiss`;
|
|
20
22
|
const willPresentEventName = `on${displayName}WillPresent`;
|
|
23
|
+
let isDismissing = false;
|
|
21
24
|
class Overlay extends React.Component {
|
|
22
25
|
constructor(props) {
|
|
23
26
|
super(props);
|
|
24
|
-
|
|
27
|
+
if (typeof document !== 'undefined') {
|
|
28
|
+
this.el = document.createElement('div');
|
|
29
|
+
}
|
|
25
30
|
this.handleDismiss = this.handleDismiss.bind(this);
|
|
26
31
|
}
|
|
27
32
|
static get displayName() {
|
|
@@ -41,9 +46,13 @@ export const createOverlayComponent = (displayName, controller) => {
|
|
|
41
46
|
if (this.props.onDidDismiss) {
|
|
42
47
|
this.props.onDidDismiss(event);
|
|
43
48
|
}
|
|
44
|
-
|
|
45
|
-
|
|
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;
|
|
46
54
|
}
|
|
55
|
+
return true;
|
|
47
56
|
}
|
|
48
57
|
async componentDidUpdate(prevProps) {
|
|
49
58
|
if (this.overlay) {
|
|
@@ -54,24 +63,23 @@ export const createOverlayComponent = (displayName, controller) => {
|
|
|
54
63
|
}
|
|
55
64
|
if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
|
|
56
65
|
await this.overlay.dismiss();
|
|
66
|
+
isDismissing = false;
|
|
67
|
+
this.forceUpdate();
|
|
57
68
|
}
|
|
58
69
|
}
|
|
59
70
|
async present(prevProps) {
|
|
60
71
|
const _a = this.props, { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent } = _a, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
|
|
61
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) });
|
|
62
73
|
this.overlay = await controller.create(Object.assign(Object.assign({}, elementProps), { component: this.el, componentProps: {} }));
|
|
63
|
-
|
|
64
|
-
this.props.forwardedRef.current = this.overlay;
|
|
65
|
-
}
|
|
74
|
+
setRef(this.props.forwardedRef, this.overlay);
|
|
66
75
|
attachProps(this.overlay, elementProps, prevProps);
|
|
67
76
|
await this.overlay.present();
|
|
68
77
|
}
|
|
69
78
|
render() {
|
|
70
|
-
return ReactDOM.createPortal(this.props.isOpen ? this.props.children : null, this.el);
|
|
79
|
+
return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
82
|
return React.forwardRef((props, ref) => {
|
|
74
|
-
// @ts-ignore
|
|
75
83
|
return _jsx(Overlay, Object.assign({}, props, { forwardedRef: ref }));
|
|
76
84
|
});
|
|
77
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;
|
|
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,EAC9D,aAAmB,EACnB,EAAE;IACF,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,mBAAmB,GAAG,KAAK,WAAW,YAAY,CAAC;IACzD,MAAM,mBAAmB,GAAG,KAAK,WAAW,YAAY,CAAC;IACzD,MAAM,oBAAoB,GAAG,KAAK,WAAW,aAAa,CAAC;IAC3D,MAAM,oBAAoB,GAAG,KAAK,WAAW,aAAa,CAAC;IAO3D,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,MAAM,OAAQ,SAAQ,KAAK,CAAC,SAAgB;QAI1C,YAAY,KAAY;YACtB,KAAK,CAAC,KAAK,CAAC,CAAC;YACb,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;gBACpC,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YA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AE,EAAE,IAClB,CAAC;YAEH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9C,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;YAEnD,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC/B,CAAC;QAED,MAAM;YAMJ,OAAO,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;KACF;IAED,OAAO,KAAK,CAAC,UAAU,CAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACzD,OAAO,KAAC,OAAO,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
2
|
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
6
|
-
*/
|
|
7
|
-
export declare const isCoveredByReact: (eventNameSuffix: string, doc: Document) => boolean;
|
|
3
|
+
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
|
4
|
+
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
|
8
5
|
export declare const syncEvent: (node: Element & {
|
|
9
6
|
__events?: {
|
|
10
|
-
[key: string]: (e: Event) => any;
|
|
7
|
+
[key: string]: ((e: Event) => any) | undefined;
|
|
11
8
|
};
|
|
12
9
|
}, eventName: string, newEventHandler?: (e: Event) => any) => void;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { camelToDashCase } from './case';
|
|
2
2
|
export const attachProps = (node, newProps, oldProps = {}) => {
|
|
3
|
-
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
4
3
|
if (node instanceof Element) {
|
|
5
|
-
// add any classes in className to the class list
|
|
6
4
|
const className = getClassName(node.classList, newProps, oldProps);
|
|
7
5
|
if (className !== '') {
|
|
8
6
|
node.className = className;
|
|
@@ -19,7 +17,7 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
19
17
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
20
18
|
const eventName = name.substring(2);
|
|
21
19
|
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
22
|
-
if (
|
|
20
|
+
if (!isCoveredByReact(eventNameLc)) {
|
|
23
21
|
syncEvent(node, eventNameLc, newProps[name]);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
@@ -29,9 +27,6 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
29
27
|
if (propType === 'string') {
|
|
30
28
|
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
31
29
|
}
|
|
32
|
-
else {
|
|
33
|
-
node[name] = newProps[name];
|
|
34
|
-
}
|
|
35
30
|
}
|
|
36
31
|
});
|
|
37
32
|
}
|
|
@@ -39,49 +34,50 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
39
34
|
export const getClassName = (classList, newProps, oldProps) => {
|
|
40
35
|
const newClassProp = newProps.className || newProps.class;
|
|
41
36
|
const oldClassProp = oldProps.className || oldProps.class;
|
|
42
|
-
// map the classes to Maps for performance
|
|
43
37
|
const currentClasses = arrayToMap(classList);
|
|
44
38
|
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
45
39
|
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
46
40
|
const finalClassNames = [];
|
|
47
|
-
// loop through each of the current classes on the component
|
|
48
|
-
// to see if it should be a part of the classNames added
|
|
49
41
|
currentClasses.forEach((currentClass) => {
|
|
50
42
|
if (incomingPropClasses.has(currentClass)) {
|
|
51
|
-
// add it as its already included in classnames coming in from newProps
|
|
52
43
|
finalClassNames.push(currentClass);
|
|
53
44
|
incomingPropClasses.delete(currentClass);
|
|
54
45
|
}
|
|
55
46
|
else if (!oldPropClasses.has(currentClass)) {
|
|
56
|
-
// add it as it has NOT been removed by user
|
|
57
47
|
finalClassNames.push(currentClass);
|
|
58
48
|
}
|
|
59
49
|
});
|
|
60
50
|
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
61
51
|
return finalClassNames.join(' ');
|
|
62
52
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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;
|
|
74
73
|
}
|
|
75
|
-
return isSupported;
|
|
76
74
|
};
|
|
77
75
|
export const syncEvent = (node, eventName, newEventHandler) => {
|
|
78
76
|
const eventStore = node.__events || (node.__events = {});
|
|
79
77
|
const oldEventHandler = eventStore[eventName];
|
|
80
|
-
// Remove old listener so they don't double up.
|
|
81
78
|
if (oldEventHandler) {
|
|
82
79
|
node.removeEventListener(eventName, oldEventHandler);
|
|
83
80
|
}
|
|
84
|
-
// Bind new listener.
|
|
85
81
|
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
|
86
82
|
if (newEventHandler) {
|
|
87
83
|
newEventHandler.call(this, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAE,QAAa,EAAE,WAAgB,EAAE,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAE,QAAa,EAAE,WAAgB,EAAE,EAAE,EAAE;IAElF,IAAI,IAAI,YAAY,OAAO,EAAE,CAAC;QAE5B,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrC,IACE,IAAI,KAAK,UAAU;gBACnB,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,KAAK;gBACd,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,WAAW;gBACpB,IAAI,KAAK,cAAc,EACvB,CAAC;gBACD,OAAO;Y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,"file":"case.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC9C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC9C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,EAAE;IACjE,IAAI,SAAS,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,EAAE;IACjE,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleReactProps } from '../interfaces';
|
|
3
3
|
export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
|
|
4
|
-
export
|
|
4
|
+
export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
|
|
5
|
+
export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
|
|
6
|
+
export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
|
|
5
7
|
export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
8
|
+
export declare const defineCustomElement: (tagName: string, customElement: any) => void;
|
|
6
9
|
export * from './attachProps';
|
|
7
10
|
export * from './case';
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
export const mergeRefs = (...refs) => (value) => refs.forEach((ref) => {
|
|
3
|
+
export const setRef = (ref, value) => {
|
|
5
4
|
if (typeof ref === 'function') {
|
|
6
5
|
ref(value);
|
|
7
6
|
}
|
|
8
7
|
else if (ref != null) {
|
|
9
|
-
// This is typed as readonly so we need to allow for override
|
|
10
8
|
ref.current = value;
|
|
11
9
|
}
|
|
12
|
-
}
|
|
10
|
+
};
|
|
11
|
+
export const mergeRefs = (...refs) => {
|
|
12
|
+
return (value) => {
|
|
13
|
+
refs.forEach((ref) => {
|
|
14
|
+
setRef(ref, value);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
};
|
|
13
18
|
export const createForwardRef = (ReactComponent, displayName) => {
|
|
14
19
|
const forwardRef = (props, ref) => {
|
|
15
20
|
return _jsx(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
|
@@ -17,6 +22,11 @@ export const createForwardRef = (ReactComponent, displayName) => {
|
|
|
17
22
|
forwardRef.displayName = displayName;
|
|
18
23
|
return React.forwardRef(forwardRef);
|
|
19
24
|
};
|
|
25
|
+
export const defineCustomElement = (tagName, customElement) => {
|
|
26
|
+
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
27
|
+
customElements.define(tagName, customElement);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
20
30
|
export * from './attachProps';
|
|
21
31
|
export * from './case';
|
|
22
32
|
//# sourceMappingURL=index.js.map
|