@rancher/shell 0.2.4 → 0.3.0
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/themes/_dark.scss +4 -0
- package/assets/styles/themes/_light.scss +5 -0
- package/assets/translations/en-us.yaml +14 -2
- package/assets/translations/zh-hans.yaml +7 -5
- package/chart/istio.vue +1 -1
- package/chart/monitoring/grafana/index.vue +1 -1
- package/chart/monitoring/index.vue +1 -1
- package/chart/monitoring/prometheus/index.vue +4 -4
- package/components/AlertTable.vue +1 -1
- package/components/AssignTo.vue +1 -1
- package/components/AsyncButton.vue +2 -2
- package/components/BrandImage.vue +1 -1
- package/components/ButtonGroup.vue +1 -1
- package/components/ClusterProviderIcon.vue +2 -2
- package/components/Collapse.vue +6 -2
- package/components/CollapsibleCard.vue +2 -2
- package/components/ConsumptionGauge.vue +4 -4
- package/components/ContainerResourceLimit.vue +1 -1
- package/components/CountBox.vue +1 -1
- package/components/CountGauge.vue +1 -1
- package/components/CruResource.vue +2 -1
- package/components/DashboardMetrics.vue +2 -2
- package/components/ExplorerProjectsNamespaces.vue +6 -6
- package/components/FixedBanner.vue +6 -6
- package/components/GlobalRoleBindings.vue +6 -6
- package/components/GradientBox.vue +2 -2
- package/components/IconMessage.vue +4 -4
- package/components/Import.vue +5 -5
- package/components/InputOrDisplay.vue +1 -1
- package/components/KeyValueView.vue +1 -1
- package/components/LabelValue.vue +1 -1
- package/components/ModalWithCard.vue +1 -1
- package/components/MoveModal.vue +1 -1
- package/components/PercentageBar.vue +2 -2
- package/components/PromptChangePassword.vue +1 -1
- package/components/PromptModal.vue +1 -1
- package/components/PromptRemove.vue +2 -2
- package/components/PromptRestore.vue +13 -13
- package/components/Questions/Question.js +1 -1
- package/components/ResourceCancelModal.vue +3 -3
- package/components/ResourceDetail/Masthead.vue +1 -1
- package/components/ResourceList/Masthead.vue +1 -1
- package/components/ResourceSummary.vue +4 -4
- package/components/RoleBindings.vue +19 -19
- package/components/SimpleBox.vue +5 -1
- package/components/SingleClusterInfo.vue +5 -5
- package/components/SortableTable/THead.vue +6 -2
- package/components/SortableTable/actions.js +4 -2
- package/components/SortableTable/index.vue +9 -9
- package/components/SortableTable/selection.js +2 -2
- package/components/TableSparkLine.vue +1 -1
- package/components/TypeDescription.vue +1 -1
- package/components/Wizard.vue +1 -1
- package/components/YamlEditor.vue +6 -6
- package/components/__tests__/ApplicationCard.test.ts +27 -0
- package/components/__tests__/Collapse.spec.ts +44 -0
- package/components/__tests__/CruResource.test.ts +3 -3
- package/components/__tests__/NamespaceFilter.test.ts +213 -0
- package/components/__tests__/SimpleBox.spec.ts +28 -0
- package/components/auth/RoleDetailEdit.vue +17 -15
- package/components/auth/SelectPrincipal.vue +9 -0
- package/components/auth/login/ldap.vue +3 -0
- package/components/cards/ApplicationCard.vue +10 -5
- package/components/fleet/FleetBundleResources.vue +8 -8
- package/components/fleet/FleetClusters.vue +10 -10
- package/components/fleet/FleetRepos.vue +5 -5
- package/components/fleet/FleetResources.vue +6 -6
- package/components/fleet/FleetSummary.vue +5 -5
- package/components/fleet/ResourcesSummary.vue +1 -1
- package/components/form/ArrayListGrouped.vue +1 -1
- package/components/form/ArrayListSelect.vue +3 -3
- package/components/form/BannerSettings.vue +6 -6
- package/components/form/ChangePassword.vue +3 -3
- package/components/form/Error.vue +2 -2
- package/components/form/FileSelector.vue +3 -3
- package/components/form/Footer.vue +1 -1
- package/components/form/GithubPicker.vue +4 -4
- package/components/form/KeyValue.vue +2 -2
- package/components/form/MatchExpressions.vue +1 -1
- package/components/form/Members/ClusterPermissionsEditor.vue +11 -11
- package/components/form/Members/MembershipEditor.vue +2 -2
- package/components/form/NodeAffinity.vue +1 -1
- package/components/form/Password.vue +3 -3
- package/components/form/PodAffinity.vue +1 -1
- package/components/form/ProjectMemberEditor.vue +1 -1
- package/components/form/ResourceQuota/shared.js +12 -12
- package/components/form/SecretSelector.vue +1 -1
- package/components/form/Security.vue +1 -1
- package/components/form/Select.vue +4 -0
- package/components/form/SimpleSecretSelector.vue +1 -1
- package/components/form/Taints.vue +1 -1
- package/components/form/UnitInput.vue +7 -7
- package/components/form/ValueFromResource.vue +1 -1
- package/components/form/WorkloadPorts.vue +1 -1
- package/components/formatter/AppSummaryGraph.vue +4 -4
- package/components/formatter/BadgeStateFormatter.vue +2 -2
- package/components/formatter/Checked.vue +1 -1
- package/components/formatter/ClusterLink.vue +3 -3
- package/components/formatter/Date.vue +1 -1
- package/components/formatter/DelayedValue.vue +1 -1
- package/components/formatter/Endpoints.vue +1 -1
- package/components/formatter/FleetSummaryGraph.vue +4 -4
- package/components/formatter/IconIsDefault.vue +1 -1
- package/components/formatter/IconText.vue +4 -4
- package/components/formatter/ImagePercentageBar.vue +4 -4
- package/components/formatter/IngressFullPath.vue +1 -1
- package/components/formatter/LinkDetail.vue +3 -3
- package/components/formatter/List.vue +1 -1
- package/components/formatter/ListLink.vue +1 -1
- package/components/formatter/ListLinkDetail.vue +1 -1
- package/components/formatter/LiveDate.vue +3 -3
- package/components/formatter/LivePodRestarts.vue +1 -1
- package/components/formatter/Number.vue +1 -1
- package/components/formatter/Percentage.vue +2 -2
- package/components/formatter/PercentageBar.vue +3 -3
- package/components/formatter/PodImages.vue +1 -1
- package/components/formatter/Principal.vue +1 -1
- package/components/formatter/PrincipalGroupBindings.vue +2 -2
- package/components/formatter/QualityText.vue +1 -1
- package/components/formatter/ReceiverIcons.vue +2 -2
- package/components/formatter/Scale.vue +1 -1
- package/components/formatter/ScanResult.vue +1 -1
- package/components/formatter/SecretData.vue +1 -1
- package/components/formatter/ServiceType.vue +1 -1
- package/components/formatter/Shortened.vue +1 -1
- package/components/formatter/VerticalScroll.vue +2 -2
- package/components/formatter/VirtualServiceGateways.vue +3 -3
- package/components/formatter/Weight.vue +2 -2
- package/components/formatter/WorkloadDetailEndpoints.vue +1 -1
- package/components/formatter/WorkloadHealthScale.vue +2 -2
- package/components/formatter/__tests__/Date.test.ts +60 -0
- package/components/formatter/__tests__/LinkDetail.test.ts +72 -0
- package/components/formatter/__tests__/LiveDate.test.ts +84 -0
- package/components/formatter/__tests__/Si.test.ts +35 -0
- package/components/graph/LinePlot.vue +1 -1
- package/components/graph/ProgressArc.vue +5 -5
- package/components/nav/GlobalLoading.vue +1 -1
- package/components/nav/Header.vue +1 -2
- package/components/nav/Jump.vue +3 -3
- package/components/nav/NamespaceFilter.vue +71 -22
- package/components/nav/TopLevelMenu.vue +4 -4
- package/components/nav/Type.vue +1 -1
- package/components/nav/WindowManager/ChartReadme.vue +1 -1
- package/components/nav/WindowManager/ContainerLogs.vue +3 -3
- package/components/nav/WindowManager/ContainerShell.vue +19 -0
- package/components/nav/WindowManager/KubectlShell.vue +6 -6
- package/components/nav/WindowManager/MachineSsh.vue +1 -1
- package/components/nav/WindowManager/index.vue +196 -25
- package/config/labels-annotations.js +19 -19
- package/config/product/apps.js +5 -5
- package/config/product/auth.js +20 -20
- package/config/product/cis.js +24 -24
- package/config/product/explorer.js +22 -21
- package/config/product/fleet.js +7 -7
- package/config/product/gatekeeper.js +7 -7
- package/config/product/harvester-manager.js +8 -8
- package/config/product/istio.js +7 -7
- package/config/product/legacy.js +21 -21
- package/config/product/logging.js +90 -90
- package/config/product/manager.js +14 -14
- package/config/product/monitoring.js +36 -36
- package/config/product/multi-cluster-apps.js +24 -24
- package/config/product/settings.js +42 -42
- package/config/settings.ts +16 -16
- package/config/table-headers.js +55 -48
- package/config/types.js +7 -7
- package/config/uiplugins.js +4 -4
- package/creators/app/app.package.json +4 -1
- package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
- package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
- package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
- package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
- package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
- package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
- package/creators/app/init +16 -17
- package/creators/app/package.json +7 -1
- package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
- package/creators/pkg/{index.ts → files/index.ts} +0 -0
- package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
- package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
- package/creators/pkg/init +1 -1
- package/creators/pkg/package.json +1 -1
- package/creators/update/init +56 -0
- package/creators/update/package.json +20 -0
- package/creators/update/upgrade +56 -0
- package/detail/cis.cattle.io.clusterscan.vue +6 -6
- package/detail/configmap.vue +1 -1
- package/detail/constraints.gatekeeper.sh.constraint.vue +1 -1
- package/detail/fleet.cattle.io.bundle.vue +5 -5
- package/detail/fleet.cattle.io.gitrepo.vue +5 -5
- package/detail/helm.cattle.io.projecthelmchart.vue +1 -1
- package/detail/management.cattle.io.user.vue +3 -3
- package/detail/namespace.vue +13 -13
- package/detail/node.vue +2 -2
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +12 -1
- package/detail/secret.vue +2 -2
- package/detail/workload/index.vue +1 -1
- package/dialog/AddClusterMemberDialog.vue +1 -1
- package/dialog/AddCustomBadgeDialog.vue +4 -4
- package/dialog/AddProjectMemberDialog.vue +29 -22
- package/dialog/AddonConfigConfirmationDialog.vue +1 -1
- package/dialog/DiagnosticTimingsDialog.vue +1 -1
- package/dialog/DrainNode.vue +12 -12
- package/dialog/ForceMachineRemoveDialog.vue +1 -1
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/RollbackWorkloadDialog.vue +8 -8
- package/dialog/RotateCertificatesDialog.vue +4 -4
- package/dialog/RotateEncryptionKeyDialog.vue +1 -1
- package/dialog/SaveAsRKETemplateDialog.vue +1 -1
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/edit/__tests__/management.cattle.io.setting.test.ts +1 -1
- package/edit/auth/azuread.vue +2 -2
- package/edit/auth/github.vue +2 -2
- package/edit/auth/ldap/index.vue +4 -4
- package/edit/auth/oidc.vue +3 -3
- package/edit/auth/saml.vue +4 -4
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +2 -2
- package/edit/cis.cattle.io.clusterscan.vue +2 -2
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -1
- package/edit/fleet.cattle.io.clustergroup.vue +3 -3
- package/edit/fleet.cattle.io.gitrepo.vue +9 -9
- package/edit/group.principal.vue +2 -2
- package/edit/helm.cattle.io.projecthelmchart.vue +3 -3
- package/edit/logging-flow/index.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +213 -0
- package/edit/logging.banzaicloud.io.output/providers/redis.vue +142 -0
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +1 -1
- package/edit/management.cattle.io.fleetworkspace.vue +1 -1
- package/edit/management.cattle.io.project.vue +3 -3
- package/edit/management.cattle.io.projectroletemplatebinding.vue +5 -5
- package/edit/management.cattle.io.setting.vue +1 -1
- package/edit/management.cattle.io.user.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +15 -15
- package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +5 -5
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +3 -3
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +3 -3
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +4 -4
- package/edit/monitoring.coreos.com.receiver/auth.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/index.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
- package/edit/monitoring.coreos.com.route.vue +1 -1
- package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +1 -1
- package/edit/networking.k8s.io.ingress/Certificates.vue +3 -3
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
- package/edit/networking.k8s.io.ingress/IngressClass.vue +1 -1
- package/edit/networking.k8s.io.ingress/Rule.vue +1 -1
- package/edit/networking.k8s.io.ingress/RulePath.vue +5 -5
- package/edit/networking.k8s.io.ingress/Rules.vue +7 -7
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +1 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +1 -1
- package/edit/networking.k8s.io.networkpolicy/index.vue +5 -5
- package/edit/persistentvolume/index.vue +1 -1
- package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +1 -1
- package/edit/persistentvolume/plugins/azureDisk.vue +1 -1
- package/edit/persistentvolume/plugins/azureFile.vue +1 -1
- package/edit/persistentvolume/plugins/cephfs.vue +2 -2
- package/edit/persistentvolume/plugins/cinder.vue +1 -1
- package/edit/persistentvolume/plugins/csi.vue +2 -2
- package/edit/persistentvolume/plugins/fc.vue +2 -2
- package/edit/persistentvolume/plugins/flexVolume.vue +2 -2
- package/edit/persistentvolume/plugins/flocker.vue +1 -1
- package/edit/persistentvolume/plugins/gcePersistentDisk.vue +1 -1
- package/edit/persistentvolume/plugins/glusterfs.vue +1 -1
- package/edit/persistentvolume/plugins/hostPath.vue +1 -1
- package/edit/persistentvolume/plugins/iscsi.vue +2 -2
- package/edit/persistentvolume/plugins/local.vue +1 -1
- package/edit/persistentvolume/plugins/longhorn.vue +2 -2
- package/edit/persistentvolume/plugins/nfs.vue +1 -1
- package/edit/persistentvolume/plugins/photonPersistentDisk.vue +1 -1
- package/edit/persistentvolume/plugins/portworxVolume.vue +1 -1
- package/edit/persistentvolume/plugins/quobyte.vue +1 -1
- package/edit/persistentvolume/plugins/rbd.vue +2 -2
- package/edit/persistentvolume/plugins/scaleIO.vue +1 -1
- package/edit/persistentvolume/plugins/storageos.vue +1 -1
- package/edit/persistentvolume/plugins/vsphereVolume.vue +1 -1
- package/edit/persistentvolumeclaim.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/S3Config.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/rke2.vue +18 -12
- package/edit/resources.cattle.io.backup.vue +2 -2
- package/edit/secret/generic.vue +1 -0
- package/edit/storage.k8s.io.storageclass/index.vue +2 -2
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/no-provisioner.vue +1 -1
- package/edit/token.vue +1 -1
- package/edit/ui.cattle.io.navlink.vue +8 -8
- package/edit/workload/Job.vue +3 -3
- package/edit/workload/Upgrading.vue +1 -1
- package/edit/workload/VolumeClaimTemplate.vue +1 -1
- package/edit/workload/index.vue +3 -3
- package/edit/workload/mixins/workload.js +23 -23
- package/edit/workload/storage/ContainerMountPaths.vue +1 -1
- package/edit/workload/storage/Mount.vue +1 -1
- package/edit/workload/storage/azureDisk.vue +1 -1
- package/edit/workload/storage/azureFile.vue +1 -1
- package/edit/workload/storage/csi/index.vue +1 -1
- package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
- package/edit/workload/storage/gcePersistentDisk.vue +1 -1
- package/edit/workload/storage/hostPath.vue +1 -1
- package/edit/workload/storage/nfs.vue +1 -1
- package/edit/workload/storage/persistentVolumeClaim/index.vue +1 -1
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +1 -1
- package/edit/workload/storage/secret.vue +1 -1
- package/edit/workload/storage/vsphereVolume.vue +1 -1
- package/layouts/default.vue +77 -16
- package/list/__tests__/workload.test.ts +50 -0
- package/list/fleet.cattle.io.gitrepo.vue +1 -1
- package/list/group.principal.vue +8 -8
- package/list/harvesterhci.io.management.cluster.vue +1 -1
- package/list/helm.cattle.io.projecthelmchart.vue +1 -1
- package/list/management.cattle.io.feature.vue +1 -1
- package/list/node.vue +1 -1
- package/list/provisioning.cattle.io.cluster.vue +3 -3
- package/machine-config/amazonec2.vue +1 -1
- package/machine-config/harvester.vue +4 -4
- package/mixins/__tests__/create-edit-view.test.ts +1 -1
- package/mixins/chart.js +14 -14
- package/mixins/create-edit-view/index.js +5 -5
- package/mixins/form-validation.js +1 -1
- package/mixins/labeled-form-element.ts +6 -6
- package/mixins/resource-fetch.js +3 -3
- package/mixins/resource-manager.js +1 -1
- package/models/autoscaling.horizontalpodautoscaler.js +5 -5
- package/models/batch.cronjob.js +15 -15
- package/models/batch.job.js +22 -0
- package/models/catalog.cattle.io.app.js +6 -6
- package/models/catalog.cattle.io.clusterrepo.js +7 -7
- package/models/catalog.cattle.io.operation.js +5 -5
- package/models/chart.js +4 -4
- package/models/cis.cattle.io.clusterscan.js +10 -10
- package/models/cluster/node.js +36 -36
- package/models/cluster.x-k8s.io.machine.js +13 -13
- package/models/constraints.gatekeeper.sh.constraint.js +1 -1
- package/models/etcdbackup.js +4 -4
- package/models/fleet.cattle.io.cluster.js +15 -15
- package/models/fleet.cattle.io.clustergroup.js +1 -1
- package/models/fleet.cattle.io.gitrepo.js +15 -15
- package/models/group.principal.js +1 -1
- package/models/logging.banzaicloud.io.clusterflow.js +2 -2
- package/models/logging.banzaicloud.io.flow.js +2 -2
- package/models/logging.banzaicloud.io.output.js +15 -3
- package/models/management.cattle.io.authconfig.js +4 -4
- package/models/management.cattle.io.cluster.js +9 -9
- package/models/management.cattle.io.clusterroletemplatebinding.js +8 -8
- package/models/management.cattle.io.globalrole.js +24 -3
- package/models/management.cattle.io.node.js +9 -9
- package/models/management.cattle.io.nodepool.js +3 -3
- package/models/management.cattle.io.nodetemplate.js +21 -21
- package/models/management.cattle.io.project.js +2 -2
- package/models/management.cattle.io.projectroletemplatebinding.js +6 -6
- package/models/management.cattle.io.roletemplate.js +54 -31
- package/models/management.cattle.io.user.js +4 -4
- package/models/monitoring.coreos.com.alertmanagerconfig.js +4 -4
- package/models/monitoring.coreos.com.receiver.js +7 -7
- package/models/monitoring.coreos.com.route.js +2 -2
- package/models/namespace.js +13 -0
- package/models/persistentvolumeclaim.js +4 -4
- package/models/pod.js +10 -10
- package/models/provisioning.cattle.io.cluster.js +29 -29
- package/models/rbac.authorization.k8s.io.role.js +4 -4
- package/models/rke.cattle.io.etcdsnapshot.js +4 -4
- package/models/service.js +15 -15
- package/models/storage.k8s.io.storageclass.js +8 -8
- package/models/workload.js +28 -28
- package/nuxt.config.js +32 -17
- package/package.json +2 -2
- package/pages/about.vue +1 -1
- package/pages/account/index.vue +1 -1
- package/pages/auth/login.vue +37 -7
- package/pages/auth/setup.vue +11 -11
- package/pages/c/_cluster/_product/_resource/_id.vue +2 -2
- package/pages/c/_cluster/apps/charts/chart.vue +4 -4
- package/pages/c/_cluster/apps/charts/index.vue +18 -18
- package/pages/c/_cluster/apps/charts/install.vue +14 -14
- package/pages/c/_cluster/auth/config/_id.vue +2 -2
- package/pages/c/_cluster/auth/roles/_resource/_id.vue +2 -2
- package/pages/c/_cluster/auth/roles/index.vue +4 -6
- package/pages/c/_cluster/explorer/EventsTable.vue +8 -8
- package/pages/c/_cluster/explorer/index.vue +14 -14
- package/pages/c/_cluster/explorer/tools/index.vue +4 -4
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +2 -2
- package/pages/c/_cluster/fleet/index.vue +10 -10
- package/pages/c/_cluster/gatekeeper/index.vue +1 -1
- package/pages/c/_cluster/legacy/index.vue +1 -1
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/mcapps/index.vue +1 -1
- package/pages/c/_cluster/navlinks/_group.vue +1 -1
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/banners.vue +30 -30
- package/pages/c/_cluster/settings/brand.vue +9 -9
- package/pages/c/_cluster/settings/links.vue +6 -6
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +1 -1
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +1 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +25 -8
- package/pages/c/_cluster/uiplugins/index.vue +2 -2
- package/pages/prefs.vue +11 -11
- package/pages/rio/mesh.vue +4 -4
- package/pages/support/index.vue +7 -7
- package/pkg/vue.config.js +10 -1
- package/plugins/dashboard-store/mutations.js +6 -6
- package/plugins/dashboard-store/normalize.js +1 -1
- package/plugins/dashboard-store/resource-class.js +100 -100
- package/plugins/steve/subscribe.js +4 -4
- package/plugins/steve/web-worker.steve-sub-worker.js +3 -3
- package/promptRemove/management.cattle.io.project.vue +1 -1
- package/promptRemove/mixin/roleDeletionCheck.js +7 -7
- package/promptRemove/pod.vue +2 -2
- package/rancher-components/Card/Card.test.ts +39 -0
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +0 -1
- package/rancher-components/StringList/StringList.test.ts +420 -45
- package/rancher-components/StringList/StringList.vue +10 -1
- package/rancher-components/Utils/DraggableZone/DraggableZone.vue +181 -0
- package/rancher-components/Utils/DraggableZone/index.ts +1 -0
- package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
- package/rancher-components/components/BadgeState/BadgeState.vue +111 -0
- package/rancher-components/components/BadgeState/index.ts +1 -0
- package/rancher-components/components/Banner/Banner.test.ts +13 -0
- package/rancher-components/components/Banner/Banner.vue +174 -0
- package/rancher-components/components/Banner/index.ts +1 -0
- package/rancher-components/components/Card/Card.test.ts +37 -0
- package/rancher-components/components/Card/Card.vue +166 -0
- package/rancher-components/components/Card/index.ts +1 -0
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +416 -0
- package/rancher-components/components/Form/Checkbox/index.ts +1 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +23 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +355 -0
- package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +276 -0
- package/rancher-components/components/Form/Radio/RadioGroup.vue +253 -0
- package/rancher-components/components/Form/Radio/index.ts +2 -0
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +169 -0
- package/rancher-components/components/Form/TextArea/index.ts +1 -0
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +94 -0
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +149 -0
- package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
- package/rancher-components/components/Form/index.ts +5 -0
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +152 -0
- package/rancher-components/components/LabeledTooltip/index.ts +1 -0
- package/rancher-components/components/StringList/StringList.test.ts +483 -0
- package/rancher-components/components/StringList/StringList.vue +605 -0
- package/rancher-components/components/StringList/index.ts +1 -0
- package/rancher-components/components/Utils/DraggableZone/DraggableZone.vue +181 -0
- package/rancher-components/components/Utils/DraggableZone/index.ts +1 -0
- package/scripts/publish-shell.sh +38 -5
- package/scripts/record-deps.js +37 -0
- package/scripts/test-plugins-build.sh +11 -7
- package/scripts/typegen.sh +84 -0
- package/store/action-menu.js +3 -3
- package/store/auth.js +4 -4
- package/store/aws.js +4 -4
- package/store/catalog.js +22 -22
- package/store/index.js +4 -4
- package/store/plugins.js +2 -2
- package/store/prefs.js +9 -1
- package/store/type-map.js +46 -31
- package/store/uiplugins.ts +2 -2
- package/store/wm.js +10 -0
- package/types/shell/index.d.ts +3059 -0
- package/types/vue-shim.d +20 -0
- package/utils/alertmanagerconfig.js +6 -6
- package/utils/gc/gc-types.ts +1 -1
- package/utils/object.js +2 -2
- package/utils/parse-externalid.js +5 -5
- package/utils/time.js +6 -0
- package/utils/validators/formRules/__tests__/index.test.ts +3 -3
- package/components/.DS_Store +0 -0
- package/components/__tests__/.DS_Store +0 -0
- package/creators/pkg/nuxt.config.js +0 -6
- package/creators/pkg/package-lock.json +0 -37
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Vue, { PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
|
|
5
|
+
import { findStringIndex, hasDuplicatedStrings } from '@shell/utils/array';
|
|
6
|
+
|
|
7
|
+
type Error = 'duplicate';
|
|
8
|
+
type ErrorMessages = Record<Error, string>;
|
|
9
|
+
|
|
10
|
+
type Arrow = 'up' | 'down';
|
|
11
|
+
|
|
12
|
+
const DIRECTION: Record<Arrow, number> = {
|
|
13
|
+
up: -1,
|
|
14
|
+
down: 1,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const INPUT = {
|
|
18
|
+
create: 'item-create',
|
|
19
|
+
edit: 'item-edit',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const BOX = 'box';
|
|
23
|
+
|
|
24
|
+
const CLASS = {
|
|
25
|
+
item: 'item',
|
|
26
|
+
error: 'error',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Manage a list of strings
|
|
31
|
+
*/
|
|
32
|
+
export default Vue.extend({
|
|
33
|
+
components: { LabeledInput },
|
|
34
|
+
|
|
35
|
+
name: 'StringList',
|
|
36
|
+
|
|
37
|
+
props: {
|
|
38
|
+
/**
|
|
39
|
+
* The items source
|
|
40
|
+
*/
|
|
41
|
+
items: {
|
|
42
|
+
type: Array as PropType<string[]>,
|
|
43
|
+
default() {
|
|
44
|
+
return [];
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Determines if items with same text will be treated differently, depending on the letters case
|
|
49
|
+
* It is used to compare items during create/edit actions and detect duplicates.
|
|
50
|
+
*/
|
|
51
|
+
caseSensitive: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Determines if the list of items is editable or view-only
|
|
57
|
+
*/
|
|
58
|
+
readonly: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* The placeholder to show in input field when create or edit items
|
|
64
|
+
*/
|
|
65
|
+
placeholder: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: null,
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* Determines the action buttons position at the bottom of the main box
|
|
71
|
+
*/
|
|
72
|
+
actionsPosition: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: 'right',
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Custom Error messages
|
|
78
|
+
*/
|
|
79
|
+
errorMessages: {
|
|
80
|
+
type: Object as PropType<ErrorMessages>,
|
|
81
|
+
default() {
|
|
82
|
+
return {} as ErrorMessages;
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
value: null as string | null,
|
|
89
|
+
selected: null as string | null,
|
|
90
|
+
editedItem: null as string | null,
|
|
91
|
+
isCreateItem: false,
|
|
92
|
+
errors: { duplicate: false } as Record<Error, boolean>
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
computed: {
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Create an array of error messages, one for each current error
|
|
100
|
+
*/
|
|
101
|
+
errorMessagesArray(): string[] {
|
|
102
|
+
return (Object.keys(this.errors) as Error[])
|
|
103
|
+
.filter(f => this.errors[f] && this.errorMessages[f])
|
|
104
|
+
.map(k => this.errorMessages[k]);
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
watch: {
|
|
109
|
+
/**
|
|
110
|
+
* Shutdown any user actions on the component when it becomes readonly
|
|
111
|
+
*/
|
|
112
|
+
readonly() {
|
|
113
|
+
this.toggleEditMode(false);
|
|
114
|
+
this.toggleCreateMode(false);
|
|
115
|
+
},
|
|
116
|
+
value(val) {
|
|
117
|
+
this.$emit('type:item', val);
|
|
118
|
+
},
|
|
119
|
+
errors: {
|
|
120
|
+
handler(val) {
|
|
121
|
+
this.$emit('errors', val);
|
|
122
|
+
},
|
|
123
|
+
deep: true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
methods: {
|
|
128
|
+
onChange(value: string) {
|
|
129
|
+
this.value = value;
|
|
130
|
+
|
|
131
|
+
const items = [
|
|
132
|
+
...this.items,
|
|
133
|
+
this.value
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
this.toggleError(
|
|
137
|
+
'duplicate',
|
|
138
|
+
hasDuplicatedStrings(items, this.caseSensitive),
|
|
139
|
+
this.isCreateItem ? INPUT.create : INPUT.edit
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
onSelect(item: string) {
|
|
144
|
+
if (this.readonly || this.isCreateItem || this.editedItem === item) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this.selected = item;
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
onSelectNext(arrow: Arrow) {
|
|
151
|
+
const index = findStringIndex(
|
|
152
|
+
this.items,
|
|
153
|
+
this.selected as string,
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
if (index !== -1) {
|
|
157
|
+
/**
|
|
158
|
+
* Select next item in the arrow's direction if it exists,
|
|
159
|
+
* else select again this.selected (do nothing)
|
|
160
|
+
*/
|
|
161
|
+
const item = (this.items[index + DIRECTION[arrow]] || this.selected) as string;
|
|
162
|
+
|
|
163
|
+
this.onSelect(item);
|
|
164
|
+
this.moveScrollbar(arrow);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
onSelectLeave(item?: string) {
|
|
169
|
+
if (item === this.selected) {
|
|
170
|
+
this.selected = null;
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
onClickEmptyBody() {
|
|
175
|
+
if (!this.isCreateItem && !this.editedItem) {
|
|
176
|
+
this.toggleCreateMode(true);
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
onClickPlusButton() {
|
|
181
|
+
this.onSelectLeave();
|
|
182
|
+
this.toggleCreateMode(true);
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
onClickMinusButton() {
|
|
186
|
+
if (this.isCreateItem) {
|
|
187
|
+
this.toggleCreateMode(false);
|
|
188
|
+
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (this.editedItem) {
|
|
192
|
+
this.toggleEditMode(false);
|
|
193
|
+
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (this.selected) {
|
|
197
|
+
const index = findStringIndex(this.items, this.selected, false);
|
|
198
|
+
|
|
199
|
+
if (index !== -1) {
|
|
200
|
+
/**
|
|
201
|
+
* Select the next item in the list when an item is to be deleted.
|
|
202
|
+
*/
|
|
203
|
+
const item = (this.items[index + 1] || this.items[index - 1]);
|
|
204
|
+
|
|
205
|
+
this.onSelect(item);
|
|
206
|
+
this.setFocus(item);
|
|
207
|
+
|
|
208
|
+
this.deleteItem(this.items[index]);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
setFocus(refId: string) {
|
|
214
|
+
this.$nextTick(() => this.getElemByRef(refId)?.focus());
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Move scrollbar when the selected item is over the top or bottom side of the box
|
|
219
|
+
*/
|
|
220
|
+
moveScrollbar(arrow: Arrow, value?: number) {
|
|
221
|
+
const box = this.getElemByRef(BOX);
|
|
222
|
+
const item = this.getElemByRef(this.selected || '');
|
|
223
|
+
|
|
224
|
+
if (box && item && item.className.includes(CLASS.item)) {
|
|
225
|
+
const boxRect = box.getClientRects()[0];
|
|
226
|
+
const itemRect = item.getClientRects()[0];
|
|
227
|
+
|
|
228
|
+
if (
|
|
229
|
+
(arrow === 'down' && itemRect.bottom > boxRect.bottom) ||
|
|
230
|
+
(arrow === 'up' && itemRect.top < boxRect.top)
|
|
231
|
+
) {
|
|
232
|
+
const top = (value ?? itemRect.height) * DIRECTION[arrow];
|
|
233
|
+
|
|
234
|
+
box.scrollBy({ top });
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Set an error and eventually assign an error class to the element
|
|
241
|
+
*/
|
|
242
|
+
toggleError(type: Error, val: boolean, refId?: string) {
|
|
243
|
+
this.errors[type] = val;
|
|
244
|
+
|
|
245
|
+
if (refId) {
|
|
246
|
+
this.toggleErrorClass(refId, val);
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
toggleErrorClass(refId: string, val: boolean) {
|
|
251
|
+
const input = this.getElemByRef(refId)?.$el;
|
|
252
|
+
|
|
253
|
+
if (input) {
|
|
254
|
+
if (val) {
|
|
255
|
+
input.classList.add(CLASS.error);
|
|
256
|
+
} else {
|
|
257
|
+
input.classList.remove(CLASS.error);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Show/Hide the input line to create new item
|
|
264
|
+
*/
|
|
265
|
+
toggleCreateMode(show: boolean) {
|
|
266
|
+
if (this.readonly) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (show) {
|
|
270
|
+
this.toggleEditMode(false);
|
|
271
|
+
this.value = '';
|
|
272
|
+
|
|
273
|
+
this.isCreateItem = true;
|
|
274
|
+
this.setFocus(INPUT.create);
|
|
275
|
+
} else {
|
|
276
|
+
this.value = null;
|
|
277
|
+
this.toggleError('duplicate', false);
|
|
278
|
+
this.onSelectLeave();
|
|
279
|
+
|
|
280
|
+
this.isCreateItem = false;
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Show/Hide the in-line editing to edit an existing item
|
|
286
|
+
*/
|
|
287
|
+
toggleEditMode(show: boolean, item?: string) {
|
|
288
|
+
if (this.readonly) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (show) {
|
|
292
|
+
this.toggleCreateMode(false);
|
|
293
|
+
this.value = this.editedItem;
|
|
294
|
+
|
|
295
|
+
this.editedItem = item || '';
|
|
296
|
+
this.setFocus(INPUT.edit);
|
|
297
|
+
} else {
|
|
298
|
+
this.value = null;
|
|
299
|
+
this.toggleError('duplicate', false);
|
|
300
|
+
this.onSelectLeave();
|
|
301
|
+
|
|
302
|
+
this.editedItem = null;
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
getElemByRef(id: string) {
|
|
307
|
+
const ref = this.$refs[id];
|
|
308
|
+
|
|
309
|
+
return (Array.isArray(ref) ? ref[0] : ref) as any;
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Create a new item and insert in the items list
|
|
314
|
+
*/
|
|
315
|
+
saveItem(closeInput = true) {
|
|
316
|
+
const value = this.value?.trim();
|
|
317
|
+
|
|
318
|
+
if (value) {
|
|
319
|
+
const items = [
|
|
320
|
+
...this.items,
|
|
321
|
+
value,
|
|
322
|
+
];
|
|
323
|
+
|
|
324
|
+
if (!hasDuplicatedStrings(items, this.caseSensitive)) {
|
|
325
|
+
this.updateItems(items);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (closeInput) {
|
|
330
|
+
this.toggleCreateMode(false);
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Update an existing item in the items list
|
|
336
|
+
*/
|
|
337
|
+
updateItem(item: string, closeInput = true) {
|
|
338
|
+
const value = this.value?.trim();
|
|
339
|
+
|
|
340
|
+
if (value) {
|
|
341
|
+
const items = [...this.items];
|
|
342
|
+
const index = findStringIndex(items, item, false);
|
|
343
|
+
|
|
344
|
+
if (index !== -1) {
|
|
345
|
+
items[index] = value;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (!hasDuplicatedStrings(items, this.caseSensitive)) {
|
|
349
|
+
this.updateItems(items);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (closeInput) {
|
|
354
|
+
this.toggleEditMode(false);
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Remove an item from items list
|
|
360
|
+
*/
|
|
361
|
+
deleteItem(item?: string) {
|
|
362
|
+
const items = this.items.filter(f => f !== item);
|
|
363
|
+
|
|
364
|
+
this.updateItems(items);
|
|
365
|
+
},
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Update items list and emit to parent component
|
|
369
|
+
*/
|
|
370
|
+
updateItems(items: string[]) {
|
|
371
|
+
this.$emit('change', items);
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
});
|
|
376
|
+
</script>
|
|
377
|
+
|
|
378
|
+
<template>
|
|
379
|
+
<div
|
|
380
|
+
class="string-list"
|
|
381
|
+
:class="{ readonly }"
|
|
382
|
+
>
|
|
383
|
+
<div
|
|
384
|
+
ref="box"
|
|
385
|
+
data-testid="div-string-list-box"
|
|
386
|
+
class="string-list-box"
|
|
387
|
+
tabindex="0"
|
|
388
|
+
@dblclick="onClickEmptyBody()"
|
|
389
|
+
>
|
|
390
|
+
<div
|
|
391
|
+
v-for="item in items"
|
|
392
|
+
:key="item"
|
|
393
|
+
:ref="item"
|
|
394
|
+
:class="{
|
|
395
|
+
selected: selected === item,
|
|
396
|
+
readonly
|
|
397
|
+
}"
|
|
398
|
+
:data-testid="`div-item-${item}`"
|
|
399
|
+
class="item static"
|
|
400
|
+
tabindex="0"
|
|
401
|
+
@mousedown="onSelect(item)"
|
|
402
|
+
@dblclick.stop="toggleEditMode(true, item)"
|
|
403
|
+
@keydown.down.prevent="onSelectNext('down')"
|
|
404
|
+
@keydown.up.prevent="onSelectNext('up')"
|
|
405
|
+
@blur="onSelectLeave(item)"
|
|
406
|
+
>
|
|
407
|
+
<span
|
|
408
|
+
v-if="!editedItem || editedItem !== item"
|
|
409
|
+
class="label static"
|
|
410
|
+
>
|
|
411
|
+
{{ item }}
|
|
412
|
+
</span>
|
|
413
|
+
<LabeledInput
|
|
414
|
+
v-if="editedItem && editedItem === item"
|
|
415
|
+
ref="item-edit"
|
|
416
|
+
:data-testid="`item-edit-${item}`"
|
|
417
|
+
class="edit-input static"
|
|
418
|
+
:value="value != null ? value : item"
|
|
419
|
+
@input="onChange($event)"
|
|
420
|
+
@blur.prevent="updateItem(item)"
|
|
421
|
+
@keydown.native.enter="updateItem(item, !errors.duplicate)"
|
|
422
|
+
/>
|
|
423
|
+
</div>
|
|
424
|
+
<div
|
|
425
|
+
v-if="isCreateItem"
|
|
426
|
+
class="create-field static"
|
|
427
|
+
>
|
|
428
|
+
<LabeledInput
|
|
429
|
+
ref="item-create"
|
|
430
|
+
data-testid="item-create"
|
|
431
|
+
class="create-input static"
|
|
432
|
+
type="text"
|
|
433
|
+
:value="value"
|
|
434
|
+
:placeholder="placeholder"
|
|
435
|
+
@input="onChange($event)"
|
|
436
|
+
@blur.prevent="saveItem"
|
|
437
|
+
@keydown.native.enter="saveItem(!errors.duplicate)"
|
|
438
|
+
/>
|
|
439
|
+
</div>
|
|
440
|
+
</div>
|
|
441
|
+
<div
|
|
442
|
+
v-if="!readonly"
|
|
443
|
+
class="string-list-footer"
|
|
444
|
+
:class="{[actionsPosition]: true }"
|
|
445
|
+
>
|
|
446
|
+
<div
|
|
447
|
+
data-testid="div-action-buttons"
|
|
448
|
+
class="action-buttons"
|
|
449
|
+
>
|
|
450
|
+
<button
|
|
451
|
+
data-testid="button-remove"
|
|
452
|
+
class="btn btn-sm role-tertiary remove-button"
|
|
453
|
+
:disabled="!selected && !isCreateItem && !editedItem"
|
|
454
|
+
@mousedown.prevent="onClickMinusButton"
|
|
455
|
+
>
|
|
456
|
+
<span class="icon icon-minus icon-sm" />
|
|
457
|
+
</button>
|
|
458
|
+
<button
|
|
459
|
+
data-testid="button-add"
|
|
460
|
+
class="btn btn-sm role-tertiary add-button"
|
|
461
|
+
:disabled="isCreateItem || editedItem"
|
|
462
|
+
@click.prevent="onClickPlusButton"
|
|
463
|
+
>
|
|
464
|
+
<span class="icon icon-plus icon-sm" />
|
|
465
|
+
</button>
|
|
466
|
+
</div>
|
|
467
|
+
<div class="messages">
|
|
468
|
+
<i
|
|
469
|
+
v-if="errorMessagesArray.length > 0"
|
|
470
|
+
data-testid="i-warning-icon"
|
|
471
|
+
class="icon icon-warning icon-lg"
|
|
472
|
+
/>
|
|
473
|
+
<span
|
|
474
|
+
v-for="(msg, idx) in errorMessagesArray"
|
|
475
|
+
:key="idx"
|
|
476
|
+
:data-testid="`span-error-message-${msg}`"
|
|
477
|
+
class="error"
|
|
478
|
+
>
|
|
479
|
+
{{ idx > 0 ? '; ' : '' }}
|
|
480
|
+
{{ msg }}
|
|
481
|
+
</span>
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
</template>
|
|
486
|
+
|
|
487
|
+
<style lang="scss" scoped>
|
|
488
|
+
|
|
489
|
+
.string-list {
|
|
490
|
+
display: flex;
|
|
491
|
+
flex-direction: column;
|
|
492
|
+
width: auto;
|
|
493
|
+
|
|
494
|
+
&.readonly {
|
|
495
|
+
cursor: default;
|
|
496
|
+
opacity: 0.4;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.string-list-box {
|
|
500
|
+
min-height: 200px;
|
|
501
|
+
height: 100%;
|
|
502
|
+
outline: none;
|
|
503
|
+
overflow-y: auto;
|
|
504
|
+
overflow-x: hidden;
|
|
505
|
+
border: solid var(--border-width) var(--input-border);
|
|
506
|
+
padding-top: 3px;
|
|
507
|
+
|
|
508
|
+
.static {
|
|
509
|
+
height: 25px;
|
|
510
|
+
padding: 3px;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.item {
|
|
514
|
+
outline: none;
|
|
515
|
+
|
|
516
|
+
&.selected {
|
|
517
|
+
background: var(--primary);
|
|
518
|
+
color: var(--primary-hover-text);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
&.readonly {
|
|
522
|
+
pointer-events: none;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.label {
|
|
526
|
+
display: block;
|
|
527
|
+
width: auto;
|
|
528
|
+
user-select: none;
|
|
529
|
+
overflow: hidden;
|
|
530
|
+
text-overflow: ellipsis;
|
|
531
|
+
padding-top: 1px;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.create-field {
|
|
536
|
+
padding-top: 1px;
|
|
537
|
+
margin-bottom: 7px;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.labeled-input {
|
|
541
|
+
padding-top: 0;
|
|
542
|
+
padding-bottom: 0;
|
|
543
|
+
border-radius: 0;
|
|
544
|
+
&.error {
|
|
545
|
+
border: none;
|
|
546
|
+
box-shadow: 0 0 0 var(--outline-width) var(--error);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.string-list-footer {
|
|
552
|
+
--footer-height: 28px;
|
|
553
|
+
height: var(--footer-height);
|
|
554
|
+
margin-top: 5px;
|
|
555
|
+
display: flex;
|
|
556
|
+
justify-content: space-between;
|
|
557
|
+
gap: 0.5rem;
|
|
558
|
+
|
|
559
|
+
&.left {
|
|
560
|
+
flex-direction: row;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
&.right {
|
|
564
|
+
flex-direction: row-reverse;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.action-buttons {
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-direction: row-reverse;
|
|
570
|
+
gap: 0.5rem;
|
|
571
|
+
|
|
572
|
+
.btn {
|
|
573
|
+
min-height: var(--footer-height);
|
|
574
|
+
line-height: 0;
|
|
575
|
+
border-radius: 2px;
|
|
576
|
+
|
|
577
|
+
&:disabled {
|
|
578
|
+
cursor: default;
|
|
579
|
+
pointer-events: none;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.messages {
|
|
585
|
+
line-height: var(--footer-height);
|
|
586
|
+
|
|
587
|
+
.error, .icon-warning {
|
|
588
|
+
color: var(--error);
|
|
589
|
+
line-height: inherit;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
::v-deep {
|
|
596
|
+
.labeled-input INPUT.no-label,
|
|
597
|
+
.labeled-input INPUT:hover.no-label,
|
|
598
|
+
.labeled-input INPUT:focus.no-label {
|
|
599
|
+
padding: 1px 0px 0px 0px;
|
|
600
|
+
}
|
|
601
|
+
.labeled-input.compact-input {
|
|
602
|
+
min-height: 0;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StringList } from './StringList.vue';
|