@livenetworks/ashlar 2.1.12 → 2.1.13
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/README.md +25 -2
- package/components/COMPONENTS.md +82 -78
- package/components/ln-core/README.md +25 -69
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/reactive.js +0 -59
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/src/ln-filter.js +3 -1
- package/package.json +95 -85
- package/theme/README.md +73 -0
- package/theme/components/_table.scss +1 -2
- package/theme/config/_density.scss +104 -191
- package/theme/config/mixins/_avatar.scss +2 -2
- package/theme/config/mixins/_card.scss +2 -5
- package/theme/config/mixins/_form.scss +26 -39
- package/theme/config/mixins/_nav.scss +4 -4
- package/theme/config/mixins/_spacing.scss +4 -4
- package/theme/config/mixins/_table.scss +9 -33
- package/theme/tailwind/components.css +1661 -0
- package/theme/tailwind/entry.css +3 -0
- package/theme/tailwind/theme.css +23 -0
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function Y(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function j(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!j(o))return}e.apply(console,t)}}function R(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function Te(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function F(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function X(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function Re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Fe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let u=0;u<s.length;u++){const r=s[u];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let u=0;u<s.length;u++){const r=s[u];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&i[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);i[r.name]=r.value===""||isNaN(d)?null:d}else i[r.name]=r.value}return i}function Oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function De(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const u=l.getAttribute("data-ln-fill-as")||l.name;if(!u||!(u in t))continue;const r=t[u];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const d=String(r).split(",").map(function(m){return m.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=Oe(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<l.options.length;d++)l.options[d].selected=r.indexOf(l.options[d].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=De,window.lnCore.serializeForm=Fe,window.lnCore.resolveFormMethod=Re);const Z={};function Ne(e,t){Z[e]=t}function Be(e){return Z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ne,window.lnCore.getDataMapper=Be);function Me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){R(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const ee={};function $e(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];ee[n]=t}function je(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return ee[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=$e,window.lnCore.getLocaleFallback=je,window.lnCore.ensureLocaleObserver=Me);const P={};function Pe(e,t){P[e]||(P[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=P[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function te(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const u=n[l],r=u.getAttribute("data-ln-field");t[r]!=null&&(u.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const u=o[l],r=u.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const y=m[0].trim(),k=m[1].trim();t[k]!=null&&u.setAttribute(y,t[k])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const u=i[l],r=u.getAttribute("data-ln-show");r in t&&u.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const u=s[l],r=u.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const y=m[0].trim(),k=m[1].trim();k in t&&u.classList.toggle(y,!!t[k])}}return e}function He(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)te(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function ne(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],u=l.attributes;for(let r=0;r<u.length;r++){const d=u[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ve(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],m=d.getAttribute("data-ln-render-key");m&&(l[m]=d)}const u=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],m=String(o(d));let y=l[m];if(y)i(y,d,r);else{const k=Pe(n,s);if(!k||(ne(k,d),y=k.firstElementChild,!y))continue;y.setAttribute("data-ln-render-key",m),i(y,d,r)}u.appendChild(y)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=ne,window.lnCore.fill=te,window.lnCore.lnFill=He,window.lnCore.renderList=Ve);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function re(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function oe(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function ie(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const H=new Map;function le(e,t){const n=(e?e.join("|"):"")+"::"+t;if(H.has(n))return H.get(n);const o=new Set(e||[]),i=function(s,l){const u=s.getAttribute(l);return u!==null&&o.has(u)?u:t};return H.set(n,i),i}function se(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function ue(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ce(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(u(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(u(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return u(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=le(o.values,o.fallback);break;case"integer":i=re;break;case"float":i=se;break;case"boolean":i=oe;break;case"list":i=ie;break;case"json":i=ue;break;case"string":default:i=O;break}i||(i=O),t[o.prop]=[i,n,o.fallback]}return t}function Ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function We(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ae,window.lnCore.attrSpec=de,window.lnCore.attrStr=O,window.lnCore.attrInt=re,window.lnCore.attrBool=oe,window.lnCore.attrList=ie,window.lnCore.attrEnum=le,window.lnCore.attrFloat=se,window.lnCore.attrJson=ue);function D(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function fe(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&D(e,l),e.querySelectorAll){const u=e.querySelectorAll(s);for(let r=0;r<u.length;r++)D(u[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function I(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function he(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Qe(e){const t=he(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=We(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function we(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ge(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=he(),i=o.byAttr.get(t),s=Y()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&j(l)){const u=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<u.length;d++)ce(u[d].spec,r,t,u[d].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const u=o.byReactive.get(t);u&&we(u,l,t,e.oldValue),o.reactiveWildcard.length&&we(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let u=0;u<i.length;u++){const r=i[u];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(fe(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ge(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function U(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ge(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=V();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=U();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,u=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;u&&s.onSubtreeChange(u,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let u=0;u<t.length;u++){const r=t[u],d=r.query;if(d&&(s.matches&&s.matches(d)&&(r.ComponentFn&&D(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let y=0;y<m.length;y++)r.ComponentFn&&D(m[y],r),r.onInit&&r.onInit(m[y])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let u=0;u<t.length;u++){const r=t[u],d=r.query;if(d&&(s.matches&&s.matches(d)&&ge(s,r),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let y=0;y<m.length;y++)ge(m[y],r)}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ye(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ze(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{ye(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ye(e){V().push(e),e.onSubtreeChange&&e.query&&U().push(e),pe()}function be(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,u=i.onSubtreeChange||null,r=i.onInit||null,d=i.onAttrChange||null,m=i.effects||null,y=i.attributes||null,k=y?Ue(y):m,z=y?new Set(Object.keys(y)):null,L=i.persist||null;function v(x){const c=x||document.body;if(fe(c,e,t,n),y&&Y())for(const f in y){const a=y[f],h=Array.from(c.querySelectorAll("["+f+"]"));c.matches&&c.matches("["+f+"]")&&h.push(c);for(let g=0;g<h.length;g++){const w=h[g];j(w)&&ce(a,w.getAttribute(f),f,o,w)}}r&&r(c)}const q=[];if(e.indexOf("[")!==-1){const x=/\[([\w-]+)/g;let c;for(;(c=x.exec(e))!==null;)q.push(c[1])}else q.push(e);Qe({selector:e,attribute:t,componentTag:o,attributes:y,ComponentFn:n,onInit:r,observed:q.concat(s),onAttributeChange:l,onAttrChange:d,effects:k,declared:z,persist:L}),Je();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,E=i.subtreeQuery||(S?e:"["+e+"]"),B={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:u,query:E};V().push(B),u&&E&&U().push(B),pe(),window[t]=v,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=be,window.lnCore.observeLifecycle=Ye,window.lnCore.withoutLifecycle=ze);function M(){Ke()>0?I(function(){v(document.body)}):v(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M(),v}function me(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function Ce(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},o=Ce(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const u=l.indexOf(":"),r=u>-1?l.slice(0,u):l,d=u>-1?l.slice(u+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function K(e){if(!e)return null;const t=W();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Ce(location.hash)!==i&&(location.hash=i)}function Xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function N(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ze(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function et(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Q(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=W,window.lnCore.hashGet=K,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=Xe,window.lnCore.resolveHashNamespace=N,window.lnCore.hashSortEncode=Ze,window.lnCore.hashSortDecode=et,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Q);function tt(e){return(e||"").replace(/^\?/,"")}function nt(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=tt(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function G(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function ve(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function rt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ot(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Se(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function J(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=nt,window.lnCore.queryGet=G,window.lnCore.querySet=ve,window.lnCore.resolveQueryParam=ke,window.lnCore.querySortEncode=rt,window.lnCore.querySortDecode=ot,window.lnCore.queryFilterEncode=Se,window.lnCore.queryFilterDecode=J);function it(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=it);function Ee(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let o=0;o<t.length;o++)if(String(t[o]).trim().toLowerCase()===n)return!0;return!1}function lt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function st(e,t,n){if(!t||typeof t!="object")return!0;const o=Object.keys(t);if(o.length===0)return!0;for(let i=0;i<o.length;i++){const s=t[o[i]];let l="";if(s.col!==null&&s.col!==void 0?l=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(l=n.getAttribute(s.attr)||""),!Ee(l,s.values))return!1}return!0}function xe(e,t,n,o){if(o!=null&&!isNaN(o))return parseInt(o,10);if(t&&typeof t.getAttribute=="function"){const i=t.getAttribute("data-ln-filter-col");if(i!==null&&!isNaN(parseInt(i,10)))return parseInt(i,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const l=t.closest("[data-ln-popover], [id]");if(l&&l.id){const u=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(u&&typeof u.querySelector=="function"){const r=u.querySelector('[data-ln-popover-for="'+l.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const i=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let l=0;l<i.length;l++){const u=i[l],r=u.getAttribute("data-ln-table-filter-col")||u.getAttribute("data-ln-filter-col")||u.getAttribute("data-ln-filter-key")||u.getAttribute("data-ln-table-col")||u.getAttribute("data-ln-col")||u.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof u.cellIndex=="number"?u.cellIndex:l}if(t){const l=t.closest?t.closest("[data-ln-popover], [id]"):null,u=l&&l.id||t.id||null;if(u)for(let r=0;r<i.length;r++){const d=i[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+u+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let l=0;l<i.length;l++){const u=i[l],d=Array.from(u.childNodes||[]).filter(y=>y.nodeType===3),m=(d.length>0?d.map(y=>y.textContent.trim()).join(" "):u.textContent||"").trim().toLowerCase();if(m&&m===s)return typeof u.cellIndex=="number"?u.cellIndex:l}}return null}function ut(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let o=0;o<e.length;o++){const i=e[o];!t&&i.key&&(t=i.key),i.checked&&!i.isReset&&i.value&&n.push(i.value)}return{key:t,values:n}}function ct(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function qe(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",o="data-ln-filter-value",i="data-ln-filter-hide",s="data-ln-filter-reset",l="data-ln-filter-col",u="data-ln-hash",r="data-ln-query",d="data-ln-filter-values",m="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const k={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:x,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:x,description:"URL hash routing key for filter state persistence"},"data-ln-query":{type:"string",effect:x,description:"URL query parameter name for filter state synchronization"},"data-ln-filter-values":{type:"string",effect:x,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},z=de(k);function L(c){if(!c.hasAttribute(r))return null;const f=c.getAttribute(r);if(f&&f.trim()!=="")return f.trim();const a=c.getAttribute(l);if(a&&isNaN(parseInt(a,10)))return a.trim();const h=c.querySelector("["+n+"]");if(h){const g=h.getAttribute(n);if(g&&g.trim()!=="")return g.trim()}return ke(c,"filter")}function v(c){return c.hasAttribute(s)||!c.getAttribute(o)}function q(c){const f=c.dom.querySelectorAll("["+n+"]"),a=[];for(let g=0;g<f.length;g++){const w=f[g];a.push({key:w.getAttribute(n),value:w.getAttribute(o)||"",checked:w.checked,isReset:v(w)})}const h=ut(a);return{key:h.key,values:h.values,targetId:c.targetId}}function S(c,f,a){const h=c.querySelectorAll("["+n+"]"),g=Array.isArray(a)&&a.length>0;for(let w=0;w<h.length;w++){const p=h[w];v(p)?p.checked=!g:g&&p.getAttribute(n)===f&&a.indexOf(p.getAttribute(o))!==-1?p.checked=!0:p.checked=!1}}function E(c){this.dom=c,ae(this,c,z);const f=c.getAttribute(l);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=N(c,"filter"),this.hashEnabled=!!this.nsKey,this.queryParam=L(c),this.queryEnabled=!!this.queryParam;const a=this,h=me(function(){a._render()});this._queueRender=h;const g=me(function(){a._destroyed||a._applyDomFilter()});this._queueDomFilter=g;function w(){if(!a.targetId)return;const b=document.getElementById(a.targetId);b&&!b.hasAttribute(m)&&b.setAttribute(m,a.targetId)}this._ensureTargetMarked=w,w(),I(function(){a._destroyed||w()}),this._attachHandlers(),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const b=K(a.nsKey),C=Q(b);C&&C.key&&C.values.length>0?S(a.dom,C.key,C.values):S(a.dom,null,[]),a._render()},this._onPopState=function(){if(a._destroyed||!a.queryEnabled)return;const b=G(a.queryParam),C=J(b),_=a.dom.querySelector("["+n+"]"),A=_?_.getAttribute(n):a.queryParam;S(a.dom,A,C),a._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),this.queryEnabled&&window.addEventListener("popstate",this._onPopState);let p=!1;if(this.hashEnabled){const b=K(this.nsKey),C=Q(b);C&&C.key&&C.values.length>0&&(S(c,C.key,C.values),I(function(){a._destroyed||a._render()}),p=!0)}else if(this.queryEnabled){const b=G(this.queryParam),C=J(b);if(C.length>0){const _=c.querySelector("["+n+"]"),A=_?_.getAttribute(n):a.queryParam;S(c,A,C),I(function(){a._destroyed||a._render()}),p=!0}}if(!p){const b=qe(c.getAttribute(d));if(b.length>0){const C=c.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(c,_,b),I(function(){a._destroyed||a._render()}),p=!0)}}if(!p){const b=c.querySelectorAll("["+n+"]");for(let C=0;C<b.length;C++)if(b[C].checked&&!v(b[C])){I(function(){a._destroyed||a._render()});break}}return this}E.prototype._attachHandlers=function(){const c=this;this._onDomChange=function(f){const a=f.target;if(!a||!a.hasAttribute||!a.hasAttribute(n))return;const h=Array.from(c.dom.querySelectorAll("["+n+"]"));if(v(a)){for(let g=0;g<h.length;g++)v(h[g])||(h[g].checked=!1);a.checked=!0,c._queueRender();return}if(a.checked){for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!1);let g=!1;for(let w=0;w<h.length;w++)if(v(h[w])){g=!0;break}if(g){let w=!0;for(let p=0;p<h.length;p++)if(!v(h[p])&&!h[p].checked){w=!1;break}if(w)for(let p=0;p<h.length;p++)v(h[p])?h[p].checked=!0:h[p].checked=!1}}else{let g=!1;for(let w=0;w<h.length;w++)if(!v(h[w])&&h[w].checked){g=!0;break}if(!g)for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!0)}c._queueRender()},this.dom.addEventListener("change",this._onDomChange)},E.prototype._render=function(){const c=this,f=q(this),a=this._lastSnapshot;if(!(!a||a.key!==f.key||lt(a.values,f.values)))return;f.key===null||f.values.length;const g=document.getElementById(c.targetId),w={key:f.key,values:f.values.slice(),targetId:c.targetId};R(c.dom,"ln-filter:change",w);let p=!1;g&&g!==c.dom&&Te(g,"ln-filter:change",w).defaultPrevented&&(p=!0);const b=a&&a.values.length>0,C=f.values.length===0;if(b&&C){const A={targetId:c.targetId};R(c.dom,"ln-filter:reset",A),g&&g!==c.dom&&R(g,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=ct(f.values);if(_?this.dom.setAttribute(d,_):this.dom.removeAttribute(d),this.hashEnabled){const A=_e(f.key,f.values);Ae(this.nsKey,A)}else if(this.queryEnabled){const A=Se(f.values),T=this.queryParam||f.key;T&&ve(T,A)}p||c._applyDomFilter(g)},E.prototype._applyDomFilter=function(c){const f=c||document.getElementById(this.targetId);if(!f)return;const a=q(this),h=a.key===null||a.values.length===0,g=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(g)this._filterTableRows(a,g);else{const w=f.children;for(let p=0;p<w.length;p++){const b=w[p],C=h?null:b.getAttribute("data-"+a.key),_=!h&&C!==null&&!Ee(C,a.values),A=b.hasAttribute(i);_&&!A?b.setAttribute(i,"true"):!_&&A&&b.removeAttribute(i)}}};function B(c){if(!c)return"";const f=c.querySelector?c.querySelector("[data-ln-value]"):null;return X(f||c)}function M(c){return!!(!c||typeof c!="object"||c.tagName==="TEMPLATE"||typeof c.hasAttribute=="function"&&(c.hasAttribute("data-ln-sort-exclude")||c.hasAttribute("hidden"))||c.classList&&c.classList.contains("hidden")||c.style&&c.style.display==="none"||typeof c.matches=="function"&&c.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof c.querySelector=="function"&&c.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}E.prototype._filterTableRows=function(c,f){if(!f){const b=document.getElementById(this.targetId);if(!b||(f=b.tagName==="TABLE"?b:b.querySelector?b.querySelector("table"):null,!f))return}const a=xe(f,this.dom,c.key,this.colIndex),h=c.key||this.dom.getAttribute("data-ln-filter-key")||(a!==null?"col"+a:"attr-filter"),g=c.values;y.has(f)||y.set(f,{});const w=y.get(f);h&&g.length>0?w[h]={col:a,values:g.slice(),attr:"data-"+h}:h&&delete w[h];const p=f.tBodies;for(let b=0;b<p.length;b++){const C=p[b].rows;for(let _=0;_<C.length;_++){const A=C[_];if(M(A))continue;const T={};for(let $=0;$<A.cells.length;$++)T[$]=B(A.cells[$]);const Ie=!st(T,w,A),Le=A.hasAttribute(i);Ie&&!Le?A.setAttribute(i,"true"):!Ie&&Le&&A.removeAttribute(i)}}},E.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const c=document.getElementById(this.targetId);if(c){const f=c.tagName==="TABLE"?c:c.querySelector?c.querySelector("table"):null;if(f&&y.has(f)){const a=y.get(f),h=xe(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),g=this.dom.getAttribute("data-ln-filter-key")||(h!==null?"col"+h:this.colIndex!==null?"col"+this.colIndex:null);g&&a[g]&&(delete a[g],this._filterTableRows({key:null,values:[]},f)),Object.keys(a).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&c.removeAttribute(m)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),this.queryEnabled&&this._onPopState&&window.removeEventListener("popstate",this._onPopState),delete this.dom[t]};function x(c,f){const a=c[t];if(!(!a||a._destroyed))if(f===u)a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=N(c,"filter"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange);else if(f===r)a.queryEnabled&&a._onPopState&&window.removeEventListener("popstate",a._onPopState),a.queryParam=L(c),a.queryEnabled=!!a.queryParam,a.queryEnabled&&window.addEventListener("popstate",a._onPopState);else if(f===d){const h=qe(c.getAttribute(d)),g=c.querySelector("["+n+"]"),w=g?g.getAttribute(n):null;w&&(S(c,w,h),a._render())}else f===e&&(a.targetId=c.getAttribute(e)||null,a._ensureTargetMarked(),a._render())}be(e,t,E,"ln-filter",{attributes:k,subtreeQuery:"["+e+"], ["+m+"]",onSubtreeChange:function(c,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let a=null,h=null;if(c.hasAttribute(m)?(h=c,a=c.getAttribute(m)||c.id):c.hasAttribute(e)&&(a=c.getAttribute(e),h=a?document.getElementById(a):null),!a||!h)return;const g=document.querySelectorAll("["+e+'="'+a+'"]');for(let w=0;w<g.length;w++){const p=g[w][t];p&&!p._destroyed&&q(p).values.length>0&&p._queueDomFilter()}},persist:{attr:d,hashActive:function(c){return!!N(c,"filter")||!!L(c)}}})})()})();
|
|
1
|
+
(function(){"use strict";function Y(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function j(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!j(o))return}e.apply(console,t)}}function R(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function Te(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function F(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function X(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function Re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Fe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&i[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);i[r.name]=r.value===""||isNaN(d)?null:d}else i[r.name]=r.value}return i}function Oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function De(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const d=String(r).split(",").map(function(m){return m.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=Oe(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<l.options.length;d++)l.options[d].selected=r.indexOf(l.options[d].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=De,window.lnCore.serializeForm=Fe,window.lnCore.resolveFormMethod=Re);const Z={};function Ne(e,t){Z[e]=t}function Be(e){return Z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ne,window.lnCore.getDataMapper=Be);function Me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){R(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const ee={};function $e(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];ee[n]=t}function je(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return ee[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=$e,window.lnCore.getLocaleFallback=je,window.lnCore.ensureLocaleObserver=Me);const P={};function Pe(e,t){P[e]||(P[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=P[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function te(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const y=m[0].trim(),k=m[1].trim();t[k]!=null&&c.setAttribute(y,t[k])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const y=m[0].trim(),k=m[1].trim();k in t&&c.classList.toggle(y,!!t[k])}}return e}function He(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)te(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function ne(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const d=c[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ve(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],m=d.getAttribute("data-ln-render-key");m&&(l[m]=d)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],m=String(o(d));let y=l[m];if(y)i(y,d,r);else{const k=Pe(n,s);if(!k||(ne(k,d),y=k.firstElementChild,!y))continue;y.setAttribute("data-ln-render-key",m),i(y,d,r)}c.appendChild(y)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=ne,window.lnCore.fill=te,window.lnCore.lnFill=He,window.lnCore.renderList=Ve);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function re(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function oe(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function ie(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const H=new Map;function le(e,t){const n=(e?e.join("|"):"")+"::"+t;if(H.has(n))return H.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return H.set(n,i),i}function se(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function ue(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ce(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=le(o.values,o.fallback);break;case"integer":i=re;break;case"float":i=se;break;case"boolean":i=oe;break;case"list":i=ie;break;case"json":i=ue;break;case"string":default:i=O;break}i||(i=O),t[o.prop]=[i,n,o.fallback]}return t}function Ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function We(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ae,window.lnCore.attrSpec=de,window.lnCore.attrStr=O,window.lnCore.attrInt=re,window.lnCore.attrBool=oe,window.lnCore.attrList=ie,window.lnCore.attrEnum=le,window.lnCore.attrFloat=se,window.lnCore.attrJson=ue);function D(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function fe(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&D(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)D(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function I(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function he(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Qe(e){const t=he(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=We(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function we(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ge(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=he(),i=o.byAttr.get(t),s=Y()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&j(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<c.length;d++)ce(c[d].spec,r,t,c[d].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&we(c,l,t,e.oldValue),o.reactiveWildcard.length&&we(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(fe(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ge(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function U(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ge(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=V();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=U();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],d=r.query;if(d&&(s.matches&&s.matches(d)&&(r.ComponentFn&&D(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let y=0;y<m.length;y++)r.ComponentFn&&D(m[y],r),r.onInit&&r.onInit(m[y])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],d=r.query;if(d&&(s.matches&&s.matches(d)&&ge(s,r),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let y=0;y<m.length;y++)ge(m[y],r)}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ye(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ze(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{ye(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ye(e){V().push(e),e.onSubtreeChange&&e.query&&U().push(e),pe()}function be(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,d=i.onAttrChange||null,m=i.effects||null,y=i.attributes||null,k=y?Ue(y):m,z=y?new Set(Object.keys(y)):null,L=i.persist||null;function v(x){const a=x||document.body;if(fe(a,e,t,n),y&&Y())for(const f in y){const u=y[f],h=Array.from(a.querySelectorAll("["+f+"]"));a.matches&&a.matches("["+f+"]")&&h.push(a);for(let g=0;g<h.length;g++){const w=h[g];j(w)&&ce(u,w.getAttribute(f),f,o,w)}}r&&r(a)}const q=[];if(e.indexOf("[")!==-1){const x=/\[([\w-]+)/g;let a;for(;(a=x.exec(e))!==null;)q.push(a[1])}else q.push(e);Qe({selector:e,attribute:t,componentTag:o,attributes:y,ComponentFn:n,onInit:r,observed:q.concat(s),onAttributeChange:l,onAttrChange:d,effects:k,declared:z,persist:L}),Je();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,E=i.subtreeQuery||(S?e:"["+e+"]"),B={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:E};V().push(B),c&&E&&U().push(B),pe(),window[t]=v,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=be,window.lnCore.observeLifecycle=Ye,window.lnCore.withoutLifecycle=ze);function M(){Ke()>0?I(function(){v(document.body)}):v(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M(),v}function me(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function Ce(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},o=Ce(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,d=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function K(e){if(!e)return null;const t=W();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Ce(location.hash)!==i&&(location.hash=i)}function Xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function N(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ze(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function et(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Q(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=W,window.lnCore.hashGet=K,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=Xe,window.lnCore.resolveHashNamespace=N,window.lnCore.hashSortEncode=Ze,window.lnCore.hashSortDecode=et,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Q);function tt(e){return(e||"").replace(/^\?/,"")}function nt(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=tt(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function G(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function ve(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function rt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ot(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Se(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function J(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=nt,window.lnCore.queryGet=G,window.lnCore.querySet=ve,window.lnCore.resolveQueryParam=ke,window.lnCore.querySortEncode=rt,window.lnCore.querySortDecode=ot,window.lnCore.queryFilterEncode=Se,window.lnCore.queryFilterDecode=J);function it(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=it);function Ee(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let o=0;o<t.length;o++)if(String(t[o]).trim().toLowerCase()===n)return!0;return!1}function lt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function st(e,t,n){if(!t||typeof t!="object")return!0;const o=Object.keys(t);if(o.length===0)return!0;for(let i=0;i<o.length;i++){const s=t[o[i]];let l="";if(s.col!==null&&s.col!==void 0?l=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(l=n.getAttribute(s.attr)||""),!Ee(l,s.values))return!1}return!0}function xe(e,t,n,o){if(o!=null&&!isNaN(o))return parseInt(o,10);if(t&&typeof t.getAttribute=="function"){const i=t.getAttribute("data-ln-filter-col");if(i!==null&&!isNaN(parseInt(i,10)))return parseInt(i,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const l=t.closest("[data-ln-popover], [id]");if(l&&l.id){const c=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(c&&typeof c.querySelector=="function"){const r=c.querySelector('[data-ln-popover-for="'+l.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const i=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-table-filter-col")||c.getAttribute("data-ln-filter-col")||c.getAttribute("data-ln-filter-key")||c.getAttribute("data-ln-table-col")||c.getAttribute("data-ln-col")||c.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof c.cellIndex=="number"?c.cellIndex:l}if(t){const l=t.closest?t.closest("[data-ln-popover], [id]"):null,c=l&&l.id||t.id||null;if(c)for(let r=0;r<i.length;r++){const d=i[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+c+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let l=0;l<i.length;l++){const c=i[l],d=Array.from(c.childNodes||[]).filter(y=>y.nodeType===3),m=(d.length>0?d.map(y=>y.textContent.trim()).join(" "):c.textContent||"").trim().toLowerCase();if(m&&m===s)return typeof c.cellIndex=="number"?c.cellIndex:l}}return null}function ut(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let o=0;o<e.length;o++){const i=e[o];!t&&i.key&&(t=i.key),i.checked&&!i.isReset&&i.value&&n.push(i.value)}return{key:t,values:n}}function ct(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function qe(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",o="data-ln-filter-value",i="data-ln-filter-hide",s="data-ln-filter-reset",l="data-ln-filter-col",c="data-ln-hash",r="data-ln-query",d="data-ln-filter-values",m="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const k={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:x,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:x,description:"URL hash routing key for filter state persistence"},"data-ln-query":{type:"string",effect:x,description:"URL query parameter name for filter state synchronization"},"data-ln-filter-values":{type:"string",effect:x,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},z=de(k);function L(a){if(!a.hasAttribute(r))return null;const f=a.getAttribute(r);if(f&&f.trim()!=="")return f.trim();const u=a.getAttribute(l);if(u&&isNaN(parseInt(u,10)))return u.trim();const h=a.querySelector("["+n+"]");if(h){const g=h.getAttribute(n);if(g&&g.trim()!=="")return g.trim()}return ke(a,"filter")}function v(a){return a.hasAttribute(s)||!a.getAttribute(o)}function q(a){const f=a.dom.querySelectorAll("["+n+"]"),u=[];for(let g=0;g<f.length;g++){const w=f[g];u.push({key:w.getAttribute(n),value:w.getAttribute(o)||"",checked:w.checked,isReset:v(w)})}const h=ut(u);return{key:h.key,values:h.values,targetId:a.targetId}}function S(a,f,u){const h=a.querySelectorAll("["+n+"]"),g=Array.isArray(u)&&u.length>0;for(let w=0;w<h.length;w++){const p=h[w];v(p)?p.checked=!g:g&&p.getAttribute(n)===f&&u.indexOf(p.getAttribute(o))!==-1?p.checked=!0:p.checked=!1}}function E(a){this.dom=a,ae(this,a,z);const f=a.getAttribute(l);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=N(a,"filter"),this.hashEnabled=!!this.nsKey,this.queryParam=L(a),this.queryEnabled=!!this.queryParam;const u=this,h=me(function(){u._destroyed||u._render()});this._queueRender=h;const g=me(function(){u._destroyed||u._applyDomFilter()});this._queueDomFilter=g;function w(){if(!u.targetId)return;const b=document.getElementById(u.targetId);b&&!b.hasAttribute(m)&&b.setAttribute(m,u.targetId)}this._ensureTargetMarked=w,w(),I(function(){u._destroyed||w()}),this._attachHandlers(),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const b=K(u.nsKey),C=Q(b);C&&C.key&&C.values.length>0?S(u.dom,C.key,C.values):S(u.dom,null,[]),u._render()},this._onPopState=function(){if(u._destroyed||!u.queryEnabled)return;const b=G(u.queryParam),C=J(b),_=u.dom.querySelector("["+n+"]"),A=_?_.getAttribute(n):u.queryParam;S(u.dom,A,C),u._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),this.queryEnabled&&window.addEventListener("popstate",this._onPopState);let p=!1;if(this.hashEnabled){const b=K(this.nsKey),C=Q(b);C&&C.key&&C.values.length>0&&(S(a,C.key,C.values),I(function(){u._destroyed||u._render()}),p=!0)}else if(this.queryEnabled){const b=G(this.queryParam),C=J(b);if(C.length>0){const _=a.querySelector("["+n+"]"),A=_?_.getAttribute(n):u.queryParam;S(a,A,C),I(function(){u._destroyed||u._render()}),p=!0}}if(!p){const b=qe(a.getAttribute(d));if(b.length>0){const C=a.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(a,_,b),I(function(){u._destroyed||u._render()}),p=!0)}}if(!p){const b=a.querySelectorAll("["+n+"]");for(let C=0;C<b.length;C++)if(b[C].checked&&!v(b[C])){I(function(){u._destroyed||u._render()});break}}return this}E.prototype._attachHandlers=function(){const a=this;this._onDomChange=function(f){const u=f.target;if(!u||!u.hasAttribute||!u.hasAttribute(n))return;const h=Array.from(a.dom.querySelectorAll("["+n+"]"));if(v(u)){for(let g=0;g<h.length;g++)v(h[g])||(h[g].checked=!1);u.checked=!0,a._queueRender();return}if(u.checked){for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!1);let g=!1;for(let w=0;w<h.length;w++)if(v(h[w])){g=!0;break}if(g){let w=!0;for(let p=0;p<h.length;p++)if(!v(h[p])&&!h[p].checked){w=!1;break}if(w)for(let p=0;p<h.length;p++)v(h[p])?h[p].checked=!0:h[p].checked=!1}}else{let g=!1;for(let w=0;w<h.length;w++)if(!v(h[w])&&h[w].checked){g=!0;break}if(!g)for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!0)}a._queueRender()},this.dom.addEventListener("change",this._onDomChange)},E.prototype._render=function(){const a=this,f=q(this),u=this._lastSnapshot;if(!(!u||u.key!==f.key||lt(u.values,f.values)))return;f.key===null||f.values.length;const g=document.getElementById(a.targetId),w={key:f.key,values:f.values.slice(),targetId:a.targetId};R(a.dom,"ln-filter:change",w);let p=!1;g&&g!==a.dom&&Te(g,"ln-filter:change",w).defaultPrevented&&(p=!0);const b=u&&u.values.length>0,C=f.values.length===0;if(b&&C){const A={targetId:a.targetId};R(a.dom,"ln-filter:reset",A),g&&g!==a.dom&&R(g,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=ct(f.values);if(_?this.dom.setAttribute(d,_):this.dom.removeAttribute(d),this.hashEnabled){const A=_e(f.key,f.values);Ae(this.nsKey,A)}else if(this.queryEnabled){const A=Se(f.values),T=this.queryParam||f.key;T&&ve(T,A)}p||a._applyDomFilter(g)},E.prototype._applyDomFilter=function(a){const f=a||document.getElementById(this.targetId);if(!f)return;const u=q(this),h=u.key===null||u.values.length===0,g=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(g)this._filterTableRows(u,g);else{const w=f.children;for(let p=0;p<w.length;p++){const b=w[p],C=h?null:b.getAttribute("data-"+u.key),_=!h&&C!==null&&!Ee(C,u.values),A=b.hasAttribute(i);_&&!A?b.setAttribute(i,"true"):!_&&A&&b.removeAttribute(i)}}};function B(a){if(!a)return"";const f=a.querySelector?a.querySelector("[data-ln-value]"):null;return X(f||a)}function M(a){return!!(!a||typeof a!="object"||a.tagName==="TEMPLATE"||typeof a.hasAttribute=="function"&&(a.hasAttribute("data-ln-sort-exclude")||a.hasAttribute("hidden"))||a.classList&&a.classList.contains("hidden")||a.style&&a.style.display==="none"||typeof a.matches=="function"&&a.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof a.querySelector=="function"&&a.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}E.prototype._filterTableRows=function(a,f){if(!f){const b=document.getElementById(this.targetId);if(!b||(f=b.tagName==="TABLE"?b:b.querySelector?b.querySelector("table"):null,!f))return}const u=xe(f,this.dom,a.key,this.colIndex),h=a.key||this.dom.getAttribute("data-ln-filter-key")||(u!==null?"col"+u:"attr-filter"),g=a.values;y.has(f)||y.set(f,{});const w=y.get(f);h&&g.length>0?w[h]={col:u,values:g.slice(),attr:"data-"+h}:h&&delete w[h];const p=f.tBodies;for(let b=0;b<p.length;b++){const C=p[b].rows;for(let _=0;_<C.length;_++){const A=C[_];if(M(A))continue;const T={};for(let $=0;$<A.cells.length;$++)T[$]=B(A.cells[$]);const Ie=!st(T,w,A),Le=A.hasAttribute(i);Ie&&!Le?A.setAttribute(i,"true"):!Ie&&Le&&A.removeAttribute(i)}}},E.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const a=document.getElementById(this.targetId);if(a){const f=a.tagName==="TABLE"?a:a.querySelector?a.querySelector("table"):null;if(f&&y.has(f)){const u=y.get(f),h=xe(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),g=this.dom.getAttribute("data-ln-filter-key")||(h!==null?"col"+h:this.colIndex!==null?"col"+this.colIndex:null);g&&u[g]&&(delete u[g],this._filterTableRows({key:null,values:[]},f)),Object.keys(u).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&a.removeAttribute(m)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),this.queryEnabled&&this._onPopState&&window.removeEventListener("popstate",this._onPopState),delete this.dom[t]};function x(a,f){const u=a[t];if(!(!u||u._destroyed))if(f===c)u.hashEnabled&&u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=N(a,"filter"),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange);else if(f===r)u.queryEnabled&&u._onPopState&&window.removeEventListener("popstate",u._onPopState),u.queryParam=L(a),u.queryEnabled=!!u.queryParam,u.queryEnabled&&window.addEventListener("popstate",u._onPopState);else if(f===d){const h=qe(a.getAttribute(d)),g=a.querySelector("["+n+"]"),w=g?g.getAttribute(n):null;w&&(S(a,w,h),u._render())}else f===e&&(u.targetId=a.getAttribute(e)||null,u._ensureTargetMarked(),u._render())}be(e,t,E,"ln-filter",{attributes:k,subtreeQuery:"["+e+"], ["+m+"]",onSubtreeChange:function(a,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let u=null,h=null;if(a.hasAttribute(m)?(h=a,u=a.getAttribute(m)||a.id):a.hasAttribute(e)&&(u=a.getAttribute(e),h=u?document.getElementById(u):null),!u||!h)return;const g=document.querySelectorAll("["+e+'="'+u+'"]');for(let w=0;w<g.length;w++){const p=g[w][t];p&&!p._destroyed&&q(p).values.length>0&&p._queueDomFilter()}},persist:{attr:d,hashActive:function(a){return!!N(a,"filter")||!!L(a)}}})})()})();
|
|
@@ -107,7 +107,9 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
107
107
|
const self = this;
|
|
108
108
|
|
|
109
109
|
const queueRender = createBatcher(function () {
|
|
110
|
-
self.
|
|
110
|
+
if (!self._destroyed) {
|
|
111
|
+
self._render();
|
|
112
|
+
}
|
|
111
113
|
});
|
|
112
114
|
|
|
113
115
|
this._queueRender = queueRender;
|
package/package.json
CHANGED
|
@@ -1,85 +1,95 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@livenetworks/ashlar",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
|
|
5
|
-
"license": "GPL-3.0-or-later",
|
|
6
|
-
"author": "Live Networks",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/livenetworks/ln-ashlar.git"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/livenetworks/ln-ashlar#readme",
|
|
16
|
-
"bugs": "https://github.com/livenetworks/ln-ashlar/issues",
|
|
17
|
-
"keywords": [
|
|
18
|
-
"css",
|
|
19
|
-
"scss",
|
|
20
|
-
"design-system",
|
|
21
|
-
"frontend",
|
|
22
|
-
"components",
|
|
23
|
-
"vanilla-js"
|
|
24
|
-
],
|
|
25
|
-
"main": "./dist/ln-ashlar.js",
|
|
26
|
-
"style": "./dist/ln-ashlar.css",
|
|
27
|
-
"web-types": "./web-types.json",
|
|
28
|
-
"files": [
|
|
29
|
-
"dist/",
|
|
30
|
-
"theme/",
|
|
31
|
-
"components/",
|
|
32
|
-
"ln-ashlar.html-data.json",
|
|
33
|
-
"web-types.json"
|
|
34
|
-
],
|
|
35
|
-
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"import": "./dist/ln-ashlar.js",
|
|
38
|
-
"default": "./dist/ln-ashlar.js"
|
|
39
|
-
},
|
|
40
|
-
"./core.css": "./dist/ln-ashlar-core.css",
|
|
41
|
-
"./theme.css": "./dist/ln-ashlar-theme.css",
|
|
42
|
-
"./full.css": "./dist/ln-ashlar.css",
|
|
43
|
-
"./landing.css": "./dist/ln-ashlar-landing.css",
|
|
44
|
-
"./presentation.css": "./dist/ln-ashlar-landing.css",
|
|
45
|
-
"./dev.css": "./dist/ln-ashlar-dev.css",
|
|
46
|
-
"./dev.js": "./dist/ln-ashlar-dev.js",
|
|
47
|
-
"./theme/*": "./theme/*",
|
|
48
|
-
"./components/*": "./components/*"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"test:
|
|
53
|
-
"test:
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"build
|
|
57
|
-
"build:
|
|
58
|
-
"
|
|
59
|
-
"build:
|
|
60
|
-
"
|
|
61
|
-
"build:demo-
|
|
62
|
-
"build:demo-
|
|
63
|
-
"build:demo-
|
|
64
|
-
"build:demo-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"sync:ln-
|
|
68
|
-
"sync:ln-
|
|
69
|
-
"sync:ln-events
|
|
70
|
-
"sync:
|
|
71
|
-
"sync:
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
}
|
|
85
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@livenetworks/ashlar",
|
|
3
|
+
"version": "2.1.13",
|
|
4
|
+
"description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
|
|
5
|
+
"license": "GPL-3.0-or-later",
|
|
6
|
+
"author": "Live Networks",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/livenetworks/ln-ashlar.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/livenetworks/ln-ashlar#readme",
|
|
16
|
+
"bugs": "https://github.com/livenetworks/ln-ashlar/issues",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"css",
|
|
19
|
+
"scss",
|
|
20
|
+
"design-system",
|
|
21
|
+
"frontend",
|
|
22
|
+
"components",
|
|
23
|
+
"vanilla-js"
|
|
24
|
+
],
|
|
25
|
+
"main": "./dist/ln-ashlar.js",
|
|
26
|
+
"style": "./dist/ln-ashlar.css",
|
|
27
|
+
"web-types": "./web-types.json",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/",
|
|
30
|
+
"theme/",
|
|
31
|
+
"components/",
|
|
32
|
+
"ln-ashlar.html-data.json",
|
|
33
|
+
"web-types.json"
|
|
34
|
+
],
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"import": "./dist/ln-ashlar.js",
|
|
38
|
+
"default": "./dist/ln-ashlar.js"
|
|
39
|
+
},
|
|
40
|
+
"./core.css": "./dist/ln-ashlar-core.css",
|
|
41
|
+
"./theme.css": "./dist/ln-ashlar-theme.css",
|
|
42
|
+
"./full.css": "./dist/ln-ashlar.css",
|
|
43
|
+
"./landing.css": "./dist/ln-ashlar-landing.css",
|
|
44
|
+
"./presentation.css": "./dist/ln-ashlar-landing.css",
|
|
45
|
+
"./dev.css": "./dist/ln-ashlar-dev.css",
|
|
46
|
+
"./dev.js": "./dist/ln-ashlar-dev.js",
|
|
47
|
+
"./theme/*": "./theme/*",
|
|
48
|
+
"./components/*": "./components/*",
|
|
49
|
+
"./tailwind.css": "./dist/ln-ashlar-tailwind.css"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"test": "npm run sync:ln-schemas:check && npm run sync:ln-events:check && npm run sync:css-tokens:check && node --test \"tests/*.test.js\"",
|
|
53
|
+
"test:p0": "node --test tests/p0-data-integrity.test.js",
|
|
54
|
+
"test:headless": "node tests/headless/run-all.mjs",
|
|
55
|
+
"dev": "node scripts/build.mjs --watch",
|
|
56
|
+
"build": "npm run sync:ln-schemas && npm run sync:ln-events && npm run sync:css-tokens && node scripts/build.mjs && npm run build:tailwind && npm run build:dev-css && npm run build:demos",
|
|
57
|
+
"build:tailwind": "node scripts/build-tailwind.mjs",
|
|
58
|
+
"build:demos": "npm run build:demo-index && npm run build:demo-admin && npm run build:demo-docuflow && npm run build:demo-spa && npm run build:demo-landing && npm run build:demo-corporate",
|
|
59
|
+
"build:dev-css": "sass theme/ln-ashlar-dev.scss demo/dist/ln-ashlar-dev.css --no-source-map --style=compressed",
|
|
60
|
+
"generate:brand-assets": "powershell -ExecutionPolicy Bypass -File scripts/generate-brand-assets.ps1 && node scripts/generate-svg-favicon.mjs",
|
|
61
|
+
"build:demo-index": "sass demo/index.scss demo/index.css --no-source-map --style=compressed",
|
|
62
|
+
"build:demo-admin": "sass demo/admin/src/admin.scss demo/admin/dist/admin.css --no-source-map --style=compressed && node -e \"const fs = require('fs'); fs.copyFileSync('demo/admin/src/demo.js', 'demo/admin/dist/demo.js')\" && node demo/admin/src/build-pages.mjs",
|
|
63
|
+
"build:demo-docuflow": "sass demo/docuflow/docuflow.scss demo/docuflow/dist/docuflow.css --no-source-map --style=compressed",
|
|
64
|
+
"build:demo-spa": "node demo/spa/build.mjs",
|
|
65
|
+
"build:demo-landing": "sass demo/landing/landing.scss demo/landing/landing.css --no-source-map --style=compressed",
|
|
66
|
+
"build:demo-corporate": "sass demo/corporate/corporate.scss demo/corporate/corporate.css --no-source-map --style=compressed",
|
|
67
|
+
"sync:ln-schemas": "node scripts/sync-ln-schemas.mjs",
|
|
68
|
+
"sync:ln-schemas:check": "node scripts/sync-ln-schemas.mjs --check",
|
|
69
|
+
"sync:ln-events": "node scripts/sync-ln-events.mjs",
|
|
70
|
+
"sync:ln-events:check": "node scripts/sync-ln-events.mjs --check",
|
|
71
|
+
"sync:ln-events:strict": "node scripts/sync-ln-events.mjs --strict",
|
|
72
|
+
"sync:css-tokens": "node scripts/sync-css-tokens.mjs",
|
|
73
|
+
"sync:css-tokens:check": "node scripts/sync-css-tokens.mjs --check",
|
|
74
|
+
"manifest": "node scripts/extract-manifest.mjs",
|
|
75
|
+
"manifest:file": "node scripts/extract-manifest.mjs --output=docs/manifest.txt",
|
|
76
|
+
"generate:llms": "node scripts/generate-llms.mjs",
|
|
77
|
+
"generate:llms:check": "node scripts/generate-llms.mjs --check",
|
|
78
|
+
"test:visual": "node tests/headless/visual-run.mjs",
|
|
79
|
+
"test:perf": "node tests/headless/perf-run.mjs",
|
|
80
|
+
"test:perf:history": "node tests/headless/perf-run.mjs --history",
|
|
81
|
+
"test:perf:compare": "node tests/headless/perf-run.mjs --compare",
|
|
82
|
+
"test:perf:density": "node tests/headless/perf-density.mjs",
|
|
83
|
+
"test:dual": "node tests/headless/dual-run.mjs"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@tabler/icons": "^3.41.1",
|
|
87
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
88
|
+
"fake-indexeddb": "^6.2.4",
|
|
89
|
+
"flag-icons": "^7.5.0",
|
|
90
|
+
"puppeteer-core": "^25.1.0",
|
|
91
|
+
"sass-embedded": "^1.83.0",
|
|
92
|
+
"tailwindcss": "^4.3.3",
|
|
93
|
+
"vite": "^6.0.0"
|
|
94
|
+
}
|
|
95
|
+
}
|
package/theme/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 🎨 ln-ashlar Theme & CSS Architecture
|
|
2
|
+
|
|
3
|
+
`ln-ashlar` provides a high-performance visual layer with **Dual CSS Engine Support**:
|
|
4
|
+
1. **Ashlar SCSS (Native):** Semantic class-free, design token-driven stylesheet system optimized for minimal CSSOM invalidation and modern W3C standards.
|
|
5
|
+
2. **Tailwind CSS v4:** Utility-first engine compiling into a standalone bundle (`dist/ln-ashlar-tailwind.css`) with comprehensive layout and interaction parity verified across all 67 demo pages.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🏛️ Directory Structure
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
theme/
|
|
13
|
+
├── base/ # Global HTML5 element resets, typography, and defaults
|
|
14
|
+
├── components/ # Layer 2 component styling (card, table, form, modal, nav, etc.)
|
|
15
|
+
├── config/ # Design tokens, density scales, color themes, and mixins
|
|
16
|
+
│ ├── mixins/ # Reusable SCSS mixins for semantic styling
|
|
17
|
+
│ ├── _tokens.scss # Master CSS custom properties (colors, spacing, radius, shadows)
|
|
18
|
+
│ ├── _theme.scss # Theme definitions (Default, Glass, Flat, Minimal)
|
|
19
|
+
│ └── _density.scss # Density scale rebinds (compact, default, spacious)
|
|
20
|
+
├── tailwind/ # Tailwind CSS v4 source definitions
|
|
21
|
+
│ ├── theme.css # Design token mappings to Tailwind v4 @theme directive
|
|
22
|
+
│ ├── components.css # Component utility recipes
|
|
23
|
+
│ └── entry.css # Entrypoint bundle
|
|
24
|
+
├── ln-ashlar.scss # Master bundle (Core + Theme)
|
|
25
|
+
└── ln-ashlar-theme.scss # Theme-only visual design system bundle
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## ⚡ SCSS Performance & Selector Best Practices
|
|
31
|
+
|
|
32
|
+
To prevent browser style invalidation storms during interactive DOM mutations, all SCSS mixins and components adhere to the following rules:
|
|
33
|
+
|
|
34
|
+
1. **Avoid Repeating `:has()` Inside Mixins:**
|
|
35
|
+
- Never embed complex `:has()` selectors inside mixins that are `@include`d across multiple component variants or classes.
|
|
36
|
+
- De-duplicate and hoist container-level `:has()` rules to global component scopes using `:is(...)` (e.g. `:is(.card, .section-card, [class*="card"]) > :is(main, a > main):has(...)`).
|
|
37
|
+
|
|
38
|
+
2. **Prefer Natural Cascade over `:not(:has(...))`:**
|
|
39
|
+
- Negative `:not(:has(...))` selectors force the browser layout engine to traverse ancestor trees repeatedly to prove absence.
|
|
40
|
+
- Use CSS source-order cascade instead:
|
|
41
|
+
```scss
|
|
42
|
+
// ✅ RECOMMENDED: Natural cascade override
|
|
43
|
+
&:hover { border-color: var(--color-accent); }
|
|
44
|
+
&:has(> input:checked) {
|
|
45
|
+
border-color: var(--color-accent);
|
|
46
|
+
color: var(--color-accent);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
3. **Use Logical Properties for Sizing and Spacing:**
|
|
51
|
+
- Mixins for padding and margin use modern CSS logical properties (`padding-inline`, `padding-block`, `margin-inline`, `margin-block`), reducing generated rules by 50% compared to separate physical properties (`-left`, `-right`, `-top`, `-bottom`).
|
|
52
|
+
|
|
53
|
+
4. **Anchor Pseudo-Elements to Direct Elements:**
|
|
54
|
+
- Apply active indicators (e.g. `::before`) directly to the target element (`a::before`) with `position: relative`, rather than querying parent containers (`li:has(a.active)::before`).
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 💨 Tailwind CSS v4 Engine
|
|
59
|
+
|
|
60
|
+
To compile the Tailwind v4 bundle:
|
|
61
|
+
```sh
|
|
62
|
+
npm run build:tailwind
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The output bundle is generated at:
|
|
66
|
+
- `dist/ln-ashlar-tailwind.css`
|
|
67
|
+
- `demo/admin/dist/admin-tailwind.css`
|
|
68
|
+
- `demo/dist/ln-ashlar-tailwind.css`
|
|
69
|
+
|
|
70
|
+
Consumers can toggle between engines dynamically in the browser or via:
|
|
71
|
+
```javascript
|
|
72
|
+
localStorage.setItem('ln-demo-engine', 'tailwind'); // or 'ashlar'
|
|
73
|
+
```
|