radh-ui
Version:
Stencil Component Starter
1 lines • 11.5 kB
JavaScript
import{r as n,h as t}from"./p-1a9f3501.js";var r="http://www.w3.org/1999/xhtml";const i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function u(n){var t=n+="",r=t.indexOf(":");return r>=0&&"xmlns"!==(t=n.slice(0,r))&&(n=n.slice(r+1)),i.hasOwnProperty(t)?{space:i[t],local:n}:n}function o(n){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===r&&t.documentElement.namespaceURI===r?t.createElement(n):t.createElementNS(i,n)}}function e(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function f(n){var t=u(n);return(t.local?e:o)(t)}function s(){}function c(n){return null==n?s:function(){return this.querySelector(n)}}function h(){return[]}function a(n){return new Array(n.length)}function l(n,t){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=t}function v(n,t,r,i,u,o){for(var e,f=0,s=t.length,c=o.length;f<c;++f)(e=t[f])?(e.__data__=o[f],i[f]=e):r[f]=new l(n,o[f]);for(;f<s;++f)(e=t[f])&&(u[f]=e)}function w(n,t,r,i,u,o,e){var f,s,c,h={},a=t.length,v=o.length,w=new Array(a);for(f=0;f<a;++f)(s=t[f])&&(w[f]=c="$"+e.call(s,s.__data__,f,t),c in h?u[f]=s:h[c]=s);for(f=0;f<v;++f)(s=h[c="$"+e.call(n,o[f],f,o)])?(i[f]=s,s.__data__=o[f],h[c]=null):r[f]=new l(n,o[f]);for(f=0;f<a;++f)(s=t[f])&&h[w[f]]===s&&(u[f]=s)}function p(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function y(n){return function(){this.removeAttribute(n)}}function d(n){return function(){this.removeAttributeNS(n.space,n.local)}}function m(n,t){return function(){this.setAttribute(n,t)}}function A(n,t){return function(){this.setAttributeNS(n.space,n.local,t)}}function x(n,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttribute(n):this.setAttribute(n,r)}}function g(n,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,r)}}function _(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function q(n){return function(){this.style.removeProperty(n)}}function L(n,t,r){return function(){this.style.setProperty(n,t,r)}}function j(n,t,r){return function(){var i=t.apply(this,arguments);null==i?this.style.removeProperty(n):this.style.setProperty(n,i,r)}}function k(n,t){return n.style.getPropertyValue(t)||_(n).getComputedStyle(n,null).getPropertyValue(t)}function z(n){return function(){delete this[n]}}function D(n,t){return function(){this[n]=t}}function M(n,t){return function(){var r=t.apply(this,arguments);null==r?delete this[n]:this[n]=r}}function N(n){return n.trim().split(/^|\s+/)}function S(n){return n.classList||new $(n)}function $(n){this._node=n,this._names=N(n.getAttribute("class")||"")}function B(n,t){for(var r=S(n),i=-1,u=t.length;++i<u;)r.add(t[i])}function C(n,t){for(var r=S(n),i=-1,u=t.length;++i<u;)r.remove(t[i])}function E(n){return function(){B(this,n)}}function X(n){return function(){C(this,n)}}function b(n,t){return function(){(t.apply(this,arguments)?B:C)(this,n)}}function F(){this.textContent=""}function G(n){return function(){this.textContent=n}}function H(n){return function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}}function I(){this.innerHTML=""}function J(n){return function(){this.innerHTML=n}}function K(n){return function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}}function O(){this.nextSibling&&this.parentNode.appendChild(this)}function P(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Q(){return null}function R(){var n=this.parentNode;n&&n.removeChild(this)}function T(){var n=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function U(){var n=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}l.prototype={constructor:l,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,t){return this._parent.insertBefore(n,t)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},$.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var V={};function W(n,t,r){return n=Y(n,t,r),function(t){var r=t.relatedTarget;r&&(r===this||8&r.compareDocumentPosition(this))||n.call(this,t)}}function Y(n,t,r){return function(){try{n.call(this,this.__data__,t,r)}finally{}}}function Z(n){return n.trim().split(/^|\s+/).map((function(n){var t="",r=n.indexOf(".");return r>=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}}))}function nn(n){return function(){var t=this.__on;if(t){for(var r,i=0,u=-1,o=t.length;i<o;++i)r=t[i],n.type&&r.type!==n.type||r.name!==n.name?t[++u]=r:this.removeEventListener(r.type,r.listener,r.capture);++u?t.length=u:delete this.__on}}}function tn(n,t,r){var i=V.hasOwnProperty(n.type)?W:Y;return function(u,o,e){var f,s=this.__on,c=i(t,o,e);if(s)for(var h=0,a=s.length;h<a;++h)if((f=s[h]).type===n.type&&f.name===n.name)return this.removeEventListener(f.type,f.listener,f.capture),this.addEventListener(f.type,f.listener=c,f.capture=r),void(f.value=t);this.addEventListener(n.type,c,r),f={type:n.type,name:n.name,value:t,listener:c,capture:r},s?s.push(f):this.__on=[f]}}function rn(n,t,r){var i=_(n),u=i.CustomEvent;"function"==typeof u?u=new u(t,r):(u=i.document.createEvent("Event"),r?(u.initEvent(t,r.bubbles,r.cancelable),u.detail=r.detail):u.initEvent(t,!1,!1)),n.dispatchEvent(u)}function un(n,t){return function(){return rn(this,n,t)}}function on(n,t){return function(){return rn(this,n,t.apply(this,arguments))}}"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(V={mouseenter:"mouseover",mouseleave:"mouseout"}));var en=[null];function fn(n,t){this._groups=n,this._parents=t}fn.prototype=function(){return new fn([[document.documentElement]],en)}.prototype={constructor:fn,select:function(n){"function"!=typeof n&&(n=c(n));for(var t=this._groups,r=t.length,i=new Array(r),u=0;u<r;++u)for(var o,e,f=t[u],s=f.length,h=i[u]=new Array(s),a=0;a<s;++a)(o=f[a])&&(e=n.call(o,o.__data__,a,f))&&("__data__"in o&&(e.__data__=o.__data__),h[a]=e);return new fn(i,this._parents)},selectAll:function(n){"function"!=typeof n&&(n=function(n){return null==n?h:function(){return this.querySelectorAll(n)}}(n));for(var t=this._groups,r=t.length,i=[],u=[],o=0;o<r;++o)for(var e,f=t[o],s=f.length,c=0;c<s;++c)(e=f[c])&&(i.push(n.call(e,e.__data__,c,f)),u.push(e));return new fn(i,u)},filter:function(n){"function"!=typeof n&&(n=function(n){return function(){return this.matches(n)}}(n));for(var t=this._groups,r=t.length,i=new Array(r),u=0;u<r;++u)for(var o,e=t[u],f=e.length,s=i[u]=[],c=0;c<f;++c)(o=e[c])&&n.call(o,o.__data__,c,e)&&s.push(o);return new fn(i,this._parents)},data:function(n,t){if(!n)return y=new Array(this.size()),h=-1,this.each((function(n){y[++h]=n})),y;var r,i=t?w:v,u=this._parents,o=this._groups;"function"!=typeof n&&(r=n,n=function(){return r});for(var e=o.length,f=new Array(e),s=new Array(e),c=new Array(e),h=0;h<e;++h){var a=u[h],l=o[h],p=l.length,y=n.call(a,a&&a.__data__,h,u),d=y.length,m=s[h]=new Array(d),A=f[h]=new Array(d);i(a,l,m,A,c[h]=new Array(p),y,t);for(var x,g,_=0,q=0;_<d;++_)if(x=m[_]){for(_>=q&&(q=_+1);!(g=A[q])&&++q<d;);x._next=g||null}}return(f=new fn(f,u))._enter=s,f._exit=c,f},enter:function(){return new fn(this._enter||this._groups.map(a),this._parents)},exit:function(){return new fn(this._exit||this._groups.map(a),this._parents)},join:function(n,t,r){var i=this.enter(),u=this,o=this.exit();return i="function"==typeof n?n(i):i.append(n+""),null!=t&&(u=t(u)),null==r?o.remove():r(o),i&&u?i.merge(u).order():u},merge:function(n){for(var t=this._groups,r=n._groups,i=t.length,u=Math.min(i,r.length),o=new Array(i),e=0;e<u;++e)for(var f,s=t[e],c=r[e],h=s.length,a=o[e]=new Array(h),l=0;l<h;++l)(f=s[l]||c[l])&&(a[l]=f);for(;e<i;++e)o[e]=t[e];return new fn(o,this._parents)},order:function(){for(var n=this._groups,t=-1,r=n.length;++t<r;)for(var i,u=n[t],o=u.length-1,e=u[o];--o>=0;)(i=u[o])&&(e&&4^i.compareDocumentPosition(e)&&e.parentNode.insertBefore(i,e),e=i);return this},sort:function(n){function t(t,r){return t&&r?n(t.__data__,r.__data__):!t-!r}n||(n=p);for(var r=this._groups,i=r.length,u=new Array(i),o=0;o<i;++o){for(var e,f=r[o],s=f.length,c=u[o]=new Array(s),h=0;h<s;++h)(e=f[h])&&(c[h]=e);c.sort(t)}return new fn(u,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){var n=new Array(this.size()),t=-1;return this.each((function(){n[++t]=this})),n},node:function(){for(var n=this._groups,t=0,r=n.length;t<r;++t)for(var i=n[t],u=0,o=i.length;u<o;++u){var e=i[u];if(e)return e}return null},size:function(){var n=0;return this.each((function(){++n})),n},empty:function(){return!this.node()},each:function(n){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var u,o=t[r],e=0,f=o.length;e<f;++e)(u=o[e])&&n.call(u,u.__data__,e,o);return this},attr:function(n,t){var r=u(n);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==t?r.local?d:y:"function"==typeof t?r.local?g:x:r.local?A:m)(r,t))},style:function(n,t,r){return arguments.length>1?this.each((null==t?q:"function"==typeof t?j:L)(n,t,null==r?"":r)):k(this.node(),n)},property:function(n,t){return arguments.length>1?this.each((null==t?z:"function"==typeof t?M:D)(n,t)):this.node()[n]},classed:function(n,t){var r=N(n+"");if(arguments.length<2){for(var i=S(this.node()),u=-1,o=r.length;++u<o;)if(!i.contains(r[u]))return!1;return!0}return this.each(("function"==typeof t?b:t?E:X)(r,t))},text:function(n){return arguments.length?this.each(null==n?F:("function"==typeof n?H:G)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?I:("function"==typeof n?K:J)(n)):this.node().innerHTML},raise:function(){return this.each(O)},lower:function(){return this.each(P)},append:function(n){var t="function"==typeof n?n:f(n);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(n,t){var r="function"==typeof n?n:f(n),i=null==t?Q:"function"==typeof t?t:c(t);return this.select((function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(R)},clone:function(n){return this.select(n?U:T)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,t,r){var i,u,o=Z(n+""),e=o.length;if(!(arguments.length<2)){for(f=t?tn:nn,null==r&&(r=!1),i=0;i<e;++i)this.each(f(o[i],t,r));return this}var f=this.node().__on;if(f)for(var s,c=0,h=f.length;c<h;++c)for(i=0,s=f[c];i<e;++i)if((u=o[i]).type===s.type&&u.name===s.name)return s.value},dispatch:function(n,t){return this.each(("function"==typeof t?on:un)(n,t))}};class sn{constructor(t){n(this,t)}componentDidLoad(){new fn([[document.querySelector("#parrafo")]],[document.documentElement]).style("color","green").style("font-size","20px")}render(){return t("div",null,t("p",{id:"parrafo"},"Linea de texto que contiene un parrafo en D3"))}}sn.style="radh-d3{}";export{sn as radh_d3}