@yongdall/theme 0.3.2 → 0.4.0
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.
- package/hooks.mjs +2 -2
- package/hooks.mjs.map +1 -1
- package/index.mjs +25 -25
- package/index.mjs.map +1 -1
- package/package.json +3 -3
- package/theme-allSider.css +8 -9
- package/theme-allSider.css.map +1 -1
- package/theme-base.css +24 -14
- package/theme-base.css.map +1 -1
- package/theme-tabs.css +30 -17
- package/theme-tabs.css.map +1 -1
package/hooks.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ArrayStore as e,ObjectStore as t,Pagination as n,Search as r,createComputed as i,createQuickFilters as a,createShowField as o,createState as s,effect as c,findConfigurator as l,getPatternFields as u,getPermissionFields as d,getPrimaryFields as f,importStyle as p,importWidget as m,loadOptions as h,modelService as g,permissionsService as _,runPattern as v,showFilterDialog as y,toId as ee,waitAbortSignal as te,watch as ne}from"@yongdall/web";import{Check as re,Source as ie}from"@neeloong/table";function b(e){let t=document.createElement(`div`),n=t;return n.style.overflow=`hidden`,n.style.whiteSpace=`nowrap`,n.style.textOverflow=`ellipsis`,e.listen(`scrollIntoView`,()=>t.scrollIntoView()),[t,e=>{n.title=n.innerText=e??``}]}function x(e,t,n,r,i){let a=e.editable,o=e.field?.nullable?null:i,[s,l]=(a?t:n)(e,t=>{o=r(t,e.field?.nullable),e.value=o});function u(e,t){!t&&e===o||(o=e,l(e))}return u(e.value,!0),c(()=>u(e.value),e.signal),s}function ae(e){let t=document.createElement(`div`),n=t;return e.listen(`scrollIntoView`,()=>t.scrollIntoView()),[t,e=>{n.innerText=e??``}]}function oe(e,t){return e||!t?e:null}function se(e,t){let n=document.createElement(`textarea`);return n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var ce=e=>x(e,se,ae,oe,``);function le(e,t){let n=parseFloat(e);return Number.isFinite(n)?n:t?null:0}function S(e,t){let n=document.createElement(`input`);return n.type=`number`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var C=e=>x(e,S,b,le,0);function w(e,t){let n=parseInt(e);return Number.isFinite(n)?n:t?null:0}function T(e,t){let n=document.createElement(`input`);return n.type=`number`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var E=e=>x(e,T,b,w,0);function ue(e,t){if(!e)return t?null:0n;try{return BigInt(e)}catch{}return t?null:0n}function D(e,t){let n=document.createElement(`input`);return n.type=`number`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var de=e=>x(e,D,b,ue,0n);function fe(e,t){return e||!t?e:null}function O(e,t){let n=document.createElement(`input`);return n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var k=e=>x(e,O,b,fe,``),pe=e=>{let t=document.createElement(`input`);t.type=`checkbox`;let n=e.editable,r=e.field?.nullable?null:!1;n?(t.addEventListener(`input`,()=>{r=!!t.checked,e.value=r}),t.addEventListener(`change`,t=>e.emit(`change`,t)),t.addEventListener(`focus`,t=>e.emit(`focus`,t)),t.addEventListener(`blur`,t=>e.emit(`blur`,t))):t.disabled=!0,c(()=>t.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>t.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>t.focus()),e.listen(`scrollIntoView`,()=>t.scrollIntoView());function i(n){let i=!e.field?.nullable||typeof n==`boolean`?!!n:null;i!==r&&(r=i,t.checked=!!i)}return c(()=>i(e.value),e.signal),t};function me(e,t){return Number.isFinite(new Date(e).valueOf())?e:t?null:``}function A(e,t){let n=document.createElement(`input`);return n.type=`date`,n.step=`1`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var j=e=>x(e,A,b,me,``);function M(e,t){let n=new Date(e);return Number.isFinite(n)?e:t?null:``}function he(e,t){let n=document.createElement(`input`);return n.type=`time`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var N=e=>x(e,he,b,M,``);function ge(e,t){let n=new Date(e);return Number.isFinite(n.valueOf())?n:null}function P(e,t){return e.valueOf()?`${[`${e.getFullYear()}`.padStart(4,`0`),`${e.getMonth()+1}`.padStart(2,`0`),`${e.getDate()}`.padStart(2,`0`)].join(`-`)}${t}${[`${e.getHours()}`.padStart(2,`0`),`${e.getMinutes()}`.padStart(2,`0`),`${e.getSeconds()}`.padStart(2,`0`)].join(`:`)}`:``}function F(e,t=`T`){return e instanceof Date?P(e,t):P(new Date(e),t)??``}function I(e){let t=document.createElement(`div`),n=t;return n.style.overflow=`hidden`,n.style.whiteSpace=`nowrap`,n.style.textOverflow=`ellipsis`,e.listen(`scrollIntoView`,()=>t.scrollIntoView()),[t,e=>{n.title=n.innerText=F(e,` `)}]}function L(e,t){let n=document.createElement(`input`);return n.type=`datetime-local`,n.step=`1`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=F(e)}]}var R=e=>x(e,L,I,ge,null);function _e(e,t){return e||!t?e:null}function z(e,t){let n=document.createElement(`input`);return n.type=`password`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var ve=e=>x(e,z,b,_e,``);function ye(e,t){return e||!t?e:null}function B(e,t){let n=document.createElement(`input`);return n.type=`url`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var be=e=>x(e,B,b,ye,``);function xe(e,t){return e||!t?e:null}function Se(e,t){let n=document.createElement(`input`);return n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var Ce=e=>x(e,Se,b,xe,``);p(`@neeloong/table/style.css`);async function we(t,l,p,m,h,g){let _=te(m,!0),b=await Promise.race([p.loadScript(),_]);if(!b)return Promise.reject();let x=g?.fields,ae=g?.queryFilters||[];function oe(n){let r=t?.parent;if(!r||(r instanceof e&&(r=r.parent),!r))return null;let i=r,a=0;for(;n[a]===`?`;){a++;let t=i.parent;if(!t||(t instanceof e&&(t=t.parent),!t))break;i=t}for(;n[a]===`?`;)a++;let o=n.slice(a),s=i.child(o);return s?s.value:null}let se=r.parse(g?.filter),ce=i(()=>r.fill(se.where,oe)),le=i(()=>r.fill(se.orWhere,oe)),S=s([]),C=s(100),w=s(1),T=s([]),E=l.appendChild(document.createElement(`div`)),ue=E.appendChild(document.createElement(`div`)),D=E.appendChild(document.createElement(`div`)),de=l.appendChild(document.createElement(`div`)),fe=l.appendChild(document.createElement(`div`)),O=new ie({idKey:`_`,parentKey:`parent`});O.selectable=!0;let k=b.fields,pe=d(`options`,b.permissions||[],b),me=Object.entries(k).filter(([,{type:e}])=>e&&typeof e!=`object`).filter(([e])=>pe.has(e)),A=f(b),j=b.labelPattern||``,M=[];for(let{field:e,width:t,label:n}of x||[]){if(!e||!Object.hasOwn(k,e))continue;let r=k[e];if(!r)continue;let i=r.type;!i||typeof i!=`string`||M.push({name:e,width:t||void 0,title:n||r.label||``,field:r})}if(!M.length){for(let[e,t]of me)if(M.push({name:e,title:t.label||``,field:t}),M.length>=4)break}let he=[...new Set([...M.map(e=>e.name),...A,...u(j)])];c(()=>O.setValue(T.get()),m);let N=M.map(({name:e,field:t,title:n,width:r})=>({field:e,title:n,width:r,resizable:!0,render(n){let r=document.createElement(`div`),i=o(e,t,{},n.data);return r.appendChild(i.root),{root:r,destroy(){i.destroy()},setHidden(){},update(n){i.destroy(),r.innerHTML=``,i=o(e,t,{},n.data),r.appendChild(i.root)}}}}));N.unshift({field:`_`,width:200,resizable:!0,render(e){let t=e.data,n=document.createElement(`div`),r=v(j,t)||A.map(e=>t[e]).join(`$`);return n.appendChild(document.createTextNode(r)),{root:n,destroy(){},setHidden(){},update(e){let t=e.data,r=v(j,t)||A.map(e=>t[e]).join(`$`);n.innerHTML=``,n.appendChild(document.createTextNode(r))}}}}),h&&N.unshift({field:`_`,extensions:[re],render(e){return{root:document.createElement(`div`),destroy(){},setHidden(){},update(){}}}});let ge=O.createGroup(N,2),P=document.createElement(`table`);ge.createHeader(P.appendChild(document.createElement(`div`))),ge.createBody(P.appendChild(document.createElement(`div`)));let F=new n;ne(()=>C.get(),e=>F.size=e||100,{immediate:!0,signal:m}),ne(()=>w.get(),e=>F.page=e||1,{immediate:!0,signal:m}),F.listen(()=>{w.set(F.page),C.set(F.size)});let I=0,L=s(!1);async function R(){if(!m.aborted&&!L.get())try{L.set(!0),I++;let e=I,{options:t,total:n}=await p.options({limit:C.get(),page:w.get(),where:[...S.get()||[],...ce.get()||[]],or:le.get(),select:he,total:!0});if(m.aborted||e!==I)return;T.set(t.map(e=>({...e,_:ee(e,A)}))),F.total=n}finally{L.set(!1)}}function _e(){b&&y(b,S.get(),l).then(e=>{S.set(e)}).catch(()=>{})}function z(e,t,n){let r=document.createElement(`button`);r.appendChild(document.createTextNode(e));let a=i(()=>!!n?.get());return c(()=>{r.disabled=a.get()},m),r.addEventListener(`click`,e=>{a.get()||e.defaultPrevented||t()}),r}let{promise:ve,reject:ye,resolve:B}=Promise.withResolvers();return D.appendChild(z(`刷新`,R,L)),D.appendChild(z(`过滤`,_e)),D.appendChild(z(`确定`,()=>{let e=[];if(h){if(e=O.checked,!e.length)return B([])}else{let t=O.selectedId;if(!t)return B(null);e=[t]}if(!e.length){B(h?[]:null);return}let t=T.get(),n=Object.fromEntries(t.map(e=>[e._,e])),r=[...new Set(e.map(e=>n[e]).filter(Boolean))].map(e=>({value:e._,label:v(j,e)||e._}));B(h?r:r[0])})),D.appendChild(z(`取消`,()=>{ye()})),ue.classList.add(`QueryFilters`),a({get(){return S.get()||[]},set(e){S.set(e),R()}},ue,ae||[],{fields:b.fields,signal:m,inline:!0}),de.appendChild(P),fe.appendChild(F.root),ne([()=>S.get(),()=>C.get(),()=>w.get()],R,{signal:m,immediate:!0}),Promise.race([ve,_]).finally(()=>{E.remove(),de.remove(),fe.remove()})}var Te=(e,t)=>{let n=e.editable,r=e.store||null,i=g(e.field?.model||``),a=document.createElement(`div`);a.classList=`InputDocument`;let o=a.appendChild(document.createElement(`div`)),l=o.appendChild(document.createElement(`div`)),d=o.appendChild(document.createElement(`div`));l.classList=`InputDocument-placeholder`,e.listen(`scrollIntoView`,()=>o.scrollIntoView()),e.listen(`focus`,()=>o.focus());let f=null,p=null,m=s(),h=null;return c(()=>l.innerText=e.placeholder,e.signal),c(()=>{let e=m.get()||``;d.innerText=e,l.hidden=!!e},e.signal),c(async()=>{let t=e.value,n=t==``||t==null?null:t;if(f===n)return;f=n;let r=e.current[`${e.name}~label`];if(r){p=null,f=null,m.set(r);return}if(p=f,m.set(f||``),!f)return;let a=await i;if(!a)return;let o=a.labelPattern||``;if(!u(o).length)return;let{option:s}=await i.option(f);!s||f!==p||m.set(v(o,s)||f)},e.signal),n?(o.classList=`InputDocument-text`,c(()=>{e.readonly||e.disabled?(o.removeAttribute(`tabIndex`),h?.abort(),h=null,o.setAttribute(`disabled`,``)):(o.tabIndex=0,o.removeAttribute(`disabled`))},e.signal),o.addEventListener(`click`,async()=>{if(e.readonly||e.disabled)return;h?.abort(),h=new AbortController,e.emit(`focus`,null);let n=a.appendChild(document.createElement(`dialog`));n.showModal();try{let a=await we(r,n,i,AbortSignal.any([h.signal,e.signal]),!1,t),o=Array.isArray(a)?a[0]:a;if(!o){if(!e.value)return;(e.clearable||e.nullable)&&(f=``,p=null,e.value=e.nullable?null:``,m.set(``),e.emit(`change`,null));return}let s=o.value;if(s===e.value)return;f=s,e.value=s,p=null,m.set(o.label||s),e.emit(`change`,null)}finally{n.remove(),e.emit(`blur`,null)}}),a):a};function Ee(e){return i(()=>{let t=[...e.get()],n=Object.create(null);for(let e;e=t.shift();){let r=e.children;n[e.value]=e.label;for(let e of r)t.push(e)}return n})}function De(e){return i(()=>{let t=e.get().map(e=>[0,e]),n=[];for(let e;e=t.shift();){let[r,i]=e;n.push({...i,level:r});for(let e of i.children)t.push([r+1,e])}return n})}function Oe(e){return i(()=>{let t=[...e.get()],n=Object.create(null);for(let e;e=t.shift();){let r=e.children;n[e.value]=e.data;for(let e of r)t.push(e)}return n})}function*ke(e,n){if(!e||!n||typeof n==`object`)return;let r=e.parent;if(r instanceof t)for(let[e,t]of Object.entries(n)){let n=r.child(e);n&&typeof t==`string`&&(yield e=>n.value=e[t])}}var Ae=(t,n={})=>{let r=t.editable,a=t.store;if(!r){let e=document.createElement(`span`),r=s(``);t.listen(`focus`,()=>e.focus()),t.listen(`scrollIntoView`,()=>e.scrollIntoView());let i=Ee(h(n,!1));function a(){let t=r.get();t===``?e.innerText=``:e.innerText=i.get()[t]??``}function o(e){let t=e??``;t!==r&&r.set(t)}return c(()=>o(t.value),t.signal),c(a,t.signal),e}function o(n){let r=t.store?.parent;if(!r||(r instanceof e&&(r=r.parent),!r))return null;let i=r,a=0;for(;n[a]===`?`;){a++;let t=i.parent;if(!t||(t instanceof e&&(t=t.parent),!t))break;i=t}for(;n[a]===`?`;)a++;let o=n.slice(a),s=i.child(o);return s?s.value:null}let l=h(n,o),u=Oe(l),d=document.createElement(`select`),f=[...ke(a,n.bind)];d.addEventListener(`change`,()=>{let e=d.value||null;if(t.value=e,!e||!f.length)return;let n=u.get(),r=Object.hasOwn(n,e)&&n[e];if(!(!r||typeof r!=`object`))for(let e of f)e(r)}),d.addEventListener(`change`,e=>t.emit(`change`,e)),d.addEventListener(`focus`,e=>t.emit(`focus`,e)),d.addEventListener(`blur`,e=>t.emit(`blur`,e)),t.listen(`focus`,()=>d.focus()),t.listen(`scrollIntoView`,()=>d.scrollIntoView()),c(()=>d.disabled=!!(t.readonly||t.disabled),t.signal);let p=De(l),m=i(()=>{let e=p.get();return t.clearable?[{value:``,label:t.field?.label??``,disabled:!1,level:0},...e]:e});c(()=>{d.innerHTML=``;for(let{value:e,label:t,disabled:n,level:r}of m.get()){let i=document.createElement(`option`);i.value=`${e}`,i.label=`${Array(r).fill(` `).join(``)}${t}`,n&&(i.disabled=n),d.appendChild(i)}d.value=t.value||``},t.signal);function g(e){d.value=(e==``||e==null?null:e)||``}return c(()=>g(t.value),t.signal),d};const je=HTMLElement.prototype.hasOwnProperty(`popover`);function Me(e){let t=e;for(;t;){let e=t.getRootNode();if(!e)return!1;if(e===document)return document.activeElement===t;if(!(e instanceof ShadowRoot)||e.activeElement!==t)return!1;let n=e.host;if(!n)return!1;t=n}}var Ne=class extends HTMLElement{#e=null;#t=null;#n=null;#r=this.attachShadow({mode:`closed`});#i=this.#r.appendChild(document.createElement(`style`));#a=this.#r.appendChild(document.createElement(`input`));#o=this.#r.appendChild(document.createElement(`div`));#s=this.#o.appendChild(document.createElement(`div`));constructor(){super(),this.#i.textContent=`:host {
|
|
1
|
+
import{ArrayStore as e,BindObjectStore as t,Pagination as n,Search as r,createComputed as i,createQuickFilters as a,createShowField as o,createState as s,effect as c,getPatternFields as l,getPermissionFields as u,getPrimaryFields as d,importStyle as f,importWidget as p,modelService as m,permissionsService as h,renderForm as g,runPattern as _,showFilterDialog as v,toId as y,waitAbortSignal as ee,watch as te}from"@yongdall/web";import{Check as ne,Source as re}from"@neeloong/table";function b(e){let t=document.createElement(`div`),n=t;return n.style.overflow=`hidden`,n.style.whiteSpace=`nowrap`,n.style.textOverflow=`ellipsis`,e.listen(`scrollIntoView`,()=>t.scrollIntoView()),[t,e=>{n.title=n.innerText=e??``}]}function x(e,t,n,r,i){let a=e.editable,o=e.field?.nullable?null:i,[s,l]=(a?t:n)(e,t=>{o=r(t,e.field?.nullable),e.value=o});function u(e,t){!t&&e===o||(o=e,l(e))}return u(e.value,!0),c(()=>u(e.value),e.signal),s}function ie(e){let t=document.createElement(`div`),n=t;return e.listen(`scrollIntoView`,()=>t.scrollIntoView()),[t,e=>{n.innerText=e??``}]}function ae(e,t){return e||!t?e:null}function oe(e,t){let n=document.createElement(`textarea`);return n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var se=e=>x(e,oe,ie,ae,``);function ce(e,t){let n=parseFloat(e);return Number.isFinite(n)?n:t?null:0}function le(e,t){let n=document.createElement(`input`);return n.type=`number`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var S=e=>x(e,le,b,ce,0);function C(e,t){let n=parseInt(e);return Number.isFinite(n)?n:t?null:0}function w(e,t){let n=document.createElement(`input`);return n.type=`number`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var T=e=>x(e,w,b,C,0);function ue(e,t){if(!e)return t?null:0n;try{return BigInt(e)}catch{}return t?null:0n}function de(e,t){let n=document.createElement(`input`);return n.type=`number`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var E=e=>x(e,de,b,ue,0n);function fe(e,t){return e||!t?e:null}function pe(e,t){let n=document.createElement(`input`);return n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var D=e=>x(e,pe,b,fe,``),O=e=>{let t=document.createElement(`input`);t.type=`checkbox`;let n=e.editable,r=e.field?.nullable?null:!1;n?(t.addEventListener(`input`,()=>{r=!!t.checked,e.value=r}),t.addEventListener(`change`,t=>e.emit(`change`,t)),t.addEventListener(`focus`,t=>e.emit(`focus`,t)),t.addEventListener(`blur`,t=>e.emit(`blur`,t))):t.disabled=!0,c(()=>t.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>t.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>t.focus()),e.listen(`scrollIntoView`,()=>t.scrollIntoView());function i(n){let i=!e.field?.nullable||typeof n==`boolean`?!!n:null;i!==r&&(r=i,t.checked=!!i)}return c(()=>i(e.value),e.signal),t};function me(e,t){return Number.isFinite(new Date(e).valueOf())?e:t?null:``}function he(e,t){let n=document.createElement(`input`);return n.type=`date`,n.step=`1`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var k=e=>x(e,he,b,me,``);function A(e,t){let n=new Date(e);return Number.isFinite(n)?e:t?null:``}function j(e,t){let n=document.createElement(`input`);return n.type=`time`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var ge=e=>x(e,j,b,A,``);function M(e,t){let n=new Date(e);return Number.isFinite(n.valueOf())?n:null}function N(e,t){return e.valueOf()?`${[`${e.getFullYear()}`.padStart(4,`0`),`${e.getMonth()+1}`.padStart(2,`0`),`${e.getDate()}`.padStart(2,`0`)].join(`-`)}${t}${[`${e.getHours()}`.padStart(2,`0`),`${e.getMinutes()}`.padStart(2,`0`),`${e.getSeconds()}`.padStart(2,`0`)].join(`:`)}`:``}function P(e,t=`T`){return e instanceof Date?N(e,t):N(new Date(e),t)??``}function F(e){let t=document.createElement(`div`),n=t;return n.style.overflow=`hidden`,n.style.whiteSpace=`nowrap`,n.style.textOverflow=`ellipsis`,e.listen(`scrollIntoView`,()=>t.scrollIntoView()),[t,e=>{n.title=n.innerText=P(e,` `)}]}function I(e,t){let n=document.createElement(`input`);return n.type=`datetime-local`,n.step=`1`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=P(e)}]}var L=e=>x(e,I,F,M,null);function R(e,t){return e||!t?e:null}function _e(e,t){let n=document.createElement(`input`);return n.type=`password`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var z=e=>x(e,_e,b,R,``);function ve(e,t){return e||!t?e:null}function ye(e,t){let n=document.createElement(`input`);return n.type=`url`,n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var B=e=>x(e,ye,b,ve,``);function be(e,t){return e||!t?e:null}function xe(e,t){let n=document.createElement(`input`);return n.addEventListener(`input`,()=>t(n.value)),n.addEventListener(`input`,t=>e.emit(`input`,t)),n.addEventListener(`change`,t=>e.emit(`change`,t)),n.addEventListener(`focus`,t=>e.emit(`focus`,t)),n.addEventListener(`blur`,t=>e.emit(`blur`,t)),c(()=>n.disabled=!!(e.readonly||e.disabled),e.signal),c(()=>n.placeholder=e.placeholder,e.signal),e.listen(`focus`,()=>n.focus()),e.listen(`scrollIntoView`,()=>n.scrollIntoView()),[n,e=>{n.value=e??``}]}var Se=e=>x(e,xe,b,be,``);f(`@neeloong/table/style.css`);async function Ce(t,f,p,m,h,g){let b=ee(m,!0),x=await Promise.race([p.loadScript(),b]);if(!x)return Promise.reject();let ie=g?.fields,ae=g?.queryFilters||[];function oe(n){let r=t?.parent;if(!r||(r instanceof e&&(r=r.parent),!r))return null;let i=r,a=0;for(;n[a]===`?`;){a++;let t=i.parent;if(!t||(t instanceof e&&(t=t.parent),!t))break;i=t}for(;n[a]===`?`;)a++;let o=n.slice(a),s=i.child(o);return s?s.value:null}let se=r.parse(g?.search||``),ce=i(()=>r.fill(se.where,oe)),le=i(()=>r.fill(se.orWhere,oe)),S=s([]),C=s(100),w=s(1),T=s([]),ue=f.appendChild(document.createElement(`div`)),de=ue.appendChild(document.createElement(`div`)),E=ue.appendChild(document.createElement(`div`)),fe=f.appendChild(document.createElement(`div`)),pe=f.appendChild(document.createElement(`div`)),D=new re({idKey:`_`,parentKey:`parent`});D.selectable=!0;let O=x.fields,me=u(`options`,x.permissions||[],x),he=Object.entries(O).filter(([,{type:e}])=>e&&typeof e!=`object`).filter(([e])=>me.has(e)),k=d(x),A=x.labelPattern||``,j=[];for(let{field:e,width:t,label:n}of ie||[]){if(!e||!Object.hasOwn(O,e))continue;let r=O[e];if(!r)continue;let i=r.type;!i||typeof i!=`string`||j.push({name:e,width:t||void 0,title:n||r.label||``,field:r})}if(!j.length){for(let[e,t]of he)if(j.push({name:e,title:t.label||``,field:t}),j.length>=4)break}let ge=[...new Set([...j.map(e=>e.name),...k,...l(A)])];c(()=>D.setValue(T.get()),m);let M=j.map(({name:e,field:t,title:n,width:r})=>({field:e,title:n,width:r,resizable:!0,render(n){let r=document.createElement(`div`),i=o(e,t,{},n.data);return r.appendChild(i.root),{root:r,destroy(){i.destroy()},setHidden(){},update(n){i.destroy(),r.innerHTML=``,i=o(e,t,{},n.data),r.appendChild(i.root)}}}}));M.unshift({field:`_`,width:200,resizable:!0,render(e){let t=e.data,n=document.createElement(`div`),r=_(A,t)||k.map(e=>t[e]).join(`$`);return n.appendChild(document.createTextNode(r)),{root:n,destroy(){},setHidden(){},update(e){let t=e.data,r=_(A,t)||k.map(e=>t[e]).join(`$`);n.innerHTML=``,n.appendChild(document.createTextNode(r))}}}}),h&&M.unshift({field:`_`,extensions:[ne],render(e){return{root:document.createElement(`div`),destroy(){},setHidden(){},update(){}}}});let N=D.createGroup(M,2),P=document.createElement(`table`);N.createHeader(P.appendChild(document.createElement(`div`))),N.createBody(P.appendChild(document.createElement(`div`)));let F=new n;te(()=>C.get(),e=>F.size=e||100,{immediate:!0,signal:m}),te(()=>w.get(),e=>F.page=e||1,{immediate:!0,signal:m}),F.listen(()=>{w.set(F.page),C.set(F.size)});let I=0,L=s(!1);async function R(){if(!m.aborted&&!L.get())try{L.set(!0),I++;let e=I,{options:t,total:n}=await p.options({limit:C.get(),page:w.get(),where:[...S.get()||[],...ce.get()||[]],or:le.get(),select:ge,total:!0});if(m.aborted||e!==I)return;T.set(t.map(e=>({...e,_:y(e,k)}))),F.total=n}finally{L.set(!1)}}function _e(){x&&v(x,S.get(),f).then(e=>{S.set(e)}).catch(()=>{})}function z(e,t,n){let r=document.createElement(`button`);r.appendChild(document.createTextNode(e));let a=i(()=>!!n?.get());return c(()=>{r.disabled=a.get()},m),r.addEventListener(`click`,e=>{a.get()||e.defaultPrevented||t()}),r}let{promise:ve,reject:ye,resolve:B}=Promise.withResolvers();return E.appendChild(z(`刷新`,R,L)),E.appendChild(z(`过滤`,_e)),E.appendChild(z(`确定`,()=>{let e=[];if(h){if(e=D.checked,!e.length)return B([])}else{let t=D.selectedId;if(!t)return B(null);e=[t]}if(!e.length){B(h?[]:null);return}let t=T.get(),n=Object.fromEntries(t.map(e=>[e._,e])),r=[...new Set(e.map(e=>n[e]).filter(Boolean))].map(e=>({value:e._,label:_(A,e)||e._,data:e}));B(h?r:r[0])})),E.appendChild(z(`取消`,()=>{ye()})),de.classList.add(`QueryFilters`),a({get(){return S.get()||[]},set(e){S.set(e),R()}},de,ae||[],{fields:x.fields,signal:m,inline:!0}),fe.appendChild(P),pe.appendChild(F.root),te([()=>S.get(),()=>C.get(),()=>w.get()],R,{signal:m,immediate:!0}),Promise.race([ve,b]).finally(()=>{ue.remove(),fe.remove(),pe.remove()})}var we=e=>{let t=e.editable,n=e.store||null,r=m(e.field?.model||``),i=document.createElement(`div`);i.classList=`InputDocument`;let a=i.appendChild(document.createElement(`div`)),o=a.appendChild(document.createElement(`div`)),u=a.appendChild(document.createElement(`div`));o.classList=`InputDocument-placeholder`,e.listen(`scrollIntoView`,()=>a.scrollIntoView()),e.listen(`focus`,()=>a.focus());let d=null,f=null,p=s(),h=null;return c(()=>o.innerText=e.placeholder,e.signal),c(()=>{let e=p.get()||``;u.innerText=e,o.hidden=!!e},e.signal),c(async()=>{let t=e.value,n=t==``||t==null?null:t;if(d===n)return;d=n;let i=e.current[`${e.name}~label`];if(i){f=null,d=null,p.set(i);return}if(f=d,p.set(d||``),!d)return;let a=await r;if(!a)return;let o=a.labelPattern||``;if(!l(o).length)return;let{option:s}=await r.option(d);!s||d!==f||p.set(_(o,s)||d)},e.signal),t?(a.classList=`InputDocument-text`,c(()=>{e.readonly||e.disabled?(a.removeAttribute(`tabIndex`),h?.abort(),h=null,a.setAttribute(`disabled`,``)):(a.tabIndex=0,a.removeAttribute(`disabled`))},e.signal),a.addEventListener(`click`,async()=>{if(e.readonly||e.disabled)return;h?.abort(),h=new AbortController,e.emit(`focus`,null);let t=i.appendChild(document.createElement(`dialog`));t.showModal();try{let i=await Ce(n,t,r,AbortSignal.any([h.signal,e.signal]),!1,e.source),a=Array.isArray(i)?i[0]:i;if(!a){if(!e.value)return;(e.clearable||e.nullable)&&(d=``,f=null,e.value=e.nullable?null:``,p.set(``),e.emit(`change`,null));return}let o=a.value;if(o===e.value)return;d=o,e.value=o,f=null,p.set(a.label||o),e.emit(`change`,o),e.bind?.(a.data)}finally{t.remove(),e.emit(`blur`,null)}}),i):i};function Te(e,t){return e.length===t.length?e.findIndex((e,n)=>e!=t[n])===-1:!1}var Ee=e=>{let t=e.editable,n=e.store||null,r=m(e.field?.model||``),i=document.createElement(`div`);i.classList=`InputDocument`;let a=i.appendChild(document.createElement(`div`)),o=a.appendChild(document.createElement(`div`)),u=a.appendChild(document.createElement(`div`));o.classList=`InputDocument-placeholder`,e.listen(`scrollIntoView`,()=>a.scrollIntoView()),e.listen(`focus`,()=>a.focus());let f=[],p=[],h=s([]),g=null;return c(()=>o.innerText=e.placeholder,e.signal),c(()=>{let e=h.get();u.innerHTML=``;for(let t of e){let e=u.appendChild(document.createElement(`span`));e.innerText=t,e.classList=`InputDocument-Item`}o.hidden=!!e.length},e.signal),c(async()=>{let t=e.value,n=(Array.isArray(t)?t:[t]).map(e=>typeof e==`string`||typeof e==`number`?String(e):``).filter(Boolean);if(Te(f,n))return;f=n;let i=e.current[`${e.name}~label`];if(i){p=[],f=[],h.set(i);return}if(p=f,h.set(f),!f.length)return;let a=await r;if(!a)return;let o=a.labelPattern||``;if(!l(o).length)return;let{options:s}=await r.options({primary:f,limit:f.length*10});if(!s.length||f!==p)return;let c=d(a),u=Object.fromEntries(s.map(e=>[y(e,c),e]));f.map(e=>{let t=Object.hasOwn(u,e)&&u[e];return t&&_(o,t)||e}),h.set(f.map(e=>{let t=Object.hasOwn(u,e)&&u[e];return t&&_(o,t)||e}))},e.signal),t?(a.classList=`InputDocument-text`,c(()=>{e.readonly||e.disabled?(a.removeAttribute(`tabIndex`),g?.abort(),g=null,a.setAttribute(`disabled`,``)):(a.tabIndex=0,a.removeAttribute(`disabled`))},e.signal),a.addEventListener(`click`,async()=>{if(e.readonly||e.disabled)return;g?.abort(),g=new AbortController,e.emit(`focus`,null);let t=i.appendChild(document.createElement(`dialog`));t.showModal();try{let i=await Ce(n,t,r,AbortSignal.any([g.signal,e.signal]),!0,e.source),a=Array.isArray(i)?i:i?[i]:[];if(!a.length){if(!e.value?.length)return;e.clearable||e.nullable?(f=[],p=[],e.value=e.nullable?null:[],h.set([]),e.emit(`change`,null)):e.value=[];return}let o=a.map(e=>e.value);if(Te(o,e.value))return;f=o,e.value=o,p=[],h.set(a.map(e=>e.label||e.value)),e.emit(`change`,null)}finally{t.remove(),e.emit(`blur`,null)}}),i):i},De=e=>{if(!e.editable){let t=document.createElement(`span`),n=s(``);e.listen(`focus`,()=>t.focus()),e.listen(`scrollIntoView`,()=>t.scrollIntoView());function r(){let r=n.get();r===``?t.innerText=``:t.innerText=e.source.labels[r]??r}function i(e){let t=e??``;t!==n&&n.set(t)}return c(()=>i(e.value),e.signal),c(r,e.signal),t}let t=document.createElement(`select`);t.addEventListener(`change`,()=>{let n=t.value||null;if(e.value=n,!n)return;let r=e.source.map;e.bind?.(Object.hasOwn(r,n)&&r[n])}),t.addEventListener(`change`,t=>e.emit(`change`,t)),t.addEventListener(`focus`,t=>e.emit(`focus`,t)),t.addEventListener(`blur`,t=>e.emit(`blur`,t)),e.listen(`focus`,()=>t.focus()),e.listen(`scrollIntoView`,()=>t.scrollIntoView()),c(()=>t.disabled=!!(e.readonly||e.disabled),e.signal);let n=i(()=>{let t=e.source.levelTree;return e.clearable?[{value:``,label:e.field?.label??``,disabled:!1,level:0},...t]:t});c(()=>{t.innerHTML=``;for(let{value:e,label:r,disabled:i,level:a}of n.get()){let n=document.createElement(`option`);n.value=`${e}`,n.label=`${Array(a).fill(` `).join(``)}${r}`,i&&(n.disabled=i),t.appendChild(n)}t.value=e.value||``},e.signal);function r(e){t.value=(e==``||e==null?null:e)||``}return c(()=>r(e.value),e.signal),t};const Oe=HTMLElement.prototype.hasOwnProperty(`popover`);function ke(e){let t=e;for(;t;){let e=t.getRootNode();if(!e)return!1;if(e===document)return document.activeElement===t;if(!(e instanceof ShadowRoot)||e.activeElement!==t)return!1;let n=e.host;if(!n)return!1;t=n}}var Ae=class extends HTMLElement{#e=null;#t=null;#n=null;#r=this.attachShadow({mode:`closed`});#i=this.#r.appendChild(document.createElement(`style`));#a=this.#r.appendChild(document.createElement(`input`));#o=this.#r.appendChild(document.createElement(`div`));#s=this.#o.appendChild(document.createElement(`div`));constructor(){super(),this.#i.textContent=`:host {
|
|
2
2
|
display: contents;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -65,5 +65,5 @@ input {
|
|
|
65
65
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
`;let e=this.#a;e.type=`text`;let t=this.#o,n=this.#s;t.className=`dropdown`,n.className=`dropdown-list`,je&&t.setAttribute(`popover`,`manual`),e.addEventListener(`input`,()=>{this.#u()}),e.addEventListener(`focus`,()=>{this.#d()}),e.addEventListener(`blur`,()=>{let t=this.#e,n=e.value,r=this.required;if(!n){if(!t)return;if(r){e.value=t.label;return}this.#e=null,this.#t=null,this.#l();return}if(t?.label===n)return;let i=this.#c.find(e=>e.label===n);if(i){this.#e=i,this.#t=i.value,e.value=i.label,this.#l();return}if(!t){e.value=``;return}r?e.value=t.label:(e.value=``,this.#e=null,this.#t=null,this.#l())}),this.addEventListener(`keydown`,e=>{if(!this.#b)return;let t=this.#n;if(e.key===`ArrowDown`){if(e.preventDefault(),t?.parentNode!==n){let e=n.firstElementChild;if(!e){this.#n=null;return}this.#n=e,e.classList.add(`current`),e.scrollIntoView();return}let r=t.nextElementSibling;if(!r)return;t.classList.remove(`current`),this.#n=r,r.classList.add(`current`),r.scrollIntoView()}if(e.key===`ArrowUp`){if(e.preventDefault(),t?.parentNode!==n){let e=n.lastElementChild;if(!e){this.#n=null;return}this.#n=e,e.classList.add(`current`),e.scrollIntoView();return}let r=t.previousElementSibling;if(!r)return;t.classList.remove(`current`),this.#n=r,r.classList.add(`current`),r.scrollIntoView()}e.key===`Enter`&&(e.preventDefault(),t?.parentNode===n&&t.click())})}get options(){return this.#c}focus(){this.#a.focus()}set options(e){this.#c=e;let t=this.#o,n=this.#s;n.innerHTML=``;for(let t of e){let e=document.createElement(`div`);e.className=`option`,e.appendChild(document.createTextNode(`${Array(t.level||0).fill(` `).join(``)}${t.label}`||` `)),n.appendChild(e),e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.#f(t)}),e.addEventListener(`click`,e=>{e.preventDefault(),this.#f(t)}),e.addEventListener(`pointermove`,()=>{this.#n?.classList.remove(`current`),this.#n=e,e.classList.add(`current`)})}if(this.#n=n.firstElementChild,this.#n?.classList.add(`current`),t.scrollTop=0,t.scrollLeft=0,Me(this.#a)){if(this.#a.value===this.current?.label)return;this.open=!0;return}let r=this.#t,i=this.#c.find(e=>e.value===r);if(i){if(i===this.#e)return;this.#e=i,this.#t=i.value,this.#a.value=i.label||``}}get active(){return Me(this.#a)}#c=[];get current(){return this.#e}get value(){return this.#t}set value(e){if(e===this.#t)return;let t=this.#c.find(t=>t.value===e);if(!t){this.#e=null,this.#t=e,this.#a.value=e;return}t!==this.#e&&(this.#e=t,this.#t=t.value,this.#a.value=t.label||``)}#l(){this.dispatchEvent(new Event(`change`))}#u(){this.dispatchEvent(new Event(`input`))}#d(){this.open=!0,this.dispatchEvent(new Event(`focus`))}get text(){return this.#a.value}#f(e){this.#e=e,this.#t=e?.value,this.#a.value=e?.label||``,this.#l(),this.open=!1,this.#a.focus()}get open(){return this.getAttribute(`open`)!==null}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get readOnly(){return this.getAttribute(`readonly`)!==null}set readOnly(e){e?this.setAttribute(`readonly`,``):this.removeAttribute(`readonly`)}get required(){return this.getAttribute(`required`)!==null}set required(e){e?this.setAttribute(`required`,``):this.removeAttribute(`required`)}get placeholder(){return this.getAttribute(`placeholder`)||``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`)}#p(){let e=this.#a.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=t-e.right,i=n-e.bottom,{top:a,left:o,width:s,height:c}=e,l=this.#s.getBoundingClientRect(),u=l.width-2,d=l.height-2,f=this.#o;f.style.maxWidth=``,f.style.minWidth=``,f.style.top=`${a+c}px`,f.style.minWidth=`${s}px`,f.style.maxHeight=`${n-a-c-4}px`,u<=t-o?(f.style.left=`${o}px`,f.style.right=``):u<=t-o?(f.style.left=`${o}px`,f.style.right=`${t-o}px`):(f.style.left=`${Math.max(0,Math.min((u-s)/2,o))}px`,f.style.right=``);let p=0;d<=i-20?(p=1,f.style.top=`${a+c}px`,f.style.minWidth=`${s}px`,f.style.bottom=``):d<=a?(p=1,f.style.top=``,f.style.bottom=`${i+c}px`):Math.max(o,r-20)<Math.min(u,e.right-o)?i-20>=a?(p=1,f.style.top=`${a+c}px`,f.style.minWidth=`${s}px`,f.style.bottom=``):d<=a&&(p=1,f.style.top=``,f.style.bottom=`${i+c}px`):u<=r-20||o<=r-20?(f.style.left=`${o+s}px`,f.style.maxWidth=`${r}px`,f.style.right=``):(f.style.left=``,f.style.right=`${r+s}px`,f.style.maxWidth=`${o}px`),p?u<=t-o?(f.style.left=`${o}px`,f.style.right=``):u<=t-o?(f.style.left=`${o}px`,f.style.right=`${t-o}px`):(f.style.left=`${Math.max(0,Math.min((u-s)/2,o))}px`,f.style.right=``):d<=n-a?(f.style.top=`${a}px`,f.style.bottom=``):d<a+c?(f.style.top=``,f.style.bottom=`${n-a}px`):(f.style.top=`${Math.max(0,Math.min(n-d,a))}px`,f.style.bottom=`0`)}#m=!1;#h=null;#g(){if(je&&this.#o.showPopover(),this.#m)return;this.#m=!0;let e=this;this.#h=requestAnimationFrame(function t(){e.#p(),e.#m&&(e.#h=requestAnimationFrame(t))})}#_(){je&&this.#o.hidePopover(),this.#m&&(this.#m=!1,cancelAnimationFrame(this.#h))}#v=e=>{this.contains(e.target)||(this.open=!1)};#y=!1;connectedCallback(){document.addEventListener(`click`,this.#v),this.#y=!0,this.#x()}disconnectedCallback(){document.removeEventListener(`click`,this.#v),this.#y=!1,this.#x()}#b=!1;#x(){let e=!this.readOnly&&!this.disabled&&this.open&&this.#y;this.#b!==e&&(this.#b=e,e?this.#g():this.#_())}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`open`:if(!this.#y)return;this.#x();return;case`placeholder`:this.#a.placeholder=n||``;return;case`readonly`:this.#a.readOnly=n!==null,this.#x();return;case`disabled`:this.#a.disabled=n!==null,this.#x();return}}static observedAttributes=[`open`,`placeholder`,`readonly`,`disabled`]};try{customElements.define(`yongdall-select`,Ne)}catch{}var V=(e,t={})=>{let{inline:n,showLabel:r,quick:a}=e.style,o=document.createElement(n?`span`:`div`).appendChild(document.createElement(`label`)),s=o.appendChild(document.createElement(`yongdall-select`)),l=h(t),u=null;s.addEventListener(`change`,()=>{u=s.value||null,e.value=u});let d=null;function f(){d&&clearTimeout(d),d=setTimeout(()=>{},300)}s.addEventListener(`input`,f);let p=i(()=>{let e=[{value:``,label:``},...l.get()];return e.unshift({value:``,label:``}),e});return c(()=>{s.options=p.get()},e.signal),c(()=>{let t=e.value,n=t==``||t==null?null:t;n!==u&&(u=n,s.value=u||``)},e.signal),r?o.insertBefore(document.createTextNode(e.field?.label??``),o.firstChild):a&&(s.placeholder=e.field?.label??``),s},Pe=e=>{let t=document.createElement(`div`),n=t.appendChild(document.createElement(`div`)).appendChild(document.createElement(`label`)),r=n.appendChild(document.createElement(`input`));n.appendChild(document.createTextNode(`全选`)),n.classList.add(`align-center`),r.type=`checkbox`;let a=t.appendChild(document.createElement(`div`)),o=new Set,l=i(()=>new Set(_.get().flatMap(e=>e.children?.map(e=>e.value)||[])));function u(){l.get().size===o.size?(r.indeterminate=!1,r.checked=!0):o.size?r.indeterminate=!0:(r.indeterminate=!1,r.checked=!1)}function d(){o=new Set;for(let{checked:e,value:t}of a.querySelectorAll(`input`))!e||!t||o.add(t);e.value=[...o].map(e=>({permission:e})),u()}function f(){for(let e of a.querySelectorAll(`input`))e.checked=o.has(e.value)}function p(){f(),u()}let m=s([]);function h(){a.innerHTML=``;let e=[];for(let{label:t,children:n}of _.get()){if(!n?.length)continue;let r=a.appendChild(document.createElement(`details`));r.open=!0,r.appendChild(document.createElement(`summary`)).appendChild(document.createTextNode(t));for(let{value:t,label:i}of n){let n=r.appendChild(document.createElement(`label`)),a=n.appendChild(document.createElement(`input`));a.type=`checkbox`,n.appendChild(document.createTextNode(i)),n.classList.add(`align-center`),n.classList.add(`inline`),a.value=String(t||``),a.addEventListener(`input`,d),e.push(a)}}m.set(e),p()}c(()=>h(),e.signal),r.addEventListener(`input`,()=>{if(!r.checked){for(let e of a.querySelectorAll(`input`))e.checked=!1;e.value=[];return}let t=new Set;for(let e of a.querySelectorAll(`input`))e.checked=!0,t.add(e.value);e.value=[...t].map(e=>({permission:e})),f()}),r.addEventListener(`change`,t=>e.emit(`change`,t)),r.addEventListener(`focus`,t=>e.emit(`focus`,t)),r.addEventListener(`blur`,t=>e.emit(`blur`,t));let g=i(()=>!!(!e.editable||e.disabled));e.listen(`focus`,()=>r.focus()),e.listen(`scrollIntoView`,()=>r.scrollIntoView()),c(()=>r.hidden=!!e.hidden,e.signal),c(()=>{let e=g.get();n.hidden=e;for(let t of m.get())t.disabled=e},e.signal),c(()=>r.readOnly=!!e.readonly,e.signal);function v(e){let t=new Set(Array.isArray(e)&&e.map(e=>e.permission)||[]);if(t.size===o.size){for(let e of o)if(!t.has(e))break;return}o=t,p()}return c(()=>v(e.value),e.signal),t},Fe=(t,n={})=>{function r(n){let r=t.store?.parent;if(!r||(r instanceof e&&(r=r.parent),!r))return null;let i=r,a=0;for(;n[a]===`?`;){a++;let t=i.parent;if(!t||(t instanceof e&&(t=t.parent),!t))break;i=t}for(;n[a]===`?`;)a++;let o=n.slice(a),s=i.child(o);return s?s.value:null}let i=l(n,r),a=null,o=null;async function s(e){if(typeof e==`string`)return m(e);if(!e||typeof e!=`object`)return null;let{component:t,widget:n}=e;return typeof t==`string`&&t||typeof n==`string`&&n?m(e):null}let u=document.createElement(`div`);async function d(e){if(t.signal.aborted||e===a)return;a=e,o?.abort(),o=new AbortController;let n=AbortSignal.any([o.signal,t.signal]),r=await s(e);typeof r==`function`&&(n.aborted||r({root:u,get store(){return t.store},get style(){return t.style},get field(){return t.field},get name(){return t.name},get value(){return t.value},set value(e){t.value=e},get current(){return t.current},get destroyed(){return t.destroyed},get readonly(){return t.readonly},get editable(){return t.editable},get required(){return t.required},get nullable(){return t.nullable},get disabled(){return t.disabled},get clearable(){return t.clearable},get hidden(){return t.hidden},get label(){return t.label},get placeholder(){return t.placeholder},get description(){return t.description},get signal(){return n},listen(e,n){return t.listen(e,n)},emit(e,n){return t.emit(e,n)}},typeof e==`object`&&e||{}))}let f=null;return c(()=>{let e=i.get()||null;f!==null&&cancelIdleCallback(f),f=requestIdleCallback(()=>{f=null,d(e)})},t.signal),u};function H(e,t){let{inline:n,showLabel:r,quick:i}=t.style,a=document.createElement(n?`span`:`div`),o=t.field?.label??``;if(r){let e=a.appendChild(document.createElement(n?`span`:`div`));e.innerText=o}let s=e(n?a:a.appendChild(document.createElement(`div`)),i?o:``,e=>{t.value=e});return c(()=>s(t.value),t.signal),a}function Ie(e,t,n){let r=e.appendChild(document.createElement(`textarea`));return t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var U=H.bind(null,Ie);function Le(e,t){let n=parseFloat(e);return Number.isFinite(n)?n:t?0:null}function Re(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`number`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(Le(r.value))),e=>{r.value=e??``}}var W=H.bind(null,Re);function ze(e,t){let n=parseInt(e);return Number.isFinite(n)?n:t?0:null}function Be(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`number`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(ze(r.value))),e=>{r.value=e??``}}var G=H.bind(null,Be);function Ve(e,t){if(!e)return t?0n:null;try{return BigInt(e)}catch{}return t?0n:null}function He(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`number`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(Ve(r.value))),e=>{r.value=e??``}}var K=H.bind(null,He);function Ue(e,t,n){let r=e.appendChild(document.createElement(`input`));return t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var q=H.bind(null,Ue),We=e=>{let{inline:t,showLabel:n,quick:r}=e.style,i=document.createElement(t?`span`:`div`),a=i.appendChild(document.createElement(`label`)),o=a.appendChild(document.createElement(`input`));return o.type=`checkbox`,o.addEventListener(`input`,()=>{e.value=o.indeterminate?null:!!o.checked}),c(()=>{let t=e.value;if(typeof t==`boolean`){o.checked=t;return}if(t===`false`||t===`0`||t===0){o.checked=!1;return}if(t===`true`||t===`1`||t===1){o.checked=!0;return}o.indeterminate=!0,t!==null&&(e.value=null)},e.signal),n?a.insertBefore(document.createTextNode(e.field?.label??``),a.firstChild):r&&a.appendChild(document.createTextNode(e.field?.label??``)),i};function Ge(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`date`,r.step=`1`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var J=H.bind(null,Ge);function Ke(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`time`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var Y=H.bind(null,Ke);function qe(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`datetime-local`,r.step=`1`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var X=H.bind(null,qe);function Je(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`url`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var Ye=H.bind(null,Je);function Xe(e,t,n){let r=e.appendChild(document.createElement(`input`));return t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var Ze=H.bind(null,Xe),Qe=(e,t)=>{let{inline:n,showLabel:r,quick:i}=e.style,a=e.field?.model||``,o=document.createElement(n?`span`:`div`),l=o.appendChild(document.createElement(`label`));o.classList=`InputDocument`;let d=l.appendChild(document.createElement(`div`)),f=d.appendChild(document.createElement(`div`)),p=d.appendChild(document.createElement(`div`));f.classList=`InputDocument-placeholder`;let m=null,h=null,_=s(),y=null,ee=e.field?.label??``;if(f.innerText=i?ee:``,c(()=>{let e=_.get()||``;p.innerText=e,f.hidden=!!e},e.signal),c(async()=>{let t=e.value,n=t==``||t==null?null:t;if(m===n||(m=n,h=m,_.set(m||``),!m)||!a)return;let r=g(a),i=await r;if(!i)return;let o=i.labelPattern||``;if(!u(o).length)return;let{option:s}=await r.option(m);!s||m!==h||_.set(v(o,s)||m)},e.signal),r&&l.insertBefore(document.createTextNode(ee),l.firstChild),!a)return o;let te=g(a);return d.classList=`InputDocument-text`,d.tabIndex=0,d.addEventListener(`click`,async()=>{y?.abort(),y=new AbortController;let n=o.appendChild(document.createElement(`dialog`));n.showModal();try{let r=await we(null,n,te,AbortSignal.any([y.signal,e.signal]),!1,t),i=Array.isArray(r)?r[0]:r;if(!i){if(!e.value)return;m=``,h=null,e.value=null,_.set(``);return}let a=i.value;if(a===e.value)return;m=a,e.value=a,h=null,_.set(i.label||a)}finally{n.remove()}}),o};function $e(e){return i(()=>{let t=e.get().map(e=>[0,e]),n=[];for(let e;e=t.shift();){let[r,i]=e;n.push({...i,level:r});for(let e of i.children)t.push([r+1,e])}return n})}var Z=(e,t={})=>{let{inline:n,showLabel:r,quick:a}=e.style,o=document.createElement(n?`span`:`div`).appendChild(document.createElement(`label`)),s=o.appendChild(document.createElement(`select`)),l=h(t);s.addEventListener(`change`,()=>{e.value=s.value||null});let u=$e(l),d=i(()=>{let t=u.get();return[{value:``,label:a&&e.field?.label||``,disabled:!1,level:0},...t]});return c(()=>{s.innerHTML=``;for(let{value:e,label:t,disabled:n,level:r}of d.get()){let i=document.createElement(`option`);i.value=`${e}`,i.label=`${Array(r).fill(` `).join(``)}${t}`,n&&(i.disabled=n),s.appendChild(i)}s.value=e.value||``},e.signal),c(()=>{let t=e.value;s.value=(t==``||t==null?null:t)||``},e.signal),r&&o.insertBefore(document.createTextNode(e.field?.label??``),o.firstChild),s};function et(e){if(typeof e!=`string`)return!!e;switch(e.toLowerCase()){case``:case`0`:case`n`:case`f`:case`no`:case`off`:case`false`:return!1}return!0}function Q(e,t){if([e,t].filter(e=>(e??null)===null).length===1)return!1;let n=e??null,r=t??null;return Object.is(n,r)?!0:n===null||r===null?!1:typeof e==`boolean`||typeof t==`boolean`?et(e)===et(t):e==t}function tt(e,t){if(Array.isArray(t)){for(let n of e)if(Array.isArray(n)){if(n.length!==t.length)continue;if(t.findIndex((e,t)=>!Q(n[t],e))<0)return!0}else for(let e of t)if(Q(n,e))return!0}else for(let n of e)if(Q(n,t))return!0;return!1}function nt(e,t){if(Array.isArray(t))return null;let n=t??null,r=n===null?``:String(n);for(let t of e){let e=(Array.isArray(t)?t[0]:t)??null;if(!(e===null||e===``)&&r.includes(String(e)))return}return!1}function rt(e,t){if(Array.isArray(t)){for(let n of e)if(Array.isArray(n)&&n.length===t.length&&t.findIndex((e,t)=>!Q(n[t],e))<0)return!0}else for(let n of e)if(Array.isArray(n)&&n.length===t.length){for(let e of n)if(Q(e,t))return!0}return!1}function $(e,t,n){if(((Array.isArray(n)?n[0]:n)??null)===null)return null;for(let r of t){if(Array.isArray(r)||(r??null)===null)continue;let t=e(r,n);if(typeof t==`boolean`)return t}return!1}function it(e,t){return $((e,t)=>e>t,e,t)}function at(e,t){return $((e,t)=>e>=t,e,t)}function ot(e,t){return $((e,t)=>e<t,e,t)}function st(e,t){return $((e,t)=>e<=t,e,t)}const ct=[{not:`!=`,notLabel:`≠`,value:tt,filters:{gt:{value:it},ge:{value:at},lt:{value:ot},le:{value:st},in:{value:tt,not:`nin`},contains:{value:nt}}},{array:!0,not:`!=`,notLabel:`≠`,value:rt,filters:{in:{value:rt,not:`nin`}}},{type:`text`,input:ce,filter:U,notFilter:U,filters:{ne:{filter:U,label:`≠`},gt:{filter:U,label:`>`},ge:{filter:U,label:`≥`},lt:{filter:U,label:`<`},le:{filter:U,label:`≤`},contains:{filter:U,label:`包含`}}},{type:`string`,input:k,filter:q,notFilter:q,filters:{ne:{filter:q,label:`≠`},gt:{filter:q,label:`>`},ge:{filter:q,label:`≥`},lt:{filter:q,label:`<`},le:{filter:q,label:`≤`},contains:{filter:q,label:`包含`}}},{type:`bool`,input:pe,filter:We,notFilter:We,filters:{ne:{filter:We,label:`≠`}}},{type:`f32`,input:C,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`f64`,input:C,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`decimal`,input:C,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`numeric`,input:C,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`money`,input:C,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`i16`,input:E,filter:G,notFilter:G,filters:{ne:{filter:G,label:`≠`},gt:{filter:G,label:`>`},ge:{filter:G,label:`≥`},lt:{filter:G,label:`<`},le:{filter:G,label:`≤`}}},{type:`i32`,input:E,filter:G,notFilter:G,filters:{ne:{filter:G,label:`≠`},gt:{filter:G,label:`>`},ge:{filter:G,label:`≥`},lt:{filter:G,label:`<`},le:{filter:G,label:`≤`}}},{type:`i64`,input:de,filter:K,notFilter:K,filters:{ne:{filter:K,label:`≠`},gt:{filter:K,label:`>`},ge:{filter:K,label:`≥`},lt:{filter:K,label:`<`},le:{filter:K,label:`≤`}}},{type:`date`,input:j,filter:J,notFilter:J,filters:{ne:{filter:J,label:`≠`},gt:{filter:J,label:`>`},ge:{filter:J,label:`≥`},lt:{filter:J,label:`<`},le:{filter:J,label:`≤`}}},{type:`time`,input:N,filter:Y,notFilter:Y,filters:{ne:{filter:Y,label:`≠`},gt:{filter:Y,label:`>`},ge:{filter:Y,label:`≥`},lt:{filter:Y,label:`<`},le:{filter:Y,label:`≤`}}},{type:`uuid`,input:Ce,filter:Ze,notFilter:Ze,filters:{ne:{filter:Ze,label:`≠`}}},{type:`datetime`,input:R,filter:X,notFilter:X,filters:{ne:{filter:X,label:`≠`},gt:{filter:X,label:`>`},ge:{filter:X,label:`≥`},lt:{filter:X,label:`<`},le:{filter:X,label:`≤`}}},{type:`timetz`,input:N,filter:Y,notFilter:Y,filters:{ne:{filter:Y,label:`≠`},gt:{filter:Y,label:`>`},ge:{filter:Y,label:`≥`},lt:{filter:Y,label:`<`},le:{filter:Y,label:`≤`}}},{type:`timestamp`,input:R,filter:X,notFilter:X,filters:{ne:{filter:X,label:`≠`},gt:{filter:X,label:`>`},ge:{filter:X,label:`≥`},lt:{filter:X,label:`<`},le:{filter:X,label:`≤`}}},{renderer:`password`,input:ve,filter:q,notFilter:q,filters:{ne:{filter:q,label:`≠`}}},{renderer:`uri`,input:be,filter:Ye,notFilter:Ye,filters:{ne:{filter:Ye,label:`≠`}}},{renderer:`document`,input:Te,filter:Qe,notFilter:Qe,filters:{ne:{filter:Qe,label:`≠`}}},{renderer:`select`,input:Ae,filter:Z,notFilter:Z,filters:{ne:{filter:Z,label:`≠`}}},{renderer:`search`,input:V,filter:V,notFilter:V,filters:{ne:{filter:V,label:`≠`}}},{renderer:`configuration`,input:Fe},{type:`submodel`,array:!0,renderer:`permission`,input:Pe}],lt=[`style.css`];export{ct as formFields,lt as styles};
|
|
68
|
+
`;let e=this.#a;e.type=`text`;let t=this.#o,n=this.#s;t.className=`dropdown`,n.className=`dropdown-list`,Oe&&t.setAttribute(`popover`,`manual`),e.addEventListener(`input`,()=>{this.#u()}),e.addEventListener(`focus`,()=>{this.#d()}),e.addEventListener(`blur`,()=>{let t=this.#e,n=e.value,r=this.required;if(!n){if(!t)return;if(r){e.value=t.label;return}this.#e=null,this.#t=null,this.#l();return}if(t?.label===n)return;let i=this.#c.find(e=>e.label===n);if(i){this.#e=i,this.#t=i.value,e.value=i.label,this.#l();return}if(!t){e.value=``;return}r?e.value=t.label:(e.value=``,this.#e=null,this.#t=null,this.#l())}),this.addEventListener(`keydown`,e=>{if(!this.#b)return;let t=this.#n;if(e.key===`ArrowDown`){if(e.preventDefault(),t?.parentNode!==n){let e=n.firstElementChild;if(!e){this.#n=null;return}this.#n=e,e.classList.add(`current`),e.scrollIntoView();return}let r=t.nextElementSibling;if(!r)return;t.classList.remove(`current`),this.#n=r,r.classList.add(`current`),r.scrollIntoView()}if(e.key===`ArrowUp`){if(e.preventDefault(),t?.parentNode!==n){let e=n.lastElementChild;if(!e){this.#n=null;return}this.#n=e,e.classList.add(`current`),e.scrollIntoView();return}let r=t.previousElementSibling;if(!r)return;t.classList.remove(`current`),this.#n=r,r.classList.add(`current`),r.scrollIntoView()}e.key===`Enter`&&(e.preventDefault(),t?.parentNode===n&&t.click())})}get options(){return this.#c}focus(){this.#a.focus()}set options(e){this.#c=e;let t=this.#o,n=this.#s;n.innerHTML=``;for(let t of e){let e=document.createElement(`div`);e.className=`option`,e.appendChild(document.createTextNode(`${Array(t.level||0).fill(` `).join(``)}${t.label}`||` `)),n.appendChild(e),e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.#f(t)}),e.addEventListener(`click`,e=>{e.preventDefault(),this.#f(t)}),e.addEventListener(`pointermove`,()=>{this.#n?.classList.remove(`current`),this.#n=e,e.classList.add(`current`)})}if(this.#n=n.firstElementChild,this.#n?.classList.add(`current`),t.scrollTop=0,t.scrollLeft=0,ke(this.#a)){if(this.#a.value===this.current?.label)return;this.open=!0;return}let r=this.#t,i=this.#c.find(e=>e.value===r);if(i){if(i===this.#e)return;this.#e=i,this.#t=i.value,this.#a.value=i.label||``}}get active(){return ke(this.#a)}#c=[];get current(){return this.#e}get value(){return this.#t}set value(e){if(e===this.#t)return;let t=this.#c.find(t=>t.value===e);if(!t){this.#e=null,this.#t=e,this.#a.value=e;return}t!==this.#e&&(this.#e=t,this.#t=t.value,this.#a.value=t.label||``)}#l(){this.dispatchEvent(new Event(`change`))}#u(){this.dispatchEvent(new Event(`input`))}#d(){this.open=!0,this.dispatchEvent(new Event(`focus`))}get text(){return this.#a.value}#f(e){this.#e=e,this.#t=e?.value,this.#a.value=e?.label||``,this.#l(),this.open=!1,this.#a.focus()}get open(){return this.getAttribute(`open`)!==null}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get disabled(){return this.getAttribute(`disabled`)!==null}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get readOnly(){return this.getAttribute(`readonly`)!==null}set readOnly(e){e?this.setAttribute(`readonly`,``):this.removeAttribute(`readonly`)}get required(){return this.getAttribute(`required`)!==null}set required(e){e?this.setAttribute(`required`,``):this.removeAttribute(`required`)}get placeholder(){return this.getAttribute(`placeholder`)||``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`)}#p(){let e=this.#a.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=t-e.right,i=n-e.bottom,{top:a,left:o,width:s,height:c}=e,l=this.#s.getBoundingClientRect(),u=l.width-2,d=l.height-2,f=this.#o;f.style.maxWidth=``,f.style.minWidth=``,f.style.top=`${a+c}px`,f.style.minWidth=`${s}px`,f.style.maxHeight=`${n-a-c-4}px`,u<=t-o?(f.style.left=`${o}px`,f.style.right=``):u<=t-o?(f.style.left=`${o}px`,f.style.right=`${t-o}px`):(f.style.left=`${Math.max(0,Math.min((u-s)/2,o))}px`,f.style.right=``);let p=0;d<=i-20?(p=1,f.style.top=`${a+c}px`,f.style.minWidth=`${s}px`,f.style.bottom=``):d<=a?(p=1,f.style.top=``,f.style.bottom=`${i+c}px`):Math.max(o,r-20)<Math.min(u,e.right-o)?i-20>=a?(p=1,f.style.top=`${a+c}px`,f.style.minWidth=`${s}px`,f.style.bottom=``):d<=a&&(p=1,f.style.top=``,f.style.bottom=`${i+c}px`):u<=r-20||o<=r-20?(f.style.left=`${o+s}px`,f.style.maxWidth=`${r}px`,f.style.right=``):(f.style.left=``,f.style.right=`${r+s}px`,f.style.maxWidth=`${o}px`),p?u<=t-o?(f.style.left=`${o}px`,f.style.right=``):u<=t-o?(f.style.left=`${o}px`,f.style.right=`${t-o}px`):(f.style.left=`${Math.max(0,Math.min((u-s)/2,o))}px`,f.style.right=``):d<=n-a?(f.style.top=`${a}px`,f.style.bottom=``):d<a+c?(f.style.top=``,f.style.bottom=`${n-a}px`):(f.style.top=`${Math.max(0,Math.min(n-d,a))}px`,f.style.bottom=`0`)}#m=!1;#h=null;#g(){if(Oe&&this.#o.showPopover(),this.#m)return;this.#m=!0;let e=this;this.#h=requestAnimationFrame(function t(){e.#p(),e.#m&&(e.#h=requestAnimationFrame(t))})}#_(){Oe&&this.#o.hidePopover(),this.#m&&(this.#m=!1,cancelAnimationFrame(this.#h))}#v=e=>{this.contains(e.target)||(this.open=!1)};#y=!1;connectedCallback(){document.addEventListener(`click`,this.#v),this.#y=!0,this.#x()}disconnectedCallback(){document.removeEventListener(`click`,this.#v),this.#y=!1,this.#x()}#b=!1;#x(){let e=!this.readOnly&&!this.disabled&&this.open&&this.#y;this.#b!==e&&(this.#b=e,e?this.#g():this.#_())}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`open`:if(!this.#y)return;this.#x();return;case`placeholder`:this.#a.placeholder=n||``;return;case`readonly`:this.#a.readOnly=n!==null,this.#x();return;case`disabled`:this.#a.disabled=n!==null,this.#x();return}}static observedAttributes=[`open`,`placeholder`,`readonly`,`disabled`]};try{customElements.define(`yongdall-select`,Ae)}catch{}var V=e=>{let{inline:t,showLabel:n,quick:r}=e.style,a=document.createElement(t?`span`:`div`).appendChild(document.createElement(`label`)),o=a.appendChild(document.createElement(`yongdall-select`)),s=null;o.addEventListener(`change`,()=>{s=o.value||null,e.value=s});let l=null;function u(){l&&clearTimeout(l),l=setTimeout(()=>{},300)}o.addEventListener(`input`,u);let d=i(()=>{let t=[...e.source.options];return t.unshift({value:``,label:``}),t});return c(()=>{o.options=d.get()},e.signal),c(()=>{let t=e.value,n=t==``||t==null?null:t;n!==s&&(s=n,o.value=s||``)},e.signal),n?a.insertBefore(document.createTextNode(e.field?.label??``),a.firstChild):r&&(o.placeholder=e.field?.label??``),o},je=e=>{let t=document.createElement(`div`),n=t.appendChild(document.createElement(`div`)).appendChild(document.createElement(`label`)),r=n.appendChild(document.createElement(`input`));n.appendChild(document.createTextNode(`全选`)),n.classList.add(`align-center`),r.type=`checkbox`;let a=t.appendChild(document.createElement(`div`)),o=new Set,l=i(()=>new Set(h.get().flatMap(e=>e.children?.map(e=>e.value)||[])));function u(){l.get().size===o.size?(r.indeterminate=!1,r.checked=!0):o.size?r.indeterminate=!0:(r.indeterminate=!1,r.checked=!1)}function d(){o=new Set;for(let{checked:e,value:t}of a.querySelectorAll(`input`))!e||!t||o.add(t);e.value=[...o].map(e=>({permission:e})),u()}function f(){for(let e of a.querySelectorAll(`input`))e.checked=o.has(e.value)}function p(){f(),u()}let m=s([]);function g(){a.innerHTML=``;let e=[];for(let{label:t,children:n}of h.get()){if(!n?.length)continue;let r=a.appendChild(document.createElement(`details`));r.open=!0,r.appendChild(document.createElement(`summary`)).appendChild(document.createTextNode(t));for(let{value:t,label:i}of n){let n=r.appendChild(document.createElement(`label`)),a=n.appendChild(document.createElement(`input`));a.type=`checkbox`,n.appendChild(document.createTextNode(i)),n.classList.add(`align-center`),n.classList.add(`inline`),a.value=String(t||``),a.addEventListener(`input`,d),e.push(a)}}m.set(e),p()}c(()=>g(),e.signal),r.addEventListener(`input`,()=>{if(!r.checked){for(let e of a.querySelectorAll(`input`))e.checked=!1;e.value=[];return}let t=new Set;for(let e of a.querySelectorAll(`input`))e.checked=!0,t.add(e.value);e.value=[...t].map(e=>({permission:e})),f()}),r.addEventListener(`change`,t=>e.emit(`change`,t)),r.addEventListener(`focus`,t=>e.emit(`focus`,t)),r.addEventListener(`blur`,t=>e.emit(`blur`,t));let _=i(()=>!!(!e.editable||e.disabled));e.listen(`focus`,()=>r.focus()),e.listen(`scrollIntoView`,()=>r.scrollIntoView()),c(()=>r.hidden=!!e.hidden,e.signal),c(()=>{let e=_.get();n.hidden=e;for(let t of m.get())t.disabled=e},e.signal),c(()=>r.readOnly=!!e.readonly,e.signal);function v(e){let t=new Set(Array.isArray(e)&&e.map(e=>e.permission)||[]);if(t.size===o.size){for(let e of o)if(!t.has(e))break;return}o=t,p()}return c(()=>v(e.value),e.signal),t};function Me(e,n){return(r,i)=>{let{signal:a,editable:o,store:s}=r;if(!s||a.aborted)return;let c=new t(e,s,a),{enableLink:l,design:u}=r.style;r.root.style.inlineSize=`100%`,g(c,r.root,{enableLink:l,design:u,layout:n,editable:o,signal:a})}}async function Ne(e){if(typeof e==`string`)return p(e);if(!e||typeof e!=`object`)return null;let{widget:t,schema:n,layout:r}=e;return typeof t==`string`&&t?p(t):n&&typeof n==`object`?Me(n,r):null}var Pe=e=>{let t=null,n=null,r=document.createElement(`div`);async function i(i){if(e.signal.aborted||i===t)return;t=i,n?.abort(),n=new AbortController;let a=AbortSignal.any([n.signal,e.signal]),o=await Ne(i);typeof o==`function`&&(a.aborted||o({root:r,get store(){return e.store},get style(){return e.style},get field(){return e.field},get name(){return e.name},get value(){return e.value},set value(t){e.value=t},get current(){return e.current},get destroyed(){return e.destroyed},get readonly(){return e.readonly},get editable(){return e.editable},get required(){return e.required},get nullable(){return e.nullable},get disabled(){return e.disabled},get clearable(){return e.clearable},get hidden(){return e.hidden},get label(){return e.label},get placeholder(){return e.placeholder},get description(){return e.description},get source(){return e.source},get signal(){return a},listen(t,n){return e.listen(t,n)},emit(t,n){return e.emit(t,n)},get bind(){return e.bind}},typeof i==`object`&&i||{}))}let a=null;return c(()=>{let t=e.source.configurator||null;a!==null&&cancelIdleCallback(a),a=requestIdleCallback(()=>{a=null,i(t)})},e.signal),r};function H(e,t){let{inline:n,showLabel:r,quick:i}=t.style,a=document.createElement(n?`span`:`div`),o=t.field?.label??``;if(r){let e=a.appendChild(document.createElement(n?`span`:`div`));e.innerText=o}let s=e(n?a:a.appendChild(document.createElement(`div`)),i?o:``,e=>{t.value=e});return c(()=>s(t.value),t.signal),a}function Fe(e,t,n){let r=e.appendChild(document.createElement(`textarea`));return t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var U=H.bind(null,Fe);function Ie(e,t){let n=parseFloat(e);return Number.isFinite(n)?n:t?0:null}function Le(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`number`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(Ie(r.value))),e=>{r.value=e??``}}var W=H.bind(null,Le);function Re(e,t){let n=parseInt(e);return Number.isFinite(n)?n:t?0:null}function ze(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`number`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(Re(r.value))),e=>{r.value=e??``}}var G=H.bind(null,ze);function Be(e,t){if(!e)return t?0n:null;try{return BigInt(e)}catch{}return t?0n:null}function Ve(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`number`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(Be(r.value))),e=>{r.value=e??``}}var K=H.bind(null,Ve);function He(e,t,n){let r=e.appendChild(document.createElement(`input`));return t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var q=H.bind(null,He),Ue=e=>{let{inline:t,showLabel:n,quick:r}=e.style,i=document.createElement(t?`span`:`div`),a=i.appendChild(document.createElement(`label`)),o=a.appendChild(document.createElement(`input`));return o.type=`checkbox`,o.addEventListener(`input`,()=>{e.value=o.indeterminate?null:!!o.checked}),c(()=>{let t=e.value;if(typeof t==`boolean`){o.checked=t;return}if(t===`false`||t===`0`||t===0){o.checked=!1;return}if(t===`true`||t===`1`||t===1){o.checked=!0;return}o.indeterminate=!0,t!==null&&(e.value=null)},e.signal),n?a.insertBefore(document.createTextNode(e.field?.label??``),a.firstChild):r&&a.appendChild(document.createTextNode(e.field?.label??``)),i};function We(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`date`,r.step=`1`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var J=H.bind(null,We);function Ge(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`time`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var Y=H.bind(null,Ge);function Ke(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`datetime-local`,r.step=`1`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var X=H.bind(null,Ke);function qe(e,t,n){let r=e.appendChild(document.createElement(`input`));return r.type=`url`,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var Je=H.bind(null,qe);function Ye(e,t,n){let r=e.appendChild(document.createElement(`input`));return t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value||null)),e=>{r.value=e??``}}var Xe=H.bind(null,Ye),Z=e=>{let{inline:t,showLabel:n,quick:r}=e.style,i=e.field?.model||``,a=document.createElement(t?`span`:`div`),o=a.appendChild(document.createElement(`label`));a.classList=`InputDocument`;let u=o.appendChild(document.createElement(`div`)),d=u.appendChild(document.createElement(`div`)),f=u.appendChild(document.createElement(`div`));d.classList=`InputDocument-placeholder`;let p=null,h=null,g=s(),v=null,y=e.field?.label??``;if(d.innerText=r?y:``,c(()=>{let e=g.get()||``;f.innerText=e,d.hidden=!!e},e.signal),c(async()=>{let t=e.value,n=t==``||t==null?null:t;if(p===n||(p=n,h=p,g.set(p||``),!p)||!i)return;let r=m(i),a=await r;if(!a)return;let o=a.labelPattern||``;if(!l(o).length)return;let{option:s}=await r.option(p);!s||p!==h||g.set(_(o,s)||p)},e.signal),n&&o.insertBefore(document.createTextNode(y),o.firstChild),!i)return a;let ee=m(i);return u.classList=`InputDocument-text`,u.tabIndex=0,u.addEventListener(`click`,async()=>{v?.abort(),v=new AbortController;let t=a.appendChild(document.createElement(`dialog`));t.showModal();try{let n=await Ce(null,t,ee,AbortSignal.any([v.signal,e.signal]),!1,e.source),r=Array.isArray(n)?n[0]:n;if(!r){if(!e.value)return;p=``,h=null,e.value=null,g.set(``);return}let i=r.value;if(i===e.value)return;p=i,e.value=i,h=null,g.set(r.label||i)}finally{t.remove()}}),a},Ze=e=>{let{inline:t,showLabel:n,quick:r}=e.style,a=document.createElement(t?`span`:`div`).appendChild(document.createElement(`label`)),o=a.appendChild(document.createElement(`select`));o.addEventListener(`change`,()=>{e.value=o.value||null});let s=i(()=>{let t=e.source.levelTree;return[{value:``,label:r&&e.field?.label||``,disabled:!1,level:0},...t]});return c(()=>{o.innerHTML=``;for(let{value:e,label:t,disabled:n,level:r}of s.get()){let i=document.createElement(`option`);i.value=`${e}`,i.label=`${Array(r).fill(` `).join(``)}${t}`,n&&(i.disabled=n),o.appendChild(i)}o.value=e.value||``},e.signal),c(()=>{let t=e.value;o.value=(t==``||t==null?null:t)||``},e.signal),n&&a.insertBefore(document.createTextNode(e.field?.label??``),a.firstChild),o};function Qe(e){if(typeof e!=`string`)return!!e;switch(e.toLowerCase()){case``:case`0`:case`n`:case`f`:case`no`:case`off`:case`false`:return!1}return!0}function Q(e,t){if([e,t].filter(e=>(e??null)===null).length===1)return!1;let n=e??null,r=t??null;return Object.is(n,r)?!0:n===null||r===null?!1:typeof e==`boolean`||typeof t==`boolean`?Qe(e)===Qe(t):e==t}function $e(e,t){if(Array.isArray(t)){for(let n of e)if(Array.isArray(n)){if(n.length!==t.length)continue;if(t.findIndex((e,t)=>!Q(n[t],e))<0)return!0}else for(let e of t)if(Q(n,e))return!0}else for(let n of e)if(Q(n,t))return!0;return!1}function et(e,t){if(Array.isArray(t))return null;let n=t??null,r=n===null?``:String(n);for(let t of e){let e=(Array.isArray(t)?t[0]:t)??null;if(!(e===null||e===``)&&r.includes(String(e)))return}return!1}function tt(e,t){if(Array.isArray(t)){for(let n of e)if(Array.isArray(n)&&n.length===t.length&&t.findIndex((e,t)=>!Q(n[t],e))<0)return!0}else for(let n of e)if(Array.isArray(n)&&n.length===t.length){for(let e of n)if(Q(e,t))return!0}return!1}function $(e,t,n){if(((Array.isArray(n)?n[0]:n)??null)===null)return null;for(let r of t){if(Array.isArray(r)||(r??null)===null)continue;let t=e(r,n);if(typeof t==`boolean`)return t}return!1}function nt(e,t){return $((e,t)=>e>t,e,t)}function rt(e,t){return $((e,t)=>e>=t,e,t)}function it(e,t){return $((e,t)=>e<t,e,t)}function at(e,t){return $((e,t)=>e<=t,e,t)}const ot=[{not:`!=`,notLabel:`≠`,value:$e,filters:{gt:{value:nt},ge:{value:rt},lt:{value:it},le:{value:at},in:{value:$e,not:`nin`},contains:{value:et}}},{array:!0,not:`!=`,notLabel:`≠`,value:tt,filters:{in:{value:tt,not:`nin`}}},{type:`text`,input:se,filter:U,notFilter:U,filters:{ne:{filter:U,label:`≠`},gt:{filter:U,label:`>`},ge:{filter:U,label:`≥`},lt:{filter:U,label:`<`},le:{filter:U,label:`≤`},contains:{filter:U,label:`包含`}}},{type:`string`,input:D,filter:q,notFilter:q,filters:{ne:{filter:q,label:`≠`},gt:{filter:q,label:`>`},ge:{filter:q,label:`≥`},lt:{filter:q,label:`<`},le:{filter:q,label:`≤`},contains:{filter:q,label:`包含`}}},{type:`bool`,input:O,filter:Ue,notFilter:Ue,filters:{ne:{filter:Ue,label:`≠`}}},{type:`f32`,input:S,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`f64`,input:S,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`decimal`,input:S,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`numeric`,input:S,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`money`,input:S,filter:W,notFilter:W,filters:{ne:{filter:W,label:`≠`},gt:{filter:W,label:`>`},ge:{filter:W,label:`≥`},lt:{filter:W,label:`<`},le:{filter:W,label:`≤`}}},{type:`i16`,input:T,filter:G,notFilter:G,filters:{ne:{filter:G,label:`≠`},gt:{filter:G,label:`>`},ge:{filter:G,label:`≥`},lt:{filter:G,label:`<`},le:{filter:G,label:`≤`}}},{type:`i32`,input:T,filter:G,notFilter:G,filters:{ne:{filter:G,label:`≠`},gt:{filter:G,label:`>`},ge:{filter:G,label:`≥`},lt:{filter:G,label:`<`},le:{filter:G,label:`≤`}}},{type:`i64`,input:E,filter:K,notFilter:K,filters:{ne:{filter:K,label:`≠`},gt:{filter:K,label:`>`},ge:{filter:K,label:`≥`},lt:{filter:K,label:`<`},le:{filter:K,label:`≤`}}},{type:`date`,input:k,filter:J,notFilter:J,filters:{ne:{filter:J,label:`≠`},gt:{filter:J,label:`>`},ge:{filter:J,label:`≥`},lt:{filter:J,label:`<`},le:{filter:J,label:`≤`}}},{type:`time`,input:ge,filter:Y,notFilter:Y,filters:{ne:{filter:Y,label:`≠`},gt:{filter:Y,label:`>`},ge:{filter:Y,label:`≥`},lt:{filter:Y,label:`<`},le:{filter:Y,label:`≤`}}},{type:`uuid`,input:Se,filter:Xe,notFilter:Xe,filters:{ne:{filter:Xe,label:`≠`}}},{type:`datetime`,input:L,filter:X,notFilter:X,filters:{ne:{filter:X,label:`≠`},gt:{filter:X,label:`>`},ge:{filter:X,label:`≥`},lt:{filter:X,label:`<`},le:{filter:X,label:`≤`}}},{type:`timetz`,input:ge,filter:Y,notFilter:Y,filters:{ne:{filter:Y,label:`≠`},gt:{filter:Y,label:`>`},ge:{filter:Y,label:`≥`},lt:{filter:Y,label:`<`},le:{filter:Y,label:`≤`}}},{type:`timestamp`,input:L,filter:X,notFilter:X,filters:{ne:{filter:X,label:`≠`},gt:{filter:X,label:`>`},ge:{filter:X,label:`≥`},lt:{filter:X,label:`<`},le:{filter:X,label:`≤`}}},{renderer:`password`,input:z,filter:q,notFilter:q,filters:{ne:{filter:q,label:`≠`}}},{renderer:`uri`,input:B,filter:Je,notFilter:Je,filters:{ne:{filter:Je,label:`≠`}}},{renderer:`document`,input:we,filter:Z,notFilter:Z,filters:{ne:{filter:Z,label:`≠`}}},{array:!0,renderer:`document`,input:Ee,filter:Z,notFilter:Z,filters:{ne:{filter:Z,label:`≠`}}},{renderer:`select`,input:De,filter:Ze,notFilter:Ze,filters:{ne:{filter:Ze,label:`≠`}}},{renderer:`search`,input:V,filter:V,notFilter:V,filters:{ne:{filter:V,label:`≠`}}},{renderer:`configuration`,input:Pe},{type:`submodel`,array:!0,renderer:`permission`,input:je}],st=[`style.css`];export{ot as formFields,st as styles};
|
|
69
69
|
//# sourceMappingURL=hooks.mjs.map
|