@vertexvis/ui 0.1.0-canary.1 → 0.1.0-canary.11

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.
Files changed (128) hide show
  1. package/dist/cjs/badge-d39ac1fc.js +23 -0
  2. package/dist/cjs/components.cjs.js +1 -1
  3. package/dist/cjs/icon-button-e2dbc8b2.js +43 -0
  4. package/dist/cjs/{icon-53d62a46.js → icon-c40f74ca.js} +1 -1
  5. package/dist/cjs/{icon-helper-caf2699e.js → icon-helper-c24d6e6b.js} +18 -0
  6. package/dist/cjs/index.cjs.js +11 -9
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{popover-d9ec8e10.js → popover-942209b8.js} +23 -1
  9. package/dist/cjs/{result-list-1e592c3c.js → result-list-241ffe8d.js} +46 -2
  10. package/dist/cjs/search-bar-91cbcd07.js +421 -0
  11. package/dist/cjs/{select-0eb7203f.js → select-5f8aecfe.js} +27 -4
  12. package/dist/cjs/{text-field-0397fb34.js → text-field-bccbde1f.js} +1 -0
  13. package/dist/cjs/{tooltip-80a7b722.js → tooltip-e9f63631.js} +57 -18
  14. package/dist/cjs/vertex-badge.cjs.entry.js +11 -0
  15. package/dist/cjs/vertex-icon-button.cjs.entry.js +2 -2
  16. package/dist/cjs/vertex-icon.cjs.entry.js +2 -2
  17. package/dist/cjs/vertex-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/vertex-result-list.cjs.entry.js +1 -1
  19. package/dist/cjs/vertex-search-bar.cjs.entry.js +1 -1
  20. package/dist/cjs/vertex-select.cjs.entry.js +1 -1
  21. package/dist/cjs/vertex-textfield.cjs.entry.js +1 -1
  22. package/dist/cjs/vertex-tooltip.cjs.entry.js +1 -1
  23. package/dist/collection/collection-manifest.json +2 -1
  24. package/dist/collection/components/badge/badge.css +18 -0
  25. package/dist/collection/components/badge/badge.js +69 -0
  26. package/dist/collection/components/icon/icon-helper.js +9 -0
  27. package/dist/collection/components/icon/icon.js +1 -1
  28. package/dist/collection/components/icon/icons/comment-filled.js +2 -0
  29. package/dist/collection/components/icon/icons/compare.js +2 -0
  30. package/dist/collection/components/icon/icons/pin-text-square.js +2 -0
  31. package/dist/collection/components/icon-button/icon-button.css +16 -1
  32. package/dist/collection/components/icon-button/icon-button.js +2 -2
  33. package/dist/collection/components/index.js +1 -0
  34. package/dist/collection/components/menu/menu.js +1 -1
  35. package/dist/collection/components/popover/popover.js +51 -0
  36. package/dist/collection/components/result-list/result-list.js +52 -5
  37. package/dist/collection/components/result-list/types.js +1 -0
  38. package/dist/collection/components/search-bar/dom.js +12 -0
  39. package/dist/collection/components/search-bar/lib.js +35 -15
  40. package/dist/collection/components/search-bar/search-bar.css +0 -16
  41. package/dist/collection/components/search-bar/search-bar.js +380 -324
  42. package/dist/collection/components/select/select.css +16 -0
  43. package/dist/collection/components/select/select.js +49 -2
  44. package/dist/collection/components/text-field/text-field.js +1 -0
  45. package/dist/collection/components/tooltip/tooltip.js +62 -18
  46. package/dist/collection/types/icon.js +3 -0
  47. package/dist/collection/util/templates/element-pool.js +19 -1
  48. package/dist/components/components.css +1 -1
  49. package/dist/components/components.esm.js +1 -1
  50. package/dist/components/index.esm.js +1 -1
  51. package/dist/components/p-08f0434e.js +1 -0
  52. package/dist/components/p-0b1cdc8a.entry.js +1 -0
  53. package/dist/components/p-0b4406fa.entry.js +1 -0
  54. package/dist/components/p-29d7697f.js +1 -0
  55. package/dist/components/p-406e73da.entry.js +1 -0
  56. package/dist/components/p-43b1b3f9.js +1 -0
  57. package/dist/components/p-606596de.entry.js +1 -0
  58. package/dist/components/p-6b862967.js +1 -0
  59. package/dist/components/p-7cfb3736.entry.js +1 -0
  60. package/dist/components/p-90a530df.entry.js +1 -0
  61. package/dist/components/p-912f6e24.js +1 -0
  62. package/dist/components/{p-17b97932.js → p-91811c21.js} +1 -1
  63. package/dist/components/p-92930f2a.js +1 -0
  64. package/dist/components/p-9340952f.entry.js +1 -0
  65. package/dist/components/p-c2706288.js +1 -0
  66. package/dist/components/p-cfe369bf.entry.js +1 -0
  67. package/dist/components/p-db34f10c.js +1 -0
  68. package/dist/components/p-ee496965.entry.js +1 -0
  69. package/dist/components/p-f007c274.js +1 -0
  70. package/dist/esm/badge-6d27ca92.js +21 -0
  71. package/dist/esm/components.js +1 -1
  72. package/dist/esm/icon-button-b0992730.js +41 -0
  73. package/dist/esm/{icon-2630793d.js → icon-c48d1e4c.js} +1 -1
  74. package/dist/esm/{icon-helper-10a99d95.js → icon-helper-cf9f8ca1.js} +18 -0
  75. package/dist/esm/index.js +10 -9
  76. package/dist/esm/loader.js +1 -1
  77. package/dist/esm/{popover-67c88e4b.js → popover-6e806354.js} +23 -1
  78. package/dist/esm/{result-list-36cfb08a.js → result-list-16c6afbd.js} +46 -2
  79. package/dist/esm/search-bar-f12a3599.js +419 -0
  80. package/dist/esm/{select-75ed5653.js → select-d4e135b7.js} +27 -4
  81. package/dist/esm/{text-field-e542da25.js → text-field-32ac877e.js} +1 -0
  82. package/dist/esm/{tooltip-97c1b3ec.js → tooltip-933da261.js} +57 -18
  83. package/dist/esm/vertex-badge.entry.js +3 -0
  84. package/dist/esm/vertex-icon-button.entry.js +2 -2
  85. package/dist/esm/vertex-icon.entry.js +2 -2
  86. package/dist/esm/vertex-popover.entry.js +1 -1
  87. package/dist/esm/vertex-result-list.entry.js +1 -1
  88. package/dist/esm/vertex-search-bar.entry.js +1 -1
  89. package/dist/esm/vertex-select.entry.js +1 -1
  90. package/dist/esm/vertex-textfield.entry.js +1 -1
  91. package/dist/esm/vertex-tooltip.entry.js +1 -1
  92. package/dist/types/components/badge/badge.d.ts +14 -0
  93. package/dist/types/components/icon/icons/comment-filled.d.ts +3 -0
  94. package/dist/types/components/icon/icons/compare.d.ts +3 -0
  95. package/dist/types/components/icon/icons/pin-text-square.d.ts +3 -0
  96. package/dist/types/components/index.d.ts +1 -0
  97. package/dist/types/components/popover/popover.d.ts +7 -0
  98. package/dist/types/components/result-list/result-list.d.ts +6 -1
  99. package/dist/types/components/result-list/types.d.ts +4 -0
  100. package/dist/types/components/search-bar/dom.d.ts +3 -0
  101. package/dist/types/components/search-bar/lib.d.ts +24 -6
  102. package/dist/types/components/search-bar/search-bar.d.ts +124 -42
  103. package/dist/types/components/select/select.d.ts +8 -0
  104. package/dist/types/components/tooltip/tooltip.d.ts +7 -0
  105. package/dist/types/components.d.ts +122 -20
  106. package/dist/types/types/icon.d.ts +3 -0
  107. package/dist/types/util/templates/element-pool.d.ts +10 -1
  108. package/package.json +4 -3
  109. package/dist/cjs/icon-button-f868bf06.js +0 -43
  110. package/dist/cjs/search-bar-bb40cfa7.js +0 -290
  111. package/dist/components/p-19318fee.entry.js +0 -1
  112. package/dist/components/p-1d6cb015.entry.js +0 -1
  113. package/dist/components/p-209db2ba.entry.js +0 -1
  114. package/dist/components/p-4224c2ad.js +0 -1
  115. package/dist/components/p-52739247.js +0 -1
  116. package/dist/components/p-552c128f.js +0 -1
  117. package/dist/components/p-6505cdb3.js +0 -1
  118. package/dist/components/p-79fd6fb6.entry.js +0 -1
  119. package/dist/components/p-94168b92.js +0 -1
  120. package/dist/components/p-ae6a3c46.entry.js +0 -1
  121. package/dist/components/p-bd11e7d1.js +0 -1
  122. package/dist/components/p-e576818b.entry.js +0 -1
  123. package/dist/components/p-ebabee40.entry.js +0 -1
  124. package/dist/components/p-ee8b96b2.js +0 -1
  125. package/dist/components/p-f49a7ffd.js +0 -1
  126. package/dist/components/p-f900d0f4.entry.js +0 -1
  127. package/dist/esm/icon-button-25edf617.js +0 -41
  128. package/dist/esm/search-bar-59cc151d.js +0 -288
@@ -1 +0,0 @@
1
- import{r,h as o,H as e}from"./p-6834631c.js";import{c as i}from"./p-fe062eb0.js";import{g as a}from"./p-94168b92.js";const t=class{constructor(o){r(this,o),this.iconName=void 0,this.disabled=void 0,this.variant="default",this.iconColor="default",this.iconSize="md"}render(){return o(e,{onClick:r=>this.handleClick(r)},o("button",{ref:r=>this.buttonEl=r,disabled:this.disabled,class:i("container",{disabled:this.disabled,floating:"floating"===this.variant,plain:"plain"===this.variant,primary:"primary"===this.iconColor,secondary:"secondary"===this.iconColor})},o("slot",{name:"left"}),o("div",{class:i("icon-button",{xs:"xs"===this.iconSize,sm:"sm"===this.iconSize,md:"md"===this.iconSize,lg:"lg"===this.iconSize})},a(this.iconName)),o("slot",null)))}handleClick(r){var o;this.disabled&&(r.preventDefault(),r.stopPropagation()),null===(o=this.buttonEl)||void 0===o||o.blur()}};t.style="button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}:host{--enabled-cursor:pointer;--disabled-cursor:not-allowed;--hover-background-color:var(--vertex-ui-neutral-300);--active-background-color:var(--vertex-ui-neutral-400);--focus-background-color:var(--vertex-ui-neutral-400);--hover-box-shadow:0 2px 2px rgb(0 0 0 / 20%);--active-box-shadow:none;--focus-box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.container{display:flex;justify-content:center;align-items:center;outline:none;fill:currentColor;color:currentColor;cursor:var(--enabled-cursor)}.container:not(.plain){border-radius:4px;padding:0.25rem}.icon-button{display:flex;justify-content:center;align-items:center;fill:currentColor;height:var(--icon-size, 1.5rem);width:var(--icon-size, 1.5rem)}.icon-button svg{width:100%;height:100%}.floating{background-color:var(--vertex-ui-neutral-100);box-shadow:var(--vertex-ui-overlay-shadow);color:var(--vertex-ui-neutral-700);fill:var(--vertex-ui-neutral-700);opacity:0.95}.floating.disabled{color:var(--vertex-ui-neutral-400);cursor:var(--disabled-cursor)}.container:not(.disabled):not(.plain):hover{background-color:var(--hover-background-color);box-shadow:var(--hover-box-shadow)}.container:not(.disabled):not(.plain):active{background-color:var(--active-background-color);box-shadow:var(--active-box-shadow)}.container:not(.disabled):not(.plain):focus-visible{background-color:var(--focus-background-color);box-shadow:var(--focus-box-shadow);color:var(--vertex-ui-neutral-900)}.container.disabled:not(.floating){cursor:var(--disabled-cursor);color:var(--vertex-ui-neutral-400)}.container.primary:not(.disabled){color:var(--vertex-ui-blue-700)}.container.secondary:not(.disabled){color:var(--vertex-ui-neutral-800)}.xs{height:var(--icon-size, 0.75rem);width:var(--icon-size, 0.75rem)}.sm{height:var(--icon-size, 1rem);width:var(--icon-size, 1rem)}.md{height:var(--icon-size, 1.5rem);width:var(--icon-size, 1.5rem)}.lg{height:var(--icon-size, 2rem);width:var(--icon-size, 2rem)}";export{t as I}
@@ -1 +0,0 @@
1
- import{r as t,h as n,H as r,g as e}from"./p-6834631c.js";import{_ as i,a as o}from"./p-59032668.js";import{c as u}from"./p-fe062eb0.js";import{a as s}from"./p-b2c7b113.js";var c;c=Error,i((function t(n){var r=c.call(this,"Validation error mapping object.")||this;return r.errors=n,Object.setPrototypeOf(r,t.prototype),r}),c);var f,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={exports:{}};!function(t,n){var r="__lodash_hash_undefined__",e=9007199254740991,i="[object Arguments]",o="[object Array]",u="[object Boolean]",s="[object Date]",c="[object Error]",f="[object Function]",h="[object Map]",l="[object Number]",v="[object Object]",d="[object Promise]",p="[object RegExp]",b="[object Set]",y="[object String]",g="[object WeakMap]",j="[object ArrayBuffer]",m="[object DataView]",w=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_[o]=_[j]=_[u]=_[m]=_[s]=_[c]=_[f]=_[h]=_[l]=_[v]=_[p]=_[b]=_[y]=_[g]=!1;var B="object"==typeof a&&a&&a.Object===Object&&a,I="object"==typeof self&&self&&self.Object===Object&&self,O=B||I||Function("return this")(),E=n&&!n.nodeType&&n,A=E&&t&&!t.nodeType&&t,P=A&&A.exports===E,$=P&&B.process,k=function(){try{return $&&$.binding&&$.binding("util")}catch(t){}}(),S=k&&k.isTypedArray;function C(t,n){for(var r=-1,e=null==t?0:t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}function T(t){var n=-1,r=Array(t.size);return t.forEach((function(t,e){r[++n]=[e,t]})),r}function M(t){var n=-1,r=Array(t.size);return t.forEach((function(t){r[++n]=t})),r}var U,D,F,L=Array.prototype,V=Object.prototype,R=O["__core-js_shared__"],N=Function.prototype.toString,W=V.hasOwnProperty,z=(U=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"",G=V.toString,H=RegExp("^"+N.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),q=P?O.Buffer:void 0,J=O.Symbol,K=O.Uint8Array,Q=V.propertyIsEnumerable,X=L.splice,Y=J?J.toStringTag:void 0,Z=Object.getOwnPropertySymbols,tt=q?q.isBuffer:void 0,nt=(D=Object.keys,F=Object,function(t){return D(F(t))}),rt=Et(O,"DataView"),et=Et(O,"Map"),it=Et(O,"Promise"),ot=Et(O,"Set"),ut=Et(O,"WeakMap"),st=Et(Object,"create"),ct=kt(rt),ft=kt(et),at=kt(it),ht=kt(ot),lt=kt(ut),vt=J?J.prototype:void 0,dt=vt?vt.valueOf:void 0;function pt(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function bt(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function yt(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function gt(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new yt;++n<r;)this.add(t[n])}function jt(t){var n=this.__data__=new bt(t);this.size=n.size}function mt(t,n){for(var r=t.length;r--;)if(St(t[r][0],n))return r;return-1}function wt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Y&&Y in Object(t)?function(t){var n=W.call(t,Y),r=t[Y];try{t[Y]=void 0;var e=!0}catch(t){}var i=G.call(t);return e&&(n?t[Y]=r:delete t[Y]),i}(t):function(t){return G.call(t)}(t)}function xt(t){return Lt(t)&&wt(t)==i}function _t(t,n,r,e,f){return t===n||(null==t||null==n||!Lt(t)&&!Lt(n)?t!=t&&n!=n:function(t,n,r,e,f,a){var d=Tt(t),g=Tt(n),w=d?o:Pt(t),x=g?o:Pt(n),_=(w=w==i?v:w)==v,B=(x=x==i?v:x)==v,I=w==x;if(I&&Mt(t)){if(!Mt(n))return!1;d=!0,_=!1}if(I&&!_)return a||(a=new jt),d||Vt(t)?Bt(t,n,r,e,f,a):function(t,n,r,e,i,o,f){switch(r){case m:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case j:return!(t.byteLength!=n.byteLength||!o(new K(t),new K(n)));case u:case s:case l:return St(+t,+n);case c:return t.name==n.name&&t.message==n.message;case p:case y:return t==n+"";case h:var a=T;case b:if(a||(a=M),t.size!=n.size&&!(1&e))return!1;var v=f.get(t);if(v)return v==n;e|=2,f.set(t,n);var d=Bt(a(t),a(n),e,i,o,f);return f.delete(t),d;case"[object Symbol]":if(dt)return dt.call(t)==dt.call(n)}return!1}(t,n,w,r,e,f,a);if(!(1&r)){var O=_&&W.call(t,"__wrapped__"),E=B&&W.call(n,"__wrapped__");if(O||E){var A=O?t.value():t,P=E?n.value():n;return a||(a=new jt),f(A,P,r,e,a)}}return!!I&&(a||(a=new jt),function(t,n,r,e,i,o){var u=1&r,s=It(t),c=s.length;if(c!=It(n).length&&!u)return!1;for(var f=c;f--;){var a=s[f];if(!(u?a in n:W.call(n,a)))return!1}var h=o.get(t);if(h&&o.get(n))return h==n;var l=!0;o.set(t,n),o.set(n,t);for(var v=u;++f<c;){var d=t[a=s[f]],p=n[a];if(e)var b=u?e(p,d,a,n,t,o):e(d,p,a,t,n,o);if(!(void 0===b?d===p||i(d,p,r,e,o):b)){l=!1;break}v||(v="constructor"==a)}if(l&&!v){var y=t.constructor,g=n.constructor;y==g||!("constructor"in t)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(l=!1)}return o.delete(t),o.delete(n),l}(t,n,r,e,f,a))}(t,n,r,e,_t,f))}function Bt(t,n,r,e,i,o){var u=1&r,s=t.length,c=n.length;if(s!=c&&!(u&&c>s))return!1;var f=o.get(t);if(f&&o.get(n))return f==n;var a=-1,h=!0,l=2&r?new gt:void 0;for(o.set(t,n),o.set(n,t);++a<s;){var v=t[a],d=n[a];if(e)var p=u?e(d,v,a,n,t,o):e(v,d,a,t,n,o);if(void 0!==p){if(p)continue;h=!1;break}if(l){if(!C(n,(function(t,n){if(!l.has(n)&&(v===t||i(v,t,r,e,o)))return l.push(n)}))){h=!1;break}}else if(v!==d&&!i(v,d,r,e,o)){h=!1;break}}return o.delete(t),o.delete(n),h}function It(t){return function(t,n,r){var e=n(t);return Tt(t)?e:function(t,n){for(var r=-1,e=n.length,i=t.length;++r<e;)t[i+r]=n[r];return t}(e,r(t))}(t,Rt,At)}function Ot(t,n){var r,e,i=t.__data__;return("string"==(e=typeof(r=n))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?i["string"==typeof n?"string":"hash"]:i.map}function Et(t,n){var r=function(t,n){return null==t?void 0:t[n]}(t,n);return function(t){return!(!Ft(t)||function(t){return!!z&&z in t}(t))&&(Ut(t)?H:w).test(kt(t))}(r)?r:void 0}pt.prototype.clear=function(){this.__data__=st?st(null):{},this.size=0},pt.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},pt.prototype.get=function(t){var n=this.__data__;if(st){var e=n[t];return e===r?void 0:e}return W.call(n,t)?n[t]:void 0},pt.prototype.has=function(t){var n=this.__data__;return st?void 0!==n[t]:W.call(n,t)},pt.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=st&&void 0===n?r:n,this},bt.prototype.clear=function(){this.__data__=[],this.size=0},bt.prototype.delete=function(t){var n=this.__data__,r=mt(n,t);return!(r<0||(r==n.length-1?n.pop():X.call(n,r,1),--this.size,0))},bt.prototype.get=function(t){var n=this.__data__,r=mt(n,t);return r<0?void 0:n[r][1]},bt.prototype.has=function(t){return mt(this.__data__,t)>-1},bt.prototype.set=function(t,n){var r=this.__data__,e=mt(r,t);return e<0?(++this.size,r.push([t,n])):r[e][1]=n,this},yt.prototype.clear=function(){this.size=0,this.__data__={hash:new pt,map:new(et||bt),string:new pt}},yt.prototype.delete=function(t){var n=Ot(this,t).delete(t);return this.size-=n?1:0,n},yt.prototype.get=function(t){return Ot(this,t).get(t)},yt.prototype.has=function(t){return Ot(this,t).has(t)},yt.prototype.set=function(t,n){var r=Ot(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this},gt.prototype.add=gt.prototype.push=function(t){return this.__data__.set(t,r),this},gt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.clear=function(){this.__data__=new bt,this.size=0},jt.prototype.delete=function(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,n){var r=this.__data__;if(r instanceof bt){var e=r.__data__;if(!et||e.length<199)return e.push([t,n]),this.size=++r.size,this;r=this.__data__=new yt(e)}return r.set(t,n),this.size=r.size,this};var At=Z?function(t){return null==t?[]:(t=Object(t),function(n){for(var r=-1,e=null==n?0:n.length,i=0,o=[];++r<e;){var u=n[r];Q.call(t,u)&&(o[i++]=u)}return o}(Z(t)))}:function(){return[]},Pt=wt;function $t(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||x.test(t))&&t>-1&&t%1==0&&t<n}function kt(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function St(t,n){return t===n||t!=t&&n!=n}(rt&&Pt(new rt(new ArrayBuffer(1)))!=m||et&&Pt(new et)!=h||it&&Pt(it.resolve())!=d||ot&&Pt(new ot)!=b||ut&&Pt(new ut)!=g)&&(Pt=function(t){var n=wt(t),r=n==v?t.constructor:void 0,e=r?kt(r):"";if(e)switch(e){case ct:return m;case ft:return h;case at:return d;case ht:return b;case lt:return g}return n});var Ct=xt(function(){return arguments}())?xt:function(t){return Lt(t)&&W.call(t,"callee")&&!Q.call(t,"callee")},Tt=Array.isArray,Mt=tt||function(){return!1};function Ut(t){if(!Ft(t))return!1;var n=wt(t);return n==f||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Dt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}function Ft(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function Lt(t){return null!=t&&"object"==typeof t}var Vt=S?function(t){return function(n){return t(n)}}(S):function(t){return Lt(t)&&Dt(t.length)&&!!_[wt(t)]};function Rt(t){return null!=(n=t)&&Dt(n.length)&&!Ut(n)?function(t,n){var r=Tt(t),e=!r&&Ct(t),i=!r&&!e&&Mt(t),o=!r&&!e&&!i&&Vt(t),u=r||e||i||o,s=u?function(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}(t.length,String):[],c=s.length;for(var f in t)!n&&!W.call(t,f)||u&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||$t(f,c))||s.push(f);return s}(t):function(t){if((n=t)!==("function"==typeof(r=n&&n.constructor)&&r.prototype||V))return nt(t);var n,r,e=[];for(var i in Object(t))W.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t);var n}t.exports=function(t,n){return _t(t,n)}}(h,h.exports);var l=new Uint8Array(16);function v(){if(!f&&!(f="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return f(l)}var d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function p(t){return"string"==typeof t&&d.test(t)}for(var b=[],y=0;y<256;++y)b.push((y+256).toString(16).substr(1));function g(t,n,r){var e=(t=t||{}).random||(t.rng||v)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,n){r=r||0;for(var i=0;i<16;++i)n[r+i]=e[i];return n}return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(b[t[n+0]]+b[t[n+1]]+b[t[n+2]]+b[t[n+3]]+"-"+b[t[n+4]]+b[t[n+5]]+"-"+b[t[n+6]]+b[t[n+7]]+"-"+b[t[n+8]]+b[t[n+9]]+"-"+b[t[n+10]]+b[t[n+11]]+b[t[n+12]]+b[t[n+13]]+b[t[n+14]]+b[t[n+15]]).toLowerCase();if(!p(r))throw TypeError("Stringified UUID is invalid");return r}(e)}var j=Object.freeze({__proto__:null,create:function(){return g()},fromMsbLsb:function(t,n){function r(t,n){var r=BigInt(1)<<n*BigInt(4);return(r|t&r-BigInt(1)).toString(16).substring(1)}var e="string"==typeof t?BigInt(t):t,i="string"==typeof n?BigInt(n):n,o=r(e>>BigInt(32),BigInt(8)),u=r(e>>BigInt(16),BigInt(4)),s=r(e,BigInt(4)),c=r(i>>BigInt(48),BigInt(4)),f=r(i,BigInt(12));return"".concat(o,"-").concat(u,"-").concat(s,"-").concat(c,"-").concat(f)},toMsbLsb:function(t){var n=o(t.split("-"),5),r=n[0],e=n[1],i=n[2],u=n[3],s=n[4];if(null==r||null==e||null==i||null==u||null==s)throw new Error("Invalid UUID string ".concat(t));var c=BigInt.asIntN(64,BigInt("0x".concat(r+e+i))),f=BigInt.asIntN(64,BigInt("0x".concat(u+s)));return{msb:c.toString(),lsb:f.toString()}}});const m=class{constructor(n){t(this,n),this.content=void 0,this.disabled=void 0,this.placement="bottom",this.delay=500,this.animated=!0,this.open=!1,this.handlePointerEnter=this.handlePointerEnter.bind(this),this.handlePointerLeave=this.handlePointerLeave.bind(this),this.tooltipId=`vertex-tooltip-${j.create()}`}disconnectedCallback(){this.removeElement(),this.clearOpenTimeout()}render(){return n(r,null,n("div",{class:"target",ref:t=>{this.targetElement=t},onPointerEnter:this.handlePointerEnter,onPointerLeave:this.handlePointerLeave},n("slot",null)),n("div",{class:"content-hidden",ref:t=>{this.contentElement=t}},n("slot",{name:"content"})))}addElement(){var t;if(null!=this.targetElement){const n=this.createPopoverElement(this.targetElement),r=this.createContentElement();this.displayedSlottedContent=null!==(t=s(this.contentElement))&&void 0!==t?t:this.displayedSlottedContent,null!=this.content?r.innerText=this.content:null!=this.displayedSlottedContent&&r.appendChild(this.displayedSlottedContent),n.appendChild(r),this.hostElement.ownerDocument.body.appendChild(n)}}removeElement(){const t=this.hostElement.ownerDocument.getElementById(this.tooltipId);null!=t&&t.remove()}createPopoverElement(t){const n=this.hostElement.ownerDocument.createElement("vertex-popover");return n.id=this.tooltipId,n.setAttribute("class","vertex-tooltip-popover"),n.open=this.open,n.resizeBehavior="fixed",n.backdrop=!1,n.placement=this.placement,n.animated=this.animated,n.anchorBounds=t.getBoundingClientRect(),n}createContentElement(){const t=this.hostElement.ownerDocument.createElement("div");return t.setAttribute("class",u("vertex-tooltip-content",{hidden:!this.open||this.disabled})),t}handlePointerEnter(){null!=this.openTimeout||this.disabled||(this.openTimeout=setTimeout((()=>{this.open=!0,this.openTimeout=void 0,this.addElement()}),this.delay))}handlePointerLeave(){this.clearOpenTimeout(),this.removeElement(),this.open=!1}clearOpenTimeout(){null!=this.openTimeout&&(clearTimeout(this.openTimeout),this.openTimeout=void 0)}get hostElement(){return e(this)}};m.style=":host{--tooltip-width:auto;--tooltip-white-space:normal;display:flex}.popover{width:100%;height:100%}.target{display:flex;width:100%;height:100%}.content-hidden{display:none}.tooltip{display:flex;justify-content:center;text-align:center;width:var(--tooltip-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-xxs);background-color:var(--vertex-ui-neutral-700);color:var(--vertex-ui-white);padding:0.25rem 0.5rem;border-radius:4px;pointer-events:none;white-space:var(--tooltip-white-space);user-select:none}.tooltip.hidden{display:none}";export{m as T}
@@ -1 +0,0 @@
1
- export{I as vertex_icon_button}from"./p-ee8b96b2.js";import"./p-6834631c.js";import"./p-fe062eb0.js";import"./p-94168b92.js";
@@ -1,41 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-72f28b71.js';
2
- import { c as classnames } from './index-9c609209.js';
3
- import { g as getSvg } from './icon-helper-10a99d95.js';
4
-
5
- const iconButtonCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}:host{--enabled-cursor:pointer;--disabled-cursor:not-allowed;--hover-background-color:var(--vertex-ui-neutral-300);--active-background-color:var(--vertex-ui-neutral-400);--focus-background-color:var(--vertex-ui-neutral-400);--hover-box-shadow:0 2px 2px rgb(0 0 0 / 20%);--active-box-shadow:none;--focus-box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.container{display:flex;justify-content:center;align-items:center;outline:none;fill:currentColor;color:currentColor;cursor:var(--enabled-cursor)}.container:not(.plain){border-radius:4px;padding:0.25rem}.icon-button{display:flex;justify-content:center;align-items:center;fill:currentColor;height:var(--icon-size, 1.5rem);width:var(--icon-size, 1.5rem)}.icon-button svg{width:100%;height:100%}.floating{background-color:var(--vertex-ui-neutral-100);box-shadow:var(--vertex-ui-overlay-shadow);color:var(--vertex-ui-neutral-700);fill:var(--vertex-ui-neutral-700);opacity:0.95}.floating.disabled{color:var(--vertex-ui-neutral-400);cursor:var(--disabled-cursor)}.container:not(.disabled):not(.plain):hover{background-color:var(--hover-background-color);box-shadow:var(--hover-box-shadow)}.container:not(.disabled):not(.plain):active{background-color:var(--active-background-color);box-shadow:var(--active-box-shadow)}.container:not(.disabled):not(.plain):focus-visible{background-color:var(--focus-background-color);box-shadow:var(--focus-box-shadow);color:var(--vertex-ui-neutral-900)}.container.disabled:not(.floating){cursor:var(--disabled-cursor);color:var(--vertex-ui-neutral-400)}.container.primary:not(.disabled){color:var(--vertex-ui-blue-700)}.container.secondary:not(.disabled){color:var(--vertex-ui-neutral-800)}.xs{height:var(--icon-size, 0.75rem);width:var(--icon-size, 0.75rem)}.sm{height:var(--icon-size, 1rem);width:var(--icon-size, 1rem)}.md{height:var(--icon-size, 1.5rem);width:var(--icon-size, 1.5rem)}.lg{height:var(--icon-size, 2rem);width:var(--icon-size, 2rem)}";
6
-
7
- const IconButton = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.iconName = undefined;
11
- this.disabled = undefined;
12
- this.variant = 'default';
13
- this.iconColor = 'default';
14
- this.iconSize = 'md';
15
- }
16
- render() {
17
- return (h(Host, { onClick: (e) => this.handleClick(e) }, h("button", { ref: (el) => (this.buttonEl = el), disabled: this.disabled, class: classnames('container', {
18
- disabled: this.disabled,
19
- floating: this.variant === 'floating',
20
- plain: this.variant === 'plain',
21
- primary: this.iconColor === 'primary',
22
- secondary: this.iconColor === 'secondary',
23
- }) }, h("slot", { name: "left" }), h("div", { class: classnames('icon-button', {
24
- xs: this.iconSize === 'xs',
25
- sm: this.iconSize === 'sm',
26
- md: this.iconSize === 'md',
27
- lg: this.iconSize === 'lg',
28
- }) }, getSvg(this.iconName)), h("slot", null))));
29
- }
30
- handleClick(event) {
31
- var _a;
32
- if (this.disabled) {
33
- event.preventDefault();
34
- event.stopPropagation();
35
- }
36
- (_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.blur();
37
- }
38
- };
39
- IconButton.style = iconButtonCss;
40
-
41
- export { IconButton as I };
@@ -1,288 +0,0 @@
1
- import { r as registerInstance, e as createEvent, h, H as Host, g as getElement } from './index-72f28b71.js';
2
- import { c as classnames } from './index-9c609209.js';
3
- import { g as generateInstanceFromTemplate } from './templates-797420bf.js';
4
-
5
- const getWindowSelection = () => {
6
- if (typeof window !== 'undefined') {
7
- return window.getSelection();
8
- }
9
- return undefined;
10
- };
11
- const createDocumentRange = () => {
12
- return document.createRange();
13
- };
14
- const isTextNode = (node) => {
15
- return node instanceof Text;
16
- };
17
- const isHtmlElement = (target) => {
18
- return target instanceof HTMLElement;
19
- };
20
- const isReplacedElement = (el) => {
21
- return (el === null || el === void 0 ? void 0 : el.getAttribute('data-replaced')) === 'true';
22
- };
23
- const createTextNode = (text) => {
24
- return new Text(text != null && text !== '' ? text : ' ');
25
- };
26
-
27
- const searchBarCss = ".wrapper.sc-vertex-search-bar{display:flex;align-items:center;width:100%;box-sizing:border-box;background:none;border:1px solid transparent;border-radius:4px;font-family:var(--vertex-ui-font-family);font-size:0.875rem;line-height:1.4}.test-mention.sc-vertex-search-bar{display:inline-block;color:blue}.hidden.sc-vertex-search-bar{visibility:hidden}.content-input.sc-vertex-search-bar{width:100%;box-sizing:border-box;padding:6px 0.5em 7px;border:1px solid transparent;background:none;font-family:var(--vertex-ui-font-family);font-weight:var(--vertex-ui-font-weight-base);font-size:0.875rem;line-height:1.4;white-space:pre-line}.textarea.sc-vertex-search-bar{overflow:hidden;outline:none;box-shadow:none;resize:none}.content-input.sc-vertex-search-bar:focus{outline:none}.standard.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);color:var(--vertex-ui-neutral-800)}.standard.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.standard.sc-vertex-search-bar:hover:not(.disabled),.standard.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-500)}.standard.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.standard.disabled.sc-vertex-search-bar,.standard.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.blank.sc-vertex-search-bar{color:var(--vertex-ui-neutral-800)}.blank.sc-vertex-search-bar:not(:hover) .content-input.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.blank.sc-vertex-search-bar:hover:not(.disabled) .content-input.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.blank.disabled.sc-vertex-search-bar,.blank.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-800)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.filled.sc-vertex-search-bar:hover:not(.disabled),.filled.sc-vertex-search-bar:focus{border-bottom-color:var(--vertex-ui-blue-600)}.filled.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-100)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar{background-color:var(--vertex-ui-white);border-color:var(--vertex-ui-white) var(--vertex-ui-white) var(--vertex-ui-neutral-400) var(--vertex-ui-white);color:var(--vertex-ui-neutral-800)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.underlined.sc-vertex-search-bar:hover:not(.disabled),.underlined.sc-vertex-search-bar:focus{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);border-bottom-color:var(--vertex-ui-blue-600)}.underlined.disabled.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-neutral-200)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.has-error.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-red-600)}";
28
-
29
- const SearchBar = class {
30
- constructor(hostRef) {
31
- registerInstance(this, hostRef);
32
- this.triggerCharacterPressed = createEvent(this, "triggerCharacterPressed", 7);
33
- this.valueChanged = createEvent(this, "valueChanged", 7);
34
- this.inputFocus = createEvent(this, "inputFocus", 7);
35
- this.inputBlur = createEvent(this, "inputBlur", 7);
36
- this.resultsEnterPressed = createEvent(this, "resultsEnterPressed", 7);
37
- this.handleKeyDown = (event) => {
38
- if ((this.triggerCharacters.includes(event.key) ||
39
- this.triggerCharacter === event.key) &&
40
- this.triggerKey == null) {
41
- this.triggerKey = event.key;
42
- this.updateCursorPosition();
43
- this.triggerCharacterPressed.emit('');
44
- }
45
- else {
46
- this.restartTriggerInput();
47
- }
48
- if (event.key === 'Backspace') {
49
- const selection = getWindowSelection();
50
- if (selection && (selection === null || selection === void 0 ? void 0 : selection.rangeCount) > 0) {
51
- const range = selection.getRangeAt(0);
52
- range.deleteContents();
53
- }
54
- }
55
- this.valueChanged.emit();
56
- };
57
- this.handleKeyUp = (event) => {
58
- if (event.key === 'Backspace') {
59
- this.updateTriggerState(this.getSelectionSubstring());
60
- }
61
- if (event.key === 'Enter') {
62
- this.clearTriggerState();
63
- }
64
- this.valueChanged.emit();
65
- };
66
- this.updateTriggerValue = (data) => {
67
- var _a, _b, _c, _d, _e;
68
- if (this.triggerKey != null &&
69
- this.triggerRange != null &&
70
- this.triggerRange.startContainer === this.triggerRange.endContainer) {
71
- const triggerRangeNode = this.triggerRange.startContainer;
72
- if (isTextNode(triggerRangeNode)) {
73
- const before = createTextNode((_a = triggerRangeNode.textContent) === null || _a === void 0 ? void 0 : _a.slice(0, this.triggerRange.startOffset - 1));
74
- const after = createTextNode((_b = triggerRangeNode.textContent) === null || _b === void 0 ? void 0 : _b.slice(this.triggerRange.endOffset));
75
- const replaced = this.createReplacedElement(data);
76
- (_c = triggerRangeNode.parentElement) === null || _c === void 0 ? void 0 : _c.insertBefore(before, triggerRangeNode);
77
- (_d = triggerRangeNode.parentElement) === null || _d === void 0 ? void 0 : _d.insertBefore(after, triggerRangeNode.nextSibling);
78
- (_e = triggerRangeNode.parentElement) === null || _e === void 0 ? void 0 : _e.insertBefore(replaced, after);
79
- triggerRangeNode.remove();
80
- this.moveCursorToNodeEnd(after, true);
81
- }
82
- }
83
- };
84
- this.triggerText = () => {
85
- var _a, _b;
86
- if (this.triggerKey != null &&
87
- this.triggerRange != null &&
88
- this.triggerRange.startContainer === this.triggerRange.endContainer) {
89
- const triggerRangeNode = this.triggerRange.startContainer;
90
- return ((_b = (_a = triggerRangeNode.textContent) === null || _a === void 0 ? void 0 : _a.slice(this.triggerRange.startOffset, this.triggerRange.endOffset)) !== null && _b !== void 0 ? _b : '');
91
- }
92
- return '';
93
- };
94
- this.restartTriggerInput = () => {
95
- this.clearTriggerTimeout();
96
- this.triggerTimeout = setTimeout(() => {
97
- if (this.triggerRange != null && this.triggerKey != null) {
98
- this.triggerCharacterPressed.emit(this.triggerText());
99
- }
100
- this.triggerTimeout = undefined;
101
- }, this.debounce);
102
- };
103
- this.clearTriggerTimeout = () => {
104
- if (this.triggerTimeout != null) {
105
- clearTimeout(this.triggerTimeout);
106
- this.triggerTimeout = undefined;
107
- }
108
- };
109
- this.updateCursorPosition = () => {
110
- var _a;
111
- const selection = getWindowSelection();
112
- if (selection != null && selection.rangeCount > 0) {
113
- const cursorBounds = selection.getRangeAt(0).getBoundingClientRect();
114
- const inputBounds = (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
115
- const cursorBottom = cursorBounds.bottom || (inputBounds === null || inputBounds === void 0 ? void 0 : inputBounds.bottom) || 0;
116
- const cursorTop = cursorBounds.top || (inputBounds === null || inputBounds === void 0 ? void 0 : inputBounds.top) || 0;
117
- this.cursorPosition = {
118
- x: cursorBounds.left || (inputBounds === null || inputBounds === void 0 ? void 0 : inputBounds.left) || 0,
119
- y: this.placement.includes('top') ? cursorTop : cursorBottom,
120
- };
121
- }
122
- };
123
- this.moveCursorToNodeEnd = (node, collapseToStart = false) => {
124
- const selection = getWindowSelection();
125
- if (selection != null) {
126
- const range = createDocumentRange();
127
- range.selectNodeContents(node);
128
- range.collapse(collapseToStart);
129
- selection.removeAllRanges();
130
- selection.addRange(range);
131
- }
132
- };
133
- this.updateInputCursorPosition = (target) => {
134
- if (isHtmlElement(target)) {
135
- const targetElement = isReplacedElement(target.parentElement)
136
- ? target.parentElement
137
- : target;
138
- if (isReplacedElement(targetElement)) {
139
- this.insertAdjacentTextNode(targetElement);
140
- }
141
- }
142
- };
143
- this.createReplacedElement = (data) => {
144
- const template = this.hostEl.querySelector('template[slot="replaced"]');
145
- if (template != null) {
146
- const instance = generateInstanceFromTemplate(template);
147
- instance.bindings.bind(data);
148
- instance.element.style.display = 'inline-block';
149
- instance.element.contentEditable = 'false';
150
- instance.element.setAttribute('data-replaced', 'true');
151
- return instance.element;
152
- }
153
- else {
154
- throw new Error('Replaced template not defined.');
155
- }
156
- };
157
- this.handleSelectionChange = () => {
158
- this.updateTriggerState(this.getSelectionSubstring());
159
- };
160
- this.getSelectionSubstring = () => {
161
- var _a;
162
- const selection = getWindowSelection();
163
- if (selection != null && selection.rangeCount > 0) {
164
- const range = selection.getRangeAt(0);
165
- this.updateTriggerRange();
166
- if (range != null &&
167
- range.startOffset === range.endOffset &&
168
- isTextNode(range.startContainer) &&
169
- range.startContainer.textContent != null &&
170
- !isReplacedElement(range.startContainer.parentElement) &&
171
- ((_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.contains(range.startContainer))) {
172
- return range.startContainer.textContent.slice(this.lastIndexOfBreakCharacter(range.startContainer.textContent.slice(0, range.startOffset)) + 1, range.startOffset);
173
- }
174
- }
175
- return '';
176
- };
177
- this.insertAdjacentTextNode = (el) => {
178
- el.insertAdjacentText('afterend', '');
179
- if (el.nextSibling != null) {
180
- this.moveCursorToNodeEnd(el.nextSibling);
181
- }
182
- };
183
- this.updateTriggerState = (text) => {
184
- const triggers = this.triggerCharacter != null
185
- ? [...this.triggerCharacters, this.triggerCharacter]
186
- : this.triggerCharacters;
187
- const trigger = triggers.find((tc) => text.includes(tc));
188
- if (trigger != null) {
189
- this.restartTriggerInput();
190
- this.triggerKey = trigger;
191
- this.updateTriggerRange();
192
- if (this.cursorPosition == null) {
193
- this.updateCursorPosition();
194
- }
195
- this.open = true;
196
- }
197
- else {
198
- this.clearTriggerState();
199
- }
200
- };
201
- this.updateTriggerRange = () => {
202
- var _a;
203
- const selection = getWindowSelection();
204
- if (selection != null && selection.rangeCount > 0) {
205
- const range = selection.getRangeAt(0);
206
- if (this.triggerKey != null) {
207
- this.triggerRange = (_a = this.triggerRange) !== null && _a !== void 0 ? _a : range.cloneRange();
208
- this.triggerRange.setEnd(range.endContainer, range.endOffset);
209
- }
210
- }
211
- };
212
- this.clearTriggerState = () => {
213
- this.triggerKey = undefined;
214
- this.triggerRange = undefined;
215
- this.cursorPosition = undefined;
216
- this.open = false;
217
- this.clearTriggerTimeout();
218
- };
219
- this.lastIndexOfBreakCharacter = (search) => {
220
- const index = this.breakCharacters.reduce((index, bc) => {
221
- const searchIndex = search
222
- .replace(String.fromCharCode(160), ' ')
223
- .lastIndexOf(bc);
224
- return searchIndex > index ? searchIndex : index;
225
- }, -1);
226
- return index;
227
- };
228
- this.handleFocus = (ev) => {
229
- this.inputFocus.emit(ev);
230
- };
231
- this.handleBlur = (ev) => {
232
- this.open = false;
233
- this.inputBlur.emit(ev);
234
- };
235
- this.handleInputPointerEvent = (ev) => {
236
- if (ev.target != null) {
237
- this.updateInputCursorPosition(ev.target);
238
- }
239
- };
240
- this.handleResultPointerDown = (ev) => {
241
- ev.preventDefault();
242
- };
243
- this.variant = 'standard';
244
- this.resultItems = undefined;
245
- this.triggerCharacters = [];
246
- this.triggerCharacter = undefined;
247
- this.breakCharacters = [' '];
248
- this.debounce = 100;
249
- this.placeholder = undefined;
250
- this.placement = 'bottom-start';
251
- this.cursorPosition = undefined;
252
- this.open = false;
253
- this.triggerKey = undefined;
254
- this.triggerRange = undefined;
255
- }
256
- componentWillLoad() {
257
- document.addEventListener('selectionchange', this.handleSelectionChange);
258
- }
259
- disconnectedCallback() {
260
- document.removeEventListener('selectionchange', this.handleSelectionChange);
261
- }
262
- async replaceTriggeredValue(data) {
263
- this.updateTriggerValue(data);
264
- this.clearTriggerState();
265
- this.valueChanged.emit();
266
- }
267
- async getEditableContent() {
268
- var _a;
269
- return (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.childNodes;
270
- }
271
- render() {
272
- var _a;
273
- const classes = classnames('wrapper', {
274
- standard: this.variant === 'standard',
275
- filled: this.variant === 'filled',
276
- underlined: this.variant === 'underlined',
277
- blank: this.variant === 'blank',
278
- });
279
- return (h(Host, null, h("div", { class: classes }, h("span", { class: "content-input", ref: (ref) => (this.contentEl = ref), role: "textbox", contenteditable: "true", "aria-multiline": "true", "data-placeholder": this.placeholder, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onBlur: this.handleBlur, onFocus: this.handleFocus, onPointerDown: this.handleInputPointerEvent, onPointerUp: this.handleInputPointerEvent })), h("vertex-result-list", { position: this.cursorPosition, placement: this.placement, open: this.open &&
280
- this.resultItems != null &&
281
- this.resultItems.length > 0 &&
282
- this.cursorPosition != null, items: (_a = this.resultItems) !== null && _a !== void 0 ? _a : [], onPointerDown: this.handleResultPointerDown, onEnterPressed: (event) => this.resultsEnterPressed.emit(event.detail) }, h("slot", { name: "results" })), h("slot", { name: "replaced" })));
283
- }
284
- get hostEl() { return getElement(this); }
285
- };
286
- SearchBar.style = searchBarCss;
287
-
288
- export { SearchBar as S };