@omegagrid/editor 0.6.40 → 0.6.42
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/editors/ruleEditor.d.ts +6 -3
- package/dist/ui/editors/ruleEditor.d.ts.map +1 -1
- package/dist/ui/editors/ruleEditor.js +62 -16
- package/dist/ui/editors/ruleEditor.js.map +1 -1
- package/dist/ui/forms/ruleFormThreshold.d.ts +6 -3
- package/dist/ui/forms/ruleFormThreshold.d.ts.map +1 -1
- package/dist/ui/forms/ruleFormThreshold.js +17 -12
- package/dist/ui/forms/ruleFormThreshold.js.map +1 -1
- package/package.json +10 -10
|
@@ -6,13 +6,16 @@ export declare class RuleEditor extends OmegaComponent {
|
|
|
6
6
|
format: ConditionalFormat;
|
|
7
7
|
rangesInput: Input;
|
|
8
8
|
conditionInput: Input;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
cminColorInput: DropdownColorPicker;
|
|
10
|
+
cmidColorInput: DropdownColorPicker;
|
|
11
|
+
cmaxColorInput: DropdownColorPicker;
|
|
12
12
|
colorInput: DropdownColorPicker;
|
|
13
13
|
iconList: DropdownList;
|
|
14
14
|
styleForm: StyleForm;
|
|
15
15
|
thresholds: NodeListOf<RuleThreshold>;
|
|
16
|
+
cmin: RuleThreshold;
|
|
17
|
+
cmid: RuleThreshold;
|
|
18
|
+
cmax: RuleThreshold;
|
|
16
19
|
updateFormat(): void;
|
|
17
20
|
renderFormulaForm: () => import("lit-html").TemplateResult<1>;
|
|
18
21
|
renderScaleForm: () => import("lit-html").TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
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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AAc,6CA8BZ;IAEF,MAAM,6CAKJ;CACF"}
|
|
@@ -40,21 +40,21 @@ let RuleEditor = class RuleEditor extends OmegaComponent {
|
|
|
40
40
|
<div class="row">${msg('Colors')}</div>
|
|
41
41
|
<div class="row" style="display: flex; gap: 4px;">
|
|
42
42
|
<og-dropdown-colorpicker
|
|
43
|
-
id="
|
|
43
|
+
id="cminColor"
|
|
44
44
|
style="flex: 1"
|
|
45
45
|
.value="${colors.css(this.format.cmin?.color)}"
|
|
46
46
|
@change="${() => this.updateFormat()}">
|
|
47
47
|
</og-dropdown-colorpicker>
|
|
48
48
|
|
|
49
49
|
<og-dropdown-colorpicker
|
|
50
|
-
id="
|
|
50
|
+
id="cmidColor"
|
|
51
51
|
style="flex: 1"
|
|
52
52
|
.value="${colors.css(this.format.cmid?.color)}"
|
|
53
53
|
@change="${() => this.updateFormat()}">
|
|
54
54
|
</og-dropdown-colorpicker>
|
|
55
55
|
|
|
56
56
|
<og-dropdown-colorpicker
|
|
57
|
-
id="
|
|
57
|
+
id="cmaxColor"
|
|
58
58
|
style="flex: 1"
|
|
59
59
|
.value="${colors.css(this.format.cmax?.color)}"
|
|
60
60
|
@change="${() => this.updateFormat()}">
|
|
@@ -62,6 +62,28 @@ let RuleEditor = class RuleEditor extends OmegaComponent {
|
|
|
62
62
|
</div>
|
|
63
63
|
`;
|
|
64
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
|
+
|
|
65
87
|
<div class="row">${msg('Color')}</div>
|
|
66
88
|
<div class="row" style="display: flex; gap: 4px;">
|
|
67
89
|
<og-dropdown-colorpicker
|
|
@@ -94,11 +116,14 @@ let RuleEditor = class RuleEditor extends OmegaComponent {
|
|
|
94
116
|
@change="${() => this.updateFormat()}">
|
|
95
117
|
</og-dropdown-list>
|
|
96
118
|
</div>
|
|
119
|
+
|
|
97
120
|
${this.format.v && iconSets.has(this.format.v) ? html `
|
|
98
121
|
<div class="row">${msg('Thresholds')}</div>
|
|
99
122
|
<div style="display: flex; flex-direction: column; gap: 2px; margin-top: 2px">
|
|
100
123
|
${map(iconSets.get(this.format.v), (_icon, i) => html `
|
|
101
124
|
<og-editor-rule-threshold
|
|
125
|
+
class="threshold"
|
|
126
|
+
.allowedTypes="${['num', 'percent']}"
|
|
102
127
|
.value="${this.format?.thresh[i]}"
|
|
103
128
|
?first="${i == 0}"
|
|
104
129
|
@change="${() => this.updateFormat()}">
|
|
@@ -126,23 +151,23 @@ let RuleEditor = class RuleEditor extends OmegaComponent {
|
|
|
126
151
|
this.format.style = this.styleForm.data;
|
|
127
152
|
else
|
|
128
153
|
this.format.style = null;
|
|
129
|
-
if (this.
|
|
154
|
+
if (this.cminColorInput) {
|
|
130
155
|
this.format.cmin = this.format.cmin ?? {};
|
|
131
156
|
this.format.cmin.t = 'min';
|
|
132
|
-
this.format.cmin.color = colors.plainHex(this.
|
|
157
|
+
this.format.cmin.color = colors.plainHex(this.cminColorInput.value);
|
|
133
158
|
}
|
|
134
159
|
else
|
|
135
160
|
this.format.cmin = null;
|
|
136
|
-
if (this.
|
|
161
|
+
if (this.cmidColorInput) {
|
|
137
162
|
this.format.cmid = this.format.cmid ?? {};
|
|
138
|
-
this.format.cmid.color = colors.plainHex(this.
|
|
163
|
+
this.format.cmid.color = colors.plainHex(this.cmidColorInput.value);
|
|
139
164
|
}
|
|
140
165
|
else
|
|
141
166
|
this.format.cmid = null;
|
|
142
|
-
if (this.
|
|
167
|
+
if (this.cmaxColorInput) {
|
|
143
168
|
this.format.cmax = this.format.cmax ?? {};
|
|
144
169
|
this.format.cmax.t = 'max';
|
|
145
|
-
this.format.cmax.color = colors.plainHex(this.
|
|
170
|
+
this.format.cmax.color = colors.plainHex(this.cmaxColorInput.value);
|
|
146
171
|
}
|
|
147
172
|
else
|
|
148
173
|
this.format.cmax = null;
|
|
@@ -161,6 +186,18 @@ let RuleEditor = class RuleEditor extends OmegaComponent {
|
|
|
161
186
|
this.format.thresh = Array.from(this.thresholds).map(t => t.value);
|
|
162
187
|
else
|
|
163
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;
|
|
164
201
|
if (update)
|
|
165
202
|
this.requestUpdate();
|
|
166
203
|
}
|
|
@@ -178,14 +215,14 @@ __decorate([
|
|
|
178
215
|
query('og-input#condition')
|
|
179
216
|
], RuleEditor.prototype, "conditionInput", void 0);
|
|
180
217
|
__decorate([
|
|
181
|
-
query('og-dropdown-colorpicker#
|
|
182
|
-
], RuleEditor.prototype, "
|
|
218
|
+
query('og-dropdown-colorpicker#cminColor')
|
|
219
|
+
], RuleEditor.prototype, "cminColorInput", void 0);
|
|
183
220
|
__decorate([
|
|
184
|
-
query('og-dropdown-colorpicker#
|
|
185
|
-
], RuleEditor.prototype, "
|
|
221
|
+
query('og-dropdown-colorpicker#cmidColor')
|
|
222
|
+
], RuleEditor.prototype, "cmidColorInput", void 0);
|
|
186
223
|
__decorate([
|
|
187
|
-
query('og-dropdown-colorpicker#
|
|
188
|
-
], RuleEditor.prototype, "
|
|
224
|
+
query('og-dropdown-colorpicker#cmaxColor')
|
|
225
|
+
], RuleEditor.prototype, "cmaxColorInput", void 0);
|
|
189
226
|
__decorate([
|
|
190
227
|
query('og-dropdown-colorpicker#color')
|
|
191
228
|
], RuleEditor.prototype, "colorInput", void 0);
|
|
@@ -196,8 +233,17 @@ __decorate([
|
|
|
196
233
|
query('og-editor-styleeditor#style')
|
|
197
234
|
], RuleEditor.prototype, "styleForm", void 0);
|
|
198
235
|
__decorate([
|
|
199
|
-
queryAll('og-editor-rule-threshold')
|
|
236
|
+
queryAll('og-editor-rule-threshold.threshold')
|
|
200
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);
|
|
201
247
|
RuleEditor = __decorate([
|
|
202
248
|
customElement('og-editor-ruleeditor')
|
|
203
249
|
], RuleEditor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleEditor.js","sourceRoot":"","sources":["../../../src/ui/editors/ruleEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAgD,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzF,OA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AAC;wCACnB;AA3CR,UAAU;IADtB,aAAa,CAAC,sBAAsB,CAAC;GACzB,UAAU,CAgOtB"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConditionalFormatThreshold, ConditionalFormatThresholdType } from '@omegagrid/grid';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import { DropdownList, NumericInput, events } from '@omegagrid/core';
|
|
4
|
+
type ThreadsholdType = ConditionalFormatThresholdType | 'auto';
|
|
4
5
|
export declare class RuleThreshold extends LitElement {
|
|
5
6
|
static styles: import("lit").CSSResult;
|
|
6
|
-
value:
|
|
7
|
+
value: ConditionalFormatThreshold;
|
|
7
8
|
first: boolean;
|
|
8
|
-
|
|
9
|
+
allowedTypes: ThreadsholdType[];
|
|
9
10
|
typeInput: DropdownList;
|
|
10
11
|
valueInput: NumericInput;
|
|
11
12
|
get isDisabled(): boolean;
|
|
13
|
+
get format(): string;
|
|
12
14
|
_onTypeChange: (e: events.ChangeEvent) => void;
|
|
13
15
|
_onChange: () => void;
|
|
14
16
|
render: () => import("lit-html").TemplateResult<1>;
|
|
15
17
|
}
|
|
18
|
+
export {};
|
|
16
19
|
//# sourceMappingURL=ruleFormThreshold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleFormThreshold.d.ts","sourceRoot":"","sources":["../../../src/ui/forms/ruleFormThreshold.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ruleFormThreshold.d.ts","sourceRoot":"","sources":["../../../src/ui/forms/ruleFormThreshold.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAErE,KAAK,eAAe,GAAG,8BAA8B,GAAG,MAAM,CAAC;AAa/D,qBACa,aAAc,SAAQ,UAAU;IAE5C,MAAM,CAAC,MAAM,0BAkBX;IAGF,KAAK,EAAE,0BAA0B,CAAC;IAGlC,KAAK,UAAS;IAGd,YAAY,EAAE,eAAe,EAAE,CAAsB;IAGrD,SAAS,EAAE,YAAY,CAAC;IAGxB,UAAU,EAAE,YAAY,CAAC;IAEzB,IAAI,UAAU,YAAiG;IAE/G,IAAI,MAAM,WAAwD;IAElE,aAAa,MAAO,MAAM,CAAC,WAAW,UAMrC;IAED,SAAS,aAGR;IAED,MAAM,6CAkBJ;CACF"}
|
|
@@ -4,9 +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 { customElement, property, query
|
|
7
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
8
8
|
import { css, html, LitElement } from 'lit';
|
|
9
9
|
import { events } from '@omegagrid/core';
|
|
10
|
+
const threasholdTypes = [
|
|
11
|
+
{ key: 'auto', value: 'automatic' },
|
|
12
|
+
{ key: 'num', value: 'number' },
|
|
13
|
+
{ key: 'percent', value: 'percent' }
|
|
14
|
+
];
|
|
10
15
|
const formatMap = {
|
|
11
16
|
'num': '#,##0.00',
|
|
12
17
|
'percent': '#,##0.00" %"',
|
|
@@ -15,11 +20,13 @@ let RuleThreshold = class RuleThreshold extends LitElement {
|
|
|
15
20
|
constructor() {
|
|
16
21
|
super(...arguments);
|
|
17
22
|
this.first = false;
|
|
18
|
-
this.
|
|
23
|
+
this.allowedTypes = ['num', 'percent'];
|
|
19
24
|
this._onTypeChange = (e) => {
|
|
20
|
-
if (
|
|
25
|
+
if (e.value === 'auto') {
|
|
26
|
+
this.value = null;
|
|
27
|
+
}
|
|
28
|
+
else if (formatMap[e.value]) {
|
|
21
29
|
this.value = { t: e.value, v: this.value?.v || 0 };
|
|
22
|
-
this.format = formatMap[e.value];
|
|
23
30
|
}
|
|
24
31
|
};
|
|
25
32
|
this._onChange = () => {
|
|
@@ -30,11 +37,8 @@ let RuleThreshold = class RuleThreshold extends LitElement {
|
|
|
30
37
|
<og-dropdown-list
|
|
31
38
|
id="type"
|
|
32
39
|
style="flex: 0; min-width: 100px"
|
|
33
|
-
.items="${
|
|
34
|
-
|
|
35
|
-
{ key: 'percent', value: 'percent' },
|
|
36
|
-
]}"
|
|
37
|
-
.value="${this.value?.t}"
|
|
40
|
+
.items="${threasholdTypes.filter(item => this.allowedTypes.includes(item.key))}"
|
|
41
|
+
.value="${this.value?.t || 'auto'}"
|
|
38
42
|
@change="${this._onTypeChange}">
|
|
39
43
|
</og-dropdown-list>
|
|
40
44
|
|
|
@@ -49,7 +53,8 @@ let RuleThreshold = class RuleThreshold extends LitElement {
|
|
|
49
53
|
</og-numericinput>
|
|
50
54
|
`;
|
|
51
55
|
}
|
|
52
|
-
get isDisabled() { return this.first && this.value?.t === 'percent'; }
|
|
56
|
+
get isDisabled() { return (this.first && this.value?.t === 'percent') || (this.value?.t || 'auto') === 'auto'; }
|
|
57
|
+
get format() { return this.value ? formatMap[this.value.t] : '0'; }
|
|
53
58
|
};
|
|
54
59
|
RuleThreshold.styles = css `
|
|
55
60
|
* {
|
|
@@ -77,8 +82,8 @@ __decorate([
|
|
|
77
82
|
property({ type: Boolean })
|
|
78
83
|
], RuleThreshold.prototype, "first", void 0);
|
|
79
84
|
__decorate([
|
|
80
|
-
|
|
81
|
-
], RuleThreshold.prototype, "
|
|
85
|
+
property({ type: Array })
|
|
86
|
+
], RuleThreshold.prototype, "allowedTypes", void 0);
|
|
82
87
|
__decorate([
|
|
83
88
|
query('og-dropdown-list#type')
|
|
84
89
|
], RuleThreshold.prototype, "typeInput", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleFormThreshold.js","sourceRoot":"","sources":["../../../src/ui/forms/ruleFormThreshold.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ruleFormThreshold.js","sourceRoot":"","sources":["../../../src/ui/forms/ruleFormThreshold.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAA8B,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIrE,MAAM,eAAe,GAA4C;IAChE,EAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAC;IACjC,EAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAC;IAC7B,EAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAC;CAClC,CAAC;AAEF,MAAM,SAAS,GAA4D;IAC1E,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,cAAc;CACzB,CAAC;AAGK,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QA0BN,UAAK,GAAG,KAAK,CAAC;QAGd,iBAAY,GAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAYrD,kBAAa,GAAG,CAAC,CAAqB,EAAE,EAAE;YACzC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;gBACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YACnB,CAAC;iBAAM,IAAI,SAAS,CAAC,CAAC,CAAC,KAAuC,CAAC,EAAE,CAAC;gBACjE,IAAI,CAAC,KAAK,GAAG,EAAC,CAAC,EAAE,CAAC,CAAC,KAAuC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK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S;AAGlC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CACZ;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;mDAC6B;AAGrD;IADC,KAAK,CAAC,uBAAuB,CAAC;gDACP;AAGxB;IADC,KAAK,CAAC,uBAAuB,CAAC;iDACN;AAnCb,aAAa;IADzB,aAAa,CAAC,0BAA0B,CAAC;GAC7B,aAAa,CAyEzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/editor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.42",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Spreadsheet editor",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"_prepublish": "yarn test && yarn lint"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@omegagrid/commands": "^0.6.
|
|
31
|
-
"@omegagrid/core": "^0.6.
|
|
32
|
-
"@omegagrid/form": "^0.6.
|
|
33
|
-
"@omegagrid/grid": "^0.6.
|
|
34
|
-
"@omegagrid/localize": "^0.6.
|
|
35
|
-
"@omegagrid/statusbar": "^0.6.
|
|
36
|
-
"@omegagrid/tabs": "^0.6.
|
|
37
|
-
"@omegagrid/toolbar": "^0.6.
|
|
38
|
-
"@omegagrid/tree": "^0.6.
|
|
30
|
+
"@omegagrid/commands": "^0.6.42",
|
|
31
|
+
"@omegagrid/core": "^0.6.42",
|
|
32
|
+
"@omegagrid/form": "^0.6.42",
|
|
33
|
+
"@omegagrid/grid": "^0.6.42",
|
|
34
|
+
"@omegagrid/localize": "^0.6.42",
|
|
35
|
+
"@omegagrid/statusbar": "^0.6.42",
|
|
36
|
+
"@omegagrid/tabs": "^0.6.42",
|
|
37
|
+
"@omegagrid/toolbar": "^0.6.42",
|
|
38
|
+
"@omegagrid/tree": "^0.6.42",
|
|
39
39
|
"lit": "^3.1.1",
|
|
40
40
|
"lit-html": "^3.1.1",
|
|
41
41
|
"ts-debounce": "^4.0.0"
|