@geoblink/design-system
Version:
Geoblink Design System for Vue.js
1 lines • 3.57 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["components/GeoHighlightedString"]=t():e["components/GeoHighlightedString"]=t()}(window,function(){return n={},e.m=t={"4hSD":function(e,t,n){"use strict";n.r(t);var r={name:"GeoHighlightedString",status:"ready",release:"4.0.0",props:{highlightedChars:{type:Array,default:function(){return[]},validator:function(e){if(e.length<2)return!0;for(var t=1;t<e.length;t++){if(e[t-1]>e[t])return console.warn("GeoHighlightedString [component] :: Values of highlightedChars must be sorted ascendently but value at index ".concat(t-1," (").concat(e[t-1],") was greater than value at index ").concat(t," (").concat(e[t],")")),!1;if(e[t-1]===e[t])return console.warn("GeoHighlightedString [component] :: Values of highlightedChars can't be repeated but value at index ".concat(t-1," (").concat(e[t-1],") was equal to value at index ").concat(t," (").concat(e[t],")")),!1}return!0}},referenceString:{type:String,required:!0}},computed:{groups:function(){if(!this.referenceString)return[];for(var e,t,n=[],r=[].concat(this.highlightedChars),i=0;i<this.referenceString.length;){if(r[0]===i){for(r.shift(),e=i+1;r[0]===e;)r.shift(),e++;t=!0}else e=r[0]||this.referenceString.length,t=!1;n.push({isHighlighted:t,substring:this.referenceString.substring(i,e)}),i=e}return n}}},i=n("KHd+"),o=Object(i.a)(r,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"highlighted-string__container"},[e._l(e.groups,function(t,r){return[t.isHighlighted?n("div",{key:r,staticClass:"highlighted-string--highlighted"},[e._v(e._s(t.substring))]):n("div",{key:r,staticClass:"highlighted-string--normal"},[e._v(e._s(t.substring))])]})],2)},[],!1,null,null,null);t.default=o.exports},62:function(e,t,n){e.exports=n("4hSD")},"KHd+":function(e,t,n){"use strict";function r(e,t,n,r,i,o,s,a){var u,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),s?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=u):i&&(u=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(e,t){return u.call(t),l(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:e,options:c}}n.d(t,"a",function(){return r})}},e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(e){return t[e]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="/",e(e.s=62);function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t,n});