@clayui/shared
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -6,2 +6,8 @@ # Change Log | ||
## [3.1.2](https://github.com/liferay/clay/compare/@clayui/shared@3.1.1...@clayui/shared@3.1.2) (2020-06-18) | ||
### Bug Fixes | ||
- **@clayui/shared:** only preventDefault if next/previous node exists in the focusManager ([6317e69](https://github.com/liferay/clay/commit/6317e69)) | ||
## [3.1.1](https://github.com/liferay/clay/compare/@clayui/shared@3.1.0...@clayui/shared@3.1.1) (2020-04-24) | ||
@@ -8,0 +14,0 @@ |
@@ -43,11 +43,13 @@ "use strict"; | ||
if (arrowKeysUpDown && keyCode === ARROW_DOWN_KEY_CODE || arrowKeysLeftRight && keyCode === ARROW_RIGHT_KEY_CODE || keyCode === TAB_KEY_CODE && !shiftKey) { | ||
event.preventDefault(); | ||
focusManager.focusNext(); | ||
if (focusManager.focusNext()) { | ||
event.preventDefault(); | ||
} | ||
} else if (arrowKeysUpDown && keyCode === ARROW_UP_KEY_CODE || arrowKeysLeftRight && keyCode === ARROW_LEFT_KEY_CODE || keyCode === TAB_KEY_CODE && shiftKey) { | ||
event.preventDefault(); | ||
focusManager.focusPrevious(); | ||
if (focusManager.focusPrevious()) { | ||
event.preventDefault(); | ||
} | ||
} | ||
}; | ||
return _react.default.cloneElement(children, { | ||
return /*#__PURE__*/_react.default.cloneElement(children, { | ||
onKeyDown: function onKeyDown(event) { | ||
@@ -54,0 +56,0 @@ _onKeyDown(event); // If the element already exists a `onKeyDown` event should |
@@ -8,3 +8,3 @@ import React from 'react'; | ||
} | ||
export declare const getEllipsisItems: (config: IBufferList, ellipsisBuffer: number, activeIndex?: number) => Object[]; | ||
export declare const getEllipsisItems: (config: IBufferList, ellipsisBuffer: number, activeIndex?: number) => (number | Object)[]; | ||
export {}; |
@@ -12,10 +12,14 @@ "use strict"; | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _extends() { _extends = Object.assign || 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); } | ||
@@ -31,3 +35,3 @@ | ||
if (removedItems.length > 1) { | ||
return [_react.default.createElement(EllipsisComponent, _extends({ | ||
return [/*#__PURE__*/_react.default.createElement(EllipsisComponent, _extends({ | ||
items: removedItems, | ||
@@ -34,0 +38,0 @@ key: "ellipsisComponent", |
@@ -22,3 +22,3 @@ "use strict"; | ||
var LinkOrButton = _react.default.forwardRef(function (_ref, ref) { | ||
var LinkOrButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) { | ||
var buttonDisplayType = _ref.buttonDisplayType, | ||
@@ -32,3 +32,3 @@ buttonType = _ref.buttonType, | ||
if (href) { | ||
return _react.default.createElement(_link.default, _extends({}, otherProps, { | ||
return /*#__PURE__*/_react.default.createElement(_link.default, _extends({}, otherProps, { | ||
displayType: linkDisplayType, | ||
@@ -40,3 +40,3 @@ href: href, | ||
return _react.default.createElement(_button.default, _extends({}, otherProps, { | ||
return /*#__PURE__*/_react.default.createElement(_button.default, _extends({}, otherProps, { | ||
displayType: buttonDisplayType, | ||
@@ -43,0 +43,0 @@ onClick: onClick, |
@@ -46,9 +46,9 @@ "use strict"; | ||
var content = _react.default.createElement(ClayPortalContext.Provider, { | ||
var content = /*#__PURE__*/_react.default.createElement(ClayPortalContext.Provider, { | ||
value: subPortalRef ? subPortalRef : portalRef | ||
}, children); | ||
return portalRef.current ? (0, _reactDom.createPortal)(content, portalRef.current) : content; | ||
return portalRef.current ? /*#__PURE__*/(0, _reactDom.createPortal)(content, portalRef.current) : content; | ||
}; | ||
exports.ClayPortal = ClayPortal; |
@@ -1,1 +0,1 @@ | ||
export declare const sub: (langKey: string, args: (string | number)[]) => string; | ||
export declare const sub: (langKey: string, args: Array<React.ReactText>) => string; |
@@ -12,18 +12,22 @@ "use strict"; | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
@@ -30,0 +34,0 @@ |
import React from 'react'; | ||
export declare function useTransitionHeight(visible: boolean, setVisible: any, contentRef: React.RefObject<any>): [boolean, (event: React.TransitionEvent<Element>) => void, (event: MouseEvent | React.MouseEvent<Element, MouseEvent>) => void]; | ||
export declare function useTransitionHeight(visible: boolean, setVisible: any, contentRef: React.RefObject<any>): [boolean, (event: React.TransitionEvent) => void, (event: React.MouseEvent | MouseEvent) => void]; |
@@ -12,8 +12,12 @@ "use strict"; | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
@@ -20,0 +24,0 @@ |
{ | ||
"name": "@clayui/shared", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "ClayShared component", | ||
@@ -30,3 +30,3 @@ "license": "BSD-3-Clause", | ||
"@clayui/button": "^3.3.1", | ||
"@clayui/link": "^3.1.1" | ||
"@clayui/link": "^3.2.0" | ||
}, | ||
@@ -41,3 +41,3 @@ "peerDependencies": { | ||
], | ||
"gitHead": "315966237dc08b74f9d7bc28e7455946f104a026" | ||
"gitHead": "0b4bbca3faa7445e2e10acc86d6288d20f2bc9dc" | ||
} |
@@ -12,3 +12,5 @@ /** | ||
export const sub = (langKey: string, args: Array<React.ReactText>) => { | ||
const keyArray = langKey.split(SPLIT_REGEX).filter(val => val.length !== 0); | ||
const keyArray = langKey | ||
.split(SPLIT_REGEX) | ||
.filter((val) => val.length !== 0); | ||
@@ -15,0 +17,0 @@ for (let i = 0; i < args.length; i++) { |
@@ -90,3 +90,3 @@ /** | ||
const internalKey = Object.keys(scope.current).find( | ||
key => key.indexOf('__reactInternalInstance') === 0 | ||
(key) => key.indexOf('__reactInternalInstance') === 0 | ||
); | ||
@@ -178,3 +178,3 @@ | ||
const nodePosition = focusableElementsEdge.findIndex( | ||
el => document.activeElement === el | ||
(el) => document.activeElement === el | ||
); | ||
@@ -181,0 +181,0 @@ let nextElement = null; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57396
1328
Updated@clayui/link@^3.2.0