@evotecit/canopyx 0.3.16 → 0.3.20
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/CanopyX.Html/Assets/canopyx-board.css +50 -0
- package/CanopyX.Html/Assets/canopyx-board.js +39 -0
- package/CanopyX.Html/Assets/canopyx-buckets.js +15 -0
- package/CanopyX.Html/Assets/canopyx-calculations.css +7 -0
- package/CanopyX.Html/Assets/canopyx-calculations.js +52 -0
- package/CanopyX.Html/Assets/canopyx-calendar-edit.js +3 -3
- package/CanopyX.Html/Assets/canopyx-calendar.css +74 -80
- package/CanopyX.Html/Assets/canopyx-calendar.js +26 -31
- package/CanopyX.Html/Assets/canopyx-cell-range.css +4 -4
- package/CanopyX.Html/Assets/canopyx-cell-range.js +16 -14
- package/CanopyX.Html/Assets/canopyx-changes.css +61 -79
- package/CanopyX.Html/Assets/canopyx-changes.js +18 -15
- package/CanopyX.Html/Assets/canopyx-column-groups.css +5 -1
- package/CanopyX.Html/Assets/canopyx-column-groups.js +15 -9
- package/CanopyX.Html/Assets/canopyx-compare.css +37 -0
- package/CanopyX.Html/Assets/canopyx-compare.js +12 -0
- package/CanopyX.Html/Assets/canopyx-data.js +3 -3
- package/CanopyX.Html/Assets/canopyx-detail-rows.css +4 -4
- package/CanopyX.Html/Assets/canopyx-detail-rows.js +1 -1
- package/CanopyX.Html/Assets/canopyx-editing.css +5 -5
- package/CanopyX.Html/Assets/canopyx-editing.js +2 -2
- package/CanopyX.Html/Assets/canopyx-enhance.js +5 -5
- package/CanopyX.Html/Assets/canopyx-export.js +54 -13
- package/CanopyX.Html/Assets/canopyx-facets.css +32 -22
- package/CanopyX.Html/Assets/canopyx-facets.js +19 -15
- package/CanopyX.Html/Assets/canopyx-filter-editor.css +75 -89
- package/CanopyX.Html/Assets/canopyx-filter-editor.js +20 -16
- package/CanopyX.Html/Assets/canopyx-flow-checks.css +3 -3
- package/CanopyX.Html/Assets/canopyx-flow-checks.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-command.css +3 -3
- package/CanopyX.Html/Assets/canopyx-flow-command.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-dialog.css +4 -4
- package/CanopyX.Html/Assets/canopyx-flow-dialog.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-drafts.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-drafts.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-entry.css +142 -17
- package/CanopyX.Html/Assets/canopyx-flow-entry.js +5 -5
- package/CanopyX.Html/Assets/canopyx-flow-host.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-host.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-module.mjs +5 -5
- package/CanopyX.Html/Assets/canopyx-flow-pick.css +4 -4
- package/CanopyX.Html/Assets/canopyx-flow-pick.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-preview.css +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-preview.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-records.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-records.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-tasks.css +4 -4
- package/CanopyX.Html/Assets/canopyx-flow-tasks.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow.css +41 -41
- package/CanopyX.Html/Assets/canopyx-flow.js +1 -1
- package/CanopyX.Html/Assets/canopyx-format-editor.css +9 -9
- package/CanopyX.Html/Assets/canopyx-format-editor.js +2 -2
- package/CanopyX.Html/Assets/canopyx-formatting.css +13 -13
- package/CanopyX.Html/Assets/canopyx-formatting.js +12 -11
- package/CanopyX.Html/Assets/canopyx-forms.css +3 -3
- package/CanopyX.Html/Assets/canopyx-forms.js +1 -1
- package/CanopyX.Html/Assets/canopyx-grid-module.mjs +220 -155
- package/CanopyX.Html/Assets/canopyx-grid-options.css +8 -8
- package/CanopyX.Html/Assets/canopyx-grid-options.js +9 -2
- package/CanopyX.Html/Assets/canopyx-grid.css +285 -150
- package/CanopyX.Html/Assets/canopyx-grid.js +220 -155
- package/CanopyX.Html/Assets/canopyx-grouping.css +23 -16
- package/CanopyX.Html/Assets/canopyx-grouping.js +24 -17
- package/CanopyX.Html/Assets/canopyx-highlight.css +10 -10
- package/CanopyX.Html/Assets/canopyx-highlight.js +1 -1
- package/CanopyX.Html/Assets/canopyx-interactive.css +215 -91
- package/CanopyX.Html/Assets/canopyx-interactive.js +47 -52
- package/CanopyX.Html/Assets/canopyx-labels-de.js +177 -9
- package/CanopyX.Html/Assets/canopyx-labels-es.js +177 -9
- package/CanopyX.Html/Assets/canopyx-labels-fr.js +176 -8
- package/CanopyX.Html/Assets/canopyx-labels-it.js +176 -8
- package/CanopyX.Html/Assets/canopyx-labels-pl.js +176 -8
- package/CanopyX.Html/Assets/canopyx-layouts.css +49 -21
- package/CanopyX.Html/Assets/canopyx-layouts.js +36 -14
- package/CanopyX.Html/Assets/canopyx-link.css +3 -3
- package/CanopyX.Html/Assets/canopyx-link.js +4 -4
- package/CanopyX.Html/Assets/canopyx-links.js +2 -2
- package/CanopyX.Html/Assets/canopyx-live.css +3 -5
- package/CanopyX.Html/Assets/canopyx-live.js +3 -3
- package/CanopyX.Html/Assets/canopyx-matrix.css +32 -39
- package/CanopyX.Html/Assets/canopyx-matrix.js +11 -11
- package/CanopyX.Html/Assets/canopyx-module.mjs +47 -52
- package/CanopyX.Html/Assets/canopyx-office-export.js +2936 -0
- package/CanopyX.Html/Assets/canopyx-pager.css +1 -1
- package/CanopyX.Html/Assets/canopyx-pager.js +1 -1
- package/CanopyX.Html/Assets/canopyx-path.css +45 -0
- package/CanopyX.Html/Assets/canopyx-path.js +28 -0
- package/CanopyX.Html/Assets/canopyx-pivot.css +75 -0
- package/CanopyX.Html/Assets/canopyx-pivot.js +72 -0
- package/CanopyX.Html/Assets/canopyx-plan.css +63 -0
- package/CanopyX.Html/Assets/canopyx-plan.js +71 -0
- package/CanopyX.Html/Assets/canopyx-presenters.js +2 -2
- package/CanopyX.Html/Assets/canopyx-record-panel.css +51 -45
- package/CanopyX.Html/Assets/canopyx-record-panel.js +30 -22
- package/CanopyX.Html/Assets/canopyx-reporting-module.mjs +262 -197
- package/CanopyX.Html/Assets/canopyx-reporting.css +300 -164
- package/CanopyX.Html/Assets/canopyx-reporting.js +262 -197
- package/CanopyX.Html/Assets/canopyx-stack.css +35 -0
- package/CanopyX.Html/Assets/canopyx-stack.js +24 -0
- package/CanopyX.Html/Assets/canopyx-time-slider.css +18 -0
- package/CanopyX.Html/Assets/canopyx-time-slider.js +27 -0
- package/CanopyX.Html/Assets/canopyx-timeline.css +19 -19
- package/CanopyX.Html/Assets/canopyx-timeline.js +6 -5
- package/CanopyX.Html/Assets/canopyx-tree-tools.css +47 -46
- package/CanopyX.Html/Assets/canopyx-tree-tools.js +15 -12
- package/CanopyX.Html/Assets/canopyx-ui-menu.css +41 -0
- package/CanopyX.Html/Assets/canopyx-ui-menu.js +64 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.css +73 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.js +39 -0
- package/CanopyX.Html/Assets/canopyx-ui-overlays.css +79 -0
- package/CanopyX.Html/Assets/canopyx-ui-overlays.js +45 -0
- package/CanopyX.Html/Assets/canopyx-ui-picker.css +12 -0
- package/CanopyX.Html/Assets/canopyx-ui-picker.js +6 -0
- package/CanopyX.Html/Assets/canopyx-ui-stepper.css +174 -0
- package/CanopyX.Html/Assets/canopyx-ui-stepper.js +48 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.css +153 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.js +47 -0
- package/CanopyX.Html/Assets/canopyx-values.css +5 -0
- package/CanopyX.Html/Assets/canopyx-values.js +13 -0
- package/CanopyX.Html/Assets/canopyx-view-intents.css +12 -0
- package/CanopyX.Html/Assets/canopyx-view-intents.js +56 -0
- package/CanopyX.Html/Assets/canopyx.css +212 -85
- package/CanopyX.Html/Assets/canopyx.js +38 -26
- package/JavaScript/board.d.ts +30 -0
- package/JavaScript/changes.d.ts +4 -1
- package/JavaScript/column-groups.d.ts +24 -4
- package/JavaScript/facets.d.ts +5 -3
- package/JavaScript/grid.d.ts +161 -17
- package/JavaScript/hosts.d.ts +16 -1
- package/JavaScript/index.d.ts +4 -2
- package/JavaScript/locales/de.mjs +177 -9
- package/JavaScript/locales/es.mjs +177 -9
- package/JavaScript/locales/fr.mjs +176 -8
- package/JavaScript/locales/it.mjs +176 -8
- package/JavaScript/locales/pl.mjs +176 -8
- package/JavaScript/matrix.d.ts +4 -1
- package/JavaScript/path.d.ts +33 -0
- package/JavaScript/pivot.d.ts +135 -0
- package/JavaScript/plan.d.ts +23 -0
- package/JavaScript/protocol.d.ts +18 -3
- package/JavaScript/records.d.ts +4 -0
- package/JavaScript/stack.d.ts +28 -0
- package/JavaScript/time-slider.d.ts +58 -0
- package/JavaScript/ui.d.ts +261 -0
- package/JavaScript/view-intents.d.ts +45 -0
- package/README.md +76 -187
- package/README.nuget.md +63 -87
- package/ThirdParty/OfficeIMO/LICENSE +21 -0
- package/ThirdParty/OfficeIMO/README.md +13 -0
- package/package.json +76 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(global){"use strict";const installed=new WeakSet();const part={version:"
|
|
1
|
+
(function(global){"use strict";const installed=new WeakSet();const part={version:"78791b002a111843",install(context){if(installed.has(context.DataGrid.prototype))return;const{DataGrid,h,setText,fill,gridButton,gridIcon,gridQuery,gridResultShape,gridQueryRows,gridCompare,gridOrder,gridIdOrder,validateGridRows,validateGridPage,validateGridCursorPage,gridFreeze,requireIdentifier,checkDocument,cellValue,PROTOCOL,GRID_REPORTING,GRID_CALCULATIONS,VIEW_MODES,inlineGridSource}=context;const LIVE_KEYS=new Set(["stableOrder","flash","batchMs","pollMs","load","announce","pauseWhenHidden"]);const LIVE_MAX_ROWS=100000;function liveOptions(view,options){const read=value=>{if(value===undefined||value===true||value===false)return{};if(!value||typeof value!=="object"||Array.isArray(value)||Object.keys(value).some(key=>!LIVE_KEYS.has(key)))
|
|
2
2
|
throw new Error("CanopyX: live takes stableOrder, flash, batchMs, pollMs, load, announce and pauseWhenHidden.");return value};const merged=options.live===false?{}:{...read(view.live),...read(options.live)},flash=merged.flash;const integer=(value,min,max)=>value===undefined||Number.isInteger(value)&&value>=min&&value<=max;if(["stableOrder","announce","pauseWhenHidden"].some(key=>merged[key]!==undefined&&typeof merged[key]!=="boolean")||
|
|
3
3
|
!(flash===undefined||typeof flash==="boolean"||flash&&typeof flash==="object"&&Object.keys(flash).every(key=>key==="durationMs")&&integer(flash.durationMs,100,10000))||
|
|
4
4
|
!integer(merged.batchMs,0,60000)||!(merged.pollMs===undefined||merged.pollMs===0||integer(merged.pollMs,250,86400000))||
|
|
@@ -27,7 +27,7 @@ return this.liveRowMap},liveOrderOf(){const query=this.acceptedQuery,shape=gridR
|
|
|
27
27
|
return this.liveOrder},liveApplyRows(queue,ordered){const rows=this.liveRows(),query=this.acceptedQuery,stable=this.liveOpts.stableOrder;if(!ordered)this.liveOrder=null;const order=ordered?this.liveOrderOf():{at:new Map(),ids:[]};const matches=liveMatcher(this,query),compare=liveComparer(this,query);const result={added:[],updated:[],removed:[],missing:[]},changed=new Map(),leave=new Set(),enter=[],kept=[];for(const change of queue.values()){const before=rows.get(change.id);if(change.kind==="remove"){if(!before){result.missing.push(change.id);continue}
|
|
28
28
|
rows.delete(change.id);result.removed.push(change.id);if(order.at.has(change.id))leave.add(change.id);continue}
|
|
29
29
|
if(change.kind==="update"&&!before){result.missing.push(change.id);continue}
|
|
30
|
-
const after=change.kind==="add"?change.row:liveMerged(before,change.row);if(before&&liveSameRow(before,after))continue;rows.set(change.id,after);(before?result.updated:result.added).push(change.id);changed.set(change.id,liveChangedColumns(before,after));if(!ordered)continue;const was=order.at.has(change.id),now=matches(after);if(was&&!now)leave.add(change.id);else if(!was&&now)enter.push(after);else if(was&&now){if(stable)kept.push(change.id);else{leave.add(change.id);enter.push(after)}}}
|
|
30
|
+
const after=change.kind==="add"?change.row:liveMerged(before,change.row);GRID_CALCULATIONS.apply?.(this.view,[after]);if(before&&liveSameRow(before,after))continue;rows.set(change.id,after);(before?result.updated:result.added).push(change.id);changed.set(change.id,liveChangedColumns(before,after));if(!ordered)continue;const was=order.at.has(change.id),now=matches(after);if(was&&!now)leave.add(change.id);else if(!was&&now)enter.push(after);else if(was&&now){if(stable)kept.push(change.id);else{leave.add(change.id);enter.push(after)}}}
|
|
31
31
|
if(!changed.size&&!result.removed.length)return{result,changed};if(!ordered){this.view.rows=this.liveRowsOf=[...rows.values()];return{result,changed}}
|
|
32
32
|
let dirty=order.dirty;const neighbour=(index,step)=>{for(let at=index+step;at>=0&&at<order.ids.length;at +=step)if(!leave.has(order.ids[at]))return rows.get(order.ids[at]);return null};for(const id of kept){if(dirty)break;const index=order.at.get(id),row=rows.get(id),previous=neighbour(index,-1),next=neighbour(index,1);dirty=!!(previous&&compare(previous,row)>0||next&&compare(row,next)>0)}
|
|
33
33
|
let ids=leave.size?order.ids.filter(id=>!leave.has(id)):order.ids;if(enter.length){enter.sort(compare);const merged=[];let i=0,j=0;while(i<ids.length&&j<enter.length)merged.push(compare(rows.get(ids[i]),enter[j])<=0?ids[i++]:enter[j++].id);while(i<ids.length)merged.push(ids[i++]);while(j<enter.length)merged.push(enter[j++].id);ids=merged}
|
|
@@ -53,7 +53,7 @@ for(let page=Math.floor(Math.max(bounds.first,range.first)/ size) * size; page <
|
|
|
53
53
|
return[...offsets].slice(0,4).sort((a,b)=>a-b)},async liveRefreshHost(force,signal=this.dataLifetime.signal){if(this.cursor)return this.liveRefreshCursor(signal);const offsets=this.liveHeldOffsets(),lifetime=this.dataLifetime,epoch=this.queryEpoch,accepted=this.acceptedQuery;const ask=async(offset,snapshot)=>{const query=gridQuery(this.view,{...accepted,offset,limit:this.pageSize,revision:snapshot?snapshot.revision:undefined});const page=validateGridPage(await this.requestPage(query,signal),this.view,query,snapshot);if(signal.aborted||this.destroyed||epoch!==this.queryEpoch||this.acceptedQuery!==accepted)throw new DOMException("The refresh was superseded.","AbortError");return page};const first=await ask(0,null);if(!force&&(first.revision===this.snapshot.revision||first.revision===this.livePending?.snapshot?.revision))return null;const snapshot={revision:first.revision,total:first.total,matched:first.matched};if(this.liveProjected()){this.livePending=null;this.liveMoved=false;await this.liveRequery(new Map(),[],signal);return{changed:new Map(),removed:[],orderChanged:false,revision:this.snapshot.revision}}
|
|
54
54
|
const pages=new Map([[0,first.items]]);for(const offset of offsets)if(offset&&offset<snapshot.matched)pages.set(offset,(await ask(offset,snapshot)).items);const position=new Map(),fresh=new Map();for(const[offset,items]of pages)items.forEach((item,index)=>{position.set(item.id,offset+index);fresh.set(item.id,item)});const changed=new Map(),held=new Map();for(const row of this.rowCache.values())if(!row.status)held.set(row.key,row);for(const[id,item]of fresh){const row=held.get(id),columns=row?liveChangedColumns(row.h,item):"*";if(columns==="*"||columns.size)changed.set(id,columns)}
|
|
55
55
|
const seen=[...this.rendered.keys()].filter(row=>!row.status&&row.key).sort((a,b)=>a._ri-b._ri).map(row=>row.key);const before=seen.filter(id=>position.has(id)),after=[...before].sort((a,b)=>position.get(a)- position.get(b));const moved=before.some((id,index)=>id!==after[index]);if(moved&&this.liveOpts.stableOrder&&!force){this.liveSetHeld(fresh,false);this.livePending={snapshot,pages};this.liveSyncPrompt();return{changed,removed:[],orderChanged:true,revision:snapshot.revision}}
|
|
56
|
-
this.livePending=null;this.liveMoved=false;this.liveSwap(snapshot,()=>pages,id=>position.get(id)??-1,changed,[]);this.liveSyncPrompt();return{changed,removed:[],orderChanged:false,revision:snapshot.revision}},async liveRefreshCursor(signal=this.dataLifetime.signal){const query=gridQuery(this.view,{...this.acceptedQuery,cursor:undefined,revision:undefined,limit:this.pageLength});const page=validateGridCursorPage(await this.requestPage(query,signal),this.view,query,null);if(signal.aborted)throw new DOMException("The refresh was superseded.","AbortError");if(this.destroyed||page.revision===this.snapshot.revision||page.revision===this.livePending?.revision)return null;this.livePending={cursor:true,revision:page.revision};this.liveSyncPrompt();return{changed:new Map(),removed:[],orderChanged:false,newData:true,revision:page.revision}},liveSetHeld(changes,merge){const changed=new Map(),loaded=new Set(),pages=new Set(),query=this.acceptedQuery,used=new Set(query.sort.map(sort=>sort.column));const walk=group=>{if(!group)return;for(const filter of group.filters)used.add(filter.column);group.groups.forEach(walk)};for(const filter of query.filters)used.add(filter.column);walk(query.filterGroup);const searched=!!query.search;let moved=false;for(const row of this.rowCache.values()){const change=!row.status&&changes.get(row.key);if(!change)continue;loaded.add(row.key);const after=merge?liveMerged(row.h,change):liveCopy(change),columns=liveChangedColumns(row.h,after);if(!columns.size&&liveSameRow(row.h,after))continue;row.h=after;changed.set(row.key,columns);pages.add(Math.floor(row._ri / this.pageSize) * this.pageSize);
|
|
56
|
+
this.livePending=null;this.liveMoved=false;this.liveSwap(snapshot,()=>pages,id=>position.get(id)??-1,changed,[]);this.liveSyncPrompt();return{changed,removed:[],orderChanged:false,revision:snapshot.revision}},async liveRefreshCursor(signal=this.dataLifetime.signal){const query=gridQuery(this.view,{...this.acceptedQuery,cursor:undefined,revision:undefined,limit:this.pageLength});const page=validateGridCursorPage(await this.requestPage(query,signal),this.view,query,null);if(signal.aborted)throw new DOMException("The refresh was superseded.","AbortError");if(this.destroyed||page.revision===this.snapshot.revision||page.revision===this.livePending?.revision)return null;this.livePending={cursor:true,revision:page.revision};this.liveSyncPrompt();return{changed:new Map(),removed:[],orderChanged:false,newData:true,revision:page.revision}},liveSetHeld(changes,merge){const changed=new Map(),loaded=new Set(),pages=new Set(),query=this.acceptedQuery,used=new Set(query.sort.map(sort=>sort.column));const walk=group=>{if(!group)return;for(const filter of group.filters)used.add(filter.column);group.groups.forEach(walk)};for(const filter of query.filters)used.add(filter.column);walk(query.filterGroup);for(const tuple of query.tupleFilters||[])for(const field of tuple.columns)used.add(field.column);const searched=!!query.search;let moved=false;for(const row of this.rowCache.values()){const change=!row.status&&changes.get(row.key);if(!change)continue;loaded.add(row.key);const after=merge?liveMerged(row.h,change):liveCopy(change),columns=liveChangedColumns(row.h,after);if(!columns.size&&liveSameRow(row.h,after))continue;row.h=after;changed.set(row.key,columns);pages.add(Math.floor(row._ri / this.pageSize) * this.pageSize);
|
|
57
57
|
if(searched||[...columns].some(id=>used.has(id)))moved=true}
|
|
58
58
|
if(merge&&this.livePending?.pages){for(const items of this.livePending.pages.values())for(let index=0;index<items.length;index++){const item=items[index],change=loaded.has(item.id)&&changes.get(item.id);if(!change)continue;const after=liveMerged(item,change),columns=liveChangedColumns(item,after);items[index]=after;if(!liveSameRow(item,after)&&(searched||[...columns].some(id=>used.has(id))))moved=true}
|
|
59
59
|
if(moved)this.livePending={refresh:true}}
|
|
@@ -1,45 +1,38 @@
|
|
|
1
1
|
/* The matrix view: a sticky header with column labels written upwards,sticky row headers and totals,windowed cells. */
|
|
2
2
|
.cx-matrix-host{display:block;}
|
|
3
3
|
.cx-matrix [hidden]{display:none !important;}
|
|
4
|
-
.cx-matrix{display:flex;flex-direction:column;gap:var(--cx-size-8px);box-sizing:border-box;max-height:100%;font:var(--hfx-control-font-size,calc(var(--hfx-type-body-size,0.875rem) - var(--cx-compact,0) * .0625rem))/1.35 var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));
|
|
5
|
-
--mx-line:color-mix(in srgb,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)) 70%,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));--mx-none:color-mix(in srgb,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)) 42%,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));
|
|
6
|
-
--mx-raised:color-mix(in srgb,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)) 18%,transparent);}
|
|
4
|
+
.cx-matrix{display:flex;flex-direction:column;gap:var(--cx-size-8px);box-sizing:border-box;max-height:100%;font:var(--hfx-control-font-size,calc(var(--hfx-type-body-size,0.875rem) - var(--cx-compact,0) * .0625rem))/1.35 var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));
|
|
5
|
+
--mx-line:color-mix(in srgb,var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30))) 70%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));--mx-none:color-mix(in srgb,var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d))) 42%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));
|
|
6
|
+
--mx-raised:color-mix(in srgb,var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5))) 18%,transparent);}
|
|
7
7
|
.cx-mx-bar{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-8px);}
|
|
8
|
-
.cx-mx-input{box-sizing:border-box;height:var(--cx-size-32px);padding:0 var(--cx-size-10px);font:inherit;color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));
|
|
9
|
-
border:var(--cx-size-1px) solid var(--hfx-color-border-control,light-dark(#8a8f98,#6e737c));border-radius:var(--hfx-radius-sm,4px);color-scheme:inherit;}
|
|
10
8
|
.cx-mx-search{flex:1 1 var(--cx-size-180px);max-width:var(--cx-size-320px);}
|
|
11
|
-
.cx-mx-button{box-sizing:border-box;min-height:var(--cx-size-32px);padding:0 var(--cx-size-12px);font:inherit;color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));
|
|
12
|
-
border:var(--cx-size-1px) solid var(--hfx-color-border-control,light-dark(#8a8f98,#6e737c));border-radius:var(--hfx-radius-sm,4px);cursor:pointer;}
|
|
13
|
-
.cx-mx-button:hover{background:var(--hfx-color-hover,light-dark(#f5f5f5,#232529));}
|
|
14
|
-
.cx-mx-button.cx-mx-active{border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
|
|
15
9
|
.cx-mx-switch{display:inline-flex;align-items:center;gap:var(--cx-size-6px);min-height:var(--cx-size-24px);cursor:pointer;}
|
|
16
|
-
.cx-mx-
|
|
17
|
-
.cx-mx-summary{margin-inline-start:auto;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font-size:var(--cx-size-13px);font-variant-numeric:tabular-nums;}
|
|
10
|
+
.cx-mx-summary{margin-inline-start:auto;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font-size:var(--cx-size-13px);font-variant-numeric:tabular-nums;}
|
|
18
11
|
.cx-mx-panel{position:absolute;top:calc(100% + var(--cx-size-4px));inset-inline-start:0;z-index:30;box-sizing:border-box;width:min(var(--cx-size-340px),100%);max-height:var(--cx-size-60vh);
|
|
19
|
-
overflow:auto;display:grid;gap:var(--cx-size-10px);padding:var(--cx-size-12px);background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));
|
|
12
|
+
overflow:auto;display:grid;gap:var(--cx-size-10px);padding:var(--cx-size-12px);background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));
|
|
20
13
|
border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));box-shadow:var(--hfx-elevation-2,0 1px 2px rgba(22,24,28,.05),0 6px 18px -10px rgba(22,24,28,.18));}
|
|
21
|
-
.cx-mx-field{display:grid;gap:var(--cx-size-4px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
22
|
-
.cx-mx-field .cx-mx-input{color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));}
|
|
14
|
+
.cx-mx-field{display:grid;gap:var(--cx-size-4px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
23
15
|
.cx-mx-facet{display:grid;gap:var(--cx-size-4px);margin:0;padding:0;border:0;min-width:0;}
|
|
24
|
-
.cx-mx-facet legend{padding:0 0 var(--cx-size-4px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
25
|
-
.cx-mx-keycount{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font-variant-numeric:tabular-nums;margin-inline-start:var(--cx-size-4px);}
|
|
16
|
+
.cx-mx-facet legend{padding:0 0 var(--cx-size-4px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
17
|
+
.cx-mx-keycount{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font-variant-numeric:tabular-nums;margin-inline-start:var(--cx-size-4px);}
|
|
26
18
|
.cx-mx-legend{display:flex;flex-wrap:wrap;gap:var(--cx-size-6px) var(--cx-size-16px);font-size:var(--cx-size-13px);}
|
|
27
19
|
.cx-mx-key{display:inline-flex;align-items:center;gap:var(--cx-size-6px);}
|
|
28
20
|
.cx-mx-swatch{display:inline-flex;align-items:center;justify-content:center;width:var(--cx-size-20px);height:var(--cx-size-20px);border-radius:var(--hfx-radius-sm,4px);
|
|
29
21
|
border:var(--cx-size-1px) solid var(--mx-line);flex:none;}
|
|
30
|
-
.cx-mx-swatch.cx-mx-none{background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));}
|
|
22
|
+
.cx-mx-swatch.cx-mx-none{background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
|
|
31
23
|
.cx-mx-swatch.cx-mx-none::after{content:"";width:var(--cx-size-3px);height:var(--cx-size-3px);border-radius:50%;background:var(--mx-none);}
|
|
32
|
-
.cx-mx-scroll{position:relative;flex:0 1 auto;box-sizing:border-box;width:fit-content;max-width:100%;min-height:0;max-height:var(--cx-size-100vh);overflow:auto;background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));
|
|
24
|
+
.cx-mx-scroll{position:relative;flex:0 1 auto;box-sizing:border-box;width:fit-content;max-width:100%;min-height:0;max-height:var(--cx-size-100vh);overflow:auto;background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));
|
|
33
25
|
overscroll-behavior:contain;scrollbar-color:var(--cx-scrollbar-thumb,auto) var(--cx-scrollbar-track,auto);}
|
|
26
|
+
[data-cx-chrome="embedded"] .cx-mx-scroll{border:0;border-radius:0;background:transparent;}
|
|
34
27
|
.cx-mx-head{position:sticky;top:0;z-index:3;width:var(--mx-content-w);background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
35
28
|
.cx-mx-head.cx-mx-raised{box-shadow:0 var(--cx-size-6px) var(--cx-size-8px) calc(var(--cx-size-6px) * -1) var(--mx-raised);}
|
|
36
29
|
.cx-mx-band,.cx-mx-hrow,.cx-mx-frow{position:relative;display:flex;}
|
|
37
30
|
.cx-mx-band{height:var(--mx-band-h);border-bottom:var(--cx-size-1px) solid var(--mx-line);}
|
|
38
|
-
.cx-mx-hrow{height:var(--mx-head-h);border-bottom:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
|
|
31
|
+
.cx-mx-hrow{height:var(--mx-head-h);border-bottom:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
|
|
39
32
|
.cx-mx-spacer{flex:none;width:var(--mx-cols-w);}
|
|
40
33
|
.cx-mx-corner{position:sticky;inset-inline-start:0;z-index:2;box-sizing:border-box;flex:none;width:var(--mx-head-w);display:flex;flex-direction:column;justify-content:flex-end;
|
|
41
|
-
gap:var(--cx-size-2px);padding:var(--cx-size-6px) var(--cx-size-10px);background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));border-inline-end:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));
|
|
42
|
-
font-size:var(--cx-size-12px);font-weight:600;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
34
|
+
gap:var(--cx-size-2px);padding:var(--cx-size-6px) var(--cx-size-10px);background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));border-inline-end:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));
|
|
35
|
+
font-size:var(--cx-size-12px);font-weight:600;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
43
36
|
.cx-mx-corner-columns{align-self:flex-end;}
|
|
44
37
|
.cx-mx-corner-columns::after{content:" \2192";}
|
|
45
38
|
.cx-mx-corner-rows::after{content:" \2193";}
|
|
@@ -47,23 +40,23 @@ font-size:var(--cx-size-12px);font-weight:600;color:var(--hfx-color-text-muted,l
|
|
|
47
40
|
.cx-mx-hcell{position:absolute;top:0;bottom:0;box-sizing:border-box;width:var(--mx-cell-w);contain:strict;display:flex;align-items:flex-end;justify-content:center;padding-bottom:var(--cx-size-6px);
|
|
48
41
|
border-inline-end:var(--cx-size-1px) solid var(--mx-line);font-size:var(--cx-size-12px);}
|
|
49
42
|
.cx-mx-vlabel{writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-height:calc(var(--mx-head-h) - var(--cx-size-12px));}
|
|
50
|
-
.cx-mx-bcell{position:absolute;top:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;padding:0 var(--cx-size-4px);border-inline-end:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));
|
|
43
|
+
.cx-mx-bcell{position:absolute;top:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;padding:0 var(--cx-size-4px);border-inline-end:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));
|
|
51
44
|
overflow:hidden;font-size:var(--cx-size-12px);font-weight:600;}
|
|
52
45
|
.cx-mx-bandcorner,.cx-mx-bandend{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
53
46
|
.cx-mx-bcell .cx-mx-toggle{max-width:100%;overflow:hidden;}
|
|
54
47
|
.cx-mx-bclip .cx-mx-toggle{visibility:hidden;}
|
|
55
48
|
.cx-mx-total{position:sticky;inset-inline-end:0;z-index:2;box-sizing:border-box;flex:none;width:var(--mx-total-w);display:flex;align-items:center;justify-content:flex-end;
|
|
56
|
-
padding:0 var(--cx-size-10px);background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border-inline-start:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));font-variant-numeric:tabular-nums;font-weight:600;}
|
|
57
|
-
.cx-mx-htotal{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));align-items:flex-end;padding-bottom:var(--cx-size-6px);font-size:var(--cx-size-12px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
58
|
-
.cx-mx-total.cx-mx-zero,.cx-mx-fcell.cx-mx-zero{font-weight:400;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
49
|
+
padding:0 var(--cx-size-10px);background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border-inline-start:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));font-variant-numeric:tabular-nums;font-weight:600;}
|
|
50
|
+
.cx-mx-htotal{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));align-items:flex-end;padding-bottom:var(--cx-size-6px);font-size:var(--cx-size-12px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
51
|
+
.cx-mx-total.cx-mx-zero,.cx-mx-fcell.cx-mx-zero{font-weight:400;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
59
52
|
.cx-mx-body{position:relative;width:var(--mx-content-w);}
|
|
60
53
|
.cx-mx-row{position:absolute;top:0;inset-inline-start:0;display:flex;contain:layout style;width:var(--mx-content-w);height:var(--mx-row-h);box-sizing:border-box;border-bottom:var(--cx-size-1px) solid var(--mx-line);}
|
|
61
54
|
.cx-mx-rowhead{position:sticky;inset-inline-start:0;z-index:2;box-sizing:border-box;flex:none;width:var(--mx-head-w);display:flex;align-items:center;gap:var(--cx-size-6px);
|
|
62
|
-
min-width:0;padding:0 var(--cx-size-10px);background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border-inline-end:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));white-space:nowrap;overflow:hidden;}
|
|
55
|
+
min-width:0;padding:0 var(--cx-size-10px);background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border-inline-end:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));white-space:nowrap;overflow:hidden;}
|
|
63
56
|
.cx-mx-member .cx-mx-rowhead{padding-inline-start:var(--cx-size-24px);}
|
|
64
57
|
.cx-mx-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;}
|
|
65
58
|
.cx-mx-rowhead > .cx-mx-label{flex:none;max-width:100%;}
|
|
66
|
-
.cx-mx-sub{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font-size:var(--cx-size-12px);overflow:hidden;text-overflow:ellipsis;}
|
|
59
|
+
.cx-mx-sub{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font-size:var(--cx-size-12px);overflow:hidden;text-overflow:ellipsis;}
|
|
67
60
|
.cx-mx-heading{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
68
61
|
.cx-mx-heading .cx-mx-rowhead,.cx-mx-rolledrow .cx-mx-rowhead{width:auto;min-width:var(--mx-head-w);background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));font-weight:600;}
|
|
69
62
|
.cx-mx-heading .cx-mx-total,.cx-mx-rolledrow .cx-mx-total{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
@@ -73,7 +66,7 @@ min-width:0;padding:0 var(--cx-size-10px);background:var(--hfx-color-surface,lig
|
|
|
73
66
|
.cx-mx-toggle:dir(rtl)[aria-expanded="true"]::before{transform:rotate(-90deg);}
|
|
74
67
|
.cx-mx-hcell .cx-mx-toggle{flex-direction:column;}
|
|
75
68
|
.cx-mx-cell{position:absolute;top:0;box-sizing:border-box;width:var(--mx-cell-w);height:100%;contain:strict;display:flex;align-items:center;justify-content:center;gap:var(--cx-size-2px);
|
|
76
|
-
border-inline-end:var(--cx-size-1px) solid var(--mx-line);font-size:var(--cx-size-11px);font-variant-numeric:tabular-nums;cursor:pointer;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
69
|
+
border-inline-end:var(--cx-size-1px) solid var(--mx-line);font-size:var(--cx-size-11px);font-variant-numeric:tabular-nums;cursor:pointer;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
77
70
|
.cx-mx-cell.cx-tone-danger{color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));}
|
|
78
71
|
.cx-mx-cell.cx-tone-warning{color:var(--hfx-color-status-warn-fg,light-dark(#8c5c05,#eeb640));}
|
|
79
72
|
.cx-mx-cell.cx-tone-info{color:var(--hfx-color-status-info-fg,light-dark(#2b5fc0,#74a2f7));}
|
|
@@ -86,9 +79,9 @@ border-inline-end:var(--cx-size-1px) solid var(--mx-line);font-size:var(--cx-siz
|
|
|
86
79
|
.cx-mx-attn.cx-tone-warning{--mx-bg:var(--hfx-color-status-warn-bg,light-dark(#f8efde,#3b3322));}
|
|
87
80
|
.cx-mx-attn.cx-tone-info{--mx-bg:var(--hfx-color-status-info-bg,light-dark(#e4ecfa,#262f41));}
|
|
88
81
|
.cx-mx-attn.cx-tone-success{--mx-bg:var(--hfx-color-status-good-bg,light-dark(#e2f0e9,#1f362f));}
|
|
89
|
-
.cx-mx-attn.cx-toned{color:var(--cx-t);--mx-bg:var(--cx-t-bg,color-mix(in srgb,var(--cx-t) 12%,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));}
|
|
90
|
-
.cx-host[data-cx-theme="dark"] .cx-mx-attn.cx-tone-danger{--mx-bg:color-mix(in srgb,var(--hfx-color-status-bad-bg,light-dark(#f9e4e4,#3c272a)) 62%,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
|
|
91
|
-
@media (prefers-color-scheme:dark){.cx-host[data-cx-theme="auto"] .cx-mx-attn.cx-tone-danger{--mx-bg:color-mix(in srgb,var(--hfx-color-status-bad-bg,light-dark(#f9e4e4,#3c272a)) 62%,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}}
|
|
82
|
+
.cx-mx-attn.cx-toned{color:var(--cx-t);--mx-bg:var(--cx-t-bg,color-mix(in srgb,var(--cx-t) 12%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)))));}
|
|
83
|
+
.cx-host[data-cx-theme="dark"] .cx-mx-attn.cx-tone-danger{--mx-bg:color-mix(in srgb,var(--hfx-color-status-bad-bg,light-dark(#f9e4e4,#3c272a)) 62%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));}
|
|
84
|
+
@media (prefers-color-scheme:dark){.cx-host[data-cx-theme="auto"] .cx-mx-attn.cx-tone-danger{--mx-bg:color-mix(in srgb,var(--hfx-color-status-bad-bg,light-dark(#f9e4e4,#3c272a)) 62%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));}}
|
|
92
85
|
.cx-mx-cell.cx-mx-self{cursor:default;background:repeating-linear-gradient(135deg,transparent 0 var(--cx-size-4px),var(--mx-line) var(--cx-size-4px) var(--cx-size-5px));}
|
|
93
86
|
.cx-mx-cell.cx-mx-rolled{box-shadow:inset 0 0 0 var(--cx-size-1px) var(--mx-line);}
|
|
94
87
|
.cx-mx-canvas{position:absolute;top:0;cursor:pointer;}
|
|
@@ -106,16 +99,16 @@ border-inline-end:var(--cx-size-1px) solid var(--mx-line);font-size:var(--cx-siz
|
|
|
106
99
|
border-inline-end:var(--cx-size-1px) solid var(--mx-line);font-size:var(--cx-size-11px);font-weight:600;font-variant-numeric:tabular-nums;}
|
|
107
100
|
.cx-mx-foot .cx-mx-total{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
108
101
|
.cx-matrix :is(.cx-mx-cell,.cx-mx-rowhead,.cx-mx-hcell,.cx-mx-total,.cx-mx-fcell,.cx-mx-corner):focus-visible{outline:var(--hfx-focus-width,2px) solid var(--hfx-color-focus-ring,light-dark(#02726a,#37c9b8));outline-offset:calc(var(--cx-size-2px) * -1);z-index:4;}
|
|
109
|
-
.cx-mx-empty{padding:var(--cx-size-24px);text-align:center;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));border:var(--cx-size-1px) dashed var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));}
|
|
102
|
+
.cx-mx-empty{padding:var(--cx-size-24px);text-align:center;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));border:var(--cx-size-1px) dashed var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));}
|
|
110
103
|
.cx-mx-tip{position:absolute;z-index:20;box-sizing:border-box;max-width:var(--cx-size-320px);padding:var(--cx-size-8px) var(--cx-size-10px);pointer-events:none;
|
|
111
104
|
background:var(--hfx-color-surface-raised,light-dark(#ffffff,#1e2126));border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));border-radius:var(--hfx-radius-overlay,var(--hfx-radius-lg,10px));font-size:var(--cx-size-13px);
|
|
112
105
|
box-shadow:var(--hfx-elevation-2,0 1px 2px rgba(22,24,28,.05),0 6px 18px -10px rgba(22,24,28,.18));}
|
|
113
106
|
.cx-matrix{position:relative;}
|
|
114
107
|
.cx-mx-tiptitle{font-weight:600;margin-bottom:var(--cx-size-4px);}
|
|
115
108
|
.cx-mx-tiplist,.cx-mx-details{display:grid;grid-template-columns:auto 1fr;gap:var(--cx-size-2px) var(--cx-size-10px);margin:0;}
|
|
116
|
-
.cx-mx-tiplist dt,.cx-mx-details dt{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
109
|
+
.cx-mx-tiplist dt,.cx-mx-details dt{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
117
110
|
.cx-mx-tiplist dd,.cx-mx-details dd{margin:0;overflow-wrap:anywhere;}
|
|
118
|
-
.cx-mx-dialog{box-sizing:border-box;width:min(var(--cx-size-420px),calc(100vw - var(--cx-size-32px)));padding:var(--cx-size-16px);color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));
|
|
111
|
+
.cx-mx-dialog{box-sizing:border-box;width:min(var(--cx-size-420px),calc(100vw - var(--cx-size-32px)));padding:var(--cx-size-16px);color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));
|
|
119
112
|
border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));border-radius:var(--hfx-radius-overlay,var(--hfx-radius-lg,10px));}
|
|
120
113
|
.cx-mx-dialog::backdrop{background:var(--hfx-color-overlay,light-dark(rgba(22,24,28,0.42),rgba(0,0,0,0.66)));}
|
|
121
114
|
.cx-mx-dialoghead{display:flex;align-items:center;gap:var(--cx-size-10px);margin-bottom:var(--cx-size-12px);}
|
|
@@ -123,8 +116,8 @@ border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5
|
|
|
123
116
|
.cx-mx-dialog .cx-mx-button{margin-top:var(--cx-size-16px);}
|
|
124
117
|
.cx-mx-cards{display:grid;align-content:start;gap:var(--cx-size-8px);flex:0 1 auto;min-height:0;max-height:var(--cx-size-100vh);overflow:auto;overscroll-behavior:contain;}
|
|
125
118
|
.cx-mx-cardlist,.cx-mx-cardcells{list-style:none;margin:0;padding:0;display:grid;gap:var(--cx-size-8px);}
|
|
126
|
-
.cx-mx-card{padding:var(--cx-size-10px) var(--cx-size-12px);border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));}
|
|
127
|
-
.cx-mx-cardgroup{padding:var(--cx-size-4px) 0 0;font-size:var(--cx-size-13px);font-weight:600;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
119
|
+
.cx-mx-card{padding:var(--cx-size-10px) var(--cx-size-12px);border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
|
|
120
|
+
.cx-mx-cardgroup{padding:var(--cx-size-4px) 0 0;font-size:var(--cx-size-13px);font-weight:600;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
128
121
|
.cx-mx-cardhead{display:flex;align-items:center;justify-content:space-between;gap:var(--cx-size-8px);font-weight:600;}
|
|
129
122
|
.cx-mx-card .cx-mx-total{position:static;width:auto;padding:0;border:0;background:none;}
|
|
130
123
|
.cx-mx-cardcells{gap:var(--cx-size-4px);margin-top:var(--cx-size-6px);}
|
|
@@ -141,14 +134,14 @@ border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5
|
|
|
141
134
|
.cx-matrix .cx-mx-print{display:block;}
|
|
142
135
|
.cx-matrix-host{max-height:none !important;}
|
|
143
136
|
.cx-mx-printtable{border-collapse:collapse;font-size:var(--cx-size-11px);-webkit-print-color-adjust:exact;print-color-adjust:exact;}
|
|
144
|
-
.cx-mx-printtable :is(th,td){border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));padding:var(--cx-size-2px) var(--cx-size-4px);text-align:center;}
|
|
137
|
+
.cx-mx-printtable :is(th,td){border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));padding:var(--cx-size-2px) var(--cx-size-4px);text-align:center;}
|
|
145
138
|
.cx-mx-printtable thead th{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
146
139
|
.cx-mx-printtable :is(th[scope="row"],th[scope="rowgroup"]){text-align:start;}
|
|
147
140
|
.cx-mx-printtable caption{text-align:start;font-weight:600;padding-bottom:var(--cx-size-6px);}
|
|
148
141
|
.cx-mx-printgroup > th,.cx-mx-printgroup > td,.cx-mx-printrolled > th{background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));font-weight:600;}
|
|
149
|
-
.cx-mx-printcount{font-weight:400;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
142
|
+
.cx-mx-printcount{font-weight:400;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
150
143
|
.cx-mx-printmember{padding-inline-start:var(--cx-size-16px) !important;font-weight:400;}
|
|
151
|
-
.cx-mx-printcell{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
|
|
144
|
+
.cx-mx-printcell{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
|
|
152
145
|
.cx-mx-printcell.cx-tone-danger{color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));}
|
|
153
146
|
.cx-mx-printcell.cx-tone-warning{color:var(--hfx-color-status-warn-fg,light-dark(#8c5c05,#eeb640));}
|
|
154
147
|
.cx-mx-printcell.cx-tone-info{color:var(--hfx-color-status-info-fg,light-dark(#2b5fc0,#74a2f7));}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(global){"use strict";const installed=new WeakSet();const part={version:"
|
|
1
|
+
(function(global){"use strict";const installed=new WeakSet();const part={version:"002a6d917bb4d638",install(context){if(installed.has(context.MATRIX_IMPL))return;const{MATRIX_IMPL,h,setText,fill,plural,foldText,numberFormat,gridFreeze,toneOf,applyTone,toneColors,AxisWindow,PROTOCOL}=context;const MATRIX_LABELS={matrixRows:"Rows",matrixColumns:"Columns",matrixSearch:"Find rows and columns",matrixSortBy:"Sort by",matrixGroupBy:"Group by",matrixByLabel:"Name",matrixByTotal:"Total",matrixAsListed:"As listed",matrixNoGrouping:"No groups",matrixDescending:"Descending",matrixOnlyProblems:"Only problems",matrixHideEmpty:"Hide empty rows and columns",matrixSize:"{rows} × {columns}",matrixShown:"Rows: {rows} of {totalRows}, columns: {columns} of {totalColumns}",matrixAttention:"Need attention: {count}",matrixLegend:"States",matrixFilter:"Filter",matrixClearFilters:"Clear filters",matrixNoMatches:"No rows or columns match.",matrixSelf:"Same item",matrixNoData:"No data",matrixCell:"{row} and {column}: {state}",matrixTotal:"Total",matrixItemTotal:"{item}: {count}",matrixExpandGroup:"Expand {group}",matrixCollapseGroup:"Collapse {group}",matrixGroupCount:"{count}",matrixCellCount:"Cells: {count}",matrixDetails:"Details",matrixClose:"Close",matrixValue:"Value",matrixState:"State",matrixAllClear:"Nothing needs attention",matrixShowMore:"Show more"};function matrixLabels(...sources){const labels={...MATRIX_LABELS};for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))matrixFail("labels must be an object of strings");for(const[name,text]of Object.entries(source)){if(!Object.hasOwn(labels,name)){if(/^matrix[A-Z]/.test(name)) matrixFail("there is no matrix label '" + name + "'"); continue; }
|
|
2
2
|
if(typeof text!=="string"||!/\S/.test(text)) matrixFail("label '" + name + "' must be a string with visible text");
|
|
3
3
|
labels[name]=text}}
|
|
4
4
|
return Object.freeze(labels)}
|
|
5
5
|
function matrixTemplate(text){const parts=text.split(/\{(\w+)\}/);
|
|
6
6
|
return values=>{let result=parts[0];for(let i=1;i<parts.length;i +=2)result +=(values[parts[i]]??"{"+parts[i]+ "}")+ parts[i+1];return result}}
|
|
7
7
|
function matrixFail(message){throw new Error("CanopyX: the matrix document is not valid: "+message+".")}
|
|
8
|
-
const MATRIX_DIGITS="0123456789abcdefghijklmnopqrstuvwxyz",MATRIX_NONE=255,MATRIX_SELF=254;const MATRIX_SYMBOLS=["check","cross","warning","info","dot","dash","question","clock","pause"];const MATRIX_KEYS=["protocol","type","id","label","rows","columns","square","columnTitle","diagonal","states","cells","notes","totals","attentionOnly","hideEmpty","cellWidth","density","details","phone","legend","autoHeight","labels"];const matrixObject=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);function matrixKeys(value,keys,what){if(!matrixObject(value))matrixFail(what+" must be an object");for(const key of Object.keys(value))if(!keys.includes(key))matrixFail(what+" has the unknown property '"+key+"'");return value}
|
|
8
|
+
const MATRIX_DIGITS="0123456789abcdefghijklmnopqrstuvwxyz",MATRIX_NONE=255,MATRIX_SELF=254;const MATRIX_SYMBOLS=["check","cross","warning","info","dot","dash","question","clock","pause"];const MATRIX_KEYS=["protocol","type","id","label","rows","columns","square","columnTitle","diagonal","states","cells","notes","totals","attentionOnly","hideEmpty","cellWidth","density","details","phone","legend","autoHeight","labels","timeSlider"];const matrixObject=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);function matrixKeys(value,keys,what){if(!matrixObject(value))matrixFail(what+" must be an object");for(const key of Object.keys(value))if(!keys.includes(key))matrixFail(what+" has the unknown property '"+key+"'");return value}
|
|
9
9
|
function matrixText(value,what,max,optional){if(value===undefined&&optional)return null;if(typeof value!=="string"||!/\S/.test(value) || value.length > max) matrixFail(what + " must be visible text of at most " + max + " characters");
|
|
10
10
|
return value}
|
|
11
11
|
function matrixId(value,what){if(typeof value!=="string"||!value.length||value.length>256||/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/.test(value)) matrixFail(what + " must be a nonempty id of at most 256 characters");
|
|
@@ -71,7 +71,7 @@ fitNow(){const host=this.host,style=host.style;if(this.fitInline===undefined){co
|
|
|
71
71
|
}
|
|
72
72
|
if(this.doc.autoHeight===false||Number.isNaN(this.fitMax)){if(style.maxHeight!==this.fitInline)style.maxHeight=this.fitInline;return}
|
|
73
73
|
if(!host.offsetHeight)return;const parts=[this.bar,this.legend,this.scroll,this.empty,this.cards].filter(part=>!part.hidden),hostStyle=getComputedStyle(host);let content=(parts.length-1)*(parseFloat(getComputedStyle(this.root).rowGap)||0);for(const part of parts){let height=part.getBoundingClientRect().height;if(part===this.scroll||part===this.cards)height=Math.min(height+part.scrollHeight-part.clientHeight,parseFloat(getComputedStyle(part).maxHeight)||Infinity);content +=height}
|
|
74
|
-
const chrome=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((sum,name)=>sum +(parseFloat(hostStyle[name])||0),0);const value=Math.min(this.fitMax,Math.ceil(chrome+content))+ "px";if(style.maxHeight!==value)style.maxHeight=value}}
|
|
74
|
+
const chrome=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((sum,name)=>sum +(parseFloat(hostStyle[name])||0),0);for(const sibling of host.children)if(sibling!==this.root&&!sibling.hidden)content +=sibling.getBoundingClientRect().height;const value=Math.min(this.fitMax,Math.ceil(chrome+content))+ "px";if(style.maxHeight!==value)style.maxHeight=value}}
|
|
75
75
|
Object.assign(MatrixView.prototype,{groupCount(axis,count){const template=(axis==="columns"?this.doc.columns:this.doc.rows).groupCount||this.labels.matrixGroupCount;return fill(plural(template,count,this.lang),{count:this.format.format(count)})},scheduleRender(){if(this.destroyed||this.frame)return;this.frame=requestAnimationFrame(()=>{this.frame=0;this.render()})},recycleAll(){this.lookCache=null;for(const row of this.rowsMounted.values())this.releaseRow(row);this.rowsMounted.clear();for(const map of[this.headMounted,this.footMounted,this.bandMounted]){for(const element of map.values())element.remove();map.clear()}},releaseRow(row){row.remove();row._key=null;if(this.rowPool.length<200)this.rowPool.push(row)},windows(){const scroll=this.scroll,viewH=Math.max(this.rowH,scroll.clientHeight-this.headH-this.bandH-this.footH),viewW=Math.max(this.cellW,scroll.clientWidth-this.rowHeadW-this.totalW);const rows=this.rowWindow.window(scroll.scrollTop,viewH,MATRIX_OVERSCAN),columns=this.columnWindow.window(Math.abs(scroll.scrollLeft),viewW,MATRIX_OVERSCAN);return{rows,columns,viewH,viewW}},render(){if(this.destroyed||this.scroll.hidden)return;const{rows,columns}=this.windows(),model=this.model,focus=this.focus,scroll=this.scroll,top=scroll.scrollTop;const below=scroll.scrollHeight-scroll.clientHeight-top>1;this.head.classList.toggle("cx-mx-raised",top>0);this.foot.classList.toggle("cx-mx-raised",below);const columnList=[];for(let c=columns.first;c<=columns.last;c++)columnList.push(c);if(focus.column>=0&&focus.column<model.columns.length&&(focus.column<columns.first||focus.column>columns.last))columnList.push(focus.column);const rowList=[];for(let r=rows.first;r<=rows.last;r++)rowList.push(r);if(focus.row>=0&&focus.row<model.rows.length&&(focus.row<rows.first||focus.row>rows.last))rowList.push(focus.row);this.paintHeader(columnList);this.paintBand(columns);this.placeBands();this.paintFoot(columnList);const keep=new Set();for(const r of rowList){const entry=model.rows[r];if(!entry)continue;keep.add(entry.key);let row=this.rowsMounted.get(entry.key);if(!row){row=this.rowPool.pop()||this.newRow();this.rowsMounted.set(entry.key,row);this.fillRow(row,entry,r);this.body.appendChild(row)}
|
|
76
76
|
else if(row._index!==r)this.placeRow(row,r);this.drawRow(row,entry,columns.first,entry.kind==="heading"?-1:columns.last)}
|
|
77
77
|
for(const[key,row]of this.rowsMounted)if(!keep.has(key)){this.releaseRow(row);this.rowsMounted.delete(key)}
|
|
@@ -113,27 +113,27 @@ event.preventDefault();this.moveTo(next[0],next[1])},onFocus(event){const elemen
|
|
|
113
113
|
if(event.target.closest("a"))return;const target=this.cellAt(event);if(target){this.focus={row:target._r,column:target._c};this.render();const cell=this.focusElement(target._r,target._c);cell?.focus({preventScroll:true});this.openCell(cell||target)}},activate(element){if(!element)return;const toggle=element.querySelector(".cx-mx-toggle");if(toggle&&toggle._group){this.toggleGroup(toggle._group.axis,toggle._group.key);return}
|
|
114
114
|
const link=element.querySelector("a[href]");if(link){link.click();return}
|
|
115
115
|
if(element.classList.contains("cx-mx-cell")){this.openCell(element);return}
|
|
116
|
-
const entry=element.classList.contains("cx-mx-hcell")&&this.model.columns[element._c];if(entry&&entry.band)this.toggleGroup("columns",entry.band.key)},toggleGroup(axis,key){const list=this.query.collapsed[axis],at=list.indexOf(key);if(at>=0)list.splice(at,1);else list.push(key);const entryKey="g"+key;this.derive(true);const index=(axis==="rows"?this.model.rows:this.model.columns).findIndex(entry=>entry.key===entryKey||entry.band&&entry.band.key===key);if(index>=0)this.moveTo(axis==="rows"?index:this.focus.row,axis==="rows"?-1:index);this.stateChanged()}});Object.assign(MatrixView.prototype,{buildBar(){const labels=this.labels,signal=this.lifetime.signal,bar=this.bar;const search=this.searchInput=h("input","cx-mx-input cx-mx-search");search.type="search";search.placeholder=labels.matrixSearch;search.setAttribute("aria-label",labels.matrixSearch);search.autocomplete="off";search.addEventListener("input",()=>{clearTimeout(this.searchTimer);this.searchTimer=setTimeout(()=>this.setQuery({search:search.value}),150)},{signal});this.axisButtons={};for(const axis of MATRIX_AXES){const button=h("button","cx-mx-button");button.type="button";button.setAttribute("aria-haspopup","dialog");button.setAttribute("aria-expanded","false");button.addEventListener("click",()=>this.togglePanel(axis),{signal});this.axisButtons[axis]=button}
|
|
117
|
-
const toggle=this.attentionToggle=h("input","cx-mx-check"),switchLabel=h("label","cx-mx-switch"),switchText=h("span");toggle.type="checkbox";setText(switchText,labels.matrixOnlyProblems);switchLabel.append(toggle,switchText);toggle.addEventListener("change",()=>this.setQuery({attentionOnly:toggle.checked}),{signal});this.attentionSwitch=switchLabel;this.attentionText=switchText;const empty=this.emptyToggle=h("input","cx-mx-check"),emptyLabel=this.emptySwitch=h("label","cx-mx-switch"),emptyText=this.emptyText=h("span");empty.type="checkbox";setText(emptyText,labels.matrixHideEmpty);emptyLabel.append(empty,emptyText);empty.addEventListener("change",()=>this.setQuery({hideEmpty:empty.checked}),{signal});const clear=this.clearButton=h("button","cx-mx-button cx-mx-clear");clear.type="button";setText(clear,labels.matrixClearFilters);clear.addEventListener("click",()=>{search.value="";this.setQuery({search:"",filters:{rows:{},columns:{}},attentionOnly:false});search.focus()},{signal});this.summary=h("span","cx-mx-summary");this.summary.setAttribute("aria-live","off");this.panel=h("div","cx-mx-panel");this.panel.setAttribute("role","dialog");this.panel.hidden=true;document.addEventListener("keydown",event=>{if(event.key==="Escape"&&!this.panel.hidden&&!event.defaultPrevented){event.preventDefault();this.closePanel(true)}},{signal});document.addEventListener("pointerdown",event=>{if(!this.panel.hidden&&!this.panel.contains(event.target)&&!Object.values(this.axisButtons).includes(event.target.closest("button")))this.closePanel(false)},{signal});bar.append(search,this.axisButtons.rows,this.axisButtons.columns,switchLabel,emptyLabel,clear,this.summary,this.panel)},refreshBar(){const labels=this.labels;this.searchInput.placeholder=labels.matrixSearch;this.searchInput.setAttribute("aria-label",labels.matrixSearch);setText(this.attentionText,labels.matrixOnlyProblems);setText(this.clearButton,labels.matrixClearFilters);this.attentionSwitch.hidden=!this.doc.states.some(state=>state.attention);setText(this.emptyText,labels.matrixHideEmpty);this.emptySwitch.hidden=!this.doc.sparse},axisTitle(axis){return axis==="rows"?this.doc.rows.title||this.labels.matrixRows:this.doc.columnTitle||this.labels.matrixColumns},activeFilters(axis){return Object.values(this.query.filters[axis]).reduce((sum,values)=>sum +(values&&values.length?1:0),0)},syncBar(){const query=this.query;for(const axis of MATRIX_AXES){const count=this.activeFilters(axis),button=this.axisButtons[axis];setText(button,this.axisTitle(axis)+(count?" ("+count+")":""));button.classList.toggle("
|
|
116
|
+
const entry=element.classList.contains("cx-mx-hcell")&&this.model.columns[element._c];if(entry&&entry.band)this.toggleGroup("columns",entry.band.key)},toggleGroup(axis,key){const list=this.query.collapsed[axis],at=list.indexOf(key);if(at>=0)list.splice(at,1);else list.push(key);const entryKey="g"+key;this.derive(true);const index=(axis==="rows"?this.model.rows:this.model.columns).findIndex(entry=>entry.key===entryKey||entry.band&&entry.band.key===key);if(index>=0)this.moveTo(axis==="rows"?index:this.focus.row,axis==="rows"?-1:index);this.stateChanged()}});Object.assign(MatrixView.prototype,{buildBar(){const labels=this.labels,signal=this.lifetime.signal,bar=this.bar;const search=this.searchInput=h("input","cx-input cx-mx-input cx-mx-search");search.type="search";search.placeholder=labels.matrixSearch;search.setAttribute("aria-label",labels.matrixSearch);search.autocomplete="off";search.addEventListener("input",()=>{clearTimeout(this.searchTimer);this.searchTimer=setTimeout(()=>this.setQuery({search:search.value}),150)},{signal});this.axisButtons={};for(const axis of MATRIX_AXES){const button=h("button","cx-btn cx-mx-button");button.type="button";button.setAttribute("aria-haspopup","dialog");button.setAttribute("aria-expanded","false");button.addEventListener("click",()=>this.togglePanel(axis),{signal});this.axisButtons[axis]=button}
|
|
117
|
+
const toggle=this.attentionToggle=h("input","cx-check cx-mx-check"),switchLabel=h("label","cx-mx-switch"),switchText=h("span");toggle.type="checkbox";setText(switchText,labels.matrixOnlyProblems);switchLabel.append(toggle,switchText);toggle.addEventListener("change",()=>this.setQuery({attentionOnly:toggle.checked}),{signal});this.attentionSwitch=switchLabel;this.attentionText=switchText;const empty=this.emptyToggle=h("input","cx-check cx-mx-check"),emptyLabel=this.emptySwitch=h("label","cx-mx-switch"),emptyText=this.emptyText=h("span");empty.type="checkbox";setText(emptyText,labels.matrixHideEmpty);emptyLabel.append(empty,emptyText);empty.addEventListener("change",()=>this.setQuery({hideEmpty:empty.checked}),{signal});const clear=this.clearButton=h("button","cx-btn cx-mx-button cx-mx-clear");clear.type="button";setText(clear,labels.matrixClearFilters);clear.addEventListener("click",()=>{search.value="";this.setQuery({search:"",filters:{rows:{},columns:{}},attentionOnly:false});search.focus()},{signal});this.summary=h("span","cx-mx-summary");this.summary.setAttribute("aria-live","off");this.panel=h("div","cx-mx-panel");this.panel.setAttribute("role","dialog");this.panel.hidden=true;document.addEventListener("keydown",event=>{if(event.key==="Escape"&&!this.panel.hidden&&!event.defaultPrevented){event.preventDefault();this.closePanel(true)}},{signal});document.addEventListener("pointerdown",event=>{if(!this.panel.hidden&&!this.panel.contains(event.target)&&!Object.values(this.axisButtons).includes(event.target.closest("button")))this.closePanel(false)},{signal});bar.append(search,this.axisButtons.rows,this.axisButtons.columns,switchLabel,emptyLabel,clear,this.summary,this.panel)},refreshBar(){const labels=this.labels;this.searchInput.placeholder=labels.matrixSearch;this.searchInput.setAttribute("aria-label",labels.matrixSearch);setText(this.attentionText,labels.matrixOnlyProblems);setText(this.clearButton,labels.matrixClearFilters);this.attentionSwitch.hidden=!this.doc.states.some(state=>state.attention);setText(this.emptyText,labels.matrixHideEmpty);this.emptySwitch.hidden=!this.doc.sparse},axisTitle(axis){return axis==="rows"?this.doc.rows.title||this.labels.matrixRows:this.doc.columnTitle||this.labels.matrixColumns},activeFilters(axis){return Object.values(this.query.filters[axis]).reduce((sum,values)=>sum +(values&&values.length?1:0),0)},syncBar(){const query=this.query;for(const axis of MATRIX_AXES){const count=this.activeFilters(axis),button=this.axisButtons[axis];setText(button,this.axisTitle(axis)+(count?" ("+count+")":""));button.classList.toggle("active",!!count||!!query.group[axis])}
|
|
118
118
|
this.attentionToggle.checked=query.attentionOnly;this.emptyToggle.checked=query.hideEmpty;if(this.searchInput.value!==query.search&&document.activeElement!==this.searchInput)this.searchInput.value=query.search;this.clearButton.hidden=!(query.search||query.attentionOnly||this.activeFilters("rows")||this.activeFilters("columns"));setText(this.summary,this.summaryText());if(!this.panel.hidden)this.fillPanel(this.panelAxis)},summaryText(){const labels=this.labels,model=this.model,doc=this.doc,f=value=>this.format.format(value);const filtered=model.visible.rows!==doc.rows.items.length||model.visible.columns!==doc.columns.items.length;const size=filtered?fill(labels.matrixShown,{rows:f(model.visible.rows),totalRows:f(doc.rows.items.length),columns:f(model.visible.columns),totalColumns:f(doc.columns.items.length)}):
|
|
119
119
|
fill(labels.matrixSize,{rows:f(model.visible.rows),columns:f(model.visible.columns)});let attention=0;doc.states.forEach((state,index)=>{if(state.attention)attention +=model.counts[index]});return size +(doc.states.some(state=>state.attention)?" · "+fill(labels.matrixAttention,{count:f(attention)}):"")},paintLegend(){if(!this.doc.legend)return;const items=[],counts=this.model.counts;this.doc.states.forEach((state,index)=>{const item=h("span","cx-mx-key"),swatch=h("span","cx-mx-swatch" +(state.attention?" cx-mx-attn":"")),text=h("span"),count=h("span","cx-mx-keycount");item.setAttribute("role","listitem");applyTone(swatch,swatch.className,toneOf(state.tone));const symbol=matrixSymbol(state.symbol);if(symbol)swatch.appendChild(symbol);setText(text,state.label);setText(count,this.format.format(counts[index]));item.append(swatch,text,count);items.push(item)});const none=counts[this.doc.states.length];if(none){const item=h("span","cx-mx-key"),swatch=h("span","cx-mx-swatch cx-mx-none"),text=h("span"),count=h("span","cx-mx-keycount");item.setAttribute("role","listitem");setText(text,this.labels.matrixNoData);setText(count,this.format.format(none));item.append(swatch,text,count);items.push(item)}
|
|
120
120
|
this.legend.replaceChildren(...items)},togglePanel(axis){if(!this.panel.hidden&&this.panelAxis===axis){this.closePanel(true);return}
|
|
121
|
-
this.panelAxis=axis;this.fillPanel(axis);this.panel.hidden=false;for(const name of MATRIX_AXES)this.axisButtons[name].setAttribute("aria-expanded",String(name===axis));this.panel.querySelector("select,input")?.focus()},closePanel(returnFocus){if(this.panel.hidden)return;this.panel.hidden=true;for(const name of MATRIX_AXES)this.axisButtons[name].setAttribute("aria-expanded","false");if(returnFocus)this.axisButtons[this.panelAxis].focus()},fillPanel(axis){const labels=this.labels,doc=this.doc,data=doc[axis==="rows"?"rows":"columns"],query=this.query,panel=this.panel,signal=this.lifetime.signal;panel.setAttribute("aria-label",this.axisTitle(axis));const focused=panel.contains(document.activeElement)?document.activeElement.dataset.cxControl:null;const field=(text,control)=>{const label=h("label","cx-mx-field"),name=h("span");setText(name,text);label.append(name,control);return label};const select=(options,value,change,key)=>{const element=h("select","cx-mx-input");element.dataset.cxControl=key;for(const[optionValue,text]of options){const option=h("option");option.value=optionValue;setText(option,text);element.appendChild(option)}
|
|
122
|
-
element.value=value;element.addEventListener("change",()=>change(element.value),{signal});return element};const sort=query.sort[axis];const sortBy=select([["",labels.matrixAsListed],["#label",labels.matrixByLabel],["#total",labels.matrixByTotal],...data.attributes.map(attribute=>[attribute.id,attribute.title])],sort?sort.by:"",value=>this.sort(axis,value||null,value==="#total"?"desc":query.sort[axis]?.direction||"asc"),"sort");const descending=h("input","cx-mx-check");descending.type="checkbox";descending.checked=!!sort&&sort.direction==="desc";descending.disabled=!sort;descending.dataset.cxControl="direction";descending.addEventListener("change",()=>this.sort(axis,query.sort[axis]?.by||null,descending.checked?"desc":"asc"),{signal});const descendingLabel=h("label","cx-mx-switch"),descendingText=h("span");setText(descendingText,labels.matrixDescending);descendingLabel.append(descending,descendingText);const groupBy=select([["",labels.matrixNoGrouping],...data.attributes.map(attribute=>[attribute.id,attribute.title])],query.group[axis]||"",value=>this.group(axis,value||null),"group");const children=[field(labels.matrixSortBy,sortBy),descendingLabel];if(data.attributes.length)children.push(field(labels.matrixGroupBy,groupBy));for(const attribute of data.attributes.filter(item=>item.facet))children.push(this.facetList(axis,data,attribute));const close=h("button","cx-mx-button");close.type="button";setText(close,labels.matrixClose);close.dataset.cxControl="close";close.addEventListener("click",()=>this.closePanel(true),{signal});children.push(close);panel.replaceChildren(...children);if(focused)panel.querySelector('[data-cx-control="'+CSS.escape(focused)+ '"]')?.focus()},facetList(axis,data,attribute){const set=h("fieldset","cx-mx-facet"),legend=h("legend"),counts=new Map(),chosen=new Set(this.query.filters[axis][attribute.id]||[]),signal=this.lifetime.signal;setText(legend,attribute.title);set.appendChild(legend);for(const item of data.items){const key=matrixValueKey(item.values[attribute.id]);if(!counts.has(key))counts.set(key,{key,text:matrixValueText(item.values[attribute.id],attribute,this.format)||"—",count:0});counts.get(key).count++}
|
|
123
|
-
for(const value of[...counts.values()].sort((a,b)=>matrixNatural(a.text,b.text)).slice(0,200)){const label=h("label","cx-mx-switch"),box=h("input","cx-mx-check"),text=h("span"),count=h("span","cx-mx-keycount");box.type="checkbox";box.checked=chosen.has(value.key);box.dataset.cxControl="facet:"+attribute.id+":"+value.key;box.addEventListener("change",()=>{const next=new Set(this.query.filters[axis][attribute.id]||[]);if(box.checked)next.add(value.key);else next.delete(value.key);this.filter(axis,attribute.id,[...next])},{signal});setText(text,value.text);setText(count,this.format.format(value.count));label.append(box,text,count);set.appendChild(label)}
|
|
121
|
+
this.panelAxis=axis;this.fillPanel(axis);this.panel.hidden=false;for(const name of MATRIX_AXES)this.axisButtons[name].setAttribute("aria-expanded",String(name===axis));this.panel.querySelector("select,input")?.focus()},closePanel(returnFocus){if(this.panel.hidden)return;this.panel.hidden=true;for(const name of MATRIX_AXES)this.axisButtons[name].setAttribute("aria-expanded","false");if(returnFocus)this.axisButtons[this.panelAxis].focus()},fillPanel(axis){const labels=this.labels,doc=this.doc,data=doc[axis==="rows"?"rows":"columns"],query=this.query,panel=this.panel,signal=this.lifetime.signal;panel.setAttribute("aria-label",this.axisTitle(axis));const focused=panel.contains(document.activeElement)?document.activeElement.dataset.cxControl:null;const field=(text,control)=>{const label=h("label","cx-mx-field"),name=h("span");setText(name,text);label.append(name,control);return label};const select=(options,value,change,key)=>{const element=h("select","cx-select cx-mx-input");element.dataset.cxControl=key;for(const[optionValue,text]of options){const option=h("option");option.value=optionValue;setText(option,text);element.appendChild(option)}
|
|
122
|
+
element.value=value;element.addEventListener("change",()=>change(element.value),{signal});return element};const sort=query.sort[axis];const sortBy=select([["",labels.matrixAsListed],["#label",labels.matrixByLabel],["#total",labels.matrixByTotal],...data.attributes.map(attribute=>[attribute.id,attribute.title])],sort?sort.by:"",value=>this.sort(axis,value||null,value==="#total"?"desc":query.sort[axis]?.direction||"asc"),"sort");const descending=h("input","cx-mx-check");descending.type="checkbox";descending.checked=!!sort&&sort.direction==="desc";descending.disabled=!sort;descending.dataset.cxControl="direction";descending.addEventListener("change",()=>this.sort(axis,query.sort[axis]?.by||null,descending.checked?"desc":"asc"),{signal});const descendingLabel=h("label","cx-mx-switch"),descendingText=h("span");setText(descendingText,labels.matrixDescending);descendingLabel.append(descending,descendingText);const groupBy=select([["",labels.matrixNoGrouping],...data.attributes.map(attribute=>[attribute.id,attribute.title])],query.group[axis]||"",value=>this.group(axis,value||null),"group");const children=[field(labels.matrixSortBy,sortBy),descendingLabel];if(data.attributes.length)children.push(field(labels.matrixGroupBy,groupBy));for(const attribute of data.attributes.filter(item=>item.facet))children.push(this.facetList(axis,data,attribute));const close=h("button","cx-btn cx-mx-button");close.type="button";setText(close,labels.matrixClose);close.dataset.cxControl="close";close.addEventListener("click",()=>this.closePanel(true),{signal});children.push(close);panel.replaceChildren(...children);if(focused)panel.querySelector('[data-cx-control="'+CSS.escape(focused)+ '"]')?.focus()},facetList(axis,data,attribute){const set=h("fieldset","cx-mx-facet"),legend=h("legend"),counts=new Map(),chosen=new Set(this.query.filters[axis][attribute.id]||[]),signal=this.lifetime.signal;setText(legend,attribute.title);set.appendChild(legend);for(const item of data.items){const key=matrixValueKey(item.values[attribute.id]);if(!counts.has(key))counts.set(key,{key,text:matrixValueText(item.values[attribute.id],attribute,this.format)||"—",count:0});counts.get(key).count++}
|
|
123
|
+
for(const value of[...counts.values()].sort((a,b)=>matrixNatural(a.text,b.text)).slice(0,200)){const label=h("label","cx-mx-switch"),box=h("input","cx-check cx-mx-check"),text=h("span"),count=h("span","cx-mx-keycount");box.type="checkbox";box.checked=chosen.has(value.key);box.dataset.cxControl="facet:"+attribute.id+":"+value.key;box.addEventListener("change",()=>{const next=new Set(this.query.filters[axis][attribute.id]||[]);if(box.checked)next.add(value.key);else next.delete(value.key);this.filter(axis,attribute.id,[...next])},{signal});setText(text,value.text);setText(count,this.format.format(value.count));label.append(box,text,count);set.appendChild(label)}
|
|
124
124
|
return set}});Object.assign(MatrixView.prototype,{cellInfo(cell){const row=this.model.rows[cell._r],column=this.model.columns[cell._c];if(!row||!column)return null;const info=this.model.cell(row,column),state=info.state<MATRIX_SELF?this.doc.states[info.state]:null;return{row,column,info,state}},cellLines(data){const labels=this.labels,lines=[],note=data.info.note;const stateText=data.state?data.state.label:data.info.state===MATRIX_SELF?labels.matrixSelf:labels.matrixNoData;lines.push([labels.matrixState,stateText]);if(note&¬e.value!=null)lines.push([labels.matrixValue,this.format.format(note.value)]);if(note&¬e.text)lines.push([note.value!=null?"":labels.matrixValue,note.text]);if(data.info.rolled){lines.push(["",fill(labels.matrixCellCount,{count:this.format.format(data.info.members)})]);if(data.info.attention)lines.push(["",fill(labels.matrixAttention,{count:this.format.format(data.info.attention)})])}
|
|
125
125
|
if(note&¬e.title)lines.push(["",note.title]);for(const[label,value]of note&¬e.details||[])lines.push([label,value]);return lines},onPointer(event){const target=this.cellAt(event);if(target&&this.pointerCell&&target._r===this.pointerCell._r&&target._c===this.pointerCell._c)return;this.pointerCell=target;this.hoverCell(target);clearTimeout(this.tipTimer);if(!target){if(!this.tipKeyboard)this.hideTip();return}
|
|
126
126
|
this.tipTimer=setTimeout(()=>{if(!this.destroyed&&this.pointerCell===target)this.showTip(target,false)},250)},showTip(cell,keyboard){const data=this.cellInfo(cell);if(!data)return;this.tipKeyboard=keyboard;const tip=this.tip,title=h("div","cx-mx-tiptitle"),list=h("dl","cx-mx-tiplist");setText(title,data.row.label+" · "+data.column.label);for(const[label,value]of this.cellLines(data).slice(0,8)){const term=h("dt"),text=h("dd");setText(term,label);setText(text,value);list.append(term,text)}
|
|
127
127
|
tip.replaceChildren(title,list);tip.hidden=false;const box=this.cellRect(cell._r,cell._c),frame=this.root.getBoundingClientRect(),width=tip.offsetWidth,height=tip.offsetHeight;if(!box){this.hideTip();return}
|
|
128
128
|
let left=box.left-frame.left+box.width / 2 - width / 2, top = box.bottom - frame.top + 6;
|
|
129
129
|
left=Math.max(4,Math.min(left,frame.width-width-4));if(box.bottom+height+10>global.innerHeight&&box.top-height-6>0)top=box.top-frame.top-height-6;tip.style.left=left+"px";tip.style.top=top+"px"},hideTip(){clearTimeout(this.tipTimer);this.tip.hidden=true;this.tipKeyboard=false;this.pointerCell=null;this.hoverElement?.remove()},openCell(cell){const data=this.cellInfo(cell);if(!data)return;this.hideTip();const note=data.info.note,member=entry=>entry.kind==="item"?entry.item.id:null,group=entry=>entry.kind==="item"?null:entry.group.key;const detail=Object.freeze({matrix:this.doc.id,row:member(data.row),rowGroup:group(data.row),column:member(data.column),columnGroup:group(data.column),state:data.state?data.state.id:data.info.state===MATRIX_SELF?"self":null,value:note?note.value:null,text:note?note.text:null,title:note?note.title:null,details:note&¬e.details?note.details.map(pair=>[...pair]):[],members:data.info.members,attention:data.info.attention});if(!this.emit("matrixCell",detail,"onCell",true)||this.doc.details==="host")return;this.openDialog(data,cell)},openDialog(data,cell){const labels=this.labels,dialog=this.dialog||=this.buildDialog();setText(dialog._title,data.row.label+" · "+data.column.label);const rows=[];for(const[label,value]of this.cellLines(data)){const term=h("dt"),text=h("dd");setText(term,label);setText(text,value);rows.push(term,text)}
|
|
130
|
-
dialog._list.replaceChildren(...rows);const state=data.state,badge=dialog._state;badge.replaceChildren();applyTone(badge,"cx-mx-swatch" +(state&&state.attention?" cx-mx-attn":""),toneOf(state?state.tone:null));const symbol=state&&matrixSymbol(state.symbol);if(symbol)badge.appendChild(symbol);setText(dialog._close,labels.matrixClose);if(typeof dialog.showModal==="function")dialog.showModal();else dialog.setAttribute("open","");dialog._close.focus()},buildDialog(){const dialog=h("dialog","cx-mx-dialog"),head=h("div","cx-mx-dialoghead"),title=h("h2","cx-mx-dialogtitle"),state=h("span","cx-mx-swatch"),list=h("dl","cx-mx-details");const close=h("button","cx-mx-button"),signal=this.lifetime.signal;title.id=(this.host.id||"cx-matrix")+ "-"+Math.random().toString(36).slice(2)+ "-title";dialog.setAttribute("aria-labelledby",title.id);close.type="button";close.addEventListener("click",()=>dialog.close?dialog.close():dialog.removeAttribute("open"),{signal});dialog.addEventListener("close",()=>{if(!this.destroyed)this.moveTo(this.focus.row,this.focus.column,true,false)},{signal});head.append(state,title);dialog.append(head,list,close);dialog._title=title;dialog._list=list;dialog._close=close;dialog._state=state;this.root.appendChild(dialog);return dialog}});const MATRIX_GLYPHS={check:"✓",cross:"✕",warning:"!",info:"i",dot:"•",dash:"–",question:"?",clock:"◷",pause:"‖"};Object.assign(MatrixView.prototype,{attentionCells(row){const cells=[];for(const column of this.model.columns){const info=this.model.cell(row,column);if(info.state<MATRIX_SELF&&this.doc.attention[info.state])cells.push({column,info,state:this.doc.states[info.state]})}
|
|
130
|
+
dialog._list.replaceChildren(...rows);const state=data.state,badge=dialog._state;badge.replaceChildren();applyTone(badge,"cx-mx-swatch" +(state&&state.attention?" cx-mx-attn":""),toneOf(state?state.tone:null));const symbol=state&&matrixSymbol(state.symbol);if(symbol)badge.appendChild(symbol);setText(dialog._close,labels.matrixClose);if(typeof dialog.showModal==="function")dialog.showModal();else dialog.setAttribute("open","");dialog._close.focus()},buildDialog(){const dialog=h("dialog","cx-mx-dialog"),head=h("div","cx-mx-dialoghead"),title=h("h2","cx-mx-dialogtitle"),state=h("span","cx-mx-swatch"),list=h("dl","cx-mx-details");const close=h("button","cx-btn cx-mx-button"),signal=this.lifetime.signal;title.id=(this.host.id||"cx-matrix")+ "-"+Math.random().toString(36).slice(2)+ "-title";dialog.setAttribute("aria-labelledby",title.id);close.type="button";close.addEventListener("click",()=>dialog.close?dialog.close():dialog.removeAttribute("open"),{signal});dialog.addEventListener("close",()=>{if(!this.destroyed)this.moveTo(this.focus.row,this.focus.column,true,false)},{signal});head.append(state,title);dialog.append(head,list,close);dialog._title=title;dialog._list=list;dialog._close=close;dialog._state=state;this.root.appendChild(dialog);return dialog}});const MATRIX_GLYPHS={check:"✓",cross:"✕",warning:"!",info:"i",dot:"•",dash:"–",question:"?",clock:"◷",pause:"‖"};Object.assign(MatrixView.prototype,{attentionCells(row){const cells=[];for(const column of this.model.columns){const info=this.model.cell(row,column);if(info.state<MATRIX_SELF&&this.doc.attention[info.state])cells.push({column,info,state:this.doc.states[info.state]})}
|
|
131
131
|
return cells},renderCards(){const labels=this.labels,list=h("ul","cx-mx-cardlist"),limit=this.cardLimit||=100,rows=this.model.rows.filter(entry=>entry.kind!=="heading");let group=null;for(const entry of rows.slice(0,limit)){if(entry.band&&entry.band!==group){group=entry.band;const heading=h("li","cx-mx-cardgroup");setText(heading,group.label);list.appendChild(heading)}
|
|
132
132
|
const card=h("li","cx-mx-card"),head=h("div","cx-mx-cardhead"),title=h("span","cx-mx-label"),total=h("span","cx-mx-total" +(entry.total?"":" cx-mx-zero"));setText(title,entry.label);setText(total,this.format.format(entry.total||0));total.setAttribute("aria-label",fill(labels.matrixItemTotal,{item:entry.label,count:this.format.format(entry.total||0)}));head.append(title,total);card.appendChild(head);if(entry.kind==="item"&&entry.item.secondary){const sub=h("div","cx-mx-sub");setText(sub,entry.item.secondary);card.appendChild(sub)}
|
|
133
133
|
const cells=this.attentionCells(entry),items=h("ul","cx-mx-cardcells");for(const{column,info,state}of cells.slice(0,12)){const item=h("li","cx-mx-cardcell"),swatch=h("span","cx-mx-swatch cx-mx-attn"),text=h("span");applyTone(swatch,swatch.className,toneOf(state.tone));const symbol=matrixSymbol(state.symbol);if(symbol)swatch.appendChild(symbol);const note=info.note,extra=note&¬e.text?note.text:note&¬e.value!=null?this.format.format(note.value):"";setText(text,column.label+" · "+state.label +(extra?" · "+extra:""));item.append(swatch,text);items.appendChild(item)}
|
|
134
134
|
if(cells.length>12){const more=h("li","cx-mx-sub");setText(more,"+"+this.format.format(cells.length-12));items.appendChild(more)}
|
|
135
135
|
if(!cells.length){const clear=h("div","cx-mx-sub cx-mx-clear-text");setText(clear,labels.matrixAllClear);card.appendChild(clear)}else card.appendChild(items);list.appendChild(card)}
|
|
136
|
-
const children=[list];if(rows.length>limit){const more=h("button","cx-mx-button");more.type="button";setText(more,labels.matrixShowMore);more.addEventListener("click",()=>{this.cardLimit +=100;this.renderCards()},{signal:this.lifetime.signal});children.push(more)}
|
|
136
|
+
const children=[list];if(rows.length>limit){const more=h("button","cx-btn cx-mx-button");more.type="button";setText(more,labels.matrixShowMore);more.addEventListener("click",()=>{this.cardLimit +=100;this.renderCards()},{signal:this.lifetime.signal});children.push(more)}
|
|
137
137
|
this.cards.replaceChildren(...children)},stateGlyph(info){if(info.state===MATRIX_SELF)return "";if(info.state===MATRIX_NONE)return "";const state=this.doc.states[info.state];return(MATRIX_GLYPHS[state.symbol]||"")+(info.note&&info.note.text?" "+info.note.text:info.note&&info.note.value!=null?" "+this.format.format(info.note.value):"")},printCell(info){const td=h("td"),state=info.state<MATRIX_SELF?this.doc.states[info.state]:null,labels=this.labels;setText(td,info.state===MATRIX_NONE?"·":this.stateGlyph(info)+(info.rolled&&info.attention?" "+this.format.format(info.attention):""));td.title=state?state.label:info.state===MATRIX_SELF?labels.matrixSelf:labels.matrixNoData;if(state)applyTone(td,"cx-mx-printcell" +(state.attention?" cx-mx-attn":""),toneOf(state.tone));else td.className=info.state===MATRIX_SELF?"cx-mx-printself":"cx-mx-printnone";return td},printHead(table,columns){const head=h("thead"),colgroup=span=>{const group=h("colgroup");group.span=span;table.appendChild(group)};if(columns.some(entry=>entry.band)){const band=h("tr");band.appendChild(h("td"));colgroup(1);for(let c=0;c<columns.length;){const group=columns[c].band,th=h(group?"th":"td");let span=1;if(group){while(c+span<columns.length&&columns[c+span].band===group)span++;const count=h("span","cx-mx-printcount");th.scope="colgroup";setText(th,group.label);setText(count," · "+this.groupCount("columns",group.members.length));th.appendChild(count)}
|
|
138
138
|
th.colSpan=span;band.appendChild(th);colgroup(span);c +=span}
|
|
139
139
|
if(this.totalW){band.appendChild(h("td"));colgroup(1)}
|
|
@@ -157,4 +157,4 @@ if(state.attentionOnly!==undefined)next.attentionOnly=!!state.attentionOnly;if(s
|
|
|
157
157
|
if(state.collapsed&&state.collapsed[axis]!==undefined){if(!Array.isArray(state.collapsed[axis])||state.collapsed[axis].some(key=>typeof key!=="string"))throw new Error("CanopyX: collapsed groups are a list of group keys.");next.collapsed[axis]=[...new Set(state.collapsed[axis])]}}
|
|
158
158
|
this.query=next;if(derive){this.derive(true);this.stateChanged()}},setQuery(partial){this.applyState(partial)},sort(axis,by,direction="asc"){this.applyState({sort:{[matrixAxisName(axis)]:by==null?null:{by,direction}}})},group(axis,attribute){this.applyState({group:{[matrixAxisName(axis)]:attribute??null}})},filter(axis,attribute,values){this.applyState({filters:{[matrixAxisName(axis)]:{...this.query.filters[axis],[attribute]:values??null}}})},getState(){const query=this.query,copy=value=>JSON.parse(JSON.stringify(value));return gridFreeze({search:query.search,attentionOnly:query.attentionOnly,hideEmpty:query.hideEmpty,filters:copy(query.filters),sort:copy(query.sort),group:copy(query.group),collapsed:copy(query.collapsed)})},stateChanged(){this.emit("matrixState",this.getState(),"onStateChange")},getVisible(){const ids=entries=>entries.filter(entry=>entry.kind!=="heading").flatMap(entry=>entry.members.map(item=>item.id));return gridFreeze({rows:ids(this.model.rows),columns:ids(this.model.columns)})},focusCell(row,column){const r=this.model.rows.findIndex(entry=>entry.kind!=="heading"&&entry.members.some(item=>item.id===row));const c=this.model.columns.findIndex(entry=>entry.members.some(item=>item.id===column));if(r<0||c<0)return false;this.moveTo(r,c);return true},update(view){const doc=matrixDocument(view),state=JSON.parse(JSON.stringify(this.getState())),focus=this.captureFocus();this.doc=doc;this.labels=matrixLabels(doc.labels,this.options.labels);this.model=new MatrixModel(doc,this.format);this.query=this.model.initialQuery();for(const axis of MATRIX_AXES){const attributes=this.axisData(axis).attributeById;state.filters[axis]=Object.fromEntries(Object.entries(state.filters[axis]).filter(([id])=>attributes.has(id)));const sort=state.sort[axis];if(sort&&!["#label","#total"].includes(sort.by)&&!attributes.has(sort.by))state.sort[axis]=null;if(state.group[axis]!==null&&!attributes.has(state.group[axis])){state.group[axis]=null;state.collapsed[axis]=[]}}
|
|
159
159
|
this.applyState(state,false);this.root.className="cx-matrix cx-mx-"+doc.density;this.source=view;this.closePanel(false);this.refreshChrome();this.geometry=undefined;this.derive(false,focus)}});function matrixCreate(host,options){const view=new MatrixView(host,options);const impl={ready:Promise.resolve().then(()=>{if(view.destroyed)return impl;host.setAttribute("data-cx-ready","");view.emit("matrixReady",{matrix:view.doc.id},"onReady");return impl}),document:()=>view.source||view.options.view,sort:(axis,by,direction)=>view.sort(axis,by,direction),group:(axis,attribute)=>view.group(axis,attribute),filter:(axis,attribute,values)=>view.filter(axis,attribute,values),setSearch:text=>view.setQuery({search:text}),setAttentionOnly:on=>view.setQuery({attentionOnly:!!on}),getState:()=>view.getState(),setState:state=>view.applyState(state),getVisible:()=>view.getVisible(),focusCell:(row,column)=>view.focusCell(row,column),update:next=>view.update(next),destroy:()=>{if(view.destroyed)return;view.destroyed=true;view.lifetime.abort();view.resize?.disconnect();view.themeWatch?.disconnect();cancelAnimationFrame(view.frame);cancelAnimationFrame(view.fitFrame);clearTimeout(view.searchTimer);clearTimeout(view.tipTimer);view.root.remove();host.removeAttribute("data-cx-ready");if(view.fitInline!==undefined){host.style.maxHeight=view.fitInline;if(!host.getAttribute("style"))host.removeAttribute("style")}}};return impl}
|
|
160
|
-
MATRIX_IMPL
|
|
160
|
+
Object.assign(MATRIX_IMPL,{create:matrixCreate,validate:matrixDocument});installed.add(context.MATRIX_IMPL)}};(global.CanopyXParts||=[]).push(["matrix",part])})(typeof window!=="undefined"?window:globalThis);
|