@rancher/shell 3.0.2-rc.3 → 3.0.2-rc.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/assets/styles/base/_basic.scss +2 -1
- package/assets/styles/global/_form.scss +2 -1
- package/assets/styles/themes/_dark.scss +1 -1
- package/assets/translations/en-us.yaml +22 -4
- package/assets/translations/zh-hans.yaml +2 -3
- package/components/AppModal.vue +50 -0
- package/components/Carousel.vue +54 -47
- package/components/CopyToClipboardText.vue +3 -0
- package/components/Dialog.vue +20 -1
- package/components/PromptChangePassword.vue +3 -0
- package/components/ResourceDetail/Masthead.vue +1 -1
- package/components/Tabbed/index.vue +4 -7
- package/components/__tests__/Carousel.test.ts +56 -27
- package/components/form/LabeledSelect.vue +1 -1
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +192 -0
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +104 -0
- package/components/form/SSHKnownHosts/index.vue +101 -0
- package/components/form/Select.vue +1 -1
- package/components/form/SelectOrCreateAuthSecret.vue +43 -11
- package/components/form/__tests__/SSHKnownHosts.test.ts +59 -0
- package/composables/focusTrap.ts +68 -0
- package/detail/secret.vue +25 -0
- package/edit/fleet.cattle.io.gitrepo.vue +27 -22
- package/edit/provisioning.cattle.io.cluster/index.vue +26 -19
- package/edit/secret/index.vue +1 -1
- package/edit/secret/ssh.vue +21 -3
- package/list/provisioning.cattle.io.cluster.vue +1 -0
- package/models/fleet.cattle.io.gitrepo.js +2 -2
- package/models/provisioning.cattle.io.cluster.js +2 -12
- package/models/secret.js +5 -0
- package/package.json +1 -1
- package/pages/account/index.vue +4 -0
- package/pages/c/_cluster/explorer/ConfigBadge.vue +5 -4
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +3 -1
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +3 -0
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +7 -1
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +3 -1
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +10 -7
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +7 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +181 -106
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +2 -0
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +9 -1
- package/pages/c/_cluster/uiplugins/index.vue +50 -12
- package/rancher-components/Card/Card.vue +7 -21
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -0
- package/rancher-components/RcDropdown/RcDropdown.vue +11 -0
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +2 -3
- package/rancher-components/RcDropdown/useDropdownCollection.ts +1 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +28 -1
|
@@ -35,6 +35,7 @@ const {
|
|
|
35
35
|
setFocus,
|
|
36
36
|
provideDropdownContext,
|
|
37
37
|
registerDropdownCollection,
|
|
38
|
+
handleKeydown,
|
|
38
39
|
} = useDropdownContext();
|
|
39
40
|
|
|
40
41
|
provideDropdownContext();
|
|
@@ -68,10 +69,14 @@ const applyShow = () => {
|
|
|
68
69
|
<template #popper>
|
|
69
70
|
<div
|
|
70
71
|
ref="dropdownTarget"
|
|
72
|
+
class="dropdownTarget"
|
|
73
|
+
tabindex="-1"
|
|
71
74
|
role="menu"
|
|
72
75
|
aria-orientation="vertical"
|
|
73
76
|
dropdown-menu-collection
|
|
74
77
|
:aria-label="ariaLabel || 'Dropdown Menu'"
|
|
78
|
+
@keydown="handleKeydown"
|
|
79
|
+
@keydown.down="setFocus()"
|
|
75
80
|
>
|
|
76
81
|
<slot name="dropdownCollection">
|
|
77
82
|
<!--Empty slot content-->
|
|
@@ -108,4 +113,10 @@ const applyShow = () => {
|
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
}
|
|
116
|
+
|
|
117
|
+
.dropdownTarget {
|
|
118
|
+
&:focus-visible, &:focus {
|
|
119
|
+
outline: none;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
111
122
|
</style>
|
|
@@ -9,8 +9,8 @@ import { DropdownContext, defaultContext } from './types';
|
|
|
9
9
|
const {
|
|
10
10
|
showMenu,
|
|
11
11
|
registerTrigger,
|
|
12
|
-
focusFirstElement,
|
|
13
12
|
isMenuOpen,
|
|
13
|
+
handleKeydown,
|
|
14
14
|
} = inject<DropdownContext>('dropdownContext') || defaultContext;
|
|
15
15
|
|
|
16
16
|
const dropdownTrigger = useTemplateRef<RcButtonType>('dropdownTrigger');
|
|
@@ -32,8 +32,7 @@ defineExpose({ focus });
|
|
|
32
32
|
role="button"
|
|
33
33
|
aria-haspopup="menu"
|
|
34
34
|
:aria-expanded="isMenuOpen"
|
|
35
|
-
@keydown.
|
|
36
|
-
@keydown.escape="showMenu(false)"
|
|
35
|
+
@keydown.enter.space="handleKeydown"
|
|
37
36
|
@click="showMenu(true)"
|
|
38
37
|
>
|
|
39
38
|
<slot name="default">
|
|
@@ -12,7 +12,12 @@ import { RcButtonType } from '@components/RcButton';
|
|
|
12
12
|
* interactions and setting focus.
|
|
13
13
|
*/
|
|
14
14
|
export const useDropdownContext = () => {
|
|
15
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
dropdownItems,
|
|
17
|
+
firstDropdownItem,
|
|
18
|
+
dropdownContainer,
|
|
19
|
+
registerDropdownCollection,
|
|
20
|
+
} = useDropdownCollection();
|
|
16
21
|
|
|
17
22
|
const isMenuOpen = ref(false);
|
|
18
23
|
|
|
@@ -21,6 +26,9 @@ export const useDropdownContext = () => {
|
|
|
21
26
|
* @param show - Whether to show or hide the dropdown menu.
|
|
22
27
|
*/
|
|
23
28
|
const showMenu = (show: boolean) => {
|
|
29
|
+
if (!show) {
|
|
30
|
+
didKeydown.value = false;
|
|
31
|
+
}
|
|
24
32
|
isMenuOpen.value = show;
|
|
25
33
|
};
|
|
26
34
|
|
|
@@ -46,12 +54,29 @@ export const useDropdownContext = () => {
|
|
|
46
54
|
dropdownTrigger?.value?.focus();
|
|
47
55
|
};
|
|
48
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Tracks if a keydown event has occurred. Important for distinguishing keyboard
|
|
59
|
+
* events from mouse events.
|
|
60
|
+
*/
|
|
61
|
+
const didKeydown = ref(false);
|
|
62
|
+
|
|
63
|
+
const handleKeydown = () => {
|
|
64
|
+
didKeydown.value = true;
|
|
65
|
+
};
|
|
66
|
+
|
|
49
67
|
/**
|
|
50
68
|
* Sets focus to the first dropdown item if a keydown event has occurred.
|
|
51
69
|
*/
|
|
52
70
|
const setFocus = () => {
|
|
53
71
|
nextTick(() => {
|
|
72
|
+
if (!didKeydown.value) {
|
|
73
|
+
dropdownContainer.value?.focus();
|
|
74
|
+
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
54
78
|
firstDropdownItem.value?.focus();
|
|
79
|
+
didKeydown.value = false;
|
|
55
80
|
});
|
|
56
81
|
};
|
|
57
82
|
|
|
@@ -69,6 +94,7 @@ export const useDropdownContext = () => {
|
|
|
69
94
|
focusFirstElement: () => {
|
|
70
95
|
setFocus();
|
|
71
96
|
},
|
|
97
|
+
handleKeydown,
|
|
72
98
|
});
|
|
73
99
|
};
|
|
74
100
|
|
|
@@ -79,5 +105,6 @@ export const useDropdownContext = () => {
|
|
|
79
105
|
setFocus,
|
|
80
106
|
provideDropdownContext,
|
|
81
107
|
registerDropdownCollection,
|
|
108
|
+
handleKeydown,
|
|
82
109
|
};
|
|
83
110
|
};
|