@ukic/react 2.8.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.d.ts +0 -1
- package/dist/components.js +62 -62
- package/dist/core/core.css +2 -2
- package/dist/react-component-lib/createComponent.js +56 -23
- package/dist/react-component-lib/createOverlayComponent.js +138 -56
- package/dist/react-component-lib/slottedSVG.js +18 -6
- package/dist/react-component-lib/utils/attachProps.js +27 -26
- package/dist/react-component-lib/utils/case.js +8 -6
- package/dist/react-component-lib/utils/dev.js +3 -3
- package/dist/react-component-lib/utils/index.js +23 -8
- package/package.json +26 -11
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { JSX } from '@ukic/web-components';
|
|
3
2
|
export declare const IcAccordion: import("react").ForwardRefExoticComponent<JSX.IcAccordion & Omit<import("react").HTMLAttributes<HTMLIcAccordionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcAccordionElement>>;
|
|
4
3
|
export declare const IcAccordionGroup: import("react").ForwardRefExoticComponent<JSX.IcAccordionGroup & Omit<import("react").HTMLAttributes<HTMLIcAccordionGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcAccordionGroupElement>>;
|
package/dist/components.js
CHANGED
|
@@ -4,65 +4,65 @@
|
|
|
4
4
|
import { createReactComponent } from './react-component-lib';
|
|
5
5
|
import { defineCustomElements } from '@ukic/web-components/loader';
|
|
6
6
|
defineCustomElements();
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
export
|
|
50
|
-
export
|
|
51
|
-
export
|
|
52
|
-
export
|
|
53
|
-
export
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
59
|
-
export
|
|
60
|
-
export
|
|
61
|
-
export
|
|
62
|
-
export
|
|
63
|
-
export
|
|
64
|
-
export
|
|
65
|
-
export
|
|
66
|
-
export
|
|
67
|
-
export
|
|
68
|
-
export
|
|
7
|
+
export var IcAccordion = /*@__PURE__*/ createReactComponent('ic-accordion');
|
|
8
|
+
export var IcAccordionGroup = /*@__PURE__*/ createReactComponent('ic-accordion-group');
|
|
9
|
+
export var IcAlert = /*@__PURE__*/ createReactComponent('ic-alert');
|
|
10
|
+
export var IcBackToTop = /*@__PURE__*/ createReactComponent('ic-back-to-top');
|
|
11
|
+
export var IcBadge = /*@__PURE__*/ createReactComponent('ic-badge');
|
|
12
|
+
export var IcBreadcrumb = /*@__PURE__*/ createReactComponent('ic-breadcrumb');
|
|
13
|
+
export var IcBreadcrumbGroup = /*@__PURE__*/ createReactComponent('ic-breadcrumb-group');
|
|
14
|
+
export var IcButton = /*@__PURE__*/ createReactComponent('ic-button');
|
|
15
|
+
export var IcCard = /*@__PURE__*/ createReactComponent('ic-card');
|
|
16
|
+
export var IcCheckbox = /*@__PURE__*/ createReactComponent('ic-checkbox');
|
|
17
|
+
export var IcCheckboxGroup = /*@__PURE__*/ createReactComponent('ic-checkbox-group');
|
|
18
|
+
export var IcChip = /*@__PURE__*/ createReactComponent('ic-chip');
|
|
19
|
+
export var IcClassificationBanner = /*@__PURE__*/ createReactComponent('ic-classification-banner');
|
|
20
|
+
export var IcDataEntity = /*@__PURE__*/ createReactComponent('ic-data-entity');
|
|
21
|
+
export var IcDataRow = /*@__PURE__*/ createReactComponent('ic-data-row');
|
|
22
|
+
export var IcDialog = /*@__PURE__*/ createReactComponent('ic-dialog');
|
|
23
|
+
export var IcDivider = /*@__PURE__*/ createReactComponent('ic-divider');
|
|
24
|
+
export var IcEmptyState = /*@__PURE__*/ createReactComponent('ic-empty-state');
|
|
25
|
+
export var IcFooter = /*@__PURE__*/ createReactComponent('ic-footer');
|
|
26
|
+
export var IcFooterLink = /*@__PURE__*/ createReactComponent('ic-footer-link');
|
|
27
|
+
export var IcFooterLinkGroup = /*@__PURE__*/ createReactComponent('ic-footer-link-group');
|
|
28
|
+
export var IcHero = /*@__PURE__*/ createReactComponent('ic-hero');
|
|
29
|
+
export var IcHorizontalScroll = /*@__PURE__*/ createReactComponent('ic-horizontal-scroll');
|
|
30
|
+
export var IcInputComponentContainer = /*@__PURE__*/ createReactComponent('ic-input-component-container');
|
|
31
|
+
export var IcInputContainer = /*@__PURE__*/ createReactComponent('ic-input-container');
|
|
32
|
+
export var IcInputLabel = /*@__PURE__*/ createReactComponent('ic-input-label');
|
|
33
|
+
export var IcInputValidation = /*@__PURE__*/ createReactComponent('ic-input-validation');
|
|
34
|
+
export var IcLink = /*@__PURE__*/ createReactComponent('ic-link');
|
|
35
|
+
export var IcLoadingIndicator = /*@__PURE__*/ createReactComponent('ic-loading-indicator');
|
|
36
|
+
export var IcMenu = /*@__PURE__*/ createReactComponent('ic-menu');
|
|
37
|
+
export var IcMenuGroup = /*@__PURE__*/ createReactComponent('ic-menu-group');
|
|
38
|
+
export var IcMenuItem = /*@__PURE__*/ createReactComponent('ic-menu-item');
|
|
39
|
+
export var IcNavigationButton = /*@__PURE__*/ createReactComponent('ic-navigation-button');
|
|
40
|
+
export var IcNavigationGroup = /*@__PURE__*/ createReactComponent('ic-navigation-group');
|
|
41
|
+
export var IcNavigationItem = /*@__PURE__*/ createReactComponent('ic-navigation-item');
|
|
42
|
+
export var IcNavigationMenu = /*@__PURE__*/ createReactComponent('ic-navigation-menu');
|
|
43
|
+
export var IcPageHeader = /*@__PURE__*/ createReactComponent('ic-page-header');
|
|
44
|
+
export var IcPagination = /*@__PURE__*/ createReactComponent('ic-pagination');
|
|
45
|
+
export var IcPaginationItem = /*@__PURE__*/ createReactComponent('ic-pagination-item');
|
|
46
|
+
export var IcPopoverMenu = /*@__PURE__*/ createReactComponent('ic-popover-menu');
|
|
47
|
+
export var IcRadioGroup = /*@__PURE__*/ createReactComponent('ic-radio-group');
|
|
48
|
+
export var IcRadioOption = /*@__PURE__*/ createReactComponent('ic-radio-option');
|
|
49
|
+
export var IcSearchBar = /*@__PURE__*/ createReactComponent('ic-search-bar');
|
|
50
|
+
export var IcSectionContainer = /*@__PURE__*/ createReactComponent('ic-section-container');
|
|
51
|
+
export var IcSelect = /*@__PURE__*/ createReactComponent('ic-select');
|
|
52
|
+
export var IcSideNavigation = /*@__PURE__*/ createReactComponent('ic-side-navigation');
|
|
53
|
+
export var IcSkeleton = /*@__PURE__*/ createReactComponent('ic-skeleton');
|
|
54
|
+
export var IcStatusTag = /*@__PURE__*/ createReactComponent('ic-status-tag');
|
|
55
|
+
export var IcStep = /*@__PURE__*/ createReactComponent('ic-step');
|
|
56
|
+
export var IcStepper = /*@__PURE__*/ createReactComponent('ic-stepper');
|
|
57
|
+
export var IcSwitch = /*@__PURE__*/ createReactComponent('ic-switch');
|
|
58
|
+
export var IcTab = /*@__PURE__*/ createReactComponent('ic-tab');
|
|
59
|
+
export var IcTabContext = /*@__PURE__*/ createReactComponent('ic-tab-context');
|
|
60
|
+
export var IcTabGroup = /*@__PURE__*/ createReactComponent('ic-tab-group');
|
|
61
|
+
export var IcTabPanel = /*@__PURE__*/ createReactComponent('ic-tab-panel');
|
|
62
|
+
export var IcTextField = /*@__PURE__*/ createReactComponent('ic-text-field');
|
|
63
|
+
export var IcTheme = /*@__PURE__*/ createReactComponent('ic-theme');
|
|
64
|
+
export var IcToast = /*@__PURE__*/ createReactComponent('ic-toast');
|
|
65
|
+
export var IcToastRegion = /*@__PURE__*/ createReactComponent('ic-toast-region');
|
|
66
|
+
export var IcTooltip = /*@__PURE__*/ createReactComponent('ic-tooltip');
|
|
67
|
+
export var IcTopNavigation = /*@__PURE__*/ createReactComponent('ic-top-navigation');
|
|
68
|
+
export var IcTypography = /*@__PURE__*/ createReactComponent('ic-typography');
|
package/dist/core/core.css
CHANGED
|
@@ -4,7 +4,7 @@ html{font-family:var(--ic-font-body-family);color:var(--ic-color-primary-text)}a
|
|
|
4
4
|
inset 0 0 0 8px var(--ic-architectural-white);--ic-border-focus-dark:0 0 0 2px white, 0 0 0 5px rgba(255 255 255 / 52%);--ic-elevation-raised:0 0 2px rgb(0 0 0 / 50%);--ic-elevation-overlay:0 2px 8px rgb(0 0 0 / 20%);--ic-elevation-modal:0 4px 16px rgb(0 0 0 / 25%);--ic-elevation-inset:inset 0 4px 16px rgb(0 0 0 / 25%),
|
|
5
5
|
inset 0 -4px 16px rgb(0 0 0 / 25%);--ic-easing-transition-fast:var(--ic-transition-duration-fast)
|
|
6
6
|
cubic-bezier(0.165, 0.84, 0.44, 1);--ic-easing-transition-slow:var(--ic-transition-duration-slow)
|
|
7
|
-
cubic-bezier(0.165, 0.84, 0.44, 1);--ic-transition-duration-fast:100ms;--ic-transition-duration-slow:300ms;--ic-border-width:0.0625rem;--ic-border-disabled:var(--ic-space-1px) dashed var(--ic-architectural-200);--ic-border-default:var(--ic-space-1px) solid var(--ic-architectural-400);--ic-border-hover:var(--ic-space-1px) solid var(--ic-architectural-500);--ic-border-pressed:var(--ic-space-1px) solid var(--ic-architectural-600);--ic-hc-border:var(--ic-space-1px) solid transparent;--ic-error-border-default:var(--ic-space-xxxs) solid var(--ic-status-error);--ic-error-border-hover:var(--ic-space-xxxs) solid
|
|
7
|
+
cubic-bezier(0.165, 0.84, 0.44, 1);--ic-transition-duration-fast:100ms;--ic-transition-duration-slow:300ms;--ic-border-width:0.0625rem;--ic-border-disabled:var(--ic-space-1px) dashed var(--ic-architectural-200);--ic-border-light:var(--ic-space-1px) solid var(--ic-architectural-200);--ic-border-default:var(--ic-space-1px) solid var(--ic-architectural-400);--ic-border-hover:var(--ic-space-1px) solid var(--ic-architectural-500);--ic-border-pressed:var(--ic-space-1px) solid var(--ic-architectural-600);--ic-hc-border:var(--ic-space-1px) solid transparent;--ic-error-border-default:var(--ic-space-xxxs) solid var(--ic-status-error);--ic-error-border-hover:var(--ic-space-xxxs) solid
|
|
8
8
|
var(--ic-status-error-hover);--ic-error-border-pressed:var(--ic-space-xxxs) solid
|
|
9
9
|
var(--ic-status-error-pressed);--ic-success-border-default:var(--ic-space-xxxs) solid
|
|
10
10
|
var(--ic-status-success);--ic-success-border-hover:var(--ic-space-xxxs) solid
|
|
@@ -62,7 +62,7 @@ html{font-family:var(--ic-font-body-family);color:var(--ic-color-primary-text)}a
|
|
|
62
62
|
);--ic-status-error-pressed:rgb(
|
|
63
63
|
calc(var(--ic-status-error-r) * 0.6) calc(var(--ic-status-error-g) * 0.6)
|
|
64
64
|
calc(var(--ic-status-error-b) * 0.6) / var(--ic-status-error-a)
|
|
65
|
-
);--ic-status-error-dark:#610a05;--ic-status-info-light:#e1f0fc;--ic-status-info-contrast:#488fe3;--ic-status-info:#124db3;--ic-status-info-dark:#041144;--ic-status-anomalous-light:#efdbff;--ic-status-anomalous-contrast:#b764fb;--ic-status-anomalous:#7c25c2;--ic-status-anomalous-dark:#350f54;--ic-status-unknown-light:var(--ic-architectural-40);--ic-status-unknown-contrast:var(--ic-architectural-300);--ic-status-unknown:var(--ic-architectural-500);--ic-status-unknown-dark:var(--ic-architectural-800);--ic-status-warning-mid:var(--ic-status-warning);--ic-status-warning-mid-hover:var(--ic-status-warning-hover);--ic-status-warning-mid-pressed:var(--ic-status-warning-pressed);--ic-status-success-background:var(--ic-status-success-light);--ic-status-warning-background:var(--ic-status-warning-light);--ic-status-error-background:var(--ic-status-error-light);--ic-status-info-background:var(--ic-status-info-light);--ic-architectural-20:#f9fafa;--ic-architectural-40:#f4f4f5;--ic-architectural-60:#eeeff0;--ic-architectural-80:#e8e9eb;--ic-architectural-100:#e1e3e5;--ic-architectural-200:#c4c8cd;--ic-architectural-300:#a7acb3;--ic-architectural-400:#8a919b;--ic-architectural-500:#6c7580;--ic-architectural-600:#575e68;--ic-architectural-700:#41464d;--ic-architectural-800:#2c2f34;--ic-architectural-900:#0b0c0c;--ic-architectural-white:#fff;--ic-architectural-black:#000;--ic-color-primary-text:#0b0c0c;--ic-color-white-text:#fff;--ic-color-secondary-text:#41464d;--ic-color-tertiary-text:#6c7580;--ic-action-default:#1759bc;--ic-action-default-hover:#0b399c;--ic-action-default-active:#07277e;--ic-action-default-active-alpha:rgba(23 89 188 / 50%);--ic-action-default-bg-hover:rgb(23 89 188 / 10%);--ic-action-default-bg-active:rgb(23 89 188 / 20%);--ic-action-default-bg-hover-no-alpha:#e7eef8;--ic-action-default-bg-active-no-alpha:#d0def2;--ic-action-destructive:#d4351c;--ic-action-destructive-hover:#ad1e0e;--ic-action-destructive-active:#8b1209;--ic-action-light:#fff;--ic-action-light-hover:#c4c8cd;--ic-action-light-active:#a7acb3;--ic-action-light-bg-hover:rgb(255 255 255 / 10%);--ic-action-light-bg-active:rgb(255 255 255 / 20%);--ic-action-dark:#0b0c0c;--ic-action-dark-hover:#2c2f34;--ic-action-dark-active:#41464d;--ic-action-dark-bg-hover:rgb(65 70 77 / 10%);--ic-action-dark-bg-active:rgb(65 70 77 / 20%);--ic-classification-official:#2b71c7;--ic-classification-official-foreground:#fff;--ic-classification-secret:#f39c2c;--ic-classification-secret-foreground:#000;--ic-classification-top-secret:#a00;--ic-classification-top-secret-foreground:#fff;--ic-classification-not-set:#616161;--ic-classification-not-set-foreground:#fff;--ic-theme-blue-primary-r:27;--ic-theme-blue-primary-g:60;--ic-theme-blue-primary-b:121;--ic-theme-blue-primary-a:1;--ic-theme-lighten-20:rgb(255 255 255 / 20%);--ic-theme-lighten-40:rgb(255 255 255 / 40%);--ic-theme-primary-r:var(--ic-theme-blue-primary-r);--ic-theme-primary-g:var(--ic-theme-blue-primary-g);--ic-theme-primary-b:var(--ic-theme-blue-primary-b);--ic-theme-primary-a:var(--ic-theme-blue-primary-a);--ic-theme-primary:rgb(
|
|
65
|
+
);--ic-status-error-dark:#610a05;--ic-status-info-light:#e1f0fc;--ic-status-info-contrast:#488fe3;--ic-status-info:#124db3;--ic-status-info-dark:#041144;--ic-status-anomalous-light:#efdbff;--ic-status-anomalous-contrast:#b764fb;--ic-status-anomalous:#7c25c2;--ic-status-anomalous-dark:#350f54;--ic-status-unknown-light:var(--ic-architectural-40);--ic-status-unknown-contrast:var(--ic-architectural-300);--ic-status-unknown:var(--ic-architectural-500);--ic-status-unknown-dark:var(--ic-architectural-800);--ic-status-warning-mid:var(--ic-status-warning);--ic-status-warning-mid-hover:var(--ic-status-warning-hover);--ic-status-warning-mid-pressed:var(--ic-status-warning-pressed);--ic-status-success-background:var(--ic-status-success-light);--ic-status-warning-background:var(--ic-status-warning-light);--ic-status-error-background:var(--ic-status-error-light);--ic-status-info-background:var(--ic-status-info-light);--ic-architectural-20:#f9fafa;--ic-architectural-40:#f4f4f5;--ic-architectural-60:#eeeff0;--ic-architectural-80:#e8e9eb;--ic-architectural-100:#e1e3e5;--ic-architectural-200:#c4c8cd;--ic-architectural-300:#a7acb3;--ic-architectural-400:#8a919b;--ic-architectural-500:#6c7580;--ic-architectural-600:#575e68;--ic-architectural-700:#41464d;--ic-architectural-800:#2c2f34;--ic-architectural-900:#0b0c0c;--ic-architectural-white:#fff;--ic-architectural-black:#000;--ic-color-primary-text:#0b0c0c;--ic-color-white-text:#fff;--ic-color-secondary-text:#41464d;--ic-color-tertiary-text:#6c7580;--ic-action-default:#1759bc;--ic-action-default-hover:#0b399c;--ic-action-default-active:#07277e;--ic-action-default-active-alpha:rgba(23 89 188 / 50%);--ic-action-default-bg-hover:rgb(23 89 188 / 10%);--ic-action-default-bg-active:rgb(23 89 188 / 20%);--ic-action-default-bg-hover-no-alpha:#e7eef8;--ic-action-default-bg-active-no-alpha:#d0def2;--ic-action-destructive:#d4351c;--ic-action-destructive-hover:#ad1e0e;--ic-action-destructive-active:#8b1209;--ic-action-light:#fff;--ic-action-light-hover:#c4c8cd;--ic-action-light-active:#a7acb3;--ic-action-light-bg-hover:rgb(255 255 255 / 10%);--ic-action-light-bg-active:rgb(255 255 255 / 20%);--ic-action-dark:#0b0c0c;--ic-action-dark-hover:#2c2f34;--ic-action-dark-active:#41464d;--ic-action-dark-bg-hover:rgb(65 70 77 / 10%);--ic-action-dark-bg-active:rgb(65 70 77 / 20%);--ic-action-dark-bg-hover-no-alpha:#ececed;--ic-action-dark-bg-active-no-alpha:#d9dadb;--ic-classification-official:#2b71c7;--ic-classification-official-foreground:#fff;--ic-classification-secret:#f39c2c;--ic-classification-secret-foreground:#000;--ic-classification-top-secret:#a00;--ic-classification-top-secret-foreground:#fff;--ic-classification-not-set:#616161;--ic-classification-not-set-foreground:#fff;--ic-theme-blue-primary-r:27;--ic-theme-blue-primary-g:60;--ic-theme-blue-primary-b:121;--ic-theme-blue-primary-a:1;--ic-theme-lighten-20:rgb(255 255 255 / 20%);--ic-theme-lighten-40:rgb(255 255 255 / 40%);--ic-theme-primary-r:var(--ic-theme-blue-primary-r);--ic-theme-primary-g:var(--ic-theme-blue-primary-g);--ic-theme-primary-b:var(--ic-theme-blue-primary-b);--ic-theme-primary-a:var(--ic-theme-blue-primary-a);--ic-theme-primary:rgb(
|
|
66
66
|
var(--ic-theme-primary-r) var(--ic-theme-primary-g)
|
|
67
67
|
var(--ic-theme-primary-b) / var(--ic-theme-primary-a)
|
|
68
68
|
);--ic-theme-secondary:rgb(
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
1
27
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
28
|
var t = {};
|
|
3
29
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -11,30 +37,32 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
37
|
};
|
|
12
38
|
import React, { createElement } from 'react';
|
|
13
39
|
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
14
|
-
export
|
|
40
|
+
export var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) {
|
|
15
41
|
if (defineCustomElement !== undefined) {
|
|
16
42
|
defineCustomElement();
|
|
17
43
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
var displayName = dashToPascalCase(tagName);
|
|
45
|
+
var ReactComponent = /** @class */ (function (_super) {
|
|
46
|
+
__extends(class_1, _super);
|
|
47
|
+
function class_1(props) {
|
|
48
|
+
var _this = _super.call(this, props) || this;
|
|
49
|
+
_this.setComponentElRef = function (element) {
|
|
50
|
+
_this.componentEl = element;
|
|
24
51
|
};
|
|
52
|
+
return _this;
|
|
25
53
|
}
|
|
26
|
-
componentDidMount() {
|
|
54
|
+
class_1.prototype.componentDidMount = function () {
|
|
27
55
|
this.componentDidUpdate(this.props);
|
|
28
|
-
}
|
|
29
|
-
componentDidUpdate(prevProps) {
|
|
56
|
+
};
|
|
57
|
+
class_1.prototype.componentDidUpdate = function (prevProps) {
|
|
30
58
|
attachProps(this.componentEl, this.props, prevProps);
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
59
|
+
};
|
|
60
|
+
class_1.prototype.render = function () {
|
|
61
|
+
var _a = this.props, children = _a.children, forwardedRef = _a.forwardedRef, style = _a.style, className = _a.className, ref = _a.ref, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
62
|
+
var propsToPass = Object.keys(cProps).reduce(function (acc, name) {
|
|
63
|
+
var value = cProps[name];
|
|
36
64
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
37
|
-
|
|
65
|
+
var eventName = name.substring(2).toLowerCase();
|
|
38
66
|
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
39
67
|
acc[name] = value;
|
|
40
68
|
}
|
|
@@ -42,7 +70,7 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
42
70
|
else {
|
|
43
71
|
// we should only render strings, booleans, and numbers as attrs in html.
|
|
44
72
|
// objects, functions, arrays etc get synced via properties on mount.
|
|
45
|
-
|
|
73
|
+
var type = typeof value;
|
|
46
74
|
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
47
75
|
acc[camelToDashCase(name)] = value;
|
|
48
76
|
}
|
|
@@ -52,7 +80,7 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
52
80
|
if (manipulatePropsFunction) {
|
|
53
81
|
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
54
82
|
}
|
|
55
|
-
|
|
83
|
+
var newProps = __assign(__assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style: style });
|
|
56
84
|
/**
|
|
57
85
|
* We use createElement here instead of
|
|
58
86
|
* React.createElement to work around a
|
|
@@ -61,11 +89,16 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
61
89
|
* as <tagname> instead of the actual Web Component.
|
|
62
90
|
*/
|
|
63
91
|
return createElement(tagName, newProps, children);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
92
|
+
};
|
|
93
|
+
Object.defineProperty(class_1, "displayName", {
|
|
94
|
+
get: function () {
|
|
95
|
+
return displayName;
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
return class_1;
|
|
101
|
+
}(React.Component));
|
|
69
102
|
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
70
103
|
if (ReactComponentContext) {
|
|
71
104
|
ReactComponent.contextType = ReactComponentContext;
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
1
27
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
28
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
29
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -7,6 +33,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
33
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
34
|
});
|
|
9
35
|
};
|
|
36
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
38
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
+
function step(op) {
|
|
41
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
+
switch (op[0]) {
|
|
46
|
+
case 0: case 1: t = op; break;
|
|
47
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
+
default:
|
|
51
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
+
if (t[2]) _.ops.pop();
|
|
56
|
+
_.trys.pop(); continue;
|
|
57
|
+
}
|
|
58
|
+
op = body.call(thisArg, _);
|
|
59
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
+
}
|
|
62
|
+
};
|
|
10
63
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
64
|
var t = {};
|
|
12
65
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -21,88 +74,117 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
74
|
import React from 'react';
|
|
22
75
|
import ReactDOM from 'react-dom';
|
|
23
76
|
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
24
|
-
export
|
|
77
|
+
export var createOverlayComponent = function (tagName, controller, customElement) {
|
|
25
78
|
defineCustomElement(tagName, customElement);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
79
|
+
var displayName = dashToPascalCase(tagName);
|
|
80
|
+
var didDismissEventName = "on".concat(displayName, "DidDismiss");
|
|
81
|
+
var didPresentEventName = "on".concat(displayName, "DidPresent");
|
|
82
|
+
var willDismissEventName = "on".concat(displayName, "WillDismiss");
|
|
83
|
+
var willPresentEventName = "on".concat(displayName, "WillPresent");
|
|
84
|
+
var isDismissing = false;
|
|
85
|
+
var Overlay = /** @class */ (function (_super) {
|
|
86
|
+
__extends(Overlay, _super);
|
|
87
|
+
function Overlay(props) {
|
|
88
|
+
var _this = _super.call(this, props) || this;
|
|
35
89
|
if (typeof document !== 'undefined') {
|
|
36
|
-
|
|
90
|
+
_this.el = document.createElement('div');
|
|
37
91
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
static get displayName() {
|
|
41
|
-
return displayName;
|
|
92
|
+
_this.handleDismiss = _this.handleDismiss.bind(_this);
|
|
93
|
+
return _this;
|
|
42
94
|
}
|
|
43
|
-
|
|
95
|
+
Object.defineProperty(Overlay, "displayName", {
|
|
96
|
+
get: function () {
|
|
97
|
+
return displayName;
|
|
98
|
+
},
|
|
99
|
+
enumerable: false,
|
|
100
|
+
configurable: true
|
|
101
|
+
});
|
|
102
|
+
Overlay.prototype.componentDidMount = function () {
|
|
44
103
|
if (this.props.isOpen) {
|
|
45
104
|
this.present();
|
|
46
105
|
}
|
|
47
|
-
}
|
|
48
|
-
componentWillUnmount() {
|
|
106
|
+
};
|
|
107
|
+
Overlay.prototype.componentWillUnmount = function () {
|
|
49
108
|
if (this.overlay) {
|
|
50
109
|
this.overlay.dismiss();
|
|
51
110
|
}
|
|
52
|
-
}
|
|
53
|
-
handleDismiss(event) {
|
|
111
|
+
};
|
|
112
|
+
Overlay.prototype.handleDismiss = function (event) {
|
|
54
113
|
if (this.props.onDidDismiss) {
|
|
55
114
|
this.props.onDidDismiss(event);
|
|
56
115
|
}
|
|
57
116
|
setRef(this.props.forwardedRef, null);
|
|
58
|
-
}
|
|
59
|
-
shouldComponentUpdate(nextProps) {
|
|
117
|
+
};
|
|
118
|
+
Overlay.prototype.shouldComponentUpdate = function (nextProps) {
|
|
60
119
|
// Check if the overlay component is about to dismiss
|
|
61
120
|
if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
|
|
62
121
|
isDismissing = true;
|
|
63
122
|
}
|
|
64
123
|
return true;
|
|
65
|
-
}
|
|
66
|
-
componentDidUpdate(prevProps) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
124
|
+
};
|
|
125
|
+
Overlay.prototype.componentDidUpdate = function (prevProps) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
return __generator(this, function (_a) {
|
|
128
|
+
switch (_a.label) {
|
|
129
|
+
case 0:
|
|
130
|
+
if (this.overlay) {
|
|
131
|
+
attachProps(this.overlay, this.props, prevProps);
|
|
132
|
+
}
|
|
133
|
+
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
|
|
134
|
+
this.present(prevProps);
|
|
135
|
+
}
|
|
136
|
+
if (!(this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false)) return [3 /*break*/, 2];
|
|
137
|
+
return [4 /*yield*/, this.overlay.dismiss()];
|
|
138
|
+
case 1:
|
|
139
|
+
_a.sent();
|
|
140
|
+
isDismissing = false;
|
|
141
|
+
/**
|
|
142
|
+
* Now that the overlay is dismissed
|
|
143
|
+
* we need to render again so that any
|
|
144
|
+
* inner components will be unmounted
|
|
145
|
+
*/
|
|
146
|
+
this.forceUpdate();
|
|
147
|
+
_a.label = 2;
|
|
148
|
+
case 2: return [2 /*return*/];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
84
151
|
});
|
|
85
|
-
}
|
|
86
|
-
present(prevProps) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
152
|
+
};
|
|
153
|
+
Overlay.prototype.present = function (prevProps) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
+
var _a, children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, cProps, elementProps, _b;
|
|
156
|
+
var _c;
|
|
157
|
+
var _this = this;
|
|
158
|
+
return __generator(this, function (_d) {
|
|
159
|
+
switch (_d.label) {
|
|
160
|
+
case 0:
|
|
161
|
+
_a = this.props, children = _a.children, isOpen = _a.isOpen, onDidDismiss = _a.onDidDismiss, onDidPresent = _a.onDidPresent, onWillDismiss = _a.onWillDismiss, onWillPresent = _a.onWillPresent, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
|
|
162
|
+
elementProps = __assign(__assign({}, cProps), (_c = { ref: this.props.forwardedRef }, _c[didDismissEventName] = this.handleDismiss, _c[didPresentEventName] = function (e) { return _this.props.onDidPresent && _this.props.onDidPresent(e); }, _c[willDismissEventName] = function (e) { return _this.props.onWillDismiss && _this.props.onWillDismiss(e); }, _c[willPresentEventName] = function (e) { return _this.props.onWillPresent && _this.props.onWillPresent(e); }, _c));
|
|
163
|
+
_b = this;
|
|
164
|
+
return [4 /*yield*/, controller.create(__assign(__assign({}, elementProps), { component: this.el, componentProps: {} }))];
|
|
165
|
+
case 1:
|
|
166
|
+
_b.overlay = _d.sent();
|
|
167
|
+
setRef(this.props.forwardedRef, this.overlay);
|
|
168
|
+
attachProps(this.overlay, elementProps, prevProps);
|
|
169
|
+
return [4 /*yield*/, this.overlay.present()];
|
|
170
|
+
case 2:
|
|
171
|
+
_d.sent();
|
|
172
|
+
return [2 /*return*/];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
94
175
|
});
|
|
95
|
-
}
|
|
96
|
-
render() {
|
|
176
|
+
};
|
|
177
|
+
Overlay.prototype.render = function () {
|
|
97
178
|
/**
|
|
98
179
|
* Continue to render the component even when
|
|
99
180
|
* overlay is dismissing otherwise component
|
|
100
181
|
* will be hidden before animation is done.
|
|
101
182
|
*/
|
|
102
183
|
return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
184
|
+
};
|
|
185
|
+
return Overlay;
|
|
186
|
+
}(React.Component));
|
|
187
|
+
return React.forwardRef(function (props, ref) {
|
|
188
|
+
return React.createElement(Overlay, __assign({}, props, { forwardedRef: ref }));
|
|
107
189
|
});
|
|
108
190
|
};
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
13
|
var t = {};
|
|
3
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -10,15 +21,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
21
|
return t;
|
|
11
22
|
};
|
|
12
23
|
import React from "react";
|
|
13
|
-
|
|
24
|
+
var defaultProps = {
|
|
14
25
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
26
|
};
|
|
16
|
-
function slot(name
|
|
17
|
-
|
|
27
|
+
function slot(name) {
|
|
28
|
+
if (name === void 0) { name = ""; }
|
|
29
|
+
return { ref: function (e) { return (e ? e.setAttribute("slot", name) : null); } };
|
|
18
30
|
}
|
|
19
|
-
export
|
|
20
|
-
var
|
|
21
|
-
return (React.createElement("svg",
|
|
31
|
+
export var SlottedSVG = function (_a) {
|
|
32
|
+
var path = _a.path, slotName = _a.slot, children = _a.children, props = __rest(_a, ["path", "slot", "children"]);
|
|
33
|
+
return (React.createElement("svg", __assign({}, slot(slotName), props, defaultProps),
|
|
22
34
|
!!path && React.createElement("path", { d: path }),
|
|
23
35
|
children));
|
|
24
36
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { camelToDashCase } from './case';
|
|
2
|
-
export
|
|
2
|
+
export var attachProps = function (node, newProps, oldProps) {
|
|
3
|
+
if (oldProps === void 0) { oldProps = {}; }
|
|
3
4
|
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
4
5
|
if (node instanceof Element) {
|
|
5
6
|
// add any classes in className to the class list
|
|
6
|
-
|
|
7
|
+
var className = getClassName(node.classList, newProps, oldProps);
|
|
7
8
|
if (className !== '') {
|
|
8
9
|
node.className = className;
|
|
9
10
|
}
|
|
10
|
-
Object.keys(newProps).forEach((name)
|
|
11
|
+
Object.keys(newProps).forEach(function (name) {
|
|
11
12
|
if (name === 'children' ||
|
|
12
13
|
name === 'style' ||
|
|
13
14
|
name === 'ref' ||
|
|
@@ -17,15 +18,15 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
var eventName = name.substring(2);
|
|
22
|
+
var eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
22
23
|
if (!isCoveredByReact(eventNameLc)) {
|
|
23
24
|
syncEvent(node, eventNameLc, newProps[name]);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
else {
|
|
27
28
|
node[name] = newProps[name];
|
|
28
|
-
|
|
29
|
+
var propType = typeof newProps[name];
|
|
29
30
|
if (propType === 'string') {
|
|
30
31
|
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
31
32
|
}
|
|
@@ -33,17 +34,17 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
export var getClassName = function (classList, newProps, oldProps) {
|
|
38
|
+
var newClassProp = newProps.className || newProps.class;
|
|
39
|
+
var oldClassProp = oldProps.className || oldProps.class;
|
|
39
40
|
// map the classes to Maps for performance
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
var currentClasses = arrayToMap(classList);
|
|
42
|
+
var incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
43
|
+
var oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
44
|
+
var finalClassNames = [];
|
|
44
45
|
// loop through each of the current classes on the component
|
|
45
46
|
// to see if it should be a part of the classNames added
|
|
46
|
-
currentClasses.forEach((currentClass)
|
|
47
|
+
currentClasses.forEach(function (currentClass) {
|
|
47
48
|
if (incomingPropClasses.has(currentClass)) {
|
|
48
49
|
// add it as its already included in classnames coming in from newProps
|
|
49
50
|
finalClassNames.push(currentClass);
|
|
@@ -54,13 +55,13 @@ export const getClassName = (classList, newProps, oldProps) => {
|
|
|
54
55
|
finalClassNames.push(currentClass);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
incomingPropClasses.forEach((s)
|
|
58
|
+
incomingPropClasses.forEach(function (s) { return finalClassNames.push(s); });
|
|
58
59
|
return finalClassNames.join(' ');
|
|
59
60
|
};
|
|
60
61
|
/**
|
|
61
62
|
* Transforms a React event name to a browser event name.
|
|
62
63
|
*/
|
|
63
|
-
export
|
|
64
|
+
export var transformReactEventName = function (eventNameSuffix) {
|
|
64
65
|
switch (eventNameSuffix) {
|
|
65
66
|
case 'doubleclick':
|
|
66
67
|
return 'dblclick';
|
|
@@ -71,24 +72,24 @@ export const transformReactEventName = (eventNameSuffix) => {
|
|
|
71
72
|
* Checks if an event is supported in the current execution environment.
|
|
72
73
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
73
74
|
*/
|
|
74
|
-
export
|
|
75
|
+
export var isCoveredByReact = function (eventNameSuffix) {
|
|
75
76
|
if (typeof document === 'undefined') {
|
|
76
77
|
return true;
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
var eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
81
|
+
var isSupported = eventName in document;
|
|
81
82
|
if (!isSupported) {
|
|
82
|
-
|
|
83
|
+
var element = document.createElement('div');
|
|
83
84
|
element.setAttribute(eventName, 'return;');
|
|
84
85
|
isSupported = typeof element[eventName] === 'function';
|
|
85
86
|
}
|
|
86
87
|
return isSupported;
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
export
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
export var syncEvent = function (node, eventName, newEventHandler) {
|
|
91
|
+
var eventStore = node.__events || (node.__events = {});
|
|
92
|
+
var oldEventHandler = eventStore[eventName];
|
|
92
93
|
// Remove old listener so they don't double up.
|
|
93
94
|
if (oldEventHandler) {
|
|
94
95
|
node.removeEventListener(eventName, oldEventHandler);
|
|
@@ -100,8 +101,8 @@ export const syncEvent = (node, eventName, newEventHandler) => {
|
|
|
100
101
|
}
|
|
101
102
|
}));
|
|
102
103
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
arr.forEach((s)
|
|
104
|
+
var arrayToMap = function (arr) {
|
|
105
|
+
var map = new Map();
|
|
106
|
+
arr.forEach(function (s) { return map.set(s, s); });
|
|
106
107
|
return map;
|
|
107
108
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export var dashToPascalCase = function (str) {
|
|
2
|
+
return str
|
|
3
|
+
.toLowerCase()
|
|
4
|
+
.split('-')
|
|
5
|
+
.map(function (segment) { return segment.charAt(0).toUpperCase() + segment.slice(1); })
|
|
6
|
+
.join('');
|
|
7
|
+
};
|
|
8
|
+
export var camelToDashCase = function (str) { return str.replace(/([A-Z])/g, function (m) { return "-".concat(m[0].toLowerCase()); }); };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var isDevMode = function () {
|
|
2
2
|
return process && process.env && process.env.NODE_ENV === 'development';
|
|
3
3
|
};
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
var warnings = {};
|
|
5
|
+
export var deprecationWarning = function (key, message) {
|
|
6
6
|
if (isDevMode()) {
|
|
7
7
|
if (!warnings[key]) {
|
|
8
8
|
console.warn(message);
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import React from 'react';
|
|
2
|
-
export
|
|
13
|
+
export var setRef = function (ref, value) {
|
|
3
14
|
if (typeof ref === 'function') {
|
|
4
15
|
ref(value);
|
|
5
16
|
}
|
|
@@ -8,21 +19,25 @@ export const setRef = (ref, value) => {
|
|
|
8
19
|
ref.current = value;
|
|
9
20
|
}
|
|
10
21
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
22
|
+
export var mergeRefs = function () {
|
|
23
|
+
var refs = [];
|
|
24
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
25
|
+
refs[_i] = arguments[_i];
|
|
26
|
+
}
|
|
27
|
+
return function (value) {
|
|
28
|
+
refs.forEach(function (ref) {
|
|
14
29
|
setRef(ref, value);
|
|
15
30
|
});
|
|
16
31
|
};
|
|
17
32
|
};
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
return React.createElement(ReactComponent,
|
|
33
|
+
export var createForwardRef = function (ReactComponent, displayName) {
|
|
34
|
+
var forwardRef = function (props, ref) {
|
|
35
|
+
return React.createElement(ReactComponent, __assign({}, props, { forwardedRef: ref }));
|
|
21
36
|
};
|
|
22
37
|
forwardRef.displayName = displayName;
|
|
23
38
|
return React.forwardRef(forwardRef);
|
|
24
39
|
};
|
|
25
|
-
export
|
|
40
|
+
export var defineCustomElement = function (tagName, customElement) {
|
|
26
41
|
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
27
42
|
customElements.define(tagName, customElement);
|
|
28
43
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sideEffects": [
|
|
4
4
|
"*.css"
|
|
5
5
|
],
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.10.0",
|
|
7
7
|
"description": "React-wrapped web components compiled using StencilJS",
|
|
8
8
|
"author": "mi6",
|
|
9
9
|
"bugs": {
|
|
@@ -16,12 +16,17 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "npm run clean && npm run compile && npm run copy:core-css && npm run copy:normalize-css",
|
|
19
|
+
"cypress": "cypress run --component --headed",
|
|
20
|
+
"cypress:open": "cypress open",
|
|
21
|
+
"cypress:component": "cypress run --component --headless",
|
|
22
|
+
"cypress:ci": "npm run cypress:component",
|
|
19
23
|
"clean": "rimraf dist",
|
|
20
24
|
"compile": "npm run tsc",
|
|
21
25
|
"tsc": "tsc -p .",
|
|
22
26
|
"rollup": "rollup -c",
|
|
27
|
+
"lint:cypress": "eslint --config ./cypress/.eslintrc.json ./src/component-tests",
|
|
23
28
|
"storybook": "start-storybook -p 6007 --no-manager-cache",
|
|
24
|
-
"build-storybook": "rimraf ./storybook-static && build-storybook
|
|
29
|
+
"build-storybook": "rimraf ./storybook-static && build-storybook",
|
|
25
30
|
"audit": "echo 'Audit for: @ukic/react' && audit-ci -m --config ../../audit-ci.json",
|
|
26
31
|
"prettier": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore src --check",
|
|
27
32
|
"prettier:fix": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore src --write",
|
|
@@ -35,11 +40,13 @@
|
|
|
35
40
|
"dist/"
|
|
36
41
|
],
|
|
37
42
|
"dependencies": {
|
|
38
|
-
"@ukic/
|
|
39
|
-
"@ukic/web-components": "^2.8.0"
|
|
43
|
+
"@ukic/web-components": "^2.10.0"
|
|
40
44
|
},
|
|
41
45
|
"devDependencies": {
|
|
42
46
|
"@babel/core": "^7.23.2",
|
|
47
|
+
"@babel/preset-env": "^7.23.2",
|
|
48
|
+
"@cypress/react": "^8.0.0",
|
|
49
|
+
"@cypress/webpack-preprocessor": "^6.0.0",
|
|
43
50
|
"@mdi/js": "^7.2.96",
|
|
44
51
|
"@stencil/react-output-target": "^0.5.3",
|
|
45
52
|
"@storybook/addon-a11y": "^6.4.8",
|
|
@@ -51,23 +58,31 @@
|
|
|
51
58
|
"@storybook/builder-webpack5": "^6.5.14",
|
|
52
59
|
"@storybook/manager-webpack5": "^6.5.14",
|
|
53
60
|
"@storybook/react": "^6.5.15",
|
|
54
|
-
"@types/node": "^16.
|
|
61
|
+
"@types/node": "^16.18.59",
|
|
55
62
|
"@types/react": "^17.0.37",
|
|
56
63
|
"@types/react-dom": "^17.0.11",
|
|
57
|
-
"
|
|
64
|
+
"axe-core": "^4.8.2",
|
|
65
|
+
"babel-loader": "^8.3.0",
|
|
66
|
+
"css-loader": "^6.8.1",
|
|
67
|
+
"cypress": "^13.3.1",
|
|
68
|
+
"cypress-axe": "^1.5.0",
|
|
69
|
+
"cypress-image-diff-js": "^1.32.0",
|
|
70
|
+
"eslint-plugin-cypress": "^2.15.1",
|
|
58
71
|
"mkdirp": "^1.0.4",
|
|
59
72
|
"np": "^7.6.0",
|
|
60
|
-
"react": "^16.
|
|
61
|
-
"react-dom": "^16.
|
|
73
|
+
"react": "^16.14.0",
|
|
74
|
+
"react-dom": "^16.14.0",
|
|
62
75
|
"react-hook-form": "^7.38.0",
|
|
63
76
|
"react-router-dom": "^6.3.0",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
77
|
+
"ts-loader": "^9.5.0",
|
|
78
|
+
"typescript": "^4.9.5",
|
|
79
|
+
"webpack": "^5.89.0"
|
|
66
80
|
},
|
|
67
81
|
"peerDependencies": {
|
|
82
|
+
"@ukic/fonts": "^2.6.0",
|
|
68
83
|
"react": "^16.7.0 || ^17.0.2 || ^18.2.0",
|
|
69
84
|
"react-dom": "^16.7.0 || ^17.0.2 || ^18.2.0"
|
|
70
85
|
},
|
|
71
86
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "d5a95835136923d7ccf2990b32bd5972535aef7d"
|
|
73
88
|
}
|