@omegagrid/bundle 0.6.102 → 0.6.104
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/omegagrid.js +17 -10
- package/package.json +18 -18
package/omegagrid.js
CHANGED
|
@@ -1847,7 +1847,7 @@
|
|
|
1847
1847
|
|
|
1848
1848
|
<div class="main"></div>
|
|
1849
1849
|
</div>
|
|
1850
|
-
`,this.components=new bg(this),this.sidebars=new yg(this),this.alerts=new mg(this),this.dialogs=new wg(this),this.options=vg(),this.logger.info("init"),this.addEventListener("state",(t=>{t.target!=this&&(t.stopPropagation(),this.dispatchStateEvent())}))}connectedCallback(){super.connectedCallback(),this.logger.info("connected"),window.addEventListener("beforeunload",this._onWindowBeforeUnload)}disconnectedCallback(){window.removeEventListener("beforeunload",this._onWindowBeforeUnload)}layout(){this.container?.layout(),this.top?.layout()}setSourceData(t){this.sourceData=t,t.options&&(this.options=vg(t.options,this.options))}async updated(){const t=this.compact?this.editorContainer:this.container;t.parentElement!=this.main&&(St(this.main),this.main.appendChild(t),t.requestUpdate());const e=(this.sourceData.sidemenu.items??[])[this.sourceData.sidemenu.activeIndex]?.id;e&&(this.sidebar1ComponentId=e),await(this.container?.updateComplete),this.layout()}async open(t){return this.compact&&this.hideSidebar(),xt(this.editorContainer),new Promise(((e,i)=>{this.components.enqueueComponentResolution(t.id,e,i),this.editorContainer.open(t),this.dispatchStateEvent()}))}async openDialog(t){return await this.dialogs.open(t)}async openMenu(t){let e;this.logger.info("open menu");const i=()=>{this.menu.removeEventListener("command.exec",o),this.menu.removeEventListener("command.close",i),e(new eg({id:null}))},o=t=>{this.menu.removeEventListener("command.exec",o),this.menu.removeEventListener("command.close",i),e(t.command)};return new Promise((n=>{e=n,this.menu.addEventListener("command.exec",o),this.menu.addEventListener("command.close",i),this.menu.text=t.text,this.menu.open(),this.menu.commands=t.content instanceof ig?t.content:new ig(gg[t.content])}))}openModalSidebar(t){return this.sidebars.openModalSidebar(t)}async toggleSidebar(t){t??(t=this.compact?this.sidebarHost.parentElement!=this.main:this.container.items[0].collapsed),t?this.showSidebar():this.hideSidebar()}async hideSidebar(){this.compact?this.sidebarHost.parentElement==this.main&&(St(this.main),this.main.appendChild(this.editorContainer)):await this.container.collapse(0,!0),this.layout()}async showSidebar(){this.compact?this.sidebarHost.parentElement!=this.main&&(St(this.main),this.main.appendChild(this.sidebarHost)):await this.container.collapse(0,!1),this.layout()}showAlert(t){return this.alerts.addAlert(t)}getState(){const t=this.container?.items[0];return{sidebar:{selectedItem:this.sidebar1ComponentId,width:t?.size,collapsed:!!t?.collapsed},layout:this.editorContainer?.model.getSourceData(),dialogs:[...Array.from(this.dialogs.items.entries()).map((([t,e])=>Object.assign({id:t},e.getOptions())))],components:[...this.components.items].reduce(((t,[e,i])=>{if(i.getState){const o=i.getState();o&&(t[e]=o)}return t}),{})}}async setState(t){this.state=t;const e=this.sourceData.sidemenu.items.findIndex((e=>e.id==t.sidebar.selectedItem));e>=0&&(this.sourceData.sidemenu.activeIndex=e,this.sidebar1ComponentId=t.sidebar.selectedItem),this.sourceData.editorLayout=t.layout,this._editorContainer=null,this.requestUpdate(),await this.updateComplete,this.sidemenu?.requestUpdate(),this.updateSidebarComponent(),this.updateMainComponent(),t.dialogs?.forEach((t=>this.openDialog(t)));for(const e in t.components)this.components.setState(e,t.components[e])}_onSidemenuSelect(t){const e=(this.sourceData.sidemenu.items??[])[t.index]?.id;e==this.sidebar1ComponentId?this.toggleSidebar():(this.toggleSidebar(!0),this.sidebar1ComponentId=e,this.updateSidebarComponent()),this.dispatchStateEvent()}updateSidebarComponent(){this.sidebarHost.componentId=this.sidebar1ComponentId}updateMainComponent(){this.container?.updateComponent(1)}};_g.styles=[pg],_g.uniqueId=0,_g.getUniqueId=()=>++xg.uniqueId,kg([fs("og-overlay")],_g.prototype,"overlay",void 0),kg([fs("og-commands")],_g.prototype,"menu",void 0),kg([fs("og-bucket-top")],_g.prototype,"top",void 0),kg([fs("og-bucket-sidemenu")],_g.prototype,"sidemenu",void 0),kg([fs(".body")],_g.prototype,"body",void 0),kg([fs(".main")],_g.prototype,"main",void 0),kg([ps({type:Object})],_g.prototype,"createComponent",void 0),kg([ps({type:Object})],_g.prototype,"sourceData",void 0),kg([ps({type:Object})],_g.prototype,"options",void 0),kg([ps({type:Object})],_g.prototype,"logger",void 0),kg([ps({type:Boolean})],_g.prototype,"compact",void 0),_g=xg=kg([hs("og-bucket")],_g);var Sg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Eg={info:[Js.Accent,"circle-info"],danger:[Js.Red,"circle-exclamation"],warning:[Js.Yellow,"circle-exclamation"],success:[Js.Green,"circle-check"]};class zg extends Event{constructor(t){super(`alert.${t}`,{bubbles:!0,composed:!0})}}let Rg=class extends ls{constructor(){super(...arguments),this.render=()=>Br`
|
|
1850
|
+
`,this.components=new bg(this),this.sidebars=new yg(this),this.alerts=new mg(this),this.dialogs=new wg(this),this.options=vg(),this.logger.info("init"),this.addEventListener("state",(t=>{t.target!=this&&(t.stopPropagation(),this.dispatchStateEvent())}))}connectedCallback(){super.connectedCallback(),this.logger.info("connected"),window.addEventListener("beforeunload",this._onWindowBeforeUnload)}disconnectedCallback(){window.removeEventListener("beforeunload",this._onWindowBeforeUnload)}layout(){this.container?.layout(),this.top?.layout()}setSourceData(t){this.sourceData=t,t.options&&(this.options=vg(t.options,this.options))}async updated(){const t=this.compact?this.editorContainer:this.container;t.parentElement!=this.main&&(St(this.main),this.main.appendChild(t),t.requestUpdate());const e=(this.sourceData.sidemenu.items??[])[this.sourceData.sidemenu.activeIndex]?.id;e&&(this.sidebar1ComponentId=e),await(this.container?.updateComplete),this.layout()}async open(t){return this.compact&&this.hideSidebar(),xt(this.editorContainer),new Promise(((e,i)=>{this.components.enqueueComponentResolution(t.id,e,i),this.editorContainer.open(t),this.dispatchStateEvent()}))}async openDialog(t){return await this.dialogs.open(t)}async openMenu(t){let e;this.logger.info("open menu");const i=()=>{this.menu.removeEventListener("command.exec",o),this.menu.removeEventListener("command.close",i),e(new eg({id:null}))},o=t=>{this.menu.removeEventListener("command.exec",o),this.menu.removeEventListener("command.close",i),e(t.command)};return new Promise((n=>{e=n,this.menu.addEventListener("command.exec",o),this.menu.addEventListener("command.close",i),this.menu.text=t.text,this.menu.open(),this.menu.commands=t.content instanceof ig?t.content:new ig(gg[t.content])}))}openModalSidebar(t){return this.sidebars.openModalSidebar(t)}async toggleSidebar(t){t??(t=this.compact?this.sidebarHost.parentElement!=this.main:this.container.items[0].collapsed),t?this.showSidebar():this.hideSidebar()}async hideSidebar(){this.compact?this.sidebarHost.parentElement==this.main&&(St(this.main),this.main.appendChild(this.editorContainer)):await this.container.collapse(0,!0),this.layout()}async showSidebar(){this.compact?this.sidebarHost.parentElement!=this.main&&(St(this.main),this.main.appendChild(this.sidebarHost)):await this.container.collapse(0,!1),this.layout()}showAlert(t){return this.alerts.addAlert(t)}getState(){const t=this.container?.items[0];return{sidebar:{selectedItem:this.sidebar1ComponentId,width:t?.size,collapsed:!!t?.collapsed},layout:this.editorContainer?.model.getSourceData(),dialogs:[...Array.from(this.dialogs.items.entries()).map((([t,e])=>Object.assign({id:t},e.getOptions())))],components:[...this.components.items].reduce(((t,[e,i])=>{if(i.getState){const o=i.getState();o&&(t[e]=o)}return t}),{})}}async setState(t){this.state=t;const e=this.sourceData.sidemenu.items.findIndex((e=>e.id==t.sidebar.selectedItem));e>=0&&(this.sourceData.sidemenu.activeIndex=e,this.sidebar1ComponentId=t.sidebar.selectedItem),this.sourceData.editorLayout=t.layout,this._editorContainer=null,this.requestUpdate(),await this.updateComplete,this.sidemenu?.requestUpdate(),this.updateSidebarComponent(),this.updateMainComponent(),t.dialogs?.forEach((t=>this.openDialog(t)));for(const e in t.components)this.components.setState(e,t.components[e])}_onSidemenuSelect(t){const e=(this.sourceData.sidemenu.items??[])[t.index]?.id;e==this.sidebar1ComponentId?this.toggleSidebar():(this.toggleSidebar(!0),this.sidebar1ComponentId=e,this.updateSidebarComponent()),this.dispatchStateEvent()}updateSidebarComponent(){this.sidebarHost.componentId=this.sidebar1ComponentId}updateMainComponent(){this.container?.updateComponent(1)}async openSidebarComponent(t){this.sidebar1ComponentId=t.toString(),this.showSidebar(),this.updateSidebarComponent(),this.sidemenu.selectItem(t.toString()),await this.sidebarHost.updateComplete}};_g.styles=[pg],_g.uniqueId=0,_g.getUniqueId=()=>++xg.uniqueId,kg([fs("og-overlay")],_g.prototype,"overlay",void 0),kg([fs("og-commands")],_g.prototype,"menu",void 0),kg([fs("og-bucket-top")],_g.prototype,"top",void 0),kg([fs("og-bucket-sidemenu")],_g.prototype,"sidemenu",void 0),kg([fs(".body")],_g.prototype,"body",void 0),kg([fs(".main")],_g.prototype,"main",void 0),kg([ps({type:Object})],_g.prototype,"createComponent",void 0),kg([ps({type:Object})],_g.prototype,"sourceData",void 0),kg([ps({type:Object})],_g.prototype,"options",void 0),kg([ps({type:Object})],_g.prototype,"logger",void 0),kg([ps({type:Boolean})],_g.prototype,"compact",void 0),_g=xg=kg([hs("og-bucket")],_g);var Sg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Eg={info:[Js.Accent,"circle-info"],danger:[Js.Red,"circle-exclamation"],warning:[Js.Yellow,"circle-exclamation"],success:[Js.Green,"circle-check"]};class zg extends Event{constructor(t){super(`alert.${t}`,{bubbles:!0,composed:!0})}}let Rg=class extends ls{constructor(){super(...arguments),this.render=()=>Br`
|
|
1851
1851
|
<div class="header">
|
|
1852
1852
|
<div class="icon">
|
|
1853
1853
|
<og-icon .icon="${this.iconSpec}"></og-icon>
|
|
@@ -1933,15 +1933,16 @@
|
|
|
1933
1933
|
.item.selected og-bucket-button, .item:hover og-bucket-button {
|
|
1934
1934
|
color: var(--og-text-color-3);
|
|
1935
1935
|
}
|
|
1936
|
-
`;let Ag=class extends ls{get tooltip(){return this.tooltipRef?.value}get count(){return this.settings?.items?.length??0}constructor(){super(),this.tooltipRef=Zh(),this.items=new pd((t=>{const e=this.settings?.items[t];return yt("og-bucket-button",{active:this.settings?.activeIndex===t,text:e.text,icon:e.icon,statusIcon:["fas",e.statusIcon]})})),this._onMouseMove=(t,e)=>{const i=this.settings.items[e.index].tooltip;i?(this.tooltip.querySelector('[slot="body"]').innerText=i,this.tooltip.attachTo(e,"right")):this.tooltip.deatach()},this._itemRenderer=async(t,e)=>{const i=await this.items.get(e);St(t),t.appendChild(i)},this.render=()=>Br`
|
|
1936
|
+
`;let Ag=class extends ls{get tooltip(){return this.tooltipRef?.value}get count(){return this.settings?.items?.length??0}selectItem(t){const e=this.settings?.items.findIndex((e=>e.id===t));e>=0&&(this.list.select(e),this.updateActiveIndex())}constructor(){super(),this.tooltipRef=Zh(),this.items=new pd((t=>{const e=this.settings?.items[t];return yt("og-bucket-button",{active:this.settings?.activeIndex===t,text:e.text,icon:e.icon,statusIcon:["fas",e.statusIcon]})})),this._onMouseMove=(t,e)=>{const i=this.settings.items[e.index].tooltip;i?(this.tooltip.querySelector('[slot="body"]').innerText=i,this.tooltip.attachTo(e,"right")):this.tooltip.deatach()},this._itemRenderer=async(t,e)=>{const i=await this.items.get(e);St(t),t.appendChild(i)},this.render=()=>Br`
|
|
1937
1937
|
<og-list
|
|
1938
|
-
size="${this.count}"
|
|
1938
|
+
.size="${this.count}"
|
|
1939
1939
|
?nativeHeight="${!0}"
|
|
1940
1940
|
.customStyle="${Tg}"
|
|
1941
1941
|
itemHeight="${ug.SIDEMENU_WIDTH}"
|
|
1942
1942
|
.itemRenderer="${this._itemRenderer}"
|
|
1943
1943
|
@select="${()=>this.updateActiveIndex()}">
|
|
1944
1944
|
</og-list>
|
|
1945
|
+
|
|
1945
1946
|
<og-tooltip ${Kh(this.tooltipRef)} style="max-width: 300px; display: none">
|
|
1946
1947
|
<div style="padding: 5px" slot="body"></div>
|
|
1947
1948
|
</og-tooltip>
|
|
@@ -2185,7 +2186,7 @@
|
|
|
2185
2186
|
height: 100%;
|
|
2186
2187
|
border: none;
|
|
2187
2188
|
}
|
|
2188
|
-
`,Mm([ps({type:Object,noAccessor:!0})],Em.prototype,"options",null),Mm([ps({type:String,noAccessor:!0})],Em.prototype,"modifiedContent",null),Mm([ps({type:String,noAccessor:!0})],Em.prototype,"originalContent",null),Mm([ps({type:String,noAccessor:!0})],Em.prototype,"language",null),Em=Cm=Mm([hs("og-code-diff")],Em);class zm extends(vn()){get type(){return this._type}set type(t){this._type=t}get checkbox(){return this._checkbox}set checkbox(t){this._checkbox=t}get key(){return this._key}set key(t){this._key=t}get value(){return this._value}set value(t){this._value=t}get htmlValue(){return this._htmlValue}set htmlValue(t){this._htmlValue=t}get icon(){return this._icon}set icon(t){this._icon=t}get folder(){return this._folder}set folder(t){this._folder=t}get renderer(){return this._renderer||this.model.options.nodeRenderer}set renderer(t){this._renderer=t}get properties(){return this._properties}set properties(t){this._properties=t}constructor(t,e){super(),this.model=t,this.subLevels=null,this._checkbox=null,this.populate(e)}populate(t){super.populate(t),this.key=t.hasOwnProperty("key")?t.key:t.k,this.value=((t.hasOwnProperty("value")?t.value:t.v)??"").toString(),this.type=t.t,this.icon=t.icon,this.folder=t.folder,this.checkbox=t.ch??null,this.renderer=t.renderer,this._properties=t.props}getSourceData(){const t=super.getSourceData();return this.key&&(t.k=this.key),this.value&&(t.v=this.value),this.type&&(t.t=this.type),this.icon&&(t.icon=this.icon),this.folder&&(t.folder=this.folder),null!=this.checkbox&&(t.ch=this.checkbox),this.properties&&(t.props=this.properties),t}}class Rm{get maxLevel(){return this._maxLevel}get root(){return this._root}get nodes(){return this._nodes}get visibleNodes(){return this._visibleNodes}getNodeByViewIndex(t){return this.visibleNodes[t]}constructor(t,e){this.options=e,this.nodeMap=new Map,this._maxLevel=-1,this.populate(t)}populate(t){this._root=new zm(this,{k:null,v:null,i:-1}),this._root.level=-1,this._nodes=t.map(((t,e)=>new zm(this,{...t,i:e}))),this._maxLevel=wn(this._nodes,this._root),this.indexNodes(!0),this.indexVisibleNodes()}insertNodes(t,e){const i=this.nodes[t].parent,o=isNaN(e)?e.length:e,n=isNaN(e)?e:new Array(o).fill(null).map((()=>new zm(this,{})));return this.nodes.splice(t,0,...n),this.maxLevel>0&&i.insertChildren(n,t-(i.index||-1)-1),this.indexNodes(),this.indexVisibleNodes(),n}deleteNodes(t,e){const i=this.nodes[t].parent,o=this.nodes.splice(t,e);return i?.deleteChildren(o),this.indexNodes(!0),this.indexVisibleNodes(),o}calculateNodeLevels(t){let e=t.parent;for(;e;)e.subLevels=Math.max(e.subLevels,t.level-e.level+(t.hasChildren?1:0)),e=e.parent}indexNodes(t=!1){this.nodeMap.clear(),this._nodes.forEach(((e,i)=>{e.index=i,this.nodeMap.set(e.key,e),t&&this.calculateNodeLevels(e)}))}indexNodesByTree(t=!1){this.nodeMap.clear(),this._nodes=[];let e=0;this.root.walk((i=>{i.index=e++,i.visibleIndex=null,this._nodes.push(i),this.nodeMap.set(i.key,i),t&&this.calculateNodeLevels(i)})),this.indexVisibleNodes()}indexVisibleNodes(){this._visibleNodes=[];const t=this.options?.pageSize;t>0?this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t),t.parent&&t.parent.lastChild===t&&t.parent.isPartialyLoaded&&this._visibleNodes.push({placeholder:!0,parent:t.parent})})):this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t)}))}getSourceData(){return this.nodes.map((t=>t.getSourceData()))}}var Lm,Im,Hm;function Tm(t){return t.map((t=>Array.isArray(t)?t:[t.toString(),0,1]))}!function(t){t.None="none",t.Single="single",t.Multiple="multiple",t.MultipleLevels="multipleLevels"}(Lm||(Lm={})),function(t){t.Numeric="n",t.Text="t",t.Date="d",t.Boolean="b"}(Im||(Im={})),function(t){t[t.None=0]="None",t[t.Checked=1]="Checked",t[t.CheckedByParent=2]="CheckedByParent",t[t.Unchecked=3]="Unchecked"}(Hm||(Hm={}));class Am{get count(){return this.items.size}constructor(t,e){this.options=t,this.items=new Map,e&&this.populate(e)}ensureItem(t,e){this.items.has(t)||this.items.set(t,{levels:new Map});const i=this.items.get(t);return null!=e&&(i.value=e),i}setItems(t){this.populate(t??[])}populate(t){const e=this.items;this.items=new Map,t.forEach((t=>{const i=t[3]?.v??t[3]?.value??e.get(t[0])?.value,o=this.ensureItem(t[0],i);o.levels.set(t[1]??0,1==(t[2]??1)),t[3]&&Object.assign(o,t[3])}))}getPropertySerializer(t){return(e,i)=>t.reduce(((t,o)=>(t[o]="v"==o||"value"==o?i.value??this.model?.nodeMap.get(e)?.value:this.model?.nodeMap.get(e)?.value,t)),{})}serialize(t){const e=[],i=t?.length?this.getPropertySerializer(t):null;return this.items.forEach(((t,o)=>{const n=i?i(o,t):null;t.levels.forEach(((t,i)=>e.push(n?[o,i,t?1:0,n]:[o,i,t?1:0])))})),e}clear(){this.items.clear()}validateChange(t,e,i){return this.options.selectMode!=Lm.Single||!1!==i||1!=this.items.size}toggle(t,e){let i=this.ensureItem(t.key,t.value);const o=i.levels.has(e)?i.levels.get(e):null;return this.validateChange(t,e,!i.levels.has(e)||!i.levels.get(e))?(o?i.levels.delete(e):this.options.selectMode==Lm.MultipleLevels?0==e&&this.isSelectedByParent(t)?!1===o?i.levels.delete(0):i.levels.set(0,!1):i.levels.set(e,!0):(this.options.selectMode==Lm.Single&&(this.clear(),i=this.ensureItem(t.key,t.value)),0==e?i.levels.set(0,!0):this.toggleChildNodes(t,e)),0==i.levels.size&&this.clearItemSelection(t),this):this}select(t,e,i=!0){const o=this.ensureItem(t.key,t.value);return this.validateChange(t,e,null===i?!!o.levels.has(e)&&o.levels.get(e):i)?(!0===i?o.levels.set(e,!0):!1===i&&this.options.selectMode==Lm.MultipleLevels?o.levels.set(e,!1):o.levels.delete(e),0==o.levels.size&&this.clearItemSelection(t),this):this}deselect(t,e){return this.validateChange(t,e,!1)?(this.items.has(t.key)&&(this.items.get(t.key).levels.delete(e),0==this.items.get(t.key).levels.size&&this.clearItemSelection(t)),this):this}clearItemSelection(t){this.items.delete(t.key)}getLevelSelection(t){return this.items.has(t.key)?this.items.get(t.key).levels:new Map}getValue(t,e,i=null){return this.items.has(t.key)?((t,e,i=null)=>t.has(e)?t.get(e):i)(this.items.get(t.key).levels,e,i):i}isSelectedByParent(t){let e=t.parent,i=0;for(;e;){if(this.getValue(e,++i,!1))return!0;e=e.parent}return!1}getSelectionStatus(t){const e=this.getValue(t,0,null);return!0===e?Hm.Checked:!1===e?Hm.Unchecked:this.options.selectMode==Lm.MultipleLevels&&this.isSelectedByParent(t)?Hm.CheckedByParent:Hm.None}toggleChildNodes(t,e){const i=t.level;let o=null;t.walk((t=>{if(t.level-i==e)return null===o&&(o=this.getSelectionStatus(t)!=Hm.Checked),this.select(t,0,!!o||null),!1}))}}const Om={DEFAULT_NODE_HEIGHT:20,DEFAULT_MAX_NODES:10,RENDERING_NODE_TRESHOLD:20,TREE_COLUMN_WIDTH:16,MAX_HIGHLIGHT_ITEM_OFFSET:2,SEARCH_DEBOUNCE_DELAY:300,...G},$m={nodeHeight:Om.DEFAULT_NODE_HEIGHT,renderingNodeTreshold:Om.RENDERING_NODE_TRESHOLD,selectMode:Lm.MultipleLevels,levelIndent:10,maxLevel:null,globalLevels:!0,levelsAlwaysVisible:!0,allowEmpty:!0,itemProperties:[],itemTypeOptions:{},expanders:!0,search:!1,checkboxes:!0,autoClose:!1,folderOptions:null,alwaysRefresh:!1};function Dm(t,e=null){return{...Fn(t,e),...$m,...e,...t}}const Nm=or`
|
|
2189
|
+
`,Mm([ps({type:Object,noAccessor:!0})],Em.prototype,"options",null),Mm([ps({type:String,noAccessor:!0})],Em.prototype,"modifiedContent",null),Mm([ps({type:String,noAccessor:!0})],Em.prototype,"originalContent",null),Mm([ps({type:String,noAccessor:!0})],Em.prototype,"language",null),Em=Cm=Mm([hs("og-code-diff")],Em);class zm extends(vn()){get type(){return this._type}set type(t){this._type=t}get checkbox(){return this._checkbox}set checkbox(t){this._checkbox=t}get key(){return this._key}set key(t){this._key=t}get value(){return this._value}set value(t){this._value=t}get htmlValue(){return this._htmlValue}set htmlValue(t){this._htmlValue=t}get icon(){return this._icon}set icon(t){this._icon=t}get folder(){return this._folder}set folder(t){this._folder=t}get renderer(){return this._renderer||this.model.options.nodeRenderer}set renderer(t){this._renderer=t}get properties(){return this._properties}set properties(t){this._properties=t}constructor(t,e){super(),this.model=t,this.subLevels=null,this._checkbox=null,this.populate(e)}populate(t){super.populate(t),this.key=t.hasOwnProperty("key")?t.key:t.k,this.value=((t.hasOwnProperty("value")?t.value:t.v)??"").toString(),this.type=t.t,this.icon=t.icon,this.folder=t.folder,this.checkbox=t.ch??null,this.renderer=t.renderer,this._properties=t.props}getSourceData(){const t=super.getSourceData();return this.key&&(t.k=this.key),this.value&&(t.v=this.value),this.type&&(t.t=this.type),this.icon&&(t.icon=this.icon),this.folder&&(t.folder=this.folder),null!=this.checkbox&&(t.ch=this.checkbox),this.properties&&(t.props=this.properties),t}}class Rm{get maxLevel(){return this._maxLevel}get root(){return this._root}get nodes(){return this._nodes}get visibleNodes(){return this._visibleNodes}getNodeByViewIndex(t){return this.visibleNodes[t]}constructor(t,e){this.options=e,this.nodeMap=new Map,this._maxLevel=-1,this.populate(t)}populate(t){this._root=new zm(this,{k:null,v:null,i:-1}),this._root.level=-1,this._nodes=t.map(((t,e)=>new zm(this,{...t,i:e}))),this._maxLevel=wn(this._nodes,this._root),this.indexNodes(!0),this.indexVisibleNodes()}insertNodes(t,e){const i=this.nodes[t].parent,o=isNaN(e)?e.length:e,n=isNaN(e)?e:new Array(o).fill(null).map((()=>new zm(this,{})));return this.nodes.splice(t,0,...n),this.maxLevel>0&&i.insertChildren(n,t-(i.index||-1)-1),this.indexNodes(),this.indexVisibleNodes(),n}deleteNodes(t,e){const i=this.nodes[t].parent,o=this.nodes.splice(t,e);return i?.deleteChildren(o),this.indexNodes(!0),this.indexVisibleNodes(),o}calculateNodeLevels(t){let e=t.parent;for(;e;)e.subLevels=Math.max(e.subLevels,t.level-e.level+(t.hasChildren?1:0)),e=e.parent}indexNodes(t=!1){this.nodeMap.clear(),this._nodes.forEach(((e,i)=>{e.index=i,this.nodeMap.set(e.key,e),t&&this.calculateNodeLevels(e)}))}indexNodesByTree(t=!1){this.nodeMap.clear(),this._nodes=[];let e=0;this.root.walk((i=>{i.index=e++,i.visibleIndex=null,this._nodes.push(i),this.nodeMap.set(i.key,i),t&&this.calculateNodeLevels(i)})),this._maxLevel=this.root.subLevels-1,this.indexVisibleNodes()}indexVisibleNodes(){this._visibleNodes=[];const t=this.options?.pageSize;t>0?this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t),t.parent&&t.parent.lastChild===t&&t.parent.isPartialyLoaded&&this._visibleNodes.push({placeholder:!0,parent:t.parent})})):this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t)}))}getSourceData(){return this.nodes.map((t=>t.getSourceData()))}}var Lm,Im,Hm;function Tm(t){return t.map((t=>Array.isArray(t)?t:[t.toString(),0,1]))}!function(t){t.None="none",t.Single="single",t.Multiple="multiple",t.MultipleLevels="multipleLevels"}(Lm||(Lm={})),function(t){t.Numeric="n",t.Text="t",t.Date="d",t.Boolean="b"}(Im||(Im={})),function(t){t[t.None=0]="None",t[t.Checked=1]="Checked",t[t.CheckedByParent=2]="CheckedByParent",t[t.Unchecked=3]="Unchecked"}(Hm||(Hm={}));class Am{get count(){return this.items.size}constructor(t,e){this.options=t,this.items=new Map,e&&this.populate(e)}ensureItem(t,e){this.items.has(t)||this.items.set(t,{levels:new Map});const i=this.items.get(t);return null!=e&&(i.value=e),i}setItems(t){this.populate(t??[])}populate(t){const e=this.items;this.items=new Map,t.forEach((t=>{const i=t[3]?.v??t[3]?.value??e.get(t[0])?.value,o=this.ensureItem(t[0],i);o.levels.set(t[1]??0,1==(t[2]??1)),t[3]&&Object.assign(o,t[3])}))}getPropertySerializer(t){return(e,i)=>t.reduce(((t,o)=>(t[o]="v"==o||"value"==o?i.value??this.model?.nodeMap.get(e)?.value:this.model?.nodeMap.get(e)?.value,t)),{})}serialize(t){const e=[],i=t?.length?this.getPropertySerializer(t):null;return this.items.forEach(((t,o)=>{const n=i?i(o,t):null;t.levels.forEach(((t,i)=>e.push(n?[o,i,t?1:0,n]:[o,i,t?1:0])))})),e}clear(){this.items.clear()}validateChange(t,e,i){return this.options.selectMode!=Lm.Single||!1!==i||1!=this.items.size}toggle(t,e){let i=this.ensureItem(t.key,t.value);const o=i.levels.has(e)?i.levels.get(e):null;return this.validateChange(t,e,!i.levels.has(e)||!i.levels.get(e))?(o?i.levels.delete(e):this.options.selectMode==Lm.MultipleLevels?0==e&&this.isSelectedByParent(t)?!1===o?i.levels.delete(0):i.levels.set(0,!1):i.levels.set(e,!0):(this.options.selectMode==Lm.Single&&(this.clear(),i=this.ensureItem(t.key,t.value)),0==e?i.levels.set(0,!0):this.toggleChildNodes(t,e)),0==i.levels.size&&this.clearItemSelection(t),this):this}select(t,e,i=!0){const o=this.ensureItem(t.key,t.value);return this.validateChange(t,e,null===i?!!o.levels.has(e)&&o.levels.get(e):i)?(!0===i?o.levels.set(e,!0):!1===i&&this.options.selectMode==Lm.MultipleLevels?o.levels.set(e,!1):o.levels.delete(e),0==o.levels.size&&this.clearItemSelection(t),this):this}deselect(t,e){return this.validateChange(t,e,!1)?(this.items.has(t.key)&&(this.items.get(t.key).levels.delete(e),0==this.items.get(t.key).levels.size&&this.clearItemSelection(t)),this):this}clearItemSelection(t){this.items.delete(t.key)}getLevelSelection(t){return this.items.has(t.key)?this.items.get(t.key).levels:new Map}getValue(t,e,i=null){return this.items.has(t.key)?((t,e,i=null)=>t.has(e)?t.get(e):i)(this.items.get(t.key).levels,e,i):i}isSelectedByParent(t){let e=t.parent,i=0;for(;e;){if(this.getValue(e,++i,!1))return!0;e=e.parent}return!1}getSelectionStatus(t){const e=this.getValue(t,0,null);return!0===e?Hm.Checked:!1===e?Hm.Unchecked:this.options.selectMode==Lm.MultipleLevels&&this.isSelectedByParent(t)?Hm.CheckedByParent:Hm.None}toggleChildNodes(t,e){const i=t.level;let o=null;t.walk((t=>{if(t.level-i==e)return null===o&&(o=this.getSelectionStatus(t)!=Hm.Checked),this.select(t,0,!!o||null),!1}))}}const Om={DEFAULT_NODE_HEIGHT:20,DEFAULT_MAX_NODES:10,RENDERING_NODE_TRESHOLD:20,TREE_COLUMN_WIDTH:16,MAX_HIGHLIGHT_ITEM_OFFSET:2,SEARCH_DEBOUNCE_DELAY:300,...G},$m={nodeHeight:Om.DEFAULT_NODE_HEIGHT,renderingNodeTreshold:Om.RENDERING_NODE_TRESHOLD,selectMode:Lm.MultipleLevels,levelIndent:10,maxLevel:null,globalLevels:!0,levelsAlwaysVisible:!0,allowEmpty:!0,itemProperties:[],itemTypeOptions:{},expanders:!0,search:!1,checkboxes:!0,autoClose:!1,folderOptions:null,alwaysRefresh:!1};function Dm(t,e=null){return{...Fn(t,e),...$m,...e,...t}}const Nm=or`
|
|
2189
2190
|
:host {
|
|
2190
2191
|
font-size: var(--og-font-size);
|
|
2191
2192
|
font-family: var(--og-font-family);
|
|
@@ -2206,7 +2207,12 @@
|
|
|
2206
2207
|
.toolbar {
|
|
2207
2208
|
flex: 0;
|
|
2208
2209
|
min-height: 18px;
|
|
2209
|
-
|
|
2210
|
+
margin: 2px 2px 0 2px;
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
.toolbar > * {
|
|
2214
|
+
height: 18px;
|
|
2215
|
+
line-height: 18px;
|
|
2210
2216
|
}
|
|
2211
2217
|
|
|
2212
2218
|
.main {
|
|
@@ -2287,7 +2293,7 @@
|
|
|
2287
2293
|
.item:hover div.lvl {
|
|
2288
2294
|
display: flex;
|
|
2289
2295
|
}
|
|
2290
|
-
`,jm=Ea({display:"block",position:"relative",top:"5px",left:"4px"}),Vm={[Hm.Checked]:{value:"checked",color:null},[Hm.CheckedByParent]:{value:"checked",color:"#555555"},[Hm.None]:{value:"none",color:null},[Hm.Unchecked]:{value:"unchecked",color:"#ff0000"}};class Bm{get term(){return this._term}get hasFilter(){return""==this._term||null==this._term}constructor(t){this.model=t,this._term=null,this._property="value"}filter(t){this._term=t;const e=((t,e)=>{const i=new RegExp(`${ut(ct(t))}`,"ig");let o;return t=>{const n=[];for(;o=i.exec(ct((t[e]??"").toString()));)n.push([o.index,i.lastIndex]);return n}})(this._term,this._property);let i;this.model.nodes.forEach((o=>{o.collapsed=!1,o.htmlValue=null,t?(i=e(o),o.filterState=i.length>0?mn.Matched:mn.Filtered):(o.filterState=mn.Matched,o.collapse()),o.filterState==mn.Matched&&(o.walkUp((t=>{t.filterState==mn.Filtered&&(t.filterState=mn.ChildMatched)})),t&&(o.htmlValue=ne(o.value,i)))})),this.model.indexVisibleNodes()}clear(){this._term=null,this.model.nodes.forEach((t=>{t.filterState=mn.Matched,t.collapsed=!1,t.htmlValue=null})),this.model.indexVisibleNodes()}}var Fm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Wm extends Event{constructor(t,e){super(t,{bubbles:!1,cancelable:!0,composed:!1}),Object.assign(this,e)}}class Um extends PointerEvent{constructor(t,e,i){super(`tree.${t}`,e),Object.assign(this,i)}}class Gm extends DragEvent{constructor(t,e,i){super(`tree.${t}`,e),Object.assign(this,i)}}let Ym=class extends ls{get size(){return this.model?.visibleNodes.length??0}get hasGlobalLevels(){return(this.options.selectMode==Lm.Multiple||this.options.selectMode==Lm.MultipleLevels)&&this.options.globalLevels&&this.model.maxLevel>0}constructor(){super(),this.options=Dm(),this.selection=new Am(this.options),this.logger=new un("Ωtree"),this.maxHeight=null,this.itemHeight=Om.LIST_ITEM_HEIGHT,this.disableAutoload=!1,this.loading=!1,this.noMatches=!1,this.awaitFilter=!1,this.currentFilter="",this.loadingNodes=new Set,this._onDragover=t=>{if(this.options.fileDrop&&(t.preventDefault(),t.stopPropagation(),"Files"==t.dataTransfer.types[0])){t.dataTransfer.dropEffect="move";const e=t.composedPath().find((t=>t.classList&&t.classList.contains("item")));this._onDragLeave(),e&&e.classList.add("drag"),this._lastDragItem=e}},this._onDrop=t=>{t.preventDefault(),this._onDragLeave();const e=t.composedPath().find((t=>t.classList&&t.classList.contains("item"))),i=this.model.nodes[parseInt(e.dataset.node)];this.dispatchEvent(new Gm("drop",t,{tree:this,node:i}))},this._onDragLeave=()=>{this._lastDragItem&&this._lastDragItem.classList.remove("drag"),this._lastDragItem=null},this.keyActions={ArrowRight:()=>{const t=this.model.visibleNodes[this.list.selectedIndex];t.collapsed&&(this.toggleNodeCollapse(t),this.model.indexVisibleNodes(),this.list.size=this.size)},ArrowLeft:()=>{const t=this.model.visibleNodes[this.list.selectedIndex];t.collapsed||(this.toggleNodeCollapse(t),this.model.indexVisibleNodes(),this.list.size=this.size)}},this._onGlobalLevelSelect=async t=>{this.toggleNode(this.model.root,t.level,!0),this.globalTreeLevels.requestUpdate(),this.requestUpdate(),await this.list.updateComplete,this.list.renderItems(!0)},this._onSearch=()=>{this.list.size=this.size,this.list.select(0),this.renderItems(!0),this.noMatches=0==this.size},this._onListRender=()=>{this.awaitFilter&&(this.filter(this.currentFilter),this.awaitFilter=null)},this._onListMenu=t=>{this.dispatchEvent(new Um("menu",t,{tree:this,node:this.model.visibleNodes[t.index]}))},this.addEventListener("dragover",this._onDragover),this.addEventListener("dragleave",this._onDragLeave),this.addEventListener("drop",this._onDrop)}destroy(){this.logger.info("destroy")}connectedCallback(){super.connectedCallback(),this.logger.info("init"),this.tabIndex=0}setSourceData(t,e=null){Object.assign(this.options,e??{}),this.model=new Rm(t,this.options),t?.length>0&&void 0!==t[0].s&&this.selection.setItems(t.filter((t=>t.s)).map((t=>[t.k,0,1]))),this.dispatchEvent(new Wm("load",{component:this}))}setValue(t){this.selection.populate(t)}async loadData(t){this.loading=!0,this.list&&(this.list.size=0),this.model=null,t=t??{};const[e,i]=await Promise.all([this.adapter.getTree(t),this.adapter.getOptions()]);this.setSourceData(e,i),i?.pageSize>0&&(this.updateNodeLoadState(this.model.root,this.model.root.children.length),this.model.indexVisibleNodes()),this.loading=!1}async loadMore(t){const e=t.children.length,i=await this.adapter.getTree({parent:t,parentKey:t.key,offset:e}),o=new Rm(i,this.options);t.insertChildren(o.root.children,e),this.updateNodeLoadState(t,o.root.children.length),this.model.indexNodesByTree(!0),this.list.size=this.size,this.list.requestUpdate()}willUpdate(t){t.has("adapter")&&this.adapter&&(this.model=null,this.adapter.attach(this),this.disableAutoload||this.loadData()),this.model=this.model??new Rm([],null),this.filtering=new Bm(this.model),this.selection.model=this.model,t.has("options")&&(this.options=Dm(this.options),this.model.options=this.options,this.selection.options=this.options)}updated(t){t.has("model")&&this.list&&(this.list.size=this.size,this.noMatches=this.noMatches&&0==this.size,this.list.requestUpdate())}async firstUpdated(){var t;this.value&&this.selection.setItems(this.value??[]),this.list.itemRenderer=(t=this,(e,i,o)=>{const n=t.model.visibleNodes[i];if(n.placeholder)return((t,e)=>{const i=e.parent,o=i.model.options;return e.element=t,Br`
|
|
2296
|
+
`,jm=Ea({display:"block",position:"relative",top:"5px",left:"4px"}),Vm={[Hm.Checked]:{value:"checked",color:null},[Hm.CheckedByParent]:{value:"checked",color:"#555555"},[Hm.None]:{value:"none",color:null},[Hm.Unchecked]:{value:"unchecked",color:"#ff0000"}};class Bm{get term(){return this._term}get hasFilter(){return""==this._term||null==this._term}constructor(t){this.model=t,this._term=null,this._property="value"}filter(t){this._term=t;const e=((t,e)=>{const i=new RegExp(`${ut(ct(t))}`,"ig");let o;return t=>{const n=[];for(;o=i.exec(ct((t[e]??"").toString()));)n.push([o.index,i.lastIndex]);return n}})(this._term,this._property);let i;this.model.nodes.forEach((o=>{o.collapsed=!1,o.htmlValue=null,t?(i=e(o),o.filterState=i.length>0?mn.Matched:mn.Filtered):(o.filterState=mn.Matched,o.collapse()),o.filterState==mn.Matched&&(o.walkUp((t=>{t.filterState==mn.Filtered&&(t.filterState=mn.ChildMatched)})),t&&(o.htmlValue=ne(o.value,i)))})),this.model.indexVisibleNodes()}clear(){this._term=null,this.model.nodes.forEach((t=>{t.filterState=mn.Matched,t.collapsed=!1,t.htmlValue=null})),this.model.indexVisibleNodes()}}var Fm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Wm extends Event{constructor(t,e){super(t,{bubbles:!1,cancelable:!0,composed:!1}),Object.assign(this,e)}}class Um extends PointerEvent{constructor(t,e,i){super(`tree.${t}`,e),Object.assign(this,i)}}class Gm extends DragEvent{constructor(t,e,i){super(`tree.${t}`,e),Object.assign(this,i)}}let Ym=class extends ls{get size(){return this.model?.visibleNodes.length??0}get hasGlobalLevels(){return(this.options.selectMode==Lm.Multiple||this.options.selectMode==Lm.MultipleLevels)&&this.options.globalLevels&&this.model.maxLevel>0}constructor(){super(),this.options=Dm(),this.selection=new Am(this.options),this.logger=new un("Ωtree"),this.maxHeight=null,this.itemHeight=Om.LIST_ITEM_HEIGHT,this.disableAutoload=!1,this.loading=!1,this.noMatches=!1,this.awaitFilter=!1,this.currentFilter="",this.loadingNodes=new Set,this._onDragover=t=>{if(this.options.fileDrop&&(t.preventDefault(),t.stopPropagation(),"Files"==t.dataTransfer.types[0])){t.dataTransfer.dropEffect="move";const e=t.composedPath().find((t=>t.classList&&t.classList.contains("item")));this._onDragLeave(),e&&e.classList.add("drag"),this._lastDragItem=e}},this._onDrop=t=>{t.preventDefault(),this._onDragLeave();const e=t.composedPath().find((t=>t.classList&&t.classList.contains("item"))),i=this.model.nodes[parseInt(e.dataset.node)];this.dispatchEvent(new Gm("drop",t,{tree:this,node:i}))},this._onDragLeave=()=>{this._lastDragItem&&this._lastDragItem.classList.remove("drag"),this._lastDragItem=null},this.keyActions={ArrowRight:()=>{const t=this.model.visibleNodes[this.list.selectedIndex];t.collapsed&&(this.toggleNodeCollapse(t),this.model.indexVisibleNodes(),this.list.size=this.size)},ArrowLeft:()=>{const t=this.model.visibleNodes[this.list.selectedIndex];t.collapsed||(this.toggleNodeCollapse(t),this.model.indexVisibleNodes(),this.list.size=this.size)}},this._onGlobalLevelSelect=async t=>{this.toggleNode(this.model.root,t.level,!0),this.globalTreeLevels.requestUpdate(),this.requestUpdate(),await this.list.updateComplete,this.list.renderItems(!0)},this._onSearch=()=>{this.list.size=this.size,this.list.select(0),this.renderItems(!0),this.noMatches=0==this.size},this._onListRender=()=>{this.awaitFilter&&(this.filter(this.currentFilter),this.awaitFilter=null)},this._onListMenu=t=>{this.dispatchEvent(new Um("menu",t,{tree:this,node:this.model.visibleNodes[t.index]}))},this.addEventListener("dragover",this._onDragover),this.addEventListener("dragleave",this._onDragLeave),this.addEventListener("drop",this._onDrop)}destroy(){this.logger.info("destroy")}connectedCallback(){super.connectedCallback(),this.logger.info("init"),this.tabIndex=0}setSourceData(t,e=null){Object.assign(this.options,e??{}),this.model=new Rm(t,this.options),t?.length>0&&void 0!==t[0].s&&this.selection.setItems(t.filter((t=>t.s)).map((t=>[t.k,0,1]))),this.dispatchEvent(new Wm("load",{component:this}))}setValue(t){this.selection.populate(t)}async loadData(t){this.loading=!0,this.list&&(this.list.size=0),this.model=null,t=t??{};const[e,i]=await Promise.all([this.adapter.getTree(t),this.adapter.getOptions()]);this.setSourceData(e,i),i?.pageSize>0&&(this.updateNodeLoadState(this.model.root,this.model.root.children.length),this.model.indexVisibleNodes()),this.loading=!1,this.pendingHighlight&&(await this.updateComplete,await this.highlightNode(this.pendingHighlight),this.pendingHighlight=null)}async loadMore(t){const e=t.children.length,i=await this.adapter.getTree({parent:t,parentKey:t.key,offset:e}),o=new Rm(i,this.options);t.insertChildren(o.root.children,e),this.updateNodeLoadState(t,o.root.children.length),this.model.indexNodesByTree(!0),this.list.size=this.size,this.list.requestUpdate()}willUpdate(t){t.has("adapter")&&this.adapter&&(this.model=null,this.adapter.attach(this),this.disableAutoload||this.loadData()),this.model=this.model??new Rm([],null),this.filtering=new Bm(this.model),this.selection.model=this.model,t.has("options")&&(this.options=Dm(this.options),this.model.options=this.options,this.selection.options=this.options)}updated(t){t.has("model")&&this.list&&(this.list.size=this.size,this.noMatches=this.noMatches&&0==this.size,this.list.requestUpdate())}async firstUpdated(){var t;this.value&&this.selection.setItems(this.value??[]),this.list.itemRenderer=(t=this,(e,i,o)=>{const n=t.model.visibleNodes[i];if(n.placeholder)return((t,e)=>{const i=e.parent,o=i.model.options;return e.element=t,Br`
|
|
2291
2297
|
<div
|
|
2292
2298
|
class="placeholder"
|
|
2293
2299
|
style="${Ea({paddingLeft:(i.level+1)*o.levelIndent+5+"px"})}">
|
|
@@ -2330,7 +2336,7 @@
|
|
|
2330
2336
|
</og-tree-levels>
|
|
2331
2337
|
</div>
|
|
2332
2338
|
`:""}
|
|
2333
|
-
`}),Rt(this.list,"toggle",".item",(async(t,e)=>{const i=this.model.nodes[parseInt(e.dataset.node)];this.toggleNodeCollapse(i),this.model.indexVisibleNodes(),this.list.size=this.size})),Rt(this.list,"levelselect",".item",((t,e)=>{this.toggleNode(this.model.nodes[parseInt(e.dataset.node)],t.level,!0)})),Rt(this.list,"contextmenu",".item",((t,e)=>{t.preventDefault();const i=this.model.nodes[parseInt(e.dataset.node)];this.selection.select(i,0,!1),this.list.renderItems(!0)})),this.list.addEventListener("select",(t=>{if(t.stopPropagation(),t.trigger!=uu.Arrow&&!(t.elm instanceof Qd)){const e=this.model.visibleNodes[t.index];if(e instanceof zm){const t=e;t.checkbox??this.options.selectMode!=Lm.None?this.toggleNode(t,0,!0):(this.toggleNodeCollapse(t),this.model.indexVisibleNodes(),this.list.size=this.size),this.dispatchEvent(new Wm("select",{component:this,node:t}))}else if(e){const t=e;if(t.loading)return;t.loading=!0,t.element.querySelector("og-icon").icon="hourglass-half",this.loadMore(t.parent)}}})),this.list.addEventListener("keydown",(t=>{const e=this.keyActions[t.key];if(e)e();else if(!isNaN(parseInt(t.key))){const e=parseInt(t.key),i=this.model.visibleNodes[this.list.selectedIndex];i.subLevels>=e&&this.toggleNode(i,e,!0)}}))}toggleNode(t,e,i=!1){this.selection.toggle(t,e),this.list.renderItems(!0),setTimeout((()=>this.list.focus())),i&&this.dispatchEvent(new Wm("change",{component:this,node:t}))}updateNodeLoadState(t,e){this.options.pageSize>0&&(e<this.options.pageSize?t.count=t.children.length:t.count=t.children.length+1)}async toggleNodeCollapse(t,e=!0){if(t.toggleCollapse(),!t.isLoaded&&!t.isPartialyLoaded&&this.adapter&&!this.loadingNodes.has(t.key)){this.loadingNodes.add(t.key),this.list.requestUpdate();const e=await this.adapter.getTree({parent:t,parentKey:t.key,offset:0}),i=new Rm(e,this.options);t.insertChildren(i.root.children,0),this.updateNodeLoadState(t,t.children.length),this.model.indexNodesByTree(!0),this.list.size=this.size,this.list.requestUpdate(),this.loadingNodes.delete(t.key)}e&&this.dispatchEvent(new Wm("tree.collapse",{component:this,node:t}))}toggleTreeCollapse(t,e=!0){0!=this.model.nodes.length&&(t||((t=this.model.root).collapsed=this.model.nodes[0].collapsed),t.toggleCollapse(!0),this.model.indexVisibleNodes(),this.list.size=this.size,e&&this.dispatchEvent(new Wm("tree.collapse",{component:this,node:t})))}get itemStyle(){const t=this.options?.customStyle;return[Pm,...t?Array.isArray(t)?t:[t]:[]]}render(){this.logger.info(`render ${this.model?.visibleNodes.length??0}`);const t=Br`
|
|
2339
|
+
`}),Rt(this.list,"toggle",".item",(async(t,e)=>{const i=this.model.nodes[parseInt(e.dataset.node)];this.toggleNodeCollapse(i),this.model.indexVisibleNodes(),this.list.size=this.size})),Rt(this.list,"levelselect",".item",((t,e)=>{this.toggleNode(this.model.nodes[parseInt(e.dataset.node)],t.level,!0)})),Rt(this.list,"contextmenu",".item",((t,e)=>{t.preventDefault();const i=this.model.nodes[parseInt(e.dataset.node)];this.selection.select(i,0,!1),this.list.renderItems(!0)})),this.list.addEventListener("select",(t=>{if(t.stopPropagation(),t.trigger!=uu.Arrow&&!(t.elm instanceof Qd)){const e=this.model.visibleNodes[t.index];if(e instanceof zm){const t=e;t.checkbox??this.options.selectMode!=Lm.None?this.toggleNode(t,0,!0):(this.toggleNodeCollapse(t),this.model.indexVisibleNodes(),this.list.size=this.size),this.dispatchEvent(new Wm("select",{component:this,node:t}))}else if(e){const t=e;if(t.loading)return;t.loading=!0,t.element.querySelector("og-icon").icon="hourglass-half",this.loadMore(t.parent)}}})),this.list.addEventListener("keydown",(t=>{const e=this.keyActions[t.key];if(e)e();else if(!isNaN(parseInt(t.key))){const e=parseInt(t.key),i=this.model.visibleNodes[this.list.selectedIndex];i.subLevels>=e&&this.toggleNode(i,e,!0)}}))}toggleNode(t,e,i=!1){this.selection.toggle(t,e),this.list.renderItems(!0),setTimeout((()=>this.list.focus())),i&&this.dispatchEvent(new Wm("change",{component:this,node:t}))}updateNodeLoadState(t,e){this.options.pageSize>0&&(e<this.options.pageSize?t.count=t.children.length:t.count=t.children.length+1)}async toggleNodeCollapse(t,e=!0){if(t.toggleCollapse(),!t.isLoaded&&!t.isPartialyLoaded&&this.adapter&&!this.loadingNodes.has(t.key)){this.loadingNodes.add(t.key),this.list.requestUpdate();const e=await this.adapter.getTree({parent:t,parentKey:t.key,offset:0}),i=new Rm(e,this.options);t.insertChildren(i.root.children,0),this.updateNodeLoadState(t,t.children.length),this.model.indexNodesByTree(!0),this.list.size=this.size,this.list.requestUpdate(),this.loadingNodes.delete(t.key),this.globalTreeLevels&&(this.globalTreeLevels.count=this.model.maxLevel+1)}e&&this.dispatchEvent(new Wm("tree.collapse",{component:this,node:t}))}toggleTreeCollapse(t,e=!0){0!=this.model.nodes.length&&(t||((t=this.model.root).collapsed=this.model.nodes[0].collapsed),t.toggleCollapse(!0),this.model.indexVisibleNodes(),this.list.size=this.size,e&&this.dispatchEvent(new Wm("tree.collapse",{component:this,node:t})))}get itemStyle(){const t=this.options?.customStyle;return[Pm,...t?Array.isArray(t)?t:[t]:[]]}render(){this.logger.info(`render ${this.model?.visibleNodes.length??0}`);const t=Br`
|
|
2334
2340
|
<div class="main" style="${Ea({overflow:"hidden",maxHeight:this.maxHeight?Ot(this.maxHeight):null})}">
|
|
2335
2341
|
<og-list
|
|
2336
2342
|
size="${this.size}"
|
|
@@ -2358,12 +2364,12 @@
|
|
|
2358
2364
|
<div class="toolbar">
|
|
2359
2365
|
<og-tree-levels
|
|
2360
2366
|
id="globalLevels"
|
|
2361
|
-
count="${(this.options.maxLevel??this.model.maxLevel)+1}"
|
|
2367
|
+
.count="${(this.options.maxLevel??this.model.maxLevel)+1}"
|
|
2362
2368
|
.selection="${this.selection.getLevelSelection(this.model.root)}"
|
|
2363
2369
|
@levelselect="${this._onGlobalLevelSelect}">
|
|
2364
2370
|
</og-tree-levels>
|
|
2365
2371
|
</div>
|
|
2366
|
-
`:null,e,t],(()=>" "))}async highlightNode(t){const e=this.model
|
|
2372
|
+
`:null,e,t],(()=>" "))}async highlightNode(t){const e=this.model?.nodeMap.get(t);if(!e)return void(this.pendingHighlight=t);e.walkUp((t=>t.expand(!0))),this.model.indexVisibleNodes(),this.list.selectedIndex=e.visibleIndex,this.list.requestUpdate(),await this.list.updateComplete;const i=Math.max(0,e.visibleIndex-Om.MAX_HIGHLIGHT_ITEM_OFFSET);this.list.scrollToIndex(i)}highlightFirstSelectedNode(){if(!this.list)return;if(!this.selection?.count)return;const t=this.selection.items.keys().next().value,e=this.model.nodeMap.get(t);e&&null!=e.visibleIndex?(this.list.selectedIndex=e.visibleIndex,this.list.scrollToIndex(e.index)):this.list.selectedIndex=-1}renderItems(t=!1){this.list&&(this.list.size=this.size,this.list.renderItems(t))}clearSelection(){this.selection.clear(),this.requestUpdate()}async filter(t){(t=(t??"").trim())!==this.currentFilter&&(this.currentFilter=t,this.loading?this.awaitFilter=!0:this.options.customSearch&&this.adapter?await this.loadData({filter:t}):(null==t?(this.filtering?.clear(),this.noMatches=!1):(this.filtering?.filter(t),this.noMatches=0==this.size),this.list.size=this.size,this.list.select(0),this.list.requestUpdate()))}async clearFilter(){this.searchBar?.searchInput&&(this.searchBar.searchInput.value=""),await this.filter()}};Ym.styles=[Nm],Fm([ps({type:Object})],Ym.prototype,"model",void 0),Fm([ps({type:Object})],Ym.prototype,"adapter",void 0),Fm([ps({type:Object})],Ym.prototype,"options",void 0),Fm([ps({type:Object})],Ym.prototype,"selection",void 0),Fm([ps({type:Object})],Ym.prototype,"logger",void 0),Fm([ps({type:Number})],Ym.prototype,"maxHeight",void 0),Fm([ps({type:Number})],Ym.prototype,"itemHeight",void 0),Fm([ps({type:Array})],Ym.prototype,"value",void 0),Fm([ps({type:Boolean})],Ym.prototype,"disableAutoload",void 0),Fm([fs("og-list")],Ym.prototype,"list",void 0),Fm([fs("og-tree-search")],Ym.prototype,"searchBar",void 0),Fm([fs("#globalLevels")],Ym.prototype,"globalTreeLevels",void 0),Fm([gs()],Ym.prototype,"loading",void 0),Fm([gs()],Ym.prototype,"noMatches",void 0),Ym=Fm([hs("og-tree")],Ym);class qm extends cd{getOptions(){return null}}const Zm=or`
|
|
2367
2373
|
og-input {
|
|
2368
2374
|
flex: 1;
|
|
2369
2375
|
border: 1px solid var(--og-accent-color);
|
|
@@ -2466,6 +2472,7 @@
|
|
|
2466
2472
|
|
|
2467
2473
|
div.selected {
|
|
2468
2474
|
background-color: var(--og-accent-color);
|
|
2475
|
+
color: #ffffff;
|
|
2469
2476
|
}
|
|
2470
2477
|
`],Km([ps({type:Number})],tf.prototype,"count",void 0),Km([ps({type:Object})],tf.prototype,"selection",void 0),tf=Km([hs("og-tree-levels")],tf);var ef=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class of extends Event{constructor(t,e){super(`${t}`,{bubbles:!1,cancelable:!0,composed:!1}),this.component=e}}let nf=class extends ls{constructor(){super(...arguments),this.debounceKeyUp=Y((async t=>{dt(t.key)||(await this.tree.filter(this.searchInput.value),this.dispatchEvent(new of("search",this)))}),Om.SEARCH_DEBOUNCE_DELAY,{isImmediate:!1}),this._onKeyDown=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.tree.list.moveDown();break;case"ArrowUp":t.preventDefault(),this.tree.list.moveUp();break;case"Enter":t.preventDefault(),this.tree.list.select(this.tree.list.selectedIndex,uu.Enter),setTimeout((()=>this.searchInput.focus()),100)}},this.render=()=>Br`
|
|
2471
2478
|
<input id="searchInput"
|
|
@@ -8441,4 +8448,4 @@ milkdown-block-handle {
|
|
|
8441
8448
|
`:null}
|
|
8442
8449
|
</div>
|
|
8443
8450
|
</og-panel>
|
|
8444
|
-
`:null,this.addEventListener("mousedown",(t=>t.stopPropagation()))}getTypeIndex(t){const e=this.types.findIndex((e=>e.type==t.type&&e.grouping==(t.grouping||"standard")));return e>-1?e:null}updateModel(){if(this.editTitle=!1,!this.model)return;this.titleInput&&(this.model.title=this.titleInput.value);const t=this.types[this.typeList.value];this.model.type=t.type,this.model.grouping=t.grouping,this.model.categoriesRange=this.categoryRangeInput?.value?fv.fromA1(this.categoryRangeInput.value):null,this.model.seriesRange=this.seriesRangeInput?.value?fv.fromA1(this.seriesRangeInput.value):null,this.model.dataRange=fv.fromA1(this.dataRangeInput.value),this.dispatchEvent(new On({value:this.model}))}async updated(){this.editTitle&&this.titleInput&&(await this.titleInput.updateComplete,this.titleInput.focus(),this.titleInput.selectAll())}};Uz.styles=[Fz],Wz([ps({type:Object})],Uz.prototype,"model",void 0),Wz([gs()],Uz.prototype,"editTitle",void 0),Wz([fs("#title")],Uz.prototype,"titleInput",void 0),Wz([fs("#type")],Uz.prototype,"typeList",void 0),Wz([fs("#dataRange")],Uz.prototype,"dataRangeInput",void 0),Wz([fs("#seriesRange")],Uz.prototype,"seriesRangeInput",void 0),Wz([fs("#categoryRange")],Uz.prototype,"categoryRangeInput",void 0),Uz=Wz([hs("og-plugin-chart-form")],Uz);const Gz=wa().themes.get("dark");Object.assign(Gz.definition,{"highcharts-title-font-size":"16px","highcharts-subtitle-font-size":"14px","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"rgb(48, 48, 48)","highcharts-neutral-color-100":"rgb(255, 255, 255)","highcharts-neutral-color-80":"rgb(214, 214, 214)","highcharts-neutral-color-60":"rgb(173, 173, 173)","highcharts-neutral-color-40":"rgb(133, 133, 133)","highcharts-neutral-color-20":"rgb(92, 92, 92)","highcharts-neutral-color-10":"rgb(71, 71, 71)","highcharts-neutral-color-5":"rgb(61, 61, 61)","highcharts-neutral-color-3":"rgb(57, 57, 57)","highcharts-highlight-color-100":"rgb(122, 167, 255)","highcharts-highlight-color-80":"rgb(108, 144, 214)","highcharts-highlight-color-60":"rgb(94, 121, 173)","highcharts-highlight-color-20":"rgb(65, 74, 92)","highcharts-highlight-color-10":"rgb(58, 63, 71)"});const Yz=wa().themes.get("light");Object.assign(Yz.definition,{"highcharts-title-font-size":"16px","chart-background-color":"#2a2a2b","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"#ffffff","highcharts-neutral-color-100":"#000000","highcharts-neutral-color-80":"#333333","highcharts-neutral-color-60":"#666666","highcharts-neutral-color-40":"#999999","highcharts-neutral-color-20":"#cccccc","highcharts-neutral-color-10":"#e6e6e6","highcharts-neutral-color-5":"#f2f2f2","highcharts-neutral-color-3":"#f7f7f7","highcharts-highlight-color-100":"#0022ff","highcharts-highlight-color-80":"#334eff","highcharts-highlight-color-60":"#667aff","highcharts-highlight-color-20":"#ccd3ff","highcharts-highlight-color-10":"#e6e9ff","highcharts-positive-color":"#06b535","highcharts-negative-color":"#f21313","highcharts-annotation-color-0":"rgba(130, 170, 255, 0.4)","highcharts-annotation-color-1":"rgba(139, 191, 216, 0.4)","highcharts-annotation-color-2":"rgba(150, 216, 192, 0.4)","highcharts-annotation-color-3":"rgba(156, 229, 161, 0.4)","highcharts-annotation-color-4":"rgba(162, 241, 130, 0.4)","highcharts-annotation-color-5":"rgba(169, 255, 101, 0.4)"});var qz=i(2439),Zz=i(8022),Xz=i(6158),Qz=i(127),Kz=i(4505),Jz=i(8659),tR=i(397),eR=i(930),iR=i(9723),oR=i(6343),nR=i(4582),rR=i(6127),sR=i(8238),aR=i(7362),lR=i(452),cR=i(5390),hR=i(3368),dR=i(6288),uR=i(7513),pR=i(1386),gR=i(5764),mR=i(1261),fR=i(3071),vR=i(3285),bR=i(2356),yR=i(6780),wR=i(8542),xR=i(8385),kR=i(1025),CR=i(2034),MR=i(8113),_R=i(1821),SR=i(7212),ER=i(2583),zR=i(5360),RR=i(2377),LR=i(2864),IR=i(7998),HR=i(4101),TR=i(7813),AR=i(5037),OR=i(7005),$R=i(9626),DR=i(9517),NR=i(1504),PR=i(3838),jR=i(4935),VR=i(7699),BR=i(3322),FR=i(5757),WR=i(536),UR=i(1673),GR=i(8736),YR=i(196),qR=i(5133),ZR=i(6092),XR=i(791),QR=i(5927),KR=i(1802),JR=i(9511),tL=i(6267),eL=i(1072),iL=i(4331),oL=i(8644),nL=i(2704),rL=i(2419),sL=i(6363),aL=i(5236),lL=i(3499),cL=i(3811),hL=i(1953),dL=i(4729),uL=i(8964),pL=i(8540),gL=i(8752),mL=i(8783),fL=i(8270),vL=i(7261),bL=i(9231),yL=i(4555),wL=i(5293),xL=i(6981),kL=i(5268),CL=i(2680),ML=i(789),_L=i(4373),SL=i(436),EL=i(8573),zL=i(1808),RL=i(3247),LL=i(5143),IL=i(2415),HL=i(2561),TL=i(5726),AL=i(7436),OL=i(4201),$L=i(8248),DL=i(6433),NL=i(2698),PL=i(979),jL=i(9358),VL=i(9176),BL=i(1239),FL=i(4218),WL=i(8377),UL=i(3740),GL=i(5379),YL=i(9974),qL=i(8955),ZL=i(3559),XL=i(809),QL=i(8014),KL=i(8265),JL=i(3300),tI=i(8724),eI=i(8033),iI=i(7700),oI=i(5741),nI=i(3478),rI=i(512),sI=i(499),aI=i(8680),lI=i(9646),cI=i(9432),hI=i(2841),dI=i(75),uI=i(9256),pI=i(444),gI=i(5633),mI=i(3788),fI=i(3573),vI=i(9948),bI=i(1836),yI=i(7029),wI=i(8532),xI=i(6639),kI=i(1633),CI=i(9805),MI=i(2171),_I=i(875),SI=i(9595),EI=i(3894),zI=i(2803),RI=i(7765),LI=i(8804),II=i(8654),HI=i(257),TI=i(5844),AI=i(9651),OI=i(760),$I=i(9518),DI=i(4585),NI=i(1769),PI=i(643),jI=i(5156),VI=i(822),BI=i(8249),FI=i(3434),WI=i(9314),UI=i(3093),GI=i(7721),YI=i(588),qI=i(7645),ZI=i(7148),XI=i(6795),QI=i(7047),KI=i(9428),JI=i(1879),tH=i(9779),eH=i(2476),iH=i(9648),oH=i(2896),nH=i(6817),rH=i(5196),sH=i(2762),aH=i(5981),lH=i(9014),cH=i(2611),hH=i(7946),dH=i(6301),uH=i(8020),pH=i(3987),gH=i(3192),mH=i(8796),fH=i(2489),vH=i(7324),bH=i(6069),yH=i(4155),wH=i(6977),xH=i(8055),kH=i(2653),CH=i(9492),MH=i(4334),_H=i(6804),SH=i(9954),EH=i(2211),zH=i(5211),RH=i(1519),LH=i(6204),IH=i(5501),HH=i(5244),TH=i(9742),AH=i(1552),OH=i(1330),$H=i(2596),DH=i(5184),NH=i(7675),PH=i(1513),jH=i(9396),VH=i(7673),BH=i(244),FH=i(1187),WH=i(1736),UH=i(4390),GH=i(7106),YH=i(2096),qH=i(9991),ZH=i(5629),XH=i(3386),QH=i(6651),KH=i(1684),JH=i(3849),tT=i(2582),eT=i(8569),iT=i(2955),oT=i(9100),nT=i(7381),rT=i(9190),sT=i(4071),aT=i(8e3),lT=i(4633),cT=i(4374),hT=i(486),dT=i(3680),uT=i(9999),pT=i(2830),gT=i(5255),mT=i(6021),fT=i(2214),vT=i(8497),bT=i(2052),yT=i(5327),wT=i(8701),xT=i(8722),kT=i(7325),CT=i(2445);const MT=[qz.mw,Zz.mw,Xz.mw,Qz.mw,Kz.mw,Jz.mw,tR.mw,eR.mw,iR.mw,nR.mw,oR.mw,rR.mw,sR.mw,aR.mw,lR.mw,cR.mw,hR.mw,dR.mw,uR.mw,pR.mw,gR.mw,mR.mw,fR.mw,vR.mw,bR.mw,yR.mw,wR.mw,xR.mw,kR.mw,MR.mw,_R.mw,SR.mw,ER.mw,zR.mw,RR.mw,LR.mw,IR.mw,HR.mw,TR.mw,AR.mw,OR.mw,$R.mw,NR.mw,DR.mw,PR.mw,jR.mw,VR.mw,BR.mw,FR.mw,WR.mw,UR.mw,GR.mw,YR.mw,qR.mw,ZR.mw,XR.mw,KR.mw,JR.mw,tL.mw,eL.mw,iL.mw,oL.mw,nL.mw,rL.mw,sL.mw,aL.mw,lL.mw,cL.mw,hL.mw,dL.mw,uL.mw,pL.mw,gL.mw,mL.mw,fL.mw,QR.mw,vL.mw,bL.mw,yL.mw,wL.mw,xL.mw,kL.mw,CL.mw,ML.mw,_L.mw,SL.mw,EL.mw,zL.mw,RL.mw,LL.mw,IL.mw,HL.mw,TL.mw,AL.mw,OL.mw,$L.mw,DL.mw,NL.mw,PL.mw,jL.mw,VL.mw,BL.mw,FL.mw,WL.mw,UL.mw,GL.mw,YL.mw,qL.mw,ZL.mw,XL.mw,QL.mw,KL.mw,JL.mw,tI.mw,eI.mw,iI.mw,oI.mw,CR.mw,nI.mw,rI.mw,sI.mw,aI.mw,lI.mw,cI.mw,hI.mw,dI.mw,uI.mw,pI.mw,gI.mw,mI.mw,fI.mw,vI.mw,yI.mw,bI.mw,xI.mw,wI.mw,kI.mw,CI.mw,MI.mw,_I.mw,SI.mw,EI.mw,zI.mw,RI.mw,LI.mw,OI.mw,$I.mw,DI.mw,NI.mw,PI.mw,jI.mw,VI.mw,FI.mw,WI.mw,UI.mw,XI.mw,QI.mw,KI.mw,JI.mw,tH.mw,eH.mw,iH.mw,oH.mw,II.mw,HI.mw,AI.mw,TI.mw,nH.mw,rH.mw,sH.mw,aH.mw,lH.mw,cH.mw,hH.mw,dH.mw,GI.mw,YI.mw,qI.mw,ZI.mw,pH.mw,gH.mw,mH.mw,fH.mw,vH.mw,bH.mw,yH.mw,wH.mw,xH.mw,kH.mw,CH.mw,MH.mw,_H.mw,SH.mw,EH.mw,zH.mw,RH.mw,LH.mw,IH.mw,uH.mw,HH.mw,TH.mw,AH.mw,OH.mw,$H.mw,DH.mw,NH.mw,PH.mw,jH.mw,VH.mw,BH.mw,FH.mw,WH.mw,UH.mw,GH.mw,YH.mw,qH.mw,ZH.mw,XH.mw,QH.mw,KH.mw,JH.mw,tT.mw,eT.mw,iT.mw,oT.mw,nT.mw,rT.mw,sT.mw,aT.mw,lT.mw,cT.mw,hT.mw,dT.mw,uT.mw,pT.mw,gT.mw,mT.mw,fT.mw,vT.mw,bT.mw,BI.mw,yT.mw,wT.mw,xT.mw,kT.mw,CT.mw],_T={xlsx:V,charts:B},ST={name:"@omegagrid/bundle",version:"0.6.
|
|
8451
|
+
`:null,this.addEventListener("mousedown",(t=>t.stopPropagation()))}getTypeIndex(t){const e=this.types.findIndex((e=>e.type==t.type&&e.grouping==(t.grouping||"standard")));return e>-1?e:null}updateModel(){if(this.editTitle=!1,!this.model)return;this.titleInput&&(this.model.title=this.titleInput.value);const t=this.types[this.typeList.value];this.model.type=t.type,this.model.grouping=t.grouping,this.model.categoriesRange=this.categoryRangeInput?.value?fv.fromA1(this.categoryRangeInput.value):null,this.model.seriesRange=this.seriesRangeInput?.value?fv.fromA1(this.seriesRangeInput.value):null,this.model.dataRange=fv.fromA1(this.dataRangeInput.value),this.dispatchEvent(new On({value:this.model}))}async updated(){this.editTitle&&this.titleInput&&(await this.titleInput.updateComplete,this.titleInput.focus(),this.titleInput.selectAll())}};Uz.styles=[Fz],Wz([ps({type:Object})],Uz.prototype,"model",void 0),Wz([gs()],Uz.prototype,"editTitle",void 0),Wz([fs("#title")],Uz.prototype,"titleInput",void 0),Wz([fs("#type")],Uz.prototype,"typeList",void 0),Wz([fs("#dataRange")],Uz.prototype,"dataRangeInput",void 0),Wz([fs("#seriesRange")],Uz.prototype,"seriesRangeInput",void 0),Wz([fs("#categoryRange")],Uz.prototype,"categoryRangeInput",void 0),Uz=Wz([hs("og-plugin-chart-form")],Uz);const Gz=wa().themes.get("dark");Object.assign(Gz.definition,{"highcharts-title-font-size":"16px","highcharts-subtitle-font-size":"14px","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"rgb(48, 48, 48)","highcharts-neutral-color-100":"rgb(255, 255, 255)","highcharts-neutral-color-80":"rgb(214, 214, 214)","highcharts-neutral-color-60":"rgb(173, 173, 173)","highcharts-neutral-color-40":"rgb(133, 133, 133)","highcharts-neutral-color-20":"rgb(92, 92, 92)","highcharts-neutral-color-10":"rgb(71, 71, 71)","highcharts-neutral-color-5":"rgb(61, 61, 61)","highcharts-neutral-color-3":"rgb(57, 57, 57)","highcharts-highlight-color-100":"rgb(122, 167, 255)","highcharts-highlight-color-80":"rgb(108, 144, 214)","highcharts-highlight-color-60":"rgb(94, 121, 173)","highcharts-highlight-color-20":"rgb(65, 74, 92)","highcharts-highlight-color-10":"rgb(58, 63, 71)"});const Yz=wa().themes.get("light");Object.assign(Yz.definition,{"highcharts-title-font-size":"16px","chart-background-color":"#2a2a2b","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"#ffffff","highcharts-neutral-color-100":"#000000","highcharts-neutral-color-80":"#333333","highcharts-neutral-color-60":"#666666","highcharts-neutral-color-40":"#999999","highcharts-neutral-color-20":"#cccccc","highcharts-neutral-color-10":"#e6e6e6","highcharts-neutral-color-5":"#f2f2f2","highcharts-neutral-color-3":"#f7f7f7","highcharts-highlight-color-100":"#0022ff","highcharts-highlight-color-80":"#334eff","highcharts-highlight-color-60":"#667aff","highcharts-highlight-color-20":"#ccd3ff","highcharts-highlight-color-10":"#e6e9ff","highcharts-positive-color":"#06b535","highcharts-negative-color":"#f21313","highcharts-annotation-color-0":"rgba(130, 170, 255, 0.4)","highcharts-annotation-color-1":"rgba(139, 191, 216, 0.4)","highcharts-annotation-color-2":"rgba(150, 216, 192, 0.4)","highcharts-annotation-color-3":"rgba(156, 229, 161, 0.4)","highcharts-annotation-color-4":"rgba(162, 241, 130, 0.4)","highcharts-annotation-color-5":"rgba(169, 255, 101, 0.4)"});var qz=i(2439),Zz=i(8022),Xz=i(6158),Qz=i(127),Kz=i(4505),Jz=i(8659),tR=i(397),eR=i(930),iR=i(9723),oR=i(6343),nR=i(4582),rR=i(6127),sR=i(8238),aR=i(7362),lR=i(452),cR=i(5390),hR=i(3368),dR=i(6288),uR=i(7513),pR=i(1386),gR=i(5764),mR=i(1261),fR=i(3071),vR=i(3285),bR=i(2356),yR=i(6780),wR=i(8542),xR=i(8385),kR=i(1025),CR=i(2034),MR=i(8113),_R=i(1821),SR=i(7212),ER=i(2583),zR=i(5360),RR=i(2377),LR=i(2864),IR=i(7998),HR=i(4101),TR=i(7813),AR=i(5037),OR=i(7005),$R=i(9626),DR=i(9517),NR=i(1504),PR=i(3838),jR=i(4935),VR=i(7699),BR=i(3322),FR=i(5757),WR=i(536),UR=i(1673),GR=i(8736),YR=i(196),qR=i(5133),ZR=i(6092),XR=i(791),QR=i(5927),KR=i(1802),JR=i(9511),tL=i(6267),eL=i(1072),iL=i(4331),oL=i(8644),nL=i(2704),rL=i(2419),sL=i(6363),aL=i(5236),lL=i(3499),cL=i(3811),hL=i(1953),dL=i(4729),uL=i(8964),pL=i(8540),gL=i(8752),mL=i(8783),fL=i(8270),vL=i(7261),bL=i(9231),yL=i(4555),wL=i(5293),xL=i(6981),kL=i(5268),CL=i(2680),ML=i(789),_L=i(4373),SL=i(436),EL=i(8573),zL=i(1808),RL=i(3247),LL=i(5143),IL=i(2415),HL=i(2561),TL=i(5726),AL=i(7436),OL=i(4201),$L=i(8248),DL=i(6433),NL=i(2698),PL=i(979),jL=i(9358),VL=i(9176),BL=i(1239),FL=i(4218),WL=i(8377),UL=i(3740),GL=i(5379),YL=i(9974),qL=i(8955),ZL=i(3559),XL=i(809),QL=i(8014),KL=i(8265),JL=i(3300),tI=i(8724),eI=i(8033),iI=i(7700),oI=i(5741),nI=i(3478),rI=i(512),sI=i(499),aI=i(8680),lI=i(9646),cI=i(9432),hI=i(2841),dI=i(75),uI=i(9256),pI=i(444),gI=i(5633),mI=i(3788),fI=i(3573),vI=i(9948),bI=i(1836),yI=i(7029),wI=i(8532),xI=i(6639),kI=i(1633),CI=i(9805),MI=i(2171),_I=i(875),SI=i(9595),EI=i(3894),zI=i(2803),RI=i(7765),LI=i(8804),II=i(8654),HI=i(257),TI=i(5844),AI=i(9651),OI=i(760),$I=i(9518),DI=i(4585),NI=i(1769),PI=i(643),jI=i(5156),VI=i(822),BI=i(8249),FI=i(3434),WI=i(9314),UI=i(3093),GI=i(7721),YI=i(588),qI=i(7645),ZI=i(7148),XI=i(6795),QI=i(7047),KI=i(9428),JI=i(1879),tH=i(9779),eH=i(2476),iH=i(9648),oH=i(2896),nH=i(6817),rH=i(5196),sH=i(2762),aH=i(5981),lH=i(9014),cH=i(2611),hH=i(7946),dH=i(6301),uH=i(8020),pH=i(3987),gH=i(3192),mH=i(8796),fH=i(2489),vH=i(7324),bH=i(6069),yH=i(4155),wH=i(6977),xH=i(8055),kH=i(2653),CH=i(9492),MH=i(4334),_H=i(6804),SH=i(9954),EH=i(2211),zH=i(5211),RH=i(1519),LH=i(6204),IH=i(5501),HH=i(5244),TH=i(9742),AH=i(1552),OH=i(1330),$H=i(2596),DH=i(5184),NH=i(7675),PH=i(1513),jH=i(9396),VH=i(7673),BH=i(244),FH=i(1187),WH=i(1736),UH=i(4390),GH=i(7106),YH=i(2096),qH=i(9991),ZH=i(5629),XH=i(3386),QH=i(6651),KH=i(1684),JH=i(3849),tT=i(2582),eT=i(8569),iT=i(2955),oT=i(9100),nT=i(7381),rT=i(9190),sT=i(4071),aT=i(8e3),lT=i(4633),cT=i(4374),hT=i(486),dT=i(3680),uT=i(9999),pT=i(2830),gT=i(5255),mT=i(6021),fT=i(2214),vT=i(8497),bT=i(2052),yT=i(5327),wT=i(8701),xT=i(8722),kT=i(7325),CT=i(2445);const MT=[qz.mw,Zz.mw,Xz.mw,Qz.mw,Kz.mw,Jz.mw,tR.mw,eR.mw,iR.mw,nR.mw,oR.mw,rR.mw,sR.mw,aR.mw,lR.mw,cR.mw,hR.mw,dR.mw,uR.mw,pR.mw,gR.mw,mR.mw,fR.mw,vR.mw,bR.mw,yR.mw,wR.mw,xR.mw,kR.mw,MR.mw,_R.mw,SR.mw,ER.mw,zR.mw,RR.mw,LR.mw,IR.mw,HR.mw,TR.mw,AR.mw,OR.mw,$R.mw,NR.mw,DR.mw,PR.mw,jR.mw,VR.mw,BR.mw,FR.mw,WR.mw,UR.mw,GR.mw,YR.mw,qR.mw,ZR.mw,XR.mw,KR.mw,JR.mw,tL.mw,eL.mw,iL.mw,oL.mw,nL.mw,rL.mw,sL.mw,aL.mw,lL.mw,cL.mw,hL.mw,dL.mw,uL.mw,pL.mw,gL.mw,mL.mw,fL.mw,QR.mw,vL.mw,bL.mw,yL.mw,wL.mw,xL.mw,kL.mw,CL.mw,ML.mw,_L.mw,SL.mw,EL.mw,zL.mw,RL.mw,LL.mw,IL.mw,HL.mw,TL.mw,AL.mw,OL.mw,$L.mw,DL.mw,NL.mw,PL.mw,jL.mw,VL.mw,BL.mw,FL.mw,WL.mw,UL.mw,GL.mw,YL.mw,qL.mw,ZL.mw,XL.mw,QL.mw,KL.mw,JL.mw,tI.mw,eI.mw,iI.mw,oI.mw,CR.mw,nI.mw,rI.mw,sI.mw,aI.mw,lI.mw,cI.mw,hI.mw,dI.mw,uI.mw,pI.mw,gI.mw,mI.mw,fI.mw,vI.mw,yI.mw,bI.mw,xI.mw,wI.mw,kI.mw,CI.mw,MI.mw,_I.mw,SI.mw,EI.mw,zI.mw,RI.mw,LI.mw,OI.mw,$I.mw,DI.mw,NI.mw,PI.mw,jI.mw,VI.mw,FI.mw,WI.mw,UI.mw,XI.mw,QI.mw,KI.mw,JI.mw,tH.mw,eH.mw,iH.mw,oH.mw,II.mw,HI.mw,AI.mw,TI.mw,nH.mw,rH.mw,sH.mw,aH.mw,lH.mw,cH.mw,hH.mw,dH.mw,GI.mw,YI.mw,qI.mw,ZI.mw,pH.mw,gH.mw,mH.mw,fH.mw,vH.mw,bH.mw,yH.mw,wH.mw,xH.mw,kH.mw,CH.mw,MH.mw,_H.mw,SH.mw,EH.mw,zH.mw,RH.mw,LH.mw,IH.mw,uH.mw,HH.mw,TH.mw,AH.mw,OH.mw,$H.mw,DH.mw,NH.mw,PH.mw,jH.mw,VH.mw,BH.mw,FH.mw,WH.mw,UH.mw,GH.mw,YH.mw,qH.mw,ZH.mw,XH.mw,QH.mw,KH.mw,JH.mw,tT.mw,eT.mw,iT.mw,oT.mw,nT.mw,rT.mw,sT.mw,aT.mw,lT.mw,cT.mw,hT.mw,dT.mw,uT.mw,pT.mw,gT.mw,mT.mw,fT.mw,vT.mw,bT.mw,BI.mw,yT.mw,wT.mw,xT.mw,kT.mw,CT.mw],_T={xlsx:V,charts:B},ST={name:"@omegagrid/bundle",version:"0.6.104"};wa().activate("light"),jh.styleDefault="fal",Vh.add(...MT)})(),window.Omegagrid=o})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/bundle",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.104",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Distribution package for Omegagrid library",
|
|
6
6
|
"main": "omegagrid.js",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
|
20
20
|
"@fortawesome/pro-light-svg-icons": "6.4.2",
|
|
21
21
|
"@fortawesome/pro-solid-svg-icons": "6.4.2",
|
|
22
|
-
"@omegagrid/bucket": "^0.6.
|
|
23
|
-
"@omegagrid/calendar": "^0.6.
|
|
24
|
-
"@omegagrid/code": "^0.6.
|
|
25
|
-
"@omegagrid/commands": "^0.6.
|
|
26
|
-
"@omegagrid/core": "^0.6.
|
|
27
|
-
"@omegagrid/dialog": "^0.6.
|
|
28
|
-
"@omegagrid/editor": "^0.6.
|
|
29
|
-
"@omegagrid/form": "^0.6.
|
|
30
|
-
"@omegagrid/grid": "^0.6.
|
|
31
|
-
"@omegagrid/localize": "^0.6.
|
|
32
|
-
"@omegagrid/markdown": "^0.6.
|
|
33
|
-
"@omegagrid/plugin-charts": "^0.6.
|
|
34
|
-
"@omegagrid/plugin-xlsx": "^0.6.
|
|
35
|
-
"@omegagrid/statusbar": "^0.6.
|
|
36
|
-
"@omegagrid/tabs": "^0.6.
|
|
37
|
-
"@omegagrid/toolbar": "^0.6.
|
|
38
|
-
"@omegagrid/tree": "^0.6.
|
|
22
|
+
"@omegagrid/bucket": "^0.6.104",
|
|
23
|
+
"@omegagrid/calendar": "^0.6.104",
|
|
24
|
+
"@omegagrid/code": "^0.6.104",
|
|
25
|
+
"@omegagrid/commands": "^0.6.104",
|
|
26
|
+
"@omegagrid/core": "^0.6.104",
|
|
27
|
+
"@omegagrid/dialog": "^0.6.104",
|
|
28
|
+
"@omegagrid/editor": "^0.6.104",
|
|
29
|
+
"@omegagrid/form": "^0.6.104",
|
|
30
|
+
"@omegagrid/grid": "^0.6.104",
|
|
31
|
+
"@omegagrid/localize": "^0.6.104",
|
|
32
|
+
"@omegagrid/markdown": "^0.6.104",
|
|
33
|
+
"@omegagrid/plugin-charts": "^0.6.104",
|
|
34
|
+
"@omegagrid/plugin-xlsx": "^0.6.104",
|
|
35
|
+
"@omegagrid/statusbar": "^0.6.104",
|
|
36
|
+
"@omegagrid/tabs": "^0.6.104",
|
|
37
|
+
"@omegagrid/toolbar": "^0.6.104",
|
|
38
|
+
"@omegagrid/tree": "^0.6.104",
|
|
39
39
|
"lit": "^3.1.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|