@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
8 lines • 3.22 kB
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
import{h as t,r as e,H as s,g as o}from"./p-1b1223fb.js";import{B as i}from"./p-3e80562d.js";import{T as a}from"./p-9932bc13.js";
/*!
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
*/const n=e=>{const{color:s="gray-10"}=e;return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"31",fill:"none"},t("path",{fill:`var(--pv-color-${s})`,d:"M15 13.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm14 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"}))};const r='.sc-peculiar-button-menu-h{display:-ms-inline-flexbox;display:inline-flex;position:relative}.is_shown.sc-peculiar-button-menu-h .button_popover.sc-peculiar-button-menu:before{position:fixed;width:100%;height:100%;top:0;left:0;content:""}.is_shown.sc-peculiar-button-menu-h .popover.sc-peculiar-button-menu{display:block}.popover.sc-peculiar-button-menu{min-width:200px;position:absolute;top:100%;right:0;border-radius:4px;z-index:1;-webkit-box-shadow:var(--pv-shadow-light-medium);box-shadow:var(--pv-shadow-light-medium);background:var(--pv-color-white);padding:var(--pv-size-base-2) 0;margin:var(--pv-size-base) 0;display:none}.button_option.sc-peculiar-button-menu{width:100%;-ms-flex-pack:start;justify-content:flex-start;border-radius:0}.group.sc-peculiar-button-menu:not(:last-child){border-bottom:1px solid var(--pv-color-gray-5);padding-bottom:var(--pv-size-base-2);margin-bottom:var(--pv-size-base)}.group_title.sc-peculiar-button-menu{line-height:var(--pv-size-base-6);padding:0 var(--pv-size-base-2)}';const c=r;const p=class{constructor(t){e(this,t);this.handleClick=()=>{this.open=!this.open};this.groups=[];this.open=false}render(){return t(s,{key:"484c56eb147ee97b4be9d9c0c324a6192be5d1b4",class:{is_shown:this.open}},t(i,{key:"00b7864c569169633c30a69f26185891ba9c39d1",class:"button_popover",onClick:this.handleClick,startIcon:t(n,null)}),t("div",{key:"afe0500732f053c8b22c65ec11bd2010546fc5e6",role:"dialog",tabIndex:-1,class:"popover","aria-hidden":String(this.open)},this.groups.map((e=>t("div",{class:"group"},t(a,{variant:"c2",color:"gray-9",class:"group_title"},e.title),e.options.map((e=>t(i,{class:"button_option",startIcon:e.startIcon,href:e.href,onClick:t=>{t.stopPropagation();this.handleClick();if(e.onClick){e.onClick(t)}}},e.text))))))))}};p.style=c;const l=":host{display:inline}::slotted(mark){background-color:var(--pv-color-attention-tint-4)}";const h=l;const d=class{constructor(t){e(this,t);this.tag="mark";this.search=undefined}componentDidLoad(){this.handleHighlightSearch()}componentDidUpdate(){this.handleHighlightSearch()}handleHighlightSearch(){const t=this.resetHighlightSearch(this.host.innerHTML);let e=t;if(this.search){const s=new RegExp(`(${this.search})`,"gi");e=t.replace(s,`<${this.tag}>$1</${this.tag}>`)}this.host.innerHTML=e}resetHighlightSearch(t){const e=new RegExp(`</?${this.tag}>`,"g");return t.replace(e,"")}render(){return t(s,{key:"353abad7e2fc43ea4af75ec025e08d2ff3159ee6"},t("slot",{key:"9ac44c0a2b95ea7a778e2d6a2909c797f8c17b6d"}))}get host(){return o(this)}};d.style=h;export{p as peculiar_button_menu,d as peculiar_highlight_words};
//# sourceMappingURL=p-81183b16.entry.js.map