@rancher/shell 3.0.5-rc.5 → 3.0.5-rc.7
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/data/aws-regions.json +1 -0
- package/assets/images/key.svg +17 -0
- package/assets/styles/base/_spacing.scss +2 -2
- package/assets/styles/base/_variables.scss +17 -11
- package/assets/styles/global/_form.scss +1 -1
- package/assets/styles/global/_labeled-input.scss +1 -1
- package/assets/styles/themes/_dark.scss +5 -0
- package/assets/styles/themes/_light.scss +11 -2
- package/assets/styles/vendor/vue-select.scss +1 -1
- package/assets/translations/en-us.yaml +426 -64
- package/assets/translations/zh-hans.yaml +3 -4
- package/cloud-credential/gcp.vue +9 -1
- package/components/AppModal.vue +2 -0
- package/components/CodeMirror.vue +2 -2
- package/components/ConfigMapSettings/Settings.vue +377 -0
- package/components/ConfigMapSettings/index.vue +354 -0
- package/components/CruResource.vue +1 -2
- package/components/DetailText.vue +61 -11
- package/components/Drawer/Chrome.vue +115 -0
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +61 -0
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +48 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +54 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/YamlTab.test.ts +80 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +106 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/helpers.test.ts +42 -0
- package/components/Drawer/ResourceDetailDrawer/composables.ts +53 -0
- package/components/Drawer/ResourceDetailDrawer/helpers.ts +10 -0
- package/components/Drawer/ResourceDetailDrawer/index.vue +111 -0
- package/components/GrowlManager.vue +16 -15
- package/components/IconOrSvg.vue +5 -0
- package/components/KeyValueView.vue +1 -1
- package/components/Loading.vue +1 -1
- package/components/LocaleSelector.vue +9 -1
- package/components/PaginatedResourceTable.vue +46 -1
- package/components/ProgressBarMulti.vue +1 -0
- package/components/PromptModal.vue +6 -1
- package/components/PromptRestore.vue +22 -44
- package/components/RelatedResources.vue +4 -12
- package/components/Resource/Detail/Additional.vue +46 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/Metadata/Annotations/index.vue +5 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +223 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +47 -256
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +317 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +34 -5
- package/components/Resource/Detail/Metadata/KeyValue.vue +32 -22
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/Metadata/Labels/index.vue +4 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +3 -1
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +1 -1
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +1 -1
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +75 -0
- package/components/Resource/Detail/Metadata/composables.ts +60 -11
- package/components/Resource/Detail/Metadata/index.vue +12 -5
- package/components/Resource/Detail/Page.vue +15 -0
- package/components/Resource/Detail/ResourceRow.vue +37 -18
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/composables.test.ts +29 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/index.test.ts +48 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/composables.ts +31 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/index.vue +50 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/__tests__/composables.test.ts +66 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/composables.ts +21 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/index.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Basic.vue +45 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/BasicAuth.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Certificate.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Registry.vue +22 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/ServiceAccountToken.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Ssh.vue +32 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Basic.test.ts +40 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/BasicAuth.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Certificate.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Registry.test.ts +27 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/ServiceAccountToken.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Ssh.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/auth-types.test.ts +186 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/composables.test.ts +102 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/auth-types.ts +109 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/composeables.ts +52 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/index.vue +71 -0
- package/components/Resource/Detail/SpacedRow.vue +1 -1
- package/components/Resource/Detail/TitleBar/Title.vue +2 -1
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +63 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/composables.ts +45 -0
- package/components/Resource/Detail/TitleBar/index.vue +85 -13
- package/components/Resource/Detail/composables.ts +45 -0
- package/components/ResourceDetail/Masthead/__tests__/index.test.ts +70 -0
- package/components/ResourceDetail/{__tests__/Masthead.test.ts → Masthead/__tests__/legacy.test.ts} +3 -3
- package/components/ResourceDetail/Masthead/index.vue +65 -0
- package/components/ResourceDetail/Masthead/latest.vue +44 -0
- package/components/ResourceDetail/{Masthead.vue → Masthead/legacy.vue} +1 -1
- package/components/ResourceDetail/__tests__/index.test.ts +26 -5
- package/components/ResourceDetail/index.vue +33 -17
- package/components/ResourceDetail/legacy.vue +18 -1
- package/components/ResourceList/Masthead.vue +6 -0
- package/components/ResourceList/index.vue +1 -0
- package/components/ResourceTable.vue +6 -1
- package/components/ResourceYaml.vue +15 -2
- package/components/RichTranslation.vue +106 -0
- package/components/SlideInPanelManager.vue +46 -11
- package/components/SortableTable/index.vue +1 -1
- package/components/SortableTable/selection.js +0 -1
- package/components/StateDot/index.vue +28 -0
- package/components/Tabbed/index.vue +17 -16
- package/components/Wizard.vue +4 -2
- package/components/__tests__/ConfigMapSettings.test.ts +376 -0
- package/components/__tests__/GrowlManager.test.ts +0 -25
- package/components/__tests__/PromptRestore.test.ts +1 -65
- package/components/__tests__/RichTranslation.test.ts +115 -0
- package/components/auth/login/ldap.vue +1 -1
- package/components/fleet/FleetApplications.vue +0 -7
- package/components/fleet/FleetClusterTargets/TargetsList.vue +66 -0
- package/components/fleet/FleetClusterTargets/index.vue +455 -0
- package/components/fleet/FleetClusters.vue +25 -6
- package/components/fleet/FleetGitRepoPaths.vue +476 -0
- package/components/fleet/FleetHelmOps.vue +8 -0
- package/components/fleet/FleetRepos.vue +1 -6
- package/components/fleet/FleetResources.vue +4 -5
- package/components/fleet/FleetValuesFrom.vue +295 -0
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +1224 -0
- package/components/fleet/__tests__/FleetGitRepoPaths.test.ts +265 -0
- package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +13 -13
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +300 -0
- package/components/fleet/dashboard/ResourceCard.vue +1 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +1 -5
- package/components/fleet/dashboard/ResourceDetails.vue +8 -10
- package/components/fleet/dashboard/ResourcePanel.vue +17 -9
- package/components/form/ArrayList.vue +13 -2
- package/components/form/ChangePassword.vue +3 -1
- package/components/form/FileImageSelector.vue +1 -1
- package/components/form/Footer.vue +10 -4
- package/components/form/KeyValue.vue +81 -43
- package/components/form/LabeledSelect.vue +56 -16
- package/components/form/Labels.vue +90 -17
- package/components/form/MatchExpressions.vue +46 -5
- package/components/form/NameNsDescription.vue +2 -1
- package/components/form/Networking.vue +24 -19
- package/components/form/ResourceLabeledSelect.vue +4 -3
- package/components/form/ResourceSelector.vue +1 -0
- package/components/form/ResourceTabs/index.vue +5 -0
- package/components/form/SecretSelector.vue +9 -2
- package/components/form/Select.vue +57 -19
- package/components/form/SelectOrCreateAuthSecret.vue +6 -3
- package/components/form/SimpleSecretSelector.vue +9 -2
- package/components/form/Taints.vue +21 -2
- package/components/form/UnitInput.vue +8 -0
- package/components/form/ValueFromResource.vue +1 -1
- package/components/form/__tests__/LabeledSelect.test.ts +8 -4
- package/components/form/__tests__/Labels.test.ts +360 -0
- package/components/form/__tests__/MatchExpressions.test.ts +16 -13
- package/components/form/__tests__/Networking.test.ts +116 -0
- package/components/form/__tests__/Select.test.ts +5 -2
- package/components/formatter/FleetApplicationSource.vue +1 -1
- package/components/formatter/PodImages.vue +1 -1
- package/components/formatter/WorkloadHealthScale.vue +1 -1
- package/components/formatter/__tests__/LiveDate.test.ts +10 -2
- package/components/google/AccountAccess.vue +209 -0
- package/components/google/types/gcp.d.ts +136 -0
- package/components/google/types/index.d.ts +101 -0
- package/components/google/util/__mocks__/gcp.ts +465 -0
- package/components/google/util/formatter.ts +82 -0
- package/components/google/util/gcp.ts +134 -0
- package/components/google/util/index.d.ts +11 -0
- package/components/nav/Favorite.vue +1 -1
- package/components/nav/Group.vue +71 -45
- package/components/nav/Header.vue +5 -1
- package/components/nav/NamespaceFilter.vue +13 -1
- package/components/nav/NotificationCenter/Notification.vue +510 -0
- package/components/nav/NotificationCenter/NotificationHeader.vue +112 -0
- package/components/nav/NotificationCenter/index.vue +148 -0
- package/composables/drawer.ts +26 -0
- package/composables/resources.test.ts +63 -0
- package/composables/resources.ts +38 -0
- package/composables/useIsNewDetailPageEnabled.ts +17 -0
- package/config/labels-annotations.js +8 -0
- package/config/pagination-table-headers.js +8 -1
- package/config/product/auth.js +16 -1
- package/config/product/{cis.js → compliance.js} +23 -26
- package/config/product/explorer.js +32 -3
- package/config/product/fleet.js +7 -0
- package/config/product/manager.js +0 -1
- package/config/product/settings.js +22 -11
- package/config/query-params.js +13 -0
- package/config/roles.ts +1 -1
- package/config/router/navigation-guards/authentication.js +51 -2
- package/config/router/routes.js +47 -31
- package/config/settings.ts +21 -3
- package/config/store.js +2 -0
- package/config/system-namespaces.js +1 -1
- package/config/table-headers.js +32 -3
- package/config/types.js +16 -7
- package/config/version.js +1 -1
- package/core/plugin.ts +32 -7
- package/core/types.ts +18 -1
- package/detail/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +22 -18
- package/detail/management.cattle.io.fleetworkspace.vue +18 -27
- package/detail/management.cattle.io.oidcclient.vue +369 -0
- package/detail/node.vue +2 -2
- package/detail/pod.vue +2 -2
- package/detail/provisioning.cattle.io.cluster.vue +3 -47
- package/detail/service.vue +10 -1
- package/detail/workload/index.vue +8 -2
- package/dialog/ExtensionCatalogUninstallDialog.vue +7 -4
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/ImportDialog.vue +8 -8
- package/dialog/OidcClientSecretDialog.vue +117 -0
- package/dialog/RotateEncryptionKeyDialog.vue +10 -30
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +3 -3
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +5 -2
- package/edit/auth/ldap/__tests__/config.test.ts +14 -0
- package/edit/auth/ldap/config.vue +24 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -1
- package/edit/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +30 -31
- package/edit/{cis.cattle.io.clusterscanbenchmark.vue → compliance.cattle.io.clusterscanbenchmark.vue} +4 -4
- package/edit/{cis.cattle.io.clusterscanprofile.vue → compliance.cattle.io.clusterscanprofile.vue} +5 -5
- package/edit/configmap.vue +8 -2
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
- package/edit/fleet.cattle.io.gitrepo.vue +44 -222
- package/edit/fleet.cattle.io.helmop.vue +44 -269
- package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +1 -0
- package/edit/logging-flow/index.vue +1 -0
- package/edit/logging.banzaicloud.io.output/index.vue +1 -0
- package/edit/management.cattle.io.fleetworkspace.vue +1 -0
- package/edit/management.cattle.io.oidcclient.vue +162 -0
- package/edit/management.cattle.io.project.vue +4 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +5 -0
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/auth.vue +30 -30
- package/edit/monitoring.coreos.com.receiver/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -1
- package/edit/monitoring.coreos.com.route.vue +1 -0
- package/edit/namespace.vue +1 -0
- package/edit/networking.istio.io.destinationrule/index.vue +4 -1
- package/edit/networking.k8s.io.ingress/Certificate.vue +12 -12
- package/edit/networking.k8s.io.ingress/__tests__/Certificate.test.ts +165 -0
- package/edit/networking.k8s.io.ingress/index.vue +4 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +7 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +6 -2
- package/edit/node.vue +1 -0
- package/edit/persistentvolume/index.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +3 -2
- package/edit/provisioning.cattle.io.cluster/rke2.vue +516 -426
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +48 -39
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +5 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +2 -2
- package/edit/resources.cattle.io.restore.vue +1 -1
- package/edit/secret/basic.vue +1 -0
- package/edit/secret/index.vue +127 -15
- package/edit/service.vue +4 -1
- package/edit/serviceaccount.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +4 -1
- package/edit/workload/index.vue +5 -0
- package/list/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +2 -2
- package/list/management.cattle.io.oidcclient.vue +108 -0
- package/list/node.vue +2 -0
- package/list/projectsecret.vue +345 -0
- package/list/secret.vue +109 -0
- package/machine-config/amazonec2.vue +3 -24
- package/machine-config/components/GCEImage.vue +374 -0
- package/machine-config/google.vue +617 -0
- package/mixins/__tests__/brand.spec.ts +170 -0
- package/mixins/brand.js +16 -17
- package/mixins/create-edit-view/impl.js +10 -1
- package/mixins/create-edit-view/index.js +5 -0
- package/mixins/resource-fetch-api-pagination.js +24 -8
- package/mixins/resource-fetch.js +3 -1
- package/mixins/vue-select-overrides.js +1 -0
- package/models/cluster.x-k8s.io.machinedeployment.js +11 -2
- package/models/{cis.cattle.io.clusterscan.js → compliance.cattle.io.clusterscan.js} +8 -8
- package/models/{cis.cattle.io.clusterscanbenchmark.js → compliance.cattle.io.clusterscanbenchmark.js} +1 -1
- package/models/{cis.cattle.io.clusterscanprofile.js → compliance.cattle.io.clusterscanprofile.js} +5 -5
- package/models/{cis.cattle.io.clusterscanreport.js → compliance.cattle.io.clusterscanreport.js} +1 -1
- package/models/fleet-application.js +8 -79
- package/models/fleet.cattle.io.cluster.js +13 -2
- package/models/fleet.cattle.io.gitrepo.js +2 -2
- package/models/fleet.cattle.io.helmop.js +9 -39
- package/models/management.cattle.io.fleetworkspace.js +2 -1
- package/models/management.cattle.io.oidcclient.js +18 -0
- package/models/management.cattle.io.registration.js +3 -0
- package/models/provisioning.cattle.io.cluster.js +29 -33
- package/models/secret.js +157 -2
- package/models/service.js +4 -0
- package/models/workload.js +5 -0
- package/package.json +2 -2
- package/pages/about.vue +4 -58
- package/pages/auth/login.vue +1 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +0 -1
- package/pages/c/_cluster/apps/charts/index.vue +296 -81
- package/pages/c/_cluster/auth/user.retention/index.vue +87 -78
- package/pages/c/_cluster/explorer/index.vue +3 -3
- package/pages/c/_cluster/explorer/projectsecret.vue +34 -0
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +0 -1
- package/pages/c/_cluster/fleet/application/create.vue +3 -2
- package/pages/c/_cluster/fleet/index.vue +94 -57
- package/pages/c/_cluster/fleet/settings/index.vue +229 -0
- package/pages/c/_cluster/longhorn/index.vue +5 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +16 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -2
- package/pages/explorer/resource/detail/configmap.vue +30 -7
- package/pages/explorer/resource/detail/projectsecret.vue +9 -0
- package/pages/explorer/resource/detail/secret.vue +63 -0
- package/pages/home.vue +9 -55
- package/pages/support/index.vue +4 -6
- package/plugins/dashboard-store/__tests__/normalize.test.ts +223 -0
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +191 -0
- package/plugins/dashboard-store/__tests__/utils/normalize-usecases.ts +1526 -0
- package/plugins/dashboard-store/actions.js +19 -5
- package/plugins/dashboard-store/getters.js +4 -0
- package/plugins/dashboard-store/normalize.js +29 -17
- package/plugins/dashboard-store/resource-class.js +68 -19
- package/plugins/steve/steve-pagination-utils.ts +38 -19
- package/plugins/steve/subscribe.js +6 -1
- package/rancher-components/Banner/Banner.vue +13 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +9 -4
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +8 -3
- package/store/auth.js +2 -0
- package/store/catalog.js +23 -1
- package/store/growl.js +97 -8
- package/store/index.js +6 -0
- package/store/notifications.ts +426 -0
- package/store/prefs.js +0 -1
- package/store/type-map.js +19 -16
- package/store/uiplugins.ts +15 -1
- package/types/fleet.d.ts +24 -0
- package/types/kube/kube-api.ts +12 -0
- package/types/notifications/index.ts +74 -0
- package/types/shell/index.d.ts +661 -589
- package/types/store/dashboard-store.types.ts +16 -0
- package/types/store/pagination.types.ts +16 -6
- package/utils/__tests__/create-yaml.test.ts +235 -0
- package/utils/__tests__/fleet.test.ts +148 -0
- package/utils/__tests__/object.test.ts +54 -1
- package/utils/__tests__/string.test.ts +273 -1
- package/utils/__tests__/time.test.ts +31 -0
- package/utils/auth.js +9 -2
- package/utils/create-yaml.js +103 -9
- package/utils/crypto/encryption.ts +103 -0
- package/utils/cspAdaptor.ts +51 -0
- package/utils/fleet.ts +54 -65
- package/utils/object.js +36 -0
- package/utils/pagination-utils.ts +19 -1
- package/utils/release-notes.ts +48 -0
- package/utils/selector-typed.ts +7 -2
- package/utils/string.js +24 -0
- package/utils/{time.js → time.ts} +25 -6
- package/utils/uiplugins.ts +22 -0
- package/utils/validators/formRules/index.ts +3 -0
- package/components/Resource/Detail/TitleBar/composable.ts +0 -31
- package/config/product/legacy.js +0 -62
- package/models/etcdbackup.js +0 -45
- package/pages/c/_cluster/legacy/pages/_page.vue +0 -29
- package/pages/c/_cluster/legacy/project/_page.vue +0 -57
- package/pages/c/_cluster/legacy/project/index.vue +0 -32
- package/pages/c/_cluster/legacy/project/pipelines.vue +0 -96
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
class="header"
|
|
77
77
|
:data-testid="'fleet-dashboard-resource-details-header'"
|
|
78
78
|
>
|
|
79
|
-
<
|
|
79
|
+
<h3 class="title">
|
|
80
80
|
<i :class="value.dashboardIcon" />
|
|
81
81
|
<router-link
|
|
82
82
|
class="label"
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
:class="statePanel.icon"
|
|
91
91
|
:style="{ color: statePanel.color }"
|
|
92
92
|
/>
|
|
93
|
-
</
|
|
93
|
+
</h3>
|
|
94
94
|
<RcButton
|
|
95
95
|
small
|
|
96
96
|
ghost
|
|
@@ -104,9 +104,9 @@ export default {
|
|
|
104
104
|
</RcButton>
|
|
105
105
|
</div>
|
|
106
106
|
|
|
107
|
-
<
|
|
107
|
+
<h4>
|
|
108
108
|
{{ t('fleet.dashboard.source') }}
|
|
109
|
-
</
|
|
109
|
+
</h4>
|
|
110
110
|
<div class="mb-15">
|
|
111
111
|
<FleetApplicationSource
|
|
112
112
|
v-if="value.source.value"
|
|
@@ -120,9 +120,9 @@ export default {
|
|
|
120
120
|
</div>
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
|
-
<
|
|
123
|
+
<h4>
|
|
124
124
|
{{ t('fleet.dashboard.resources') }}
|
|
125
|
-
</
|
|
125
|
+
</h4>
|
|
126
126
|
<FleetResources
|
|
127
127
|
:rows="value.resourcesStatuses"
|
|
128
128
|
:cluster-id="clusterId"
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
136
136
|
<div class="col span-10">
|
|
137
137
|
<LabeledSelect
|
|
138
138
|
v-model:value="clusterId"
|
|
139
|
-
:label="'
|
|
139
|
+
:label="t('fleet.cluster.label')"
|
|
140
140
|
:options="clusters"
|
|
141
141
|
:mode="'edit'"
|
|
142
142
|
:disabled="workspace.id === 'fleet-local'"
|
|
@@ -168,9 +168,7 @@ export default {
|
|
|
168
168
|
display: flex;
|
|
169
169
|
align-items: center;
|
|
170
170
|
flex: 1;
|
|
171
|
-
|
|
172
|
-
font-weight: 600;
|
|
173
|
-
font-size: 18px;
|
|
171
|
+
margin-bottom: 0;
|
|
174
172
|
|
|
175
173
|
.icon {
|
|
176
174
|
font-size: 2em;
|
|
@@ -97,18 +97,27 @@ export default {
|
|
|
97
97
|
legend: { display: false },
|
|
98
98
|
title: { display: false },
|
|
99
99
|
tooltip: {
|
|
100
|
-
yAlign:
|
|
101
|
-
|
|
100
|
+
yAlign: 'bottom',
|
|
101
|
+
titleFont: { size: 12 },
|
|
102
|
+
bodyFont: { size: 12 },
|
|
103
|
+
titleAlign: 'center',
|
|
104
|
+
bodyAlign: 'center',
|
|
105
|
+
callbacks: {
|
|
102
106
|
title: (ctx: TooltipItem<'doughnut'>[]) => {
|
|
103
107
|
const v = ctx[0];
|
|
104
108
|
|
|
105
|
-
|
|
109
|
+
const value = v?.formattedValue || '';
|
|
110
|
+
const label = lcFirst(v?.label || '');
|
|
111
|
+
|
|
112
|
+
const titleLn = `${ value }${ label }`.length;
|
|
113
|
+
|
|
114
|
+
return `${ value }${ titleLn > 7 ? '\n' : ' ' }${ label }`;
|
|
106
115
|
},
|
|
107
116
|
label: () => '',
|
|
108
117
|
}
|
|
109
118
|
}
|
|
110
119
|
},
|
|
111
|
-
cutout:
|
|
120
|
+
cutout: 14,
|
|
112
121
|
onHover: (event: any) => {
|
|
113
122
|
if (this.selectable && event?.native?.target?.style) {
|
|
114
123
|
event.native.target.style.cursor = 'pointer';
|
|
@@ -293,13 +302,11 @@ export default {
|
|
|
293
302
|
|
|
294
303
|
.panel-chart-container {
|
|
295
304
|
padding: 3px;
|
|
296
|
-
min-width:
|
|
297
|
-
width:
|
|
305
|
+
min-width: 68px;
|
|
306
|
+
width: 68px;
|
|
298
307
|
}
|
|
299
308
|
|
|
300
309
|
.details {
|
|
301
|
-
padding: 5px;
|
|
302
|
-
|
|
303
310
|
.description {
|
|
304
311
|
.count {
|
|
305
312
|
font-size: 25px;
|
|
@@ -330,7 +337,8 @@ export default {
|
|
|
330
337
|
}
|
|
331
338
|
|
|
332
339
|
&.bg-error {
|
|
333
|
-
background: var(--click-badge-error-bg);
|
|
340
|
+
// background: var(--click-badge-error-bg); TODO revert after dashboard theme colors refactoring
|
|
341
|
+
background: var(--error);
|
|
334
342
|
color: var(--click-badge-error);
|
|
335
343
|
}
|
|
336
344
|
|
|
@@ -49,6 +49,10 @@ export default {
|
|
|
49
49
|
type: Boolean,
|
|
50
50
|
default: false,
|
|
51
51
|
},
|
|
52
|
+
addClass: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: '',
|
|
55
|
+
},
|
|
52
56
|
addIcon: {
|
|
53
57
|
type: String,
|
|
54
58
|
default: '',
|
|
@@ -300,6 +304,7 @@ export default {
|
|
|
300
304
|
:key="idx"
|
|
301
305
|
:data-testid="`${componentTestid}-box${ idx }`"
|
|
302
306
|
class="box"
|
|
307
|
+
:class="{'hide-remove-is-view': isView}"
|
|
303
308
|
role="group"
|
|
304
309
|
>
|
|
305
310
|
<slot
|
|
@@ -358,7 +363,7 @@ export default {
|
|
|
358
363
|
</div>
|
|
359
364
|
</slot>
|
|
360
365
|
<div
|
|
361
|
-
v-if="showRemove"
|
|
366
|
+
v-if="showRemove && !isView"
|
|
362
367
|
class="remove"
|
|
363
368
|
>
|
|
364
369
|
<slot
|
|
@@ -400,7 +405,7 @@ export default {
|
|
|
400
405
|
</div>
|
|
401
406
|
<div
|
|
402
407
|
v-if="showAdd && !isView"
|
|
403
|
-
class="footer
|
|
408
|
+
class="footer mmt-6"
|
|
404
409
|
>
|
|
405
410
|
<slot
|
|
406
411
|
v-if="showAdd"
|
|
@@ -410,6 +415,7 @@ export default {
|
|
|
410
415
|
<button
|
|
411
416
|
type="button"
|
|
412
417
|
class="btn role-tertiary add"
|
|
418
|
+
:class="[addClass]"
|
|
413
419
|
:disabled="loading || disableAdd"
|
|
414
420
|
:data-testid="`${componentTestid}-button`"
|
|
415
421
|
:aria-label="_addLabel"
|
|
@@ -449,6 +455,11 @@ export default {
|
|
|
449
455
|
}
|
|
450
456
|
}
|
|
451
457
|
}
|
|
458
|
+
|
|
459
|
+
.box.hide-remove-is-view {
|
|
460
|
+
grid-template-columns: auto;
|
|
461
|
+
}
|
|
462
|
+
|
|
452
463
|
.remove {
|
|
453
464
|
text-align: right;
|
|
454
465
|
}
|
|
@@ -331,15 +331,17 @@ export default {
|
|
|
331
331
|
:value="username"
|
|
332
332
|
tabindex="-1"
|
|
333
333
|
:data-lpignore="!isChange"
|
|
334
|
+
aria-hidden="true"
|
|
334
335
|
>
|
|
335
336
|
<input
|
|
336
337
|
id="password"
|
|
337
338
|
type="password"
|
|
338
339
|
name="password"
|
|
339
|
-
autocomplete="password"
|
|
340
|
+
autocomplete="new-password"
|
|
340
341
|
:value="password"
|
|
341
342
|
tabindex="-1"
|
|
342
343
|
:data-lpignore="!isChange"
|
|
344
|
+
aria-hidden="true"
|
|
343
345
|
>
|
|
344
346
|
<Password
|
|
345
347
|
v-if="isChange"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { defineComponent } from 'vue';
|
|
2
|
+
import { defineComponent, PropType } from 'vue';
|
|
3
3
|
import { _VIEW } from '@shell/config/query-params';
|
|
4
4
|
import AsyncButton, { AsyncButtonCallback } from '@shell/components/AsyncButton.vue';
|
|
5
5
|
import Banner from '@components/Banner/Banner.vue';
|
|
6
6
|
|
|
7
7
|
export default defineComponent({
|
|
8
|
-
emits: ['save', 'done'],
|
|
8
|
+
emits: ['save', 'done', 'closeError'],
|
|
9
9
|
|
|
10
10
|
components: { AsyncButton, Banner },
|
|
11
11
|
|
|
@@ -20,8 +20,8 @@ export default defineComponent({
|
|
|
20
20
|
},
|
|
21
21
|
|
|
22
22
|
errors: {
|
|
23
|
-
type: Array
|
|
24
|
-
default:
|
|
23
|
+
type: Array as PropType<string[]>,
|
|
24
|
+
default: () => []
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
disableSave: {
|
|
@@ -37,6 +37,10 @@ export default defineComponent({
|
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
methods: {
|
|
40
|
+
closeError(index: number) {
|
|
41
|
+
this.$emit('closeError', index);
|
|
42
|
+
},
|
|
43
|
+
|
|
40
44
|
save(buttonCb: AsyncButtonCallback) {
|
|
41
45
|
this.$emit('save', buttonCb);
|
|
42
46
|
},
|
|
@@ -58,6 +62,8 @@ export default defineComponent({
|
|
|
58
62
|
<Banner
|
|
59
63
|
color="error"
|
|
60
64
|
:label="err"
|
|
65
|
+
:closable="true"
|
|
66
|
+
@close="closeError(idx)"
|
|
61
67
|
/>
|
|
62
68
|
</div>
|
|
63
69
|
<div class="buttons">
|
|
@@ -12,6 +12,7 @@ import { _EDIT, _VIEW } from '@shell/config/query-params';
|
|
|
12
12
|
import { asciiLike } from '@shell/utils/string';
|
|
13
13
|
import CodeMirror from '@shell/components/CodeMirror';
|
|
14
14
|
import isEqual from 'lodash/isEqual';
|
|
15
|
+
import { LabeledTooltip } from '@components/LabeledTooltip';
|
|
15
16
|
|
|
16
17
|
export default {
|
|
17
18
|
name: 'KeyValue',
|
|
@@ -22,7 +23,8 @@ export default {
|
|
|
22
23
|
CodeMirror,
|
|
23
24
|
Select,
|
|
24
25
|
TextAreaAutoGrow,
|
|
25
|
-
FileSelector
|
|
26
|
+
FileSelector,
|
|
27
|
+
LabeledTooltip
|
|
26
28
|
},
|
|
27
29
|
props: {
|
|
28
30
|
value: {
|
|
@@ -64,6 +66,12 @@ export default {
|
|
|
64
66
|
type: [String, Boolean],
|
|
65
67
|
default: '',
|
|
66
68
|
},
|
|
69
|
+
|
|
70
|
+
protipValue: {
|
|
71
|
+
type: [String, Boolean],
|
|
72
|
+
default: '',
|
|
73
|
+
},
|
|
74
|
+
|
|
67
75
|
// For asMap=false, the name of the field that goes into the row objects
|
|
68
76
|
keyName: {
|
|
69
77
|
type: String,
|
|
@@ -95,20 +103,6 @@ export default {
|
|
|
95
103
|
type: String,
|
|
96
104
|
default: '',
|
|
97
105
|
},
|
|
98
|
-
/**
|
|
99
|
-
* List of keys which needs to be disabled and hidden based on toggler
|
|
100
|
-
*/
|
|
101
|
-
protectedKeys: {
|
|
102
|
-
type: Array,
|
|
103
|
-
default: () => [],
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* Conditionally display protected keys, if any
|
|
107
|
-
*/
|
|
108
|
-
toggleFilter: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: false,
|
|
111
|
-
},
|
|
112
106
|
separatorLabel: {
|
|
113
107
|
type: String,
|
|
114
108
|
default: '',
|
|
@@ -184,6 +178,10 @@ export default {
|
|
|
184
178
|
type: String,
|
|
185
179
|
default: '',
|
|
186
180
|
},
|
|
181
|
+
addClass: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: '',
|
|
184
|
+
},
|
|
187
185
|
addAllowed: {
|
|
188
186
|
type: Boolean,
|
|
189
187
|
default: true,
|
|
@@ -210,7 +208,7 @@ export default {
|
|
|
210
208
|
},
|
|
211
209
|
removeIcon: {
|
|
212
210
|
type: String,
|
|
213
|
-
default: '
|
|
211
|
+
default: '',
|
|
214
212
|
},
|
|
215
213
|
removeAllowed: {
|
|
216
214
|
type: Boolean,
|
|
@@ -240,6 +238,10 @@ export default {
|
|
|
240
238
|
default: false,
|
|
241
239
|
type: Boolean
|
|
242
240
|
},
|
|
241
|
+
keyErrors: {
|
|
242
|
+
type: Object,
|
|
243
|
+
default: () => ({})
|
|
244
|
+
}
|
|
243
245
|
},
|
|
244
246
|
data() {
|
|
245
247
|
const rows = this.getRows(this.value);
|
|
@@ -252,6 +254,10 @@ export default {
|
|
|
252
254
|
},
|
|
253
255
|
computed: {
|
|
254
256
|
_protip() {
|
|
257
|
+
if (this.protip === false) {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
|
|
255
261
|
return this.protip || this.t('keyValue.protip', null, true);
|
|
256
262
|
},
|
|
257
263
|
_keyLabel() {
|
|
@@ -323,10 +329,6 @@ export default {
|
|
|
323
329
|
}
|
|
324
330
|
},
|
|
325
331
|
|
|
326
|
-
isProtected(key) {
|
|
327
|
-
return this.protectedKeys && this.protectedKeys.includes(key);
|
|
328
|
-
},
|
|
329
|
-
|
|
330
332
|
getRows(value) {
|
|
331
333
|
const rows = [];
|
|
332
334
|
|
|
@@ -515,10 +517,16 @@ export default {
|
|
|
515
517
|
const text = event.clipboardData.getData('text/plain');
|
|
516
518
|
const lines = text.split('\n');
|
|
517
519
|
const splits = lines.map((line) => {
|
|
518
|
-
const
|
|
520
|
+
const separatorIndex = line.search(new RegExp(this.parserSeparators.join('|')));
|
|
521
|
+
|
|
522
|
+
if (separatorIndex === -1) {
|
|
523
|
+
return [];
|
|
524
|
+
}
|
|
525
|
+
const key = line.substring(0, separatorIndex).trim();
|
|
526
|
+
const value = line.substring(separatorIndex + 1).trim();
|
|
519
527
|
|
|
520
|
-
return
|
|
521
|
-
}).filter((split) => split
|
|
528
|
+
return [key, value];
|
|
529
|
+
}).filter((split) => split.length > 0);
|
|
522
530
|
|
|
523
531
|
if (splits.length === 0 || (splits.length === 1 && splits[0].length < 2)) {
|
|
524
532
|
return;
|
|
@@ -606,8 +614,8 @@ export default {
|
|
|
606
614
|
<template v-if="rows.length || isView">
|
|
607
615
|
<div class="rowgroup">
|
|
608
616
|
<div class="row">
|
|
609
|
-
<
|
|
610
|
-
class="text-label"
|
|
617
|
+
<div
|
|
618
|
+
class="text-label key-value-label"
|
|
611
619
|
role="columnheader"
|
|
612
620
|
>
|
|
613
621
|
{{ _keyLabel }}
|
|
@@ -617,21 +625,32 @@ export default {
|
|
|
617
625
|
v-stripped-aria-label="_protip"
|
|
618
626
|
class="icon icon-info"
|
|
619
627
|
tabindex="0"
|
|
628
|
+
role="tooltip"
|
|
620
629
|
/>
|
|
621
|
-
</
|
|
622
|
-
<
|
|
623
|
-
class="text-label"
|
|
630
|
+
</div>
|
|
631
|
+
<div
|
|
632
|
+
class="text-label key-value-label"
|
|
624
633
|
role="columnheader"
|
|
625
634
|
>
|
|
626
635
|
{{ _valueLabel }}
|
|
627
|
-
|
|
628
|
-
|
|
636
|
+
<i
|
|
637
|
+
v-if="protipValue && !isView && addAllowed"
|
|
638
|
+
v-clean-tooltip="{content: protipValue, triggers: ['hover', 'touch', 'focus'] }"
|
|
639
|
+
v-stripped-aria-label="protipValue"
|
|
640
|
+
class="icon icon-info"
|
|
641
|
+
tabindex="0"
|
|
642
|
+
role="tooltip"
|
|
643
|
+
/>
|
|
644
|
+
</div>
|
|
645
|
+
<div
|
|
629
646
|
v-for="(c, i) in extraColumns"
|
|
630
647
|
:key="i"
|
|
631
648
|
role="columnheader"
|
|
632
649
|
>
|
|
633
|
-
<slot :name="'label:'+c">
|
|
634
|
-
|
|
650
|
+
<slot :name="'label:'+c">
|
|
651
|
+
{{ c }}
|
|
652
|
+
</slot>
|
|
653
|
+
</div>
|
|
635
654
|
<slot
|
|
636
655
|
v-if="canRemove"
|
|
637
656
|
name="remove"
|
|
@@ -664,10 +683,7 @@ export default {
|
|
|
664
683
|
v-else
|
|
665
684
|
:key="i"
|
|
666
685
|
>
|
|
667
|
-
<div
|
|
668
|
-
class="rowgroup"
|
|
669
|
-
:class="{'hide': isProtected(row.key) && !toggleFilter}"
|
|
670
|
-
>
|
|
686
|
+
<div class="rowgroup">
|
|
671
687
|
<div class="row">
|
|
672
688
|
<!-- Key -->
|
|
673
689
|
<div
|
|
@@ -675,6 +691,10 @@ export default {
|
|
|
675
691
|
role="gridcell"
|
|
676
692
|
:aria-rowindex="i+1"
|
|
677
693
|
:aria-colindex="1"
|
|
694
|
+
:class="{
|
|
695
|
+
'labeled-input-key': keyErrors[row.key],
|
|
696
|
+
'v-popper--has-tooltip': keyErrors[row.key],
|
|
697
|
+
}"
|
|
678
698
|
>
|
|
679
699
|
<slot
|
|
680
700
|
name="key"
|
|
@@ -690,7 +710,7 @@ export default {
|
|
|
690
710
|
ref="key"
|
|
691
711
|
v-model:value="row[keyName]"
|
|
692
712
|
:searchable="true"
|
|
693
|
-
:disabled="disabled
|
|
713
|
+
:disabled="disabled"
|
|
694
714
|
:clearable="false"
|
|
695
715
|
:taggable="keyTaggable"
|
|
696
716
|
:options="calculateOptions(row[keyName])"
|
|
@@ -702,13 +722,18 @@ export default {
|
|
|
702
722
|
v-else
|
|
703
723
|
ref="key"
|
|
704
724
|
v-model="row[keyName]"
|
|
705
|
-
:disabled="isView || disabled || !keyEditable
|
|
725
|
+
:disabled="isView || disabled || !keyEditable"
|
|
706
726
|
:placeholder="_keyPlaceholder"
|
|
707
727
|
:data-testid="`input-kv-item-key-${i}`"
|
|
708
728
|
:aria-label="t('generic.ariaLabel.key', {index: i+1})"
|
|
709
729
|
@input="queueUpdate"
|
|
710
730
|
@paste="onPaste(i, $event)"
|
|
711
731
|
>
|
|
732
|
+
<LabeledTooltip
|
|
733
|
+
v-if="keyErrors[row.key]"
|
|
734
|
+
:value="keyErrors[row.key]"
|
|
735
|
+
:hover="true"
|
|
736
|
+
/>
|
|
712
737
|
</slot>
|
|
713
738
|
</div>
|
|
714
739
|
|
|
@@ -758,7 +783,7 @@ export default {
|
|
|
758
783
|
v-model:value="row[valueName]"
|
|
759
784
|
data-testid="value-multiline"
|
|
760
785
|
:class="{'conceal': valueConcealed}"
|
|
761
|
-
:disabled="disabled
|
|
786
|
+
:disabled="disabled"
|
|
762
787
|
:mode="mode"
|
|
763
788
|
:placeholder="_valuePlaceholder"
|
|
764
789
|
:min-height="40"
|
|
@@ -769,7 +794,7 @@ export default {
|
|
|
769
794
|
<input
|
|
770
795
|
v-else
|
|
771
796
|
v-model="row[valueName]"
|
|
772
|
-
:disabled="isView || disabled
|
|
797
|
+
:disabled="isView || disabled"
|
|
773
798
|
:type="valueConcealed ? 'password' : 'text'"
|
|
774
799
|
:placeholder="_valuePlaceholder"
|
|
775
800
|
autocorrect="off"
|
|
@@ -823,12 +848,16 @@ export default {
|
|
|
823
848
|
<button
|
|
824
849
|
type="button"
|
|
825
850
|
role="button"
|
|
826
|
-
:disabled="isView ||
|
|
851
|
+
:disabled="isView || disabled"
|
|
827
852
|
:aria-label="t('generic.ariaLabel.remove', {index: i+1})"
|
|
828
853
|
class="btn role-link"
|
|
829
854
|
@click="remove(i)"
|
|
830
855
|
>
|
|
831
856
|
{{ removeLabel || t('generic.remove') }}
|
|
857
|
+
<i
|
|
858
|
+
v-if="removeIcon"
|
|
859
|
+
:class="[removeIcon]"
|
|
860
|
+
/>
|
|
832
861
|
</button>
|
|
833
862
|
</slot>
|
|
834
863
|
</div>
|
|
@@ -838,7 +867,7 @@ export default {
|
|
|
838
867
|
</div>
|
|
839
868
|
<div
|
|
840
869
|
v-if="(addAllowed || readAllowed) && !isView"
|
|
841
|
-
class="footer mt-
|
|
870
|
+
class="footer mt-10"
|
|
842
871
|
>
|
|
843
872
|
<slot
|
|
844
873
|
name="add"
|
|
@@ -849,6 +878,7 @@ export default {
|
|
|
849
878
|
type="button"
|
|
850
879
|
role="button"
|
|
851
880
|
class="btn role-tertiary add"
|
|
881
|
+
:class="[addClass]"
|
|
852
882
|
data-testid="add_row_item_button"
|
|
853
883
|
:disabled="loading || disabled || (keyOptions && filteredKeyOptions.length === 0)"
|
|
854
884
|
:aria-label="t('generic.ariaLabel.addKeyValue')"
|
|
@@ -885,7 +915,8 @@ export default {
|
|
|
885
915
|
display: grid;
|
|
886
916
|
align-items: center;
|
|
887
917
|
column-gap: 20px;
|
|
888
|
-
|
|
918
|
+
|
|
919
|
+
.key-value-label {
|
|
889
920
|
margin-bottom: 0;
|
|
890
921
|
}
|
|
891
922
|
& .kv-item {
|
|
@@ -962,4 +993,11 @@ export default {
|
|
|
962
993
|
padding: 0px 0px 0px 10px;
|
|
963
994
|
}
|
|
964
995
|
}
|
|
996
|
+
|
|
997
|
+
.labeled-input-key {
|
|
998
|
+
position: relative;
|
|
999
|
+
display: flex;
|
|
1000
|
+
border-collapse: separate;
|
|
1001
|
+
z-index: 0; // Prevent label from cover other elements outside of the input
|
|
1002
|
+
}
|
|
965
1003
|
</style>
|
|
@@ -9,6 +9,9 @@ import { generateRandomAlphaString } from '@shell/utils/string';
|
|
|
9
9
|
import LabeledSelectPagination from '@shell/components/form/labeled-select-utils/labeled-select-pagination';
|
|
10
10
|
import { LABEL_SELECT_NOT_OPTION_KINDS } from '@shell/types/components/labeledSelect';
|
|
11
11
|
import { mapGetters } from 'vuex';
|
|
12
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
13
|
+
import { useClickOutside } from '@shell/composables/useClickOutside';
|
|
14
|
+
import { ref } from 'vue';
|
|
12
15
|
|
|
13
16
|
export default {
|
|
14
17
|
name: 'LabeledSelect',
|
|
@@ -114,12 +117,22 @@ export default {
|
|
|
114
117
|
}
|
|
115
118
|
},
|
|
116
119
|
|
|
120
|
+
setup() {
|
|
121
|
+
const select = ref(null);
|
|
122
|
+
const isOpen = ref(false);
|
|
123
|
+
|
|
124
|
+
useClickOutside(select, () => {
|
|
125
|
+
isOpen.value = false;
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return { isOpen, select };
|
|
129
|
+
},
|
|
130
|
+
|
|
117
131
|
data() {
|
|
118
132
|
return {
|
|
119
133
|
selectedVisibility: 'visible',
|
|
120
134
|
shouldOpen: true,
|
|
121
135
|
labeledSelectLabelId: `ls-label-id-${ generateRandomAlphaString(12) }`,
|
|
122
|
-
isOpen: false,
|
|
123
136
|
generatedUid: `ls-uid-${ generateRandomAlphaString(12) }`
|
|
124
137
|
};
|
|
125
138
|
},
|
|
@@ -156,20 +169,24 @@ export default {
|
|
|
156
169
|
},
|
|
157
170
|
|
|
158
171
|
methods: {
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
if (this.
|
|
172
|
+
// Ensure we only focus on open, otherwise we re-open on close
|
|
173
|
+
clickSelect() {
|
|
174
|
+
if (this.mode === _VIEW || this.loading === true || this.disabled === true) {
|
|
162
175
|
return;
|
|
163
176
|
}
|
|
164
177
|
|
|
165
|
-
|
|
178
|
+
this.isOpen = !this.isOpen;
|
|
166
179
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
ev.preventDefault();
|
|
180
|
+
if (this.isOpen) {
|
|
181
|
+
this.focusSearch();
|
|
170
182
|
}
|
|
183
|
+
},
|
|
171
184
|
|
|
172
|
-
|
|
185
|
+
// resizeHandler = in mixin
|
|
186
|
+
focusSearch() {
|
|
187
|
+
if (this.isView || this.disabled || this.loading) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
173
190
|
|
|
174
191
|
this.$nextTick(() => {
|
|
175
192
|
const el = this.$refs['select-input']?.searchEl;
|
|
@@ -180,6 +197,10 @@ export default {
|
|
|
180
197
|
});
|
|
181
198
|
},
|
|
182
199
|
|
|
200
|
+
focusWrapper() {
|
|
201
|
+
this.$refs.select.focus();
|
|
202
|
+
},
|
|
203
|
+
|
|
183
204
|
onFocus() {
|
|
184
205
|
this.selectedVisibility = 'hidden';
|
|
185
206
|
this.onFocusLabeled();
|
|
@@ -191,14 +212,27 @@ export default {
|
|
|
191
212
|
},
|
|
192
213
|
|
|
193
214
|
onOpen() {
|
|
194
|
-
this.
|
|
215
|
+
this.focusSearch();
|
|
195
216
|
this.$emit('on-open');
|
|
196
217
|
this.resizeHandler();
|
|
197
218
|
},
|
|
198
219
|
|
|
199
|
-
|
|
220
|
+
closeOnSelecting(e) {
|
|
221
|
+
if (e.value === this.value) {
|
|
222
|
+
this.close();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
this.$emit('selecting', e);
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
close() {
|
|
200
229
|
this.isOpen = false;
|
|
230
|
+
this.onClose();
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
onClose() {
|
|
201
234
|
this.$emit('on-close');
|
|
235
|
+
this.focusWrapper();
|
|
202
236
|
},
|
|
203
237
|
|
|
204
238
|
getOptionLabel(option) {
|
|
@@ -233,6 +267,10 @@ export default {
|
|
|
233
267
|
},
|
|
234
268
|
|
|
235
269
|
dropdownShouldOpen(instance, forceOpen = false) {
|
|
270
|
+
if (!this.isOpen) {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
|
|
236
274
|
const { noDrop, mutableLoading } = instance;
|
|
237
275
|
const { open } = instance;
|
|
238
276
|
const shouldOpen = this.shouldOpen;
|
|
@@ -297,10 +335,10 @@ export default {
|
|
|
297
335
|
:aria-expanded="isOpen"
|
|
298
336
|
:aria-describedby="$attrs['aria-describedby'] || undefined"
|
|
299
337
|
:aria-required="requiredField"
|
|
300
|
-
@click="
|
|
301
|
-
@keydown.enter="
|
|
302
|
-
@keydown.down.prevent="
|
|
303
|
-
@keydown.space="
|
|
338
|
+
@click="clickSelect"
|
|
339
|
+
@keydown.self.enter="clickSelect"
|
|
340
|
+
@keydown.self.down.prevent="clickSelect"
|
|
341
|
+
@keydown.self.space.prevent="clickSelect"
|
|
304
342
|
>
|
|
305
343
|
<div
|
|
306
344
|
:class="{ 'labeled-container': true, raised, empty, [mode]: true }"
|
|
@@ -327,6 +365,7 @@ export default {
|
|
|
327
365
|
ref="select-input"
|
|
328
366
|
v-bind="filteredAttrs"
|
|
329
367
|
class="inline"
|
|
368
|
+
:close-on-select="false"
|
|
330
369
|
:append-to-body="appendToBody"
|
|
331
370
|
:calculate-position="positionDropdown"
|
|
332
371
|
:class="{ 'no-label': !(label || '').length}"
|
|
@@ -353,7 +392,8 @@ export default {
|
|
|
353
392
|
@search="onSearch"
|
|
354
393
|
@open="onOpen"
|
|
355
394
|
@close="onClose"
|
|
356
|
-
@option:selecting="
|
|
395
|
+
@option:selecting="closeOnSelecting"
|
|
396
|
+
@option:selected="close"
|
|
357
397
|
@option:deselecting="$emit('deselecting', $event)"
|
|
358
398
|
@keydown.enter.stop
|
|
359
399
|
>
|