@omegagrid/editor 0.10.2 → 0.10.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 +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +34 -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 +2 -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 +14 -0
- package/dist/options.js.map +1 -0
- package/dist/ui/editor.d.ts +76 -0
- package/dist/ui/editor.d.ts.map +1 -0
- package/dist/ui/editor.js +338 -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 +38 -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 +82 -0
- package/dist/ui/editorZoom.js.map +1 -0
- package/dist/ui/editors/hyperlinkEditor.d.ts +10 -0
- package/dist/ui/editors/hyperlinkEditor.d.ts.map +1 -0
- package/dist/ui/editors/hyperlinkEditor.js +70 -0
- package/dist/ui/editors/hyperlinkEditor.js.map +1 -0
- package/dist/ui/editors/index.d.ts +6 -0
- package/dist/ui/editors/index.d.ts.map +1 -0
- package/dist/ui/editors/index.js +6 -0
- package/dist/ui/editors/index.js.map +1 -0
- package/dist/ui/editors/ruleEditor.d.ts +27 -0
- package/dist/ui/editors/ruleEditor.d.ts.map +1 -0
- package/dist/ui/editors/ruleEditor.js +251 -0
- package/dist/ui/editors/ruleEditor.js.map +1 -0
- package/dist/ui/editors/styleEditor.d.ts +14 -0
- package/dist/ui/editors/styleEditor.d.ts.map +1 -0
- package/dist/ui/editors/styleEditor.js +160 -0
- package/dist/ui/editors/styleEditor.js.map +1 -0
- package/dist/ui/editors/themeEditor.d.ts +24 -0
- package/dist/ui/editors/themeEditor.d.ts.map +1 -0
- package/dist/ui/editors/themeEditor.js +138 -0
- package/dist/ui/editors/themeEditor.js.map +1 -0
- package/dist/ui/editors/themeItemEditor.d.ts +22 -0
- package/dist/ui/editors/themeItemEditor.d.ts.map +1 -0
- package/dist/ui/editors/themeItemEditor.js +181 -0
- package/dist/ui/editors/themeItemEditor.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 +101 -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 +144 -0
- package/dist/ui/forms/headerForm.js.map +1 -0
- package/dist/ui/forms/index.d.ts +9 -0
- package/dist/ui/forms/index.d.ts.map +1 -0
- package/dist/ui/forms/index.js +9 -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 +124 -0
- package/dist/ui/forms/namesForm.js.map +1 -0
- package/dist/ui/forms/ruleForm.d.ts +13 -0
- package/dist/ui/forms/ruleForm.d.ts.map +1 -0
- package/dist/ui/forms/ruleForm.js +56 -0
- package/dist/ui/forms/ruleForm.js.map +1 -0
- package/dist/ui/forms/ruleForm.style.d.ts +2 -0
- package/dist/ui/forms/ruleForm.style.d.ts.map +1 -0
- package/dist/ui/forms/ruleForm.style.js +50 -0
- package/dist/ui/forms/ruleForm.style.js.map +1 -0
- package/dist/ui/forms/ruleFormThreshold.d.ts +19 -0
- package/dist/ui/forms/ruleFormThreshold.d.ts.map +1 -0
- package/dist/ui/forms/ruleFormThreshold.js +97 -0
- package/dist/ui/forms/ruleFormThreshold.js.map +1 -0
- package/dist/ui/forms/ruleList.d.ts +25 -0
- package/dist/ui/forms/ruleList.d.ts.map +1 -0
- package/dist/ui/forms/ruleList.js +169 -0
- package/dist/ui/forms/ruleList.js.map +1 -0
- package/dist/ui/forms/ruleList.style.d.ts +3 -0
- package/dist/ui/forms/ruleList.style.d.ts.map +1 -0
- package/dist/ui/forms/ruleList.style.js +69 -0
- package/dist/ui/forms/ruleList.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 +199 -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 +94 -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 +151 -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 +155 -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 +48 -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 +71 -0
- package/dist/ui/gridStats.js.map +1 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +11 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/sidebars/baseSidebar.d.ts +10 -0
- package/dist/ui/sidebars/baseSidebar.d.ts.map +1 -0
- package/dist/ui/sidebars/baseSidebar.js +24 -0
- package/dist/ui/sidebars/baseSidebar.js.map +1 -0
- package/dist/ui/sidebars/index.d.ts +2 -0
- package/dist/ui/sidebars/index.d.ts.map +1 -0
- package/dist/ui/sidebars/index.js +2 -0
- package/dist/ui/sidebars/index.js.map +1 -0
- package/dist/ui/sidebars/themeEditorSidebar.d.ts +14 -0
- package/dist/ui/sidebars/themeEditorSidebar.d.ts.map +1 -0
- package/dist/ui/sidebars/themeEditorSidebar.js +110 -0
- package/dist/ui/sidebars/themeEditorSidebar.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 +69 -0
- package/dist/ui/statusbar.js.map +1 -0
- package/dist/ui/toolbar.config.d.ts +7 -0
- package/dist/ui/toolbar.config.d.ts.map +1 -0
- package/dist/ui/toolbar.config.js +166 -0
- package/dist/ui/toolbar.config.js.map +1 -0
- package/dist/ui/toolbar.d.ts +42 -0
- package/dist/ui/toolbar.d.ts.map +1 -0
- package/dist/ui/toolbar.js +356 -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 +22 -0
- package/dist/ui/toolbar.style.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { dom } from '@omegagrid/core';
|
|
10
|
+
const rightItems = [
|
|
11
|
+
{ type: 'custom', id: 'stats' },
|
|
12
|
+
{ type: 'custom', id: 'zoom' },
|
|
13
|
+
// {type: 'button', id: 'btn1', text: 'item1', icon: 'book'},
|
|
14
|
+
// {type: 'button', id: 'btn2', text: 'item2', icon: 'book'},
|
|
15
|
+
];
|
|
16
|
+
const componentFactories = new Map([
|
|
17
|
+
['stats', (group) => {
|
|
18
|
+
const zoom = dom.createElement('og-editor-gridstats');
|
|
19
|
+
zoom.group = group;
|
|
20
|
+
return zoom;
|
|
21
|
+
}],
|
|
22
|
+
['zoom', (group) => {
|
|
23
|
+
const zoom = dom.createElement('og-editor-zoom');
|
|
24
|
+
zoom.group = group;
|
|
25
|
+
return zoom;
|
|
26
|
+
}]
|
|
27
|
+
]);
|
|
28
|
+
let EditorStatusbar = class EditorStatusbar extends LitElement {
|
|
29
|
+
constructor() {
|
|
30
|
+
//static styles = [style];
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.components = new Map();
|
|
33
|
+
this._onGridEdit = (_e) => {
|
|
34
|
+
// this.updateToolbar();
|
|
35
|
+
};
|
|
36
|
+
this.createComponent = (id) => {
|
|
37
|
+
if (!this.components.has(id))
|
|
38
|
+
this.components.set(id, componentFactories.get(id)(this.group));
|
|
39
|
+
return this.components.get(id);
|
|
40
|
+
};
|
|
41
|
+
this.render = () => html `
|
|
42
|
+
<og-statusbar
|
|
43
|
+
.rightItems="${rightItems}"
|
|
44
|
+
.createComponent="${this.createComponent}">
|
|
45
|
+
</og-statusbar>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
willUpdate(_props) {
|
|
49
|
+
this.components.forEach(c => {
|
|
50
|
+
c.group = this.group;
|
|
51
|
+
c.grid = this.grid;
|
|
52
|
+
c.range = this.range;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
__decorate([
|
|
57
|
+
property({ type: Object })
|
|
58
|
+
], EditorStatusbar.prototype, "group", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ type: Object })
|
|
61
|
+
], EditorStatusbar.prototype, "grid", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
property({ type: Object })
|
|
64
|
+
], EditorStatusbar.prototype, "range", void 0);
|
|
65
|
+
EditorStatusbar = __decorate([
|
|
66
|
+
customElement('og-editor-statusbar')
|
|
67
|
+
], EditorStatusbar);
|
|
68
|
+
export { EditorStatusbar };
|
|
69
|
+
//# sourceMappingURL=statusbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusbar.js","sourceRoot":"","sources":["../../src/ui/statusbar.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAe,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,UAAU,GAAoB;IACnC,EAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAC;IAC7B,EAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAC;IAC5B,6DAA6D;IAC7D,6DAA6D;CAC7D,CAAC;AAEF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAiD;IAClF,CAAC,OAAO,EAAE,CAAC,KAAgB,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,aAAa,CAAa,qBAAqB,CAAC,CAAC;YAClE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;IACF,CAAC,MAAM,EAAE,CAAC,KAAgB,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,aAAa,CAAa,gBAAgB,CAAC,CAAC;YAC7D,IAAI,CAAC,KAAK,GAAG,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a,CAAC,qBAAqB,CAAC;GACxB,eAAe,CAuC3B","sourcesContent":["import { CellRange, Grid, GridEditEvent, GridGroup } from '@omegagrid/grid';\nimport { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { StatusbarItem } from '@omegagrid/statusbar';\nimport { ComponentId, dom } from '@omegagrid/core';\nimport { EditorZoom } from './editorZoom';\n\nconst rightItems: StatusbarItem[] = [\n\t{type: 'custom', id: 'stats'},\n\t{type: 'custom', id: 'zoom'},\n\t// {type: 'button', id: 'btn1', text: 'item1', icon: 'book'},\n\t// {type: 'button', id: 'btn2', text: 'item2', icon: 'book'},\n];\n\nconst componentFactories = new Map<ComponentId, (group: GridGroup) => HTMLElement>([\n\t['stats', (group: GridGroup) => {\n\t\tconst zoom = dom.createElement<EditorZoom>('og-editor-gridstats');\n\t\tzoom.group = group;\n\t\treturn zoom;\n\t}],\n\t['zoom', (group: GridGroup) => {\n\t\tconst zoom = dom.createElement<EditorZoom>('og-editor-zoom');\n\t\tzoom.group = group;\n\t\treturn zoom;\n\t}]\n]);\n\nexport type StatusBarComponent = HTMLElement & {group: GridGroup, grid: Grid, range: CellRange};\n\n@customElement('og-editor-statusbar')\nexport class EditorStatusbar extends LitElement {\n\n\t//static styles = [style];\n\n\tcomponents = new Map<ComponentId, StatusBarComponent>();\n\n\t@property({type: Object})\n\tgroup: GridGroup;\n\n\t@property({type: Object})\n\tgrid: Grid;\n\n\t@property({type: Object})\n\trange: CellRange;\n\n\t_onGridEdit = (_e: GridEditEvent) => {\n\t\t// this.updateToolbar();\n\t}\n\n\twillUpdate(_props: Map<PropertyKey, unknown>) {\n\t\tthis.components.forEach(c => {\n\t\t\tc.group = this.group;\n\t\t\tc.grid = this.grid;\n\t\t\tc.range = this.range;\n\t\t});\n\t}\n\n\tcreateComponent = (id: ComponentId) => {\n\t\tif (!this.components.has(id)) this.components.set(id, componentFactories.get(id)(this.group) as StatusBarComponent);\n\t\treturn this.components.get(id);\n\t};\n\t\n\trender = () => html`\n\t\t<og-statusbar\n\t\t\t.rightItems=\"${rightItems}\"\n\t\t\t.createComponent=\"${this.createComponent}\">\n\t\t</og-statusbar>\n\t`;\n\n}"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ToolbarItem } from "@omegagrid/toolbar";
|
|
2
|
+
export declare const createBorderIcon: (border: "top" | "right" | "left" | "bottom" | "bottom-double" | "bottom-thick" | "top-bottom" | "top-bottom-thick" | "all" | "none" | "outside" | "outside-thick") => import("lit-html").TemplateResult<1>;
|
|
3
|
+
export declare const toolbar1Config: ToolbarItem[];
|
|
4
|
+
export declare const toolbar2Config: ToolbarItem[];
|
|
5
|
+
export declare const toolbar3Config: ToolbarItem[];
|
|
6
|
+
export declare const toolbar4Config: ToolbarItem[];
|
|
7
|
+
//# sourceMappingURL=toolbar.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.config.d.ts","sourceRoot":"","sources":["../../src/ui/toolbar.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKjD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,KAAK,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,eAAe,GAAC,cAAc,GAAC,YAAY,GAAC,kBAAkB,GAAC,KAAK,GAAC,MAAM,GAAC,SAAS,GAAC,eAAe,yCA2E3K,CAAA;AAqBD,eAAO,MAAM,cAAc,EAAE,WAAW,EAoDvC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,EAGvC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,EAKvC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,EAEvC,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { dom } from "@omegagrid/core";
|
|
2
|
+
import { html } from "lit-html";
|
|
3
|
+
import { styleMap } from "lit-html/directives/style-map.js";
|
|
4
|
+
export const createBorderIcon = (border) => {
|
|
5
|
+
const borderWidth = ['outside-thick', 'bottom-thick'].indexOf(border) > -1 ? '2px' : '1.5px';
|
|
6
|
+
const style = {
|
|
7
|
+
boxSizing: 'border-box',
|
|
8
|
+
width: "15px",
|
|
9
|
+
height: "15px",
|
|
10
|
+
marginLeft: "2px",
|
|
11
|
+
borderWidth: '1px',
|
|
12
|
+
borderColor: 'var(--og-text-color-2)',
|
|
13
|
+
borderStyle: 'dotted',
|
|
14
|
+
position: 'relative',
|
|
15
|
+
};
|
|
16
|
+
if (border == 'top' || border == 'top-bottom' || border == 'top-bottom-thick' || border == 'all' || border == 'outside' || border == 'outside-thick') {
|
|
17
|
+
style.borderTopStyle = 'solid';
|
|
18
|
+
style.borderTopWidth = borderWidth;
|
|
19
|
+
}
|
|
20
|
+
if (border == 'right' || border == 'all' || border == 'outside' || border == 'outside-thick') {
|
|
21
|
+
style.borderRightStyle = 'solid';
|
|
22
|
+
style.borderRightWidth = borderWidth;
|
|
23
|
+
}
|
|
24
|
+
if (border == 'bottom' || border == 'top-bottom' || border == 'all' || border == 'outside' || border == 'outside-thick') {
|
|
25
|
+
style.borderBottomStyle = 'solid';
|
|
26
|
+
style.borderBottomWidth = borderWidth;
|
|
27
|
+
}
|
|
28
|
+
if (border == 'bottom-double') {
|
|
29
|
+
style.borderBottomStyle = 'double';
|
|
30
|
+
style.borderBottomWidth = '2px';
|
|
31
|
+
}
|
|
32
|
+
if (border == 'bottom-thick' || border == 'top-bottom-thick') {
|
|
33
|
+
style.borderBottomStyle = 'solid';
|
|
34
|
+
style.borderBottomWidth = '2px';
|
|
35
|
+
}
|
|
36
|
+
if (border == 'left' || border == 'all' || border == 'outside' || border == 'outside-thick') {
|
|
37
|
+
style.borderLeftStyle = 'solid';
|
|
38
|
+
style.borderLeftWidth = borderWidth;
|
|
39
|
+
}
|
|
40
|
+
style.position = 'relative';
|
|
41
|
+
style.left = '-2px';
|
|
42
|
+
const insideStyle1 = {
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
width: '100%',
|
|
45
|
+
height: '50%',
|
|
46
|
+
top: '0',
|
|
47
|
+
left: '0',
|
|
48
|
+
borderColor: 'var(--og-text-color-2)',
|
|
49
|
+
borderWidth: border == 'all' ? borderWidth : '1px',
|
|
50
|
+
borderBottomStyle: border == 'all' ? 'solid' : 'dotted'
|
|
51
|
+
};
|
|
52
|
+
const insideStyle2 = {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
width: '50%',
|
|
55
|
+
height: '100%',
|
|
56
|
+
top: '0',
|
|
57
|
+
left: '0',
|
|
58
|
+
borderColor: 'var(--og-text-color-2)',
|
|
59
|
+
borderWidth: border == 'all' ? borderWidth : '1px',
|
|
60
|
+
borderRightStyle: border == 'all' ? 'solid' : 'dotted'
|
|
61
|
+
};
|
|
62
|
+
return html `
|
|
63
|
+
<div style="${styleMap(style)}">
|
|
64
|
+
<div style="${styleMap(insideStyle1)}"></div>
|
|
65
|
+
<div style="${styleMap(insideStyle2)}"></div>
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
69
|
+
const cellTypes = [
|
|
70
|
+
['General', 'g'],
|
|
71
|
+
['Text', 't'],
|
|
72
|
+
['Number', 'n'],
|
|
73
|
+
['Date', 'd'],
|
|
74
|
+
['DateTime', 'dt'],
|
|
75
|
+
['Time', 'tm'],
|
|
76
|
+
['Checkbox', 'b'],
|
|
77
|
+
// ['Select', 's'],
|
|
78
|
+
// ['MultiSelect', 'm'],
|
|
79
|
+
];
|
|
80
|
+
const predefinedFormats = ['#,0.0', '#,0.00', '#,0.000', '0%', '0.0%', '0.00%', '0.000%'];
|
|
81
|
+
const fontSizes = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26].map(sz => ({
|
|
82
|
+
k: sz.toString(),
|
|
83
|
+
v: sz.toString(),
|
|
84
|
+
}));
|
|
85
|
+
export const toolbar1Config = [
|
|
86
|
+
{ type: 'button', id: 'undo', icon: { icon: 'rotate-left' } },
|
|
87
|
+
{ type: 'button', id: 'redo', icon: { icon: 'rotate-right' } },
|
|
88
|
+
{ type: 'togglebutton', id: 'bold', icon: { icon: 'bold' } },
|
|
89
|
+
{ type: 'togglebutton', id: 'italic', icon: { icon: 'italic' } },
|
|
90
|
+
{ type: 'togglebutton', id: 'underline', icon: { icon: 'underline' } },
|
|
91
|
+
{ type: 'text', id: 'sz', width: 40, items: fontSizes, placeholder: '' },
|
|
92
|
+
{ type: 'dropdown-button', id: 'alignment', items: [[
|
|
93
|
+
{ type: 'button', id: 'alignTopLeft', value: { vertical: 'top', horizontal: 'left' }, icon: { icon: 'align-right', rotation: 180 } },
|
|
94
|
+
{ type: 'button', id: 'alignTopCenter', value: { vertical: 'top', horizontal: 'center' }, icon: { icon: 'align-center' } },
|
|
95
|
+
{ type: 'button', id: 'alignTopRight', value: { vertical: 'top', horizontal: 'right' }, icon: { icon: 'align-left', rotation: 180 } },
|
|
96
|
+
], [
|
|
97
|
+
{ type: 'button', id: 'alignCenterLeft', value: { vertical: 'center', horizontal: 'left' }, icon: { icon: 'align-left' } },
|
|
98
|
+
{ type: 'button', id: 'alignCenterCenter', value: { vertical: 'center', horizontal: 'center' }, icon: { icon: 'align-center' } },
|
|
99
|
+
{ type: 'button', id: 'alignCenterRight', value: { vertical: 'center', horizontal: 'right' }, default: true, icon: { icon: 'align-right' } },
|
|
100
|
+
], [
|
|
101
|
+
{ type: 'button', id: 'alignBottomLeft', value: { vertical: 'bottom', horizontal: 'left' }, icon: { icon: 'align-left' } },
|
|
102
|
+
{ type: 'button', id: 'alignBottomCenter', value: { vertical: 'bottom', horizontal: 'center' }, icon: { icon: 'align-center' } },
|
|
103
|
+
{ type: 'button', id: 'alignBottomRight', value: { vertical: 'bottom', horizontal: 'right' }, icon: { icon: 'align-right' } },
|
|
104
|
+
]] },
|
|
105
|
+
{ type: 'dropdown', id: 'type', width: 80, items: cellTypes.map(([v, k]) => ({ k: k, v: v })) },
|
|
106
|
+
{ type: 'text', id: 'format', width: 100, items: predefinedFormats.map(f => ({ k: f, v: f })), placeholder: '<format>' },
|
|
107
|
+
{ type: 'color', id: 'color', icon: { icon: 'font' } },
|
|
108
|
+
{ type: 'color', id: 'fgColor', icon: { icon: 'fill' } },
|
|
109
|
+
{ type: 'togglebutton', id: 'merge', title: 'Merge', icon: { icon: 'object-union' } },
|
|
110
|
+
{ type: 'togglebutton', id: 'wrap', title: 'Word wrap', icon: { icon: 'text', statusIcon: 'arrow-turn-down' } },
|
|
111
|
+
{ type: 'dropdown-button', id: 'border', icon: { icon: 'align-center' }, items: [[
|
|
112
|
+
{ type: 'button', id: 'borderLeft', value: { left: { style: 'thin' } }, content: createBorderIcon('left') },
|
|
113
|
+
{ type: 'button', id: 'borderRight', value: { right: { style: 'thin' } }, content: createBorderIcon('right') },
|
|
114
|
+
{ type: 'button', id: 'borderTop', value: { top: { style: 'thin' } }, content: createBorderIcon('top') },
|
|
115
|
+
{ type: 'button', id: 'borderBottom', value: { bottom: { style: 'thin' } }, content: createBorderIcon('bottom') },
|
|
116
|
+
], [
|
|
117
|
+
{ type: 'button', id: 'borderNone', value: { left: null, top: null, right: null, bottom: null }, content: createBorderIcon('none') },
|
|
118
|
+
{ type: 'button', id: 'borderAll', value: { left: { style: 'thin' }, top: { style: 'thin' }, right: { style: 'thin' }, bottom: { style: 'thin' } }, content: createBorderIcon('all') },
|
|
119
|
+
{ type: 'button', id: 'borderOutside', value: { left: { style: 'thin' }, top: { style: 'thin' }, right: { style: 'thin' }, bottom: { style: 'thin' } }, content: createBorderIcon('outside') },
|
|
120
|
+
{ type: 'button', id: 'borderOutsideThick', value: { left: { style: 'thick' }, top: { style: 'thick' }, right: { style: 'thick' }, bottom: { style: 'thick' } }, content: createBorderIcon('outside-thick') },
|
|
121
|
+
], [
|
|
122
|
+
{ type: 'button', id: 'borderBottomDouble', value: { bottom: { style: 'double' } }, content: createBorderIcon('bottom-double') },
|
|
123
|
+
{ type: 'button', id: 'borderBottomThick', value: { bottom: { style: 'thick' } }, content: createBorderIcon('bottom-thick') },
|
|
124
|
+
{ type: 'button', id: 'borderTopBottom', value: { top: { style: 'thin' }, bottom: { style: 'thin' } }, content: createBorderIcon('top-bottom') },
|
|
125
|
+
{ type: 'button', id: 'borderTopBottomThick', value: { top: { style: 'thin' }, bottom: { style: 'thick' } }, content: createBorderIcon('top-bottom-thick') },
|
|
126
|
+
], [{ type: 'color', id: 'borderColor', colspan: 4, icon: { icon: 'fill' } }]] },
|
|
127
|
+
{ type: 'dropdown-custom', id: 'hyperlink', title: 'Hyperlink', icon: { icon: 'link' }, createComponent: (_id, value) => {
|
|
128
|
+
const editor = dom.createElement('og-hyperlinkeditor', { href: value });
|
|
129
|
+
return editor;
|
|
130
|
+
} },
|
|
131
|
+
// {type: 'dropdown-button', id: 'outline', width: 80, options: {mode: 'dropdown'}, icon: {icon: 'list-tree'}, items: [[
|
|
132
|
+
// {type: 'button', id: 'x', value: {left: {style: 'thin'}}, content: createBorderIcon('left')},
|
|
133
|
+
// {type: 'button', id: 'c', value: {right: {style: 'thin'}}, content: createBorderIcon('right')},
|
|
134
|
+
// {type: 'button', id: 'v', value: {top: {style: 'thin'}}, content: createBorderIcon('top')},
|
|
135
|
+
// {type: 'button', id: 'b', value: {bottom: {style: 'thin'}}, content: createBorderIcon('bottom')},
|
|
136
|
+
// ]]}
|
|
137
|
+
];
|
|
138
|
+
export const toolbar2Config = [
|
|
139
|
+
{ type: 'dropdown', id: 'theme', width: 80, items: [] },
|
|
140
|
+
{ type: 'togglebutton', id: 'themes', icon: { icon: 'palette' }, title: 'Themes' }
|
|
141
|
+
];
|
|
142
|
+
export const toolbar3Config = [
|
|
143
|
+
{ type: 'togglebutton', id: 'headers', icon: { icon: 'heading' }, title: 'Headers' },
|
|
144
|
+
{ type: 'togglebutton', id: 'rules', icon: { icon: 'paintbrush-pencil' }, title: 'Conditional formatting' },
|
|
145
|
+
{ type: 'togglebutton', id: 'sparklines', icon: { icon: 'chart-simple' }, title: 'Sparklines' },
|
|
146
|
+
{ type: 'togglebutton', id: 'names', icon: { icon: 'table-cells', statusIcon: 'input-text' }, title: 'Named ranges' }
|
|
147
|
+
];
|
|
148
|
+
export const toolbar4Config = [
|
|
149
|
+
{ type: 'togglebutton', id: 'config', icon: { icon: 'gear' } }
|
|
150
|
+
];
|
|
151
|
+
// const fontCheck = new Set([
|
|
152
|
+
// // Windows 10
|
|
153
|
+
// 'Arial', 'Arial Black', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Gadugi', 'Georgia', 'HoloLens MDL2 Assets', 'Impact', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Marlett', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU-ExtB', 'Mongolian Baiti', 'MS Gothic', 'MV Boli', 'Myanmar Text', 'Nirmala UI', 'Palatino Linotype', 'Segoe MDL2 Assets', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Historic', 'Segoe UI Emoji', 'Segoe UI Symbol', 'SimSun', 'Sitka', 'Sylfaen', 'Symbol', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings', 'Yu Gothic',
|
|
154
|
+
// // macOS
|
|
155
|
+
// 'American Typewriter', 'Andale Mono', 'Arial', 'Arial Black', 'Arial Narrow', 'Arial Rounded MT Bold', 'Arial Unicode MS', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Baskerville', 'Big Caslon', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bradley Hand', 'Brush Script MT', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Comic Sans MS', 'Copperplate', 'Courier', 'Courier New', 'Didot', 'DIN Alternate', 'DIN Condensed', 'Futura', 'Geneva', 'Georgia', 'Gill Sans', 'Helvetica', 'Helvetica Neue', 'Herculanum', 'Hoefler Text', 'Impact', 'Lucida Grande', 'Luminari', 'Marker Felt', 'Menlo', 'Microsoft Sans Serif', 'Monaco', 'Noteworthy', 'Optima', 'Palatino', 'Papyrus', 'Phosphate', 'Rockwell', 'Savoye LET', 'SignPainter', 'Skia', 'Snell Roundhand', 'Tahoma', 'Times', 'Times New Roman', 'Trattatello', 'Trebuchet MS', 'Verdana', 'Zapfino',
|
|
156
|
+
// ].sort());
|
|
157
|
+
// (() => {
|
|
158
|
+
// const fontAvailable = new Set();
|
|
159
|
+
// for (const font of fontCheck.values()) {
|
|
160
|
+
// if (document.fonts.check(`12px "${font}"`)) {
|
|
161
|
+
// fontAvailable.add(font);
|
|
162
|
+
// }
|
|
163
|
+
// }
|
|
164
|
+
// console.log('Available Fonts:', [...fontAvailable.values()]);
|
|
165
|
+
// })();
|
|
166
|
+
//# sourceMappingURL=toolbar.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.config.js","sourceRoot":"","sources":["../../src/ui/toolbar.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAa,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAA2I,EAAE,EAAE;IAC/K,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IAE7F,MAAM,KAAK,GAAc;QACxB,SAAS,EAAE,YAAY;QACvB,K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AAE,YAAY,EAAC,EAAE,KAAK,EAAE,cAAc,EAAC;CACjH,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC5C,EAAC,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,EAAC;CAC1D,CAAC;AAEF,8BAA8B;AAC9B,iBAAiB;AACjB,s5BAAs5B;AACt5B,YAAY;AACZ,u3BAAu3B;AACv3B,aAAa;AAEb,WAAW;AACX,oCAAoC;AAEpC,4CAA4C;AAC5C,kDAAkD;AAClD,8BAA8B;AAC9B,MAAM;AACN,KAAK;AACL,iEAAiE;AACjE,QAAQ","sourcesContent":["import { dom } from \"@omegagrid/core\";\nimport { ToolbarItem } from \"@omegagrid/toolbar\";\nimport { html } from \"lit-html\";\nimport { StyleInfo, styleMap } from \"lit-html/directives/style-map.js\";\nimport { HyperlinkEditor } from \"./editors\";\n\nexport const createBorderIcon = (border: 'top'|'right'|'left'|'bottom'|'bottom-double'|'bottom-thick'|'top-bottom'|'top-bottom-thick'|'all'|'none'|'outside'|'outside-thick') => {\n\tconst borderWidth = ['outside-thick', 'bottom-thick'].indexOf(border) > -1 ? '2px' : '1.5px';\n\n\tconst style: StyleInfo = {\n\t\tboxSizing: 'border-box',\n\t\twidth: \"15px\",\n\t\theight: \"15px\",\n\t\tmarginLeft: \"2px\",\n\t\tborderWidth: '1px',\n\t\tborderColor: 'var(--og-text-color-2)',\n\t\tborderStyle: 'dotted',\n\t\tposition: 'relative',\n\t};\n\n\tif (border == 'top' || border == 'top-bottom' || border == 'top-bottom-thick' || border == 'all' || border == 'outside' || border == 'outside-thick') {\n\t\tstyle.borderTopStyle = 'solid';\n\t\tstyle.borderTopWidth = borderWidth;\n\t}\n\t\n\tif (border == 'right' || border == 'all' || border == 'outside' || border == 'outside-thick') {\n\t\tstyle.borderRightStyle = 'solid';\n\t\tstyle.borderRightWidth = borderWidth;\n\t} \n\t\n\tif (border == 'bottom' || border == 'top-bottom' || border == 'all' || border == 'outside' || border == 'outside-thick') {\n\t\tstyle.borderBottomStyle = 'solid';\n\t\tstyle.borderBottomWidth = borderWidth;\n\t}\n\n\tif (border == 'bottom-double') {\n\t\tstyle.borderBottomStyle = 'double';\n\t\tstyle.borderBottomWidth = '2px';\n\t}\n\n\tif (border == 'bottom-thick' || border == 'top-bottom-thick') {\n\t\tstyle.borderBottomStyle = 'solid';\n\t\tstyle.borderBottomWidth = '2px';\n\t}\n\t\n\tif (border == 'left' || border == 'all' || border == 'outside' || border == 'outside-thick') {\n\t\tstyle.borderLeftStyle = 'solid';\n\t\tstyle.borderLeftWidth = borderWidth;\n\t}\n\n\tstyle.position = 'relative';\n\tstyle.left = '-2px';\n\n\tconst insideStyle1: StyleInfo = {\n\t\tposition: 'absolute',\n\t\twidth: '100%',\n\t\theight: '50%',\n\t\ttop: '0',\n\t\tleft: '0',\n\t\tborderColor: 'var(--og-text-color-2)',\n\t\tborderWidth: border == 'all' ? borderWidth : '1px',\n\t\tborderBottomStyle: border == 'all' ? 'solid' : 'dotted'\n\t};\n\n\tconst insideStyle2: StyleInfo = {\n\t\tposition: 'absolute',\n\t\twidth: '50%',\n\t\theight: '100%',\n\t\ttop: '0',\n\t\tleft: '0',\n\t\tborderColor: 'var(--og-text-color-2)',\n\t\tborderWidth: border == 'all' ? borderWidth : '1px',\n\t\tborderRightStyle: border == 'all' ? 'solid' : 'dotted'\n\t};\n\n\treturn html`\n\t\t<div style=\"${styleMap(style)}\">\n\t\t\t<div style=\"${styleMap(insideStyle1)}\"></div>\n\t\t\t<div style=\"${styleMap(insideStyle2)}\"></div>\n\t\t</div>\n\t`;\n}\n\nconst cellTypes = [\n\t['General', 'g'],\n\t['Text', 't'],\n\t['Number', 'n'],\n\t['Date', 'd'],\n\t['DateTime', 'dt'],\t\n\t['Time', 'tm'],\n\t['Checkbox', 'b'],\n\t// ['Select', 's'],\n\t// ['MultiSelect', 'm'],\n];\n\nconst predefinedFormats = ['#,0.0', '#,0.00', '#,0.000', '0%', '0.0%', '0.00%', '0.000%'];\n\nconst fontSizes = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26].map(sz => ({\n\tk: sz.toString(),\n\tv: sz.toString(),\n}));\n\nexport const toolbar1Config: ToolbarItem[] = [\n\t{type: 'button', id: 'undo', icon: {icon: 'rotate-left'}},\n\t{type: 'button', id: 'redo', icon: {icon: 'rotate-right'}},\n\t{type: 'togglebutton', id: 'bold', icon: {icon: 'bold'}},\n\t{type: 'togglebutton', id: 'italic', icon: {icon: 'italic'}},\n\t{type: 'togglebutton', id: 'underline', icon: {icon: 'underline'}},\n\t{type: 'text', id: 'sz', width: 40, items: fontSizes, placeholder: ''},\n\t{type: 'dropdown-button', id: 'alignment', items: [[\n\t\t{type: 'button', id: 'alignTopLeft', value: {vertical: 'top', horizontal: 'left'}, icon: {icon: 'align-right', rotation: 180}},\n\t\t{type: 'button', id: 'alignTopCenter', value: {vertical: 'top', horizontal: 'center'}, icon: {icon: 'align-center'}},\n\t\t{type: 'button', id: 'alignTopRight', value: {vertical: 'top', horizontal: 'right'}, icon: {icon: 'align-left', rotation: 180}},\n\t], [\n\t\t{type: 'button', id: 'alignCenterLeft', value: {vertical: 'center', horizontal: 'left'}, icon: {icon: 'align-left'}},\n\t\t{type: 'button', id: 'alignCenterCenter', value: {vertical: 'center', horizontal: 'center'}, icon: {icon: 'align-center'}},\n\t\t{type: 'button', id: 'alignCenterRight', value: {vertical: 'center', horizontal: 'right'}, default: true, icon: {icon: 'align-right'}},\n\t], [\n\t\t{type: 'button', id: 'alignBottomLeft', value: {vertical: 'bottom', horizontal: 'left'}, icon: {icon: 'align-left'}},\n\t\t{type: 'button', id: 'alignBottomCenter', value: {vertical: 'bottom', horizontal: 'center'}, icon: {icon: 'align-center'}},\n\t\t{type: 'button', id: 'alignBottomRight', value: {vertical: 'bottom', horizontal: 'right'}, icon: {icon: 'align-right'}},\n\t]]},\n\t{type: 'dropdown', id: 'type', width: 80, items: cellTypes.map(([v, k]) => ({k: k, v: v}))},\n\t{type: 'text', id: 'format', width: 100, items: predefinedFormats.map(f => ({k: f, v: f})), placeholder: '<format>'},\n\t{type: 'color', id: 'color', icon: {icon: 'font'}},\n\t{type: 'color', id: 'fgColor', icon: {icon: 'fill'}},\n\t{type: 'togglebutton', id: 'merge', title: 'Merge', icon: {icon: 'object-union'}},\n\t{type: 'togglebutton', id: 'wrap', title: 'Word wrap', icon: {icon: 'text', statusIcon: 'arrow-turn-down'}},\n\t{type: 'dropdown-button', id: 'border', icon: {icon: 'align-center'}, items: [[\n\t\t{type: 'button', id: 'borderLeft', value: {left: {style: 'thin'}}, content: createBorderIcon('left')},\n\t\t{type: 'button', id: 'borderRight', value: {right: {style: 'thin'}}, content: createBorderIcon('right')},\n\t\t{type: 'button', id: 'borderTop', value: {top: {style: 'thin'}}, content: createBorderIcon('top')},\n\t\t{type: 'button', id: 'borderBottom', value: {bottom: {style: 'thin'}}, content: createBorderIcon('bottom')},\n\t], [\n\t\t{type: 'button', id: 'borderNone', value: {left: null, top: null, right: null, bottom: null}, content: createBorderIcon('none')},\n\t\t{type: 'button', id: 'borderAll', value: {left: {style: 'thin'}, top: {style: 'thin'}, right: {style: 'thin'}, bottom: {style: 'thin'}}, content: createBorderIcon('all')},\n\t\t{type: 'button', id: 'borderOutside', value: {left: {style: 'thin'}, top: {style: 'thin'}, right: {style: 'thin'}, bottom: {style: 'thin'}}, content: createBorderIcon('outside')},\n\t\t{type: 'button', id: 'borderOutsideThick', value: {left: {style: 'thick'}, top: {style: 'thick'}, right: {style: 'thick'}, bottom: {style: 'thick'}}, content: createBorderIcon('outside-thick')},\n\t], [\n\t\t{type: 'button', id: 'borderBottomDouble', value: {bottom: {style: 'double'}}, content: createBorderIcon('bottom-double')},\n\t\t{type: 'button', id: 'borderBottomThick', value: {bottom: {style: 'thick'}}, content: createBorderIcon('bottom-thick')},\n\t\t{type: 'button', id: 'borderTopBottom', value: {top: {style: 'thin'}, bottom: {style: 'thin'}}, content: createBorderIcon('top-bottom')},\n\t\t{type: 'button', id: 'borderTopBottomThick', value: {top: {style: 'thin'}, bottom: {style: 'thick'}}, content: createBorderIcon('top-bottom-thick')},\n\t], [{type: 'color', id: 'borderColor', colspan: 4, icon: {icon: 'fill'}}]]},\n\t{type: 'dropdown-custom', id: 'hyperlink', title: 'Hyperlink', icon: {icon: 'link'}, createComponent: (_id, value) => {\n\t\tconst editor = dom.createElement<HyperlinkEditor>('og-hyperlinkeditor', {href: value as string});\n\t\treturn editor;\n\t}},\n\t// {type: 'dropdown-button', id: 'outline', width: 80, options: {mode: 'dropdown'}, icon: {icon: 'list-tree'}, items: [[\n\t// \t{type: 'button', id: 'x', value: {left: {style: 'thin'}}, content: createBorderIcon('left')},\n\t// \t{type: 'button', id: 'c', value: {right: {style: 'thin'}}, content: createBorderIcon('right')},\n\t// \t{type: 'button', id: 'v', value: {top: {style: 'thin'}}, content: createBorderIcon('top')},\n\t// \t{type: 'button', id: 'b', value: {bottom: {style: 'thin'}}, content: createBorderIcon('bottom')},\n\t// ]]}\n];\n\nexport const toolbar2Config: ToolbarItem[] = [\n\t{type: 'dropdown', id: 'theme', width: 80, items: []},\n\t{type: 'togglebutton', id: 'themes', icon: {icon: 'palette'}, title: 'Themes'}\n];\n\nexport const toolbar3Config: ToolbarItem[] = [\n\t{type: 'togglebutton', id: 'headers', icon: {icon: 'heading'}, title: 'Headers'},\n\t{type: 'togglebutton', id: 'rules', icon: {icon: 'paintbrush-pencil'}, title: 'Conditional formatting'},\n\t{type: 'togglebutton', id: 'sparklines', icon: {icon: 'chart-simple'}, title: 'Sparklines'},\n\t{type: 'togglebutton', id: 'names', icon: {icon: 'table-cells', statusIcon: 'input-text'}, title: 'Named ranges'}\n];\n\nexport const toolbar4Config: ToolbarItem[] = [\n\t{type: 'togglebutton', id: 'config', icon: {icon: 'gear'}}\n];\n\n// const fontCheck = new Set([\n// \t// Windows 10\n// \t'Arial', 'Arial Black', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Gadugi', 'Georgia', 'HoloLens MDL2 Assets', 'Impact', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Marlett', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU-ExtB', 'Mongolian Baiti', 'MS Gothic', 'MV Boli', 'Myanmar Text', 'Nirmala UI', 'Palatino Linotype', 'Segoe MDL2 Assets', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Historic', 'Segoe UI Emoji', 'Segoe UI Symbol', 'SimSun', 'Sitka', 'Sylfaen', 'Symbol', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings', 'Yu Gothic',\n// \t// macOS\n// \t'American Typewriter', 'Andale Mono', 'Arial', 'Arial Black', 'Arial Narrow', 'Arial Rounded MT Bold', 'Arial Unicode MS', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Baskerville', 'Big Caslon', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bradley Hand', 'Brush Script MT', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Comic Sans MS', 'Copperplate', 'Courier', 'Courier New', 'Didot', 'DIN Alternate', 'DIN Condensed', 'Futura', 'Geneva', 'Georgia', 'Gill Sans', 'Helvetica', 'Helvetica Neue', 'Herculanum', 'Hoefler Text', 'Impact', 'Lucida Grande', 'Luminari', 'Marker Felt', 'Menlo', 'Microsoft Sans Serif', 'Monaco', 'Noteworthy', 'Optima', 'Palatino', 'Papyrus', 'Phosphate', 'Rockwell', 'Savoye LET', 'SignPainter', 'Skia', 'Snell Roundhand', 'Tahoma', 'Times', 'Times New Roman', 'Trattatello', 'Trebuchet MS', 'Verdana', 'Zapfino',\n// ].sort());\n\n// (() => {\n// \tconst fontAvailable = new Set();\n\n// \tfor (const font of fontCheck.values()) {\n// \t\tif (document.fonts.check(`12px \"${font}\"`)) {\n// \t\t\tfontAvailable.add(font);\n// \t\t}\n// \t}\n// \tconsole.log('Available Fonts:', [...fontAvailable.values()]);\n// })();"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { actions } from '@omegagrid/core';
|
|
2
|
+
import { Border, ElementModel, Grid, GridEditEvent, Style } from '@omegagrid/grid';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
import { Toolbar, ToolbarItem } from '@omegagrid/toolbar';
|
|
5
|
+
import { CellRange } from '@omegagrid/grid';
|
|
6
|
+
import { Editor } from './editor';
|
|
7
|
+
export declare class EditorToolbar extends LitElement {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
toolbar1: Toolbar;
|
|
10
|
+
toolbar2: Toolbar;
|
|
11
|
+
toolbar3: Toolbar;
|
|
12
|
+
toolbar4: Toolbar;
|
|
13
|
+
grid: Grid;
|
|
14
|
+
editor: Editor;
|
|
15
|
+
gridElements: ElementModel[];
|
|
16
|
+
toolbar1Config: ToolbarItem[];
|
|
17
|
+
toolbar2Config: ToolbarItem[];
|
|
18
|
+
toolbar3Config: ToolbarItem[];
|
|
19
|
+
toolbar4Config: ToolbarItem[];
|
|
20
|
+
get gridElement(): ElementModel;
|
|
21
|
+
_borderColor: string;
|
|
22
|
+
filterToolbarItems(items: ToolbarItem[]): ToolbarItem[];
|
|
23
|
+
getToolbar1Config(): ToolbarItem[];
|
|
24
|
+
getToolbar2Config(): ToolbarItem[];
|
|
25
|
+
getToolbar3Config(): ToolbarItem[];
|
|
26
|
+
getToolbar4Config(): ToolbarItem[];
|
|
27
|
+
_onGridEdit: (_e: GridEditEvent) => void;
|
|
28
|
+
willUpdate(props: Map<PropertyKey, unknown>): void;
|
|
29
|
+
firstUpdated(): void;
|
|
30
|
+
getToolbarValues(): Record<string, unknown>;
|
|
31
|
+
getCellBorderStyles(element: ElementModel, range: CellRange, value: {
|
|
32
|
+
top?: Border;
|
|
33
|
+
right?: Border;
|
|
34
|
+
bottom?: Border;
|
|
35
|
+
left?: Border;
|
|
36
|
+
}, borderType: string): Record<keyof Style, unknown>;
|
|
37
|
+
applyProperty(target: ElementModel, action: actions.Action, value: unknown, isStyleProperty: boolean): void;
|
|
38
|
+
updateToolbar(): Promise<void>;
|
|
39
|
+
_onToolbarAction: (e: actions.ActionEvent) => void;
|
|
40
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/ui/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAa,MAAM,EAAa,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAE/C,qBACa,aAAc,SAAQ,UAAU;IAE5C,MAAM,CAAC,MAAM,4BAAW;IAGxB,QAAQ,EAAE,OAAO,CAAC;IAGlB,QAAQ,EAAE,OAAO,CAAC;IAGlB,QAAQ,EAAE,OAAO,CAAC;IAGlB,QAAQ,EAAE,OAAO,CAAC;IAGlB,IAAI,EAAE,IAAI,CAAC;IAGX,MAAM,EAAE,MAAM,CAAC;IA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