@omegagrid/editor 0.6.28 → 0.6.30
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/ui/editor.d.ts.map +1 -1
- package/dist/ui/editor.js +5 -2
- package/dist/ui/editor.js.map +1 -1
- 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 +24 -0
- package/dist/ui/editors/ruleEditor.d.ts.map +1 -0
- package/dist/ui/editors/ruleEditor.js +205 -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/ruleForm.d.ts +1 -16
- package/dist/ui/forms/ruleForm.d.ts.map +1 -1
- package/dist/ui/forms/ruleForm.js +3 -174
- package/dist/ui/forms/ruleForm.js.map +1 -1
- package/dist/ui/forms/ruleForm.style.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +1 -1
- 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/toolbar.config.d.ts.map +1 -1
- package/dist/ui/toolbar.config.js +20 -9
- package/dist/ui/toolbar.config.js.map +1 -1
- package/dist/ui/toolbar.d.ts.map +1 -1
- package/dist/ui/toolbar.js +13 -0
- package/dist/ui/toolbar.js.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleEditor.js","sourceRoot":"","sources":["../../../src/ui/editors/styleEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAW,MAAM,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CA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V;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yCACR;AAGjB;IADC,KAAK,CAAC,YAAY,CAAC;4CACH;AAtBL,WAAW;IADvB,aAAa,CAAC,uBAAuB,CAAC;GAC1B,WAAW,CA4EvB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TableTheme } from '@omegagrid/grid';
|
|
2
|
+
import { OmegaComponent, SortableList } from '@omegagrid/core';
|
|
3
|
+
import { TabContainer } from '@omegagrid/tabs';
|
|
4
|
+
type ThemeItemType = 'rows' | 'columns' | 'cells';
|
|
5
|
+
export declare class ThemeEditor extends OmegaComponent {
|
|
6
|
+
static styles: import("lit").CSSResultGroup[];
|
|
7
|
+
theme: TableTheme;
|
|
8
|
+
tabContainer: TabContainer;
|
|
9
|
+
private lists;
|
|
10
|
+
private listItems;
|
|
11
|
+
willUpdate(props: Map<string, unknown>): void;
|
|
12
|
+
updated(props: Map<string, unknown>): void;
|
|
13
|
+
createItemEditor: (type: ThemeItemType) => (div: HTMLDivElement, index: number) => void;
|
|
14
|
+
updateList(type: ThemeItemType): void;
|
|
15
|
+
moveItemUp(index: number, type: ThemeItemType): void;
|
|
16
|
+
moveItemDown(index: number, type: ThemeItemType): void;
|
|
17
|
+
moveItem(fromIndex: number, toIndex: number, type: ThemeItemType): void;
|
|
18
|
+
deleteItem(index: number, type: ThemeItemType): void;
|
|
19
|
+
addItem(type: ThemeItemType): void;
|
|
20
|
+
createComponent: (id: ThemeItemType) => SortableList;
|
|
21
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=themeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeEditor.d.ts","sourceRoot":"","sources":["../../../src/ui/editors/themeEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAsB,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGnF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,KAAK,aAAa,GAAG,MAAM,GAAC,SAAS,GAAC,OAAO,CAAC;AAE9C,qBACa,WAAY,SAAQ,cAAc;IAE9C,MAAM,CAAC,MAAM,iCAIV;IAGH,KAAK,EAAE,UAAU,CAAC;IAGlB,YAAY,EAAE,YAAY,CAAC;IAE3B,OAAO,CAAC,KAAK,CAA+C;IAC5D,OAAO,CAAC,SAAS,CAAoD;IAErE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAQtC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAInC,gBAAgB,SAAU,aAAa,WAAW,cAAc,SAAS,MAAM,UAe9E;IAED,UAAU,CAAC,IAAI,EAAE,aAAa;IAM9B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;IAK7C,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;IAK/C,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;IAQhE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;IAQ7C,OAAO,CAAC,IAAI,EAAE,aAAa;IAQ3B,eAAe,OAAQ,aAAa,kBAgBnC;IAED,MAAM,6CAuBJ;CAEF"}
|
|
@@ -0,0 +1,138 @@
|
|
|
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 { customElement, property, query } from 'lit/decorators.js';
|
|
8
|
+
import { css, html } from 'lit';
|
|
9
|
+
import { dom, OmegaComponent } from '@omegagrid/core';
|
|
10
|
+
import { msg } from '@omegagrid/localize';
|
|
11
|
+
let ThemeEditor = class ThemeEditor extends OmegaComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.createItemEditor = (type) => (div, index) => {
|
|
15
|
+
this.listItems = this.listItems || {};
|
|
16
|
+
this.listItems[type] = this.listItems[type] || [];
|
|
17
|
+
let editor = this.listItems[type][index] ? this.listItems[type][index] : null;
|
|
18
|
+
if (!editor) {
|
|
19
|
+
editor = dom.createElement('og-editor-themeitem', {
|
|
20
|
+
index: index,
|
|
21
|
+
themeItem: this.theme[type][index],
|
|
22
|
+
itemType: type,
|
|
23
|
+
editor: this
|
|
24
|
+
});
|
|
25
|
+
this.listItems[type][index] = editor;
|
|
26
|
+
}
|
|
27
|
+
dom.empty(div);
|
|
28
|
+
div.appendChild(editor);
|
|
29
|
+
};
|
|
30
|
+
this.createComponent = (id) => {
|
|
31
|
+
this.lists = this.lists || {};
|
|
32
|
+
if (this.lists[id])
|
|
33
|
+
return this.lists[id];
|
|
34
|
+
const list = dom.createElement('og-sortablelist');
|
|
35
|
+
list.style.height = '100%';
|
|
36
|
+
list.style.overflow = 'hidden';
|
|
37
|
+
list.scrollbarPadding = true;
|
|
38
|
+
list.disabledSelect = true;
|
|
39
|
+
list.customHandle = true;
|
|
40
|
+
list.dynamicItemHeight = true;
|
|
41
|
+
list.nativeHeight = true;
|
|
42
|
+
list.size = this.theme && this.theme[id] ? this.theme[id].length : 0;
|
|
43
|
+
list.itemRenderer = this.createItemEditor(id);
|
|
44
|
+
list.addEventListener('list.sort', (e) => this.moveItem(e.fromIndex, e.toIndex, id));
|
|
45
|
+
this.lists[id] = list;
|
|
46
|
+
return list;
|
|
47
|
+
};
|
|
48
|
+
this.render = () => html `
|
|
49
|
+
<div style="display: flex; flex-direction: column; height: 100%">
|
|
50
|
+
<div style="flex: 1; overflow: hidden">
|
|
51
|
+
<og-tabcontainer
|
|
52
|
+
fixed
|
|
53
|
+
style="height: 100%"
|
|
54
|
+
.createComponent="${this.createComponent}"
|
|
55
|
+
.items="${[
|
|
56
|
+
{ id: 'rows', title: msg('Rows') },
|
|
57
|
+
{ id: 'columns', title: msg('Columns') },
|
|
58
|
+
{ id: 'cells', title: msg('Cells') }
|
|
59
|
+
]}">
|
|
60
|
+
</og-tabcontainer>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div style="flex: 0; padding-top: 5px">
|
|
64
|
+
<og-button
|
|
65
|
+
@click="${() => this.addItem(this.tabContainer.selectedId)}"
|
|
66
|
+
icon="plus"
|
|
67
|
+
style="width: 100%">
|
|
68
|
+
</og-button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
willUpdate(props) {
|
|
74
|
+
this.theme = this.theme || { name: '' };
|
|
75
|
+
if (props.has('theme')) {
|
|
76
|
+
this.listItems = {};
|
|
77
|
+
this.lists = {};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
updated(props) {
|
|
81
|
+
if (props.has('theme'))
|
|
82
|
+
this.tabContainer?.refresh();
|
|
83
|
+
}
|
|
84
|
+
updateList(type) {
|
|
85
|
+
this.listItems[type] = [];
|
|
86
|
+
this.lists[type].size = this.theme[type].length;
|
|
87
|
+
this.lists[type].renderItems(true);
|
|
88
|
+
}
|
|
89
|
+
moveItemUp(index, type) {
|
|
90
|
+
if (index === 0)
|
|
91
|
+
return;
|
|
92
|
+
this.moveItem(index, index - 1, type);
|
|
93
|
+
}
|
|
94
|
+
moveItemDown(index, type) {
|
|
95
|
+
if (index >= this.listItems[type].length - 1)
|
|
96
|
+
return;
|
|
97
|
+
this.moveItem(index, index + 1, type);
|
|
98
|
+
}
|
|
99
|
+
moveItem(fromIndex, toIndex, type) {
|
|
100
|
+
const items = this.theme[type];
|
|
101
|
+
if (!this.theme[type])
|
|
102
|
+
return;
|
|
103
|
+
const item = items.splice(fromIndex, 1)[0];
|
|
104
|
+
items.splice(toIndex, 0, item);
|
|
105
|
+
this.updateList(type);
|
|
106
|
+
}
|
|
107
|
+
deleteItem(index, type) {
|
|
108
|
+
const items = this.theme[type];
|
|
109
|
+
if (!this.theme[type])
|
|
110
|
+
return;
|
|
111
|
+
items.splice(index, 1);
|
|
112
|
+
this.theme[type] = items;
|
|
113
|
+
this.updateList(type);
|
|
114
|
+
}
|
|
115
|
+
addItem(type) {
|
|
116
|
+
const items = this.theme[type] ?? [];
|
|
117
|
+
items.push({});
|
|
118
|
+
this.theme[type] = items;
|
|
119
|
+
this.updateList(type);
|
|
120
|
+
this.lists[type].scrollToIndex(items.length - 1);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
ThemeEditor.styles = [OmegaComponent.styles, css `
|
|
124
|
+
:host {
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
}
|
|
127
|
+
`];
|
|
128
|
+
__decorate([
|
|
129
|
+
property({ type: Object })
|
|
130
|
+
], ThemeEditor.prototype, "theme", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
query('og-tabcontainer')
|
|
133
|
+
], ThemeEditor.prototype, "tabContainer", void 0);
|
|
134
|
+
ThemeEditor = __decorate([
|
|
135
|
+
customElement('og-editor-theme')
|
|
136
|
+
], ThemeEditor);
|
|
137
|
+
export { ThemeEditor };
|
|
138
|
+
//# sourceMappingURL=themeEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeEditor.js","sourceRoot":"","sources":["../../../src/ui/editors/themeEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAA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tB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;;AAlFM,kBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAA;;;;EAI1C,CAAC,AAJW,CAIV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CACP;AAGlB;IADC,KAAK,CAAC,iBAAiB,CAAC;iDACE;AAZf,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAiIvB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConditionalFormatType, Style, ThemeColumnItem, ThemeRowItem } from '@omegagrid/grid';
|
|
2
|
+
import { events, OmegaComponent } from '@omegagrid/core';
|
|
3
|
+
import { RuleEditor } from './ruleEditor';
|
|
4
|
+
import { StyleEditor } from './styleEditor';
|
|
5
|
+
import { ThemeEditor } from './themeEditor';
|
|
6
|
+
type ThemeItemType = 'rows' | 'columns' | 'cells';
|
|
7
|
+
export declare class ThemeItemEditor extends OmegaComponent {
|
|
8
|
+
index: number;
|
|
9
|
+
themeItem: ThemeColumnItem & ThemeRowItem;
|
|
10
|
+
itemType: ThemeItemType;
|
|
11
|
+
editor: ThemeEditor;
|
|
12
|
+
moveHandle: HTMLElement;
|
|
13
|
+
ruleEditor: RuleEditor;
|
|
14
|
+
styleEditor: StyleEditor;
|
|
15
|
+
static styles: import("lit").CSSResultGroup[];
|
|
16
|
+
willUpdate(): void;
|
|
17
|
+
updateRuleType(type: ConditionalFormatType): void;
|
|
18
|
+
_onStyleChange: (e: events.ChangeEvent<Style>) => void;
|
|
19
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=themeItemEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeItemEditor.d.ts","sourceRoot":"","sources":["../../../src/ui/editors/themeItemEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,eAAe,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzG,OAAO,EAAE,MAAM,EAAY,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,aAAa,GAAG,MAAM,GAAC,SAAS,GAAC,OAAO,CAAC;AAU9C,qBACa,eAAgB,SAAQ,cAAc;IAGlD,KAAK,EAAE,MAAM,CAAC;IAGd,SAAS,EAAE,eAAe,GAAG,YAAY,CAAC;IAG1C,QAAQ,EAAE,aAAa,CAAC;IAGxB,MAAM,EAAE,WAAW,CAAC;IAGpB,UAAU,EAAE,WAAW,CAAC;IAGxB,UAAU,EAAE,UAAU,CAAC;IAGvB,WAAW,EAAE,WAAW,CAAC;IAEzB,MAAM,CAAC,MAAM,iCA6CV;IAEH,UAAU;IAKV,cAAc,CAAC,IAAI,EAAE,qBAAqB;IAS1C,cAAc,MAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,UAE7C;IAED,MAAM,6CAsEJ;CACF"}
|
|
@@ -0,0 +1,181 @@
|
|
|
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 { customElement, property, query } from 'lit/decorators.js';
|
|
8
|
+
import { css, html } from 'lit';
|
|
9
|
+
import { OmegaComponent } from '@omegagrid/core';
|
|
10
|
+
import { msg } from '@omegagrid/localize';
|
|
11
|
+
const ruleTypes = [
|
|
12
|
+
{ key: null, value: 'Static style' },
|
|
13
|
+
{ key: 'formula', value: 'Formula' },
|
|
14
|
+
{ key: 'scale', value: 'Scale' },
|
|
15
|
+
{ key: 'bar', value: 'Data Bar' },
|
|
16
|
+
{ key: 'icon', value: 'Icon Set' },
|
|
17
|
+
];
|
|
18
|
+
let ThemeItemEditor = class ThemeItemEditor extends OmegaComponent {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this._onStyleChange = (e) => {
|
|
22
|
+
this.themeItem.style = e.value;
|
|
23
|
+
};
|
|
24
|
+
this.render = () => html `
|
|
25
|
+
<div class="header">
|
|
26
|
+
<div style="flex: 1" class="move-handle">${msg('Rule')} #${this.index + 1}</div>
|
|
27
|
+
|
|
28
|
+
<div>
|
|
29
|
+
<og-dropdown-menu
|
|
30
|
+
noCaret
|
|
31
|
+
dynamicWidth
|
|
32
|
+
alignment="right"
|
|
33
|
+
color="transparent"
|
|
34
|
+
.items="${[{
|
|
35
|
+
key: 'moveUp',
|
|
36
|
+
value: msg('Move up'),
|
|
37
|
+
icon: 'arrow-up',
|
|
38
|
+
exec: () => this.editor.moveItemUp(this.index, this.itemType)
|
|
39
|
+
}, {
|
|
40
|
+
key: 'moveDown',
|
|
41
|
+
value: msg('Move down'),
|
|
42
|
+
icon: 'arrow-down',
|
|
43
|
+
exec: () => this.editor.moveItemDown(this.index, this.itemType)
|
|
44
|
+
}, {
|
|
45
|
+
key: 'delete',
|
|
46
|
+
value: msg('Delete'),
|
|
47
|
+
icon: 'trash',
|
|
48
|
+
color: 'red',
|
|
49
|
+
exec: () => this.editor.deleteItem(this.index, this.itemType)
|
|
50
|
+
}]}">
|
|
51
|
+
<div slot="label"><og-icon icon="ellipsis"></og-icon></div>
|
|
52
|
+
</og-dropdown-menu>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
${this.itemType != 'cells' ? html `
|
|
57
|
+
<div class="row">${msg('Conditions')}</div>
|
|
58
|
+
|
|
59
|
+
<div class="row">
|
|
60
|
+
<label>${msg('Level')}</label>
|
|
61
|
+
<og-numericinput buttons min="0" .value="${this.themeItem?.level}"></og-numericinput>
|
|
62
|
+
<label>${msg('Index')}</label>
|
|
63
|
+
<og-numericinput buttons min="0" .value="${this.themeItem?.index}"></og-numericinput>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="row">
|
|
67
|
+
<label>${msg('Name')}</label>
|
|
68
|
+
<og-input></og-input>
|
|
69
|
+
</div>
|
|
70
|
+
` : ''}
|
|
71
|
+
|
|
72
|
+
<div class="row">${msg('Style definition')}</div>
|
|
73
|
+
|
|
74
|
+
<div class="row">
|
|
75
|
+
<og-dropdown-list
|
|
76
|
+
.value = "${this.themeItem?.type ?? null}"
|
|
77
|
+
.items="${ruleTypes}"
|
|
78
|
+
@change="${(e) => this.updateRuleType(e.value)}">
|
|
79
|
+
</og-dropdown-list>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div>
|
|
83
|
+
${this.themeItem?.type ? html `
|
|
84
|
+
<og-editor-ruleeditor
|
|
85
|
+
.format="${this.themeItem}">
|
|
86
|
+
</og-editor-ruleeditor>
|
|
87
|
+
` : html `
|
|
88
|
+
<og-editor-styleeditor
|
|
89
|
+
@change="${this._onStyleChange}"
|
|
90
|
+
.data="${this.themeItem.style}">
|
|
91
|
+
</og-editor-styleeditor>
|
|
92
|
+
`}
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
willUpdate() {
|
|
97
|
+
this.themeItem = this.themeItem || {};
|
|
98
|
+
this.updateRuleType(this.themeItem.type);
|
|
99
|
+
}
|
|
100
|
+
updateRuleType(type) {
|
|
101
|
+
this.themeItem.type = type;
|
|
102
|
+
if (type)
|
|
103
|
+
delete this.themeItem.style;
|
|
104
|
+
else
|
|
105
|
+
this.themeItem.style = this.themeItem.style || {};
|
|
106
|
+
this.requestUpdate();
|
|
107
|
+
this.ruleEditor?.requestUpdate();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
ThemeItemEditor.styles = [OmegaComponent.styles, css `
|
|
111
|
+
:host {
|
|
112
|
+
line-height: 22px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.row {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: row;
|
|
118
|
+
margin: 2px 0;
|
|
119
|
+
align-items: center;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
label {
|
|
123
|
+
flex: 0 60px;
|
|
124
|
+
text-align: right;
|
|
125
|
+
margin-right: 10px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
og-dropdown-list, og-dropdown-menu, og-editor-ruleeditor {
|
|
129
|
+
line-height: 16px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
og-numericinput, og-input {
|
|
133
|
+
flex: 1;
|
|
134
|
+
display: block;
|
|
135
|
+
width: 100%;
|
|
136
|
+
line-height: 20px;
|
|
137
|
+
text-align: center;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.move-handle {
|
|
141
|
+
cursor: move;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
og-dropdown-list {
|
|
145
|
+
flex: 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.header {
|
|
149
|
+
padding-left: 5px;
|
|
150
|
+
border-top: 1px solid var(--og-border-color);
|
|
151
|
+
border-bottom: 1px solid var(--og-border-color);
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: row;
|
|
154
|
+
}
|
|
155
|
+
`];
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ type: Number })
|
|
158
|
+
], ThemeItemEditor.prototype, "index", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
property({ type: Object })
|
|
161
|
+
], ThemeItemEditor.prototype, "themeItem", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
property({ type: String })
|
|
164
|
+
], ThemeItemEditor.prototype, "itemType", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
property({ type: Object })
|
|
167
|
+
], ThemeItemEditor.prototype, "editor", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
query('.move-handle')
|
|
170
|
+
], ThemeItemEditor.prototype, "moveHandle", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
query('og-editor-ruleeditor')
|
|
173
|
+
], ThemeItemEditor.prototype, "ruleEditor", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
query('og-editor-styleeditor')
|
|
176
|
+
], ThemeItemEditor.prototype, "styleEditor", void 0);
|
|
177
|
+
ThemeItemEditor = __decorate([
|
|
178
|
+
customElement('og-editor-themeitem')
|
|
179
|
+
], ThemeItemEditor);
|
|
180
|
+
export { ThemeItemEditor };
|
|
181
|
+
//# sourceMappingURL=themeItemEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeItemEditor.js","sourceRoot":"","sources":["../../../src/ui/editors/themeItemEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAoB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAO1C,MAAM,SAAS,GAAe;IAC7B,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAC;IAClC,EAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAC;IAClC,EAAC,GAAG,EAAE,OAAO,EAA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AC,MAAM,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6C1C,CAAC,AA7CW,CA6CV;AAjEH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CACX;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACiB;AAG1C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;iDACD;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;+CACL;AAGpB;IADC,KAAK,CAAC,cAAc,CAAC;mDACE;AAGxB;IADC,KAAK,CAAC,sBAAsB,CAAC;mDACP;AAGvB;IADC,KAAK,CAAC,uBAAuB,CAAC;oDACN;AArBb,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CA+J3B"}
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Input } from '@omegagrid/core';
|
|
2
2
|
import { ConditionalFormat, GridModel } from '@omegagrid/grid';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { StyleForm } from './styleForm';
|
|
5
|
-
import { RuleThreshold } from './ruleFormThreshold';
|
|
6
4
|
export declare class RuleForm extends LitElement {
|
|
7
5
|
static styles: import("lit").CSSResult[];
|
|
8
6
|
model: GridModel;
|
|
9
7
|
format: ConditionalFormat;
|
|
10
8
|
rangesInput: Input;
|
|
11
9
|
conditionInput: Input;
|
|
12
|
-
cminInput: DropdownColorPicker;
|
|
13
|
-
cmidInput: DropdownColorPicker;
|
|
14
|
-
cmaxInput: DropdownColorPicker;
|
|
15
|
-
colorInput: DropdownColorPicker;
|
|
16
|
-
iconList: DropdownList;
|
|
17
|
-
styleForm: StyleForm;
|
|
18
|
-
thresholds: NodeListOf<RuleThreshold>;
|
|
19
|
-
_onStyleChange(e: events.ChangeEvent, format: ConditionalFormat): void;
|
|
20
10
|
updateFormat(): void;
|
|
21
|
-
renderFormulaForm: () => import("lit-html").TemplateResult<1>;
|
|
22
|
-
renderScaleForm: () => import("lit-html").TemplateResult<1>;
|
|
23
|
-
renderBarForm: () => import("lit-html").TemplateResult<1>;
|
|
24
|
-
iconItemRenderer: (div: HTMLDivElement, index: number, item: MenuItem) => import("lit-html").TemplateResult<1>;
|
|
25
|
-
renderIconForm: () => import("lit-html").TemplateResult<1>;
|
|
26
11
|
render: () => import("lit-html").TemplateResult<1>;
|
|
27
12
|
}
|
|
28
13
|
//# sourceMappingURL=ruleForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleForm.d.ts","sourceRoot":"","sources":["../../../src/ui/forms/ruleForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ruleForm.d.ts","sourceRoot":"","sources":["../../../src/ui/forms/ruleForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAa,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,qBACa,QAAS,SAAQ,UAAU;IAEvC,MAAM,CAAC,MAAM,4BAAW;IAGxB,KAAK,EAAE,SAAS,CAAC;IAGjB,MAAM,EAAE,iBAAiB,CAAC;IAG1B,WAAW,EAAE,KAAK,CAAC;IAGnB,cAAc,EAAE,KAAK,CAAC;IAEtB,YAAY;IAMZ,MAAM,6CAaG;CACT"}
|
|
@@ -4,110 +4,14 @@ 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 {
|
|
8
|
-
import {
|
|
9
|
-
import { CellRange, iconSets } from '@omegagrid/grid';
|
|
7
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
8
|
+
import { CellRange } from '@omegagrid/grid';
|
|
10
9
|
import { html, LitElement } from 'lit';
|
|
11
10
|
import { style } from './ruleForm.style';
|
|
12
11
|
import { msg } from '@omegagrid/localize';
|
|
13
|
-
import { choose } from 'lit/directives/choose.js';
|
|
14
|
-
import { map } from 'lit/directives/map.js';
|
|
15
12
|
let RuleForm = class RuleForm extends LitElement {
|
|
16
13
|
constructor() {
|
|
17
14
|
super(...arguments);
|
|
18
|
-
this.renderFormulaForm = () => html `
|
|
19
|
-
<div class="row">${msg('Condition')}</div>
|
|
20
|
-
|
|
21
|
-
<div class="row">
|
|
22
|
-
<og-input
|
|
23
|
-
id="condition"
|
|
24
|
-
.value="${this.format.condition || ''}"
|
|
25
|
-
style="width: 100%"
|
|
26
|
-
@change="${() => this.updateFormat()}">
|
|
27
|
-
</og-input>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div class="row">${msg('Style')}</div>
|
|
31
|
-
|
|
32
|
-
<div class="row">
|
|
33
|
-
<og-editor-form-style
|
|
34
|
-
id="style"
|
|
35
|
-
.data="${this.format.style || {}}"
|
|
36
|
-
@change="${() => this.updateFormat()}">
|
|
37
|
-
</og-editor-form-style>
|
|
38
|
-
</div>
|
|
39
|
-
`;
|
|
40
|
-
this.renderScaleForm = () => html `
|
|
41
|
-
<div class="row">${msg('Colors')}</div>
|
|
42
|
-
<div class="row" style="display: flex; gap: 4px;">
|
|
43
|
-
<og-dropdown-colorpicker
|
|
44
|
-
id="cmin"
|
|
45
|
-
style="flex: 1"
|
|
46
|
-
.value="${colors.css(this.format.cmin?.color)}"
|
|
47
|
-
@change="${() => this.updateFormat()}">
|
|
48
|
-
</og-dropdown-colorpicker>
|
|
49
|
-
|
|
50
|
-
<og-dropdown-colorpicker
|
|
51
|
-
id="cmid"
|
|
52
|
-
style="flex: 1"
|
|
53
|
-
.value="${colors.css(this.format.cmid?.color)}"
|
|
54
|
-
@change="${() => this.updateFormat()}">
|
|
55
|
-
</og-dropdown-colorpicker>
|
|
56
|
-
|
|
57
|
-
<og-dropdown-colorpicker
|
|
58
|
-
id="cmax"
|
|
59
|
-
style="flex: 1"
|
|
60
|
-
.value="${colors.css(this.format.cmax?.color)}"
|
|
61
|
-
@change="${() => this.updateFormat()}">
|
|
62
|
-
</og-dropdown-colorpicker>
|
|
63
|
-
</div>
|
|
64
|
-
`;
|
|
65
|
-
this.renderBarForm = () => html `
|
|
66
|
-
<div class="row">${msg('Color')}</div>
|
|
67
|
-
<div class="row" style="display: flex; gap: 4px;">
|
|
68
|
-
<og-dropdown-colorpicker
|
|
69
|
-
id="color"
|
|
70
|
-
style="flex: 1"
|
|
71
|
-
.value="${colors.css(this.format.color)}"
|
|
72
|
-
@change="${() => this.updateFormat()}">
|
|
73
|
-
</og-dropdown-colorpicker>
|
|
74
|
-
</div>
|
|
75
|
-
`;
|
|
76
|
-
this.iconItemRenderer = (div, index, item) => html `
|
|
77
|
-
<div style="padding-left: 5px">
|
|
78
|
-
${map(iconSets.get(item.key), icon => html `
|
|
79
|
-
<og-icon .icon="${icon}"></og-icon>
|
|
80
|
-
`)} (${item.key})
|
|
81
|
-
</div>
|
|
82
|
-
`;
|
|
83
|
-
this.renderIconForm = () => html `
|
|
84
|
-
<div class="row">${msg('Icons')}</div>
|
|
85
|
-
<div class="row" style="display: flex; gap: 4px;">
|
|
86
|
-
<og-dropdown-list
|
|
87
|
-
id="icons"
|
|
88
|
-
style="flex: 1"
|
|
89
|
-
.items="${Array.from(iconSets.entries()).map(item => ({
|
|
90
|
-
key: item[0],
|
|
91
|
-
value: item[0],
|
|
92
|
-
renderer: this.iconItemRenderer
|
|
93
|
-
}))}"
|
|
94
|
-
.value="${this.format.v}"
|
|
95
|
-
@change="${() => this.updateFormat()}">
|
|
96
|
-
</og-dropdown-list>
|
|
97
|
-
</div>
|
|
98
|
-
${this.format.v && iconSets.has(this.format.v) ? html `
|
|
99
|
-
<div class="row">${msg('Thresholds')}</div>
|
|
100
|
-
<div style="display: flex; flex-direction: column; gap: 2px; margin-top: 2px">
|
|
101
|
-
${map(iconSets.get(this.format.v), (_icon, i) => html `
|
|
102
|
-
<og-editor-rule-threshold
|
|
103
|
-
.value="${this.format?.thresh[i]}"
|
|
104
|
-
?first="${i == 0}"
|
|
105
|
-
@change="${() => this.updateFormat()}">
|
|
106
|
-
</og-editor-rule-threshold>
|
|
107
|
-
`)}
|
|
108
|
-
</div>
|
|
109
|
-
` : ''}
|
|
110
|
-
`;
|
|
111
15
|
this.render = () => this.format ? html `
|
|
112
16
|
<div class="row">${msg('Range')}</div>
|
|
113
17
|
|
|
@@ -120,70 +24,16 @@ let RuleForm = class RuleForm extends LitElement {
|
|
|
120
24
|
</og-input>
|
|
121
25
|
</div>
|
|
122
26
|
|
|
123
|
-
${
|
|
124
|
-
['formula', this.renderFormulaForm],
|
|
125
|
-
['scale', this.renderScaleForm],
|
|
126
|
-
['bar', this.renderBarForm],
|
|
127
|
-
['icon', this.renderIconForm],
|
|
128
|
-
])}
|
|
27
|
+
<og-editor-ruleeditor .format="${this.format}"></og-editor-ruleeditor>
|
|
129
28
|
` : null;
|
|
130
29
|
}
|
|
131
|
-
_onStyleChange(e, format) {
|
|
132
|
-
format.style = this.model.styles.add(e.value);
|
|
133
|
-
}
|
|
134
30
|
updateFormat() {
|
|
135
31
|
if (!this.format)
|
|
136
32
|
return;
|
|
137
|
-
let update = false;
|
|
138
|
-
if (this.conditionInput)
|
|
139
|
-
this.format.condition = this.conditionInput.value;
|
|
140
|
-
else
|
|
141
|
-
this.format.condition = null;
|
|
142
33
|
if (this.rangesInput)
|
|
143
34
|
this.format.ranges = CellRange.fromA1s(this.rangesInput.value);
|
|
144
35
|
else
|
|
145
36
|
this.format.ranges = null;
|
|
146
|
-
if (this.styleForm)
|
|
147
|
-
this.format.style = this.styleForm.data;
|
|
148
|
-
else
|
|
149
|
-
this.format.style = null;
|
|
150
|
-
if (this.cminInput) {
|
|
151
|
-
this.format.cmin = this.format.cmin ?? {};
|
|
152
|
-
this.format.cmin.t = 'min';
|
|
153
|
-
this.format.cmin.color = colors.plainHex(this.cminInput.value);
|
|
154
|
-
}
|
|
155
|
-
else
|
|
156
|
-
this.format.cmin = null;
|
|
157
|
-
if (this.cmidInput) {
|
|
158
|
-
this.format.cmid = this.format.cmid ?? {};
|
|
159
|
-
this.format.cmid.color = colors.plainHex(this.cmidInput.value);
|
|
160
|
-
}
|
|
161
|
-
else
|
|
162
|
-
this.format.cmid = null;
|
|
163
|
-
if (this.cmaxInput) {
|
|
164
|
-
this.format.cmax = this.format.cmax ?? {};
|
|
165
|
-
this.format.cmax.t = 'max';
|
|
166
|
-
this.format.cmax.color = colors.plainHex(this.cmaxInput.value);
|
|
167
|
-
}
|
|
168
|
-
else
|
|
169
|
-
this.format.cmax = null;
|
|
170
|
-
if (this.colorInput)
|
|
171
|
-
this.format.color = colors.plainHex(this.colorInput.value);
|
|
172
|
-
else
|
|
173
|
-
this.format.color = null;
|
|
174
|
-
if (this.iconList) {
|
|
175
|
-
if (this.format.v != this.iconList.value)
|
|
176
|
-
update = true;
|
|
177
|
-
this.format.v = this.iconList.value;
|
|
178
|
-
}
|
|
179
|
-
else
|
|
180
|
-
this.format.v = null;
|
|
181
|
-
if (this.thresholds)
|
|
182
|
-
this.format.thresh = Array.from(this.thresholds).map(t => t.value);
|
|
183
|
-
else
|
|
184
|
-
this.format.thresh = null;
|
|
185
|
-
if (update)
|
|
186
|
-
this.requestUpdate();
|
|
187
37
|
}
|
|
188
38
|
};
|
|
189
39
|
RuleForm.styles = [style];
|
|
@@ -199,27 +49,6 @@ __decorate([
|
|
|
199
49
|
__decorate([
|
|
200
50
|
query('og-input#condition')
|
|
201
51
|
], RuleForm.prototype, "conditionInput", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
query('og-dropdown-colorpicker#cmin')
|
|
204
|
-
], RuleForm.prototype, "cminInput", void 0);
|
|
205
|
-
__decorate([
|
|
206
|
-
query('og-dropdown-colorpicker#cmid')
|
|
207
|
-
], RuleForm.prototype, "cmidInput", void 0);
|
|
208
|
-
__decorate([
|
|
209
|
-
query('og-dropdown-colorpicker#cmax')
|
|
210
|
-
], RuleForm.prototype, "cmaxInput", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
query('og-dropdown-colorpicker#color')
|
|
213
|
-
], RuleForm.prototype, "colorInput", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
query('og-dropdown-list#icons')
|
|
216
|
-
], RuleForm.prototype, "iconList", void 0);
|
|
217
|
-
__decorate([
|
|
218
|
-
query('og-editor-form-style#style')
|
|
219
|
-
], RuleForm.prototype, "styleForm", void 0);
|
|
220
|
-
__decorate([
|
|
221
|
-
queryAll('og-editor-rule-threshold')
|
|
222
|
-
], RuleForm.prototype, "thresholds", void 0);
|
|
223
52
|
RuleForm = __decorate([
|
|
224
53
|
customElement('og-editor-form-rule')
|
|
225
54
|
], RuleForm);
|