@carbon/vue 3.0.27 → 3.0.29
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/carbon-vue-3.common.js +144 -23
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.umd.js +144 -23
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +1 -1
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/dist/web-types.json +18 -2
- package/package.json +1 -1
- package/src/components/CvDropdown/CvDropdown.vue +25 -5
- package/src/components/CvUIShell/CvContent.vue +7 -1
- package/src/components/CvUIShell/CvHeaderMenu.vue +2 -1
- package/src/components/CvUIShell/CvHeaderMenuItem.vue +8 -3
- package/src/components/CvUIShell/CvHeaderNav.vue +10 -1
- package/src/components/CvUIShell/CvHeaderPanel.vue +42 -0
- package/src/components/CvUIShell/CvSideNav.vue +36 -0
- package/src/components/CvUIShell/CvUIShell.stories.mdx +19 -15
|
@@ -9562,6 +9562,13 @@ var _hoisted_7 = ["aria-disabled"];
|
|
|
9562
9562
|
});
|
|
9563
9563
|
var el = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
9564
9564
|
function onClickOut() {
|
|
9565
|
+
// Move focus to button if focus is inside dropdown list
|
|
9566
|
+
var dropListEl = dropList.value;
|
|
9567
|
+
if (dropListEl && dropListEl.contains(document.activeElement)) {
|
|
9568
|
+
if (button.value && typeof button.value.focus === 'function') {
|
|
9569
|
+
button.value.focus();
|
|
9570
|
+
}
|
|
9571
|
+
}
|
|
9565
9572
|
open.value = false;
|
|
9566
9573
|
}
|
|
9567
9574
|
(0,index_esm/* onClickOutside */.X2)(el, onClickOut);
|
|
@@ -9608,8 +9615,14 @@ var _hoisted_7 = ["aria-disabled"];
|
|
|
9608
9615
|
}
|
|
9609
9616
|
}
|
|
9610
9617
|
function onEsc() {
|
|
9618
|
+
// Move focus to button if focus is inside dropdown list
|
|
9619
|
+
var dropListEl = dropList.value;
|
|
9620
|
+
if (dropListEl && dropListEl.contains(document.activeElement)) {
|
|
9621
|
+
if (button.value && typeof button.value.focus === 'function') {
|
|
9622
|
+
button.value.focus();
|
|
9623
|
+
}
|
|
9624
|
+
}
|
|
9611
9625
|
open.value = false;
|
|
9612
|
-
doFocus();
|
|
9613
9626
|
}
|
|
9614
9627
|
var button = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
9615
9628
|
var listBox = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(null);
|
|
@@ -9621,8 +9634,10 @@ var _hoisted_7 = ["aria-disabled"];
|
|
|
9621
9634
|
open.value = false;
|
|
9622
9635
|
} else if (ev.target === null || (_listBox$value = listBox.value) !== null && _listBox$value !== void 0 && _listBox$value.contains(ev.target)) {
|
|
9623
9636
|
// list has focus, close and return focus to dropdown
|
|
9637
|
+
if (button.value && typeof button.value.focus === 'function') {
|
|
9638
|
+
button.value.focus();
|
|
9639
|
+
}
|
|
9624
9640
|
open.value = false;
|
|
9625
|
-
doFocus();
|
|
9626
9641
|
ev.preventDefault();
|
|
9627
9642
|
}
|
|
9628
9643
|
}
|
|
@@ -9631,9 +9646,6 @@ var _hoisted_7 = ["aria-disabled"];
|
|
|
9631
9646
|
if (props.disabled) {
|
|
9632
9647
|
ev.preventDefault();
|
|
9633
9648
|
} else {
|
|
9634
|
-
open.value = !open.value;
|
|
9635
|
-
doFocus(); // open or close (Some browsers do not focus on button when clicked)
|
|
9636
|
-
|
|
9637
9649
|
var target = ev.target;
|
|
9638
9650
|
while (!target.classList.contains("".concat(settings/* carbonPrefix */.s, "--dropdown-link")) && (_dropList$value2 = dropList.value) !== null && _dropList$value2 !== void 0 && _dropList$value2.contains(target)) {
|
|
9639
9651
|
var _dropList$value2;
|
|
@@ -9642,6 +9654,14 @@ var _hoisted_7 = ["aria-disabled"];
|
|
|
9642
9654
|
if (target.classList.contains("".concat(settings/* carbonPrefix */.s, "--dropdown-link"))) {
|
|
9643
9655
|
var targetItemEl = target.parentNode;
|
|
9644
9656
|
dataValue.value = targetItemEl.getAttribute('data-value');
|
|
9657
|
+
// Move focus to button before closing
|
|
9658
|
+
if (button.value && typeof button.value.focus === 'function') {
|
|
9659
|
+
button.value.focus();
|
|
9660
|
+
}
|
|
9661
|
+
open.value = false;
|
|
9662
|
+
} else {
|
|
9663
|
+
open.value = !open.value;
|
|
9664
|
+
doFocus(); // open or close (Some browsers do not focus on button when clicked)
|
|
9645
9665
|
}
|
|
9646
9666
|
}
|
|
9647
9667
|
}
|
|
@@ -19963,18 +19983,24 @@ var settings = __webpack_require__(8470);
|
|
|
19963
19983
|
tagType: {
|
|
19964
19984
|
type: String,
|
|
19965
19985
|
default: 'main'
|
|
19986
|
+
},
|
|
19987
|
+
id: {
|
|
19988
|
+
type: String,
|
|
19989
|
+
default: 'main-content'
|
|
19966
19990
|
}
|
|
19967
19991
|
},
|
|
19968
19992
|
setup: function setup(__props) {
|
|
19969
19993
|
return function (_ctx, _cache) {
|
|
19970
19994
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveDynamicComponent)(__props.tagType), {
|
|
19971
|
-
|
|
19995
|
+
id: __props.id,
|
|
19996
|
+
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)("".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--content")),
|
|
19997
|
+
tabindex: "-1"
|
|
19972
19998
|
}, {
|
|
19973
19999
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
|
|
19974
20000
|
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default")];
|
|
19975
20001
|
}),
|
|
19976
20002
|
_: 3
|
|
19977
|
-
}, 8, ["class"]);
|
|
20003
|
+
}, 8, ["id", "class"]);
|
|
19978
20004
|
};
|
|
19979
20005
|
}
|
|
19980
20006
|
});
|
|
@@ -20478,6 +20504,7 @@ var _hoisted_2 = ["aria-label", "aria-labelledby"];
|
|
|
20478
20504
|
ref_key: "el",
|
|
20479
20505
|
ref: el,
|
|
20480
20506
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)("cv-header-menu ".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header__submenu")),
|
|
20507
|
+
role: "menuitem",
|
|
20481
20508
|
onMouseenter: _cache[1] || (_cache[1] = function ($event) {
|
|
20482
20509
|
return doHoverToggle(true);
|
|
20483
20510
|
}),
|
|
@@ -20489,9 +20516,9 @@ var _hoisted_2 = ["aria-label", "aria-labelledby"];
|
|
|
20489
20516
|
"aria-expanded": data.expanded ? 'true' : 'false',
|
|
20490
20517
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)("".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header__menu-item ").concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header__menu-title")),
|
|
20491
20518
|
href: "javascript:void(0)",
|
|
20492
|
-
role: "menuitem",
|
|
20493
20519
|
tabindex: "0",
|
|
20494
20520
|
"aria-label": _ctx.$attrs.ariaLabel,
|
|
20521
|
+
role: "button",
|
|
20495
20522
|
onClick: doToggle,
|
|
20496
20523
|
onKeydown: [_cache[0] || (_cache[0] = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withKeys)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.withModifiers)(function () {}, ["prevent"]), ["space"])), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withKeys)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.withModifiers)(doToggle, ["prevent"]), ["enter"])],
|
|
20497
20524
|
onKeyup: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withKeys)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.withModifiers)(doToggle, ["prevent"]), ["space"]),
|
|
@@ -20714,7 +20741,10 @@ var cvLink = __webpack_require__(7174);
|
|
|
20714
20741
|
|
|
20715
20742
|
|
|
20716
20743
|
|
|
20717
|
-
var _hoisted_1 =
|
|
20744
|
+
var _hoisted_1 = {
|
|
20745
|
+
class: "cv-header-menu-item",
|
|
20746
|
+
role: "none"
|
|
20747
|
+
};
|
|
20718
20748
|
|
|
20719
20749
|
|
|
20720
20750
|
|
|
@@ -20728,7 +20758,7 @@ var _hoisted_1 = ["role"];
|
|
|
20728
20758
|
},
|
|
20729
20759
|
role: {
|
|
20730
20760
|
type: String,
|
|
20731
|
-
default:
|
|
20761
|
+
default: 'menuitem'
|
|
20732
20762
|
}
|
|
20733
20763
|
}, cvLink/* props */.xk),
|
|
20734
20764
|
setup: function setup(__props) {
|
|
@@ -20738,14 +20768,15 @@ var _hoisted_1 = ["role"];
|
|
|
20738
20768
|
var activePage = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(function () {
|
|
20739
20769
|
return props.active && props.ariaCurrent !== 'page';
|
|
20740
20770
|
});
|
|
20771
|
+
var tabindex = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(function () {
|
|
20772
|
+
return props.role === 'menuitem' ? '0' : undefined;
|
|
20773
|
+
});
|
|
20741
20774
|
return function (_ctx, _cache) {
|
|
20742
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("li", {
|
|
20743
|
-
class: "cv-header-menu-item",
|
|
20744
|
-
role: __props.role
|
|
20745
|
-
}, [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveDynamicComponent)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(tagType)), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.mergeProps)((0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, _ctx.$attrs), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(linkProps)), {
|
|
20775
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("li", _hoisted_1, [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveDynamicComponent)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(tagType)), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.mergeProps)((0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, _ctx.$attrs), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(linkProps)), {
|
|
20746
20776
|
class: ["".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header__menu-item"), (0,defineProperty/* default */.A)({}, "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header__menu-item--current"), activePage.value)],
|
|
20747
|
-
|
|
20748
|
-
|
|
20777
|
+
"aria-current": __props.ariaCurrent,
|
|
20778
|
+
role: __props.role,
|
|
20779
|
+
tabindex: tabindex.value
|
|
20749
20780
|
}), {
|
|
20750
20781
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(function () {
|
|
20751
20782
|
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("span", {
|
|
@@ -20753,7 +20784,7 @@ var _hoisted_1 = ["role"];
|
|
|
20753
20784
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default")], 2)];
|
|
20754
20785
|
}),
|
|
20755
20786
|
_: 3
|
|
20756
|
-
}, 16, ["class", "aria-current"
|
|
20787
|
+
}, 16, ["class", "aria-current", "role", "tabindex"]))]);
|
|
20757
20788
|
};
|
|
20758
20789
|
}
|
|
20759
20790
|
});
|
|
@@ -20845,17 +20876,27 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
20845
20876
|
"default": function() { return /* binding */ CvHeaderNav; }
|
|
20846
20877
|
});
|
|
20847
20878
|
|
|
20879
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.assign.js
|
|
20880
|
+
var es_object_assign = __webpack_require__(9218);
|
|
20848
20881
|
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
20849
20882
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(4100);
|
|
20850
20883
|
// EXTERNAL MODULE: ./src/global/settings.js
|
|
20851
20884
|
var settings = __webpack_require__(8470);
|
|
20852
20885
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/CvUIShell/CvHeaderNav.vue?vue&type=script&setup=true&lang=js
|
|
20853
20886
|
|
|
20854
|
-
var _hoisted_1 = ["ariaLabeldBy"];
|
|
20855
20887
|
|
|
20856
|
-
|
|
20888
|
+
var _hoisted_1 = ["aria-label", "aria-labelledby"];
|
|
20889
|
+
|
|
20890
|
+
var __default__ = {
|
|
20891
|
+
inheritAttrs: false
|
|
20892
|
+
};
|
|
20893
|
+
/* harmony default export */ var CvHeaderNavvue_type_script_setup_true_lang_js = (/*@__PURE__*/Object.assign(__default__, {
|
|
20857
20894
|
__name: 'CvHeaderNav',
|
|
20858
20895
|
props: {
|
|
20896
|
+
ariaLabel: {
|
|
20897
|
+
type: String,
|
|
20898
|
+
default: undefined
|
|
20899
|
+
},
|
|
20859
20900
|
ariaLabelledBy: {
|
|
20860
20901
|
type: String,
|
|
20861
20902
|
default: undefined
|
|
@@ -20868,11 +20909,13 @@ var _hoisted_1 = ["ariaLabeldBy"];
|
|
|
20868
20909
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("ul", {
|
|
20869
20910
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)("".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header__menu-bar")),
|
|
20870
20911
|
role: "menubar",
|
|
20871
|
-
|
|
20912
|
+
"aria-orientation": "horizontal",
|
|
20913
|
+
"aria-label": __props.ariaLabel || _ctx.$attrs['aria-label'],
|
|
20914
|
+
"aria-labelledby": __props.ariaLabelledBy || _ctx.$attrs['aria-labelledby']
|
|
20872
20915
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default")], 10, _hoisted_1)], 2);
|
|
20873
20916
|
};
|
|
20874
20917
|
}
|
|
20875
|
-
});
|
|
20918
|
+
}));
|
|
20876
20919
|
;// ./src/components/CvUIShell/CvHeaderNav.vue?vue&type=script&setup=true&lang=js
|
|
20877
20920
|
|
|
20878
20921
|
;// ./src/components/CvUIShell/CvHeaderNav.vue
|
|
@@ -20899,6 +20942,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
20899
20942
|
|
|
20900
20943
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js + 2 modules
|
|
20901
20944
|
var defineProperty = __webpack_require__(139);
|
|
20945
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
|
|
20946
|
+
var es_object_to_string = __webpack_require__(5086);
|
|
20947
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
|
|
20948
|
+
var web_dom_collections_for_each = __webpack_require__(8379);
|
|
20902
20949
|
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
20903
20950
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(4100);
|
|
20904
20951
|
// EXTERNAL MODULE: ./src/global/settings.js
|
|
@@ -20908,7 +20955,9 @@ var event_bus = __webpack_require__(9535);
|
|
|
20908
20955
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/CvUIShell/CvHeaderPanel.vue?vue&type=script&setup=true&lang=js
|
|
20909
20956
|
|
|
20910
20957
|
|
|
20911
|
-
|
|
20958
|
+
|
|
20959
|
+
|
|
20960
|
+
var _hoisted_1 = ["id", "aria-hidden", "inert"];
|
|
20912
20961
|
|
|
20913
20962
|
|
|
20914
20963
|
|
|
@@ -20990,6 +21039,29 @@ var _hoisted_1 = ["id", "aria-hidden"];
|
|
|
20990
21039
|
}, function () {
|
|
20991
21040
|
panelExpanded.value = props.expanded;
|
|
20992
21041
|
});
|
|
21042
|
+
function manageFocusableElements(isExpanded) {
|
|
21043
|
+
if (!el.value) return;
|
|
21044
|
+
var focusableElements = el.value.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])');
|
|
21045
|
+
focusableElements.forEach(function (element) {
|
|
21046
|
+
if (isExpanded) {
|
|
21047
|
+
// Restore original tabindex when expanded
|
|
21048
|
+
var originalTabindex = element.getAttribute('data-original-tabindex');
|
|
21049
|
+
if (originalTabindex !== null) {
|
|
21050
|
+
if (originalTabindex === 'null') {
|
|
21051
|
+
element.removeAttribute('tabindex');
|
|
21052
|
+
} else {
|
|
21053
|
+
element.setAttribute('tabindex', originalTabindex);
|
|
21054
|
+
}
|
|
21055
|
+
element.removeAttribute('data-original-tabindex');
|
|
21056
|
+
}
|
|
21057
|
+
} else {
|
|
21058
|
+
// Store original tabindex and set to -1 when collapsed
|
|
21059
|
+
var currentTabindex = element.getAttribute('tabindex');
|
|
21060
|
+
element.setAttribute('data-original-tabindex', currentTabindex || 'null');
|
|
21061
|
+
element.setAttribute('tabindex', '-1');
|
|
21062
|
+
}
|
|
21063
|
+
});
|
|
21064
|
+
}
|
|
20993
21065
|
var emit = __emit;
|
|
20994
21066
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(panelExpanded, function (current) {
|
|
20995
21067
|
emit('update:expanded', current);
|
|
@@ -20997,6 +21069,18 @@ var _hoisted_1 = ["id", "aria-hidden"];
|
|
|
20997
21069
|
id: props.id,
|
|
20998
21070
|
expanded: current
|
|
20999
21071
|
});
|
|
21072
|
+
|
|
21073
|
+
// Manage focusable elements
|
|
21074
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(function () {
|
|
21075
|
+
manageFocusableElements(current);
|
|
21076
|
+
});
|
|
21077
|
+
});
|
|
21078
|
+
|
|
21079
|
+
// Initial setup of focusable elements
|
|
21080
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(function () {
|
|
21081
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(function () {
|
|
21082
|
+
manageFocusableElements(panelExpanded.value);
|
|
21083
|
+
});
|
|
21000
21084
|
});
|
|
21001
21085
|
return function (_ctx, _cache) {
|
|
21002
21086
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
@@ -21005,6 +21089,7 @@ var _hoisted_1 = ["id", "aria-hidden"];
|
|
|
21005
21089
|
ref: el,
|
|
21006
21090
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)(["cv-header-panel", "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header-panel"), (0,defineProperty/* default */.A)({}, "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--header-panel--expanded"), panelExpanded.value)]),
|
|
21007
21091
|
"aria-hidden": !panelExpanded.value ? 'true' : 'false',
|
|
21092
|
+
inert: !panelExpanded.value,
|
|
21008
21093
|
onFocusout: onFocusout,
|
|
21009
21094
|
onMousedown: onMouseDown
|
|
21010
21095
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderSlot)(_ctx.$slots, "default")], 42, _hoisted_1);
|
|
@@ -21037,6 +21122,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
21037
21122
|
|
|
21038
21123
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js + 2 modules
|
|
21039
21124
|
var defineProperty = __webpack_require__(139);
|
|
21125
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
|
|
21126
|
+
var es_object_to_string = __webpack_require__(5086);
|
|
21127
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
|
|
21128
|
+
var web_dom_collections_for_each = __webpack_require__(8379);
|
|
21040
21129
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.fixed.js
|
|
21041
21130
|
var es_string_fixed = __webpack_require__(9607);
|
|
21042
21131
|
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
@@ -21135,7 +21224,9 @@ var event_bus = __webpack_require__(9535);
|
|
|
21135
21224
|
|
|
21136
21225
|
|
|
21137
21226
|
|
|
21138
|
-
|
|
21227
|
+
|
|
21228
|
+
|
|
21229
|
+
var CvSideNavvue_type_script_setup_true_lang_js_hoisted_1 = ["id", "aria-hidden", "inert"];
|
|
21139
21230
|
|
|
21140
21231
|
|
|
21141
21232
|
|
|
@@ -21213,6 +21304,30 @@ var CvSideNavvue_type_script_setup_true_lang_js_hoisted_1 = ["id", "aria-hidden"
|
|
|
21213
21304
|
}, function () {
|
|
21214
21305
|
panelExpanded.value = props.expanded;
|
|
21215
21306
|
});
|
|
21307
|
+
// Manage focusable elements when panel visibility changes
|
|
21308
|
+
function manageFocusableElements(isExpanded, isFixed) {
|
|
21309
|
+
if (!el.value || isFixed) return;
|
|
21310
|
+
var focusableElements = el.value.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])');
|
|
21311
|
+
focusableElements.forEach(function (element) {
|
|
21312
|
+
if (isExpanded) {
|
|
21313
|
+
// Restore original tabindex when expanded
|
|
21314
|
+
var originalTabindex = element.getAttribute('data-original-tabindex');
|
|
21315
|
+
if (originalTabindex !== null) {
|
|
21316
|
+
if (originalTabindex === 'null') {
|
|
21317
|
+
element.removeAttribute('tabindex');
|
|
21318
|
+
} else {
|
|
21319
|
+
element.setAttribute('tabindex', originalTabindex);
|
|
21320
|
+
}
|
|
21321
|
+
element.removeAttribute('data-original-tabindex');
|
|
21322
|
+
}
|
|
21323
|
+
} else {
|
|
21324
|
+
// Store original tabindex and set to -1 when collapsed
|
|
21325
|
+
var currentTabindex = element.getAttribute('tabindex');
|
|
21326
|
+
element.setAttribute('data-original-tabindex', currentTabindex || 'null');
|
|
21327
|
+
element.setAttribute('tabindex', '-1');
|
|
21328
|
+
}
|
|
21329
|
+
});
|
|
21330
|
+
}
|
|
21216
21331
|
var emit = __emit;
|
|
21217
21332
|
var isPanelExpanded = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(function () {
|
|
21218
21333
|
return panelExpanded.value || expandedViaHoverState.value;
|
|
@@ -21223,6 +21338,11 @@ var CvSideNavvue_type_script_setup_true_lang_js_hoisted_1 = ["id", "aria-hidden"
|
|
|
21223
21338
|
id: props.id,
|
|
21224
21339
|
expanded: current
|
|
21225
21340
|
});
|
|
21341
|
+
|
|
21342
|
+
// Manage focusable elements for non-fixed nav
|
|
21343
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(function () {
|
|
21344
|
+
manageFocusableElements(current, props.fixed);
|
|
21345
|
+
});
|
|
21226
21346
|
});
|
|
21227
21347
|
var isChildOfHeader = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(function () {
|
|
21228
21348
|
return !!bus.value;
|
|
@@ -21255,6 +21375,7 @@ var CvSideNavvue_type_script_setup_true_lang_js_hoisted_1 = ["id", "aria-hidden"
|
|
|
21255
21375
|
ref: el,
|
|
21256
21376
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)(["cv-side-nav", "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--side-nav"), "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--side-nav__navigation"), (_ref2 = {}, (0,defineProperty/* default */.A)(_ref2, "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--side-nav--expanded"), panelExpanded.value), (0,defineProperty/* default */.A)(_ref2, "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--side-nav--rail"), __props.rail), (0,defineProperty/* default */.A)(_ref2, "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--side-nav--collapsed"), !panelExpanded.value && __props.fixed), (0,defineProperty/* default */.A)(_ref2, "".concat((0,external_commonjs_vue_commonjs2_vue_root_Vue_.unref)(settings/* carbonPrefix */.s), "--side-nav--ux"), isChildOfHeader.value), _ref2)]),
|
|
21257
21377
|
"aria-hidden": !panelExpanded.value && !__props.fixed ? 'true' : 'false',
|
|
21378
|
+
inert: !panelExpanded.value && !__props.fixed,
|
|
21258
21379
|
onFocusout: onFocusout,
|
|
21259
21380
|
onMousedown: onMouseDown,
|
|
21260
21381
|
onMouseenter: _cache[0] || (_cache[0] = function ($event) {
|