@uncinc/uncinc-react-kitchen-sink 2.21.2 → 2.21.4
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/Context/withMapping.d.ts +1 -1
- package/dist/Context/withMapping.js +4 -3
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Form/Checkbox/index.js +1 -1
- package/dist/components/Form/GenericFormElement/index.js +1 -1
- package/dist/components/Form/SearchField/index.js +1 -1
- package/dist/components/Form/TextField/index.js +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/Share/index.d.ts +3 -1
- package/dist/components/Share/index.js +12 -6
- package/dist/components/WysiwygField/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import KitchenSinkComponentMapperContext from './KitchenSinkComponentMapperContext';
|
|
4
|
-
var withMapping = function withMapping(BaseComponent) {
|
|
4
|
+
var withMapping = function withMapping(BaseComponent, mappingKey) {
|
|
5
5
|
return function (props) {
|
|
6
6
|
var componentIsWrapped = props.componentIsWrapped;
|
|
7
7
|
var context = useContext(KitchenSinkComponentMapperContext);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var key = mappingKey || BaseComponent.displayName || BaseComponent.name;
|
|
9
|
+
if (context && BaseComponent && !componentIsWrapped && context[key]) {
|
|
10
|
+
var WrapperComponent = context[key];
|
|
10
11
|
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({}, props, {
|
|
11
12
|
componentIsWrapped: true
|
|
12
13
|
}), props.children);
|
|
@@ -55,4 +55,4 @@ var GenericFormElement = function GenericFormElement(props) {
|
|
|
55
55
|
className: "FormElement__error ".concat(className, "__error")
|
|
56
56
|
}, error) : null));
|
|
57
57
|
};
|
|
58
|
-
export default withMapping(GenericFormElement);
|
|
58
|
+
export default withMapping(GenericFormElement, 'GenericFormElement');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default Share;
|
|
2
|
-
declare function Share({ title, pageTitle, url, items, onClick, customItems, withLabels, headingLevel }: {
|
|
2
|
+
declare function Share({ title, pageTitle, url, items, onClick, customItems, withLabels, headingLevel, isDropdown }: {
|
|
3
3
|
title: any;
|
|
4
4
|
pageTitle: any;
|
|
5
5
|
url: any;
|
|
@@ -8,6 +8,7 @@ declare function Share({ title, pageTitle, url, items, onClick, customItems, wit
|
|
|
8
8
|
customItems: any;
|
|
9
9
|
withLabels: any;
|
|
10
10
|
headingLevel?: number | undefined;
|
|
11
|
+
isDropdown?: boolean | undefined;
|
|
11
12
|
}): React.JSX.Element;
|
|
12
13
|
declare namespace Share {
|
|
13
14
|
namespace defaultProps {
|
|
@@ -18,6 +19,7 @@ declare namespace Share {
|
|
|
18
19
|
function onClick(): void;
|
|
19
20
|
let withLabels: boolean;
|
|
20
21
|
let customItems: {};
|
|
22
|
+
let isDropdown: boolean;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
import React from 'react';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { EmailShareButton, FacebookShareButton, LinkedinShareButton, TwitterShareButton, WhatsappShareButton, PinterestShareButton, RedditShareButton, TelegramShareButton } from 'react-share';
|
|
3
4
|
import './style.scss';
|
|
@@ -44,7 +45,9 @@ var Share = function Share(_ref2) {
|
|
|
44
45
|
customItems = _ref2.customItems,
|
|
45
46
|
withLabels = _ref2.withLabels,
|
|
46
47
|
_ref2$headingLevel = _ref2.headingLevel,
|
|
47
|
-
headingLevel = _ref2$headingLevel === void 0 ? 3 : _ref2$headingLevel
|
|
48
|
+
headingLevel = _ref2$headingLevel === void 0 ? 3 : _ref2$headingLevel,
|
|
49
|
+
_ref2$isDropdown = _ref2.isDropdown,
|
|
50
|
+
isDropdown = _ref2$isDropdown === void 0 ? true : _ref2$isDropdown;
|
|
48
51
|
var HeadingTag = "h".concat(headingLevel);
|
|
49
52
|
var windowUrl = url || window.location.href;
|
|
50
53
|
var buttons = items.map(function (item) {
|
|
@@ -65,10 +68,12 @@ var Share = function Share(_ref2) {
|
|
|
65
68
|
className: "Share"
|
|
66
69
|
}, /*#__PURE__*/React.createElement("div", {
|
|
67
70
|
className: "Share__wrapper"
|
|
68
|
-
}, /*#__PURE__*/React.createElement(HeadingTag, {
|
|
69
|
-
className: "Share__title"
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
}, /*#__PURE__*/React.createElement(HeadingTag, _extends({
|
|
72
|
+
className: "Share__title"
|
|
73
|
+
}, isDropdown && {
|
|
74
|
+
tabIndex: '0',
|
|
75
|
+
role: 'button'
|
|
76
|
+
}), title), /*#__PURE__*/React.createElement("div", {
|
|
72
77
|
className: "Share__buttons"
|
|
73
78
|
}, buttons)));
|
|
74
79
|
};
|
|
@@ -79,6 +84,7 @@ Share.defaultProps = {
|
|
|
79
84
|
items: ['mail', 'facebook', 'linkedin', 'twitter', 'whatsapp'],
|
|
80
85
|
onClick: function onClick() {},
|
|
81
86
|
withLabels: false,
|
|
82
|
-
customItems: {}
|
|
87
|
+
customItems: {},
|
|
88
|
+
isDropdown: true
|
|
83
89
|
};
|
|
84
90
|
export default Share;
|