@genesislcap/foundation-header 14.360.1 → 14.361.0
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/custom-elements.json +346 -22
- package/dist/dts/components/control-panel.d.ts +109 -0
- package/dist/dts/components/control-panel.d.ts.map +1 -0
- package/dist/dts/components/index.d.ts +2 -0
- package/dist/dts/components/index.d.ts.map +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +12 -1
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/esm/components/control-panel.js +410 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/main/main.js +15 -1
- package/dist/esm/main/main.styles.js +0 -4
- package/dist/esm/main/main.template.js +19 -0
- package/dist/foundation-header.api.json +61 -0
- package/dist/foundation-header.d.ts +120 -1
- package/docs/api/foundation-header.navigation.controlpanel.md +11 -0
- package/docs/api/foundation-header.navigation.md +36 -0
- package/docs/api/foundation-header.navigation.showcontrolpanel.md +13 -0
- package/docs/api-report.md.api.md +54 -1
- package/package.json +22 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAe,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAsB,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;A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ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,iDAyYgD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAe1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAIpD,CAAC;AAwLF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,+BAgJvB,CAAC;AAiDF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAM,2BAIzC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAEpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,+BAAc,CAAC"}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
|
+
import { KVStorage, Session } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { whenElse } from '@genesislcap/foundation-utils';
|
|
4
|
+
import { css, customElement, GenesisElement, html, observable, ref, repeat, volatile, } from '@genesislcap/web-core';
|
|
5
|
+
const controlPanelDialog = html `
|
|
6
|
+
<rapid-modal ${ref('controlPanelModal')}>
|
|
7
|
+
<div slot="top">Control Panel</div>
|
|
8
|
+
<div class="control-panel">
|
|
9
|
+
<rapid-tabs>
|
|
10
|
+
<rapid-tab>Foundation Layout</rapid-tab>
|
|
11
|
+
<rapid-tab>Grid Columns (local storage)</rapid-tab>
|
|
12
|
+
<rapid-tab>Grid Filters (local storage)</rapid-tab>
|
|
13
|
+
<rapid-tab>Key Value Storage</rapid-tab>
|
|
14
|
+
<rapid-tab-panel>
|
|
15
|
+
${whenElse((x) => { var _a; return (_a = x.foundationLayoutKeys) === null || _a === void 0 ? void 0 : _a.length; }, html `
|
|
16
|
+
<div class="control-panel-section">
|
|
17
|
+
<h4>Saved Layouts</h4>
|
|
18
|
+
<div class="control-panel-section-list">
|
|
19
|
+
${repeat((x) => x.foundationLayoutKeys, html `
|
|
20
|
+
<rapid-checkbox
|
|
21
|
+
@change=${(x, c) => c.parent.toggleLayoutSelection(x.key)}
|
|
22
|
+
?checked=${(x) => x.selected}
|
|
23
|
+
>
|
|
24
|
+
${(x) => x.key}
|
|
25
|
+
</rapid-checkbox>
|
|
26
|
+
`)}
|
|
27
|
+
</div>
|
|
28
|
+
<rapid-button
|
|
29
|
+
@click=${(x) => x.deleteSelectedLayouts()}
|
|
30
|
+
?disabled=${(x) => !x.hasSelectedLayouts}
|
|
31
|
+
>
|
|
32
|
+
Delete Selected Layouts
|
|
33
|
+
</rapid-button>
|
|
34
|
+
</div>
|
|
35
|
+
`, html `
|
|
36
|
+
<p>No layouts in local storage</p>
|
|
37
|
+
`)}
|
|
38
|
+
</rapid-tab-panel>
|
|
39
|
+
<rapid-tab-panel>
|
|
40
|
+
${whenElse((x) => { var _a; return (_a = x.gridStateKeys) === null || _a === void 0 ? void 0 : _a.length; }, html `
|
|
41
|
+
<div class="control-panel-section">
|
|
42
|
+
<h4>Saved Grids</h4>
|
|
43
|
+
<div class="control-panel-section-list">
|
|
44
|
+
${repeat((x) => x.gridStateKeys, html `
|
|
45
|
+
<rapid-checkbox
|
|
46
|
+
@change=${(x, c) => c.parent.toggleGridSelection(x.key)}
|
|
47
|
+
?checked=${(x) => x.selected}
|
|
48
|
+
>
|
|
49
|
+
${(x) => x.key}
|
|
50
|
+
</rapid-checkbox>
|
|
51
|
+
`)}
|
|
52
|
+
</div>
|
|
53
|
+
<rapid-button
|
|
54
|
+
@click=${(x) => x.deleteSelectedGridStates()}
|
|
55
|
+
?disabled=${(x) => !x.hasSelectedGridStates}
|
|
56
|
+
>
|
|
57
|
+
Delete Selected Grid States
|
|
58
|
+
</rapid-button>
|
|
59
|
+
</div>
|
|
60
|
+
`, html `
|
|
61
|
+
<p>No grid settings in local storage</p>
|
|
62
|
+
`)}
|
|
63
|
+
</rapid-tab-panel>
|
|
64
|
+
<rapid-tab-panel>
|
|
65
|
+
${whenElse((x) => { var _a; return (_a = x.filterModelKeys) === null || _a === void 0 ? void 0 : _a.length; }, html `
|
|
66
|
+
<div class="control-panel-section">
|
|
67
|
+
<h4>Saved Filter Models</h4>
|
|
68
|
+
<div class="control-panel-section-list">
|
|
69
|
+
${repeat((x) => x.filterModelKeys, html `
|
|
70
|
+
<rapid-checkbox
|
|
71
|
+
@change=${(x, c) => c.parent.toggleFilterModelSelection(x.key)}
|
|
72
|
+
?checked=${(x) => x.selected}
|
|
73
|
+
>
|
|
74
|
+
${(x) => x.key}
|
|
75
|
+
</rapid-checkbox>
|
|
76
|
+
`)}
|
|
77
|
+
</div>
|
|
78
|
+
<rapid-button
|
|
79
|
+
@click=${(x) => x.deleteSelectedFilterModels()}
|
|
80
|
+
?disabled=${(x) => !x.hasSelectedFilterModels}
|
|
81
|
+
>
|
|
82
|
+
Delete Selected Filter Models
|
|
83
|
+
</rapid-button>
|
|
84
|
+
</div>
|
|
85
|
+
`, html `
|
|
86
|
+
<p>No filter models in local storage</p>
|
|
87
|
+
`)}
|
|
88
|
+
</rapid-tab-panel>
|
|
89
|
+
<rapid-tab-panel>
|
|
90
|
+
|
|
91
|
+
${whenElse((x) => { var _a; return (_a = x.kvStorageKeys) === null || _a === void 0 ? void 0 : _a.length; }, html `
|
|
92
|
+
<div class="control-panel-section">
|
|
93
|
+
<h4>KV Storage Items</h4>
|
|
94
|
+
<div class="control-panel-section-list">
|
|
95
|
+
${repeat((x) => x.kvStorageKeys, html `
|
|
96
|
+
<rapid-checkbox
|
|
97
|
+
@change=${(x, c) => c.parent.toggleKVStorageSelection(x.key)}
|
|
98
|
+
?checked=${(x) => x.selected}
|
|
99
|
+
>
|
|
100
|
+
${(x) => x.key}
|
|
101
|
+
</rapid-checkbox>
|
|
102
|
+
`)}
|
|
103
|
+
</div>
|
|
104
|
+
<rapid-button
|
|
105
|
+
@click=${(x) => x.deleteSelectedKVStorageItems()}
|
|
106
|
+
?disabled=${(x) => !x.hasSelectedKVStorageItems}
|
|
107
|
+
>
|
|
108
|
+
Delete Selected KV Storage Items
|
|
109
|
+
</rapid-button>
|
|
110
|
+
</div>
|
|
111
|
+
`, html `
|
|
112
|
+
<p>No items in KV Storage</p>
|
|
113
|
+
`)}
|
|
114
|
+
<rapid-tab-panel>
|
|
115
|
+
|
|
116
|
+
</rapid-tabs>
|
|
117
|
+
</div>
|
|
118
|
+
</rapid-modal>
|
|
119
|
+
`;
|
|
120
|
+
/**
|
|
121
|
+
* control-panel
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
let ControlPanel = class ControlPanel extends GenesisElement {
|
|
125
|
+
constructor() {
|
|
126
|
+
super(...arguments);
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
this.foundationLayoutKeys = [];
|
|
131
|
+
/**
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
this.gridStateKeys = [];
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
this.filterModelKeys = [];
|
|
139
|
+
/**
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
this.kvStorageKeys = [];
|
|
143
|
+
this.handleKeyDown = (event) => {
|
|
144
|
+
// Check for Ctrl+Shift+G (Windows/Linux) or Cmd+Shift+G (Mac)
|
|
145
|
+
const isCorrectModifier = event.ctrlKey || event.metaKey;
|
|
146
|
+
const isShiftPressed = event.shiftKey;
|
|
147
|
+
const isGKey = event.key.toLowerCase() === 'g';
|
|
148
|
+
if (isCorrectModifier && isShiftPressed && isGKey) {
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
this.showDialog();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
this.handleKeyDownBound = this.handleKeyDown.bind(this);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
* Check if any foundation layouts are selected
|
|
158
|
+
*/
|
|
159
|
+
get hasSelectedLayouts() {
|
|
160
|
+
return this.foundationLayoutKeys.some((item) => item.selected);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @internal
|
|
164
|
+
* Check if any grid states are selected
|
|
165
|
+
*/
|
|
166
|
+
get hasSelectedGridStates() {
|
|
167
|
+
return this.gridStateKeys.some((item) => item.selected);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @internal
|
|
171
|
+
* Check if any filter models are selected
|
|
172
|
+
*/
|
|
173
|
+
get hasSelectedFilterModels() {
|
|
174
|
+
return this.filterModelKeys.some((item) => item.selected);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* @internal
|
|
178
|
+
* Check if any KV storage items are selected
|
|
179
|
+
*/
|
|
180
|
+
get hasSelectedKVStorageItems() {
|
|
181
|
+
return this.kvStorageKeys.some((item) => item.selected);
|
|
182
|
+
}
|
|
183
|
+
connectedCallback() {
|
|
184
|
+
super.connectedCallback();
|
|
185
|
+
document.addEventListener('keydown', this.handleKeyDownBound);
|
|
186
|
+
}
|
|
187
|
+
disconnectedCallback() {
|
|
188
|
+
super.disconnectedCallback();
|
|
189
|
+
document.removeEventListener('keydown', this.handleKeyDownBound);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
showDialog() {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
this.foundationLayoutKeys = this.getKeysForSessionStorageItem('foundation-layout-autosave');
|
|
197
|
+
this.gridStateKeys = this.getKeysForStorageItem('gridOptions');
|
|
198
|
+
this.filterModelKeys = this.getKeysForStorageItem('persist-filter-model-key');
|
|
199
|
+
this.kvStorageKeys = yield this.getKeysForKVStorage();
|
|
200
|
+
this.controlPanelModal.show();
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
toggleSelection(key, keys) {
|
|
204
|
+
const item = keys.find((i) => i.key === key);
|
|
205
|
+
if (item) {
|
|
206
|
+
item.selected = !item.selected;
|
|
207
|
+
}
|
|
208
|
+
return [...keys];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
213
|
+
toggleLayoutSelection(key) {
|
|
214
|
+
this.foundationLayoutKeys = this.toggleSelection(key, this.foundationLayoutKeys);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
toggleGridSelection(key) {
|
|
220
|
+
this.gridStateKeys = this.toggleSelection(key, this.gridStateKeys);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
toggleFilterModelSelection(key) {
|
|
226
|
+
this.filterModelKeys = this.toggleSelection(key, this.filterModelKeys);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
toggleKVStorageSelection(key) {
|
|
232
|
+
this.kvStorageKeys = this.toggleSelection(key, this.kvStorageKeys);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
deleteSelectedLayouts() {
|
|
238
|
+
const selectedKeys = this.foundationLayoutKeys
|
|
239
|
+
.filter((item) => item.selected)
|
|
240
|
+
.map((item) => item.key);
|
|
241
|
+
if (selectedKeys.length === 0) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.deleteKeysFromSessionStorage('foundation-layout-autosave', selectedKeys);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
deleteSelectedGridStates() {
|
|
250
|
+
this.deleteKeysFromLocalStorage('gridOptions', this.gridStateKeys);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* @internal
|
|
254
|
+
*/
|
|
255
|
+
deleteSelectedFilterModels() {
|
|
256
|
+
this.deleteKeysFromLocalStorage('persist-filter-model-key', this.filterModelKeys);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* @internal
|
|
260
|
+
*/
|
|
261
|
+
deleteSelectedKVStorageItems() {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const selectedKeys = this.kvStorageKeys.filter((item) => item.selected).map((item) => item.key);
|
|
264
|
+
if (selectedKeys.length === 0) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
yield this.deleteKeysFromKVStorage(selectedKeys);
|
|
268
|
+
// Refresh the list after deletion
|
|
269
|
+
this.kvStorageKeys = yield this.getKeysForKVStorage();
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
deleteKeysFromSessionStorage(storageKey, keysToDelete) {
|
|
273
|
+
const storageString = this.session.getLocalStorageItem(storageKey);
|
|
274
|
+
if (!storageString) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const storageData = JSON.parse(storageString);
|
|
278
|
+
// Remove selected keys from storage object
|
|
279
|
+
keysToDelete.forEach((key) => {
|
|
280
|
+
delete storageData[key];
|
|
281
|
+
});
|
|
282
|
+
// Update session storage with the modified data
|
|
283
|
+
this.session.setLocalStorageItem(storageKey, JSON.stringify(storageData));
|
|
284
|
+
location.reload();
|
|
285
|
+
}
|
|
286
|
+
deleteKeysFromLocalStorage(storageKey, keys) {
|
|
287
|
+
const keysToDelete = keys.filter((i) => i.selected).map((i) => i.key);
|
|
288
|
+
if (!keysToDelete.length) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const storageString = localStorage.getItem(storageKey);
|
|
292
|
+
if (!storageString) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const storageData = JSON.parse(storageString);
|
|
296
|
+
// Remove selected keys from storage object
|
|
297
|
+
keysToDelete.forEach((key) => {
|
|
298
|
+
delete storageData[key];
|
|
299
|
+
});
|
|
300
|
+
// Update localStorage with the modified data
|
|
301
|
+
localStorage.setItem(storageKey, JSON.stringify(storageData));
|
|
302
|
+
location.reload();
|
|
303
|
+
}
|
|
304
|
+
getKeysForSessionStorageItem(storageKey) {
|
|
305
|
+
const storageString = this.session.getLocalStorageItem(storageKey);
|
|
306
|
+
if (storageString) {
|
|
307
|
+
const storageKeys = JSON.parse(storageString);
|
|
308
|
+
return Object.keys(storageKeys).map((key) => ({
|
|
309
|
+
key,
|
|
310
|
+
selected: false,
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
return [];
|
|
314
|
+
}
|
|
315
|
+
getKeysForStorageItem(storageKey) {
|
|
316
|
+
const storageString = localStorage.getItem(storageKey);
|
|
317
|
+
if (storageString) {
|
|
318
|
+
const storageKeys = JSON.parse(storageString);
|
|
319
|
+
return Object.keys(storageKeys).map((key) => ({
|
|
320
|
+
key,
|
|
321
|
+
selected: false,
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
return [];
|
|
325
|
+
}
|
|
326
|
+
getKeysForKVStorage() {
|
|
327
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
328
|
+
try {
|
|
329
|
+
const keyValuePairs = yield this.kvStorage.get();
|
|
330
|
+
// Filter for entries that have actual values and map to keys
|
|
331
|
+
return keyValuePairs
|
|
332
|
+
.filter((kvTransfer) => { var _a; return ((_a = kvTransfer === null || kvTransfer === void 0 ? void 0 : kvTransfer.kv) === null || _a === void 0 ? void 0 : _a.value) != null; })
|
|
333
|
+
.map((kvTransfer) => ({
|
|
334
|
+
key: kvTransfer.kv.key,
|
|
335
|
+
selected: false,
|
|
336
|
+
}));
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
console.error('Failed to load keys from KVStorage:', error);
|
|
340
|
+
return [];
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
deleteKeysFromKVStorage(keysToDelete) {
|
|
345
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
346
|
+
try {
|
|
347
|
+
yield this.kvStorage.delete(keysToDelete);
|
|
348
|
+
location.reload();
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
console.error('Failed to delete keys from KVStorage:', error);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
__decorate([
|
|
357
|
+
observable
|
|
358
|
+
], ControlPanel.prototype, "foundationLayoutKeys", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
observable
|
|
361
|
+
], ControlPanel.prototype, "gridStateKeys", void 0);
|
|
362
|
+
__decorate([
|
|
363
|
+
observable
|
|
364
|
+
], ControlPanel.prototype, "filterModelKeys", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
observable
|
|
367
|
+
], ControlPanel.prototype, "kvStorageKeys", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
Session
|
|
370
|
+
], ControlPanel.prototype, "session", void 0);
|
|
371
|
+
__decorate([
|
|
372
|
+
KVStorage
|
|
373
|
+
], ControlPanel.prototype, "kvStorage", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
volatile
|
|
376
|
+
], ControlPanel.prototype, "hasSelectedLayouts", null);
|
|
377
|
+
__decorate([
|
|
378
|
+
volatile
|
|
379
|
+
], ControlPanel.prototype, "hasSelectedGridStates", null);
|
|
380
|
+
__decorate([
|
|
381
|
+
volatile
|
|
382
|
+
], ControlPanel.prototype, "hasSelectedFilterModels", null);
|
|
383
|
+
__decorate([
|
|
384
|
+
volatile
|
|
385
|
+
], ControlPanel.prototype, "hasSelectedKVStorageItems", null);
|
|
386
|
+
ControlPanel = __decorate([
|
|
387
|
+
customElement({
|
|
388
|
+
name: 'control-panel',
|
|
389
|
+
template: html `
|
|
390
|
+
${controlPanelDialog}
|
|
391
|
+
`,
|
|
392
|
+
styles: css `
|
|
393
|
+
h4 {
|
|
394
|
+
margin: 0 0 10px;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.control-panel {
|
|
398
|
+
display: flex;
|
|
399
|
+
gap: 10px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.control-panel-section-list {
|
|
403
|
+
max-height: 300px;
|
|
404
|
+
overflow-y: auto;
|
|
405
|
+
display: grid;
|
|
406
|
+
}
|
|
407
|
+
`,
|
|
408
|
+
})
|
|
409
|
+
], ControlPanel);
|
|
410
|
+
export { ControlPanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './control-panel';
|
package/dist/esm/index.js
CHANGED
package/dist/esm/main/main.js
CHANGED
|
@@ -9,7 +9,7 @@ import { User } from '@genesislcap/foundation-user';
|
|
|
9
9
|
import { InactivityManager } from '@genesislcap/foundation-utils';
|
|
10
10
|
import { attr, Container, customElement, GenesisElement, observable } from '@genesislcap/web-core';
|
|
11
11
|
import logo from '../assets/logo.svg';
|
|
12
|
-
import { HeaderConfig } from '../config
|
|
12
|
+
import { HeaderConfig } from '../config';
|
|
13
13
|
import { rapidTemplate } from '../templates/rapid.template';
|
|
14
14
|
import { logger } from '../utils';
|
|
15
15
|
import { MainStyles as styles } from './main.styles';
|
|
@@ -132,6 +132,11 @@ let Navigation = class Navigation extends EventEmitter(GenesisElement) {
|
|
|
132
132
|
* Control via `show-environment-indicator`
|
|
133
133
|
*/
|
|
134
134
|
this.showEnvironmentIndicator = false;
|
|
135
|
+
/**
|
|
136
|
+
* Boolean attribute which controls whether to show the control panel toggle on the navigation bar
|
|
137
|
+
* Control via `show-control-panel`
|
|
138
|
+
*/
|
|
139
|
+
this.showControlPanel = false;
|
|
135
140
|
/**
|
|
136
141
|
* Boolean attribute which controls whether to show the language selector on the navigation bar
|
|
137
142
|
* Control via `show-language-selector`
|
|
@@ -433,6 +438,12 @@ let Navigation = class Navigation extends EventEmitter(GenesisElement) {
|
|
|
433
438
|
notificationIconEvent() {
|
|
434
439
|
this.$emit('notification-icon-clicked');
|
|
435
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* @internal
|
|
443
|
+
*/
|
|
444
|
+
toggleControlPanel() {
|
|
445
|
+
this.controlPanel.showDialog();
|
|
446
|
+
}
|
|
436
447
|
/**
|
|
437
448
|
* Changes the language of the application
|
|
438
449
|
*
|
|
@@ -565,6 +576,9 @@ __decorate([
|
|
|
565
576
|
__decorate([
|
|
566
577
|
attr({ mode: 'boolean', attribute: 'show-environment-indicator' })
|
|
567
578
|
], Navigation.prototype, "showEnvironmentIndicator", void 0);
|
|
579
|
+
__decorate([
|
|
580
|
+
attr({ mode: 'boolean', attribute: 'show-control-panel' })
|
|
581
|
+
], Navigation.prototype, "showControlPanel", void 0);
|
|
568
582
|
__decorate([
|
|
569
583
|
attr({ mode: 'boolean', attribute: 'show-language-selector' })
|
|
570
584
|
], Navigation.prototype, "showLanguageSelector", void 0);
|
|
@@ -195,10 +195,6 @@ export const MainStyles = css `
|
|
|
195
195
|
padding: calc(var(--design-unit) * 3px);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.notifications-button {
|
|
199
|
-
padding-right: calc((var(--design-unit) - 1) * 2px);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
198
|
.side-nav-buttons-container {
|
|
203
199
|
display: flex;
|
|
204
200
|
flex-direction: column;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { getApp } from '@genesislcap/foundation-shell/app';
|
|
2
|
+
import { ref } from '@genesislcap/web-core';
|
|
2
3
|
import { classNames, html, repeat, when } from '@genesislcap/web-core';
|
|
4
|
+
import { ControlPanel } from '../components';
|
|
3
5
|
import { buttonTag, connectionIndicatorTag, environmentIndicatorTag, flyoutTag, getTagHelper, iconTag, optionTag, providerTag, selectTag, } from '../tags';
|
|
6
|
+
ControlPanel;
|
|
4
7
|
const app = getApp();
|
|
5
8
|
const navigationClassMatcher = (className, buttonPath, urlPath) => classNames([className, urlPath.split('/').reverse()[0] === buttonPath]);
|
|
6
9
|
/**
|
|
@@ -234,6 +237,19 @@ export const navTemplate = html `
|
|
|
234
237
|
${when((x) => x.showEnvironmentIndicator, html `
|
|
235
238
|
<${environmentIndicatorTag} class="environment-indicator"></${environmentIndicatorTag}>
|
|
236
239
|
`)}
|
|
240
|
+
${when((x) => x.showControlPanel, html `
|
|
241
|
+
<div
|
|
242
|
+
class="icon-container"
|
|
243
|
+
part="control-panel-button"
|
|
244
|
+
aria-label="Control Panel toggle"
|
|
245
|
+
>
|
|
246
|
+
<${iconTag}
|
|
247
|
+
name="cog"
|
|
248
|
+
data-test-id="control-panel-icon"
|
|
249
|
+
@click=${(x) => x.toggleControlPanel()}>
|
|
250
|
+
</${iconTag}>
|
|
251
|
+
</div>
|
|
252
|
+
`)}
|
|
237
253
|
${app.registerElementsTarget('nav-end')}
|
|
238
254
|
${when((x) => x.showLuminanceToggleButton, html `
|
|
239
255
|
<div
|
|
@@ -283,6 +299,9 @@ export const navTemplate = html `
|
|
|
283
299
|
`)}
|
|
284
300
|
${() => accountMenuTemplate}
|
|
285
301
|
</div>
|
|
302
|
+
${when((x) => x.showControlPanel, html `
|
|
303
|
+
<control-panel ${ref('controlPanel')}></control-panel>
|
|
304
|
+
`)}
|
|
286
305
|
${app.registerElementsTarget(['header', 'header-end'])}
|
|
287
306
|
</div>
|
|
288
307
|
`;
|
|
@@ -741,6 +741,37 @@
|
|
|
741
741
|
"isProtected": false,
|
|
742
742
|
"isAbstract": false
|
|
743
743
|
},
|
|
744
|
+
{
|
|
745
|
+
"kind": "Property",
|
|
746
|
+
"canonicalReference": "@genesislcap/foundation-header!Navigation#controlPanel:member",
|
|
747
|
+
"docComment": "",
|
|
748
|
+
"excerptTokens": [
|
|
749
|
+
{
|
|
750
|
+
"kind": "Content",
|
|
751
|
+
"text": "controlPanel: "
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"kind": "Reference",
|
|
755
|
+
"text": "ControlPanel",
|
|
756
|
+
"canonicalReference": "@genesislcap/foundation-header!ControlPanel:class"
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"kind": "Content",
|
|
760
|
+
"text": ";"
|
|
761
|
+
}
|
|
762
|
+
],
|
|
763
|
+
"isReadonly": false,
|
|
764
|
+
"isOptional": false,
|
|
765
|
+
"releaseTag": "Public",
|
|
766
|
+
"name": "controlPanel",
|
|
767
|
+
"propertyTypeTokenRange": {
|
|
768
|
+
"startIndex": 1,
|
|
769
|
+
"endIndex": 2
|
|
770
|
+
},
|
|
771
|
+
"isStatic": false,
|
|
772
|
+
"isProtected": false,
|
|
773
|
+
"isAbstract": false
|
|
774
|
+
},
|
|
744
775
|
{
|
|
745
776
|
"kind": "Method",
|
|
746
777
|
"canonicalReference": "@genesislcap/foundation-header!Navigation#disconnectedCallback:member(1)",
|
|
@@ -1554,6 +1585,36 @@
|
|
|
1554
1585
|
"isProtected": false,
|
|
1555
1586
|
"isAbstract": false
|
|
1556
1587
|
},
|
|
1588
|
+
{
|
|
1589
|
+
"kind": "Property",
|
|
1590
|
+
"canonicalReference": "@genesislcap/foundation-header!Navigation#showControlPanel:member",
|
|
1591
|
+
"docComment": "/**\n * Boolean attribute which controls whether to show the control panel toggle on the navigation bar Control via `show-control-panel`\n */\n",
|
|
1592
|
+
"excerptTokens": [
|
|
1593
|
+
{
|
|
1594
|
+
"kind": "Content",
|
|
1595
|
+
"text": "showControlPanel: "
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
"kind": "Content",
|
|
1599
|
+
"text": "boolean"
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
"kind": "Content",
|
|
1603
|
+
"text": ";"
|
|
1604
|
+
}
|
|
1605
|
+
],
|
|
1606
|
+
"isReadonly": false,
|
|
1607
|
+
"isOptional": false,
|
|
1608
|
+
"releaseTag": "Public",
|
|
1609
|
+
"name": "showControlPanel",
|
|
1610
|
+
"propertyTypeTokenRange": {
|
|
1611
|
+
"startIndex": 1,
|
|
1612
|
+
"endIndex": 2
|
|
1613
|
+
},
|
|
1614
|
+
"isStatic": false,
|
|
1615
|
+
"isProtected": false,
|
|
1616
|
+
"isAbstract": false
|
|
1617
|
+
},
|
|
1557
1618
|
{
|
|
1558
1619
|
"kind": "Property",
|
|
1559
1620
|
"canonicalReference": "@genesislcap/foundation-header!Navigation#showEnvironmentIndicator:member",
|