TYPO3 v15 dev-main snapshot ()
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{parser as a}from"@lezer/json";import{LRLanguage as s,indentNodeProp as i,continuedIndent as r,foldNodeProp as c,foldInside as d,LanguageSupport as g}from"@codemirror/language";const m=()=>n=>{try{JSON.parse(n.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=p(e,n.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function p(n,e){let t;return(t=n.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=n.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const o=s.define({name:"json",parser:a.configure({props:[i.add({Object:r({except:/^\s*\}/}),Array:r({except:/^\s*\]/})}),c.add({"Object Array":d})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function u(){return new g(o)}export{u as json,o as jsonLanguage,m as jsonParseLinter};
|
||||
@@ -0,0 +1 @@
|
||||
import{parser as l}from"@lezer/php";import{parseMixed as i}from"@lezer/common";import{html as p}from"@codemirror/lang-html";import{LRLanguage as u,indentNodeProp as d,continuedIndent as r,delimitedIndent as m,foldNodeProp as f,foldInside as c,LanguageSupport as g}from"@codemirror/language";const a=u.define({name:"php",parser:l.configure({props:[d.add({IfStatement:r({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:r({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:e=>{let o=e.textAfter,t=/^\s*\}/.test(o),n=/^\s*(case|default)\b/.test(o);return e.baseIndent+(t?0:n?1:2)*e.unit},ColonBlock:e=>e.baseIndent+e.unit,"Block EnumBody DeclarationList":m({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:r({except:/^({|end(for|foreach|switch|while)\b)/})}),f.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":c,ColonBlock(e){return{from:e.from+1,to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function h(e={}){let o=[],t;if(e.baseLanguage!==null)if(e.baseLanguage)t=e.baseLanguage;else{let n=p({matchClosingTags:!1});o.push(n.support),t=n.language}return new g(a.configure({wrap:t&&i(n=>n.type.isTop?{parser:t.parser,overlay:s=>s.name=="Text"}:null),top:e.plain?"Program":"Template"}),o)}export{h as php,a as phpLanguage};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{EditorView as C}from"@codemirror/view";import{HighlightStyle as y,syntaxHighlighting as B}from"@codemirror/language";import{tags as o}from"@lezer/highlight";const d="#e5c07b",c="#e06c75",m="#56b6c2",g="#ffffff",r="#abb2bf",e="#7d8799",s="#61afef",b="#98c379",a="#d19a66",p="#c678dd",f="#21252b",l="#2c313a",n="#282c34",t="#353a42",u="#3E4451",i="#528bff",v={chalky:d,coral:c,cyan:m,invalid:g,ivory:r,stone:e,malibu:s,sage:b,whiskey:a,violet:p,darkBackground:f,highlightBackground:l,background:n,tooltipBackground:t,selection:u,cursor:i},k=C.theme({"&":{color:r,backgroundColor:n},".cm-content":{caretColor:i},".cm-cursor, .cm-dropCursor":{borderLeftColor:i},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:u},".cm-panels":{backgroundColor:f,color:r},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:n,color:e,border:"none"},".cm-activeLineGutter":{backgroundColor:l},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:t},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:t,borderBottomColor:t},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:l,color:r}}},{dark:!0}),h=y.define([{tag:o.keyword,color:p},{tag:[o.name,o.deleted,o.character,o.propertyName,o.macroName],color:c},{tag:[o.function(o.variableName),o.labelName],color:s},{tag:[o.color,o.constant(o.name),o.standard(o.name)],color:a},{tag:[o.definition(o.name),o.separator],color:r},{tag:[o.typeName,o.className,o.number,o.changed,o.annotation,o.modifier,o.self,o.namespace],color:d},{tag:[o.operator,o.operatorKeyword,o.url,o.escape,o.regexp,o.link,o.special(o.string)],color:m},{tag:[o.meta,o.comment],color:e},{tag:o.strong,fontWeight:"bold"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:e,textDecoration:"underline"},{tag:o.heading,fontWeight:"bold",color:c},{tag:[o.atom,o.bool,o.special(o.variableName)],color:a},{tag:[o.processingInstruction,o.string,o.inserted],color:b},{tag:o.invalid,color:g}]),x=[k,B(h)];export{v as color,x as oneDark,h as oneDarkHighlightStyle,k as oneDarkTheme};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
import{NodeProp as D}from"@lezer/common";let Q=0;class m{constructor(t,a,i){this.set=t,this.base=a,this.modified=i,this.id=Q++}static define(t){if(t?.base)throw new Error("Can not derive from a modified tag");let a=new m([],null,[]);if(a.set.push(a),t)for(let i of t.set)a.set.push(i);return a}static defineModifier(){let t=new B;return a=>a.modified.indexOf(t)>-1?a:B.get(a.base||a,a.modified.concat(t).sort((i,l)=>i.id-l.id))}}let U=0;class B{constructor(){this.instances=[],this.id=U++}static get(t,a){if(!a.length)return t;let i=a[0].instances.find(r=>r.base==t&&W(a,r.modified));if(i)return i;let l=[],s=new m(l,t,a);for(let r of a)r.instances.push(s);let c=X(a);for(let r of t.set)if(!r.modified.length)for(let d of c)l.push(B.get(r,d));return s}}function W(o,t){return o.length==t.length&&o.every((a,i)=>a==t[i])}function X(o){let t=[[]];for(let a=0;a<o.length;a++)for(let i=0,l=t.length;i<l;i++)t.push(t[i].concat(o[a]));return t.sort((a,i)=>i.length-a.length)}function Y(o){let t=Object.create(null);for(let a in o){let i=o[a];Array.isArray(i)||(i=[i]);for(let l of a.split(" "))if(l){let s=[],c=2,r=l;for(let f=0;;){if(r=="..."&&f>0&&f+3==l.length){c=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!h)throw new RangeError("Invalid path: "+l);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==l.length)break;let p=l[f++];if(f==l.length&&p=="!"){c=0;break}if(p!="/")throw new RangeError("Invalid path: "+l);r=l.slice(f)}let d=s.length-1,g=s[d];if(!g)throw new RangeError("Invalid path: "+l);let b=new A(i,c,d>0?s.slice(0,d):null);t[g]=b.sort(t[g])}}return F.add(t)}const F=new D;class A{constructor(t,a,i,l){this.tags=t,this.mode=a,this.context=i,this.next=l}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}A.empty=new A([],2,null);function J(o,t){let a=Object.create(null);for(let s of o)if(!Array.isArray(s.tag))a[s.tag.id]=s.class;else for(let c of s.tag)a[c.id]=s.class;let{scope:i,all:l=null}=t||{};return{style:s=>{let c=l;for(let r of s)for(let d of r.set){let g=a[d.id];if(g){c=c?c+" "+g:g;break}}return c},scope:i}}function Z(o,t){let a=null;for(let i of o){let l=i.style(t);l&&(a=a?a+" "+l:l)}return a}function V(o,t,a,i=0,l=o.length){let s=new _(i,Array.isArray(t)?t:[t],a);s.highlightRange(o.cursor(),i,l,"",s.highlighters),s.flush(l)}function $(o,t,a,i,l,s=0,c=o.length){let r=s;function d(g,b){if(!(g<=r)){for(let f=o.slice(r,g),h=0;;){let p=f.indexOf(`
|
||||
`,h),R=p<0?f.length:p;if(R>h&&i(f.slice(h,R),b),p<0)break;l(),h=p+1}r=g}}V(t,a,(g,b,f)=>{d(g,""),d(b,f)},s,c),d(c,"")}class _{constructor(t,a,i){this.at=t,this.highlighters=a,this.span=i,this.class=""}startSpan(t,a){a!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=a)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,a,i,l,s){let{type:c,from:r,to:d}=t;if(r>=i||d<=a)return;c.isTop&&(s=this.highlighters.filter(p=>!p.scope||p.scope(c)));let g=l,b=z(t)||A.empty,f=Z(s,b.tags);if(f&&(g&&(g+=" "),g+=f,b.mode==1&&(l+=(l?" ":"")+f)),this.startSpan(Math.max(a,r),g),b.opaque)return;let h=t.tree&&t.tree.prop(D.mounted);if(h&&h.overlay){let p=t.node.enter(h.overlay[0].from+r,1),R=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),j=t.firstChild();for(let v=0,M=r;;v++){let O=v<h.overlay.length?h.overlay[v]:null,E=O?O.from+r:d,P=Math.max(a,M),T=Math.min(i,E);if(P<T&&j)for(;t.from<T&&(this.highlightRange(t,P,T,l,s),this.startSpan(Math.min(T,t.to),g),!(t.to>=E||!t.nextSibling())););if(!O||E>i)break;M=O.to+r,M>a&&(this.highlightRange(p.cursor(),Math.max(a,O.from+r),Math.min(i,M),"",R),this.startSpan(Math.min(i,M),g))}j&&t.parent()}else if(t.firstChild()){h&&(l="");do if(!(t.to<=a)){if(t.from>=i)break;this.highlightRange(t,a,i,l,s),this.startSpan(Math.min(i,t.to),g)}while(t.nextSibling());t.parent()}}}function z(o){let t=o.type.prop(F);for(;t&&t.context&&!o.matchContext(t.context);)t=t.next;return t||null}const e=m.define,C=e(),N=e(),G=e(N),L=e(N),x=e(),I=e(x),H=e(x),u=e(),w=e(u),k=e(),y=e(),K=e(),S=e(K),q=e(),n={comment:C,lineComment:e(C),blockComment:e(C),docComment:e(C),name:N,variableName:e(N),typeName:G,tagName:e(G),propertyName:L,attributeName:e(L),className:e(N),labelName:e(N),namespace:e(N),macroName:e(N),literal:x,string:I,docString:e(I),character:e(I),attributeValue:e(I),number:H,integer:e(H),float:e(H),bool:e(x),regexp:e(x),escape:e(x),color:e(x),url:e(x),keyword:k,self:e(k),null:e(k),atom:e(k),unit:e(k),modifier:e(k),operatorKeyword:e(k),controlKeyword:e(k),definitionKeyword:e(k),moduleKeyword:e(k),operator:y,derefOperator:e(y),arithmeticOperator:e(y),logicOperator:e(y),bitwiseOperator:e(y),compareOperator:e(y),updateOperator:e(y),definitionOperator:e(y),typeOperator:e(y),controlOperator:e(y),punctuation:K,separator:e(K),bracket:S,angleBracket:e(S),squareBracket:e(S),paren:e(S),brace:e(S),content:u,heading:w,heading1:e(w),heading2:e(w),heading3:e(w),heading4:e(w),heading5:e(w),heading6:e(w),contentSeparator:e(u),list:e(u),quote:e(u),emphasis:e(u),strong:e(u),link:e(u),monospace:e(u),strikethrough:e(u),inserted:e(),deleted:e(),changed:e(),invalid:e(),meta:q,documentMeta:e(q),annotation:e(q),processingInstruction:e(q),definition:m.defineModifier(),constant:m.defineModifier(),function:m.defineModifier(),standard:m.defineModifier(),local:m.defineModifier(),special:m.defineModifier()},tt=J([{tag:n.link,class:"tok-link"},{tag:n.heading,class:"tok-heading"},{tag:n.emphasis,class:"tok-emphasis"},{tag:n.strong,class:"tok-strong"},{tag:n.keyword,class:"tok-keyword"},{tag:n.atom,class:"tok-atom"},{tag:n.bool,class:"tok-bool"},{tag:n.url,class:"tok-url"},{tag:n.labelName,class:"tok-labelName"},{tag:n.inserted,class:"tok-inserted"},{tag:n.deleted,class:"tok-deleted"},{tag:n.literal,class:"tok-literal"},{tag:n.string,class:"tok-string"},{tag:n.number,class:"tok-number"},{tag:[n.regexp,n.escape,n.special(n.string)],class:"tok-string2"},{tag:n.variableName,class:"tok-variableName"},{tag:n.local(n.variableName),class:"tok-variableName tok-local"},{tag:n.definition(n.variableName),class:"tok-variableName tok-definition"},{tag:n.special(n.variableName),class:"tok-variableName2"},{tag:n.definition(n.propertyName),class:"tok-propertyName tok-definition"},{tag:n.typeName,class:"tok-typeName"},{tag:n.namespace,class:"tok-namespace"},{tag:n.className,class:"tok-className"},{tag:n.macroName,class:"tok-macroName"},{tag:n.propertyName,class:"tok-propertyName"},{tag:n.operator,class:"tok-operator"},{tag:n.comment,class:"tok-comment"},{tag:n.meta,class:"tok-meta"},{tag:n.invalid,class:"tok-invalid"},{tag:n.punctuation,class:"tok-punctuation"}]);export{m as Tag,tt as classHighlighter,z as getStyleTags,$ as highlightCode,V as highlightTree,Y as styleTags,J as tagHighlighter,n as tags};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{LRParser as P}from"@lezer/lr";import{styleTags as Q,tags as O}from"@lezer/highlight";const e=Q({String:O.string,Number:O.number,"True False":O.bool,PropertyName:O.propertyName,Null:O.null,",":O.separator,"[ ]":O.squareBracket,"{ }":O.brace}),r=P.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[e],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});export{r as parser};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function s(){var r=arguments[0];typeof r=="string"&&(r=document.createElement(r));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var o=t[n];typeof o=="string"?r.setAttribute(n,o):o!=null&&(r[n]=o)}e++}for(;e<arguments.length;e++)f(r,arguments[e]);return r}function f(r,e){if(typeof e=="string")r.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)r.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)f(r,e[t]);else throw new RangeError("Unsupported child node: "+e)}export{s as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,202 @@
|
||||
var k=Object.defineProperty;var I=(n,e)=>{for(var t in e)k(n,t,{get:e[t],enumerable:!0})};var g={};I(g,{OptionPure:()=>p,SelectPure:()=>o});function v(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?v=function(t){return typeof t}:v=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(n)}function a(n,e,t){var i=t.value;if(typeof i!="function")throw new TypeError("@boundMethod decorator can only be applied to methods not: ".concat(v(i)));var r=!1;return{configurable:!0,get:function(){if(r||this===n.prototype||this.hasOwnProperty(e)||typeof i!="function")return i;var d=i.bind(this);return r=!0,Object.defineProperty(this,e,{configurable:!0,get:function(){return d},set:function(C){i=C,delete this[e]}}),r=!1,d},set:function(d){i=d}}}import{LitElement as _,html as $}from"lit";import{ifDefined as P}from"lit-html/directives/if-defined.js";import{customElement as D}from"lit/decorators/custom-element.js";import{property as f}from"lit/decorators/property.js";var b={ENTER:"Enter",TAB:"Tab"};var y=()=>{};var O={label:"",value:"",select:y,unselect:y,disabled:!1,hidden:!1,selected:!1};import{css as E}from"lit";var x=E`
|
||||
.select-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
.select {
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: var(--select-width, 100%);
|
||||
}
|
||||
.label:focus {
|
||||
outline: var(--select-outline, 2px solid #e3e3e3);
|
||||
}
|
||||
.label:after {
|
||||
border-bottom: 1px solid var(--color, #000);
|
||||
border-right: 1px solid var(--color, #000);
|
||||
box-sizing: border-box;
|
||||
content: "";
|
||||
display: block;
|
||||
height: 10px;
|
||||
margin-top: -2px;
|
||||
transform: rotate(45deg);
|
||||
transition: 0.2s ease-in-out;
|
||||
width: 10px;
|
||||
}
|
||||
.label.visible:after {
|
||||
margin-bottom: -4px;
|
||||
margin-top: 0;
|
||||
transform: rotate(225deg);
|
||||
}
|
||||
select {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
position: relative;
|
||||
opacity: 0;
|
||||
}
|
||||
select[multiple] {
|
||||
z-index: 0;
|
||||
}
|
||||
select,
|
||||
.label {
|
||||
align-items: center;
|
||||
background-color: var(--background-color, #fff);
|
||||
border-radius: var(--border-radius, 4px);
|
||||
border: var(--border-width, 1px) solid var(--border-color, #000);
|
||||
box-sizing: border-box;
|
||||
color: var(--color, #000);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
font-family: var(--font-family, inherit);
|
||||
font-size: var(--font-size, 14px);
|
||||
font-weight: var(--font-weight, 400);
|
||||
min-height: var(--select-height, 44px);
|
||||
justify-content: space-between;
|
||||
padding: var(--padding, 0 10px);
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
@media only screen and (hover: none) and (pointer: coarse){
|
||||
select {
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
.dropdown {
|
||||
background-color: var(--border-color, #000);
|
||||
border-radius: var(--border-radius, 4px);
|
||||
border: var(--border-width, 1px) solid var(--border-color, #000);
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
gap: var(--border-width, 1px);
|
||||
justify-content: space-between;
|
||||
max-height: calc(var(--select-height, 44px) * var(--dropdown-items, 4) + var(--border-width, 1px) * calc(var(--dropdown-items, 4) - 1));
|
||||
overflow-y: scroll;
|
||||
position: absolute;
|
||||
top: calc(var(--select-height, 44px) + var(--dropdown-gap, 0px));
|
||||
width: calc(100% - var(--border-width, 1px) * 2);
|
||||
z-index: var(--dropdown-z-index, 2);
|
||||
}
|
||||
.dropdown.visible {
|
||||
display: flex;
|
||||
z-index: 100;
|
||||
}
|
||||
.disabled {
|
||||
background-color: var(--disabled-background-color, #bdc3c7);
|
||||
color: var(--disabled-color, #ecf0f1);
|
||||
cursor: default;
|
||||
}
|
||||
.multi-selected {
|
||||
background-color: var(--selected-background-color, #e3e3e3);
|
||||
border-radius: var(--border-radius, 4px);
|
||||
color: var(--selected-color, #000);
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: space-between;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
.multi-selected-wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
.cross:after {
|
||||
content: '\\00d7';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
width: 12px;
|
||||
}
|
||||
`;import{css as L}from"lit";var S=L`
|
||||
.option {
|
||||
align-items: center;
|
||||
background-color: var(--background-color, #fff);
|
||||
box-sizing: border-box;
|
||||
color: var(--color, #000);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
font-family: var(--font-family, inherit);
|
||||
font-size: var(--font-size, 14px);
|
||||
font-weight: var(--font-weight, 400);
|
||||
min-height: var(--select-height, 44px);
|
||||
justify-content: flex-start;
|
||||
padding: var(--padding, 0 10px);
|
||||
width: 100%;
|
||||
}
|
||||
.option:not(.disabled):focus, .option:not(.disabled):not(.selected):hover {
|
||||
background-color: var(--hover-background-color, #e3e3e3);
|
||||
color: var(--hover-color, #000);
|
||||
}
|
||||
.selected {
|
||||
background-color: var(--selected-background-color, #e3e3e3);
|
||||
color: var(--selected-color, #000);
|
||||
}
|
||||
.disabled {
|
||||
background-color: var(--disabled-background-color, #e3e3e3);
|
||||
color: var(--disabled-color, #000);
|
||||
cursor: default;
|
||||
}
|
||||
`;var u=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var h=n.length-1;h>=0;h--)(d=n[h])&&(s=(r<3?d(s):r>3?d(e,t,s):d(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},p=class extends _{constructor(){super(...arguments),this.isSelected=!1,this.isDisabled=!1,this.isHidden=!1,this.optionValue="",this.displayedLabel="",this.optionIndex=-1}static get styles(){return S}connectedCallback(){super.connectedCallback(),this.isSelected=this.getAttribute("selected")!==null,this.isDisabled=this.getAttribute("disabled")!==null,this.isHidden=this.getAttribute("hidden")!==null,this.optionValue=this.getAttribute("value")||"",this.assignDisplayedLabel(),this.fireOnReadyCallback()}getOption(){return{label:this.displayedLabel,value:this.optionValue,select:this.select,unselect:this.unselect,selected:this.isSelected,disabled:this.isDisabled,hidden:this.isHidden}}select(){this.isSelected=!0,this.setAttribute("selected","")}unselect(){this.isSelected=!1,this.removeAttribute("selected")}setOnReadyCallback(e,t){this.onReady=e,this.optionIndex=t}setOnSelectCallback(e){this.onSelect=e}render(){let e=["option"];return this.isSelected&&e.push("selected"),this.isDisabled&&e.push("disabled"),$`
|
||||
<div
|
||||
class="${e.join(" ")}"
|
||||
@click=${this.fireOnSelectCallback}
|
||||
@keydown="${this.fireOnSelectIfEnterPressed}"
|
||||
tabindex="${P(this.isDisabled?void 0:"0")}"
|
||||
>
|
||||
<slot hidden @slotchange=${this.assignDisplayedLabel}></slot>
|
||||
${this.displayedLabel}
|
||||
</div>
|
||||
`}assignDisplayedLabel(){if(this.textContent){this.displayedLabel=this.textContent;return}this.getAttribute("label")&&(this.displayedLabel=this.getAttribute("label")||"")}fireOnReadyCallback(){this.onReady&&this.onReady(this.getOption(),this.optionIndex)}fireOnSelectCallback(e){e.stopPropagation(),!(!this.onSelect||this.isDisabled)&&this.onSelect(this.optionValue)}fireOnSelectIfEnterPressed(e){e.key===b.ENTER&&this.fireOnSelectCallback(e)}};u([f()],p.prototype,"isSelected",void 0);u([f()],p.prototype,"isDisabled",void 0);u([f()],p.prototype,"isHidden",void 0);u([f()],p.prototype,"optionValue",void 0);u([f()],p.prototype,"displayedLabel",void 0);u([f()],p.prototype,"optionIndex",void 0);u([a],p.prototype,"getOption",null);u([a],p.prototype,"select",null);u([a],p.prototype,"unselect",null);u([a],p.prototype,"fireOnReadyCallback",null);p=u([D("option-pure")],p);import{LitElement as A,html as m}from"lit";import{ifDefined as w}from"lit-html/directives/if-defined.js";import{customElement as R}from"lit/decorators/custom-element.js";import{property as c}from"lit/decorators/property.js";import{query as z}from"lit/decorators/query.js";var l=function(n,e,t,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var h=n.length-1;h>=0;h--)(d=n[h])&&(s=(r<3?d(s):r>3?d(e,t,s):d(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s},o=class extends A{constructor(){super(...arguments),this.options=[],this.visible=!1,this.selectedOption=O,this._selectedOptions=[],this.disabled=!1,this.isMultipleSelect=!1,this.name="",this._id="",this.formName="",this.value="",this.values=[],this.defaultLabel="",this.totalRenderedChildOptions=-1,this.form=null,this.hiddenInput=null}static get styles(){return x}connectedCallback(){super.connectedCallback(),this.disabled=this.getAttribute("disabled")!==null,this.isMultipleSelect=this.getAttribute("multiple")!==null,this.name=this.getAttribute("name")||"",this._id=this.getAttribute("id")||"",this.formName=this.name||this.id,this.defaultLabel=this.getAttribute("default-label")||""}open(){this.disabled||(this.visible=!0,this.removeEventListeners(),document.body.addEventListener("click",this.close,!0))}close(e){e&&this.contains(e.target)||(this.visible=!1,this.removeEventListeners())}enable(){this.disabled=!1}disable(){this.disabled=!0}get selectedIndex(){var e;return(e=this.nativeSelect)===null||e===void 0?void 0:e.selectedIndex}set selectedIndex(e){!e&&e!==0||this.selectOptionByValue(this.options[e].value)}get selectedOptions(){var e;return(e=this.nativeSelect)===null||e===void 0?void 0:e.selectedOptions}render(){let e=["label"];return this.disabled&&e.push("disabled"),this.visible&&e.push("visible"),m`
|
||||
<div class="select-wrapper">
|
||||
<select
|
||||
@change=${this.handleNativeSelectChange}
|
||||
?disabled=${this.disabled}
|
||||
?multiple=${this.isMultipleSelect}
|
||||
name="${w(this.name||void 0)}"
|
||||
id=${w(this.id||void 0)}
|
||||
size="1"
|
||||
>
|
||||
${this.getNativeOptionsHtml()}
|
||||
</select>
|
||||
<div class="select">
|
||||
<div
|
||||
class="${e.join(" ")}"
|
||||
@click="${this.visible?this.close:this.open}"
|
||||
@keydown="${this.openDropdownIfProperKeyIsPressed}"
|
||||
tabindex="0"
|
||||
>
|
||||
${this.getDisplayedLabel()}
|
||||
</div>
|
||||
<div class="dropdown${this.visible?" visible":""}">
|
||||
<slot @slotchange=${this.initializeSelect}></slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`}handleNativeSelectChange(){var e;this.selectedIndex=(e=this.nativeSelect)===null||e===void 0?void 0:e.selectedIndex}getNativeOptionsHtml(){return this.options.map(this.getSingleNativeOptionHtml)}getSingleNativeOptionHtml({value:e,label:t,hidden:i,disabled:r}){return m`
|
||||
<option
|
||||
value=${e}
|
||||
?selected=${this.isOptionSelected(e)}
|
||||
?hidden=${i}
|
||||
?disabled=${r}
|
||||
>
|
||||
${t}
|
||||
</option>
|
||||
`}isOptionSelected(e){let t=this.selectedOption.value===e;return this.isMultipleSelect&&(t=!!this._selectedOptions.find(i=>i.value===e)),t}openDropdownIfProperKeyIsPressed(e){(e.key===b.ENTER||e.key===b.TAB)&&this.open()}getDisplayedLabel(){return this.isMultipleSelect&&this._selectedOptions.length?this.getMultiSelectLabelHtml():this.selectedOption.label||this.defaultLabel}getMultiSelectLabelHtml(){return m`
|
||||
<div class="multi-selected-wrapper">
|
||||
${this._selectedOptions.map(this.getMultiSelectSelectedOptionHtml)}
|
||||
</div>
|
||||
`}getMultiSelectSelectedOptionHtml({label:e,value:t}){return m`
|
||||
<span class="multi-selected">
|
||||
${e}
|
||||
<span
|
||||
class="cross"
|
||||
@click=${i=>this.fireOnSelectCallback(i,t)}
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
`}fireOnSelectCallback(e,t){e.stopPropagation(),this.selectOptionByValue(t)}initializeSelect(){this.processChildOptions(),this.selectDefaultOptionIfNoneSelected(),this.appendHiddenInputToClosestForm()}processChildOptions(){let e=this.querySelectorAll("option-pure");this.totalRenderedChildOptions=e.length;for(let t=0;t<e.length;t++)this.initializeSingleOption(e[t],t)}selectDefaultOptionIfNoneSelected(){!this.selectedOption.value&&!this.isMultipleSelect&&this.options.length&&this.selectOptionByValue(this.options[0].value)}initializeSingleOption(e,t){e.setOnSelectCallback(this.selectOptionByValue),this.options[t]=e.getOption(),this.options[t].selected&&this.selectOptionByValue(this.options[t].value)}removeEventListeners(){document.body.removeEventListener("click",this.close)}appendHiddenInputToClosestForm(){this.form=this.closest("form"),!(!this.form||this.hiddenInput)&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.setAttribute("type","hidden"),this.hiddenInput.setAttribute("name",this.formName),this.form.appendChild(this.hiddenInput))}unselectAllOptions(){for(let e=0;e<this.options.length;e++)this.options[e].unselect()}selectOptionByValue(e){let t=this.options.find(({value:i})=>i===e);t&&this.setSelectValue(t)}setSelectValue(e){this.isMultipleSelect?this.setMultiSelectValue(e):this.setSingleSelectValue(e),this.updateHiddenInputInForm(),this.dispatchChangeEvent()}dispatchChangeEvent(){this.dispatchEvent(new Event("change"))}setMultiSelectValue(e){let t=this._selectedOptions.indexOf(e);t!==-1?(this.values.splice(t,1),this._selectedOptions.splice(t,1),e.unselect()):(this.values.push(e.value),this._selectedOptions.push(e),e.select()),this.requestUpdate()}setSingleSelectValue(e){this.unselectAllOptions(),this.close(),this.selectedOption=e,this.value=e.value,e.select()}updateHiddenInputInForm(){if(!this.form||!this.hiddenInput)return;this.hiddenInput.value=this.isMultipleSelect?this.values.join(","):this.value;let e=new Event("change",{bubbles:!0});this.hiddenInput.dispatchEvent(e)}};l([c()],o.prototype,"options",void 0);l([c()],o.prototype,"visible",void 0);l([c()],o.prototype,"selectedOption",void 0);l([c()],o.prototype,"_selectedOptions",void 0);l([c()],o.prototype,"disabled",void 0);l([c()],o.prototype,"isMultipleSelect",void 0);l([c()],o.prototype,"name",void 0);l([c()],o.prototype,"_id",void 0);l([c()],o.prototype,"formName",void 0);l([c()],o.prototype,"value",void 0);l([c()],o.prototype,"values",void 0);l([c()],o.prototype,"defaultLabel",void 0);l([c()],o.prototype,"totalRenderedChildOptions",void 0);l([z("select")],o.prototype,"nativeSelect",void 0);l([a],o.prototype,"close",null);l([a],o.prototype,"getSingleNativeOptionHtml",null);l([a],o.prototype,"getMultiSelectLabelHtml",null);l([a],o.prototype,"getMultiSelectSelectedOptionHtml",null);l([a],o.prototype,"initializeSelect",null);l([a],o.prototype,"initializeSingleOption",null);l([a],o.prototype,"removeEventListeners",null);l([a],o.prototype,"appendHiddenInputToClosestForm",null);l([a],o.prototype,"selectOptionByValue",null);o=l([R("select-pure")],o);var xe=g;export{xe as default};
|
||||
@@ -0,0 +1,3 @@
|
||||
const y="\u037C",m=typeof Symbol>"u"?"__"+y:Symbol.for(y),S=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class C{constructor(e,n){this.rules=[];let{finish:i}=n||{};function s(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function l(t,h,a,T){let f=[],r=/^@(\w+)\b/.exec(t[0]),c=r&&r[1]=="keyframes";if(r&&h==null)return a.push(t[0]+";");for(let u in h){let o=h[u];if(/&/.test(u))l(u.split(/,\s*/).map(d=>t.map(p=>d.replace(/&/,p))).reduce((d,p)=>d.concat(p)),o,a);else if(o&&typeof o=="object"){if(!r)throw new RangeError("The value of a property ("+u+") should be a primitive value.");l(s(u),o,f,c)}else o!=null&&f.push(u.replace(/_.*/,"").replace(/[A-Z]/g,d=>"-"+d.toLowerCase())+": "+o+";")}(f.length||c)&&a.push((i&&!r&&!T?t.map(i):t).join(", ")+" {"+f.join(" ")+"}")}for(let t in e)l(s(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
||||
`)}static newName(){let e=g[m]||1;return g[m]=e+1,y+e.toString(36)}static mount(e,n,i){let s=e[S],l=i&&i.nonce;s?l&&s.setNonce(l):s=new A(e,l),s.mount(Array.isArray(n)?n:[n])}}let w=new Map;class A{constructor(e,n){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let l=w.get(i);if(l)return e.adoptedStyleSheets=[l.sheet,...e.adoptedStyleSheets],e[S]=l;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],w.set(i,this)}else{this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);let l=e.head||e;l.insertBefore(this.styleTag,l.firstChild)}this.modules=[],e[S]=this}mount(e){let n=this.sheet,i=0,s=0;for(let l=0;l<e.length;l++){let t=e[l],h=this.modules.indexOf(t);if(h<s&&h>-1&&(this.modules.splice(h,1),s--,h=-1),h==-1){if(this.modules.splice(s++,0,t),n)for(let a=0;a<t.rules.length;a++)n.insertRule(t.rules[a],i++)}else{for(;s<h;)i+=this.modules[s++].rules.length;i+=t.rules.length,s++}}if(!n){let l="";for(let t=0;t<this.modules.length;t++)l+=this.modules[t].getRules()+`
|
||||
`;this.styleTag.textContent=l}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}export{C as StyleModule};
|
||||
@@ -0,0 +1 @@
|
||||
var t={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};for(var n=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),y=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),g=typeof navigator<"u"&&/Mac/.test(navigator.platform),d=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c=g||n&&+n[1]<57,r=0;r<10;r++)t[48+r]=t[96+r]=String(r);for(var r=1;r<=24;r++)t[r+111]="F"+r;for(var r=65;r<=90;r++)t[r]=String.fromCharCode(r+32),a[r]=String.fromCharCode(r);for(var i in t)a.hasOwnProperty(i)||(a[i]=t[i]);function p(o){var f=c&&(o.ctrlKey||o.altKey||o.metaKey)||d&&o.shiftKey&&o.key&&o.key.length==1||o.key=="Unidentified",e=!f&&o.key||(o.shiftKey?a:t)[o.keyCode]||o.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}export{t as base,p as keyName,a as shift};
|
||||
Reference in New Issue
Block a user