Gathering detailed insights and metrics for @kong-ui-public/copy-uuid
Gathering detailed insights and metrics for @kong-ui-public/copy-uuid
Kong open-source UI components and associated packages
npm install @kong-ui-public/copy-uuid
Typescript
Module System
Node Version
NPM Version
50.4
Supply Chain
76.5
Quality
85.6
Maintenance
100
Vulnerability
99.6
License
@kong-ui-public/entities-plugins@9.10.0
Published on 07 Feb 2025
@kong-ui-public/entities-gateway-services@3.9.0
Published on 07 Feb 2025
@kong-ui-public/entities-certificates@3.7.0
Published on 07 Feb 2025
@kong-ui-public/entities-routes@3.9.0
Published on 07 Feb 2025
@kong-ui-public/dashboard-renderer@0.35.0
Published on 06 Feb 2025
@kong-ui-public/tracing@0.7.0
Published on 05 Feb 2025
TypeScript (55.29%)
Vue (43.43%)
HTML (0.55%)
JavaScript (0.41%)
SCSS (0.25%)
CSS (0.07%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
384,496
Last Day
64
Last Week
188
Last Month
1,244
Last Year
50,441
9 Stars
3,124 Commits
11 Forks
14 Watching
27 Branches
83 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.47
Package Id
@kong-ui-public/copy-uuid@2.0.47
Unpacked Size
38.91 kB
Size
12.70 kB
File Count
16
NPM Version
10.2.4
Node Version
18.19.1
Publised On
18 Mar 2024
Cumulative downloads
Total Downloads
Last day
-5.9%
64
Compared to previous day
Last week
-55.8%
188
Compared to previous week
Last month
-35.4%
1,244
Compared to previous month
Last year
-84.9%
50,441
Compared to previous year
1
3
4
A Kong UI component for displaying uuid and copying it to clipboard.
notify
method through provide
or prop
vue
must be initialized in the host application@kong/kongponents
must be available as a dependency
in the host application, along with the package's style imports. See here for instructions on installing Kongponents. Specifically, the following Kongponents must be available:
KClipboardProvider
KIcon
@kong-ui-public/i18n
must be available as a dependency
in the host application.Install the component in your host application
1yarn add @kong-ui-public/copy-uuid
You can register copy-uuid
globally or locally.
1// Global registration 2import { createApp } from 'vue' 3import CopyUuid, { CopyUuidNotifyParam } from '@kong-ui-public/copy-uuid' 4import '@kong-ui-public/copy-uuid/dist/style.css' 5 6const app = createApp(App) 7 8app.use(CopyUuid)
1<!-- Local registration --> 2<template> 3 <copy-uuid /> 4</template> 5 6<script setup lang="ts"> 7import { CopyUuid } from '@kong-ui-public/copy-uuid' 8</script>
You can set up an optional global notify
method, and every copy-uuid
component instance will use this method as a default.
If you're using copy-uuid
as a vue plugin:
1// app entry file 2import { createApp } from 'vue' 3import CopyUuid, { CopyUuidNotifyParam } from '@kong-ui-public/copy-uuid' 4import '@kong-ui-public/copy-uuid/dist/style.css' 5 6const app = createApp(App) 7 8app.use(CopyUuid, { 9 notify: (props: CopyUuidNotifyParam) => { 10 // Notify your end users 11 } 12})
If you prefer using copy-uuid
as a component:
1// app entry file 2import { createApp } from 'vue' 3import { COPY_UUID_NOTIFY_KEY, CopyUuidNotifyParam } from '@kong-ui-public/copy-uuid' 4 5const app = createApp(App) 6 7app.provide(COPY_UUID_NOTIFY_KEY, (props: CopyUuidNotifyParam) => { 8 // Notify your end users 9})
You could also set up a notify
method for each copy-uuid
component instance through its prop
. If the notify
prop is defined, it'll take precedence over the global notify
method:
1<template> 2 <copy-uuid 3 <!-- other props --> 4 :notify="notify" 5 /> 6</template> 7 8<script setup lang="ts"> 9 import { CopyUuidNotifyParam } from '@kong-ui-public/copy-uuid' 10 11 const notify = (param: CopyUuidNotifyParam) => { 12 // Notify your end users 13 } 14</script>
TypeScript interfaces are available here and can be directly imported into your host application. The following interfaces are available for import:
1import type { CopyUuidNotifyParam, CopyUuidInstallOptions } from '@kong-ui-public/copy-uuid'
uuid
String
true
The UUID string. When the copy button is clicked, this string will be copied to clipboard.
truncated
Boolean
false
true
An indicator of whether a long UUID is truncated. When true
, the UUID will be truncated to 8 characters. When false
, the UUID will be displayed in full.
useMono
Boolean
false
true
An indicator of whether a .mono
class is added to the UUID string. Make sure to import the Kongponents style file in your host application for this class to take effect.
format
String as PropType<'uuid' | 'hidden' | 'redacted' | 'deleted'>
false
uuid
Determines the display format of the UUID string. The component can take the following format
values:
uuid
: displays regular uuidhidden
: displays just a copy button without textredacted
: displays *****
deleted
: displays *<first-5-chars-of-uuid>
notify
Function as PropType<(param: CopyUuidNotifyParam) => void>
false
undefined
A function that will be called when the copy button is clicked. The function will receive a CopyUuidNotifyParam
object as its only argument. The CopyUuidNotifyParam
object has the following properties:
type
: success
| error
, indicating whether the copy operation is successfulmessage
: string
, the message to be displayed to the end usericonColor
String
false
'rgba(0, 0, 0, 0.45)'
The color of the copy
icon.
tooltip
String
false
''
Tooltip text to display on hovering over the copy icon. This field is required if successTooltip
has a value.
successTooltip
String
false
''
Note: The tooltip
prop is required to have a value in order to use this prop. When using this prop the @success
and @error
events will not be fired, as the tooltip text will be updated instead.
Tooltip text to display on successful copy.
Success and error events are only emitted if NOT using the successTooltip
prop.
success
A success
event is emitted when the UUID is successfully copied to clipboard. The event payload is the UUID.
error
An error
event is emitted when an error occurs when trying to copy the UUID. The event payload is the UUID.
No vulnerabilities found.
No security vulnerabilities found.