@omegagrid/editor 0.10.1 → 0.10.2
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/package.json +10 -10
- package/dist/commands/index.d.ts +0 -3
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -34
- package/dist/commands/index.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/options.d.ts +0 -12
- package/dist/options.d.ts.map +0 -1
- package/dist/options.js +0 -14
- package/dist/options.js.map +0 -1
- package/dist/ui/editor.d.ts +0 -76
- package/dist/ui/editor.d.ts.map +0 -1
- package/dist/ui/editor.js +0 -338
- package/dist/ui/editor.js.map +0 -1
- package/dist/ui/editor.style.d.ts +0 -2
- package/dist/ui/editor.style.d.ts.map +0 -1
- package/dist/ui/editor.style.js +0 -38
- package/dist/ui/editor.style.js.map +0 -1
- package/dist/ui/editorZoom.d.ts +0 -16
- package/dist/ui/editorZoom.d.ts.map +0 -1
- package/dist/ui/editorZoom.js +0 -82
- package/dist/ui/editorZoom.js.map +0 -1
- package/dist/ui/editors/hyperlinkEditor.d.ts +0 -10
- package/dist/ui/editors/hyperlinkEditor.d.ts.map +0 -1
- package/dist/ui/editors/hyperlinkEditor.js +0 -70
- package/dist/ui/editors/hyperlinkEditor.js.map +0 -1
- package/dist/ui/editors/index.d.ts +0 -6
- package/dist/ui/editors/index.d.ts.map +0 -1
- package/dist/ui/editors/index.js +0 -6
- package/dist/ui/editors/index.js.map +0 -1
- package/dist/ui/editors/ruleEditor.d.ts +0 -27
- package/dist/ui/editors/ruleEditor.d.ts.map +0 -1
- package/dist/ui/editors/ruleEditor.js +0 -251
- package/dist/ui/editors/ruleEditor.js.map +0 -1
- package/dist/ui/editors/styleEditor.d.ts +0 -14
- package/dist/ui/editors/styleEditor.d.ts.map +0 -1
- package/dist/ui/editors/styleEditor.js +0 -160
- package/dist/ui/editors/styleEditor.js.map +0 -1
- package/dist/ui/editors/themeEditor.d.ts +0 -24
- package/dist/ui/editors/themeEditor.d.ts.map +0 -1
- package/dist/ui/editors/themeEditor.js +0 -138
- package/dist/ui/editors/themeEditor.js.map +0 -1
- package/dist/ui/editors/themeItemEditor.d.ts +0 -22
- package/dist/ui/editors/themeItemEditor.d.ts.map +0 -1
- package/dist/ui/editors/themeItemEditor.js +0 -181
- package/dist/ui/editors/themeItemEditor.js.map +0 -1
- package/dist/ui/forms/configForm.d.ts +0 -12
- package/dist/ui/forms/configForm.d.ts.map +0 -1
- package/dist/ui/forms/configForm.js +0 -101
- package/dist/ui/forms/configForm.js.map +0 -1
- package/dist/ui/forms/headerForm.d.ts +0 -18
- package/dist/ui/forms/headerForm.d.ts.map +0 -1
- package/dist/ui/forms/headerForm.js +0 -144
- package/dist/ui/forms/headerForm.js.map +0 -1
- package/dist/ui/forms/index.d.ts +0 -9
- package/dist/ui/forms/index.d.ts.map +0 -1
- package/dist/ui/forms/index.js +0 -9
- package/dist/ui/forms/index.js.map +0 -1
- package/dist/ui/forms/namesForm.d.ts +0 -21
- package/dist/ui/forms/namesForm.d.ts.map +0 -1
- package/dist/ui/forms/namesForm.js +0 -124
- package/dist/ui/forms/namesForm.js.map +0 -1
- package/dist/ui/forms/ruleForm.d.ts +0 -13
- package/dist/ui/forms/ruleForm.d.ts.map +0 -1
- package/dist/ui/forms/ruleForm.js +0 -56
- package/dist/ui/forms/ruleForm.js.map +0 -1
- package/dist/ui/forms/ruleForm.style.d.ts +0 -2
- package/dist/ui/forms/ruleForm.style.d.ts.map +0 -1
- package/dist/ui/forms/ruleForm.style.js +0 -50
- package/dist/ui/forms/ruleForm.style.js.map +0 -1
- package/dist/ui/forms/ruleFormThreshold.d.ts +0 -19
- package/dist/ui/forms/ruleFormThreshold.d.ts.map +0 -1
- package/dist/ui/forms/ruleFormThreshold.js +0 -97
- package/dist/ui/forms/ruleFormThreshold.js.map +0 -1
- package/dist/ui/forms/ruleList.d.ts +0 -25
- package/dist/ui/forms/ruleList.d.ts.map +0 -1
- package/dist/ui/forms/ruleList.js +0 -169
- package/dist/ui/forms/ruleList.js.map +0 -1
- package/dist/ui/forms/ruleList.style.d.ts +0 -3
- package/dist/ui/forms/ruleList.style.d.ts.map +0 -1
- package/dist/ui/forms/ruleList.style.js +0 -69
- package/dist/ui/forms/ruleList.style.js.map +0 -1
- package/dist/ui/forms/sparklineForm.d.ts +0 -22
- package/dist/ui/forms/sparklineForm.d.ts.map +0 -1
- package/dist/ui/forms/sparklineForm.js +0 -199
- package/dist/ui/forms/sparklineForm.js.map +0 -1
- package/dist/ui/forms/sparklineForm.style.d.ts +0 -3
- package/dist/ui/forms/sparklineForm.style.d.ts.map +0 -1
- package/dist/ui/forms/sparklineForm.style.js +0 -94
- package/dist/ui/forms/sparklineForm.style.js.map +0 -1
- package/dist/ui/forms/styleForm.d.ts +0 -14
- package/dist/ui/forms/styleForm.d.ts.map +0 -1
- package/dist/ui/forms/styleForm.js +0 -151
- package/dist/ui/forms/styleForm.js.map +0 -1
- package/dist/ui/formulabar.d.ts +0 -23
- package/dist/ui/formulabar.d.ts.map +0 -1
- package/dist/ui/formulabar.js +0 -155
- package/dist/ui/formulabar.js.map +0 -1
- package/dist/ui/formulabar.style.d.ts +0 -2
- package/dist/ui/formulabar.style.d.ts.map +0 -1
- package/dist/ui/formulabar.style.js +0 -48
- package/dist/ui/formulabar.style.js.map +0 -1
- package/dist/ui/gridStats.d.ts +0 -11
- package/dist/ui/gridStats.d.ts.map +0 -1
- package/dist/ui/gridStats.js +0 -71
- package/dist/ui/gridStats.js.map +0 -1
- package/dist/ui/index.d.ts +0 -11
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -11
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/sidebars/baseSidebar.d.ts +0 -10
- package/dist/ui/sidebars/baseSidebar.d.ts.map +0 -1
- package/dist/ui/sidebars/baseSidebar.js +0 -24
- package/dist/ui/sidebars/baseSidebar.js.map +0 -1
- package/dist/ui/sidebars/index.d.ts +0 -2
- package/dist/ui/sidebars/index.d.ts.map +0 -1
- package/dist/ui/sidebars/index.js +0 -2
- package/dist/ui/sidebars/index.js.map +0 -1
- package/dist/ui/sidebars/themeEditorSidebar.d.ts +0 -14
- package/dist/ui/sidebars/themeEditorSidebar.d.ts.map +0 -1
- package/dist/ui/sidebars/themeEditorSidebar.js +0 -110
- package/dist/ui/sidebars/themeEditorSidebar.js.map +0 -1
- package/dist/ui/statusbar.d.ts +0 -19
- package/dist/ui/statusbar.d.ts.map +0 -1
- package/dist/ui/statusbar.js +0 -69
- package/dist/ui/statusbar.js.map +0 -1
- package/dist/ui/toolbar.config.d.ts +0 -7
- package/dist/ui/toolbar.config.d.ts.map +0 -1
- package/dist/ui/toolbar.config.js +0 -166
- package/dist/ui/toolbar.config.js.map +0 -1
- package/dist/ui/toolbar.d.ts +0 -42
- package/dist/ui/toolbar.d.ts.map +0 -1
- package/dist/ui/toolbar.js +0 -356
- package/dist/ui/toolbar.js.map +0 -1
- package/dist/ui/toolbar.style.d.ts +0 -2
- package/dist/ui/toolbar.style.d.ts.map +0 -1
- package/dist/ui/toolbar.style.js +0 -22
- package/dist/ui/toolbar.style.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor.style.js","sourceRoot":"","sources":["../../src/ui/editor.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const style = css`\n\t:host {\n\t\tbox-sizing: border-box;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tposition: relative;\n\t\t-webkit-user-select: none;\n\t\tuser-select: none;\n\t\theight: 100%;\n\t\tcolor: var(--og-text-color);\n\t\tbackground-color: var(--og-background-color);\n\t\tfont-family: var(--og-font-family);\n\t}\n\n\t.toolbar {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t}\n\n\tog-splitcontainer {\n\t\tflex: 1;\n\t}\n\n\tog-editor-toolbar, og-editor-formula {\n\t\tflex: 0;\n\t\t//min-height: 30px;\n\t\theight: 30px;\n\t}\n\n\tog-overlay {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\t//pointer-events: none;\n\t}\n`;"]}
|
package/dist/ui/editorZoom.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAI,IAAI,UAAU,UAE9B;IAED,QAAQ,GAAI,GAAG,UAAU,UAGxB;IAED,WAAW,GAAI,GAAG,UAAU,UAK3B;IAEK,OAAO;IAYb,MAAM,6CAYJ;CAEF"}
|
package/dist/ui/editorZoom.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
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, css } from 'lit';
|
|
8
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
9
|
-
let EditorZoom = class EditorZoom extends LitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this._onSlideStart = (_e) => {
|
|
13
|
-
this.group.hideSelectors();
|
|
14
|
-
};
|
|
15
|
-
this._onSlide = (e) => {
|
|
16
|
-
this.updateText(e.value);
|
|
17
|
-
this.group.previewZoom(this.translateValue(e.value));
|
|
18
|
-
};
|
|
19
|
-
this._onSlideEnd = (e) => {
|
|
20
|
-
this.group.showSelectors();
|
|
21
|
-
this.slider.value = Math.round(e.value / 10) * 10;
|
|
22
|
-
this.updateText(this.slider.value);
|
|
23
|
-
this.group.zoom = this.translateValue(this.slider.value);
|
|
24
|
-
};
|
|
25
|
-
this.render = () => html `
|
|
26
|
-
<div id="inner">
|
|
27
|
-
<og-slider
|
|
28
|
-
cursor="ew-resize"
|
|
29
|
-
maxValue="200"
|
|
30
|
-
pageSize="80"
|
|
31
|
-
value="100"
|
|
32
|
-
@slideStart="${this._onSlideStart}"
|
|
33
|
-
@slide="${this._onSlide}"
|
|
34
|
-
@slideEnd="${this._onSlideEnd}">
|
|
35
|
-
</og-slider>
|
|
36
|
-
</div>
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
translateValue(value) {
|
|
40
|
-
return Math.round(value < 100 ? (50 + value / 2) : value) / 100;
|
|
41
|
-
}
|
|
42
|
-
updateText(value) {
|
|
43
|
-
this.slider.setText(`${Math.round((this.translateValue(value) * 100)).toString()}%`);
|
|
44
|
-
}
|
|
45
|
-
async updated() {
|
|
46
|
-
let value = 1;
|
|
47
|
-
if (this.group) {
|
|
48
|
-
await this.group.updateComplete;
|
|
49
|
-
value = this.group.zoom;
|
|
50
|
-
}
|
|
51
|
-
await this.updateComplete;
|
|
52
|
-
this.slider.value = value * 100;
|
|
53
|
-
this.updateText(this.slider.value);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
EditorZoom.styles = [css `
|
|
57
|
-
:host {
|
|
58
|
-
display: block;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
#inner {
|
|
62
|
-
height: 100%;
|
|
63
|
-
display: flex;
|
|
64
|
-
flex-direction: row;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
og-slider {
|
|
68
|
-
width: 200px;
|
|
69
|
-
height: 100%;
|
|
70
|
-
}
|
|
71
|
-
`];
|
|
72
|
-
__decorate([
|
|
73
|
-
property({ type: Object })
|
|
74
|
-
], EditorZoom.prototype, "group", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
query('og-slider')
|
|
77
|
-
], EditorZoom.prototype, "slider", void 0);
|
|
78
|
-
EditorZoom = __decorate([
|
|
79
|
-
customElement('og-editor-zoom')
|
|
80
|
-
], EditorZoom);
|
|
81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BACV,IAAI,CAAC,WAAW;;;EAG/B,CAAC;IAEH,CAAC;IAlDA,cAAc,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;IACjE,CAAC;IAED,UAAU,CAAC,KAAa;QACvB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACtF,CAAC;IAkBD,KAAK,CAAC,OAAO;QACZ,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;YAChC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,CAAC;QAED,MAAM,IAAI,CAAC,cAAc,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,GAAG,GAAG,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAzDM,iBAAM,GAAG,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;EAenB,CAAC,AAfW,CAeV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yCACR;AAGjB;IADC,KAAK,CAAC,WAAW,CAAC;0CACJ;AAvBH,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CA2EtB","sourcesContent":["import { GridGroup } from '@omegagrid/grid';\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { SlideEvent, Slider } from '@omegagrid/core';\n\n@customElement('og-editor-zoom')\nexport class EditorZoom extends LitElement {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\n\t\t#inner {\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t}\n\n\t\tog-slider {\n\t\t\twidth: 200px;\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\tgroup: GridGroup;\n\n\t@query('og-slider')\n\tslider: Slider;\n\n\ttranslateValue(value: number) {\n\t\treturn Math.round(value < 100 ? (50 + value / 2) : value) / 100;\n\t}\n\n\tupdateText(value: number) {\n\t\tthis.slider.setText(`${Math.round((this.translateValue(value) * 100)).toString()}%`);\n\t}\n\n\t_onSlideStart = (_e: SlideEvent) => {\n\t\tthis.group.hideSelectors();\n\t}\n\n\t_onSlide = (e: SlideEvent) => {\n\t\tthis.updateText(e.value);\n\t\tthis.group.previewZoom(this.translateValue(e.value));\n\t}\n\n\t_onSlideEnd = (e: SlideEvent) => {\n\t\tthis.group.showSelectors();\n\t\tthis.slider.value = Math.round(e.value / 10) * 10;\n\t\tthis.updateText(this.slider.value);\n\t\tthis.group.zoom = this.translateValue(this.slider.value);\n\t}\n\n\tasync updated() {\n\t\tlet value = 1;\n\t\tif (this.group) {\n\t\t\tawait this.group.updateComplete;\n\t\t\tvalue = this.group.zoom;\n\t\t}\n\n\t\tawait this.updateComplete;\n\t\tthis.slider.value = value * 100;\n\t\tthis.updateText(this.slider.value);\n\t}\n\n\trender = () => html`\n\t\t<div id=\"inner\">\n\t\t\t<og-slider\n\t\t\t\tcursor=\"ew-resize\"\n\t\t\t\tmaxValue=\"200\"\n\t\t\t\tpageSize=\"80\"\n\t\t\t\tvalue=\"100\"\n\t\t\t\t@slideStart=\"${this._onSlideStart}\"\n\t\t\t\t@slide=\"${this._onSlide}\"\n\t\t\t\t@slideEnd=\"${this._onSlideEnd}\">\n\t\t\t</og-slider>\n\t\t</div>\n\t`;\n\n}"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Input, OmegaComponent } from "@omegagrid/core";
|
|
2
|
-
export declare class HyperlinkEditor extends OmegaComponent {
|
|
3
|
-
static styles: import("lit").CSSResultGroup[];
|
|
4
|
-
href: string;
|
|
5
|
-
input: Input;
|
|
6
|
-
focus(): void;
|
|
7
|
-
updateValue(value: string, dispatchEvent?: boolean): void;
|
|
8
|
-
render: () => import("lit-html").TemplateResult<1>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=hyperlinkEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hyperlinkEditor.d.ts","sourceRoot":"","sources":["../../../src/ui/editors/hyperlinkEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIhE,qBACa,eAAgB,SAAQ,cAAc;IAElD,MAAM,CAAC,MAAM,iCAkBV;IAGH,IAAI,EAAE,MAAM,CAAM;IAGlB,KAAK,EAAE,KAAK,CAAC;IAEb,KAAK;IAKL,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,UAAO;IAO/C,MAAM,6CAcJ;CAEF"}
|
|
@@ -1,70 +0,0 @@
|
|
|
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 { events, OmegaComponent } from "@omegagrid/core";
|
|
8
|
-
import { customElement, property, query } from "lit/decorators.js";
|
|
9
|
-
import { html, css } from "lit";
|
|
10
|
-
let HyperlinkEditor = class HyperlinkEditor extends OmegaComponent {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.href = '';
|
|
14
|
-
this.render = () => html `
|
|
15
|
-
<div>
|
|
16
|
-
<og-input
|
|
17
|
-
.value="${this.href || ''}"
|
|
18
|
-
@change="${(e) => this.updateValue(e.value)}">
|
|
19
|
-
</og-input>
|
|
20
|
-
|
|
21
|
-
<og-button
|
|
22
|
-
id="cross"
|
|
23
|
-
@click="${() => this.updateValue(null)}"
|
|
24
|
-
icon="xmark"
|
|
25
|
-
color="red">
|
|
26
|
-
</og-button>
|
|
27
|
-
</div>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
30
|
-
focus() {
|
|
31
|
-
this.input?.focus();
|
|
32
|
-
this.input?.selectAll();
|
|
33
|
-
}
|
|
34
|
-
updateValue(value, dispatchEvent = true) {
|
|
35
|
-
this.href = value;
|
|
36
|
-
if (dispatchEvent) {
|
|
37
|
-
this.dispatchEvent(new events.ChangeEvent({ value: this.href }));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
HyperlinkEditor.styles = [OmegaComponent.styles, css `
|
|
42
|
-
:host {
|
|
43
|
-
width: 200px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
div {
|
|
47
|
-
display: flex;
|
|
48
|
-
flex-direction: row;
|
|
49
|
-
padding: 5px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
og-input {
|
|
53
|
-
flex: 1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
og-button {
|
|
57
|
-
flex: 0 20px;
|
|
58
|
-
}
|
|
59
|
-
`];
|
|
60
|
-
__decorate([
|
|
61
|
-
property({ type: String })
|
|
62
|
-
], HyperlinkEditor.prototype, "href", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
query('og-input')
|
|
65
|
-
], HyperlinkEditor.prototype, "input", void 0);
|
|
66
|
-
HyperlinkEditor = __decorate([
|
|
67
|
-
customElement('og-hyperlinkeditor')
|
|
68
|
-
], HyperlinkEditor);
|
|
69
|
-
export { HyperlinkEditor };
|
|
70
|
-
//# sourceMappingURL=hyperlinkEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hyperlinkEditor.js","sourceRoot":"","sources":["../../../src/ui/editors/hyperlinkEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAS,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAGzB,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,cAAc;IAA5C;;QAuBN,SAAI,GAAW,EAAE,CAAC;QAiBlB,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;;;cAGN,IAAI,CAAC,IAAI,IAAI,EAAE;eACd,CAAC,CAA6B,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;;;;;cAK7D,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;;;;;EAKxC,CAAC;IAEH,CAAC;IA5BA,KAAK;QACJ,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC;IACzB,CAAC;IAED,WAAW,CAAC,KAAa,EAAE,aAAa,GAAG,IAAI;QAC9C,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,aAAa,EAAE,CAAC;YACnB,IAAI,CAAC,aAAa,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;;AApCM,sBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;EAkB1C,CAAC,AAlBW,CAkBV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACP;AAGlB;IADC,KAAK,CAAC,UAAU,CAAC;8CACL;AA1BD,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CAwD3B","sourcesContent":["import { events, Input, OmegaComponent } from \"@omegagrid/core\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { html, css } from \"lit\";\n\n@customElement('og-hyperlinkeditor')\nexport class HyperlinkEditor extends OmegaComponent {\n\n\tstatic styles = [OmegaComponent.styles, css`\n\t\t:host {\n\t\t\twidth: 200px;\n\t\t}\n\n\t\tdiv {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\tpadding: 5px;\n\t\t}\n\n\t\tog-input {\n\t\t\tflex: 1;\n\t\t}\n\n\t\tog-button {\n\t\t\tflex: 0 20px;\n\t\t}\n\t`];\n\n\t@property({type: String})\n\thref: string = '';\n\n\t@query('og-input')\n\tinput: Input;\n\n\tfocus() {\n\t\tthis.input?.focus();\n\t\tthis.input?.selectAll();\n\t}\n\n\tupdateValue(value: string, dispatchEvent = true) {\n\t\tthis.href = value;\n\t\tif (dispatchEvent) {\n\t\t\tthis.dispatchEvent(new events.ChangeEvent({value: this.href}));\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t<div>\n\t\t\t<og-input \n\t\t\t\t.value=\"${this.href || ''}\"\n\t\t\t\t@change=\"${(e: events.ChangeEvent<string>) => this.updateValue(e.value)}\">\n\t\t\t</og-input>\n\n\t\t\t<og-button\n\t\t\t\tid=\"cross\"\n\t\t\t\t@click=\"${() => this.updateValue(null)}\"\n\t\t\t\ticon=\"xmark\"\n\t\t\t\tcolor=\"red\">\n\t\t\t</og-button>\n\t\t</div>\n\t`;\n\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/editors/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
package/dist/ui/editors/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/editors/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './themeEditor';\nexport * from './themeItemEditor';\nexport * from './ruleEditor';\nexport * from './styleEditor';\nexport * from './hyperlinkEditor';"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ConditionalFormat } from '@omegagrid/grid';
|
|
2
|
-
import { DropdownColorPicker, DropdownList, Input, MenuItem, OmegaComponent } from '@omegagrid/core';
|
|
3
|
-
import { RuleThreshold, StyleForm } from '../forms';
|
|
4
|
-
export declare class RuleEditor extends OmegaComponent {
|
|
5
|
-
static styles: import("lit").CSSResultGroup[];
|
|
6
|
-
format: ConditionalFormat;
|
|
7
|
-
rangesInput: Input;
|
|
8
|
-
conditionInput: Input;
|
|
9
|
-
cminColorInput: DropdownColorPicker;
|
|
10
|
-
cmidColorInput: DropdownColorPicker;
|
|
11
|
-
cmaxColorInput: DropdownColorPicker;
|
|
12
|
-
colorInput: DropdownColorPicker;
|
|
13
|
-
iconList: DropdownList;
|
|
14
|
-
styleForm: StyleForm;
|
|
15
|
-
thresholds: NodeListOf<RuleThreshold>;
|
|
16
|
-
cmin: RuleThreshold;
|
|
17
|
-
cmid: RuleThreshold;
|
|
18
|
-
cmax: RuleThreshold;
|
|
19
|
-
updateFormat(): void;
|
|
20
|
-
renderFormulaForm: () => import("lit-html").TemplateResult<1>;
|
|
21
|
-
renderScaleForm: () => import("lit-html").TemplateResult<1>;
|
|
22
|
-
renderBarForm: () => import("lit-html").TemplateResult<1>;
|
|
23
|
-
iconItemRenderer: (div: HTMLDivElement, index: number, item: MenuItem) => import("lit-html").TemplateResult<1>;
|
|
24
|
-
renderIconForm: () => import("lit-html").TemplateResult<1>;
|
|
25
|
-
render: () => import("lit-html").TemplateResult<1>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=ruleEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ruleEditor.d.ts","sourceRoot":"","sources":["../../../src/ui/editors/ruleEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAuC,MAAM,iBAAiB,CAAC;AAEzF,OAAO,EAAU,mBAAmB,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7G,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIpD,qBACa,UAAW,SAAQ,cAAc;IAE7C,MAAM,CAAC,MAAM,iCAEV;IAGH,MAAM,EAAE,iBAAiB,CAAC;IAG1B,WAAW,EAAE,KAAK,CAAC;IAGnB,cAAc,EAAE,KAAK,CAAC;IAGtB,cAAc,EAAE,mBAAmB,CAAC;IAGpC,cAAc,EAAE,mBAAmB,CAAC;IAGpC,cAAc,EAAE,mBAAmB,CAAC;IAGpC,UAAU,EAAE,mBAAmB,CAAC;IAGhC,QAAQ,EAAE,YAAY,CAAC;IAGvB,SAAS,EAAE,SAAS,CAAC;IAGrB,UAAU,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAGtC,IAAI,EAAE,aAAa,CAAC;IAGpB,IAAI,EAAE,aAAa,CAAC;IAGpB,IAAI,EAAE,aAAa,CAAC;IAEpB,YAAY;IAkDZ,iBAAiB,6CAqBf;IAEF,eAAe,6CAwBb;IAEF,aAAa,6CAgCX;IAEF,gBAAgB,GAAI,KAAK,cAAc,EAAE,OAAO,MAAM,EAAE,MAAM,QAAQ,0CAMpE;IAEF,cAAc,6CA8BZ;IAEF,MAAM,6CAKJ;CACF"}
|
|
@@ -1,251 +0,0 @@
|
|
|
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, queryAll } from 'lit/decorators.js';
|
|
8
|
-
import { iconSets } from '@omegagrid/grid';
|
|
9
|
-
import { css, html } from 'lit';
|
|
10
|
-
import { colors, OmegaComponent } from '@omegagrid/core';
|
|
11
|
-
import { msg } from '@omegagrid/localize';
|
|
12
|
-
import { map } from 'lit-html/directives/map.js';
|
|
13
|
-
import { choose } from 'lit-html/directives/choose.js';
|
|
14
|
-
let RuleEditor = class RuleEditor extends OmegaComponent {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.renderFormulaForm = () => html `
|
|
18
|
-
<div class="row">${msg('Condition')}</div>
|
|
19
|
-
|
|
20
|
-
<div class="row">
|
|
21
|
-
<og-input
|
|
22
|
-
id="condition"
|
|
23
|
-
.value="${this.format.condition || ''}"
|
|
24
|
-
style="width: 100%"
|
|
25
|
-
@change="${() => this.updateFormat()}">
|
|
26
|
-
</og-input>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div class="row">${msg('Style')}</div>
|
|
30
|
-
|
|
31
|
-
<div class="row">
|
|
32
|
-
<og-editor-styleeditor
|
|
33
|
-
id="style"
|
|
34
|
-
.data="${this.format.style || {}}"
|
|
35
|
-
@change="${() => this.updateFormat()}">
|
|
36
|
-
</og-editor-styleeditor>
|
|
37
|
-
</div>
|
|
38
|
-
`;
|
|
39
|
-
this.renderScaleForm = () => html `
|
|
40
|
-
<div class="row">${msg('Colors')}</div>
|
|
41
|
-
<div class="row" style="display: flex; gap: 4px;">
|
|
42
|
-
<og-dropdown-colorpicker
|
|
43
|
-
id="cminColor"
|
|
44
|
-
style="flex: 1"
|
|
45
|
-
.value="${colors.css(this.format.cmin?.color)}"
|
|
46
|
-
@change="${() => this.updateFormat()}">
|
|
47
|
-
</og-dropdown-colorpicker>
|
|
48
|
-
|
|
49
|
-
<og-dropdown-colorpicker
|
|
50
|
-
id="cmidColor"
|
|
51
|
-
style="flex: 1"
|
|
52
|
-
.value="${colors.css(this.format.cmid?.color)}"
|
|
53
|
-
@change="${() => this.updateFormat()}">
|
|
54
|
-
</og-dropdown-colorpicker>
|
|
55
|
-
|
|
56
|
-
<og-dropdown-colorpicker
|
|
57
|
-
id="cmaxColor"
|
|
58
|
-
style="flex: 1"
|
|
59
|
-
.value="${colors.css(this.format.cmax?.color)}"
|
|
60
|
-
@change="${() => this.updateFormat()}">
|
|
61
|
-
</og-dropdown-colorpicker>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
this.renderBarForm = () => html `
|
|
65
|
-
<div class="row">${msg('Minimum')}</div>
|
|
66
|
-
<div class="row">
|
|
67
|
-
<og-editor-rule-threshold
|
|
68
|
-
id="cmin"
|
|
69
|
-
.value="${this.format?.cmin}"
|
|
70
|
-
.allowedTypes="${['auto', 'num', 'percent']}"
|
|
71
|
-
?first="${false}"
|
|
72
|
-
@change="${() => this.updateFormat()}">
|
|
73
|
-
</og-editor-rule-threshold>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div class="row">${msg('Maximum')}</div>
|
|
77
|
-
<div class="row">
|
|
78
|
-
<og-editor-rule-threshold
|
|
79
|
-
id="cmax"
|
|
80
|
-
.value="${this.format?.cmax}"
|
|
81
|
-
.allowedTypes="${['auto', 'num', 'percent']}"
|
|
82
|
-
?first="${false}"
|
|
83
|
-
@change="${() => this.updateFormat()}">
|
|
84
|
-
</og-editor-rule-threshold>
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<div class="row">${msg('Color')}</div>
|
|
88
|
-
<div class="row" style="display: flex; gap: 4px;">
|
|
89
|
-
<og-dropdown-colorpicker
|
|
90
|
-
id="color"
|
|
91
|
-
style="flex: 1"
|
|
92
|
-
.value="${colors.css(this.format.color)}"
|
|
93
|
-
@change="${() => this.updateFormat()}">
|
|
94
|
-
</og-dropdown-colorpicker>
|
|
95
|
-
</div>
|
|
96
|
-
`;
|
|
97
|
-
this.iconItemRenderer = (div, index, item) => html `
|
|
98
|
-
<div style="padding-left: 5px">
|
|
99
|
-
${map(iconSets.get(item.key), icon => html `
|
|
100
|
-
<og-icon .icon="${icon}"></og-icon>
|
|
101
|
-
`)} (${item.key})
|
|
102
|
-
</div>
|
|
103
|
-
`;
|
|
104
|
-
this.renderIconForm = () => html `
|
|
105
|
-
<div class="row">${msg('Icons')}</div>
|
|
106
|
-
<div class="row" style="display: flex; gap: 4px;">
|
|
107
|
-
<og-dropdown-list
|
|
108
|
-
id="icons"
|
|
109
|
-
style="flex: 1"
|
|
110
|
-
.items="${Array.from(iconSets.entries()).map(item => ({
|
|
111
|
-
key: item[0],
|
|
112
|
-
value: item[0],
|
|
113
|
-
renderer: this.iconItemRenderer
|
|
114
|
-
}))}"
|
|
115
|
-
.value="${this.format.v}"
|
|
116
|
-
@change="${() => this.updateFormat()}">
|
|
117
|
-
</og-dropdown-list>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
${this.format.v && iconSets.has(this.format.v) ? html `
|
|
121
|
-
<div class="row">${msg('Thresholds')}</div>
|
|
122
|
-
<div style="display: flex; flex-direction: column; gap: 2px; margin-top: 2px">
|
|
123
|
-
${map(iconSets.get(this.format.v), (_icon, i) => html `
|
|
124
|
-
<og-editor-rule-threshold
|
|
125
|
-
class="threshold"
|
|
126
|
-
.allowedTypes="${['num', 'percent']}"
|
|
127
|
-
.value="${this.format?.thresh[i]}"
|
|
128
|
-
?first="${i == 0}"
|
|
129
|
-
@change="${() => this.updateFormat()}">
|
|
130
|
-
</og-editor-rule-threshold>
|
|
131
|
-
`)}
|
|
132
|
-
</div>
|
|
133
|
-
` : ''}
|
|
134
|
-
`;
|
|
135
|
-
this.render = () => choose(this.format?.type, [
|
|
136
|
-
['formula', this.renderFormulaForm],
|
|
137
|
-
['scale', this.renderScaleForm],
|
|
138
|
-
['bar', this.renderBarForm],
|
|
139
|
-
['icon', this.renderIconForm],
|
|
140
|
-
]);
|
|
141
|
-
}
|
|
142
|
-
updateFormat() {
|
|
143
|
-
if (!this.format)
|
|
144
|
-
return;
|
|
145
|
-
let update = false;
|
|
146
|
-
if (this.conditionInput)
|
|
147
|
-
this.format.condition = this.conditionInput.value;
|
|
148
|
-
else
|
|
149
|
-
this.format.condition = null;
|
|
150
|
-
if (this.styleForm)
|
|
151
|
-
this.format.style = this.styleForm.data;
|
|
152
|
-
else
|
|
153
|
-
this.format.style = null;
|
|
154
|
-
if (this.cminColorInput) {
|
|
155
|
-
this.format.cmin = this.format.cmin ?? {};
|
|
156
|
-
this.format.cmin.t = 'min';
|
|
157
|
-
this.format.cmin.color = colors.plainHex(this.cminColorInput.value);
|
|
158
|
-
}
|
|
159
|
-
else
|
|
160
|
-
this.format.cmin = null;
|
|
161
|
-
if (this.cmidColorInput) {
|
|
162
|
-
this.format.cmid = this.format.cmid ?? {};
|
|
163
|
-
this.format.cmid.color = colors.plainHex(this.cmidColorInput.value);
|
|
164
|
-
}
|
|
165
|
-
else
|
|
166
|
-
this.format.cmid = null;
|
|
167
|
-
if (this.cmaxColorInput) {
|
|
168
|
-
this.format.cmax = this.format.cmax ?? {};
|
|
169
|
-
this.format.cmax.t = 'max';
|
|
170
|
-
this.format.cmax.color = colors.plainHex(this.cmaxColorInput.value);
|
|
171
|
-
}
|
|
172
|
-
else
|
|
173
|
-
this.format.cmax = null;
|
|
174
|
-
if (this.colorInput)
|
|
175
|
-
this.format.color = colors.plainHex(this.colorInput.value);
|
|
176
|
-
else
|
|
177
|
-
this.format.color = null;
|
|
178
|
-
if (this.iconList) {
|
|
179
|
-
if (this.format.v != this.iconList.value)
|
|
180
|
-
update = true;
|
|
181
|
-
this.format.v = this.iconList.value;
|
|
182
|
-
}
|
|
183
|
-
else
|
|
184
|
-
this.format.v = null;
|
|
185
|
-
if (this.thresholds)
|
|
186
|
-
this.format.thresh = Array.from(this.thresholds).map(t => t.value);
|
|
187
|
-
else
|
|
188
|
-
this.format.thresh = null;
|
|
189
|
-
if (this.cmin)
|
|
190
|
-
this.format.cmin = this.cmin.value;
|
|
191
|
-
else
|
|
192
|
-
this.format.cmin = null;
|
|
193
|
-
if (this.cmid)
|
|
194
|
-
this.format.cmid = this.cmid.value;
|
|
195
|
-
else
|
|
196
|
-
this.format.cmid = null;
|
|
197
|
-
if (this.cmax)
|
|
198
|
-
this.format.cmax = this.cmax.value;
|
|
199
|
-
else
|
|
200
|
-
this.format.cmax = null;
|
|
201
|
-
if (update)
|
|
202
|
-
this.requestUpdate();
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
RuleEditor.styles = [OmegaComponent.styles, css `
|
|
206
|
-
|
|
207
|
-
`];
|
|
208
|
-
__decorate([
|
|
209
|
-
property({ type: Object })
|
|
210
|
-
], RuleEditor.prototype, "format", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
query('og-input#ranges')
|
|
213
|
-
], RuleEditor.prototype, "rangesInput", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
query('og-input#condition')
|
|
216
|
-
], RuleEditor.prototype, "conditionInput", void 0);
|
|
217
|
-
__decorate([
|
|
218
|
-
query('og-dropdown-colorpicker#cminColor')
|
|
219
|
-
], RuleEditor.prototype, "cminColorInput", void 0);
|
|
220
|
-
__decorate([
|
|
221
|
-
query('og-dropdown-colorpicker#cmidColor')
|
|
222
|
-
], RuleEditor.prototype, "cmidColorInput", void 0);
|
|
223
|
-
__decorate([
|
|
224
|
-
query('og-dropdown-colorpicker#cmaxColor')
|
|
225
|
-
], RuleEditor.prototype, "cmaxColorInput", void 0);
|
|
226
|
-
__decorate([
|
|
227
|
-
query('og-dropdown-colorpicker#color')
|
|
228
|
-
], RuleEditor.prototype, "colorInput", void 0);
|
|
229
|
-
__decorate([
|
|
230
|
-
query('og-dropdown-list#icons')
|
|
231
|
-
], RuleEditor.prototype, "iconList", void 0);
|
|
232
|
-
__decorate([
|
|
233
|
-
query('og-editor-styleeditor#style')
|
|
234
|
-
], RuleEditor.prototype, "styleForm", void 0);
|
|
235
|
-
__decorate([
|
|
236
|
-
queryAll('og-editor-rule-threshold.threshold')
|
|
237
|
-
], RuleEditor.prototype, "thresholds", void 0);
|
|
238
|
-
__decorate([
|
|
239
|
-
query('og-editor-rule-threshold#cmin')
|
|
240
|
-
], RuleEditor.prototype, "cmin", void 0);
|
|
241
|
-
__decorate([
|
|
242
|
-
query('og-editor-rule-threshold#cmid')
|
|
243
|
-
], RuleEditor.prototype, "cmid", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
query('og-editor-rule-threshold#cmax')
|
|
246
|
-
], RuleEditor.prototype, "cmax", void 0);
|
|
247
|
-
RuleEditor = __decorate([
|
|
248
|
-
customElement('og-editor-ruleeditor')
|
|
249
|
-
], RuleEditor);
|
|
250
|
-
export { RuleEditor };
|
|
251
|
-
//# sourceMappingURL=ruleEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ruleEditor.js","sourceRoot":"","sources":["../../../src/ui/editors/ruleEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,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E7B,IAAI,MAAM;YAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IAClC,CAAC;;AA3FM,iBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAA;;EAE1C,CAAC,AAFW,CAEV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CACC;AAG1B;IADC,KAAK,CAAC,iBAAiB,CAAC;+CACN;AAGnB;IADC,KAAK,CAAC,oBAAoB,CAAC;kDACN;AAGtB;IADC,KAAK,CAAC,mCAAmC,CAAC;kDACP;AAGpC;IADC,KAAK,CAAC,mCAAmC,CAAC;kDACP;AAGpC;IADC,KAAK,CAAC,mCAAmC,CAAC;kDACP;AAGpC;IADC,KAAK,CAAC,+BAA+B,CAAC;8CACP;AAGhC;IADC,KAAK,CAAC,wBAAwB,CAAC;4CACT;AAGvB;IADC,KAAK,CAAC,6BAA6B,CAAC;6CAChB;AAGrB;IADC,QAAQ,CAAC,oCAAoC,CAAC;8CACT;AAGtC;IADC,KAAK,CAAC,+BAA+B,CAAC;wCACnB;AAGpB;IADC,KAAK,CAAC,+BAA+B,CAAC;wCACnB;AAGpB;IADC,KAAK,CAAC,+BAA+B,CAAC;wCACnB;AA3CR,UAAU;IADtB,aAAa,CAAC,sBAAsB,CAAC;GACzB,UAAU,CAgOtB","sourcesContent":["import { customElement, property, query, queryAll } from 'lit/decorators.js';\nimport { ConditionalFormat, ConditionalFormatIconType, iconSets } from '@omegagrid/grid';\nimport { css, html } from 'lit';\nimport { colors, DropdownColorPicker, DropdownList, Input, MenuItem, OmegaComponent } from '@omegagrid/core';\nimport { msg } from '@omegagrid/localize';\nimport { RuleThreshold, StyleForm } from '../forms';\nimport { map } from 'lit-html/directives/map.js';\nimport { choose } from 'lit-html/directives/choose.js';\n\n@customElement('og-editor-ruleeditor')\nexport class RuleEditor extends OmegaComponent {\n\n\tstatic styles = [OmegaComponent.styles, css`\n\t\t\n\t`];\n\n\t@property({type: Object})\n\tformat: ConditionalFormat;\n\n\t@query('og-input#ranges')\n\trangesInput: Input;\n\n\t@query('og-input#condition')\n\tconditionInput: Input;\n\n\t@query('og-dropdown-colorpicker#cminColor')\n\tcminColorInput: DropdownColorPicker;\n\n\t@query('og-dropdown-colorpicker#cmidColor')\n\tcmidColorInput: DropdownColorPicker;\n\n\t@query('og-dropdown-colorpicker#cmaxColor')\n\tcmaxColorInput: DropdownColorPicker;\n\n\t@query('og-dropdown-colorpicker#color')\n\tcolorInput: DropdownColorPicker;\n\n\t@query('og-dropdown-list#icons')\n\ticonList: DropdownList;\n\n\t@query('og-editor-styleeditor#style')\n\tstyleForm: StyleForm;\n\n\t@queryAll('og-editor-rule-threshold.threshold')\n\tthresholds: NodeListOf<RuleThreshold>;\n\n\t@query('og-editor-rule-threshold#cmin')\n\tcmin: RuleThreshold;\n\n\t@query('og-editor-rule-threshold#cmid')\n\tcmid: RuleThreshold;\n\n\t@query('og-editor-rule-threshold#cmax')\n\tcmax: RuleThreshold;\n\n\tupdateFormat() {\n\t\tif (!this.format) return;\n\t\tlet update = false;\n\n\t\tif (this.conditionInput) this.format.condition = this.conditionInput.value;\n\t\telse this.format.condition = null;\n\n\t\tif (this.styleForm) this.format.style = this.styleForm.data;\n\t\telse this.format.style = null;\n\n\t\tif (this.cminColorInput) {\n\t\t\tthis.format.cmin = this.format.cmin ?? {};\n\t\t\tthis.format.cmin.t = 'min';\n\t\t\tthis.format.cmin.color = colors.plainHex(this.cminColorInput.value);\n\t\t} else this.format.cmin = null;\n\n\t\tif (this.cmidColorInput) {\n\t\t\tthis.format.cmid = this.format.cmid ?? {};\n\t\t\tthis.format.cmid.color = colors.plainHex(this.cmidColorInput.value);\n\t\t} else this.format.cmid = null;\n\n\t\tif (this.cmaxColorInput) {\n\t\t\tthis.format.cmax = this.format.cmax ?? {};\n\t\t\tthis.format.cmax.t = 'max';\n\t\t\tthis.format.cmax.color = colors.plainHex(this.cmaxColorInput.value);\n\t\t} else this.format.cmax = null;\n\n\t\tif (this.colorInput) this.format.color = colors.plainHex(this.colorInput.value);\n\t\telse this.format.color = null;\n\n\t\tif (this.iconList) {\n\t\t\tif (this.format.v != this.iconList.value) update = true;\n\t\t\tthis.format.v = this.iconList.value;\t\n\t\t} else this.format.v = null;\n\n\t\tif (this.thresholds) this.format.thresh = Array.from(this.thresholds).map(t => t.value);\n\t\telse this.format.thresh = null;\n\n\t\tif (this.cmin) this.format.cmin = this.cmin.value;\n\t\telse this.format.cmin = null;\n\n\t\tif (this.cmid) this.format.cmid = this.cmid.value;\n\t\telse this.format.cmid = null;\n\n\t\tif (this.cmax) this.format.cmax = this.cmax.value;\n\t\telse this.format.cmax = null;\n\n\t\tif (update) this.requestUpdate();\n\t}\n\n\trenderFormulaForm = () => html`\n\t\t<div class=\"row\">${msg('Condition')}</div>\n\n\t\t<div class=\"row\">\n\t\t\t<og-input\n\t\t\t\tid=\"condition\"\n\t\t\t\t.value=\"${this.format.condition || ''}\"\n\t\t\t\tstyle=\"width: 100%\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-input>\n\t\t</div>\n\n\t\t<div class=\"row\">${msg('Style')}</div>\n\n\t\t<div class=\"row\">\n\t\t\t<og-editor-styleeditor\n\t\t\t\tid=\"style\"\n\t\t\t\t.data=\"${this.format.style || {}}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-editor-styleeditor>\n\t\t</div>\n\t`;\n\n\trenderScaleForm = () => html`\n\t\t<div class=\"row\">${msg('Colors')}</div>\n\t\t<div class=\"row\" style=\"display: flex; gap: 4px;\">\n\t\t\t<og-dropdown-colorpicker\n\t\t\t\tid=\"cminColor\"\n\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t.value=\"${colors.css(this.format.cmin?.color)}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-dropdown-colorpicker>\n\n\t\t\t<og-dropdown-colorpicker\n\t\t\t\tid=\"cmidColor\"\n\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t.value=\"${colors.css(this.format.cmid?.color)}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-dropdown-colorpicker>\n\n\t\t\t<og-dropdown-colorpicker\n\t\t\t\tid=\"cmaxColor\"\n\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t.value=\"${colors.css(this.format.cmax?.color)}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-dropdown-colorpicker>\n\t\t</div>\n\t`;\n\n\trenderBarForm = () => html`\n\t\t<div class=\"row\">${msg('Minimum')}</div>\n\t\t<div class=\"row\">\n\t\t\t<og-editor-rule-threshold\n\t\t\t\tid=\"cmin\"\n\t\t\t\t.value=\"${this.format?.cmin}\"\n\t\t\t\t.allowedTypes=\"${['auto', 'num', 'percent']}\"\n\t\t\t\t?first=\"${false}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-editor-rule-threshold>\n\t\t</div>\n\n\t\t<div class=\"row\">${msg('Maximum')}</div>\n\t\t<div class=\"row\">\n\t\t\t<og-editor-rule-threshold\n\t\t\t\tid=\"cmax\"\n\t\t\t\t.value=\"${this.format?.cmax}\" \n\t\t\t\t.allowedTypes=\"${['auto', 'num', 'percent']}\"\n\t\t\t\t?first=\"${false}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-editor-rule-threshold>\n\t\t</div>\n\t\t\n\t\t<div class=\"row\">${msg('Color')}</div>\n\t\t<div class=\"row\" style=\"display: flex; gap: 4px;\">\n\t\t\t<og-dropdown-colorpicker\n\t\t\t\tid=\"color\"\n\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t.value=\"${colors.css(this.format.color)}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-dropdown-colorpicker>\n\t\t</div>\n\t`;\n\n\ticonItemRenderer = (div: HTMLDivElement, index: number, item: MenuItem) => html`\n\t\t<div style=\"padding-left: 5px\">\n\t\t\t${map(iconSets.get(item.key as ConditionalFormatIconType), icon => html`\n\t\t\t\t<og-icon .icon=\"${icon}\"></og-icon>\n\t\t\t`)} (${item.key})\n\t\t</div>\n\t`;\n\n\trenderIconForm = () => html`\n\t\t<div class=\"row\">${msg('Icons')}</div>\n\t\t<div class=\"row\" style=\"display: flex; gap: 4px;\">\n\t\t\t<og-dropdown-list\n\t\t\t\tid=\"icons\"\n\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t.items=\"${Array.from(iconSets.entries()).map(item => ({\n\t\t\t\t\tkey: item[0],\n\t\t\t\t\tvalue: item[0],\n\t\t\t\t\trenderer: this.iconItemRenderer\n\t\t\t\t}))}\"\n\t\t\t\t.value=\"${this.format.v as string}\"\n\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t</og-dropdown-list>\n\t\t</div>\n\n\t\t${this.format.v && iconSets.has(this.format.v as ConditionalFormatIconType) ? html`\n\t\t\t<div class=\"row\">${msg('Thresholds')}</div>\n\t\t\t<div style=\"display: flex; flex-direction: column; gap: 2px; margin-top: 2px\">\n\t\t\t\t${map(iconSets.get(this.format.v as ConditionalFormatIconType), (_icon, i) => html`\n\t\t\t\t\t<og-editor-rule-threshold\n\t\t\t\t\t\tclass=\"threshold\"\n\t\t\t\t\t\t.allowedTypes=\"${['num', 'percent']}\"\n\t\t\t\t\t\t.value=\"${this.format?.thresh[i]}\" \n\t\t\t\t\t\t?first=\"${i == 0}\"\n\t\t\t\t\t\t@change=\"${() => this.updateFormat()}\">\n\t\t\t\t\t</og-editor-rule-threshold>\n\t\t\t\t`)}\n\t\t\t</div>\n\t\t` : ''}\n\t`;\n\n\trender = () => choose(this.format?.type, [\n\t\t['formula', this.renderFormulaForm],\n\t\t['scale', this.renderScaleForm],\n\t\t['bar', this.renderBarForm],\n\t\t['icon', this.renderIconForm],\n\t])\n}"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { actions } from '@omegagrid/core';
|
|
2
|
-
import { Style } from '@omegagrid/grid';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
import { Toolbar } from '@omegagrid/toolbar';
|
|
5
|
-
export declare class StyleEditor extends LitElement {
|
|
6
|
-
static styles: import("lit").CSSResult[];
|
|
7
|
-
data: Style;
|
|
8
|
-
toolbar: Toolbar;
|
|
9
|
-
styleToToolbarValues(s: Style): Record<string, unknown>;
|
|
10
|
-
connectedCallback(): void;
|
|
11
|
-
_onAction: (e: actions.ActionEvent) => void;
|
|
12
|
-
render: () => import("lit-html").TemplateResult<1>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=styleEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styleEditor.d.ts","sourceRoot":"","sources":["../../../src/ui/editors/styleEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAe,MAAM,oBAAoB,CAAC;AA+C1D,qBACa,WAAY,SAAQ,UAAU;IAE1C,MAAM,CAAC,MAAM,4BAcV;IAGH,IAAI,EAAE,KAAK,CAAM;IAGjB,OAAO,EAAE,OAAO,CAAC;IAEjB,oBAAoB,CAAC,CAAC,EAAE,KAAK;IAW7B,iBAAiB;IAIjB,SAAS,GAAI,GAAG,OAAO,CAAC,WAAW,UA2BlC;IAED,MAAM,6CAMJ;CAEF"}
|