UNPKG

webc-matriz-eisenhower

Version:

Matriz de Eisenhower como Web Component sin dependencias externas

390 lines (353 loc) 31.1 kB
"use strict";(()=>{var At=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var g=(i,t,e,r)=>{for(var s=r>1?void 0:r?xt(t,e):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(r?n(t,e,s):n(s))||s);return r&&s&&At(t,e,s),s};var F=globalThis,j=F.ShadowRoot&&(F.ShadyCSS===void 0||F.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,U=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(j&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&it.set(e,t))}return t}toString(){return this.cssText}},ot=i=>new U(typeof i=="string"?i:i+"",void 0,V),K=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new U(e,i,V)},nt=(i,t)=>{if(j)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=F.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Z=j?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return ot(e)})(i):i;var{is:St,defineProperty:Et,getOwnPropertyDescriptor:Ct,getOwnPropertyNames:wt,getOwnPropertySymbols:Ut,getPrototypeOf:Pt}=Object,B=globalThis,at=B.trustedTypes,kt=at?at.emptyScript:"",Nt=B.reactiveElementPolyfillSupport,P=(i,t)=>i,k={toAttribute(i,t){switch(t){case Boolean:i=i?kt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},q=(i,t)=>!St(i,t),lt={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:q};Symbol.metadata??=Symbol("metadata"),B.litPropertyMetadata??=new WeakMap;var f=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=lt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Et(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){let{get:s,set:o}=Ct(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:s,set(n){let l=s?.call(this);o?.call(this,n),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??lt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let t=Pt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let e=this.properties,r=[...wt(e),...Ut(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(Z(s))}else t!==void 0&&e.push(Z(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return nt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:k).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:k;this._$Em=s,this[s]=n.fromAttribute(e,o.type)??this._$Ej?.get(s)??null,this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){let s=this.constructor,o=this[t];if(r??=s.getPropertyOptions(t),!((r.hasChanged??q)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:o},n){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[s,o]of r){let{wrapped:n}=o,l=this[s];n!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};f.elementStyles=[],f.shadowRootOptions={mode:"open"},f[P("elementProperties")]=new Map,f[P("finalized")]=new Map,Nt?.({ReactiveElement:f}),(B.reactiveElementVersions??=[]).push("2.1.0");var tt=globalThis,L=tt.trustedTypes,ht=L?L.createPolicy("lit-html",{createHTML:i=>i}):void 0,mt="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,ft="?"+v,Rt=`<${ft}>`,A=document,R=()=>A.createComment(""),D=i=>i===null||typeof i!="object"&&typeof i!="function",et=Array.isArray,Dt=i=>et(i)||typeof i?.[Symbol.iterator]=="function",J=`[ \f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,ct=/>/g,y=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,ut=/"/g,$t=/^(?:script|style|textarea|title)$/i,rt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),w=rt(1),zt=rt(2),Vt=rt(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),gt=new WeakMap,b=A.createTreeWalker(A,129);function vt(i,t){if(!et(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(t):t}var Ot=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?"<svg>":t===3?"<math>":"",n=N;for(let l=0;l<e;l++){let a=i[l],d,p,h=-1,m=0;for(;m<a.length&&(n.lastIndex=m,p=n.exec(a),p!==null);)m=n.lastIndex,n===N?p[1]==="!--"?n=dt:p[1]!==void 0?n=ct:p[2]!==void 0?($t.test(p[2])&&(s=RegExp("</"+p[2],"g")),n=y):p[3]!==void 0&&(n=y):n===y?p[0]===">"?(n=s??N,h=-1):p[1]===void 0?h=-2:(h=n.lastIndex-p[2].length,d=p[1],n=p[3]===void 0?y:p[3]==='"'?ut:pt):n===ut||n===pt?n=y:n===dt||n===ct?n=N:(n=y,s=void 0);let $=n===y&&i[l+1].startsWith("/>")?" ":"";o+=n===N?a+Rt:h>=0?(r.push(d),a.slice(0,h)+mt+a.slice(h)+v+$):a+v+(h===-2?l:$)}return[vt(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},O=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0,l=t.length-1,a=this.parts,[d,p]=Ot(t,e);if(this.el=i.createElement(d,r),b.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=b.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(mt)){let m=p[n++],$=s.getAttribute(h).split(v),I=/([.?@])?(.*)/.exec(m);a.push({type:1,index:o,name:I[2],strings:$,ctor:I[1]==="."?Q:I[1]==="?"?X:I[1]==="@"?Y:C}),s.removeAttribute(h)}else h.startsWith(v)&&(a.push({type:6,index:o}),s.removeAttribute(h));if($t.test(s.tagName)){let h=s.textContent.split(v),m=h.length-1;if(m>0){s.textContent=L?L.emptyScript:"";for(let $=0;$<m;$++)s.append(h[$],R()),b.nextNode(),a.push({type:2,index:++o});s.append(h[m],R())}}}else if(s.nodeType===8)if(s.data===ft)a.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(v,h+1))!==-1;)a.push({type:7,index:o}),h+=v.length-1}o++}}static createElement(t,e){let r=A.createElement("template");return r.innerHTML=t,r}};function E(i,t,e=i,r){if(t===x)return t;let s=r!==void 0?e._$Co?.[r]:e._$Cl,o=D(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?(e._$Co??=[])[r]=s:e._$Cl=s),s!==void 0&&(t=E(i,s._$AS(i,t.values),s,r)),t}var G=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??A).importNode(e,!0);b.currentNode=s;let o=b.nextNode(),n=0,l=0,a=r[0];for(;a!==void 0;){if(n===a.index){let d;a.type===2?d=new T(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new W(o,this,t)),this._$AV.push(d),a=r[++l]}n!==a?.index&&(o=b.nextNode(),n++)}return b.currentNode=A,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},T=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),D(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==x&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Dt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==c&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=O.createElement(vt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{let o=new G(s,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=gt.get(t.strings);return e===void 0&&gt.set(t.strings,e=new O(t)),e}k(t){et(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(R()),this.O(R()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},C=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=c}_$AI(t,e=this,r,s){let o=this.strings,n=!1;if(o===void 0)t=E(this,t,e,0),n=!D(t)||t!==this._$AH&&t!==x,n&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=E(this,l[r+a],e,a),d===x&&(d=this._$AH[a]),n||=!D(d)||d!==this._$AH[a],d===c?t=c:t!==c&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}n&&!s&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Q=class extends C{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}},X=class extends C{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}},Y=class extends C{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??c)===x)return;let r=this._$AH,s=t===c&&r!==c||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==c&&(r===c||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},W=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}};var Tt=tt.litHtmlPolyfillSupport;Tt?.(O,T),(tt.litHtmlVersions??=[]).push("3.3.0");var _t=(i,t,e)=>{let r=e?.renderBefore??t,s=r._$litPart$;if(s===void 0){let o=e?.renderBefore??null;r._$litPart$=s=new T(t.insertBefore(R(),o),o,void 0,e??{})}return s._$AI(i),s};var st=globalThis,_=class extends f{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=_t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return x}};_._$litElement$=!0,_.finalized=!0,st.litElementHydrateSupport?.({LitElement:_});var Mt=st.litElementPolyfillSupport;Mt?.({LitElement:_});(st.litElementVersions??=[]).push("4.2.0");var yt=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Ht={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:q},It=(i=Ht,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,i)},init(l){return l!==void 0&&this.C(n,void 0,i,l),l}}}if(r==="setter"){let{name:n}=e;return function(l){let a=this[n];t.call(this,l),this.requestUpdate(n,a,i)}}throw Error("Unsupported decorator location: "+r)};function S(i){return(t,e)=>typeof e=="object"?It(i,t,e):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function M(i){return S({...i,state:!0,attribute:!1})}var bt=K` :host { display: block; font-family: Inter, sans-serif; padding: 5px; } h1 { text-align: center; } .grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; height: 80vh; } .cuadrante { box-shadow: rgba(0, 0, 0, 0.09) 0 3px 12px; padding: 15px; box-sizing: border-box; display: flex; flex-direction: column; border-radius: 20px; } .titulo { font-weight: bold; margin-bottom: 0.5rem; } ul { list-style: none; padding-left: 0; flex: 1; overflow-y: auto; margin-top: 10px; } li { display: flex; justify-content: space-between; background: #fff; padding: 0 10px; margin-bottom: 5px; border: 1px solid #ccc; border-radius: 4px; align-items: center; } input { padding: 4px; margin-right: 4px; flex: 1; } button { padding: 4px 8px; margin-top: 5px; } .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .btn-agregar { background-color: #FFFFFF; padding: 5px; border: 1px solid #555555; box-shadow: rgba(50, 50, 93, 0.25) 0 2px 5px -1px, rgba(0, 0, 0, 0.3) 0 1px 3px -1px; border-radius: 5px; cursor: pointer; } .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; } .modal { background: white; padding: 15px; border-radius: 15px; max-width: 500px; width: 100%; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); } .modal-actions { margin-top: 1rem; display: flex; justify-content: flex-end; gap: 10px; } .btn-tarea { border: none; cursor: pointer; margin: 0; } .btn-eliminar { background-color: #CB0404; } .btn-ver-tarea { background-color: #FFB22C; } .btn-editar { background-color: #5459AC; } `;function H(i,t,e){return w` <div class="cuadrante" data-key="${e}" @dragover=${r=>this.permitirDrop(r)} @drop=${r=>this.soltarTarea(r,e)} @dragenter=${r=>this.resaltarCuadrante(r)} @dragleave=${r=>this.quitarResaltadoCuadrante(r)} > <div class="header"> <div class="titulo">${i}</div> <button @click=${()=>this.abrirModal(e)} class="btn-agregar" title="Agregar tarea" aria-label="Agregar tarea" tabindex="-1" > <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" > <path d="M12 5l0 14"/> <path d="M5 12l14 0"/> </svg> </button> </div> <div>${t}</div> <ul> ${this.tareas[e].map((r,s)=>w` <li draggable="true" @dragstart=${o=>this.iniciarDrag(o,e,s)} > <span>${r}</span> <div> <button class="btn-tarea btn-ver-tarea" title="Ver tarea" aria-label="Ver tarea" tabindex="-1" > <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="#FFFFFF" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" > <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/> <path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/> </svg> </button> <button class="btn-tarea btn-editar" title="Editar tarea" aria-label="Editar tarea" tabindex="-1" > <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="#FFFFFF" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" > <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"/> <path d="M13.5 6.5l4 4"/> </svg> </button> <button @click=${()=>this.eliminarTarea(e,s)} class="btn-tarea btn-eliminar" title="Eliminar tarea" aria-label="Eliminar tarea" tabindex="-1" > <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="#FFFFFF" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" > <path d="M4 7l16 0"/> <path d="M10 11l0 6"/> <path d="M14 11l0 6"/> <path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"/> <path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"/> </svg> </button> </div> </li> `)} </ul> </div> `}var u=class extends _{constructor(){super(...arguments);this.importanteUrgenteBorderColor="#DA6C6C";this.importanteNoUrgenteBorderColor="#A0C878";this.noImportanteUrgenteBorderColor="#FED16A";this.noImportanteNoUrgenteBorderColor="#578FCA";this.modalAbierto=!1;this.cuadranteActual=null;this.tareas={importanteUrgente:[],importanteNoUrgente:[],noImportanteUrgente:[],noImportanteNoUrgente:[]};this.inputs={importanteUrgente:"",importanteNoUrgente:"",noImportanteUrgente:"",noImportanteNoUrgente:""};this.dragData=null;this.cuadranteDragOver=null}agregarTarea(e){let r=this.inputs[e].trim();r&&(this.tareas={...this.tareas,[e]:[...this.tareas[e],r]},this.inputs[e]="",this.requestUpdate())}eliminarTarea(e,r){let s=[...this.tareas[e]];s.splice(r,1),this.tareas={...this.tareas,[e]:s}}actualizarInput(e,r){let s=e.target;this.inputs[r]=s.value}abrirModal(e){this.cuadranteActual=e,this.modalAbierto=!0}cerrarModal(){this.modalAbierto=!1,this.cuadranteActual=null}confirmarTarea(){this.cuadranteActual&&(this.agregarTarea(this.cuadranteActual),this.cerrarModal())}iniciarDrag(e,r,s){this.dragData={from:r,index:s},e.dataTransfer?.setData("text/plain","dragging")}permitirDrop(e){e.preventDefault()}soltarTarea(e,r){if(e.preventDefault(),!this.dragData)return;let{from:s,index:o}=this.dragData,n=this.tareas[s][o],l=[...this.tareas[s]];l.splice(o,1);let a=[...this.tareas[r],n];this.tareas={...this.tareas,[s]:l,[r]:a},this.dragData=null,this.requestUpdate()}resaltarCuadrante(e){let r=e.currentTarget?.dataset.key;this.cuadranteDragOver=r??null}quitarResaltadoCuadrante(e){this.cuadranteDragOver=null}render(){return w` <style> .cuadrante[data-key="importanteUrgente"] { border: 3px solid ${this.importanteUrgenteBorderColor}; } .cuadrante[data-key="importanteNoUrgente"] { border: 3px solid ${this.importanteNoUrgenteBorderColor}; } .cuadrante[data-key="noImportanteUrgente"] { border: 3px solid ${this.noImportanteUrgenteBorderColor}; } .cuadrante[data-key="noImportanteNoUrgente"] { border: 3px solid ${this.noImportanteNoUrgenteBorderColor}; } </style> <h1>Matriz de Eisenhower</h1> <div class="grid"> ${H.call(this,"C1 * Importante - Urgente","Hazlo ahora","importanteUrgente")} ${H.call(this,"C2 * Importante - No Urgente","Planif\xEDcalo","importanteNoUrgente")} ${H.call(this,"C3 * No Importante - Urgente","Del\xE9galo","noImportanteUrgente")} ${H.call(this,"C4 * No Importante - No Urgente","Elim\xEDnalo","noImportanteNoUrgente")} </div> ${this.modalAbierto?w` <div class="modal-overlay" @click=${()=>this.cerrarModal()}> <div class="modal" @click=${e=>e.stopPropagation()}> <h3>Agregar tarea</h3> <input .value=${this.inputs[this.cuadranteActual]} @input=${e=>this.actualizarInput(e,this.cuadranteActual)} placeholder="Escribe la tarea..." /> <div class="modal-actions"> <button @click=${this.confirmarTarea}>Guardar</button> <button @click=${this.cerrarModal}>Cancelar</button> </div> </div> </div> `:""} `}};u.styles=bt,g([S({type:String,attribute:"importante-urgente-border-color"})],u.prototype,"importanteUrgenteBorderColor",2),g([S({type:String,attribute:"importante-no-urgente-border-color"})],u.prototype,"importanteNoUrgenteBorderColor",2),g([S({type:String,attribute:"no-importante-urgente-border-color"})],u.prototype,"noImportanteUrgenteBorderColor",2),g([S({type:String,attribute:"no-importante-no-urgente-border-color"})],u.prototype,"noImportanteNoUrgenteBorderColor",2),g([M()],u.prototype,"modalAbierto",2),g([M()],u.prototype,"cuadranteActual",2),g([M()],u.prototype,"tareas",2),g([M()],u.prototype,"cuadranteDragOver",2),u=g([yt("webc-matriz-eisenhower")],u);})(); /*! Bundled license information: @lit/reactive-element/css-tag.js: (** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/reactive-element.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) lit-html/lit-html.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) lit-element/lit-element.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) lit-html/is-server.js: (** * @license * Copyright 2022 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/custom-element.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/property.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/state.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/event-options.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/base.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/query.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/query-all.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/query-async.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/query-assigned-elements.js: (** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @lit/reactive-element/decorators/query-assigned-nodes.js: (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) */