@evotecit/canopyx 0.3.20 → 0.3.22
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-calendar-screen.css +71 -0
- package/CanopyX.Html/Assets/canopyx-calendar-screen.js +38 -0
- package/CanopyX.Html/Assets/canopyx-calendar.css +15 -3
- package/CanopyX.Html/Assets/canopyx-calendar.js +16 -14
- package/CanopyX.Html/Assets/canopyx-grid-module.mjs +5 -6
- package/CanopyX.Html/Assets/canopyx-grid.js +4 -5
- package/CanopyX.Html/Assets/canopyx-interactive.js +3 -4
- package/CanopyX.Html/Assets/canopyx-labels-de.js +7 -0
- package/CanopyX.Html/Assets/canopyx-labels-es.js +7 -0
- package/CanopyX.Html/Assets/canopyx-labels-fr.js +7 -0
- package/CanopyX.Html/Assets/canopyx-labels-it.js +7 -0
- package/CanopyX.Html/Assets/canopyx-labels-pl.js +7 -0
- package/CanopyX.Html/Assets/canopyx-module.mjs +4 -5
- package/CanopyX.Html/Assets/canopyx-reporting-module.mjs +5 -6
- package/CanopyX.Html/Assets/canopyx-reporting.js +4 -5
- package/CanopyX.Html/Assets/canopyx-ui-accordion.css +119 -0
- package/CanopyX.Html/Assets/canopyx-ui-accordion.js +33 -0
- package/CanopyX.Html/Assets/canopyx-ui-module.mjs +39 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.css +4 -4
- package/CanopyX.Html/Assets/canopyx-ui-navigation.js +5 -5
- package/CanopyX.Html/Assets/canopyx-ui-overlays.js +1 -1
- package/CanopyX.Html/Assets/canopyx-ui-stepper.js +1 -1
- package/CanopyX.Html/Assets/canopyx-ui-tabs.css +1 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.js +7 -4
- package/CanopyX.Html/Assets/canopyx-ui.css +119 -0
- package/CanopyX.Html/Assets/canopyx-ui.js +37 -0
- package/CanopyX.Html/Assets/canopyx.js +3 -4
- package/JavaScript/calendar.d.ts +39 -0
- package/JavaScript/locales/de.mjs +7 -0
- package/JavaScript/locales/es.mjs +7 -0
- package/JavaScript/locales/fr.mjs +7 -0
- package/JavaScript/locales/it.mjs +7 -0
- package/JavaScript/locales/pl.mjs +7 -0
- package/JavaScript/protocol.d.ts +1 -0
- package/JavaScript/ui.d.ts +70 -2
- package/package.json +18 -1
|
@@ -77,8 +77,7 @@ function fill(template,values){return template.replace(/\{(\w+)\}/g, (match, nam
|
|
|
77
77
|
const pluralRules=new Map();function plural(template,count,lang){if(!template.startsWith("["))return template;const forms={};for(const match of template.matchAll(/\[(zero|one|two|few|many|other)\]([^[]*)/g)) forms[match[1]] = match[2];
|
|
78
78
|
let rules=pluralRules.get(lang);if(!rules){try{rules=new Intl.PluralRules(lang||"en")}catch(_){rules=new Intl.PluralRules("en")}pluralRules.set(lang,rules)}
|
|
79
79
|
return forms[rules.select(Number(count))]??forms.other??template}
|
|
80
|
-
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{
|
|
81
|
-
if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent)[A-Z]\w{0,63}$/.test(name) && !uiLabel) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
80
|
+
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent|tabs|stepper|accordion|dialog|drawer|state)[A-Z]\w{0,63}$/.test(name)) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
82
81
|
if(typeof source[name]!=="string"||!/\S/.test(source[name])) throw new Error("CanopyX: label '" + name + "' must be a string with visible text.");
|
|
83
82
|
if((name==="utcTime"||name==="localTime")&&source[name].indexOf("{time}")<0)throw new Error("CanopyX: label '"+name+"' must hold {time}.");labels[name]=source[name]})}
|
|
84
83
|
return Object.freeze(labels)}
|
|
@@ -533,7 +532,7 @@ close()}else{return}
|
|
|
533
532
|
e.preventDefault()});input.addEventListener("blur",()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);blurTimer=setTimeout(close,150)});this.cancelSearch=()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);hits=[];close()};box.appendChild(input);box.appendChild(list);box.appendChild(status);bar.appendChild(box);this.searchInput=input}});function watchFlyout(anchorElement,panel,isOpen){const lifetime=new AbortController();let flyout=null,pending=null;const ready=()=>flyout?Promise.resolve(flyout):pending||=loadPart(SHARED_PARTS["ui-overlays"]).then(()=>{if(!lifetime.signal.aborted)flyout=UI_TOOLS.toolbarFlyout(anchorElement,panel,isOpen,lifetime.signal);return flyout}).catch(error=>{pending=null;throw error});const invoke=method=>{if(lifetime.signal.aborted||!isOpen())return;if(flyout){flyout[method]();return}
|
|
534
533
|
ready().then(value=>{if(!lifetime.signal.aborted&&isOpen())value?.[method]()}).catch(error=>{if(!lifetime.signal.aborted)(anchorElement.closest(".cx-host")||anchorElement)
|
|
535
534
|
.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))})};return{position:()=>invoke("position"),open:()=>invoke("open"),close:()=>flyout?.close(),dispose:()=>lifetime.abort()}}
|
|
536
|
-
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["
|
|
535
|
+
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["24afaa117ebf3fb5","canopyx-ui-overlays.dedc42d3a501a387.js","canopyx-ui-overlays.3668a9a74004ea8e.css"],"ui-menu":["352b1ee391133ff0","canopyx-ui-menu.f9abee36db8f6ad2.js","canopyx-ui-menu.2f3478cc5f5c272f.css"],"ui-picker":["d415103478faf52a","canopyx-ui-picker.13e544bd68aca998.js","canopyx-ui-picker.59c85a1988a287a9.css"],"ui-navigation":["2553d01c5276d56a","canopyx-ui-navigation.c4ebc214197f140d.js","canopyx-ui-navigation.0afd07bbdc5aecb5.css"],"ui-tabs":["19ece8184f3daf4a","canopyx-ui-tabs.6cd35b2afd89f530.js","canopyx-ui-tabs.7bb6c6f1341e87e9.css"],"ui-stepper":["5682c49db1b85314","canopyx-ui-stepper.96973189b0f6e0c4.js","canopyx-ui-stepper.1d4a9db373b8d2f2.css"],"ui-accordion":["1424f075b78d0ccd","canopyx-ui-accordion.d0d5daa7f73d0859.js","canopyx-ui-accordion.a3ef9c27cea5b7a4.css"],"tree-tools":["ef0d06c82135ae2e","canopyx-tree-tools.1c4b9e286dde6065.js","canopyx-tree-tools.350dd0ee46757029.css"],"presenters":["d5f9d61bb730974b","canopyx-presenters.d71f9e12d83969d9.js"],"filter-editor":["b760f978327dbab0","canopyx-filter-editor.4851bd579e7d146c.js","canopyx-filter-editor.2e0cf6850cbd3235.css"],"export":["15abf3205094bda6","canopyx-export.68b90138463329fe.js"],"office-export":["4fb7a4d570390ee9","canopyx-office-export.7e62c385b884e75b.js"],"history":["7d9901d2fe04df72","canopyx-history.9432e724bf14c9ed.js"],"pager":["cc30dd4f6d3feeb0","canopyx-pager.2a6f5da8c93de083.js","canopyx-pager.c1e16027780b7fdd.css"],"enhance":["a3b4be5ec19a43a6","canopyx-enhance.4a189cba27c290de.js"],"data":["bab770170bd2cfdd","canopyx-data.34325d1fd693886e.js"],"forms":["381a3edba481660b","canopyx-forms.fa85aa9e8b62876a.js","canopyx-forms.50a5ddb0fcc98bdf.css"],"flow":["02a915fe174e4710","canopyx-flow.2ec165998fe2950d.js","canopyx-flow.347ecd64183ea3a1.css"],"flow-host":["7169c4283cec8b25","canopyx-flow-host.52ccd1a2b6cd53f7.js","canopyx-flow-host.a7c8d3fc930ad3a9.css"],"flow-checks":["53394e75b7d1b0e2","canopyx-flow-checks.76e58f9d05eaa78f.js","canopyx-flow-checks.88dd9f389b249147.css"],"flow-options":["60450342239ded26","canopyx-flow-options.d31458a54aa4b1e7.js"],"flow-pick":["7e0924c72fdd2f74","canopyx-flow-pick.c2e34da944b0edab.js","canopyx-flow-pick.ce7687598d4703f1.css"],"flow-records":["0b652a9789ce4128","canopyx-flow-records.df8aba0a303019e0.js","canopyx-flow-records.393243243aae9a56.css"],"flow-drafts":["fac75bf905a77d0b","canopyx-flow-drafts.c7db634ab651e9fc.js","canopyx-flow-drafts.2c43cff1ce9be700.css"],"flow-preview":["5e8207eed3801f91","canopyx-flow-preview.3924dc8410f9775d.js","canopyx-flow-preview.069c52c33e87ffb4.css"],"flow-command":["a30245a47f6d4530","canopyx-flow-command.b145a234a6ecc8a2.js","canopyx-flow-command.f98b5333af3a0e17.css"],"flow-tasks":["8a4437f5216ac3ee","canopyx-flow-tasks.569d4c40d317472b.js","canopyx-flow-tasks.54857a9f2732048a.css"],"flow-dialog":["8c45e0a8bb6a8ab9","canopyx-flow-dialog.cb4e85bcb7383fe2.js","canopyx-flow-dialog.58bd5d446415e01a.css"],"flow-links":["2c14b19c9236e90d","canopyx-flow-links.7b6cfe42d28b6067.js"],"flow-endpoint":["f5cddfc9545e0920","canopyx-flow-endpoint.b31146202bd76aac.js"],"flow-facts":["385b5e61ed487e16","canopyx-flow-facts.8dad3bc07a71fdb0.js"],"flow-consent":["22121778bc0d07c5","canopyx-flow-consent.749b97f13039bc71.js","canopyx-flow-consent.9f6580d3673ae8bf.css"],"matrix":["002a6d917bb4d638","canopyx-matrix.17ae2d0e03ad1364.js","canopyx-matrix.59fc6920ae000d49.css"],"changes":["7d9a526aa07a8838","canopyx-changes.75f1a61cbba98a4f.js","canopyx-changes.5f0ae1710b8b081c.css"],"editing":["88e4ca705a7eb0c3","canopyx-editing.6a6df811fb4dde54.js","canopyx-editing.4816f6be6f89d794.css"],"column-groups":["91abd99e8ff95b58","canopyx-column-groups.4c71d23375de727c.js","canopyx-column-groups.4e4131c1e2df40b1.css"],"cell-range":["cb29468954702795","canopyx-cell-range.d4f99a024db5d0f8.js","canopyx-cell-range.c790b8f140b1243b.css"],"links":["c6579c9401f0971d","canopyx-links.b25760079f57e6e1.js"],"search":["521eebd6e1bbbd35","canopyx-search.14c69f4551c69f23.js"],"formatting":["0feff4e3424599e9","canopyx-formatting.94536547a1d35e9b.js","canopyx-formatting.22b2400c566e25d6.css"],"format-editor":["97085e181fbc1cf7","canopyx-format-editor.a6bc57c48173bfc0.js","canopyx-format-editor.d5aaa8e873d92695.css"],"link":["7485f5c9875e9f9b","canopyx-link.9066770aa822fe0f.js","canopyx-link.997fefec6b85f0c5.css"],"detail-rows":["1892f1fd9d035c0f","canopyx-detail-rows.8be98dbc5721170a.js","canopyx-detail-rows.275076ec8bd9144a.css"],"calculations":["f902dc5856fc7bdd","canopyx-calculations.97e438237ba43f99.js","canopyx-calculations.50432e524dd7d8d9.css"],"pivot":["577443c67c7ed719","canopyx-pivot.3abc630122030933.js","canopyx-pivot.5670e62c0bbf114f.css"],"values":["0d7006b0f7bfca10","canopyx-values.ad4c56fcbcd89cbb.js","canopyx-values.446654b98c62ef1d.css"],"buckets":["cc69c8336c15df83","canopyx-buckets.1f59613f13ee292c.js"],"grouping":["c82705991ff01a4c","canopyx-grouping.239f13b0785a2e30.js","canopyx-grouping.a91801c602d752b3.css"],"highlight":["5ebf0042011ba4fd","canopyx-highlight.ff11a0ca8e30102b.js","canopyx-highlight.9c26291cbcd0962b.css"],"layouts":["90267e35e7edf3a4","canopyx-layouts.058b8a396f909a79.js","canopyx-layouts.ca17f42babc4192a.css"],"facets":["e78c2340a96fa802","canopyx-facets.74b2e520a3c04580.js","canopyx-facets.e2970dd7cf0c3da6.css"],"live":["78791b002a111843","canopyx-live.878dc16d683abb72.js","canopyx-live.9881627f352f59da.css"],"record-panel":["cb6bcd1baf644a51","canopyx-record-panel.557c676822e8624f.js","canopyx-record-panel.174846a640de979f.css"],"calendar":["b414f93d261b2b76","canopyx-calendar.b25ab96faed29154.js","canopyx-calendar.e3f3eaca3f05bb03.css"],"calendar-recurrence":["64bcc24d785bd1af","canopyx-calendar-recurrence.4b7f430c2a64de23.js"],"calendar-edit":["09747e191820d94c","canopyx-calendar-edit.174f5125d3e75bd9.js"],"calendar-ics":["ac8b2950fccbfb0f","canopyx-calendar-ics.4a18c1c4a1520418.js"],"calendar-screen":["c2be4b1ddf96a778","canopyx-calendar-screen.00a3a9b445e504f6.js","canopyx-calendar-screen.1f4866e9a24e75f3.css"],"timeline":["cb9b9dd33154172c","canopyx-timeline.a3dea165914fa7fd.js","canopyx-timeline.44c3156c218531e2.css"],"grid-options":["ee53e6f124b99d5a","canopyx-grid-options.9f8604806c93bf19.js","canopyx-grid-options.e85648a66d70d5b5.css"],"board":["dd02be00df77f53a","canopyx-board.81de43b6e0f4aec3.js","canopyx-board.b62cc3a0348e758a.css"],"plan":["db07c2eb53541d49","canopyx-plan.f3bf394516b627b7.js","canopyx-plan.743201d95414f399.css"],"path":["c6fa2dbab6a0dbaa","canopyx-path.97c3ee2b076b2db6.js","canopyx-path.efba21adc0bfc372.css"],"stack":["e29298edc07edb6d","canopyx-stack.82a5a0c6383519dc.js","canopyx-stack.b867aa57edf9002c.css"],"time-slider":["5516099a165cc345","canopyx-time-slider.ed59a275671c729f.js","canopyx-time-slider.dfc55326f03e1d4a.css"],"view-intents":["dbd26360f2b90a49","canopyx-view-intents.3adcb56dffca0650.js","canopyx-view-intents.29a5c2de68ce3ba0.css"],"compare":["46245b96483e9c30","canopyx-compare.2a8ddc0ce67e903f.js","canopyx-compare.da0a2dff321e782d.css"]},PART_CODE=new Map(),SHARED_PARTS={},partName=name=>typeof name==="string"&&/^[a-z][a-z\d-]{0,31}$/.test(name);
|
|
537
536
|
function registerPart(name,part){if(!partName(name)||!part||typeof part.version!=="string"||typeof part.install!=="function"||
|
|
538
537
|
part.requires!==undefined&&!(Array.isArray(part.requires)&&part.requires.every(partName)))throw new Error("CanopyX: invalid part.");PART_CODE.set(name,part)}
|
|
539
538
|
function definePart(View,name,label,context){const parts=View.prototype.parts||={};return parts[name]={name,label,context,parts}}
|
|
@@ -595,7 +594,7 @@ const wanted=Array.from(new Set(ids||this.rows.filter((w)=>!w.status).map((w)=>w
|
|
|
595
594
|
const navigation=navigationScope(this,this.dataLifetime.signal);let doc;try{doc=await navigation.wait(this.source.counts(wanted,this.sourceRequest(this.dataLifetime.signal)))}
|
|
596
595
|
finally{navigation.dispose()}
|
|
597
596
|
if(navigation.cancelled())return null;if(this.queryAware)snapshotRevision(doc,this.datasetRevision);checkDocument(doc,"counts");this.applyCounts(Object.assign({},doc,{items:doc.items.filter(item=>{const captured=mine.get(item.id);return captured&&this.keyMap.get(item.id)===captured.w&&captured.w.countRevision===captured.revision})}),true);return doc}});function UiHost(){}
|
|
598
|
-
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of
|
|
597
|
+
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",accordion:"ui-accordion",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of Object.keys(PARTS).filter(part=>part.startsWith("ui-")))SHARED_PARTS[name]=definePart(UiHost,name,name.replace("ui-","UI "),uiContext);function createUi(kind,target,options={}){const root=typeof target==="string"?document.querySelector(target):target;if(root?.nodeType!==1)throw new Error("CanopyX: "+kind+" needs an element.");let registrations=uiInstances.get(root);if(!registrations)uiInstances.set(root,registrations=new Map());if(registrations.has(kind))return registrations.get(kind);const lifetime=new AbortController();watchTheme(root,lifetime.signal);let instance=null;const ready=loadPart(SHARED_PARTS[UI_KINDS[kind]]).then(()=>{if(lifetime.signal.aborted)throw new DOMException("UI component destroyed.","AbortError");instance=UI_IMPL[kind](root,options,lifetime.signal);return instance.ready||instance});const api={element:root,ready:ready.then(()=>api),destroy(){if(lifetime.signal.aborted)return;lifetime.abort();instance?.destroy?.();registrations.delete(kind)}};for(const name of["select","getSelected","refresh","preparePrint","open","close","next","back","skip","finish","setStepState","getState","toggle","getOpen","filter"])api[name]=(...args)=>{if(lifetime.signal.aborted)throw new Error("CanopyX: UI component destroyed.");return instance?instance[name]?.(...args):ready.then(()=>instance[name]?.(...args))};api.ready.catch(error=>{if(error.name!=="AbortError")root.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))});registrations.set(kind,Object.freeze(api));return api}
|
|
599
598
|
function bindContextMenu(target,items,options={}){if(typeof target!=="string"&&target?.nodeType!==1)throw new Error("CanopyX: contextMenu needs an element or selector.");if(typeof target==="string")document.documentElement.matches(target);let disposed=false,cleanup=null;const dispose=()=>{disposed=true;cleanup?.()};dispose.ready=loadPart(SHARED_PARTS["ui-menu"]).then(()=>{if(!disposed)cleanup=UI_IMPL.contextMenu(target,items,options)});dispose.open=(...args)=>disposed?false:cleanup?cleanup.open(...args):dispose.ready.then(()=>!disposed&&cleanup.open(...args));dispose.close=(...args)=>cleanup?.close(...args);return dispose}
|
|
600
599
|
function mountUi(root=document){const mounted=[];for(const kind of Object.keys(UI_KINDS)){const selector="[data-cx-"+kind+"]",nodes=[...root.querySelectorAll(selector)];if(root.matches?.(selector))nodes.unshift(root);for(const element of nodes){if(kind==="menu"&&element.parentElement?.closest(selector))continue;if(kind==="stepper"&&["report","static"].includes(element.dataset.mode))continue;mounted.push(createUi(kind,element))}}
|
|
601
600
|
return mounted}
|
|
@@ -1068,7 +1067,7 @@ ids.some(id=>!this.columns.some(column=>column.id===id)))throw new Error("Canopy
|
|
|
1068
1067
|
catch(_){/* A disabled or full storage leaves the current session usable. */ }
|
|
1069
1068
|
}});const GRID_HISTORY_IMPL={},GRID_HISTORY=definePart(DataGrid,"history","history presenters",()=>({GRID_HISTORY_IMPL,h,setText,fill,gridSeries,gridPresenterTone,toneColors,toneOf,GRID_TONE_RANK}));const GRID_HISTORY_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.loadHistory=function(){return this.historyLoad||=loadPart(GRID_HISTORY).then(()=>{this.version++;this.scheduleRender()},error=>this.emit("error",{error}))};DataGrid.prototype.initializeState=function(){const ready=GRID_HISTORY_INIT.call(this);return this.columns.some(column=>GRID_HISTORY_KINDS.includes(column.presenter?.kind))?Promise.all([ready,this.loadHistory()]).then(([result])=>result):ready};const GRID_BOARD=definePart(DataGrid,"board","board view",()=>({DataGrid,h,setText,fill,cellValue,cellText,gridScalar,gridQueryRows,gridQuery,validateGridPage,validateGridCursorPage,numberFormat,PROTOCOL}));const GRID_BOARD_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.initializeState=function(){const start=()=>GRID_BOARD_INIT.call(this);return this.view.board?loadPart(GRID_BOARD).then(()=>{if(!this.destroyed)this.startBoard()}).then(start):start()};DEFAULT_LABELS=Object.freeze(Object.assign({},DEFAULT_LABELS,{gridBucket:"Bucket",gridBucketNone:"Exact values",gridBucketDay:"Day",gridBucketWeek:"Week",gridBucketMonth:"Month",gridBucketQuarter:"Quarter",gridBucketYear:"Year",gridBucketHour:"Hour of day",gridBucketWeekday:"Weekday",gridBucketWidth:"Range width",gridBucketEdges:"Range edges",gridBucketOrigin:"Range origin",gridBucketInvalid:"Enter valid bucket settings."}));const BUCKETS_PART=definePart(DataGrid,"buckets","date and range buckets",()=>({GRID_BUCKETS}));const gridUsesBuckets=view=>view.reporting?.groupBy?.some(level=>level.bucket)||view.facets?.columns?.some(facet=>facet?.bucket)||
|
|
1070
1069
|
view.query?.groupBy?.some(level=>level.bucket)||gridQueryUsesBucketFilters(view.query);function gridQueryUsesBucketFilters(query){const group=node=>!!node&&(node.filters?.some(filter=>filter.bucket)||node.groups?.some(group));return query?.filters?.some(filter=>filter.bucket)||group(query?.filterGroup)||query?.tupleFilters?.some(tuple=>tuple.columns?.some(field=>field.bucket))}
|
|
1071
|
-
const BUCKET_REQUEST_PAGE=DataGrid.prototype.requestPage;DataGrid.prototype.requestPage=async function(query,signal){if(gridQueryUsesBucketFilters(query))await loadPart(BUCKETS_PART);return BUCKET_REQUEST_PAGE.call(this,query,signal)};DEFAULT_LABELS=Object.freeze(Object.assign({},DEFAULT_LABELS,{gridCalculationAdd:"Add calculated column",gridCalculationTitle:"Column title",gridCalculationId:"Column ID",gridCalculationExpression:"Expression",gridCalculationError:"Calculation error: {error}",gridCalculationInvalid:"Check the expression, column references and result kind.",gridCalculationHelp:"Use [columnId], arithmetic, IF, COALESCE, ROUND, CONCAT, DATEPART or DATEDIFF.",gridCalculationResultType:"Result type",gridCalculationDivideZero:"Division by zero",gridCalculationNumber:"Number",gridCalculationDate:"Date and time"}));const GRID_CALCULATIONS={},CALCULATIONS_PART=definePart(DataGrid,"calculations","calculated columns",()=>({DataGrid,GRID_CALCULATIONS,requireIdentifier,cellValue,h,setText,fill,gridButton,gridQuery,gridQueryStart,inlineGridSource,rowDataSource,loadGridFilterEditor,gridFreeze,gridFitPrepare}));const gridUsesCalculations=view=>view.calculatedColumnsEditable||view.columns.some(column=>column.calculation!==undefined);Object.assign(DataGrid.prototype,{async prepareCalculations(){if(!gridUsesCalculations(this.view))return;await loadPart(CALCULATIONS_PART);GRID_CALCULATIONS.prepare(this)},async setCalculatedColumns(columns){await loadPart(CALCULATIONS_PART);return this.setCalculatedColumns(columns)},getCalculatedColumns(){return GRID_CALCULATIONS.definitions?.(this.view)||[]},async openCalculatedColumn(anchor){await loadPart(CALCULATIONS_PART);return this.openCalculatedColumn(anchor)}});const GRID_CALENDAR=definePart(DataGrid,"calendar","calendar",()=>({DataGrid,h,setText,fill,plural,gridButton,gridIcon,gridFreeze,cellText,cellValue,isCellObject,gridQuery,gridQueryRows,gridResultShape,gridPresenterTone,validateGridRows,repairGridCell,validateGridPage,validateGridCursorPage,validStructuralCount,checkDocument,numberFormat,loadPart,HostCellContext,disposeHostSlot,PROTOCOL,toneVariable,bindContextMenu}));definePart(DataGrid,"timeline","resource timeline",()=>({DataGrid,TreeGrid,h,setText,fill,numberFormat,toneVariable}));definePart(DataGrid,"calendar-recurrence","calendar recurrence",()=>({DataGrid}));definePart(DataGrid,"calendar-edit","calendar editing",()=>({DataGrid,h,setText,fill,cellValue,GRID_DRAG}));definePart(DataGrid,"calendar-ics","iCalendar",()=>({DataGrid,h,fill,cellText}));const GRID_CALENDAR_API=["getCalendar","setCalendarView","setCalendarDate","setCalendarZoom","calendarStep","calendarToday","getCalendarEvents","exportCalendar","openCalendarEvent","editCalendarOccurrence","clearCalendarSelection","setCalendarSource"];for(const name of GRID_CALENDAR_API)DataGrid.prototype[name]=function(...args){return this.loadCalendar().then(()=>this[name](...args))};DataGrid.prototype.loadCalendar=function(){return this.calLoad||=loadPart(GRID_CALENDAR).then(()=>this.destroyed||this.calParts()).then(()=>this.destroyed||this.startCalendar()).catch(error=>{this.calLoad=null;this.emit("error",{error});throw error})};const GRID_CALENDAR_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.initializeState=function(){const start=()=>GRID_CALENDAR_INIT.call(this);return this.view.calendar?this.loadCalendar().then(start,start):start()};const CAL_PRESETS={basic:{toolbar:false,details:"popover",views:["month","week","day","agenda"]},standard:{toolbar:["search","filters","export"],details:"popover",print:true,views:["month","week","day","days","agenda","year"]},scheduler:{toolbar:["search","filters","views","export"],details:"drawer",print:true,editable:true,create:true,views:["month","week","day","agenda"]}};const CAL_FIELDS=["allDay","description","tone","resource","resourceIds","recurrence","exceptions","series","recurrenceId","source"];const CAL_TITLES={allDay:"All day",description:"Description",tone:"Tone",resource:"Resource",resourceIds:"Resources",series:"Series",recurrenceId:"Original start",recurrence:"Repeats",exceptions:"Exceptions",source:"Source"};const CAL_OWN=new Set(["events","preset","id","label","views","view","date","timeZone","firstDay","toolbar","details","editable","create","drop","resources","timeline","live","facets","drawer","export","print","sources","calendar","links"]);const calPad=(value,size=2)=>String(value).padStart(size,"0");function calInstantText(value,field,allDay){if(value instanceof Date&&Number.isFinite(value.getTime()))
|
|
1070
|
+
const BUCKET_REQUEST_PAGE=DataGrid.prototype.requestPage;DataGrid.prototype.requestPage=async function(query,signal){if(gridQueryUsesBucketFilters(query))await loadPart(BUCKETS_PART);return BUCKET_REQUEST_PAGE.call(this,query,signal)};DEFAULT_LABELS=Object.freeze(Object.assign({},DEFAULT_LABELS,{gridCalculationAdd:"Add calculated column",gridCalculationTitle:"Column title",gridCalculationId:"Column ID",gridCalculationExpression:"Expression",gridCalculationError:"Calculation error: {error}",gridCalculationInvalid:"Check the expression, column references and result kind.",gridCalculationHelp:"Use [columnId], arithmetic, IF, COALESCE, ROUND, CONCAT, DATEPART or DATEDIFF.",gridCalculationResultType:"Result type",gridCalculationDivideZero:"Division by zero",gridCalculationNumber:"Number",gridCalculationDate:"Date and time"}));const GRID_CALCULATIONS={},CALCULATIONS_PART=definePart(DataGrid,"calculations","calculated columns",()=>({DataGrid,GRID_CALCULATIONS,requireIdentifier,cellValue,h,setText,fill,gridButton,gridQuery,gridQueryStart,inlineGridSource,rowDataSource,loadGridFilterEditor,gridFreeze,gridFitPrepare}));const gridUsesCalculations=view=>view.calculatedColumnsEditable||view.columns.some(column=>column.calculation!==undefined);Object.assign(DataGrid.prototype,{async prepareCalculations(){if(!gridUsesCalculations(this.view))return;await loadPart(CALCULATIONS_PART);GRID_CALCULATIONS.prepare(this)},async setCalculatedColumns(columns){await loadPart(CALCULATIONS_PART);return this.setCalculatedColumns(columns)},getCalculatedColumns(){return GRID_CALCULATIONS.definitions?.(this.view)||[]},async openCalculatedColumn(anchor){await loadPart(CALCULATIONS_PART);return this.openCalculatedColumn(anchor)}});const GRID_CALENDAR=definePart(DataGrid,"calendar","calendar",()=>({DataGrid,h,setText,fill,plural,gridButton,gridIcon,gridFreeze,cellText,cellValue,isCellObject,gridQuery,gridQueryRows,gridResultShape,gridPresenterTone,validateGridRows,repairGridCell,validateGridPage,validateGridCursorPage,validStructuralCount,checkDocument,numberFormat,loadPart,HostCellContext,disposeHostSlot,PROTOCOL,toneVariable,bindContextMenu}));definePart(DataGrid,"timeline","resource timeline",()=>({DataGrid,TreeGrid,h,setText,fill,numberFormat,toneVariable}));definePart(DataGrid,"calendar-recurrence","calendar recurrence",()=>({DataGrid}));definePart(DataGrid,"calendar-edit","calendar editing",()=>({DataGrid,h,setText,fill,cellValue,GRID_DRAG}));definePart(DataGrid,"calendar-ics","iCalendar",()=>({DataGrid,h,fill,cellText}));definePart(DataGrid,"calendar-screen","calendar shared screens",()=>({DataGrid,h,setText,fill,gridButton,gridFreeze,toneVariable}));const GRID_CALENDAR_API=["getCalendar","setCalendarView","setCalendarDate","setCalendarZoom","calendarStep","calendarToday","getCalendarEvents","exportCalendar","openCalendarEvent","editCalendarOccurrence","clearCalendarSelection","setCalendarSource","resetCalendar"];for(const name of GRID_CALENDAR_API)DataGrid.prototype[name]=function(...args){return this.loadCalendar().then(()=>this[name](...args))};DataGrid.prototype.loadCalendar=function(){return this.calLoad||=loadPart(GRID_CALENDAR).then(()=>this.destroyed||this.calParts()).then(()=>this.destroyed||this.startCalendar()).catch(error=>{this.calLoad=null;this.emit("error",{error});throw error})};const GRID_CALENDAR_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.initializeState=function(){const start=()=>GRID_CALENDAR_INIT.call(this);return this.view.calendar?this.loadCalendar().then(start,start):start()};const CAL_PRESETS={basic:{toolbar:false,details:"popover",views:["month","week","day","agenda"]},standard:{toolbar:["search","filters","export"],details:"popover",print:true,views:["month","week","day","days","agenda","year"]},scheduler:{toolbar:["search","filters","views","export"],details:"drawer",print:true,editable:true,create:true,views:["month","week","day","agenda"]}};const CAL_FIELDS=["allDay","description","location","tone","resource","resourceIds","recurrence","exceptions","series","recurrenceId","source"];const CAL_TITLES={allDay:"All day",description:"Description",location:"Location",tone:"Tone",resource:"Resource",resourceIds:"Resources",series:"Series",recurrenceId:"Original start",recurrence:"Repeats",exceptions:"Exceptions",source:"Source"};const CAL_OWN=new Set(["events","preset","id","label","views","view","date","timeZone","firstDay","toolbar","details","editable","create","drop","resources","timeline","live","facets","drawer","export","print","sources","calendar","links"]);const calPad=(value,size=2)=>String(value).padStart(size,"0");function calInstantText(value,field,allDay){if(value instanceof Date&&Number.isFinite(value.getTime()))
|
|
1072
1071
|
return allDay?calPad(value.getFullYear(),4)+ "-"+calPad(value.getMonth()+ 1)+ "-"+calPad(value.getDate())+ "T00:00:00Z":value.toISOString().replace(".000Z","Z");if(typeof value==="string"&&/^\d{4}-\d\d-\d\d$/.test(value)) return value + "T00:00:00Z";
|
|
1073
1072
|
if(typeof value==="string"&&/^\d{4}-\d\d-\d\dT\d\d:\d\d(:\d\d(\.\d+)?)?(Z|[+-]\d\d:\d\d)$/.test(value)) return allDay ? value.slice(0, 10) + "T00:00:00Z" : value;
|
|
1074
1073
|
const parsed=typeof value==="string"&&/^\d{4}-\d\d-\d\dT\d\d:\d\d/.test(value) ? new Date(value) : null;
|
|
@@ -1314,4 +1313,4 @@ function mount(root,automatic){const scope=root||document;const created=[];const
|
|
|
1314
1313
|
const message=err&&err.message?err.message:String(err);let labels=DEFAULT_LABELS;for(const attempt of[()=>labelsFor(view&&view.labels,view&&configured.has(view.id)?configured.get(view.id).labels:null),()=>labelsFor(view&&view.labels)]){try{labels=attempt();break}catch(e){labels=DEFAULT_LABELS}}
|
|
1315
1314
|
const notice=document.createElement("div");notice.className="cx-mount-error";notice.setAttribute("role","alert");setText(notice,fill(labels.mountError,{error:message}));host.classList.add("cx-host");host.setAttribute("data-canopyx-mounted","true");host.setAttribute("data-cx-error",message);host.appendChild(notice);if(global.console)global.console.error(err)};const selector="[data-canopyx-host]:not([data-canopyx-mounted])";(scope.matches?.(selector)?[scope]:scope.querySelectorAll(selector)).forEach((host)=>{const config=host.querySelector("script.cx-config"),mode=host.getAttribute("data-cx-mount");if(!config||(automatic===true&&mode==="manual")){return}
|
|
1316
1315
|
if(mode==="visible"&&host!==scope&&global.IntersectionObserver)return mountWhenVisible(host);watcher?.unobserve(host);host.setAttribute("data-canopyx-mounted","true");let view=null;try{view=JSON.parse(config.textContent);if(view===Object(view))parsedViews.add(view);const flow=view&&view.kind==="flow"&&typeof FLOW_API==="object",matrix=view&&view.type==="matrix"&&typeof MATRIX_API==="object";const change=view&&typeof CHANGE_VIEW_TYPES==="object"&&Object.hasOwn(CHANGE_VIEW_TYPES,view.type)?CHANGE_VIEW_TYPES[view.type]:null;const create=flow?FLOW_API.createFlow:matrix?MATRIX_API.createMatrix:change?change:view&&view.type==="grid"&&typeof createDataGrid==="function"?createDataGrid:createTreeGrid;const api=create(host,Object.assign({},view&&configured.get(view.id),flow?{flow:view}:{view}));created.push(api);api.ready.catch((err)=>{if(view.type!=="grid"&&!matrix&&!change&&activeGrids.get(host)===api&&host.canopyx===api)showError(host,err,api,view)})}catch(err){showError(host,err,null,view)}});mountUi(scope);return created}
|
|
1317
|
-
global.CanopyX=Object.freeze(Object.assign({protocol:PROTOCOL,createTreeGrid,configure,unconfigure,mount:(root)=>mount(root,false),sources:Object.freeze({inline:inlineSource,sidecar:sidecarSource,remote:remoteSource}),badge:hostBadge,labels:DEFAULT_LABELS,registerExportFormat,use,registerPart,setNonce},typeof GRID_API==="object"?GRID_API:{},typeof FLOW_API==="object"?FLOW_API:{},typeof MATRIX_API==="object"?MATRIX_API:{},typeof CHANGES_API==="object"?CHANGES_API:{},UI_API));if(typeof document!=="undefined"){const navigation=global.performance&&performance.getEntriesByType?performance.getEntriesByType("navigation")[0]:null;if(document.readyState==="loading"||(document.readyState==="interactive"&&navigation&&navigation.domContentLoadedEventStart===0)){document.addEventListener("DOMContentLoaded",()=>mount(document,true))}else{mount(document,true)}}})(runtimeHost);const CanopyX=runtimeHost.CanopyX;const{protocol,createTreeGrid,createDataGrid,createCalendar,createFlow,createMatrix,createDiff,createChangeList,createPropagation,enhance,grid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,dialog,drawer,popover,tooltip,menu}=CanopyX;export{protocol,createTreeGrid,createDataGrid,createCalendar,createFlow,createMatrix,createDiff,createChangeList,createPropagation,enhance,grid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,dialog,drawer,popover,tooltip,menu};export default CanopyX;
|
|
1316
|
+
global.CanopyX=Object.freeze(Object.assign({protocol:PROTOCOL,createTreeGrid,configure,unconfigure,mount:(root)=>mount(root,false),sources:Object.freeze({inline:inlineSource,sidecar:sidecarSource,remote:remoteSource}),badge:hostBadge,labels:DEFAULT_LABELS,registerExportFormat,use,registerPart,setNonce},typeof GRID_API==="object"?GRID_API:{},typeof FLOW_API==="object"?FLOW_API:{},typeof MATRIX_API==="object"?MATRIX_API:{},typeof CHANGES_API==="object"?CHANGES_API:{},UI_API));if(typeof document!=="undefined"){const navigation=global.performance&&performance.getEntriesByType?performance.getEntriesByType("navigation")[0]:null;if(document.readyState==="loading"||(document.readyState==="interactive"&&navigation&&navigation.domContentLoadedEventStart===0)){document.addEventListener("DOMContentLoaded",()=>mount(document,true))}else{mount(document,true)}}})(runtimeHost);const CanopyX=runtimeHost.CanopyX;const{protocol,createTreeGrid,createDataGrid,createCalendar,createFlow,createMatrix,createDiff,createChangeList,createPropagation,enhance,grid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,accordion,dialog,drawer,popover,tooltip,menu}=CanopyX;export{protocol,createTreeGrid,createDataGrid,createCalendar,createFlow,createMatrix,createDiff,createChangeList,createPropagation,enhance,grid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,accordion,dialog,drawer,popover,tooltip,menu};export default CanopyX;
|
|
@@ -75,8 +75,7 @@ function fill(template,values){return template.replace(/\{(\w+)\}/g, (match, nam
|
|
|
75
75
|
const pluralRules=new Map();function plural(template,count,lang){if(!template.startsWith("["))return template;const forms={};for(const match of template.matchAll(/\[(zero|one|two|few|many|other)\]([^[]*)/g)) forms[match[1]] = match[2];
|
|
76
76
|
let rules=pluralRules.get(lang);if(!rules){try{rules=new Intl.PluralRules(lang||"en")}catch(_){rules=new Intl.PluralRules("en")}pluralRules.set(lang,rules)}
|
|
77
77
|
return forms[rules.select(Number(count))]??forms.other??template}
|
|
78
|
-
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{
|
|
79
|
-
if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent)[A-Z]\w{0,63}$/.test(name) && !uiLabel) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
78
|
+
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent|tabs|stepper|accordion|dialog|drawer|state)[A-Z]\w{0,63}$/.test(name)) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
80
79
|
if(typeof source[name]!=="string"||!/\S/.test(source[name])) throw new Error("CanopyX: label '" + name + "' must be a string with visible text.");
|
|
81
80
|
if((name==="utcTime"||name==="localTime")&&source[name].indexOf("{time}")<0)throw new Error("CanopyX: label '"+name+"' must hold {time}.");labels[name]=source[name]})}
|
|
82
81
|
return Object.freeze(labels)}
|
|
@@ -531,7 +530,7 @@ close()}else{return}
|
|
|
531
530
|
e.preventDefault()});input.addEventListener("blur",()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);blurTimer=setTimeout(close,150)});this.cancelSearch=()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);hits=[];close()};box.appendChild(input);box.appendChild(list);box.appendChild(status);bar.appendChild(box);this.searchInput=input}});function watchFlyout(anchorElement,panel,isOpen){const lifetime=new AbortController();let flyout=null,pending=null;const ready=()=>flyout?Promise.resolve(flyout):pending||=loadPart(SHARED_PARTS["ui-overlays"]).then(()=>{if(!lifetime.signal.aborted)flyout=UI_TOOLS.toolbarFlyout(anchorElement,panel,isOpen,lifetime.signal);return flyout}).catch(error=>{pending=null;throw error});const invoke=method=>{if(lifetime.signal.aborted||!isOpen())return;if(flyout){flyout[method]();return}
|
|
532
531
|
ready().then(value=>{if(!lifetime.signal.aborted&&isOpen())value?.[method]()}).catch(error=>{if(!lifetime.signal.aborted)(anchorElement.closest(".cx-host")||anchorElement)
|
|
533
532
|
.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))})};return{position:()=>invoke("position"),open:()=>invoke("open"),close:()=>flyout?.close(),dispose:()=>lifetime.abort()}}
|
|
534
|
-
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["
|
|
533
|
+
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["24afaa117ebf3fb5","canopyx-ui-overlays.dedc42d3a501a387.js","canopyx-ui-overlays.3668a9a74004ea8e.css"],"ui-menu":["352b1ee391133ff0","canopyx-ui-menu.f9abee36db8f6ad2.js","canopyx-ui-menu.2f3478cc5f5c272f.css"],"ui-picker":["d415103478faf52a","canopyx-ui-picker.13e544bd68aca998.js","canopyx-ui-picker.59c85a1988a287a9.css"],"ui-navigation":["2553d01c5276d56a","canopyx-ui-navigation.c4ebc214197f140d.js","canopyx-ui-navigation.0afd07bbdc5aecb5.css"],"ui-tabs":["19ece8184f3daf4a","canopyx-ui-tabs.6cd35b2afd89f530.js","canopyx-ui-tabs.7bb6c6f1341e87e9.css"],"ui-stepper":["5682c49db1b85314","canopyx-ui-stepper.96973189b0f6e0c4.js","canopyx-ui-stepper.1d4a9db373b8d2f2.css"],"ui-accordion":["1424f075b78d0ccd","canopyx-ui-accordion.d0d5daa7f73d0859.js","canopyx-ui-accordion.a3ef9c27cea5b7a4.css"],"tree-tools":["ef0d06c82135ae2e","canopyx-tree-tools.1c4b9e286dde6065.js","canopyx-tree-tools.350dd0ee46757029.css"],"presenters":["d5f9d61bb730974b","canopyx-presenters.d71f9e12d83969d9.js"],"filter-editor":["b760f978327dbab0","canopyx-filter-editor.4851bd579e7d146c.js","canopyx-filter-editor.2e0cf6850cbd3235.css"],"export":["15abf3205094bda6","canopyx-export.68b90138463329fe.js"],"office-export":["4fb7a4d570390ee9","canopyx-office-export.7e62c385b884e75b.js"],"history":["7d9901d2fe04df72","canopyx-history.9432e724bf14c9ed.js"],"pager":["cc30dd4f6d3feeb0","canopyx-pager.2a6f5da8c93de083.js","canopyx-pager.c1e16027780b7fdd.css"],"enhance":["a3b4be5ec19a43a6","canopyx-enhance.4a189cba27c290de.js"],"data":["bab770170bd2cfdd","canopyx-data.34325d1fd693886e.js"],"forms":["381a3edba481660b","canopyx-forms.fa85aa9e8b62876a.js","canopyx-forms.50a5ddb0fcc98bdf.css"],"flow":["02a915fe174e4710","canopyx-flow.2ec165998fe2950d.js","canopyx-flow.347ecd64183ea3a1.css"],"flow-host":["7169c4283cec8b25","canopyx-flow-host.52ccd1a2b6cd53f7.js","canopyx-flow-host.a7c8d3fc930ad3a9.css"],"flow-checks":["53394e75b7d1b0e2","canopyx-flow-checks.76e58f9d05eaa78f.js","canopyx-flow-checks.88dd9f389b249147.css"],"flow-options":["60450342239ded26","canopyx-flow-options.d31458a54aa4b1e7.js"],"flow-pick":["7e0924c72fdd2f74","canopyx-flow-pick.c2e34da944b0edab.js","canopyx-flow-pick.ce7687598d4703f1.css"],"flow-records":["0b652a9789ce4128","canopyx-flow-records.df8aba0a303019e0.js","canopyx-flow-records.393243243aae9a56.css"],"flow-drafts":["fac75bf905a77d0b","canopyx-flow-drafts.c7db634ab651e9fc.js","canopyx-flow-drafts.2c43cff1ce9be700.css"],"flow-preview":["5e8207eed3801f91","canopyx-flow-preview.3924dc8410f9775d.js","canopyx-flow-preview.069c52c33e87ffb4.css"],"flow-command":["a30245a47f6d4530","canopyx-flow-command.b145a234a6ecc8a2.js","canopyx-flow-command.f98b5333af3a0e17.css"],"flow-tasks":["8a4437f5216ac3ee","canopyx-flow-tasks.569d4c40d317472b.js","canopyx-flow-tasks.54857a9f2732048a.css"],"flow-dialog":["8c45e0a8bb6a8ab9","canopyx-flow-dialog.cb4e85bcb7383fe2.js","canopyx-flow-dialog.58bd5d446415e01a.css"],"flow-links":["2c14b19c9236e90d","canopyx-flow-links.7b6cfe42d28b6067.js"],"flow-endpoint":["f5cddfc9545e0920","canopyx-flow-endpoint.b31146202bd76aac.js"],"flow-facts":["385b5e61ed487e16","canopyx-flow-facts.8dad3bc07a71fdb0.js"],"flow-consent":["22121778bc0d07c5","canopyx-flow-consent.749b97f13039bc71.js","canopyx-flow-consent.9f6580d3673ae8bf.css"],"matrix":["002a6d917bb4d638","canopyx-matrix.17ae2d0e03ad1364.js","canopyx-matrix.59fc6920ae000d49.css"],"changes":["7d9a526aa07a8838","canopyx-changes.75f1a61cbba98a4f.js","canopyx-changes.5f0ae1710b8b081c.css"],"editing":["88e4ca705a7eb0c3","canopyx-editing.6a6df811fb4dde54.js","canopyx-editing.4816f6be6f89d794.css"],"column-groups":["91abd99e8ff95b58","canopyx-column-groups.4c71d23375de727c.js","canopyx-column-groups.4e4131c1e2df40b1.css"],"cell-range":["cb29468954702795","canopyx-cell-range.d4f99a024db5d0f8.js","canopyx-cell-range.c790b8f140b1243b.css"],"links":["c6579c9401f0971d","canopyx-links.b25760079f57e6e1.js"],"search":["521eebd6e1bbbd35","canopyx-search.14c69f4551c69f23.js"],"formatting":["0feff4e3424599e9","canopyx-formatting.94536547a1d35e9b.js","canopyx-formatting.22b2400c566e25d6.css"],"format-editor":["97085e181fbc1cf7","canopyx-format-editor.a6bc57c48173bfc0.js","canopyx-format-editor.d5aaa8e873d92695.css"],"link":["7485f5c9875e9f9b","canopyx-link.9066770aa822fe0f.js","canopyx-link.997fefec6b85f0c5.css"],"detail-rows":["1892f1fd9d035c0f","canopyx-detail-rows.8be98dbc5721170a.js","canopyx-detail-rows.275076ec8bd9144a.css"],"calculations":["f902dc5856fc7bdd","canopyx-calculations.97e438237ba43f99.js","canopyx-calculations.50432e524dd7d8d9.css"],"pivot":["577443c67c7ed719","canopyx-pivot.3abc630122030933.js","canopyx-pivot.5670e62c0bbf114f.css"],"values":["0d7006b0f7bfca10","canopyx-values.ad4c56fcbcd89cbb.js","canopyx-values.446654b98c62ef1d.css"],"buckets":["cc69c8336c15df83","canopyx-buckets.1f59613f13ee292c.js"],"grouping":["c82705991ff01a4c","canopyx-grouping.239f13b0785a2e30.js","canopyx-grouping.a91801c602d752b3.css"],"highlight":["5ebf0042011ba4fd","canopyx-highlight.ff11a0ca8e30102b.js","canopyx-highlight.9c26291cbcd0962b.css"],"layouts":["90267e35e7edf3a4","canopyx-layouts.058b8a396f909a79.js","canopyx-layouts.ca17f42babc4192a.css"],"facets":["e78c2340a96fa802","canopyx-facets.74b2e520a3c04580.js","canopyx-facets.e2970dd7cf0c3da6.css"],"live":["78791b002a111843","canopyx-live.878dc16d683abb72.js","canopyx-live.9881627f352f59da.css"],"record-panel":["cb6bcd1baf644a51","canopyx-record-panel.557c676822e8624f.js","canopyx-record-panel.174846a640de979f.css"],"calendar":["b414f93d261b2b76","canopyx-calendar.b25ab96faed29154.js","canopyx-calendar.e3f3eaca3f05bb03.css"],"calendar-recurrence":["64bcc24d785bd1af","canopyx-calendar-recurrence.4b7f430c2a64de23.js"],"calendar-edit":["09747e191820d94c","canopyx-calendar-edit.174f5125d3e75bd9.js"],"calendar-ics":["ac8b2950fccbfb0f","canopyx-calendar-ics.4a18c1c4a1520418.js"],"calendar-screen":["c2be4b1ddf96a778","canopyx-calendar-screen.00a3a9b445e504f6.js","canopyx-calendar-screen.1f4866e9a24e75f3.css"],"timeline":["cb9b9dd33154172c","canopyx-timeline.a3dea165914fa7fd.js","canopyx-timeline.44c3156c218531e2.css"],"grid-options":["ee53e6f124b99d5a","canopyx-grid-options.9f8604806c93bf19.js","canopyx-grid-options.e85648a66d70d5b5.css"],"board":["dd02be00df77f53a","canopyx-board.81de43b6e0f4aec3.js","canopyx-board.b62cc3a0348e758a.css"],"plan":["db07c2eb53541d49","canopyx-plan.f3bf394516b627b7.js","canopyx-plan.743201d95414f399.css"],"path":["c6fa2dbab6a0dbaa","canopyx-path.97c3ee2b076b2db6.js","canopyx-path.efba21adc0bfc372.css"],"stack":["e29298edc07edb6d","canopyx-stack.82a5a0c6383519dc.js","canopyx-stack.b867aa57edf9002c.css"],"time-slider":["5516099a165cc345","canopyx-time-slider.ed59a275671c729f.js","canopyx-time-slider.dfc55326f03e1d4a.css"],"view-intents":["dbd26360f2b90a49","canopyx-view-intents.3adcb56dffca0650.js","canopyx-view-intents.29a5c2de68ce3ba0.css"],"compare":["46245b96483e9c30","canopyx-compare.2a8ddc0ce67e903f.js","canopyx-compare.da0a2dff321e782d.css"]},PART_CODE=new Map(),SHARED_PARTS={},partName=name=>typeof name==="string"&&/^[a-z][a-z\d-]{0,31}$/.test(name);
|
|
535
534
|
function registerPart(name,part){if(!partName(name)||!part||typeof part.version!=="string"||typeof part.install!=="function"||
|
|
536
535
|
part.requires!==undefined&&!(Array.isArray(part.requires)&&part.requires.every(partName)))throw new Error("CanopyX: invalid part.");PART_CODE.set(name,part)}
|
|
537
536
|
function definePart(View,name,label,context){const parts=View.prototype.parts||={};return parts[name]={name,label,context,parts}}
|
|
@@ -593,7 +592,7 @@ const wanted=Array.from(new Set(ids||this.rows.filter((w)=>!w.status).map((w)=>w
|
|
|
593
592
|
const navigation=navigationScope(this,this.dataLifetime.signal);let doc;try{doc=await navigation.wait(this.source.counts(wanted,this.sourceRequest(this.dataLifetime.signal)))}
|
|
594
593
|
finally{navigation.dispose()}
|
|
595
594
|
if(navigation.cancelled())return null;if(this.queryAware)snapshotRevision(doc,this.datasetRevision);checkDocument(doc,"counts");this.applyCounts(Object.assign({},doc,{items:doc.items.filter(item=>{const captured=mine.get(item.id);return captured&&this.keyMap.get(item.id)===captured.w&&captured.w.countRevision===captured.revision})}),true);return doc}});function UiHost(){}
|
|
596
|
-
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of
|
|
595
|
+
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",accordion:"ui-accordion",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of Object.keys(PARTS).filter(part=>part.startsWith("ui-")))SHARED_PARTS[name]=definePart(UiHost,name,name.replace("ui-","UI "),uiContext);function createUi(kind,target,options={}){const root=typeof target==="string"?document.querySelector(target):target;if(root?.nodeType!==1)throw new Error("CanopyX: "+kind+" needs an element.");let registrations=uiInstances.get(root);if(!registrations)uiInstances.set(root,registrations=new Map());if(registrations.has(kind))return registrations.get(kind);const lifetime=new AbortController();watchTheme(root,lifetime.signal);let instance=null;const ready=loadPart(SHARED_PARTS[UI_KINDS[kind]]).then(()=>{if(lifetime.signal.aborted)throw new DOMException("UI component destroyed.","AbortError");instance=UI_IMPL[kind](root,options,lifetime.signal);return instance.ready||instance});const api={element:root,ready:ready.then(()=>api),destroy(){if(lifetime.signal.aborted)return;lifetime.abort();instance?.destroy?.();registrations.delete(kind)}};for(const name of["select","getSelected","refresh","preparePrint","open","close","next","back","skip","finish","setStepState","getState","toggle","getOpen","filter"])api[name]=(...args)=>{if(lifetime.signal.aborted)throw new Error("CanopyX: UI component destroyed.");return instance?instance[name]?.(...args):ready.then(()=>instance[name]?.(...args))};api.ready.catch(error=>{if(error.name!=="AbortError")root.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))});registrations.set(kind,Object.freeze(api));return api}
|
|
597
596
|
function bindContextMenu(target,items,options={}){if(typeof target!=="string"&&target?.nodeType!==1)throw new Error("CanopyX: contextMenu needs an element or selector.");if(typeof target==="string")document.documentElement.matches(target);let disposed=false,cleanup=null;const dispose=()=>{disposed=true;cleanup?.()};dispose.ready=loadPart(SHARED_PARTS["ui-menu"]).then(()=>{if(!disposed)cleanup=UI_IMPL.contextMenu(target,items,options)});dispose.open=(...args)=>disposed?false:cleanup?cleanup.open(...args):dispose.ready.then(()=>!disposed&&cleanup.open(...args));dispose.close=(...args)=>cleanup?.close(...args);return dispose}
|
|
598
597
|
function mountUi(root=document){const mounted=[];for(const kind of Object.keys(UI_KINDS)){const selector="[data-cx-"+kind+"]",nodes=[...root.querySelectorAll(selector)];if(root.matches?.(selector))nodes.unshift(root);for(const element of nodes){if(kind==="menu"&&element.parentElement?.closest(selector))continue;if(kind==="stepper"&&["report","static"].includes(element.dataset.mode))continue;mounted.push(createUi(kind,element))}}
|
|
599
598
|
return mounted}
|
|
@@ -1066,7 +1065,7 @@ ids.some(id=>!this.columns.some(column=>column.id===id)))throw new Error("Canopy
|
|
|
1066
1065
|
catch(_){/* A disabled or full storage leaves the current session usable. */ }
|
|
1067
1066
|
}});const GRID_HISTORY_IMPL={},GRID_HISTORY=definePart(DataGrid,"history","history presenters",()=>({GRID_HISTORY_IMPL,h,setText,fill,gridSeries,gridPresenterTone,toneColors,toneOf,GRID_TONE_RANK}));const GRID_HISTORY_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.loadHistory=function(){return this.historyLoad||=loadPart(GRID_HISTORY).then(()=>{this.version++;this.scheduleRender()},error=>this.emit("error",{error}))};DataGrid.prototype.initializeState=function(){const ready=GRID_HISTORY_INIT.call(this);return this.columns.some(column=>GRID_HISTORY_KINDS.includes(column.presenter?.kind))?Promise.all([ready,this.loadHistory()]).then(([result])=>result):ready};const GRID_BOARD=definePart(DataGrid,"board","board view",()=>({DataGrid,h,setText,fill,cellValue,cellText,gridScalar,gridQueryRows,gridQuery,validateGridPage,validateGridCursorPage,numberFormat,PROTOCOL}));const GRID_BOARD_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.initializeState=function(){const start=()=>GRID_BOARD_INIT.call(this);return this.view.board?loadPart(GRID_BOARD).then(()=>{if(!this.destroyed)this.startBoard()}).then(start):start()};DEFAULT_LABELS=Object.freeze(Object.assign({},DEFAULT_LABELS,{gridBucket:"Bucket",gridBucketNone:"Exact values",gridBucketDay:"Day",gridBucketWeek:"Week",gridBucketMonth:"Month",gridBucketQuarter:"Quarter",gridBucketYear:"Year",gridBucketHour:"Hour of day",gridBucketWeekday:"Weekday",gridBucketWidth:"Range width",gridBucketEdges:"Range edges",gridBucketOrigin:"Range origin",gridBucketInvalid:"Enter valid bucket settings."}));const BUCKETS_PART=definePart(DataGrid,"buckets","date and range buckets",()=>({GRID_BUCKETS}));const gridUsesBuckets=view=>view.reporting?.groupBy?.some(level=>level.bucket)||view.facets?.columns?.some(facet=>facet?.bucket)||
|
|
1068
1067
|
view.query?.groupBy?.some(level=>level.bucket)||gridQueryUsesBucketFilters(view.query);function gridQueryUsesBucketFilters(query){const group=node=>!!node&&(node.filters?.some(filter=>filter.bucket)||node.groups?.some(group));return query?.filters?.some(filter=>filter.bucket)||group(query?.filterGroup)||query?.tupleFilters?.some(tuple=>tuple.columns?.some(field=>field.bucket))}
|
|
1069
|
-
const BUCKET_REQUEST_PAGE=DataGrid.prototype.requestPage;DataGrid.prototype.requestPage=async function(query,signal){if(gridQueryUsesBucketFilters(query))await loadPart(BUCKETS_PART);return BUCKET_REQUEST_PAGE.call(this,query,signal)};DEFAULT_LABELS=Object.freeze(Object.assign({},DEFAULT_LABELS,{gridCalculationAdd:"Add calculated column",gridCalculationTitle:"Column title",gridCalculationId:"Column ID",gridCalculationExpression:"Expression",gridCalculationError:"Calculation error: {error}",gridCalculationInvalid:"Check the expression, column references and result kind.",gridCalculationHelp:"Use [columnId], arithmetic, IF, COALESCE, ROUND, CONCAT, DATEPART or DATEDIFF.",gridCalculationResultType:"Result type",gridCalculationDivideZero:"Division by zero",gridCalculationNumber:"Number",gridCalculationDate:"Date and time"}));const GRID_CALCULATIONS={},CALCULATIONS_PART=definePart(DataGrid,"calculations","calculated columns",()=>({DataGrid,GRID_CALCULATIONS,requireIdentifier,cellValue,h,setText,fill,gridButton,gridQuery,gridQueryStart,inlineGridSource,rowDataSource,loadGridFilterEditor,gridFreeze,gridFitPrepare}));const gridUsesCalculations=view=>view.calculatedColumnsEditable||view.columns.some(column=>column.calculation!==undefined);Object.assign(DataGrid.prototype,{async prepareCalculations(){if(!gridUsesCalculations(this.view))return;await loadPart(CALCULATIONS_PART);GRID_CALCULATIONS.prepare(this)},async setCalculatedColumns(columns){await loadPart(CALCULATIONS_PART);return this.setCalculatedColumns(columns)},getCalculatedColumns(){return GRID_CALCULATIONS.definitions?.(this.view)||[]},async openCalculatedColumn(anchor){await loadPart(CALCULATIONS_PART);return this.openCalculatedColumn(anchor)}});const GRID_CALENDAR=definePart(DataGrid,"calendar","calendar",()=>({DataGrid,h,setText,fill,plural,gridButton,gridIcon,gridFreeze,cellText,cellValue,isCellObject,gridQuery,gridQueryRows,gridResultShape,gridPresenterTone,validateGridRows,repairGridCell,validateGridPage,validateGridCursorPage,validStructuralCount,checkDocument,numberFormat,loadPart,HostCellContext,disposeHostSlot,PROTOCOL,toneVariable,bindContextMenu}));definePart(DataGrid,"timeline","resource timeline",()=>({DataGrid,TreeGrid,h,setText,fill,numberFormat,toneVariable}));definePart(DataGrid,"calendar-recurrence","calendar recurrence",()=>({DataGrid}));definePart(DataGrid,"calendar-edit","calendar editing",()=>({DataGrid,h,setText,fill,cellValue,GRID_DRAG}));definePart(DataGrid,"calendar-ics","iCalendar",()=>({DataGrid,h,fill,cellText}));const GRID_CALENDAR_API=["getCalendar","setCalendarView","setCalendarDate","setCalendarZoom","calendarStep","calendarToday","getCalendarEvents","exportCalendar","openCalendarEvent","editCalendarOccurrence","clearCalendarSelection","setCalendarSource"];for(const name of GRID_CALENDAR_API)DataGrid.prototype[name]=function(...args){return this.loadCalendar().then(()=>this[name](...args))};DataGrid.prototype.loadCalendar=function(){return this.calLoad||=loadPart(GRID_CALENDAR).then(()=>this.destroyed||this.calParts()).then(()=>this.destroyed||this.startCalendar()).catch(error=>{this.calLoad=null;this.emit("error",{error});throw error})};const GRID_CALENDAR_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.initializeState=function(){const start=()=>GRID_CALENDAR_INIT.call(this);return this.view.calendar?this.loadCalendar().then(start,start):start()};const CAL_PRESETS={basic:{toolbar:false,details:"popover",views:["month","week","day","agenda"]},standard:{toolbar:["search","filters","export"],details:"popover",print:true,views:["month","week","day","days","agenda","year"]},scheduler:{toolbar:["search","filters","views","export"],details:"drawer",print:true,editable:true,create:true,views:["month","week","day","agenda"]}};const CAL_FIELDS=["allDay","description","tone","resource","resourceIds","recurrence","exceptions","series","recurrenceId","source"];const CAL_TITLES={allDay:"All day",description:"Description",tone:"Tone",resource:"Resource",resourceIds:"Resources",series:"Series",recurrenceId:"Original start",recurrence:"Repeats",exceptions:"Exceptions",source:"Source"};const CAL_OWN=new Set(["events","preset","id","label","views","view","date","timeZone","firstDay","toolbar","details","editable","create","drop","resources","timeline","live","facets","drawer","export","print","sources","calendar","links"]);const calPad=(value,size=2)=>String(value).padStart(size,"0");function calInstantText(value,field,allDay){if(value instanceof Date&&Number.isFinite(value.getTime()))
|
|
1068
|
+
const BUCKET_REQUEST_PAGE=DataGrid.prototype.requestPage;DataGrid.prototype.requestPage=async function(query,signal){if(gridQueryUsesBucketFilters(query))await loadPart(BUCKETS_PART);return BUCKET_REQUEST_PAGE.call(this,query,signal)};DEFAULT_LABELS=Object.freeze(Object.assign({},DEFAULT_LABELS,{gridCalculationAdd:"Add calculated column",gridCalculationTitle:"Column title",gridCalculationId:"Column ID",gridCalculationExpression:"Expression",gridCalculationError:"Calculation error: {error}",gridCalculationInvalid:"Check the expression, column references and result kind.",gridCalculationHelp:"Use [columnId], arithmetic, IF, COALESCE, ROUND, CONCAT, DATEPART or DATEDIFF.",gridCalculationResultType:"Result type",gridCalculationDivideZero:"Division by zero",gridCalculationNumber:"Number",gridCalculationDate:"Date and time"}));const GRID_CALCULATIONS={},CALCULATIONS_PART=definePart(DataGrid,"calculations","calculated columns",()=>({DataGrid,GRID_CALCULATIONS,requireIdentifier,cellValue,h,setText,fill,gridButton,gridQuery,gridQueryStart,inlineGridSource,rowDataSource,loadGridFilterEditor,gridFreeze,gridFitPrepare}));const gridUsesCalculations=view=>view.calculatedColumnsEditable||view.columns.some(column=>column.calculation!==undefined);Object.assign(DataGrid.prototype,{async prepareCalculations(){if(!gridUsesCalculations(this.view))return;await loadPart(CALCULATIONS_PART);GRID_CALCULATIONS.prepare(this)},async setCalculatedColumns(columns){await loadPart(CALCULATIONS_PART);return this.setCalculatedColumns(columns)},getCalculatedColumns(){return GRID_CALCULATIONS.definitions?.(this.view)||[]},async openCalculatedColumn(anchor){await loadPart(CALCULATIONS_PART);return this.openCalculatedColumn(anchor)}});const GRID_CALENDAR=definePart(DataGrid,"calendar","calendar",()=>({DataGrid,h,setText,fill,plural,gridButton,gridIcon,gridFreeze,cellText,cellValue,isCellObject,gridQuery,gridQueryRows,gridResultShape,gridPresenterTone,validateGridRows,repairGridCell,validateGridPage,validateGridCursorPage,validStructuralCount,checkDocument,numberFormat,loadPart,HostCellContext,disposeHostSlot,PROTOCOL,toneVariable,bindContextMenu}));definePart(DataGrid,"timeline","resource timeline",()=>({DataGrid,TreeGrid,h,setText,fill,numberFormat,toneVariable}));definePart(DataGrid,"calendar-recurrence","calendar recurrence",()=>({DataGrid}));definePart(DataGrid,"calendar-edit","calendar editing",()=>({DataGrid,h,setText,fill,cellValue,GRID_DRAG}));definePart(DataGrid,"calendar-ics","iCalendar",()=>({DataGrid,h,fill,cellText}));definePart(DataGrid,"calendar-screen","calendar shared screens",()=>({DataGrid,h,setText,fill,gridButton,gridFreeze,toneVariable}));const GRID_CALENDAR_API=["getCalendar","setCalendarView","setCalendarDate","setCalendarZoom","calendarStep","calendarToday","getCalendarEvents","exportCalendar","openCalendarEvent","editCalendarOccurrence","clearCalendarSelection","setCalendarSource","resetCalendar"];for(const name of GRID_CALENDAR_API)DataGrid.prototype[name]=function(...args){return this.loadCalendar().then(()=>this[name](...args))};DataGrid.prototype.loadCalendar=function(){return this.calLoad||=loadPart(GRID_CALENDAR).then(()=>this.destroyed||this.calParts()).then(()=>this.destroyed||this.startCalendar()).catch(error=>{this.calLoad=null;this.emit("error",{error});throw error})};const GRID_CALENDAR_INIT=DataGrid.prototype.initializeState;DataGrid.prototype.initializeState=function(){const start=()=>GRID_CALENDAR_INIT.call(this);return this.view.calendar?this.loadCalendar().then(start,start):start()};const CAL_PRESETS={basic:{toolbar:false,details:"popover",views:["month","week","day","agenda"]},standard:{toolbar:["search","filters","export"],details:"popover",print:true,views:["month","week","day","days","agenda","year"]},scheduler:{toolbar:["search","filters","views","export"],details:"drawer",print:true,editable:true,create:true,views:["month","week","day","agenda"]}};const CAL_FIELDS=["allDay","description","location","tone","resource","resourceIds","recurrence","exceptions","series","recurrenceId","source"];const CAL_TITLES={allDay:"All day",description:"Description",location:"Location",tone:"Tone",resource:"Resource",resourceIds:"Resources",series:"Series",recurrenceId:"Original start",recurrence:"Repeats",exceptions:"Exceptions",source:"Source"};const CAL_OWN=new Set(["events","preset","id","label","views","view","date","timeZone","firstDay","toolbar","details","editable","create","drop","resources","timeline","live","facets","drawer","export","print","sources","calendar","links"]);const calPad=(value,size=2)=>String(value).padStart(size,"0");function calInstantText(value,field,allDay){if(value instanceof Date&&Number.isFinite(value.getTime()))
|
|
1070
1069
|
return allDay?calPad(value.getFullYear(),4)+ "-"+calPad(value.getMonth()+ 1)+ "-"+calPad(value.getDate())+ "T00:00:00Z":value.toISOString().replace(".000Z","Z");if(typeof value==="string"&&/^\d{4}-\d\d-\d\d$/.test(value)) return value + "T00:00:00Z";
|
|
1071
1070
|
if(typeof value==="string"&&/^\d{4}-\d\d-\d\dT\d\d:\d\d(:\d\d(\.\d+)?)?(Z|[+-]\d\d:\d\d)$/.test(value)) return allDay ? value.slice(0, 10) + "T00:00:00Z" : value;
|
|
1072
1071
|
const parsed=typeof value==="string"&&/^\d{4}-\d\d-\d\dT\d\d:\d\d/.test(value) ? new Date(value) : null;
|
|
@@ -75,8 +75,7 @@ function fill(template,values){return template.replace(/\{(\w+)\}/g, (match, nam
|
|
|
75
75
|
const pluralRules=new Map();function plural(template,count,lang){if(!template.startsWith("["))return template;const forms={};for(const match of template.matchAll(/\[(zero|one|two|few|many|other)\]([^[]*)/g)) forms[match[1]] = match[2];
|
|
76
76
|
let rules=pluralRules.get(lang);if(!rules){try{rules=new Intl.PluralRules(lang||"en")}catch(_){rules=new Intl.PluralRules("en")}pluralRules.set(lang,rules)}
|
|
77
77
|
return forms[rules.select(Number(count))]??forms.other??template}
|
|
78
|
-
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{
|
|
79
|
-
if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent)[A-Z]\w{0,63}$/.test(name) && !uiLabel) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
78
|
+
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent|tabs|stepper|accordion|dialog|drawer|state)[A-Z]\w{0,63}$/.test(name)) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
80
79
|
if(typeof source[name]!=="string"||!/\S/.test(source[name])) throw new Error("CanopyX: label '" + name + "' must be a string with visible text.");
|
|
81
80
|
if((name==="utcTime"||name==="localTime")&&source[name].indexOf("{time}")<0)throw new Error("CanopyX: label '"+name+"' must hold {time}.");labels[name]=source[name]})}
|
|
82
81
|
return Object.freeze(labels)}
|
|
@@ -531,7 +530,7 @@ close()}else{return}
|
|
|
531
530
|
e.preventDefault()});input.addEventListener("blur",()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);blurTimer=setTimeout(close,150)});this.cancelSearch=()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);hits=[];close()};box.appendChild(input);box.appendChild(list);box.appendChild(status);bar.appendChild(box);this.searchInput=input}});function watchFlyout(anchorElement,panel,isOpen){const lifetime=new AbortController();let flyout=null,pending=null;const ready=()=>flyout?Promise.resolve(flyout):pending||=loadPart(SHARED_PARTS["ui-overlays"]).then(()=>{if(!lifetime.signal.aborted)flyout=UI_TOOLS.toolbarFlyout(anchorElement,panel,isOpen,lifetime.signal);return flyout}).catch(error=>{pending=null;throw error});const invoke=method=>{if(lifetime.signal.aborted||!isOpen())return;if(flyout){flyout[method]();return}
|
|
532
531
|
ready().then(value=>{if(!lifetime.signal.aborted&&isOpen())value?.[method]()}).catch(error=>{if(!lifetime.signal.aborted)(anchorElement.closest(".cx-host")||anchorElement)
|
|
533
532
|
.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))})};return{position:()=>invoke("position"),open:()=>invoke("open"),close:()=>flyout?.close(),dispose:()=>lifetime.abort()}}
|
|
534
|
-
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["
|
|
533
|
+
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["24afaa117ebf3fb5","canopyx-ui-overlays.dedc42d3a501a387.js","canopyx-ui-overlays.3668a9a74004ea8e.css"],"ui-menu":["352b1ee391133ff0","canopyx-ui-menu.f9abee36db8f6ad2.js","canopyx-ui-menu.2f3478cc5f5c272f.css"],"ui-picker":["d415103478faf52a","canopyx-ui-picker.13e544bd68aca998.js","canopyx-ui-picker.59c85a1988a287a9.css"],"ui-navigation":["2553d01c5276d56a","canopyx-ui-navigation.c4ebc214197f140d.js","canopyx-ui-navigation.0afd07bbdc5aecb5.css"],"ui-tabs":["19ece8184f3daf4a","canopyx-ui-tabs.6cd35b2afd89f530.js","canopyx-ui-tabs.7bb6c6f1341e87e9.css"],"ui-stepper":["5682c49db1b85314","canopyx-ui-stepper.96973189b0f6e0c4.js","canopyx-ui-stepper.1d4a9db373b8d2f2.css"],"ui-accordion":["1424f075b78d0ccd","canopyx-ui-accordion.d0d5daa7f73d0859.js","canopyx-ui-accordion.a3ef9c27cea5b7a4.css"],"tree-tools":["ef0d06c82135ae2e","canopyx-tree-tools.1c4b9e286dde6065.js","canopyx-tree-tools.350dd0ee46757029.css"],"export":["15abf3205094bda6","canopyx-export.68b90138463329fe.js"],"office-export":["4fb7a4d570390ee9","canopyx-office-export.7e62c385b884e75b.js"],"links":["c6579c9401f0971d","canopyx-links.b25760079f57e6e1.js"],"search":["521eebd6e1bbbd35","canopyx-search.14c69f4551c69f23.js"],"link":["7485f5c9875e9f9b","canopyx-link.9066770aa822fe0f.js","canopyx-link.997fefec6b85f0c5.css"],"highlight":["5ebf0042011ba4fd","canopyx-highlight.ff11a0ca8e30102b.js","canopyx-highlight.9c26291cbcd0962b.css"],"layouts":["90267e35e7edf3a4","canopyx-layouts.058b8a396f909a79.js","canopyx-layouts.ca17f42babc4192a.css"],"record-panel":["cb6bcd1baf644a51","canopyx-record-panel.557c676822e8624f.js","canopyx-record-panel.174846a640de979f.css"]},PART_CODE=new Map(),SHARED_PARTS={},partName=name=>typeof name==="string"&&/^[a-z][a-z\d-]{0,31}$/.test(name);
|
|
535
534
|
function registerPart(name,part){if(!partName(name)||!part||typeof part.version!=="string"||typeof part.install!=="function"||
|
|
536
535
|
part.requires!==undefined&&!(Array.isArray(part.requires)&&part.requires.every(partName)))throw new Error("CanopyX: invalid part.");PART_CODE.set(name,part)}
|
|
537
536
|
function definePart(View,name,label,context){const parts=View.prototype.parts||={};return parts[name]={name,label,context,parts}}
|
|
@@ -593,7 +592,7 @@ const wanted=Array.from(new Set(ids||this.rows.filter((w)=>!w.status).map((w)=>w
|
|
|
593
592
|
const navigation=navigationScope(this,this.dataLifetime.signal);let doc;try{doc=await navigation.wait(this.source.counts(wanted,this.sourceRequest(this.dataLifetime.signal)))}
|
|
594
593
|
finally{navigation.dispose()}
|
|
595
594
|
if(navigation.cancelled())return null;if(this.queryAware)snapshotRevision(doc,this.datasetRevision);checkDocument(doc,"counts");this.applyCounts(Object.assign({},doc,{items:doc.items.filter(item=>{const captured=mine.get(item.id);return captured&&this.keyMap.get(item.id)===captured.w&&captured.w.countRevision===captured.revision})}),true);return doc}});function UiHost(){}
|
|
596
|
-
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of
|
|
595
|
+
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",accordion:"ui-accordion",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of Object.keys(PARTS).filter(part=>part.startsWith("ui-")))SHARED_PARTS[name]=definePart(UiHost,name,name.replace("ui-","UI "),uiContext);function createUi(kind,target,options={}){const root=typeof target==="string"?document.querySelector(target):target;if(root?.nodeType!==1)throw new Error("CanopyX: "+kind+" needs an element.");let registrations=uiInstances.get(root);if(!registrations)uiInstances.set(root,registrations=new Map());if(registrations.has(kind))return registrations.get(kind);const lifetime=new AbortController();watchTheme(root,lifetime.signal);let instance=null;const ready=loadPart(SHARED_PARTS[UI_KINDS[kind]]).then(()=>{if(lifetime.signal.aborted)throw new DOMException("UI component destroyed.","AbortError");instance=UI_IMPL[kind](root,options,lifetime.signal);return instance.ready||instance});const api={element:root,ready:ready.then(()=>api),destroy(){if(lifetime.signal.aborted)return;lifetime.abort();instance?.destroy?.();registrations.delete(kind)}};for(const name of["select","getSelected","refresh","preparePrint","open","close","next","back","skip","finish","setStepState","getState","toggle","getOpen","filter"])api[name]=(...args)=>{if(lifetime.signal.aborted)throw new Error("CanopyX: UI component destroyed.");return instance?instance[name]?.(...args):ready.then(()=>instance[name]?.(...args))};api.ready.catch(error=>{if(error.name!=="AbortError")root.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))});registrations.set(kind,Object.freeze(api));return api}
|
|
597
596
|
function bindContextMenu(target,items,options={}){if(typeof target!=="string"&&target?.nodeType!==1)throw new Error("CanopyX: contextMenu needs an element or selector.");if(typeof target==="string")document.documentElement.matches(target);let disposed=false,cleanup=null;const dispose=()=>{disposed=true;cleanup?.()};dispose.ready=loadPart(SHARED_PARTS["ui-menu"]).then(()=>{if(!disposed)cleanup=UI_IMPL.contextMenu(target,items,options)});dispose.open=(...args)=>disposed?false:cleanup?cleanup.open(...args):dispose.ready.then(()=>!disposed&&cleanup.open(...args));dispose.close=(...args)=>cleanup?.close(...args);return dispose}
|
|
598
597
|
function mountUi(root=document){const mounted=[];for(const kind of Object.keys(UI_KINDS)){const selector="[data-cx-"+kind+"]",nodes=[...root.querySelectorAll(selector)];if(root.matches?.(selector))nodes.unshift(root);for(const element of nodes){if(kind==="menu"&&element.parentElement?.closest(selector))continue;if(kind==="stepper"&&["report","static"].includes(element.dataset.mode))continue;mounted.push(createUi(kind,element))}}
|
|
599
598
|
return mounted}
|
|
@@ -525,6 +525,9 @@ const labels = Object.freeze({
|
|
|
525
525
|
calendarOutsideRange: "Außerhalb des Zeitraums dieses Kalenders",
|
|
526
526
|
calendarClose: "Schließen",
|
|
527
527
|
calendarDetailsOf: "Details zu {title}",
|
|
528
|
+
calendarReset: "Zurücksetzen",
|
|
529
|
+
calendarSharedBy: "Geteilt von {names}",
|
|
530
|
+
calendarSourcesShown: "{shown} von {total}",
|
|
528
531
|
flowSteps: "Schritte",
|
|
529
532
|
flowStepOf: "Schritt {current} von {count}",
|
|
530
533
|
flowStepAnnounce: "Schritt {current} von {count}, {title}",
|
|
@@ -915,6 +918,10 @@ const labels = Object.freeze({
|
|
|
915
918
|
timePosition: "Momentaufnahme {index} von {count}",
|
|
916
919
|
timeFrame: "Momentaufnahme um {time}",
|
|
917
920
|
timeReducedMotion: "Die zeitgesteuerte Wiedergabe ist wegen reduzierter Bewegung deaktiviert. Momentaufnahmen manuell durchgehen.",
|
|
921
|
+
accordionSearch: "Abschnitte filtern",
|
|
922
|
+
accordionNoMatches: "Keine passenden Abschnitte",
|
|
923
|
+
accordionCopyTitle: "Titel kopieren",
|
|
924
|
+
accordionCopied: "Kopiert",
|
|
918
925
|
tabsMore: "Mehr",
|
|
919
926
|
tabsMoreSelected: "Mehr: {label}",
|
|
920
927
|
tabsScrollPrevious: "Vorherige Tabs",
|
|
@@ -525,6 +525,9 @@ const labels = Object.freeze({
|
|
|
525
525
|
calendarOutsideRange: "Fuera de las fechas que muestra este calendario",
|
|
526
526
|
calendarClose: "Cerrar",
|
|
527
527
|
calendarDetailsOf: "Detalles de {title}",
|
|
528
|
+
calendarReset: "Restablecer",
|
|
529
|
+
calendarSharedBy: "Compartido por {names}",
|
|
530
|
+
calendarSourcesShown: "{shown} de {total}",
|
|
528
531
|
flowSteps: "Pasos",
|
|
529
532
|
flowStepOf: "Paso {current} de {count}",
|
|
530
533
|
flowStepAnnounce: "Paso {current} de {count}, {title}",
|
|
@@ -915,6 +918,10 @@ const labels = Object.freeze({
|
|
|
915
918
|
timePosition: "Instantánea {index} de {count}",
|
|
916
919
|
timeFrame: "Instantánea de {time}",
|
|
917
920
|
timeReducedMotion: "La reproducción automática está desactivada porque el movimiento reducido está activado. Recorre las instantáneas manualmente.",
|
|
921
|
+
accordionSearch: "Filtrar secciones",
|
|
922
|
+
accordionNoMatches: "No hay secciones coincidentes",
|
|
923
|
+
accordionCopyTitle: "Copiar título",
|
|
924
|
+
accordionCopied: "Copiado",
|
|
918
925
|
tabsMore: "Más",
|
|
919
926
|
tabsMoreSelected: "Más: {label}",
|
|
920
927
|
tabsScrollPrevious: "Pestañas anteriores",
|
|
@@ -525,6 +525,9 @@ const labels = Object.freeze({
|
|
|
525
525
|
calendarOutsideRange: "En dehors des dates de ce calendrier",
|
|
526
526
|
calendarClose: "Fermer",
|
|
527
527
|
calendarDetailsOf: "Détails de {title}",
|
|
528
|
+
calendarReset: "Réinitialiser",
|
|
529
|
+
calendarSharedBy: "Partagé par {names}",
|
|
530
|
+
calendarSourcesShown: "{shown} sur {total}",
|
|
528
531
|
flowSteps: "Étapes",
|
|
529
532
|
flowStepOf: "Étape {current} sur {count}",
|
|
530
533
|
flowStepAnnounce: "Étape {current} sur {count}, {title}",
|
|
@@ -915,6 +918,10 @@ const labels = Object.freeze({
|
|
|
915
918
|
timePosition: "Instantané {index} sur {count}",
|
|
916
919
|
timeFrame: "Instantané du {time}",
|
|
917
920
|
timeReducedMotion: "La lecture automatique est désactivée car les mouvements réduits sont activés. Parcourez les instantanés manuellement.",
|
|
921
|
+
accordionSearch: "Filtrer les sections",
|
|
922
|
+
accordionNoMatches: "Aucune section correspondante",
|
|
923
|
+
accordionCopyTitle: "Copier le titre",
|
|
924
|
+
accordionCopied: "Copié",
|
|
918
925
|
tabsMore: "Plus",
|
|
919
926
|
tabsMoreSelected: "Plus : {label}",
|
|
920
927
|
tabsScrollPrevious: "Onglets précédents",
|
|
@@ -525,6 +525,9 @@ const labels = Object.freeze({
|
|
|
525
525
|
calendarOutsideRange: "Al di fuori delle date di questo calendario",
|
|
526
526
|
calendarClose: "Chiudi",
|
|
527
527
|
calendarDetailsOf: "Dettagli di {title}",
|
|
528
|
+
calendarReset: "Ripristina",
|
|
529
|
+
calendarSharedBy: "Condiviso da {names}",
|
|
530
|
+
calendarSourcesShown: "{shown} di {total}",
|
|
528
531
|
flowSteps: "Passaggi",
|
|
529
532
|
flowStepOf: "Passaggio {current} di {count}",
|
|
530
533
|
flowStepAnnounce: "Passaggio {current} di {count}, {title}",
|
|
@@ -915,6 +918,10 @@ const labels = Object.freeze({
|
|
|
915
918
|
timePosition: "Istantanea {index} di {count}",
|
|
916
919
|
timeFrame: "Istantanea del {time}",
|
|
917
920
|
timeReducedMotion: "La riproduzione automatica è disattivata perché è attiva la riduzione del movimento. Scorri le istantanee manualmente.",
|
|
921
|
+
accordionSearch: "Filtra le sezioni",
|
|
922
|
+
accordionNoMatches: "Nessuna sezione corrispondente",
|
|
923
|
+
accordionCopyTitle: "Copia titolo",
|
|
924
|
+
accordionCopied: "Copiato",
|
|
918
925
|
tabsMore: "Altro",
|
|
919
926
|
tabsMoreSelected: "Altro: {label}",
|
|
920
927
|
tabsScrollPrevious: "Schede precedenti",
|
|
@@ -525,6 +525,9 @@ const labels = Object.freeze({
|
|
|
525
525
|
calendarOutsideRange: "Poza datami, które pokazuje ten kalendarz",
|
|
526
526
|
calendarClose: "Zamknij",
|
|
527
527
|
calendarDetailsOf: "Szczegóły: {title}",
|
|
528
|
+
calendarReset: "Resetuj",
|
|
529
|
+
calendarSharedBy: "Wspólne: {names}",
|
|
530
|
+
calendarSourcesShown: "{shown} z {total}",
|
|
528
531
|
flowSteps: "Kroki",
|
|
529
532
|
flowStepOf: "Krok {current} z {count}",
|
|
530
533
|
flowStepAnnounce: "Krok {current} z {count}: {title}",
|
|
@@ -915,6 +918,10 @@ const labels = Object.freeze({
|
|
|
915
918
|
timePosition: "Stan {index} z {count}",
|
|
916
919
|
timeFrame: "Stan z {time}",
|
|
917
920
|
timeReducedMotion: "Automatyczne odtwarzanie jest wyłączone z powodu ograniczenia ruchu. Przeglądaj stany ręcznie.",
|
|
921
|
+
accordionSearch: "Filtruj sekcje",
|
|
922
|
+
accordionNoMatches: "Brak pasujących sekcji",
|
|
923
|
+
accordionCopyTitle: "Kopiuj tytuł",
|
|
924
|
+
accordionCopied: "Skopiowano",
|
|
918
925
|
tabsMore: "Więcej",
|
|
919
926
|
tabsMoreSelected: "Więcej: {label}",
|
|
920
927
|
tabsScrollPrevious: "Poprzednie karty",
|
|
@@ -77,8 +77,7 @@ function fill(template,values){return template.replace(/\{(\w+)\}/g, (match, nam
|
|
|
77
77
|
const pluralRules=new Map();function plural(template,count,lang){if(!template.startsWith("["))return template;const forms={};for(const match of template.matchAll(/\[(zero|one|two|few|many|other)\]([^[]*)/g)) forms[match[1]] = match[2];
|
|
78
78
|
let rules=pluralRules.get(lang);if(!rules){try{rules=new Intl.PluralRules(lang||"en")}catch(_){rules=new Intl.PluralRules("en")}pluralRules.set(lang,rules)}
|
|
79
79
|
return forms[rules.select(Number(count))]??forms.other??template}
|
|
80
|
-
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{
|
|
81
|
-
if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent)[A-Z]\w{0,63}$/.test(name) && !uiLabel) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
80
|
+
let DEFAULT_LABELS=Object.freeze({searchPlaceholder:"Search",searchResults:"Search results",searchResultCount:"{count} results",searchResultCountOfTotal:"{count} of {total} results",searchResultCountOfMany:"{count} of many results",searchNoResults:"No results",searchTooShort:"Type at least {min} characters",searchWordTooShort:"Type a word of at least {min} characters",searchFailed:"Search failed: {error}",columns:"Columns",hiddenColumns:"[one]+{count} column[other]+{count} columns",visibleColumns:"Visible columns",resizeColumn:"Resize {column}",columnWidth:"{width} pixels",loading:"Loading…",loadError:"Could not load: {error} (Enter to retry)",queryFailed:"Could not update the view: {error}",showMore:"Show more ({loaded} of {total} loaded)",showMoreUnknownTotal:"Show more ({loaded} loaded)",pageLoaded:"{loaded} of {total} loaded",itemsLoaded:"{count} items",yes:"Yes",no:"No",utcTime:"{time} UTC",localTime:"{time} local time",mountError:"This view could not be displayed: {error}"});function labelsFor(...sources){const labels=Object.assign({},DEFAULT_LABELS);for(const source of sources){if(source==null)continue;if(typeof source!=="object"||Array.isArray(source))throw new Error("CanopyX: labels must be an object of strings.");Object.keys(source).forEach((name)=>{if(!Object.hasOwn(DEFAULT_LABELS,name)&&!/^(?:gridEdit|format|calendar|flow|matrix|change|board|plan|path|stack|time|compare|viewIntent|tabs|stepper|accordion|dialog|drawer|state)[A-Z]\w{0,63}$/.test(name)) throw new Error("CanopyX: there is no label '" + name + "'.");
|
|
82
81
|
if(typeof source[name]!=="string"||!/\S/.test(source[name])) throw new Error("CanopyX: label '" + name + "' must be a string with visible text.");
|
|
83
82
|
if((name==="utcTime"||name==="localTime")&&source[name].indexOf("{time}")<0)throw new Error("CanopyX: label '"+name+"' must hold {time}.");labels[name]=source[name]})}
|
|
84
83
|
return Object.freeze(labels)}
|
|
@@ -533,7 +532,7 @@ close()}else{return}
|
|
|
533
532
|
e.preventDefault()});input.addEventListener("blur",()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);blurTimer=setTimeout(close,150)});this.cancelSearch=()=>{cancelNavigation();sequence++;clearTimeout(timer);clearTimeout(blurTimer);hits=[];close()};box.appendChild(input);box.appendChild(list);box.appendChild(status);bar.appendChild(box);this.searchInput=input}});function watchFlyout(anchorElement,panel,isOpen){const lifetime=new AbortController();let flyout=null,pending=null;const ready=()=>flyout?Promise.resolve(flyout):pending||=loadPart(SHARED_PARTS["ui-overlays"]).then(()=>{if(!lifetime.signal.aborted)flyout=UI_TOOLS.toolbarFlyout(anchorElement,panel,isOpen,lifetime.signal);return flyout}).catch(error=>{pending=null;throw error});const invoke=method=>{if(lifetime.signal.aborted||!isOpen())return;if(flyout){flyout[method]();return}
|
|
534
533
|
ready().then(value=>{if(!lifetime.signal.aborted&&isOpen())value?.[method]()}).catch(error=>{if(!lifetime.signal.aborted)(anchorElement.closest(".cx-host")||anchorElement)
|
|
535
534
|
.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))})};return{position:()=>invoke("position"),open:()=>invoke("open"),close:()=>flyout?.close(),dispose:()=>lifetime.abort()}}
|
|
536
|
-
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["
|
|
535
|
+
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"ui-overlays":["24afaa117ebf3fb5","canopyx-ui-overlays.dedc42d3a501a387.js","canopyx-ui-overlays.3668a9a74004ea8e.css"],"ui-menu":["352b1ee391133ff0","canopyx-ui-menu.f9abee36db8f6ad2.js","canopyx-ui-menu.2f3478cc5f5c272f.css"],"ui-picker":["d415103478faf52a","canopyx-ui-picker.13e544bd68aca998.js","canopyx-ui-picker.59c85a1988a287a9.css"],"ui-navigation":["2553d01c5276d56a","canopyx-ui-navigation.c4ebc214197f140d.js","canopyx-ui-navigation.0afd07bbdc5aecb5.css"],"ui-tabs":["19ece8184f3daf4a","canopyx-ui-tabs.6cd35b2afd89f530.js","canopyx-ui-tabs.7bb6c6f1341e87e9.css"],"ui-stepper":["5682c49db1b85314","canopyx-ui-stepper.96973189b0f6e0c4.js","canopyx-ui-stepper.1d4a9db373b8d2f2.css"],"ui-accordion":["1424f075b78d0ccd","canopyx-ui-accordion.d0d5daa7f73d0859.js","canopyx-ui-accordion.a3ef9c27cea5b7a4.css"],"tree-tools":["ef0d06c82135ae2e","canopyx-tree-tools.1c4b9e286dde6065.js","canopyx-tree-tools.350dd0ee46757029.css"],"export":["15abf3205094bda6","canopyx-export.68b90138463329fe.js"],"office-export":["4fb7a4d570390ee9","canopyx-office-export.7e62c385b884e75b.js"],"links":["c6579c9401f0971d","canopyx-links.b25760079f57e6e1.js"],"search":["521eebd6e1bbbd35","canopyx-search.14c69f4551c69f23.js"],"link":["7485f5c9875e9f9b","canopyx-link.9066770aa822fe0f.js","canopyx-link.997fefec6b85f0c5.css"],"highlight":["5ebf0042011ba4fd","canopyx-highlight.ff11a0ca8e30102b.js","canopyx-highlight.9c26291cbcd0962b.css"],"layouts":["90267e35e7edf3a4","canopyx-layouts.058b8a396f909a79.js","canopyx-layouts.ca17f42babc4192a.css"],"record-panel":["cb6bcd1baf644a51","canopyx-record-panel.557c676822e8624f.js","canopyx-record-panel.174846a640de979f.css"]},PART_CODE=new Map(),SHARED_PARTS={},partName=name=>typeof name==="string"&&/^[a-z][a-z\d-]{0,31}$/.test(name);
|
|
537
536
|
function registerPart(name,part){if(!partName(name)||!part||typeof part.version!=="string"||typeof part.install!=="function"||
|
|
538
537
|
part.requires!==undefined&&!(Array.isArray(part.requires)&&part.requires.every(partName)))throw new Error("CanopyX: invalid part.");PART_CODE.set(name,part)}
|
|
539
538
|
function definePart(View,name,label,context){const parts=View.prototype.parts||={};return parts[name]={name,label,context,parts}}
|
|
@@ -595,7 +594,7 @@ const wanted=Array.from(new Set(ids||this.rows.filter((w)=>!w.status).map((w)=>w
|
|
|
595
594
|
const navigation=navigationScope(this,this.dataLifetime.signal);let doc;try{doc=await navigation.wait(this.source.counts(wanted,this.sourceRequest(this.dataLifetime.signal)))}
|
|
596
595
|
finally{navigation.dispose()}
|
|
597
596
|
if(navigation.cancelled())return null;if(this.queryAware)snapshotRevision(doc,this.datasetRevision);checkDocument(doc,"counts");this.applyCounts(Object.assign({},doc,{items:doc.items.filter(item=>{const captured=mine.get(item.id);return captured&&this.keyMap.get(item.id)===captured.w&&captured.w.countRevision===captured.revision})}),true);return doc}});function UiHost(){}
|
|
598
|
-
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of
|
|
597
|
+
const UI_IMPL={},UI_TOOLS={},uiInstances=new WeakMap();const UI_KINDS={tabs:"ui-tabs",stepper:"ui-stepper",accordion:"ui-accordion",menu:"ui-menu",dialog:"ui-overlays",drawer:"ui-overlays",popover:"ui-overlays",tooltip:"ui-overlays"};const uiContext=()=>({UI_IMPL,UI_TOOLS,h,setText,fill,watchTheme,overlayTheme,hostHtml});for(const name of Object.keys(PARTS).filter(part=>part.startsWith("ui-")))SHARED_PARTS[name]=definePart(UiHost,name,name.replace("ui-","UI "),uiContext);function createUi(kind,target,options={}){const root=typeof target==="string"?document.querySelector(target):target;if(root?.nodeType!==1)throw new Error("CanopyX: "+kind+" needs an element.");let registrations=uiInstances.get(root);if(!registrations)uiInstances.set(root,registrations=new Map());if(registrations.has(kind))return registrations.get(kind);const lifetime=new AbortController();watchTheme(root,lifetime.signal);let instance=null;const ready=loadPart(SHARED_PARTS[UI_KINDS[kind]]).then(()=>{if(lifetime.signal.aborted)throw new DOMException("UI component destroyed.","AbortError");instance=UI_IMPL[kind](root,options,lifetime.signal);return instance.ready||instance});const api={element:root,ready:ready.then(()=>api),destroy(){if(lifetime.signal.aborted)return;lifetime.abort();instance?.destroy?.();registrations.delete(kind)}};for(const name of["select","getSelected","refresh","preparePrint","open","close","next","back","skip","finish","setStepState","getState","toggle","getOpen","filter"])api[name]=(...args)=>{if(lifetime.signal.aborted)throw new Error("CanopyX: UI component destroyed.");return instance?instance[name]?.(...args):ready.then(()=>instance[name]?.(...args))};api.ready.catch(error=>{if(error.name!=="AbortError")root.dispatchEvent(new CustomEvent("canopyx:error",{detail:{error},bubbles:true}))});registrations.set(kind,Object.freeze(api));return api}
|
|
599
598
|
function bindContextMenu(target,items,options={}){if(typeof target!=="string"&&target?.nodeType!==1)throw new Error("CanopyX: contextMenu needs an element or selector.");if(typeof target==="string")document.documentElement.matches(target);let disposed=false,cleanup=null;const dispose=()=>{disposed=true;cleanup?.()};dispose.ready=loadPart(SHARED_PARTS["ui-menu"]).then(()=>{if(!disposed)cleanup=UI_IMPL.contextMenu(target,items,options)});dispose.open=(...args)=>disposed?false:cleanup?cleanup.open(...args):dispose.ready.then(()=>!disposed&&cleanup.open(...args));dispose.close=(...args)=>cleanup?.close(...args);return dispose}
|
|
600
599
|
function mountUi(root=document){const mounted=[];for(const kind of Object.keys(UI_KINDS)){const selector="[data-cx-"+kind+"]",nodes=[...root.querySelectorAll(selector)];if(root.matches?.(selector))nodes.unshift(root);for(const element of nodes){if(kind==="menu"&&element.parentElement?.closest(selector))continue;if(kind==="stepper"&&["report","static"].includes(element.dataset.mode))continue;mounted.push(createUi(kind,element))}}
|
|
601
600
|
return mounted}
|
|
@@ -772,4 +771,4 @@ function mount(root,automatic){const scope=root||document;const created=[];const
|
|
|
772
771
|
const message=err&&err.message?err.message:String(err);let labels=DEFAULT_LABELS;for(const attempt of[()=>labelsFor(view&&view.labels,view&&configured.has(view.id)?configured.get(view.id).labels:null),()=>labelsFor(view&&view.labels)]){try{labels=attempt();break}catch(e){labels=DEFAULT_LABELS}}
|
|
773
772
|
const notice=document.createElement("div");notice.className="cx-mount-error";notice.setAttribute("role","alert");setText(notice,fill(labels.mountError,{error:message}));host.classList.add("cx-host");host.setAttribute("data-canopyx-mounted","true");host.setAttribute("data-cx-error",message);host.appendChild(notice);if(global.console)global.console.error(err)};const selector="[data-canopyx-host]:not([data-canopyx-mounted])";(scope.matches?.(selector)?[scope]:scope.querySelectorAll(selector)).forEach((host)=>{const config=host.querySelector("script.cx-config"),mode=host.getAttribute("data-cx-mount");if(!config||(automatic===true&&mode==="manual")){return}
|
|
774
773
|
if(mode==="visible"&&host!==scope&&global.IntersectionObserver)return mountWhenVisible(host);watcher?.unobserve(host);host.setAttribute("data-canopyx-mounted","true");let view=null;try{view=JSON.parse(config.textContent);if(view===Object(view))parsedViews.add(view);const flow=view&&view.kind==="flow"&&typeof FLOW_API==="object",matrix=view&&view.type==="matrix"&&typeof MATRIX_API==="object";const change=view&&typeof CHANGE_VIEW_TYPES==="object"&&Object.hasOwn(CHANGE_VIEW_TYPES,view.type)?CHANGE_VIEW_TYPES[view.type]:null;const create=flow?FLOW_API.createFlow:matrix?MATRIX_API.createMatrix:change?change:view&&view.type==="grid"&&typeof createDataGrid==="function"?createDataGrid:createTreeGrid;const api=create(host,Object.assign({},view&&configured.get(view.id),flow?{flow:view}:{view}));created.push(api);api.ready.catch((err)=>{if(view.type!=="grid"&&!matrix&&!change&&activeGrids.get(host)===api&&host.canopyx===api)showError(host,err,api,view)})}catch(err){showError(host,err,null,view)}});mountUi(scope);return created}
|
|
775
|
-
global.CanopyX=Object.freeze(Object.assign({protocol:PROTOCOL,createTreeGrid,configure,unconfigure,mount:(root)=>mount(root,false),sources:Object.freeze({inline:inlineSource,sidecar:sidecarSource,remote:remoteSource}),badge:hostBadge,labels:DEFAULT_LABELS,registerExportFormat,use,registerPart,setNonce},typeof GRID_API==="object"?GRID_API:{},typeof FLOW_API==="object"?FLOW_API:{},typeof MATRIX_API==="object"?MATRIX_API:{},typeof CHANGES_API==="object"?CHANGES_API:{},UI_API));if(typeof document!=="undefined"){const navigation=global.performance&&performance.getEntriesByType?performance.getEntriesByType("navigation")[0]:null;if(document.readyState==="loading"||(document.readyState==="interactive"&&navigation&&navigation.domContentLoadedEventStart===0)){document.addEventListener("DOMContentLoaded",()=>mount(document,true))}else{mount(document,true)}}})(runtimeHost);const CanopyX=runtimeHost.CanopyX;const{protocol,createTreeGrid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,dialog,drawer,popover,tooltip,menu}=CanopyX;export{protocol,createTreeGrid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,dialog,drawer,popover,tooltip,menu};export default CanopyX;
|
|
774
|
+
global.CanopyX=Object.freeze(Object.assign({protocol:PROTOCOL,createTreeGrid,configure,unconfigure,mount:(root)=>mount(root,false),sources:Object.freeze({inline:inlineSource,sidecar:sidecarSource,remote:remoteSource}),badge:hostBadge,labels:DEFAULT_LABELS,registerExportFormat,use,registerPart,setNonce},typeof GRID_API==="object"?GRID_API:{},typeof FLOW_API==="object"?FLOW_API:{},typeof MATRIX_API==="object"?MATRIX_API:{},typeof CHANGES_API==="object"?CHANGES_API:{},UI_API));if(typeof document!=="undefined"){const navigation=global.performance&&performance.getEntriesByType?performance.getEntriesByType("navigation")[0]:null;if(document.readyState==="loading"||(document.readyState==="interactive"&&navigation&&navigation.domContentLoadedEventStart===0)){document.addEventListener("DOMContentLoaded",()=>mount(document,true))}else{mount(document,true)}}})(runtimeHost);const CanopyX=runtimeHost.CanopyX;const{protocol,createTreeGrid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,accordion,dialog,drawer,popover,tooltip,menu}=CanopyX;export{protocol,createTreeGrid,configure,unconfigure,mount,sources,badge,labels,registerExportFormat,use,registerPart,setNonce, mountUi,contextMenu,tabs,stepper,accordion,dialog,drawer,popover,tooltip,menu};export default CanopyX;
|