@elliemae/ds-breadcrumb 2.2.0-alpha.4 → 3.0.0-next.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/cjs/DSBreadcrumb.js +97 -81
- package/cjs/DSBreadcrumbItem.js +92 -80
- package/cjs/hooks/useKeyboardNavigation.js +15 -42
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +15 -37
- package/cjs/styles.js +66 -105
- package/esm/DSBreadcrumb.js +79 -48
- package/esm/DSBreadcrumbItem.js +80 -50
- package/esm/hooks/useKeyboardNavigation.js +9 -11
- package/esm/index.d.js +1 -2
- package/esm/index.js +2 -8
- package/esm/styles.js +55 -76
- package/package.json +5 -5
- package/cjs/DSBreadcrumb.js.map +0 -7
- package/cjs/DSBreadcrumbItem.js.map +0 -7
- package/cjs/hooks/useKeyboardNavigation.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/esm/DSBreadcrumb.js.map +0 -7
- package/esm/DSBreadcrumbItem.js.map +0 -7
- package/esm/hooks/useKeyboardNavigation.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/styles.js.map +0 -7
package/cjs/DSBreadcrumb.js
CHANGED
|
@@ -1,86 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const [addRef, onKeyDown] = (0, import_useKeyboardNavigation.useKeyboardNavigation)();
|
|
52
|
-
const safeElement = (0, import_react.useMemo)(() => htmlElements.indexOf(as) > -1 ? as : "nav", [as]);
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
14
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
15
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
16
|
+
var React = require('react');
|
|
17
|
+
var reactDesc = require('react-desc');
|
|
18
|
+
var DSBreadcrumbItem = require('./DSBreadcrumbItem.js');
|
|
19
|
+
var useKeyboardNavigation = require('./hooks/useKeyboardNavigation.js');
|
|
20
|
+
var styles = require('./styles.js');
|
|
21
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
22
|
+
|
|
23
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
+
|
|
25
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
26
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
27
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
28
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
+
|
|
30
|
+
const _excluded = ["containerProps", "as", "label", "isTitle", "children", "trailingSlash"];
|
|
31
|
+
|
|
32
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
+
|
|
34
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
|
+
const htmlElements = ['nav', 'div', 'header', 'footer', 'main'];
|
|
36
|
+
|
|
37
|
+
const DSBreadcrumb = _ref => {
|
|
38
|
+
let {
|
|
39
|
+
containerProps = {},
|
|
40
|
+
as = 'nav',
|
|
41
|
+
label = 'Breadcrumb',
|
|
42
|
+
isTitle = false,
|
|
43
|
+
children,
|
|
44
|
+
trailingSlash = true
|
|
45
|
+
} = _ref,
|
|
46
|
+
rest = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
47
|
+
|
|
48
|
+
const [addRef, onKeyDown] = useKeyboardNavigation.useKeyboardNavigation();
|
|
49
|
+
const safeElement = React.useMemo(() => htmlElements.indexOf(as) > -1 ? as : 'nav', [as]);
|
|
50
|
+
return /*#__PURE__*/jsxRuntime.jsx(styles.StyledContainer, _objectSpread(_objectSpread(_objectSpread({
|
|
54
51
|
"aria-label": label,
|
|
55
|
-
"data-testid": "breadcrumb-nav-container"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}))
|
|
52
|
+
"data-testid": "breadcrumb-nav-container"
|
|
53
|
+
}, rest), containerProps), {}, {
|
|
54
|
+
as: safeElement,
|
|
55
|
+
children: /*#__PURE__*/_jsx__default["default"](styles.StyledList, {
|
|
56
|
+
"data-testid": "list-container"
|
|
57
|
+
}, void 0, React__default["default"].Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? /*#__PURE__*/React.cloneElement(child, {
|
|
58
|
+
childIndex,
|
|
59
|
+
addRef,
|
|
60
|
+
onKeyDown
|
|
61
|
+
}) : /*#__PURE__*/React.cloneElement(child, {
|
|
62
|
+
childIndex,
|
|
63
|
+
addRef,
|
|
64
|
+
onKeyDown,
|
|
65
|
+
trailingSlash,
|
|
66
|
+
isTitle
|
|
67
|
+
})))
|
|
68
|
+
}));
|
|
72
69
|
};
|
|
73
|
-
|
|
70
|
+
|
|
71
|
+
DSBreadcrumb.Item = DSBreadcrumbItem.DSBreadcrumbItem;
|
|
74
72
|
const props = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
/** props injected to breadcrumb wrapper */
|
|
74
|
+
containerProps: reactDesc.PropTypes.object.description('props injected to breadcrumb wrapper'),
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Type of element you want the main container to be:
|
|
78
|
+
* 'nav', 'div', 'header', 'footer', 'main'
|
|
79
|
+
*/
|
|
80
|
+
as: reactDesc.PropTypes.string.description("Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'"),
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Whether to show the last element of the breadcrumb as a title
|
|
84
|
+
* Also removes trailing slash to show last element as title
|
|
85
|
+
*/
|
|
86
|
+
isTitle: reactDesc.PropTypes.bool.description('Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title'),
|
|
87
|
+
|
|
88
|
+
/** breadcrumb label */
|
|
89
|
+
label: reactDesc.PropTypes.string.description('breadcrumb label'),
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Container items to wrap
|
|
93
|
+
*/
|
|
94
|
+
children: reactDesc.PropTypes.arrayOf(DSBreadcrumbItem.DSBreadcrumbItem).isRequired.description('Container items to wrap')
|
|
80
95
|
};
|
|
81
|
-
|
|
82
|
-
const DSBreadcrumbWithSchema = (0, import_react_desc.describe)(DSBreadcrumb);
|
|
96
|
+
const DSBreadcrumbWithSchema = reactDesc.describe(DSBreadcrumb);
|
|
83
97
|
DSBreadcrumbWithSchema.propTypes = props;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
|
|
99
|
+
exports.DSBreadcrumb = DSBreadcrumb;
|
|
100
|
+
exports.DSBreadcrumbWithSchema = DSBreadcrumbWithSchema;
|
|
101
|
+
exports["default"] = DSBreadcrumb;
|
|
102
|
+
exports.htmlElements = htmlElements;
|
package/cjs/DSBreadcrumbItem.js
CHANGED
|
@@ -1,86 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_react_desc = require("react-desc");
|
|
37
|
-
var import_styles = require("./styles");
|
|
38
|
-
function DSBreadcrumbItem({
|
|
39
|
-
active = false,
|
|
40
|
-
as = "a",
|
|
41
|
-
href = void 0,
|
|
42
|
-
isTitle,
|
|
43
|
-
onClick = () => null,
|
|
44
|
-
label = "",
|
|
45
|
-
color = null,
|
|
46
|
-
addRef,
|
|
47
|
-
childIndex,
|
|
48
|
-
trailingSlash,
|
|
49
|
-
onKeyDown = () => null,
|
|
50
|
-
...rest
|
|
51
|
-
}) {
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledCrumbWrapper, {
|
|
53
|
-
"aria-current": active ? "page" : void 0,
|
|
54
|
-
"data-testid": "breadcrumb-item-container",
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
|
+
require('react');
|
|
13
|
+
var reactDesc = require('react-desc');
|
|
14
|
+
var styles = require('./styles.js');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
21
|
+
|
|
22
|
+
const _excluded = ["active", "as", "href", "isTitle", "onClick", "label", "color", "addRef", "childIndex", "trailingSlash", "onKeyDown"];
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
28
|
+
function DSBreadcrumbItem(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
active = false,
|
|
31
|
+
as = 'a',
|
|
32
|
+
href = undefined,
|
|
55
33
|
isTitle,
|
|
34
|
+
onClick = () => null,
|
|
35
|
+
label = '',
|
|
36
|
+
color = null,
|
|
37
|
+
addRef,
|
|
38
|
+
childIndex,
|
|
56
39
|
trailingSlash,
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
40
|
+
onKeyDown = () => null
|
|
41
|
+
} = _ref,
|
|
42
|
+
rest = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
43
|
+
|
|
44
|
+
return /*#__PURE__*/jsxRuntime.jsx(styles.StyledCrumbWrapper, _objectSpread(_objectSpread({
|
|
45
|
+
"aria-current": active ? 'page' : undefined,
|
|
46
|
+
"data-testid": "breadcrumb-item-container",
|
|
47
|
+
isTitle: isTitle,
|
|
48
|
+
trailingSlash: trailingSlash
|
|
49
|
+
}, rest), {}, {
|
|
50
|
+
children: /*#__PURE__*/jsxRuntime.jsx(styles.StyledLink, {
|
|
51
|
+
as: as,
|
|
52
|
+
href: href,
|
|
53
|
+
onClick: onClick,
|
|
54
|
+
ref: addRef,
|
|
55
|
+
tabIndex: 0,
|
|
56
|
+
isActive: active,
|
|
57
|
+
onKeyDown: e => onKeyDown(e, childIndex, onClick),
|
|
58
|
+
isTitle: isTitle,
|
|
59
|
+
color: color,
|
|
60
|
+
children: label
|
|
61
|
+
})
|
|
62
|
+
}));
|
|
69
63
|
}
|
|
64
|
+
|
|
70
65
|
const props = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
/** inject props to wrapper */
|
|
67
|
+
containerComponent: reactDesc.PropTypes.string.description('inject props to wrapper'),
|
|
68
|
+
|
|
69
|
+
/** render as any html node */
|
|
70
|
+
as: reactDesc.PropTypes.string.description('render as any html node'),
|
|
71
|
+
|
|
72
|
+
/** active item */
|
|
73
|
+
active: reactDesc.PropTypes.bool.description('active item'),
|
|
74
|
+
|
|
75
|
+
/** href link */
|
|
76
|
+
href: reactDesc.PropTypes.string.description('href link'),
|
|
77
|
+
|
|
78
|
+
/** on click handler */
|
|
79
|
+
onClick: reactDesc.PropTypes.func.description('on click handler'),
|
|
80
|
+
|
|
81
|
+
/** style item as title */
|
|
82
|
+
isTitle: reactDesc.PropTypes.bool.description('style item as title'),
|
|
83
|
+
|
|
84
|
+
/** add trailing slash */
|
|
85
|
+
trailingSlash: reactDesc.PropTypes.bool.description('add trailing slash'),
|
|
86
|
+
|
|
87
|
+
/** item label */
|
|
88
|
+
label: reactDesc.PropTypes.string.description('item label'),
|
|
89
|
+
|
|
90
|
+
/** link color */
|
|
91
|
+
color: reactDesc.PropTypes.string.description('link color')
|
|
80
92
|
};
|
|
81
|
-
|
|
82
|
-
const DSBreadcrumbItemWithSchema = (0, import_react_desc.describe)(DSBreadcrumbItem);
|
|
93
|
+
const DSBreadcrumbItemWithSchema = reactDesc.describe(DSBreadcrumbItem);
|
|
83
94
|
DSBreadcrumbItemWithSchema.propTypes = props;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
|
|
96
|
+
exports.DSBreadcrumbItem = DSBreadcrumbItem;
|
|
97
|
+
exports.DSBreadcrumbItemWithSchema = DSBreadcrumbItemWithSchema;
|
|
98
|
+
exports["default"] = DSBreadcrumbItem;
|
|
@@ -1,57 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var useKeyboardNavigation_exports = {};
|
|
29
|
-
__export(useKeyboardNavigation_exports, {
|
|
30
|
-
useKeyboardNavigation: () => useKeyboardNavigation
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = require("react");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
34
7
|
const useKeyboardNavigation = () => {
|
|
35
|
-
const componentsRef =
|
|
36
|
-
const addRef =
|
|
8
|
+
const componentsRef = React.useRef([]);
|
|
9
|
+
const addRef = React.useCallback(ref => {
|
|
37
10
|
if (ref && !componentsRef.current.includes(ref)) {
|
|
38
11
|
componentsRef.current.push(ref);
|
|
39
12
|
}
|
|
40
13
|
}, []);
|
|
41
|
-
const onKeyDown =
|
|
42
|
-
if (e.key ===
|
|
14
|
+
const onKeyDown = React.useCallback((e, componentRefIndex, callback) => {
|
|
15
|
+
if (e.key === 'ArrowDown' && componentsRef.current[componentRefIndex + 1]) {
|
|
43
16
|
componentsRef.current[componentRefIndex + 1].focus();
|
|
44
17
|
e.preventDefault();
|
|
45
|
-
} else if (e.key ===
|
|
18
|
+
} else if (e.key === 'ArrowUp' && componentRefIndex !== 0) {
|
|
46
19
|
componentsRef.current[componentRefIndex - 1].focus();
|
|
47
20
|
e.preventDefault();
|
|
48
|
-
} else if (e.key ===
|
|
21
|
+
} else if (e.key === 'Enter') {
|
|
49
22
|
callback();
|
|
50
|
-
} else if (e.ctrlKey && e.altKey && e.key ===
|
|
23
|
+
} else if (e.ctrlKey && e.altKey && e.key === ' ') {
|
|
51
24
|
componentsRef.current[componentRefIndex].click();
|
|
52
25
|
}
|
|
53
26
|
}, []);
|
|
54
27
|
return [addRef, onKeyDown];
|
|
55
28
|
};
|
|
56
|
-
|
|
57
|
-
|
|
29
|
+
|
|
30
|
+
exports.useKeyboardNavigation = useKeyboardNavigation;
|
package/cjs/index.d.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/index.js
CHANGED
|
@@ -1,37 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
default: () => import_DSBreadcrumb.default
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
__reExport(src_exports, require("./DSBreadcrumb"));
|
|
34
|
-
__reExport(src_exports, require("./DSBreadcrumbItem"));
|
|
35
|
-
var import_DSBreadcrumb = require("./DSBreadcrumb");
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSBreadcrumb = require('./DSBreadcrumb.js');
|
|
6
|
+
var DSBreadcrumbItem = require('./DSBreadcrumbItem.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DSBreadcrumb = DSBreadcrumb.DSBreadcrumb;
|
|
11
|
+
exports.DSBreadcrumbWithSchema = DSBreadcrumb.DSBreadcrumbWithSchema;
|
|
12
|
+
exports["default"] = DSBreadcrumb.DSBreadcrumb;
|
|
13
|
+
exports.htmlElements = DSBreadcrumb.htmlElements;
|
|
14
|
+
exports.DSBreadcrumbItem = DSBreadcrumbItem.DSBreadcrumbItem;
|
|
15
|
+
exports.DSBreadcrumbItemWithSchema = DSBreadcrumbItem.DSBreadcrumbItemWithSchema;
|