@omegagrid/editor 0.2.5
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 +8 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +19 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +12 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +18 -0
- package/dist/options.js.map +1 -0
- package/dist/ui/editor.d.ts +70 -0
- package/dist/ui/editor.d.ts.map +1 -0
- package/dist/ui/editor.js +320 -0
- package/dist/ui/editor.js.map +1 -0
- package/dist/ui/editor.style.d.ts +2 -0
- package/dist/ui/editor.style.d.ts.map +1 -0
- package/dist/ui/editor.style.js +41 -0
- package/dist/ui/editor.style.js.map +1 -0
- package/dist/ui/editorZoom.d.ts +16 -0
- package/dist/ui/editorZoom.d.ts.map +1 -0
- package/dist/ui/editorZoom.js +85 -0
- package/dist/ui/editorZoom.js.map +1 -0
- package/dist/ui/forms/configForm.d.ts +12 -0
- package/dist/ui/forms/configForm.d.ts.map +1 -0
- package/dist/ui/forms/configForm.js +89 -0
- package/dist/ui/forms/configForm.js.map +1 -0
- package/dist/ui/forms/headerForm.d.ts +18 -0
- package/dist/ui/forms/headerForm.d.ts.map +1 -0
- package/dist/ui/forms/headerForm.js +150 -0
- package/dist/ui/forms/headerForm.js.map +1 -0
- package/dist/ui/forms/index.d.ts +7 -0
- package/dist/ui/forms/index.d.ts.map +1 -0
- package/dist/ui/forms/index.js +23 -0
- package/dist/ui/forms/index.js.map +1 -0
- package/dist/ui/forms/namesForm.d.ts +21 -0
- package/dist/ui/forms/namesForm.d.ts.map +1 -0
- package/dist/ui/forms/namesForm.js +127 -0
- package/dist/ui/forms/namesForm.js.map +1 -0
- package/dist/ui/forms/ruleForm.d.ts +20 -0
- package/dist/ui/forms/ruleForm.d.ts.map +1 -0
- package/dist/ui/forms/ruleForm.js +152 -0
- package/dist/ui/forms/ruleForm.js.map +1 -0
- package/dist/ui/forms/ruleForm.style.d.ts +3 -0
- package/dist/ui/forms/ruleForm.style.d.ts.map +1 -0
- package/dist/ui/forms/ruleForm.style.js +81 -0
- package/dist/ui/forms/ruleForm.style.js.map +1 -0
- package/dist/ui/forms/sparklineForm.d.ts +22 -0
- package/dist/ui/forms/sparklineForm.d.ts.map +1 -0
- package/dist/ui/forms/sparklineForm.js +202 -0
- package/dist/ui/forms/sparklineForm.js.map +1 -0
- package/dist/ui/forms/sparklineForm.style.d.ts +3 -0
- package/dist/ui/forms/sparklineForm.style.d.ts.map +1 -0
- package/dist/ui/forms/sparklineForm.style.js +97 -0
- package/dist/ui/forms/sparklineForm.style.js.map +1 -0
- package/dist/ui/forms/styleForm.d.ts +14 -0
- package/dist/ui/forms/styleForm.d.ts.map +1 -0
- package/dist/ui/forms/styleForm.js +150 -0
- package/dist/ui/forms/styleForm.js.map +1 -0
- package/dist/ui/formulabar.d.ts +23 -0
- package/dist/ui/formulabar.d.ts.map +1 -0
- package/dist/ui/formulabar.js +164 -0
- package/dist/ui/formulabar.js.map +1 -0
- package/dist/ui/formulabar.style.d.ts +2 -0
- package/dist/ui/formulabar.style.d.ts.map +1 -0
- package/dist/ui/formulabar.style.js +49 -0
- package/dist/ui/formulabar.style.js.map +1 -0
- package/dist/ui/gridStats.d.ts +11 -0
- package/dist/ui/gridStats.d.ts.map +1 -0
- package/dist/ui/gridStats.js +74 -0
- package/dist/ui/gridStats.js.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +25 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/statusbar.d.ts +19 -0
- package/dist/ui/statusbar.d.ts.map +1 -0
- package/dist/ui/statusbar.js +72 -0
- package/dist/ui/statusbar.js.map +1 -0
- package/dist/ui/toolbar.config.d.ts +6 -0
- package/dist/ui/toolbar.config.d.ts.map +1 -0
- package/dist/ui/toolbar.config.js +138 -0
- package/dist/ui/toolbar.config.js.map +1 -0
- package/dist/ui/toolbar.d.ts +37 -0
- package/dist/ui/toolbar.d.ts.map +1 -0
- package/dist/ui/toolbar.js +288 -0
- package/dist/ui/toolbar.js.map +1 -0
- package/dist/ui/toolbar.style.d.ts +2 -0
- package/dist/ui/toolbar.style.d.ts.map +1 -0
- package/dist/ui/toolbar.style.js +25 -0
- package/dist/ui/toolbar.style.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM;;;;;IAalD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEditorCommands = void 0;
|
|
4
|
+
function createEditorCommands(editor) {
|
|
5
|
+
const section = 'editor';
|
|
6
|
+
return [{ section, name: 'show controls', requiredParams: 0, fn: () => {
|
|
7
|
+
editor.toolbarDisabled = false;
|
|
8
|
+
editor.formulabarDisabled = false;
|
|
9
|
+
} }, { section, name: 'hide controls', requiredParams: 0, fn: () => {
|
|
10
|
+
editor.toolbarDisabled = true;
|
|
11
|
+
editor.formulabarDisabled = true;
|
|
12
|
+
} }, { section, name: 'show statusbar', requiredParams: 0, fn: () => {
|
|
13
|
+
editor.statusbarDisabled = false;
|
|
14
|
+
} }, { section, name: 'hide statusbar', requiredParams: 0, fn: () => {
|
|
15
|
+
editor.statusbarDisabled = true;
|
|
16
|
+
} }];
|
|
17
|
+
}
|
|
18
|
+
exports.createEditorCommands = createEditorCommands;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAC,MAAc;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;gBACpE,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC/B,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;YACnC,CAAC,EAAC,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;gBAChE,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;gBAC9B,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAClC,CAAC,EAAC,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;gBACjE,MAAM,CAAC,iBAAiB,GAAG,KAAK,CAAC;YAClC,CAAC,EAAC,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;gBACjE,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC;YACjC,CAAC,EAAC,CAAC,CAAC;AACL,CAAC;AAbD,oDAaC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ui"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAqB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommonOptions } from "@omegagrid/core";
|
|
2
|
+
export type Options = CommonOptions & {
|
|
3
|
+
commandWindow?: boolean;
|
|
4
|
+
editing?: {
|
|
5
|
+
headers?: boolean;
|
|
6
|
+
conditionalStyles?: boolean;
|
|
7
|
+
names?: boolean;
|
|
8
|
+
sparklines?: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function initOptions(options?: Partial<Options>, origOptions?: Options): Options;
|
|
12
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAS,MAAM,iBAAiB,CAAC;AAE1E,MAAM,MAAM,OAAO,GAAG,aAAa,GAAG;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,UAAU,CAAC,EAAE,OAAO,CAAA;KACpB,CAAA;CACD,CAAC;AAYF,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,GAAE,OAAc,GAAG,OAAO,CAE5F"}
|
package/dist/options.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initOptions = void 0;
|
|
4
|
+
const core_1 = require("@omegagrid/core");
|
|
5
|
+
const DEFAULT_OPTIONS = {
|
|
6
|
+
commandWindow: true,
|
|
7
|
+
editing: {
|
|
8
|
+
headers: true,
|
|
9
|
+
conditionalStyles: true,
|
|
10
|
+
names: true,
|
|
11
|
+
sparklines: true
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function initOptions(options, origOptions = null) {
|
|
15
|
+
return core_1.utils.mergeDeep({}, DEFAULT_OPTIONS, (0, core_1.initCommonOptions)(options, origOptions));
|
|
16
|
+
}
|
|
17
|
+
exports.initOptions = initOptions;
|
|
18
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;AAAA,0CAA0E;AAY1E,MAAM,eAAe,GAAqB;IACzC,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE;QACR,OAAO,EAAE,IAAI;QACb,iBAAiB,EAAE,IAAI;QACvB,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,IAAI;KAChB;CACD,CAAC;AAEF,SAAgB,WAAW,CAAC,OAA0B,EAAE,cAAuB,IAAI;IAClF,OAAO,YAAK,CAAC,SAAS,CAAC,EAAE,EAAE,eAAe,EAAE,IAAA,wBAAiB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AACtF,CAAC;AAFD,kCAEC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { actions, ComponentId, ComponentStore, Layout, ListSelectEvent, Menu, Overlay, Plugin, Plugins, SplitContainer } from '@omegagrid/core';
|
|
2
|
+
import { Commands } from '@omegagrid/commands';
|
|
3
|
+
import { ElementModel, Grid, GridEvent, GridGroup, GridModel, GroupModel, GroupModelSource, GridEditEvent, CellRange } from '@omegagrid/grid';
|
|
4
|
+
import { CommandWindow } from '@omegagrid/commands';
|
|
5
|
+
import { LitElement } from 'lit';
|
|
6
|
+
import { EditorFormula } from './formulabar';
|
|
7
|
+
import { EditorToolbar } from './toolbar';
|
|
8
|
+
import { TabEvent } from '@omegagrid/tabs';
|
|
9
|
+
import { EditorStatusbar } from './statusbar';
|
|
10
|
+
import { Options } from '../options';
|
|
11
|
+
export type SidebarComponent = LitElement & {
|
|
12
|
+
grid: Grid;
|
|
13
|
+
group: GridGroup;
|
|
14
|
+
model: GridModel;
|
|
15
|
+
range: CellRange;
|
|
16
|
+
};
|
|
17
|
+
export type SidebarComponentType = 'config' | 'headers' | 'rules' | 'sparklines' | 'names';
|
|
18
|
+
export declare class Editor extends LitElement implements Layout {
|
|
19
|
+
static styles: import("lit").CSSResult[];
|
|
20
|
+
formulaBar: EditorFormula;
|
|
21
|
+
container: SplitContainer;
|
|
22
|
+
toolbar: EditorToolbar;
|
|
23
|
+
statusbar: EditorStatusbar;
|
|
24
|
+
overlay: Overlay;
|
|
25
|
+
enableDrag: boolean;
|
|
26
|
+
model: GroupModel;
|
|
27
|
+
toolbarDisabled: boolean;
|
|
28
|
+
statusbarDisabled: boolean;
|
|
29
|
+
formulabarDisabled: boolean;
|
|
30
|
+
options: Options;
|
|
31
|
+
gridElement: ElementModel;
|
|
32
|
+
activeRange: CellRange;
|
|
33
|
+
rightSidebarComponent: SidebarComponentType;
|
|
34
|
+
activeGrid: Grid;
|
|
35
|
+
activeModel: GridModel;
|
|
36
|
+
gridContainer: GridGroup;
|
|
37
|
+
private commandWindowRef;
|
|
38
|
+
get commandWindow(): CommandWindow;
|
|
39
|
+
private tabMenuRef;
|
|
40
|
+
get tabMenu(): Menu;
|
|
41
|
+
private activeMenuSheet;
|
|
42
|
+
readonly plugins: Plugins<Editor>;
|
|
43
|
+
readonly commands: Commands;
|
|
44
|
+
readonly sidebarComponents: ComponentStore<SidebarComponent>;
|
|
45
|
+
constructor();
|
|
46
|
+
updateOptions(options: Partial<Options>): void;
|
|
47
|
+
_onDragover: (e: DragEvent) => void;
|
|
48
|
+
connectedCallback(): void;
|
|
49
|
+
willUpdate(props: Map<PropertyKey, unknown>): void;
|
|
50
|
+
updated(props: Map<PropertyKey, unknown>): void;
|
|
51
|
+
firstUpdated(): void;
|
|
52
|
+
updateComponents(): void;
|
|
53
|
+
setSourceData(sourceData: GroupModelSource): void;
|
|
54
|
+
getCommands(): Commands;
|
|
55
|
+
updateCommands(): void;
|
|
56
|
+
layout(): void;
|
|
57
|
+
updateSelectedRange(range: CellRange): void;
|
|
58
|
+
_onGridSelect: (e: GridEvent) => Promise<void>;
|
|
59
|
+
_onGridEdit: (e: GridEditEvent) => void;
|
|
60
|
+
registerPlugin(plugin: Plugin<Editor>): void;
|
|
61
|
+
_onTabContextMenu: (e: TabEvent) => void;
|
|
62
|
+
createGridContainer: () => GridGroup;
|
|
63
|
+
getGridContainer(): GridGroup;
|
|
64
|
+
createComponent: (index: ComponentId) => GridGroup | Promise<SidebarComponent>;
|
|
65
|
+
_onToolbarAction: (_e: actions.ActionEvent) => void;
|
|
66
|
+
_onCommandsOpen: () => void;
|
|
67
|
+
_onTabMenuItemSelect: (e: ListSelectEvent) => void;
|
|
68
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
69
|
+
}
|
|
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AAO,QAAQ,UAI/B;IAED,mBAAmB,kBAiBlB;IAED,gBAAgB;IAIhB,eAAe,UAAW,WAAW,2CAMpC;IAED,gBAAgB,OAAQ,QAAQ,WAAW,UAI1C;IAED,eAAe,aAEd;IAED,oBAAoB,MAAO,eAAe,UAWzC;IAED,MAAM,6CAgDJ;CAEF"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Editor = void 0;
|
|
10
|
+
const core_1 = require("@omegagrid/core");
|
|
11
|
+
const commands_1 = require("@omegagrid/commands");
|
|
12
|
+
const grid_1 = require("@omegagrid/grid");
|
|
13
|
+
const lit_1 = require("lit");
|
|
14
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
15
|
+
const guard_js_1 = require("lit/directives/guard.js");
|
|
16
|
+
const editor_style_1 = require("./editor.style");
|
|
17
|
+
const ref_js_1 = require("lit-html/directives/ref.js");
|
|
18
|
+
const commands_2 = require("../commands");
|
|
19
|
+
const options_1 = require("../options");
|
|
20
|
+
let Editor = class Editor extends lit_1.LitElement {
|
|
21
|
+
get commandWindow() { return this.commandWindowRef.value; }
|
|
22
|
+
get tabMenu() { return this.tabMenuRef.value; }
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.enableDrag = true;
|
|
26
|
+
this.toolbarDisabled = false;
|
|
27
|
+
this.statusbarDisabled = false;
|
|
28
|
+
this.formulabarDisabled = false;
|
|
29
|
+
this.options = (0, options_1.initOptions)();
|
|
30
|
+
this.commandWindowRef = (0, ref_js_1.createRef)();
|
|
31
|
+
this.tabMenuRef = (0, ref_js_1.createRef)();
|
|
32
|
+
this.plugins = new core_1.Plugins(this);
|
|
33
|
+
this.sidebarComponents = new core_1.ComponentStore((id) => {
|
|
34
|
+
let component;
|
|
35
|
+
switch (id) {
|
|
36
|
+
case 'config':
|
|
37
|
+
component = core_1.dom.createElement('og-editor-form-config');
|
|
38
|
+
break;
|
|
39
|
+
case 'headers':
|
|
40
|
+
component = core_1.dom.createElement('og-editor-form-headers');
|
|
41
|
+
break;
|
|
42
|
+
case 'rules':
|
|
43
|
+
component = core_1.dom.createElement('og-editor-form-rules');
|
|
44
|
+
break;
|
|
45
|
+
case 'sparklines':
|
|
46
|
+
component = core_1.dom.createElement('og-editor-form-sparklines');
|
|
47
|
+
break;
|
|
48
|
+
case 'names':
|
|
49
|
+
component = core_1.dom.createElement('og-editor-form-names');
|
|
50
|
+
break;
|
|
51
|
+
default: return null;
|
|
52
|
+
}
|
|
53
|
+
if (this.activeGrid) {
|
|
54
|
+
component.grid = this.activeGrid;
|
|
55
|
+
component.range = this.activeGrid.selection.range;
|
|
56
|
+
}
|
|
57
|
+
if (this.activeModel)
|
|
58
|
+
component.model = this.activeModel;
|
|
59
|
+
if (this.gridContainer)
|
|
60
|
+
component.group = this.gridContainer;
|
|
61
|
+
return component;
|
|
62
|
+
});
|
|
63
|
+
this._onDragover = (e) => {
|
|
64
|
+
if (!this.enableDrag)
|
|
65
|
+
return;
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
if (e.dataTransfer.types[0] == 'Files') {
|
|
69
|
+
e.dataTransfer.dropEffect = 'move';
|
|
70
|
+
this.overlay.text = 'drop file';
|
|
71
|
+
this.overlay.show(this);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this._onGridSelect = async (e) => {
|
|
75
|
+
if (this.gridContainer.isFormulaMode)
|
|
76
|
+
return;
|
|
77
|
+
this.activeGrid = e.composedPath().find(elm => elm instanceof grid_1.Grid);
|
|
78
|
+
if (this.rightSidebarComponent == 'headers') {
|
|
79
|
+
const headerForm = await this.sidebarComponents.get('headers');
|
|
80
|
+
headerForm.grid = this.activeGrid;
|
|
81
|
+
headerForm.range = this.activeGrid.selection.range.clone();
|
|
82
|
+
}
|
|
83
|
+
this.updateSelectedRange(e.selection.range);
|
|
84
|
+
};
|
|
85
|
+
this._onGridEdit = (e) => {
|
|
86
|
+
switch (e.editType) {
|
|
87
|
+
case 'delete_column':
|
|
88
|
+
case 'delete_row':
|
|
89
|
+
case 'insert_column':
|
|
90
|
+
case 'insert_row':
|
|
91
|
+
this.updateSelectedRange(e.selection.range);
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this._onTabContextMenu = (e) => {
|
|
96
|
+
const uiEvent = e.uiEvent;
|
|
97
|
+
this.activeMenuSheet = e.tab.id;
|
|
98
|
+
this.tabMenu.openAt(uiEvent.pageX, uiEvent.pageY + 1);
|
|
99
|
+
};
|
|
100
|
+
this.createGridContainer = () => {
|
|
101
|
+
const container = core_1.dom.createElement('og-gridgroup');
|
|
102
|
+
container.tabPosition = 'bottom';
|
|
103
|
+
container.designMode = true;
|
|
104
|
+
container.model = this.model;
|
|
105
|
+
container.options.commandWindow = false;
|
|
106
|
+
container.addEventListener('gridgroup.activate', e => {
|
|
107
|
+
var _a;
|
|
108
|
+
if (this.gridContainer.isFormulaMode)
|
|
109
|
+
return;
|
|
110
|
+
this.activeGrid = e.target.activeGrid;
|
|
111
|
+
this.activeModel = (_a = this.activeGrid) === null || _a === void 0 ? void 0 : _a.model;
|
|
112
|
+
this.updateCommands();
|
|
113
|
+
this.updateComponents();
|
|
114
|
+
});
|
|
115
|
+
container.addEventListener('tab.contextmenu', this._onTabContextMenu);
|
|
116
|
+
container.addEventListener('grid.select', this._onGridSelect);
|
|
117
|
+
container.addEventListener('grid.edit', this._onGridEdit);
|
|
118
|
+
return container;
|
|
119
|
+
};
|
|
120
|
+
this.createComponent = (index) => {
|
|
121
|
+
if (index == 0) {
|
|
122
|
+
return this.getGridContainer();
|
|
123
|
+
}
|
|
124
|
+
else if (index == 1) {
|
|
125
|
+
return this.sidebarComponents.get(this.rightSidebarComponent);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
this._onToolbarAction = (_e) => {
|
|
129
|
+
// if (e.action.key == 'config') {
|
|
130
|
+
// this.rightSidebarComponent = e.action.value ? e.action.key : null;
|
|
131
|
+
// }
|
|
132
|
+
};
|
|
133
|
+
this._onCommandsOpen = () => {
|
|
134
|
+
// this.commandWindow.requestUpdate();
|
|
135
|
+
};
|
|
136
|
+
this._onTabMenuItemSelect = (e) => {
|
|
137
|
+
switch (this.tabMenu.items[e.index].key) {
|
|
138
|
+
case 'properties':
|
|
139
|
+
this.activeModel = this.gridContainer.model.get(this.activeMenuSheet);
|
|
140
|
+
this.activeGrid = this.gridContainer.grids.get(this.activeMenuSheet);
|
|
141
|
+
this.rightSidebarComponent = 'config';
|
|
142
|
+
break;
|
|
143
|
+
case 'delete':
|
|
144
|
+
this.gridContainer.deleteModel(this.activeMenuSheet);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
this.render = () => (0, lit_1.html) `
|
|
149
|
+
${this.toolbarDisabled ? '' : (0, lit_1.html) `
|
|
150
|
+
<og-editor-toolbar
|
|
151
|
+
.grid="${this.activeGrid}"
|
|
152
|
+
.gridElement=${this.gridElement}
|
|
153
|
+
.editor="${this}"
|
|
154
|
+
@toolbar.action="${this._onToolbarAction}">
|
|
155
|
+
</og-editor-toolbar>
|
|
156
|
+
`}
|
|
157
|
+
|
|
158
|
+
${this.toolbarDisabled ? '' : (0, lit_1.html) `
|
|
159
|
+
<og-editor-formula .grid="${this.activeGrid}"></og-editor-formula>
|
|
160
|
+
`}
|
|
161
|
+
|
|
162
|
+
${(0, guard_js_1.guard)([this.rightSidebarComponent], () => (0, lit_1.html) `
|
|
163
|
+
<og-splitcontainer
|
|
164
|
+
.items="${[{}, { size: 300, collapsed: !this.rightSidebarComponent }]}"
|
|
165
|
+
.createComponent="${this.createComponent}">
|
|
166
|
+
</og-splitcontainer>
|
|
167
|
+
`)}
|
|
168
|
+
|
|
169
|
+
${this.statusbarDisabled ? '' : (0, lit_1.html) `
|
|
170
|
+
<og-editor-statusbar
|
|
171
|
+
.group="${this.getGridContainer()}"
|
|
172
|
+
.grid="${this.activeGrid}"
|
|
173
|
+
.range="${this.activeRange}">
|
|
174
|
+
</og-editor-statusbar>
|
|
175
|
+
`}
|
|
176
|
+
|
|
177
|
+
${this.options.commandWindow ? (0, lit_1.html) `
|
|
178
|
+
<og-commands ${(0, ref_js_1.ref)(this.commandWindowRef)}
|
|
179
|
+
style="display: none"
|
|
180
|
+
.commands="${this.getCommands()}"
|
|
181
|
+
.target="${this}"
|
|
182
|
+
@command.open="${this._onCommandsOpen}">
|
|
183
|
+
</og-commands>
|
|
184
|
+
` : ``}
|
|
185
|
+
|
|
186
|
+
<og-menu ${(0, ref_js_1.ref)(this.tabMenuRef)}
|
|
187
|
+
style="display: none; z-index: 2000"
|
|
188
|
+
@select=${this._onTabMenuItemSelect}
|
|
189
|
+
.items=${[
|
|
190
|
+
{ key: 'properties', value: 'Properties', icon: 'pen' },
|
|
191
|
+
{ key: 'delete', value: 'Delete', icon: 'trash' },
|
|
192
|
+
]}>
|
|
193
|
+
</og-menu>
|
|
194
|
+
|
|
195
|
+
<og-overlay striped></og-overlay>
|
|
196
|
+
`;
|
|
197
|
+
this.commands = new commands_1.Commands((0, commands_2.createEditorCommands)(this));
|
|
198
|
+
this.addEventListener('dragover', this._onDragover);
|
|
199
|
+
this.addEventListener('dragleave', () => this.overlay.hide());
|
|
200
|
+
this.addEventListener('drop', () => this.overlay.hide());
|
|
201
|
+
}
|
|
202
|
+
updateOptions(options) {
|
|
203
|
+
this.options = (0, options_1.initOptions)(options, this.options);
|
|
204
|
+
this.requestUpdate();
|
|
205
|
+
}
|
|
206
|
+
connectedCallback() {
|
|
207
|
+
super.connectedCallback();
|
|
208
|
+
this.tabIndex = 0;
|
|
209
|
+
}
|
|
210
|
+
willUpdate(props) {
|
|
211
|
+
if (props.has('model'))
|
|
212
|
+
this.gridContainer = null;
|
|
213
|
+
}
|
|
214
|
+
updated(props) {
|
|
215
|
+
this.updateComponents();
|
|
216
|
+
if (props.has('toolbarDisabled') || props.has('formulabarDisabled'))
|
|
217
|
+
this.layout();
|
|
218
|
+
}
|
|
219
|
+
firstUpdated() {
|
|
220
|
+
this.dispatchEvent(new Event('editor.init'));
|
|
221
|
+
}
|
|
222
|
+
updateComponents() {
|
|
223
|
+
this.sidebarComponents.items.forEach(c => {
|
|
224
|
+
c.grid = this.activeGrid;
|
|
225
|
+
c.model = this.activeModel;
|
|
226
|
+
c.group = this.gridContainer;
|
|
227
|
+
c.range = this.activeGrid.selection.range.clone();
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
setSourceData(sourceData) {
|
|
231
|
+
var _a, _b, _c;
|
|
232
|
+
const container = this.getGridContainer();
|
|
233
|
+
container.setSourceData(sourceData);
|
|
234
|
+
this.activeGrid = (_b = (_a = this.gridContainer) === null || _a === void 0 ? void 0 : _a.grids) === null || _b === void 0 ? void 0 : _b.entries().next().value;
|
|
235
|
+
this.activeModel = (_c = this.activeGrid) === null || _c === void 0 ? void 0 : _c.model;
|
|
236
|
+
}
|
|
237
|
+
getCommands() { return this.gridContainer ? this.commands.merge(this.gridContainer.commands) : this.commands; }
|
|
238
|
+
updateCommands() {
|
|
239
|
+
if (this.commandWindow)
|
|
240
|
+
this.commandWindow.commands = this.getCommands();
|
|
241
|
+
}
|
|
242
|
+
layout() {
|
|
243
|
+
this.container.layout();
|
|
244
|
+
}
|
|
245
|
+
updateSelectedRange(range) {
|
|
246
|
+
if (range.isColumn) {
|
|
247
|
+
this.gridElement = this.activeGrid.model.columns[this.activeGrid.selection.range.c1];
|
|
248
|
+
}
|
|
249
|
+
else if (range.isRow) {
|
|
250
|
+
this.gridElement = this.activeGrid.model.rows[this.activeGrid.selection.range.r1];
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.gridElement = this.activeGrid.selecting.activeCell;
|
|
254
|
+
}
|
|
255
|
+
this.statusbar.grid = this.activeGrid;
|
|
256
|
+
this.statusbar.range = range.clone();
|
|
257
|
+
}
|
|
258
|
+
registerPlugin(plugin) {
|
|
259
|
+
this.plugins.register(plugin).init();
|
|
260
|
+
}
|
|
261
|
+
getGridContainer() {
|
|
262
|
+
var _a;
|
|
263
|
+
return (_a = this.gridContainer) !== null && _a !== void 0 ? _a : (this.gridContainer = this.createGridContainer());
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
exports.Editor = Editor;
|
|
267
|
+
Editor.styles = [editor_style_1.style];
|
|
268
|
+
__decorate([
|
|
269
|
+
(0, decorators_js_1.query)('og-editor-formula')
|
|
270
|
+
], Editor.prototype, "formulaBar", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
(0, decorators_js_1.query)('og-splitcontainer')
|
|
273
|
+
], Editor.prototype, "container", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, decorators_js_1.query)('og-editor-toolbar')
|
|
276
|
+
], Editor.prototype, "toolbar", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
(0, decorators_js_1.query)('og-editor-statusbar')
|
|
279
|
+
], Editor.prototype, "statusbar", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, decorators_js_1.query)('og-overlay')
|
|
282
|
+
], Editor.prototype, "overlay", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
285
|
+
], Editor.prototype, "enableDrag", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
(0, decorators_js_1.property)({ type: Object })
|
|
288
|
+
], Editor.prototype, "model", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
291
|
+
], Editor.prototype, "toolbarDisabled", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
294
|
+
], Editor.prototype, "statusbarDisabled", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
297
|
+
], Editor.prototype, "formulabarDisabled", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
(0, decorators_js_1.property)({ type: Object })
|
|
300
|
+
], Editor.prototype, "options", void 0);
|
|
301
|
+
__decorate([
|
|
302
|
+
(0, decorators_js_1.state)()
|
|
303
|
+
], Editor.prototype, "gridElement", void 0);
|
|
304
|
+
__decorate([
|
|
305
|
+
(0, decorators_js_1.state)()
|
|
306
|
+
], Editor.prototype, "activeRange", void 0);
|
|
307
|
+
__decorate([
|
|
308
|
+
(0, decorators_js_1.state)()
|
|
309
|
+
], Editor.prototype, "rightSidebarComponent", void 0);
|
|
310
|
+
__decorate([
|
|
311
|
+
(0, decorators_js_1.state)()
|
|
312
|
+
], Editor.prototype, "activeGrid", void 0);
|
|
313
|
+
__decorate([
|
|
314
|
+
(0, decorators_js_1.state)()
|
|
315
|
+
], Editor.prototype, "activeModel", void 0);
|
|
316
|
+
exports.Editor = Editor = __decorate([
|
|
317
|
+
(0, decorators_js_1.customElement)('og-editor'),
|
|
318
|
+
(0, core_1.stylable)({ vars: ['accent-color', 'font-*', 'background-*', 'text-*'] })
|
|
319
|
+
], Editor);
|
|
320
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/ui/editor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAGyB;AACzB,kDAA+C;AAC/C,0CAA8I;AAE9I,6BAAuC;AACvC,qDAA0E;A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KAAK,yBAmCjB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.style = void 0;
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
exports.style = (0, lit_1.css) `
|
|
6
|
+
:host {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
position: relative;
|
|
11
|
+
-webkit-user-select: none;
|
|
12
|
+
user-select: none;
|
|
13
|
+
height: 100%;
|
|
14
|
+
color: var(--text-color);
|
|
15
|
+
background-color: var(--background-color);
|
|
16
|
+
font-family: var(--font-family);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.toolbar {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
og-splitcontainer {
|
|
25
|
+
flex: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
og-editor-toolbar, og-editor-formula {
|
|
29
|
+
flex: 0;
|
|
30
|
+
//min-height: 30px;
|
|
31
|
+
height: 30px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
og-overlay {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
//pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
//# sourceMappingURL=editor.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.style.js","sourceRoot":"","sources":["../../src/ui/editor.style.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAEb,QAAA,KAAK,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCvB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GridGroup } from '@omegagrid/grid';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { SlideEvent, Slider } from '@omegagrid/core';
|
|
4
|
+
export declare class EditorZoom extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
group: GridGroup;
|
|
7
|
+
slider: Slider;
|
|
8
|
+
translateValue(value: number): number;
|
|
9
|
+
updateText(value: number): void;
|
|
10
|
+
_onSlideStart: (_e: SlideEvent) => void;
|
|
11
|
+
_onSlide: (e: SlideEvent) => void;
|
|
12
|
+
_onSlideEnd: (e: SlideEvent) => void;
|
|
13
|
+
updated(): Promise<void>;
|
|
14
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=editorZoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorZoom.d.ts","sourceRoot":"","sources":["../../src/ui/editorZoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAErD,qBACa,UAAW,SAAQ,UAAU;IAEzC,MAAM,CAAC,MAAM,4BAeV;IAGH,KAAK,EAAE,SAAS,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAEf,cAAc,CAAC,KAAK,EAAE,MAAM;IAI5B,UAAU,CAAC,KAAK,EAAE,MAAM;IAIxB,aAAa,OAAQ,UAAU,UAE9B;IAED,QAAQ,MAAO,UAAU,UAGxB;IAED,WAAW,MAAO,UAAU,UAK3B;IAEK,OAAO;IAYb,MAAM,6CAYJ;CAEF"}
|