genesys-spark-components-react 4.0.0-beta.43 → 4.0.0-beta.45
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/react-component-lib/createComponent.js +1 -1
- package/dist/react-component-lib/createOverlayComponent.js +1 -1
- package/dist/react-component-lib/utils/attachProps.d.ts +4 -0
- package/dist/react-component-lib/utils/attachProps.js +11 -1
- package/dist/react-component-lib/utils/index.js +2 -4
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const GuxFormFieldSelect: import("react").ForwardRefExoticCompone
|
|
|
46
46
|
export declare const GuxFormFieldTextLike: import("react").ForwardRefExoticComponent<JSX.GuxFormFieldTextLike & Omit<import("react").HTMLAttributes<HTMLGuxFormFieldTextLikeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxFormFieldTextLikeElement>>;
|
|
47
47
|
export declare const GuxFormFieldTextarea: import("react").ForwardRefExoticComponent<JSX.GuxFormFieldTextarea & Omit<import("react").HTMLAttributes<HTMLGuxFormFieldTextareaElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxFormFieldTextareaElement>>;
|
|
48
48
|
export declare const GuxFormFieldTimePicker: import("react").ForwardRefExoticComponent<JSX.GuxFormFieldTimePicker & Omit<import("react").HTMLAttributes<HTMLGuxFormFieldTimePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxFormFieldTimePickerElement>>;
|
|
49
|
+
export declare const GuxFormFieldTimeZonePicker: import("react").ForwardRefExoticComponent<JSX.GuxFormFieldTimeZonePicker & Omit<import("react").HTMLAttributes<HTMLGuxFormFieldTimeZonePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxFormFieldTimeZonePickerElement>>;
|
|
49
50
|
export declare const GuxIcon: import("react").ForwardRefExoticComponent<JSX.GuxIcon & Omit<import("react").HTMLAttributes<HTMLGuxIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxIconElement>>;
|
|
50
51
|
export declare const GuxInlineAlert: import("react").ForwardRefExoticComponent<JSX.GuxInlineAlert & Omit<import("react").HTMLAttributes<HTMLGuxInlineAlertElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxInlineAlertElement>>;
|
|
51
52
|
export declare const GuxList: import("react").ForwardRefExoticComponent<JSX.GuxList & Omit<import("react").HTMLAttributes<HTMLGuxListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxListElement>>;
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ export const GuxFormFieldSelect = /*@__PURE__*/ createReactComponent('gux-form-f
|
|
|
48
48
|
export const GuxFormFieldTextLike = /*@__PURE__*/ createReactComponent('gux-form-field-text-like');
|
|
49
49
|
export const GuxFormFieldTextarea = /*@__PURE__*/ createReactComponent('gux-form-field-textarea');
|
|
50
50
|
export const GuxFormFieldTimePicker = /*@__PURE__*/ createReactComponent('gux-form-field-time-picker');
|
|
51
|
+
export const GuxFormFieldTimeZonePicker = /*@__PURE__*/ createReactComponent('gux-form-field-time-zone-picker');
|
|
51
52
|
export const GuxIcon = /*@__PURE__*/ createReactComponent('gux-icon');
|
|
52
53
|
export const GuxInlineAlert = /*@__PURE__*/ createReactComponent('gux-inline-alert');
|
|
53
54
|
export const GuxList = /*@__PURE__*/ createReactComponent('gux-list');
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { createElement } from 'react';
|
|
13
|
-
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs
|
|
13
|
+
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
14
14
|
export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
|
|
15
15
|
if (defineCustomElement !== undefined) {
|
|
16
16
|
defineCustomElement();
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import ReactDOM from 'react-dom';
|
|
14
|
-
import { attachProps, dashToPascalCase, defineCustomElement, setRef
|
|
14
|
+
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
15
15
|
export const createOverlayComponent = (tagName, controller, customElement) => {
|
|
16
16
|
defineCustomElement(tagName, customElement);
|
|
17
17
|
const displayName = dashToPascalCase(tagName);
|
|
@@ -1,5 +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
|
+
* Transforms a React event name to a browser event name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
|
3
7
|
/**
|
|
4
8
|
* Checks if an event is supported in the current execution environment.
|
|
5
9
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
@@ -57,6 +57,16 @@ export const getClassName = (classList, newProps, oldProps) => {
|
|
|
57
57
|
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
58
58
|
return finalClassNames.join(' ');
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Transforms a React event name to a browser event name.
|
|
62
|
+
*/
|
|
63
|
+
export const transformReactEventName = (eventNameSuffix) => {
|
|
64
|
+
switch (eventNameSuffix) {
|
|
65
|
+
case 'doubleclick':
|
|
66
|
+
return 'dblclick';
|
|
67
|
+
}
|
|
68
|
+
return eventNameSuffix;
|
|
69
|
+
};
|
|
60
70
|
/**
|
|
61
71
|
* Checks if an event is supported in the current execution environment.
|
|
62
72
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
@@ -66,7 +76,7 @@ export const isCoveredByReact = (eventNameSuffix) => {
|
|
|
66
76
|
return true;
|
|
67
77
|
}
|
|
68
78
|
else {
|
|
69
|
-
const eventName = 'on' + eventNameSuffix;
|
|
79
|
+
const eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
70
80
|
let isSupported = eventName in document;
|
|
71
81
|
if (!isSupported) {
|
|
72
82
|
const element = document.createElement('div');
|
|
@@ -10,7 +10,7 @@ export const setRef = (ref, value) => {
|
|
|
10
10
|
};
|
|
11
11
|
export const mergeRefs = (...refs) => {
|
|
12
12
|
return (value) => {
|
|
13
|
-
refs.forEach(ref => {
|
|
13
|
+
refs.forEach((ref) => {
|
|
14
14
|
setRef(ref, value);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
@@ -23,9 +23,7 @@ export const createForwardRef = (ReactComponent, displayName) => {
|
|
|
23
23
|
return React.forwardRef(forwardRef);
|
|
24
24
|
};
|
|
25
25
|
export const defineCustomElement = (tagName, customElement) => {
|
|
26
|
-
if (customElement !== undefined &&
|
|
27
|
-
typeof customElements !== 'undefined' &&
|
|
28
|
-
!customElements.get(tagName)) {
|
|
26
|
+
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
29
27
|
customElements.define(tagName, customElement);
|
|
30
28
|
}
|
|
31
29
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genesys-spark-components-react",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.45",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"version-sync": "npm version --no-git-tag-version --allow-same-version"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"genesys-spark-components": "4.0.0-beta.
|
|
22
|
+
"genesys-spark-components": "4.0.0-beta.45"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@types/react": "16 - 18",
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
"react-dom": "16 - 18"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/react": "^17.0.
|
|
31
|
-
"@types/react-dom": "^17.0.
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
33
|
-
"@typescript-eslint/parser": "^6.
|
|
34
|
-
"eslint": "^8.
|
|
30
|
+
"@types/react": "^17.0.68",
|
|
31
|
+
"@types/react-dom": "^17.0.21",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
|
33
|
+
"@typescript-eslint/parser": "^6.7.5",
|
|
34
|
+
"eslint": "^8.51.0",
|
|
35
35
|
"eslint-config-genesys-spark-components": "file:../../shared-configs/eslint-config-genesys-spark-components",
|
|
36
|
-
"eslint-config-prettier": "^8.
|
|
37
|
-
"lint-staged": "^13.
|
|
36
|
+
"eslint-config-prettier": "^8.10.0",
|
|
37
|
+
"lint-staged": "^13.3.0",
|
|
38
38
|
"npm-run-all": "^4.1.5",
|
|
39
|
-
"prettier": "^3.0.
|
|
39
|
+
"prettier": "^3.0.3",
|
|
40
40
|
"prettier-config-genesys-spark-components": "file:../../shared-configs/prettier-config-genesys-spark-components",
|
|
41
41
|
"prettier-package-json": "^2.8.0",
|
|
42
42
|
"react": "^17.0.2",
|
|
43
43
|
"react-dom": "17.0.2",
|
|
44
|
-
"typescript": "^4.5
|
|
44
|
+
"typescript": "^4.9.5"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"registry": "https://registry.npmjs.org/"
|