@kit-data-manager/pid-component
Version:
The PID-Component is a web component that can be used to evaluate and display FAIR Digital Objects, PIDs, ORCiDs, and possibly other identifiers in a user-friendly way. It is easily extensible to support other identifier types.
19 lines • 1.89 kB
JavaScript
/*!
*
* Copyright 2024 Karlsruhe Institute of Technology.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import{r as e,h as t,H as o}from"./p-19958745.js";const n=class{constructor(t){e(this,t)}render(){function e(e,t){if("clipboard"in navigator){navigator.clipboard.writeText(t).then((()=>o()))}else{const e=document.createElement("textarea");e.value=t;e.style.opacity="0";document.body.appendChild(e);e.focus();e.select();try{const e=document.execCommand("copy");console.debug(`Deprecated Text copy was ${e?"successful":"unsuccessful"}.`);o()}catch(e){console.error(e.name,e.message)}document.body.removeChild(e)}function o(){const t=e.target;t.innerText="✓ Copied!";t.classList.remove("hover:bg-blue-200");t.classList.remove("bg-white");t.classList.add("bg-green-200");setTimeout((()=>{t.classList.remove("bg-green-200");t.classList.add("hover:bg-blue-200");t.classList.add("bg-white");t.innerText="Copy"}),1500)}}return t(o,{key:"b2cfb19eeb72103bd07d7d8f7596a6b2f343f506",class:"inline-block align-baseline text-xs"},t("button",{key:"3bbbe4e78d3d2b31f873354f229077e781df9e6f",class:"bg-white border border-slate-500 text-slate-800 font-medium font-mono rounded-md px-2 py-0.5 hover:bg-blue-200 hover:text-slate-900 flex-none max-h-min items-center",onClick:t=>e(t,this.value)},"Copy"))}};export{n as copy_button};
//# sourceMappingURL=p-daa2fb65.entry.js.map