@omegagrid/editor 0.8.4 → 0.9.1
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/dist/commands/index.d.ts +1 -6
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +26 -7
- package/dist/commands/index.js.map +1 -1
- package/dist/ui/editor.d.ts +4 -4
- package/dist/ui/editor.d.ts.map +1 -1
- package/dist/ui/editor.js +17 -16
- package/dist/ui/editor.js.map +1 -1
- package/package.json +10 -10
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { Editor } from "../ui";
|
|
2
|
-
export declare function
|
|
3
|
-
section: string;
|
|
4
|
-
name: string;
|
|
5
|
-
requiredParams: number;
|
|
6
|
-
fn: () => void;
|
|
7
|
-
}[];
|
|
2
|
+
export declare function initEditorCommands(editor: Editor): void;
|
|
8
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAgC/B,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,QAGhD"}
|
package/dist/commands/index.js
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function createEditorCommands(editor) {
|
|
2
|
+
return [{
|
|
3
|
+
group: 'editor',
|
|
4
|
+
name: 'show controls',
|
|
5
|
+
exec: () => {
|
|
4
6
|
editor.toolbarDisabled = false;
|
|
5
7
|
editor.formulabarDisabled = false;
|
|
6
|
-
}
|
|
8
|
+
}
|
|
9
|
+
}, {
|
|
10
|
+
group: 'editor',
|
|
11
|
+
name: 'hide controls',
|
|
12
|
+
exec: () => {
|
|
7
13
|
editor.toolbarDisabled = true;
|
|
8
14
|
editor.formulabarDisabled = true;
|
|
9
|
-
}
|
|
15
|
+
}
|
|
16
|
+
}, {
|
|
17
|
+
group: 'editor',
|
|
18
|
+
name: 'show statusbar',
|
|
19
|
+
exec: () => {
|
|
10
20
|
editor.statusbarDisabled = false;
|
|
11
|
-
}
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
group: 'editor',
|
|
24
|
+
name: 'hide statusbar',
|
|
25
|
+
exec: () => {
|
|
12
26
|
editor.statusbarDisabled = true;
|
|
13
|
-
}
|
|
27
|
+
}
|
|
28
|
+
}];
|
|
29
|
+
}
|
|
30
|
+
export function initEditorCommands(editor) {
|
|
31
|
+
editor.commands.clear();
|
|
32
|
+
createEditorCommands(editor).forEach(c => editor.commands.add(c));
|
|
14
33
|
}
|
|
15
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAGA,SAAS,oBAAoB,CAAC,MAAc;IAC3C,OAAO,CAAC;YACP,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,GAAG,EAAE;gBACV,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC/B,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;YACnC,CAAC;SACD,EAAE;YACF,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,GAAG,EAAE;gBACV,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;gBAC9B,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAClC,CAAC;SACD,EAAE;YACF,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,GAAG,EAAE;gBACV,MAAM,CAAC,iBAAiB,GAAG,KAAK,CAAC;YAClC,CAAC;SACD,EAAE;YACF,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,GAAG,EAAE;gBACV,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC;YACjC,CAAC;SACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAChD,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,oBAAoB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import { FlowCommandSource } from \"@omegagrid/commands\";\nimport { Editor } from \"../ui\";\n\nfunction createEditorCommands(editor: Editor): FlowCommandSource[] {\n\treturn [{\n\t\tgroup: 'editor', \n\t\tname: 'show controls', \n\t\texec: () => {\n\t\t\teditor.toolbarDisabled = false;\n\t\t\teditor.formulabarDisabled = false;\n\t\t}\n\t}, {\n\t\tgroup: 'editor',\n\t\tname: 'hide controls', \n\t\texec: () => {\n\t\t\teditor.toolbarDisabled = true;\n\t\t\teditor.formulabarDisabled = true;\n\t\t}\n\t}, {\n\t\tgroup: 'editor',\n\t\tname: 'show statusbar',\n\t\texec: () => {\n\t\t\teditor.statusbarDisabled = false;\n\t\t}\n\t}, {\n\t\tgroup: 'editor',\n\t\tname: 'hide statusbar',\n\t\texec: () => {\n\t\t\teditor.statusbarDisabled = true;\n\t\t}\n\t}];\n}\n\nexport function initEditorCommands(editor: Editor) {\n\teditor.commands.clear();\n\tcreateEditorCommands(editor).forEach(c => editor.commands.add(c));\n}"]}
|
package/dist/ui/editor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { actions, ComponentContainer, ComponentFactory, ComponentId, ComponentStore, Layout, ListSelectEvent, Menu, Overlay, Plugin, Plugins, SplitContainer } from '@omegagrid/core';
|
|
2
|
-
import {
|
|
1
|
+
import { actions, ComponentContainer, ComponentFactory, ComponentId, ComponentStore, Layout, ListSelectEvent, Menu, Overlay, Plugin, Plugins, ShortcutManager, SplitContainer } from '@omegagrid/core';
|
|
2
|
+
import { CommandManager } from '@omegagrid/commands';
|
|
3
3
|
import { ElementModel, Grid, GridEvent, GridGroup, GridModel, GroupModel, GroupModelSource, GridEditEvent, CellRange } from '@omegagrid/grid';
|
|
4
4
|
import { CommandWindow } from '@omegagrid/commands';
|
|
5
5
|
import { LitElement } from 'lit';
|
|
@@ -46,7 +46,8 @@ export declare class Editor extends LitElement implements Layout, ComponentConta
|
|
|
46
46
|
get tabMenu(): Menu;
|
|
47
47
|
private activeMenuSheet;
|
|
48
48
|
readonly plugins: Plugins<Editor>;
|
|
49
|
-
readonly commands:
|
|
49
|
+
readonly commands: CommandManager;
|
|
50
|
+
readonly shortcuts: ShortcutManager;
|
|
50
51
|
readonly sidebarComponents: ComponentStore<SidebarComponent>;
|
|
51
52
|
constructor();
|
|
52
53
|
updateOptions(options: Partial<Options>): void;
|
|
@@ -56,7 +57,6 @@ export declare class Editor extends LitElement implements Layout, ComponentConta
|
|
|
56
57
|
updated(props: Map<PropertyKey, unknown>): void;
|
|
57
58
|
updateComponents(): void;
|
|
58
59
|
setSourceData(sourceData: GroupModelSource): void;
|
|
59
|
-
getCommands(): Commands;
|
|
60
60
|
updateCommands(): void;
|
|
61
61
|
layout(): void;
|
|
62
62
|
updateSelectedRange(range: CellRange): void;
|
package/dist/ui/editor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/ui/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAO,MAAM,EAAE,eAAe,EACxG,IAAI,EAAE,OAAO,EAAE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,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAKxC,gBAAgB;IAShB,aAAa,CAAC,UAAU,EAAE,gBAAgB;IAW1C,cAAc;IAId,MAAM;IAIN,mBAAmB,CAAC,KAAK,EAAE,SAAS;IAapC,YAAY,CAAC,IAAI,EAAE,IAAI;IAMvB,aAAa,GAAU,GAAG,SAAS,mBAYlC;IAED,WAAW,GAAI,GAAG,aAAa,UAS9B;IAED,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAIrC,iBAAiB,GAAI,GAAG,QAAQ,UAI/B;IAED,mBAAmB,kBAgBlB;IAED,gBAAgB;IAIhB,sBAAsB,EAAE,gBAAgB,CAMvC;IAED,gBAAgB,GAAI,IAAI,OAAO,CAAC,WAAW,UAI1C;IAED,eAAe,aAEd;IAED,oBAAoB,GAAI,GAAG,eAAe,UAazC;IAED,MAAM,6CAwCJ;CAEF"}
|
package/dist/ui/editor.js
CHANGED
|
@@ -4,15 +4,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { ComponentStore, dom, Plugins } from '@omegagrid/core';
|
|
8
|
-
import {
|
|
7
|
+
import { ComponentStore, dom, Plugins, ShortcutManager } from '@omegagrid/core';
|
|
8
|
+
import { CommandManager } from '@omegagrid/commands';
|
|
9
9
|
import { Grid } from '@omegagrid/grid';
|
|
10
10
|
import { LitElement, html } from 'lit';
|
|
11
11
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
12
12
|
import { guard } from 'lit/directives/guard.js';
|
|
13
13
|
import { style } from './editor.style';
|
|
14
14
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
15
|
-
import {
|
|
15
|
+
import { initEditorCommands } from '../commands';
|
|
16
16
|
import { initOptions } from '../options';
|
|
17
17
|
export class EditorEvent extends Event {
|
|
18
18
|
constructor(type, args) {
|
|
@@ -34,6 +34,8 @@ let Editor = class Editor extends LitElement {
|
|
|
34
34
|
this.commandWindowRef = createRef();
|
|
35
35
|
this.tabMenuRef = createRef();
|
|
36
36
|
this.plugins = new Plugins(this);
|
|
37
|
+
this.commands = new CommandManager(this);
|
|
38
|
+
this.shortcuts = new ShortcutManager(this);
|
|
37
39
|
this.sidebarComponents = new ComponentStore(async (id) => {
|
|
38
40
|
let component;
|
|
39
41
|
switch (id) {
|
|
@@ -183,15 +185,6 @@ let Editor = class Editor extends LitElement {
|
|
|
183
185
|
</og-editor-statusbar>
|
|
184
186
|
`}
|
|
185
187
|
|
|
186
|
-
${this.options.commandWindow ? html `
|
|
187
|
-
<og-commands ${ref(this.commandWindowRef)}
|
|
188
|
-
style="display: none"
|
|
189
|
-
.commands="${this.getCommands()}"
|
|
190
|
-
.target="${this}"
|
|
191
|
-
@command.open="${this._onCommandsOpen}">
|
|
192
|
-
</og-commands>
|
|
193
|
-
` : ``}
|
|
194
|
-
|
|
195
188
|
<og-menu ${ref(this.tabMenuRef)}
|
|
196
189
|
style="display: none; z-index: 20000"
|
|
197
190
|
@select=${this._onTabMenuItemSelect}
|
|
@@ -204,10 +197,16 @@ let Editor = class Editor extends LitElement {
|
|
|
204
197
|
|
|
205
198
|
<og-overlay striped></og-overlay>
|
|
206
199
|
`;
|
|
207
|
-
this.commands = new Commands(createEditorCommands(this));
|
|
208
200
|
this.addEventListener('dragover', this._onDragover);
|
|
209
201
|
this.addEventListener('dragleave', () => this.overlay.hide());
|
|
210
202
|
this.addEventListener('drop', () => this.overlay.hide());
|
|
203
|
+
initEditorCommands(this);
|
|
204
|
+
this.shortcuts.register('F1', 'open_commands');
|
|
205
|
+
this.shortcuts.addEventListener('shortcut', (e) => {
|
|
206
|
+
if (e.action == 'open_commands') {
|
|
207
|
+
this.commands.open();
|
|
208
|
+
}
|
|
209
|
+
});
|
|
211
210
|
}
|
|
212
211
|
updateOptions(options) {
|
|
213
212
|
this.options = initOptions(options, this.options);
|
|
@@ -239,14 +238,16 @@ let Editor = class Editor extends LitElement {
|
|
|
239
238
|
}
|
|
240
239
|
setSourceData(sourceData) {
|
|
241
240
|
const container = this.getGridContainer();
|
|
241
|
+
sourceData.models?.forEach(m => {
|
|
242
|
+
m.options ?? (m.options = {});
|
|
243
|
+
m.options.commandWindow = false;
|
|
244
|
+
});
|
|
242
245
|
container.setSourceData(sourceData);
|
|
243
246
|
this.activeGrid = this.gridContainer?.grids?.entries().next().value;
|
|
244
247
|
this.activeModel = this.activeGrid?.model;
|
|
245
248
|
}
|
|
246
|
-
getCommands() { return this.gridContainer ? this.commands.merge(this.gridContainer.commands) : this.commands; }
|
|
247
249
|
updateCommands() {
|
|
248
|
-
|
|
249
|
-
this.commandWindow.commands = this.getCommands();
|
|
250
|
+
this.activeGrid.commands.commands.forEach(c => this.commands.add(c));
|
|
250
251
|
}
|
|
251
252
|
layout() {
|
|
252
253
|
this.container?.layout();
|
package/dist/ui/editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/ui/editor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACsD,cAAc,EAAE,GAAG,EACxD,OAAO,EAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAgB,IAAI,EAA2F,MAAM,iBAAiB,CAAC;AAE9I,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAA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yCACF;AAG3B;IADC,KAAK,CAAC,YAAY,CAAC;uCACH;AAGjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CACR;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qCACP;AAGlB;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC;+CACiB;AAG9C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CACF;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDACA;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;kDACC;AAG3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACD;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDACmB;AAG5C;IADC,KAAK,EAAE;4CACqB;AAG7B;IADC,KAAK,EAAE;2CACe;AAGvB;IADC,KAAK,EAAE;0CACS;AAGjB;IADC,KAAK,EAAE;2CACe;AArDX,MAAM;IADlB,aAAa,CAAC,WAAW,CAAC;GACd,MAAM,CA+TlB","sourcesContent":["import {\n\tactions, ComponentContainer, ComponentFactory, ComponentId, ComponentStore, dom, Layout, ListSelectEvent,\n\tMenu, Overlay, Plugin, Plugins, SplitContainer\n} from '@omegagrid/core';\nimport { Commands } from '@omegagrid/commands';\nimport { ElementModel, Grid, GridEvent, GridGroup, GridModel, GroupModel, GroupModelSource, GridEditEvent, CellRange } from '@omegagrid/grid';\nimport { CommandWindow } from '@omegagrid/commands';\nimport { LitElement, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { EditorFormula } from './formulabar';\nimport { EditorToolbar } from './toolbar';\nimport { guard } from 'lit/directives/guard.js';\nimport { style } from './editor.style';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { TabEvent } from '@omegagrid/tabs';\nimport { createEditorCommands } from '../commands';\nimport { EditorStatusbar } from './statusbar';\nimport { initOptions, Options } from '../options';\nimport { ThemeEditorSidebar } from './sidebars';\n\nexport type SidebarComponent = LitElement & {grid: Grid, group: GridGroup, model: GridModel, range: CellRange};\nexport type SidebarComponentType = 'config'|'headers'|'rules'|'sparklines'|'names'|ComponentId;\n\nexport class EditorEvent extends Event {\n\n\treadonly editor: Editor;\n\n\tconstructor(type: string, args?: Partial<EditorEvent>) {\n\t\tsuper(`editor.${type}`, {bubbles: true, composed: true});\n\t\tObject.assign(this, args);\n\t}\n\n}\n\n@customElement('og-editor')\nexport class Editor extends LitElement implements Layout, ComponentContainer {\n\n\tstatic styles = [style];\n\n\t@query('og-editor-formula')\n\tformulaBar: EditorFormula;\n\n\t@query('og-splitcontainer')\n\tcontainer: SplitContainer;\n\n\t@query('og-editor-toolbar')\n\ttoolbar: EditorToolbar;\n\n\t@query('og-editor-statusbar')\n\tstatusbar: EditorStatusbar;\n\n\t@query('og-overlay')\n\toverlay: Overlay;\n\n\t@property({type: Boolean})\n\tenableDrag = true;\n\n\t@property({type: Object})\n\tmodel: GroupModel;\n\n\t@property({attribute: false})\n\tcreateComponent: ComponentFactory<LitElement>;\n\n\t@property({type: Boolean})\n\ttoolbarDisabled = false;\n\n\t@property({type: Boolean})\n\tstatusbarDisabled = false;\n\n\t@property({type: Boolean})\n\tformulabarDisabled = false;\n\n\t@property({type: Object})\n\toptions = initOptions();\n\n\t@property({type: String})\n\trightSidebarComponent: SidebarComponentType; // = 'names';\n\t\n\t@state()\n\tgridElements: ElementModel[];\n\n\t@state()\n\tactiveRange: CellRange;\n\t\n\t@state()\n\tactiveGrid: Grid;\n\n\t@state()\n\tactiveModel: GridModel;\n\n\tgridContainer: GridGroup;\n\tget group() { return this.gridContainer }\n\t\n\tprivate commandWindowRef = createRef<CommandWindow>();\n\tget commandWindow() { return this.commandWindowRef.value }\n\n\tprivate tabMenuRef = createRef<Menu>();\n\tget tabMenu() { return this.tabMenuRef.value }\n\t\n\tprivate activeMenuSheet: string;\n\n\treadonly plugins = new Plugins<Editor>(this);\n\treadonly commands: Commands;\n\t\n\treadonly sidebarComponents = new ComponentStore<SidebarComponent>(async (id: ComponentId) => {\n\t\tlet component: SidebarComponent;\n\t\tswitch (id) {\n\t\t\tcase 'config': component = dom.createElement<SidebarComponent>('og-editor-form-config'); break;\n\t\t\tcase 'headers': component = dom.createElement<SidebarComponent>('og-editor-form-headers'); break;\n\t\t\tcase 'rules': component = dom.createElement<SidebarComponent>('og-editor-rules'); break;\n\t\t\tcase 'sparklines': component = dom.createElement<SidebarComponent>('og-editor-form-sparklines'); break;\n\t\t\tcase 'names': component = dom.createElement<SidebarComponent>('og-editor-form-names'); break;\n\t\t\tcase 'themes': component = dom.createElement<ThemeEditorSidebar>('og-editor-themesidebar'); break;\n\t\t\tdefault : component = this.createComponent ? await this.createComponent(id) as SidebarComponent : null;\n\t\t}\n\n\t\tif (!component) return null;\n\n\t\tif (this.activeGrid) {\n\t\t\tcomponent.grid = this.activeGrid;\n\t\t\tcomponent.range = this.activeGrid.selection.range;\n\t\t}\n\t\tif (this.activeModel) component.model = this.activeModel;\n\t\tif (this.gridContainer) component.group = this.gridContainer;\n\t\treturn component;\n\t});\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.commands = new Commands(createEditorCommands(this));\n\t\tthis.addEventListener('dragover', this._onDragover);\n\t\tthis.addEventListener('dragleave', () => this.overlay.hide());\n\t\tthis.addEventListener('drop', () => this.overlay.hide());\n\t}\n\n\tupdateOptions(options: Partial<Options>) {\n\t\tthis.options = initOptions(options, this.options);\n\t\tthis.requestUpdate();\n\t}\n\n\t_onDragover = (e: DragEvent) => {\n\t\tif (!this.enableDrag) return;\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tif (e.dataTransfer.types[0] == 'Files') {\n\t\t\te.dataTransfer.dropEffect = 'move';\n\t\t\tthis.overlay.text = 'drop file';\n\t\t\tthis.overlay.show(this);\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\twillUpdate(props: Map<PropertyKey, unknown>) {\n\t\tif (!this.hasUpdated) {\n\t\t\tthis.dispatchEvent(new EditorEvent('init', {editor: this}));\n\t\t}\n\t\tif (props.has('model')) this.gridContainer = null;\n\t}\n\n\tupdated(props: Map<PropertyKey, unknown>) {\n\t\tthis.updateComponents();\n\t\tif (props.has('toolbarDisabled') || props.has('formulabarDisabled')) this.layout();\n\t}\n\n\tupdateComponents() {\n\t\tthis.sidebarComponents.items.forEach(c => {\n\t\t\tc.grid = this.activeGrid;\n\t\t\tc.model = this.activeModel;\n\t\t\tc.group = this.gridContainer;\n\t\t\tc.range = this.activeGrid?.selection?.range.clone()\n\t\t});\n\t}\n\n\tsetSourceData(sourceData: GroupModelSource) {\n\t\tconst container = this.getGridContainer();\n\t\tcontainer.setSourceData(sourceData);\n\t\tthis.activeGrid = this.gridContainer?.grids?.entries().next().value;\n\t\tthis.activeModel = this.activeGrid?.model;\n\t}\n\n\tgetCommands() { return this.gridContainer ? this.commands.merge(this.gridContainer.commands) : this.commands }\n\n\tupdateCommands() {\n\t\tif (this.commandWindow) this.commandWindow.commands = this.getCommands();\n\t}\n\t\n\tlayout() {\n\t\tthis.container?.layout();\n\t}\n\n\tupdateSelectedRange(range: CellRange) {\n\t\tconst m = this.activeGrid.model;\n\t\tif (range.isColumn) {\n\t\t\tthis.gridElements = [...Array(range.size.columns).keys()].map(c => m.columns[c + range.c1]);\n\t\t} else if (range.isRow) {\n\t\t\tthis.gridElements = [...Array(range.size.rows).keys()].map(r => m.rows[r + range.r1]);\n\t\t} else {\n\t\t\tthis.gridElements = m.getCellArray( this.activeGrid.selection.range);\n\t\t}\n\t\tthis.statusbar.grid = this.activeGrid;\n\t\tthis.statusbar.range = range.clone();\n\t}\n\n\tactivateGrid(grid: Grid) {\n\t\tif (!grid) return;\n\t\tthis.activeGrid = grid;\n\t\tthis.activeModel = grid.model;\n\t}\n\n\t_onGridSelect = async (e: GridEvent) => {\n\t\tif (this.gridContainer.isFormulaMode) return;\n\n\t\tthis.activateGrid(e.composedPath().find(elm => elm instanceof Grid) as Grid);\n\t\t\n\t\tif (this.rightSidebarComponent == 'headers') {\n\t\t\tconst headerForm = await this.sidebarComponents.get('headers');\n\t\t\theaderForm.grid = this.activeGrid;\n\t\t\theaderForm.range = this.activeGrid.selection.range.clone();\n\t\t}\n\n\t\tthis.updateSelectedRange(e.selection.range);\n\t}\n\n\t_onGridEdit = (e: GridEditEvent) => {\n\t\tswitch (e.editType) {\n\t\t\tcase 'delete_column':\n\t\t\tcase 'delete_row':\n\t\t\tcase 'insert_column':\n\t\t\tcase 'insert_row':\n\t\t\t\tthis.updateSelectedRange(e.selection.range);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tregisterPlugin(plugin: Plugin<Editor>) {\n\t\tthis.plugins.register(plugin);\n\t}\n\n\t_onTabContextMenu = (e: TabEvent) => {\n\t\tconst uiEvent = e.uiEvent as MouseEvent;\n\t\tthis.activeMenuSheet = e.tab.id as string\n\t\tthis.tabMenu.openAt(uiEvent.pageX, uiEvent.pageY + 1);\n\t}\n\n\tcreateGridContainer = () => {\n\t\tconst container = dom.createElement<GridGroup>('og-gridgroup');\n\t\tcontainer.tabPosition = 'bottom';\n\t\tcontainer.designMode = true;\n\t\tcontainer.model = this.model;\n\t\tcontainer.options.commandWindow = false;\n\t\tcontainer.addEventListener('gridgroup.activate', () => {\n\t\t\tif (this.gridContainer.isFormulaMode) return;\n\t\t\tthis.activateGrid(this.gridContainer.activeGrid);\n\t\t\tthis.updateCommands();\n\t\t\tthis.updateComponents();\n\t\t});\n\t\tcontainer.addEventListener('tab.contextmenu', this._onTabContextMenu);\n\t\tcontainer.addEventListener('grid.select', this._onGridSelect);\n\t\tcontainer.addEventListener('grid.edit', this._onGridEdit);\n\t\treturn container;\n\t}\n\n\tgetGridContainer() {\n\t\treturn this.gridContainer ?? (this.gridContainer = this.createGridContainer());\n\t}\n\n\tcreateDefaultComponent: ComponentFactory = (index: ComponentId) => {\n\t\tif (index == 0) {\n\t\t\treturn this.getGridContainer();\n\t\t} else if (index == 1) {\n\t\t\treturn this.sidebarComponents.get(this.rightSidebarComponent);\n\t\t}\n\t}\n\n\t_onToolbarAction = (_e: actions.ActionEvent) => {\n\t\t// if (e.action.key == 'config') {\n\t\t// \tthis.rightSidebarComponent = e.action.value ? e.action.key : null;\n\t\t// }\n\t}\n\n\t_onCommandsOpen = () => {\n\t\t// this.commandWindow.requestUpdate();\n\t}\n\n\t_onTabMenuItemSelect = (e: ListSelectEvent) => {\n\t\tswitch (this.tabMenu.items[e.index].key) {\n\t\t\tcase 'properties':\n\t\t\t\tthis.activateGrid(this.gridContainer.grids.get(this.activeMenuSheet));\n\t\t\t\tthis.rightSidebarComponent = 'config';\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\tthis.gridContainer.deleteModel(this.activeMenuSheet);\n\t\t\t\tbreak;\n\t\t\tcase 'duplicate':\n\t\t\t\tthis.gridContainer.duplicateModel(this.activeMenuSheet);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t${this.toolbarDisabled ? '' : html`\n\t\t\t<og-editor-toolbar\n\t\t\t\t.grid=\"${this.activeGrid}\"\n\t\t\t\t.gridElements=${this.gridElements}\n\t\t\t\t.editor=\"${this}\"\n\t\t\t\t@toolbar.action=\"${this._onToolbarAction}\">\n\t\t\t</og-editor-toolbar>\n\t\t`}\n\t\t\n\t\t${this.toolbarDisabled ? '' : html`\n\t\t\t<og-editor-formula .grid=\"${this.activeGrid}\"></og-editor-formula>\n\t\t`}\n\n\t\t${guard([this.rightSidebarComponent], () => html`\n\t\t\t<og-splitcontainer \n\t\t\t\t.items=\"${[{}, {size: 300, collapsed: !this.rightSidebarComponent}]}\"\n\t\t\t\t.createComponent=\"${this.createDefaultComponent}\">\n\t\t\t</og-splitcontainer>\n\t\t`)}\n\n\t\t${this.statusbarDisabled ? '' : html`\n\t\t\t<og-editor-statusbar\n\t\t\t\t.group=\"${this.getGridContainer()}\"\n\t\t\t\t.grid=\"${this.activeGrid}\"\n\t\t\t\t.range=\"${this.activeRange}\">\n\t\t\t</og-editor-statusbar>\n\t\t`}\n\n\t\t${this.options.commandWindow ? html`\n\t\t\t<og-commands ${ref(this.commandWindowRef)}\n\t\t\t\tstyle=\"display: none\"\n\t\t\t\t.commands=\"${this.getCommands()}\"\n\t\t\t\t.target=\"${this}\"\n\t\t\t\t@command.open=\"${this._onCommandsOpen}\">\n\t\t\t</og-commands>\n\t\t` : ``}\n\n\t\t<og-menu ${ref(this.tabMenuRef)}\n\t\t\tstyle=\"display: none; z-index: 20000\"\n\t\t\t@select=${this._onTabMenuItemSelect}\n\t\t\t.items=${[\n\t\t\t\t{key: 'properties', value: 'Properties', icon: 'pen'},\n\t\t\t\t{key: 'duplicate', value: 'Duplicate', icon: 'copy'},\n\t\t\t\t{key: 'delete', value: 'Delete', icon: 'trash'},\n\t\t\t]}>\n\t\t</og-menu>\n\n\t\t<og-overlay striped></og-overlay>\n\t`;\n\n}"]}
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/ui/editor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACsD,cAAc,EAAE,GAAG,EACxD,OAAO,EAAiB,eAAe,EAC9D,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAgB,IAAI,EAA2F,MAAM,iBAAiB,CAAC;AAE9I,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAA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aAAM,GAAG,CAAC,KAAK,CAAC,AAAV,CAAW;AAGxB;IADC,KAAK,CAAC,mBAAmB,CAAC;0CACD;AAG1B;IADC,KAAK,CAAC,mBAAmB,CAAC;yCACD;AAG1B;IADC,KAAK,CAAC,mBAAmB,CAAC;uCACJ;AAGvB;IADC,KAAK,CAAC,qBAAqB,CAAC;yCACF;AAG3B;IADC,KAAK,CAAC,YAAY,CAAC;uCACH;AAGjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CACR;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qCACP;AAGlB;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC;+CACiB;AAG9C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CACF;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDACA;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;kDACC;AAG3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACD;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDACmB;AAG5C;IADC,KAAK,EAAE;4CACqB;AAG7B;IADC,KAAK,EAAE;2CACe;AAGvB;IADC,KAAK,EAAE;0CACS;AAGjB;IADC,KAAK,EAAE;2CACe;AArDX,MAAM;IADlB,aAAa,CAAC,WAAW,CAAC;GACd,MAAM,CA+TlB","sourcesContent":["import {\n\tactions, ComponentContainer, ComponentFactory, ComponentId, ComponentStore, dom, Layout, ListSelectEvent,\n\tMenu, Overlay, Plugin, Plugins, ShortcutEvent, ShortcutManager, SplitContainer\n} from '@omegagrid/core';\nimport { CommandManager } from '@omegagrid/commands';\nimport { ElementModel, Grid, GridEvent, GridGroup, GridModel, GroupModel, GroupModelSource, GridEditEvent, CellRange } from '@omegagrid/grid';\nimport { CommandWindow } from '@omegagrid/commands';\nimport { LitElement, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { EditorFormula } from './formulabar';\nimport { EditorToolbar } from './toolbar';\nimport { guard } from 'lit/directives/guard.js';\nimport { style } from './editor.style';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { TabEvent } from '@omegagrid/tabs';\nimport { initEditorCommands } from '../commands';\nimport { EditorStatusbar } from './statusbar';\nimport { initOptions, Options } from '../options';\nimport { ThemeEditorSidebar } from './sidebars';\n\nexport type SidebarComponent = LitElement & {grid: Grid, group: GridGroup, model: GridModel, range: CellRange};\nexport type SidebarComponentType = 'config'|'headers'|'rules'|'sparklines'|'names'|ComponentId;\n\nexport class EditorEvent extends Event {\n\n\treadonly editor: Editor;\n\n\tconstructor(type: string, args?: Partial<EditorEvent>) {\n\t\tsuper(`editor.${type}`, {bubbles: true, composed: true});\n\t\tObject.assign(this, args);\n\t}\n\n}\n\n@customElement('og-editor')\nexport class Editor extends LitElement implements Layout, ComponentContainer {\n\n\tstatic styles = [style];\n\n\t@query('og-editor-formula')\n\tformulaBar: EditorFormula;\n\n\t@query('og-splitcontainer')\n\tcontainer: SplitContainer;\n\n\t@query('og-editor-toolbar')\n\ttoolbar: EditorToolbar;\n\n\t@query('og-editor-statusbar')\n\tstatusbar: EditorStatusbar;\n\n\t@query('og-overlay')\n\toverlay: Overlay;\n\n\t@property({type: Boolean})\n\tenableDrag = true;\n\n\t@property({type: Object})\n\tmodel: GroupModel;\n\n\t@property({attribute: false})\n\tcreateComponent: ComponentFactory<LitElement>;\n\n\t@property({type: Boolean})\n\ttoolbarDisabled = false;\n\n\t@property({type: Boolean})\n\tstatusbarDisabled = false;\n\n\t@property({type: Boolean})\n\tformulabarDisabled = false;\n\n\t@property({type: Object})\n\toptions = initOptions();\n\n\t@property({type: String})\n\trightSidebarComponent: SidebarComponentType; // = 'names';\n\t\n\t@state()\n\tgridElements: ElementModel[];\n\n\t@state()\n\tactiveRange: CellRange;\n\t\n\t@state()\n\tactiveGrid: Grid;\n\n\t@state()\n\tactiveModel: GridModel;\n\n\tgridContainer: GridGroup;\n\tget group() { return this.gridContainer }\n\t\n\tprivate commandWindowRef = createRef<CommandWindow>();\n\tget commandWindow() { return this.commandWindowRef.value }\n\n\tprivate tabMenuRef = createRef<Menu>();\n\tget tabMenu() { return this.tabMenuRef.value }\n\t\n\tprivate activeMenuSheet: string;\n\n\treadonly plugins = new Plugins<Editor>(this);\n\treadonly commands = new CommandManager(this);\n\treadonly shortcuts = new ShortcutManager(this);\n\t\n\treadonly sidebarComponents = new ComponentStore<SidebarComponent>(async (id: ComponentId) => {\n\t\tlet component: SidebarComponent;\n\t\tswitch (id) {\n\t\t\tcase 'config': component = dom.createElement<SidebarComponent>('og-editor-form-config'); break;\n\t\t\tcase 'headers': component = dom.createElement<SidebarComponent>('og-editor-form-headers'); break;\n\t\t\tcase 'rules': component = dom.createElement<SidebarComponent>('og-editor-rules'); break;\n\t\t\tcase 'sparklines': component = dom.createElement<SidebarComponent>('og-editor-form-sparklines'); break;\n\t\t\tcase 'names': component = dom.createElement<SidebarComponent>('og-editor-form-names'); break;\n\t\t\tcase 'themes': component = dom.createElement<ThemeEditorSidebar>('og-editor-themesidebar'); break;\n\t\t\tdefault : component = this.createComponent ? await this.createComponent(id) as SidebarComponent : null;\n\t\t}\n\n\t\tif (!component) return null;\n\n\t\tif (this.activeGrid) {\n\t\t\tcomponent.grid = this.activeGrid;\n\t\t\tcomponent.range = this.activeGrid.selection.range;\n\t\t}\n\t\tif (this.activeModel) component.model = this.activeModel;\n\t\tif (this.gridContainer) component.group = this.gridContainer;\n\t\treturn component;\n\t});\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('dragover', this._onDragover);\n\t\tthis.addEventListener('dragleave', () => this.overlay.hide());\n\t\tthis.addEventListener('drop', () => this.overlay.hide());\n\t\tinitEditorCommands(this);\n\t\tthis.shortcuts.register('F1', 'open_commands');\n\t\tthis.shortcuts.addEventListener('shortcut', (e: ShortcutEvent) => {\n\t\t\tif (e.action == 'open_commands') {\n\t\t\t\tthis.commands.open();\n\t\t\t}\n\t\t});\n\t}\n\n\tupdateOptions(options: Partial<Options>) {\n\t\tthis.options = initOptions(options, this.options);\n\t\tthis.requestUpdate();\n\t}\n\n\t_onDragover = (e: DragEvent) => {\n\t\tif (!this.enableDrag) return;\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tif (e.dataTransfer.types[0] == 'Files') {\n\t\t\te.dataTransfer.dropEffect = 'move';\n\t\t\tthis.overlay.text = 'drop file';\n\t\t\tthis.overlay.show(this);\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\twillUpdate(props: Map<PropertyKey, unknown>) {\n\t\tif (!this.hasUpdated) {\n\t\t\tthis.dispatchEvent(new EditorEvent('init', {editor: this}));\n\t\t}\n\t\tif (props.has('model')) this.gridContainer = null;\n\t}\n\n\tupdated(props: Map<PropertyKey, unknown>) {\n\t\tthis.updateComponents();\n\t\tif (props.has('toolbarDisabled') || props.has('formulabarDisabled')) this.layout();\n\t}\n\n\tupdateComponents() {\n\t\tthis.sidebarComponents.items.forEach(c => {\n\t\t\tc.grid = this.activeGrid;\n\t\t\tc.model = this.activeModel;\n\t\t\tc.group = this.gridContainer;\n\t\t\tc.range = this.activeGrid?.selection?.range.clone()\n\t\t});\n\t}\n\n\tsetSourceData(sourceData: GroupModelSource) {\n\t\tconst container = this.getGridContainer();\n\t\tsourceData.models?.forEach(m => {\n\t\t\tm.options ??= {};\n\t\t\tm.options.commandWindow = false;\n\t\t});\n\t\tcontainer.setSourceData(sourceData);\n\t\tthis.activeGrid = this.gridContainer?.grids?.entries().next().value;\n\t\tthis.activeModel = this.activeGrid?.model;\n\t}\n\n\tupdateCommands() {\n\t\tthis.activeGrid.commands.commands.forEach(c => this.commands.add(c));\n\t}\n\t\n\tlayout() {\n\t\tthis.container?.layout();\n\t}\n\n\tupdateSelectedRange(range: CellRange) {\n\t\tconst m = this.activeGrid.model;\n\t\tif (range.isColumn) {\n\t\t\tthis.gridElements = [...Array(range.size.columns).keys()].map(c => m.columns[c + range.c1]);\n\t\t} else if (range.isRow) {\n\t\t\tthis.gridElements = [...Array(range.size.rows).keys()].map(r => m.rows[r + range.r1]);\n\t\t} else {\n\t\t\tthis.gridElements = m.getCellArray( this.activeGrid.selection.range);\n\t\t}\n\t\tthis.statusbar.grid = this.activeGrid;\n\t\tthis.statusbar.range = range.clone();\n\t}\n\n\tactivateGrid(grid: Grid) {\n\t\tif (!grid) return;\n\t\tthis.activeGrid = grid;\n\t\tthis.activeModel = grid.model;\n\t}\n\n\t_onGridSelect = async (e: GridEvent) => {\n\t\tif (this.gridContainer.isFormulaMode) return;\n\n\t\tthis.activateGrid(e.composedPath().find(elm => elm instanceof Grid) as Grid);\n\t\t\n\t\tif (this.rightSidebarComponent == 'headers') {\n\t\t\tconst headerForm = await this.sidebarComponents.get('headers');\n\t\t\theaderForm.grid = this.activeGrid;\n\t\t\theaderForm.range = this.activeGrid.selection.range.clone();\n\t\t}\n\n\t\tthis.updateSelectedRange(e.selection.range);\n\t}\n\n\t_onGridEdit = (e: GridEditEvent) => {\n\t\tswitch (e.editType) {\n\t\t\tcase 'delete_column':\n\t\t\tcase 'delete_row':\n\t\t\tcase 'insert_column':\n\t\t\tcase 'insert_row':\n\t\t\t\tthis.updateSelectedRange(e.selection.range);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tregisterPlugin(plugin: Plugin<Editor>) {\n\t\tthis.plugins.register(plugin);\n\t}\n\n\t_onTabContextMenu = (e: TabEvent) => {\n\t\tconst uiEvent = e.uiEvent as MouseEvent;\n\t\tthis.activeMenuSheet = e.tab.id as string\n\t\tthis.tabMenu.openAt(uiEvent.pageX, uiEvent.pageY + 1);\n\t}\n\n\tcreateGridContainer = () => {\n\t\tconst container = dom.createElement<GridGroup>('og-gridgroup');\n\t\tcontainer.tabPosition = 'bottom';\n\t\tcontainer.designMode = true;\n\t\tcontainer.model = this.model;\n\t\tcontainer.options.commandWindow = false;\n\t\tcontainer.addEventListener('gridgroup.activate', () => {\n\t\t\tif (this.gridContainer.isFormulaMode) return;\n\t\t\tthis.activateGrid(this.gridContainer.activeGrid);\n\t\t\tthis.updateCommands();\n\t\t\tthis.updateComponents();\n\t\t});\n\t\tcontainer.addEventListener('tab.contextmenu', this._onTabContextMenu);\n\t\tcontainer.addEventListener('grid.select', this._onGridSelect);\n\t\tcontainer.addEventListener('grid.edit', this._onGridEdit);\n\t\treturn container;\n\t}\n\n\tgetGridContainer() {\n\t\treturn this.gridContainer ?? (this.gridContainer = this.createGridContainer());\n\t}\n\n\tcreateDefaultComponent: ComponentFactory = (index: ComponentId) => {\n\t\tif (index == 0) {\n\t\t\treturn this.getGridContainer();\n\t\t} else if (index == 1) {\n\t\t\treturn this.sidebarComponents.get(this.rightSidebarComponent);\n\t\t}\n\t}\n\n\t_onToolbarAction = (_e: actions.ActionEvent) => {\n\t\t// if (e.action.key == 'config') {\n\t\t// \tthis.rightSidebarComponent = e.action.value ? e.action.key : null;\n\t\t// }\n\t}\n\n\t_onCommandsOpen = () => {\n\t\t// this.commandWindow.requestUpdate();\n\t}\n\n\t_onTabMenuItemSelect = (e: ListSelectEvent) => {\n\t\tswitch (this.tabMenu.items[e.index].key) {\n\t\t\tcase 'properties':\n\t\t\t\tthis.activateGrid(this.gridContainer.grids.get(this.activeMenuSheet));\n\t\t\t\tthis.rightSidebarComponent = 'config';\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\tthis.gridContainer.deleteModel(this.activeMenuSheet);\n\t\t\t\tbreak;\n\t\t\tcase 'duplicate':\n\t\t\t\tthis.gridContainer.duplicateModel(this.activeMenuSheet);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t${this.toolbarDisabled ? '' : html`\n\t\t\t<og-editor-toolbar\n\t\t\t\t.grid=\"${this.activeGrid}\"\n\t\t\t\t.gridElements=${this.gridElements}\n\t\t\t\t.editor=\"${this}\"\n\t\t\t\t@toolbar.action=\"${this._onToolbarAction}\">\n\t\t\t</og-editor-toolbar>\n\t\t`}\n\t\t\n\t\t${this.toolbarDisabled ? '' : html`\n\t\t\t<og-editor-formula .grid=\"${this.activeGrid}\"></og-editor-formula>\n\t\t`}\n\n\t\t${guard([this.rightSidebarComponent], () => html`\n\t\t\t<og-splitcontainer \n\t\t\t\t.items=\"${[{}, {size: 300, collapsed: !this.rightSidebarComponent}]}\"\n\t\t\t\t.createComponent=\"${this.createDefaultComponent}\">\n\t\t\t</og-splitcontainer>\n\t\t`)}\n\n\t\t${this.statusbarDisabled ? '' : html`\n\t\t\t<og-editor-statusbar\n\t\t\t\t.group=\"${this.getGridContainer()}\"\n\t\t\t\t.grid=\"${this.activeGrid}\"\n\t\t\t\t.range=\"${this.activeRange}\">\n\t\t\t</og-editor-statusbar>\n\t\t`}\n\n\t\t<og-menu ${ref(this.tabMenuRef)}\n\t\t\tstyle=\"display: none; z-index: 20000\"\n\t\t\t@select=${this._onTabMenuItemSelect}\n\t\t\t.items=${[\n\t\t\t\t{key: 'properties', value: 'Properties', icon: 'pen'},\n\t\t\t\t{key: 'duplicate', value: 'Duplicate', icon: 'copy'},\n\t\t\t\t{key: 'delete', value: 'Delete', icon: 'trash'},\n\t\t\t]}>\n\t\t</og-menu>\n\n\t\t<og-overlay striped></og-overlay>\n\t`;\n\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Spreadsheet editor",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"_prepublish": "yarn test && yarn lint"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@omegagrid/commands": "^0.
|
|
31
|
-
"@omegagrid/core": "^0.
|
|
32
|
-
"@omegagrid/form": "^0.
|
|
33
|
-
"@omegagrid/grid": "^0.
|
|
34
|
-
"@omegagrid/localize": "^0.
|
|
35
|
-
"@omegagrid/statusbar": "^0.
|
|
36
|
-
"@omegagrid/tabs": "^0.
|
|
37
|
-
"@omegagrid/toolbar": "^0.
|
|
38
|
-
"@omegagrid/tree": "^0.
|
|
30
|
+
"@omegagrid/commands": "^0.9.1",
|
|
31
|
+
"@omegagrid/core": "^0.9.1",
|
|
32
|
+
"@omegagrid/form": "^0.9.1",
|
|
33
|
+
"@omegagrid/grid": "^0.9.1",
|
|
34
|
+
"@omegagrid/localize": "^0.9.1",
|
|
35
|
+
"@omegagrid/statusbar": "^0.9.1",
|
|
36
|
+
"@omegagrid/tabs": "^0.9.1",
|
|
37
|
+
"@omegagrid/toolbar": "^0.9.1",
|
|
38
|
+
"@omegagrid/tree": "^0.9.1",
|
|
39
39
|
"lit": "^3.1.1",
|
|
40
40
|
"lit-html": "^3.1.1",
|
|
41
41
|
"ts-debounce": "^4.0.0"
|