@things-factory/meta-ui 7.0.1-alpha.1 → 7.0.1-alpha.11
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/client/actions/main.js +14 -20
- package/client/bootstrap.ts +13 -6
- package/client/component/grist/renderer/grist-renderer-meta-object-selector.js +18 -13
- package/client/pages/entity/config-entity.js +180 -112
- package/client/pages/entity/main-menu-selector.js +85 -84
- package/client/pages/history/history-copy-list-popup.js +33 -45
- package/client/pages/history/history-json-list-popup.js +38 -50
- package/client/pages/menu/dynamic-menu-template.js +1 -1
- package/client/pages/menu/dynamic-menu.js +137 -121
- package/client/pages/menu/export-menu-popup.js +210 -218
- package/client/pages/personalize/personal-column-selector.js +112 -122
- package/client/utils/meta-ui-util.js +0 -4
- package/client/utils/service-util.js +4 -4
- package/client/utils/terms-util.js +41 -42
- package/client/utils/ui-util.js +2 -5
- package/client/viewparts/dynamic-menu-part.js +7 -28
- package/dist-client/actions/main.js +6 -5
- package/dist-client/actions/main.js.map +1 -1
- package/dist-client/bootstrap.d.ts +4 -1
- package/dist-client/bootstrap.js +12 -6
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-code-input.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-code-selector.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js +9 -3
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js.map +1 -1
- package/dist-client/component/popup/code-input-editor-popup.d.ts +1 -1
- package/dist-client/component/popup/meta-object-selector-popup.d.ts +1 -1
- package/dist-client/component/popup/record-based-code-editor-popup.d.ts +1 -1
- package/dist-client/mixin/meta-basic-grist-mixin.d.ts +1 -1
- package/dist-client/pages/activity/meta-activity-viewer-element.d.ts +1 -1
- package/dist-client/pages/activity/meta-activity-writer-element.d.ts +1 -1
- package/dist-client/pages/button-role/button-role-detail.d.ts +1 -1
- package/dist-client/pages/entity/config-entity.js +131 -62
- package/dist-client/pages/entity/config-entity.js.map +1 -1
- package/dist-client/pages/entity/main-menu-selector.d.ts +1 -1
- package/dist-client/pages/entity/main-menu-selector.js +74 -73
- package/dist-client/pages/entity/main-menu-selector.js.map +1 -1
- package/dist-client/pages/history/history-copy-list-popup.d.ts +1 -1
- package/dist-client/pages/history/history-copy-list-popup.js +14 -26
- package/dist-client/pages/history/history-copy-list-popup.js.map +1 -1
- package/dist-client/pages/history/history-json-list-popup.d.ts +5 -5
- package/dist-client/pages/history/history-json-list-popup.js +19 -31
- package/dist-client/pages/history/history-json-list-popup.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu-setting-let.d.ts +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu.js +68 -48
- package/dist-client/pages/menu/dynamic-menu.js.map +1 -1
- package/dist-client/pages/menu/export-menu-popup.d.ts +5 -5
- package/dist-client/pages/menu/export-menu-popup.js +50 -54
- package/dist-client/pages/menu/export-menu-popup.js.map +1 -1
- package/dist-client/pages/meta-grist-element.d.ts +1 -1
- package/dist-client/pages/meta-grist-page.d.ts +1 -1
- package/dist-client/pages/personalize/personal-column-selector.d.ts +1 -1
- package/dist-client/pages/personalize/personal-column-selector.js +76 -84
- package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
- package/dist-client/pages/work-code/work-code-detail-popup.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/meta-ui-util.js +0 -3
- package/dist-client/utils/meta-ui-util.js.map +1 -1
- package/dist-client/utils/service-util.js +4 -4
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-client/utils/terms-util.d.ts +13 -13
- package/dist-client/utils/terms-util.js +10 -12
- package/dist-client/utils/terms-util.js.map +1 -1
- package/dist-client/utils/ui-util.js +1 -4
- package/dist-client/utils/ui-util.js.map +1 -1
- package/dist-client/viewparts/dynamic-menu-part.d.ts +1 -1
- package/dist-client/viewparts/dynamic-menu-part.js +7 -26
- package/dist-client/viewparts/dynamic-menu-part.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/client/viewparts/dynamic-menu-landscape.js +0 -106
- package/client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/client/viewparts/dynamic-menu-portrait.js +0 -90
- package/client/viewparts/dynamic-top-menu-bar.js +0 -148
- package/dist-client/viewparts/dynamic-menu-landscape-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape.d.ts +0 -21
- package/dist-client/viewparts/dynamic-menu-landscape.js +0 -87
- package/dist-client/viewparts/dynamic-menu-landscape.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait.d.ts +0 -13
- package/dist-client/viewparts/dynamic-menu-portrait.js +0 -74
- package/dist-client/viewparts/dynamic-menu-portrait.js.map +0 -1
- package/dist-client/viewparts/dynamic-top-menu-bar.d.ts +0 -27
- package/dist-client/viewparts/dynamic-top-menu-bar.js +0 -133
- package/dist-client/viewparts/dynamic-top-menu-bar.js.map +0 -1
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export const DynamicMenuLandscapeStyles = css `
|
|
3
|
-
:host {
|
|
4
|
-
overflow-x: auto;
|
|
5
|
-
background-color: var(--secondary-text-color);
|
|
6
|
-
--focus-anchor-color: #e6ffa2;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
:host > div {
|
|
10
|
-
overflow-x: auto;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host > div > ul {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: row;
|
|
16
|
-
list-style: none;
|
|
17
|
-
margin: auto;
|
|
18
|
-
padding: 0;
|
|
19
|
-
border: var(--border-dark-color);
|
|
20
|
-
border-width: 0 1px;
|
|
21
|
-
max-width: 1250px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host > div > ul > li {
|
|
25
|
-
flex: 1;
|
|
26
|
-
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
}
|
|
30
|
-
:host > div > ul > li > a {
|
|
31
|
-
display: none;
|
|
32
|
-
font-weight: bold;
|
|
33
|
-
font-size: var(--fontsize-large);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
ul[submenus] {
|
|
37
|
-
flex: 1;
|
|
38
|
-
list-style: none;
|
|
39
|
-
overflow-y: hidden;
|
|
40
|
-
background-color: var(--primary-color);
|
|
41
|
-
margin: 0;
|
|
42
|
-
padding: 0;
|
|
43
|
-
border-left: var(--border-dark-color);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
ul[submenus] li {
|
|
47
|
-
min-width: 120px;
|
|
48
|
-
max-width: 180px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
a {
|
|
52
|
-
display: block;
|
|
53
|
-
padding: var(--padding-default) var(--padding-default) var(--padding-narrow) var(--padding-wide);
|
|
54
|
-
text-decoration: none;
|
|
55
|
-
font: normal 14px var(--theme-font);
|
|
56
|
-
color: var(--theme-white-color);
|
|
57
|
-
text-transform: capitalize;
|
|
58
|
-
|
|
59
|
-
overflow: hidden;
|
|
60
|
-
white-space: nowrap;
|
|
61
|
-
text-overflow: ellipsis;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
a:hover {
|
|
65
|
-
font-weight: bold;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
ul[submenus] a::before {
|
|
69
|
-
content: '';
|
|
70
|
-
display: inline-block;
|
|
71
|
-
position: relative;
|
|
72
|
-
top: -1px;
|
|
73
|
-
width: 5px;
|
|
74
|
-
height: 5px;
|
|
75
|
-
border: 1px solid var(--theme-white-color);
|
|
76
|
-
border-radius: 50%;
|
|
77
|
-
background-color: transparent;
|
|
78
|
-
margin-right: 3px;
|
|
79
|
-
}
|
|
80
|
-
ul[submenus] a:hover,
|
|
81
|
-
ul[submenus] li[active] a {
|
|
82
|
-
background-color: rgba(var(--secondary-color-rgb), 0.3);
|
|
83
|
-
color: var(--focus-anchor-color);
|
|
84
|
-
font-weight: bold;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
[description] {
|
|
88
|
-
background-color: var(--primary-color);
|
|
89
|
-
margin: 0;
|
|
90
|
-
padding: var(--padding-default) 0;
|
|
91
|
-
border-left: 1px solid rgba(0, 0, 0, 0.1);
|
|
92
|
-
color: var(--focus-anchor-color);
|
|
93
|
-
font-size: 11px;
|
|
94
|
-
}
|
|
95
|
-
[description] mwc-icon {
|
|
96
|
-
background-color: rgba(0, 0, 0, 0.15);
|
|
97
|
-
margin-right: 4px;
|
|
98
|
-
padding: var(--padding-narrow);
|
|
99
|
-
border-radius: 0 5px 5px 0;
|
|
100
|
-
float: left;
|
|
101
|
-
font-size: 26px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@media only screen and (max-width: 460px) {
|
|
105
|
-
:host {
|
|
106
|
-
min-width: 100vw;
|
|
107
|
-
}
|
|
108
|
-
:host > div {
|
|
109
|
-
display: initial;
|
|
110
|
-
}
|
|
111
|
-
:host > div > ul {
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
}
|
|
114
|
-
a {
|
|
115
|
-
padding: var(--padding-wide);
|
|
116
|
-
font: normal 15px var(--theme-font);
|
|
117
|
-
}
|
|
118
|
-
li[active] ul {
|
|
119
|
-
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
|
|
120
|
-
}
|
|
121
|
-
li li a {
|
|
122
|
-
display: block;
|
|
123
|
-
padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
text-overflow: ellipsis;
|
|
126
|
-
white-space: nowrap;
|
|
127
|
-
font: normal 14px var(--theme-font);
|
|
128
|
-
}
|
|
129
|
-
li li[active] a {
|
|
130
|
-
font: bold 14px var(--theme-font);
|
|
131
|
-
}
|
|
132
|
-
:host > div > ul > li > a {
|
|
133
|
-
display: block;
|
|
134
|
-
}
|
|
135
|
-
:host > div > ul > li > a mwc-icon {
|
|
136
|
-
font-size: 1em;
|
|
137
|
-
position: relative;
|
|
138
|
-
top: 2px;
|
|
139
|
-
}
|
|
140
|
-
[description] {
|
|
141
|
-
display: none;
|
|
142
|
-
}
|
|
143
|
-
ul[submenus] a:hover,
|
|
144
|
-
ul[submenus] li[active] a {
|
|
145
|
-
background-color: rgba(var(--secondary-color-rgb), 0.3);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
`;
|
|
149
|
-
//# sourceMappingURL=dynamic-menu-landscape-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-menu-landscape-styles.js","sourceRoot":"","sources":["../../client/viewparts/dynamic-menu-landscape-styles.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJ5C,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const DynamicMenuLandscapeStyles = css`\n :host {\n overflow-x: auto;\n background-color: var(--secondary-text-color);\n --focus-anchor-color: #e6ffa2;\n }\n\n :host > div {\n overflow-x: auto;\n }\n\n :host > div > ul {\n display: flex;\n flex-direction: row;\n list-style: none;\n margin: auto;\n padding: 0;\n border: var(--border-dark-color);\n border-width: 0 1px;\n max-width: 1250px;\n }\n\n :host > div > ul > li {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n :host > div > ul > li > a {\n display: none;\n font-weight: bold;\n font-size: var(--fontsize-large);\n }\n\n ul[submenus] {\n flex: 1;\n list-style: none;\n overflow-y: hidden;\n background-color: var(--primary-color);\n margin: 0;\n padding: 0;\n border-left: var(--border-dark-color);\n }\n\n ul[submenus] li {\n min-width: 120px;\n max-width: 180px;\n }\n\n a {\n display: block;\n padding: var(--padding-default) var(--padding-default) var(--padding-narrow) var(--padding-wide);\n text-decoration: none;\n font: normal 14px var(--theme-font);\n color: var(--theme-white-color);\n text-transform: capitalize;\n\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n a:hover {\n font-weight: bold;\n }\n\n ul[submenus] a::before {\n content: '';\n display: inline-block;\n position: relative;\n top: -1px;\n width: 5px;\n height: 5px;\n border: 1px solid var(--theme-white-color);\n border-radius: 50%;\n background-color: transparent;\n margin-right: 3px;\n }\n ul[submenus] a:hover,\n ul[submenus] li[active] a {\n background-color: rgba(var(--secondary-color-rgb), 0.3);\n color: var(--focus-anchor-color);\n font-weight: bold;\n }\n\n [description] {\n background-color: var(--primary-color);\n margin: 0;\n padding: var(--padding-default) 0;\n border-left: 1px solid rgba(0, 0, 0, 0.1);\n color: var(--focus-anchor-color);\n font-size: 11px;\n }\n [description] mwc-icon {\n background-color: rgba(0, 0, 0, 0.15);\n margin-right: 4px;\n padding: var(--padding-narrow);\n border-radius: 0 5px 5px 0;\n float: left;\n font-size: 26px;\n }\n\n @media only screen and (max-width: 460px) {\n :host {\n min-width: 100vw;\n }\n :host > div {\n display: initial;\n }\n :host > div > ul {\n flex-direction: column;\n }\n a {\n padding: var(--padding-wide);\n font: normal 15px var(--theme-font);\n }\n li[active] ul {\n border-bottom: 2px solid rgba(0, 0, 0, 0.1);\n }\n li li a {\n display: block;\n padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font: normal 14px var(--theme-font);\n }\n li li[active] a {\n font: bold 14px var(--theme-font);\n }\n :host > div > ul > li > a {\n display: block;\n }\n :host > div > ul > li > a mwc-icon {\n font-size: 1em;\n position: relative;\n top: 2px;\n }\n [description] {\n display: none;\n }\n ul[submenus] a:hover,\n ul[submenus] li[active] a {\n background-color: rgba(var(--secondary-color-rgb), 0.3);\n }\n }\n`\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
declare const DynamicMenuLandscape_base: (new (...args: any[]) => {
|
|
2
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
3
|
-
connectedCallback(): void;
|
|
4
|
-
disconnectedCallback(): void;
|
|
5
|
-
stateChanged(_state: unknown): void;
|
|
6
|
-
readonly isConnected: boolean;
|
|
7
|
-
}) & typeof LitElement;
|
|
8
|
-
export class DynamicMenuLandscape extends DynamicMenuLandscape_base {
|
|
9
|
-
static get styles(): import("lit").CSSResult[];
|
|
10
|
-
static get properties(): {
|
|
11
|
-
menus: ArrayConstructor;
|
|
12
|
-
activeTopLevel: ObjectConstructor;
|
|
13
|
-
activeMenu: ObjectConstructor;
|
|
14
|
-
path: StringConstructor;
|
|
15
|
-
};
|
|
16
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
-
firstUpdated(): void;
|
|
18
|
-
onWheelEvent(e: any): void;
|
|
19
|
-
}
|
|
20
|
-
import { LitElement } from "lit-element/lit-element";
|
|
21
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import '@material/mwc-icon';
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { connect } from 'pwa-helpers';
|
|
4
|
-
import { navigate, store } from '@operato/shell';
|
|
5
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
6
|
-
import { DynamicMenuLandscapeStyles } from './dynamic-menu-landscape-styles';
|
|
7
|
-
export class DynamicMenuLandscape extends connect(store)(LitElement) {
|
|
8
|
-
static get styles() {
|
|
9
|
-
return [ScrollbarStyles, DynamicMenuLandscapeStyles];
|
|
10
|
-
}
|
|
11
|
-
static get properties() {
|
|
12
|
-
return {
|
|
13
|
-
menus: Array,
|
|
14
|
-
activeTopLevel: Object,
|
|
15
|
-
activeMenu: Object,
|
|
16
|
-
path: String
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
const { menus = [], activeTopLevel, activeMenu } = this;
|
|
21
|
-
return html `
|
|
22
|
-
<div id="wrap">
|
|
23
|
-
<ul>
|
|
24
|
-
${menus.map(menu => {
|
|
25
|
-
var _a;
|
|
26
|
-
return menu.type == 'group'
|
|
27
|
-
? html ``
|
|
28
|
-
: html `
|
|
29
|
-
<li ?active=${menu === activeTopLevel}>
|
|
30
|
-
<a href=${menu.path || '#'}>
|
|
31
|
-
${menu.icon ? html `<mwc-icon>${menu.icon}</mwc-icon>` : html ``} ${menu.name}
|
|
32
|
-
</a>
|
|
33
|
-
|
|
34
|
-
<ul submenus>
|
|
35
|
-
${(_a = menu.menus) === null || _a === void 0 ? void 0 : _a.map(menu => html `
|
|
36
|
-
<li ?active=${menu === activeMenu}>
|
|
37
|
-
<a href=${menu.path || '#'}> ${menu.name} </a>
|
|
38
|
-
</li>
|
|
39
|
-
`)}
|
|
40
|
-
</ul>
|
|
41
|
-
|
|
42
|
-
<div description>
|
|
43
|
-
${menu.icon ? html `<mwc-icon>${menu.icon}</mwc-icon>` : html ``} ${menu.description || ''}
|
|
44
|
-
</div>
|
|
45
|
-
</li>
|
|
46
|
-
`;
|
|
47
|
-
})}
|
|
48
|
-
</ul>
|
|
49
|
-
</div>
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
firstUpdated() {
|
|
53
|
-
const wrap = this.renderRoot.querySelector('#wrap');
|
|
54
|
-
wrap.addEventListener('mousewheel', this.onWheelEvent.bind(this), false);
|
|
55
|
-
this.renderRoot.addEventListener('click', e => {
|
|
56
|
-
if (e.target.submenu) {
|
|
57
|
-
/* protect to act move to href. */
|
|
58
|
-
e.stopPropagation();
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
let menu = e.target.submenu;
|
|
61
|
-
this.dispatchEvent(new CustomEvent('active-toplevel', {
|
|
62
|
-
bubbles: true,
|
|
63
|
-
detail: this.activeTopLevel === menu ? undefined : menu
|
|
64
|
-
}));
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
/* to respond even if current acting menu is selected */
|
|
68
|
-
let href = e.target.href;
|
|
69
|
-
href && location.href === href && navigate(href + '#force', true);
|
|
70
|
-
});
|
|
71
|
-
/* to hide scrollbar during transition */
|
|
72
|
-
this.renderRoot.addEventListener('transitionstart', e => {
|
|
73
|
-
e.target.removeAttribute('settled');
|
|
74
|
-
});
|
|
75
|
-
this.renderRoot.addEventListener('transitionend', e => {
|
|
76
|
-
e.target.setAttribute('settled', '');
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
onWheelEvent(e) {
|
|
80
|
-
const wrap = e.currentTarget;
|
|
81
|
-
var delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail));
|
|
82
|
-
wrap.scrollLeft -= delta * 10;
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
customElements.define('dynamic-menu-landscape', DynamicMenuLandscape);
|
|
87
|
-
//# sourceMappingURL=dynamic-menu-landscape.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-menu-landscape.js","sourceRoot":"","sources":["../../client/viewparts/dynamic-menu-landscape.js"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM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AAC,CAAC,CAAA;QACF,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE;YACpD,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QACtC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,CAAC,CAAC;QACZ,MAAM,IAAI,GAAG,CAAC,CAAC,aAAa,CAAA;QAC5B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,IAAI,KAAK,GAAG,EAAE,CAAA;QAE7B,CAAC,CAAC,cAAc,EAAE,CAAA;IACpB,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAA","sourcesContent":["import '@material/mwc-icon'\n\nimport { html, LitElement } from 'lit'\nimport { connect } from 'pwa-helpers'\n\nimport { navigate, store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { DynamicMenuLandscapeStyles } from './dynamic-menu-landscape-styles'\n\nexport class DynamicMenuLandscape extends connect(store)(LitElement) {\n static get styles() {\n return [ScrollbarStyles, DynamicMenuLandscapeStyles]\n }\n\n static get properties() {\n return {\n menus: Array,\n activeTopLevel: Object,\n activeMenu: Object,\n path: String\n }\n }\n\n render() {\n const { menus = [], activeTopLevel, activeMenu } = this\n\n return html`\n <div id=\"wrap\">\n <ul>\n ${menus.map(menu =>\n menu.type == 'group'\n ? html``\n : html`\n <li ?active=${menu === activeTopLevel}>\n <a href=${menu.path || '#'}>\n ${menu.icon ? html`<mwc-icon>${menu.icon}</mwc-icon>` : html``} ${menu.name}\n </a>\n\n <ul submenus>\n ${menu.menus?.map(\n menu => html`\n <li ?active=${menu === activeMenu}>\n <a href=${menu.path || '#'}> ${menu.name} </a>\n </li>\n `\n )}\n </ul>\n\n <div description>\n ${menu.icon ? html`<mwc-icon>${menu.icon}</mwc-icon>` : html``} ${menu.description || ''}\n </div>\n </li>\n `\n )}\n </ul>\n </div>\n `\n }\n\n firstUpdated() {\n const wrap = this.renderRoot.querySelector('#wrap')\n wrap.addEventListener('mousewheel', this.onWheelEvent.bind(this), false)\n\n this.renderRoot.addEventListener('click', e => {\n if (e.target.submenu) {\n /* protect to act move to href. */\n e.stopPropagation()\n e.preventDefault()\n\n let menu = e.target.submenu\n\n this.dispatchEvent(\n new CustomEvent('active-toplevel', {\n bubbles: true,\n detail: this.activeTopLevel === menu ? undefined : menu\n })\n )\n\n return\n }\n\n /* to respond even if current acting menu is selected */\n let href = e.target.href\n href && location.href === href && navigate(href + '#force', true)\n })\n\n /* to hide scrollbar during transition */\n this.renderRoot.addEventListener('transitionstart', e => {\n e.target.removeAttribute('settled')\n })\n this.renderRoot.addEventListener('transitionend', e => {\n e.target.setAttribute('settled', '')\n })\n }\n\n onWheelEvent(e) {\n const wrap = e.currentTarget\n var delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail))\n wrap.scrollLeft -= delta * 10\n\n e.preventDefault()\n }\n}\n\ncustomElements.define('dynamic-menu-landscape', DynamicMenuLandscape)\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const DynamicMenuPortraitStyles: import("lit").CSSResult;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export const DynamicMenuPortraitStyles = css `
|
|
3
|
-
:host {
|
|
4
|
-
display: flex;
|
|
5
|
-
overflow-y: auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
height: 100%;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host > ul {
|
|
11
|
-
margin-block-end: 1.5em;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
ul {
|
|
15
|
-
list-style: none;
|
|
16
|
-
margin: 0;
|
|
17
|
-
padding: 0;
|
|
18
|
-
}
|
|
19
|
-
[group-label] {
|
|
20
|
-
padding: 25px 0 var(--padding-narrow) var(--padding-wide);
|
|
21
|
-
border-bottom: var(--border-dark-color);
|
|
22
|
-
font: bold 12px var(--theme-font);
|
|
23
|
-
color: rgba(var(--primary-color-rgb), 0.9);
|
|
24
|
-
text-transform: uppercase;
|
|
25
|
-
}
|
|
26
|
-
a {
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
|
|
30
|
-
padding: var(--padding-default) var(--padding-default) var(--padding-default) var(--padding-wide);
|
|
31
|
-
text-decoration: none;
|
|
32
|
-
font: normal 14px var(--theme-font);
|
|
33
|
-
color: var(--secondary-color);
|
|
34
|
-
text-transform: capitalize;
|
|
35
|
-
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
white-space: nowrap;
|
|
38
|
-
text-overflow: ellipsis;
|
|
39
|
-
}
|
|
40
|
-
a:hover {
|
|
41
|
-
color: var(--primary-color);
|
|
42
|
-
font-weight: bold;
|
|
43
|
-
}
|
|
44
|
-
a * {
|
|
45
|
-
vertical-align: middle;
|
|
46
|
-
}
|
|
47
|
-
a mwc-icon {
|
|
48
|
-
margin-top: -3px;
|
|
49
|
-
margin-right: var(--margin-narrow);
|
|
50
|
-
font-size: 15px;
|
|
51
|
-
color: rgba(var(--secondary-color-rgb), 0.7);
|
|
52
|
-
}
|
|
53
|
-
a [submenu-button] {
|
|
54
|
-
float: left;
|
|
55
|
-
margin: -5px 0 0 -8px;
|
|
56
|
-
font-size: 25px;
|
|
57
|
-
max-height: 20px;
|
|
58
|
-
}
|
|
59
|
-
a [submenu-button]::before {
|
|
60
|
-
content: 'arrow_right';
|
|
61
|
-
}
|
|
62
|
-
li[active] > a [submenu-button]::before {
|
|
63
|
-
content: 'arrow_drop_down';
|
|
64
|
-
}
|
|
65
|
-
li[active] > a {
|
|
66
|
-
border-left: 3px solid var(--primary-color);
|
|
67
|
-
font-weight: bold;
|
|
68
|
-
color: var(--primary-color);
|
|
69
|
-
}
|
|
70
|
-
li li a {
|
|
71
|
-
padding: 7px 0 7px 35px;
|
|
72
|
-
font: normal 13px var(--theme-font);
|
|
73
|
-
color: var(--secondary-color);
|
|
74
|
-
}
|
|
75
|
-
li li[active] a {
|
|
76
|
-
background-color: rgba(var(--primary-color-rgb), 0.15);
|
|
77
|
-
font: bold 13px var(--theme-font);
|
|
78
|
-
color: var(--primary-color);
|
|
79
|
-
}
|
|
80
|
-
li > ul {
|
|
81
|
-
overflow-y: hidden;
|
|
82
|
-
max-height: 0;
|
|
83
|
-
background-color: #f6f6f6;
|
|
84
|
-
|
|
85
|
-
transition-property: all;
|
|
86
|
-
transition-duration: 0.7s;
|
|
87
|
-
}
|
|
88
|
-
li[active] > ul {
|
|
89
|
-
max-height: 500px;
|
|
90
|
-
}
|
|
91
|
-
li[active] > ul[settled] {
|
|
92
|
-
overflow-y: auto;
|
|
93
|
-
}
|
|
94
|
-
li li a::before {
|
|
95
|
-
margin-right: var(--margin-narrow);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
a [badge] {
|
|
99
|
-
margin-left: auto;
|
|
100
|
-
background-color: var(--primary-background-color);
|
|
101
|
-
color: white;
|
|
102
|
-
border-radius: 999em;
|
|
103
|
-
padding: 0px 6px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@media only screen and (max-width: 460px) {
|
|
107
|
-
:host {
|
|
108
|
-
min-width: 100vw;
|
|
109
|
-
}
|
|
110
|
-
a {
|
|
111
|
-
padding: var(--padding-wide);
|
|
112
|
-
font: normal 15px var(--theme-font);
|
|
113
|
-
}
|
|
114
|
-
li[active] ul {
|
|
115
|
-
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
|
|
116
|
-
}
|
|
117
|
-
li li a {
|
|
118
|
-
display: block;
|
|
119
|
-
padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;
|
|
120
|
-
overflow: hidden;
|
|
121
|
-
text-overflow: ellipsis;
|
|
122
|
-
white-space: nowrap;
|
|
123
|
-
font: normal 14px var(--theme-font);
|
|
124
|
-
}
|
|
125
|
-
li li[active] a {
|
|
126
|
-
font: bold 14px var(--theme-font);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`;
|
|
130
|
-
//# sourceMappingURL=dynamic-menu-portrait-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-menu-portrait-styles.js","sourceRoot":"","sources":["../../client/viewparts/dynamic-menu-portrait-styles.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+H3C,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const DynamicMenuPortraitStyles = css`\n :host {\n display: flex;\n overflow-y: auto;\n flex-direction: column;\n height: 100%;\n }\n\n :host > ul {\n margin-block-end: 1.5em;\n }\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n [group-label] {\n padding: 25px 0 var(--padding-narrow) var(--padding-wide);\n border-bottom: var(--border-dark-color);\n font: bold 12px var(--theme-font);\n color: rgba(var(--primary-color-rgb), 0.9);\n text-transform: uppercase;\n }\n a {\n display: flex;\n align-items: center;\n border-bottom: 1px solid rgba(0, 0, 0, 0.07);\n padding: var(--padding-default) var(--padding-default) var(--padding-default) var(--padding-wide);\n text-decoration: none;\n font: normal 14px var(--theme-font);\n color: var(--secondary-color);\n text-transform: capitalize;\n\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n a:hover {\n color: var(--primary-color);\n font-weight: bold;\n }\n a * {\n vertical-align: middle;\n }\n a mwc-icon {\n margin-top: -3px;\n margin-right: var(--margin-narrow);\n font-size: 15px;\n color: rgba(var(--secondary-color-rgb), 0.7);\n }\n a [submenu-button] {\n float: left;\n margin: -5px 0 0 -8px;\n font-size: 25px;\n max-height: 20px;\n }\n a [submenu-button]::before {\n content: 'arrow_right';\n }\n li[active] > a [submenu-button]::before {\n content: 'arrow_drop_down';\n }\n li[active] > a {\n border-left: 3px solid var(--primary-color);\n font-weight: bold;\n color: var(--primary-color);\n }\n li li a {\n padding: 7px 0 7px 35px;\n font: normal 13px var(--theme-font);\n color: var(--secondary-color);\n }\n li li[active] a {\n background-color: rgba(var(--primary-color-rgb), 0.15);\n font: bold 13px var(--theme-font);\n color: var(--primary-color);\n }\n li > ul {\n overflow-y: hidden;\n max-height: 0;\n background-color: #f6f6f6;\n\n transition-property: all;\n transition-duration: 0.7s;\n }\n li[active] > ul {\n max-height: 500px;\n }\n li[active] > ul[settled] {\n overflow-y: auto;\n }\n li li a::before {\n margin-right: var(--margin-narrow);\n }\n\n a [badge] {\n margin-left: auto;\n background-color: var(--primary-background-color);\n color: white;\n border-radius: 999em;\n padding: 0px 6px;\n }\n\n @media only screen and (max-width: 460px) {\n :host {\n min-width: 100vw;\n }\n a {\n padding: var(--padding-wide);\n font: normal 15px var(--theme-font);\n }\n li[active] ul {\n border-bottom: 2px solid rgba(0, 0, 0, 0.1);\n }\n li li a {\n display: block;\n padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font: normal 14px var(--theme-font);\n }\n li li[active] a {\n font: bold 14px var(--theme-font);\n }\n }\n`\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class DynamicMenuPortrait extends LitElement {
|
|
2
|
-
static get styles(): import("lit").CSSResult[];
|
|
3
|
-
static get properties(): {
|
|
4
|
-
menus: ArrayConstructor;
|
|
5
|
-
activeTopLevel: ObjectConstructor;
|
|
6
|
-
activeMenu: ObjectConstructor;
|
|
7
|
-
path: StringConstructor;
|
|
8
|
-
};
|
|
9
|
-
renderMenus(menus: any, activeTopLevel: any, activeMenu: any): import("lit-html").TemplateResult<1>;
|
|
10
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
-
firstUpdated(): void;
|
|
12
|
-
}
|
|
13
|
-
import { LitElement } from "lit-element/lit-element";
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import '@material/mwc-icon';
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { navigate } from '@operato/shell';
|
|
4
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
5
|
-
import { DynamicMenuPortraitStyles } from './dynamic-menu-portrait-styles';
|
|
6
|
-
export class DynamicMenuPortrait extends LitElement {
|
|
7
|
-
static get styles() {
|
|
8
|
-
return [ScrollbarStyles, DynamicMenuPortraitStyles];
|
|
9
|
-
}
|
|
10
|
-
static get properties() {
|
|
11
|
-
return {
|
|
12
|
-
menus: Array,
|
|
13
|
-
activeTopLevel: Object,
|
|
14
|
-
activeMenu: Object,
|
|
15
|
-
path: String
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
renderMenus(menus, activeTopLevel, activeMenu) {
|
|
19
|
-
return html `
|
|
20
|
-
<ul>
|
|
21
|
-
${menus.map(menu => {
|
|
22
|
-
var { type, active, path, name, badge, icon, menus } = menu;
|
|
23
|
-
active = active && typeof active === 'function' ? active.call(menu, { path: this.path }) : false;
|
|
24
|
-
badge = typeof badge === 'function' ? badge.call(menu) : badge !== null && badge !== void 0 ? badge : false;
|
|
25
|
-
return type == 'group'
|
|
26
|
-
? html `<li group-label>${name}</li>`
|
|
27
|
-
: html `
|
|
28
|
-
<li ?active=${activeTopLevel ? menu === activeTopLevel : active} .menu=${menu} menu>
|
|
29
|
-
<a href=${path || '#'}>
|
|
30
|
-
${(menus === null || menus === void 0 ? void 0 : menus.length) > 0 ? html ` <mwc-icon submenu-button></mwc-icon> ` : html ``}
|
|
31
|
-
<mwc-icon>${icon}</mwc-icon>
|
|
32
|
-
${name} ${badge !== false ? html `<div badge>${badge}</div>` : html ``}
|
|
33
|
-
</a>
|
|
34
|
-
${menus && this.renderMenus(menus, activeMenu)}
|
|
35
|
-
</li>
|
|
36
|
-
`;
|
|
37
|
-
})}
|
|
38
|
-
</ul>
|
|
39
|
-
`;
|
|
40
|
-
}
|
|
41
|
-
render() {
|
|
42
|
-
const { menus, activeTopLevel, activeMenu } = this;
|
|
43
|
-
return this.renderMenus(menus, activeTopLevel, activeMenu);
|
|
44
|
-
}
|
|
45
|
-
firstUpdated() {
|
|
46
|
-
this.renderRoot.addEventListener('click', e => {
|
|
47
|
-
const menuElement = e.target.closest('[menu]');
|
|
48
|
-
if (menuElement === null || menuElement === void 0 ? void 0 : menuElement.menu) {
|
|
49
|
-
let menu = menuElement.menu;
|
|
50
|
-
if (!menu.path) {
|
|
51
|
-
/* protect to act move to href. */
|
|
52
|
-
e.stopPropagation();
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
}
|
|
55
|
-
this.dispatchEvent(new CustomEvent('active-toplevel', {
|
|
56
|
-
bubbles: true,
|
|
57
|
-
detail: this.activeTopLevel === menu ? undefined : menu
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
/* to respond even if current acting menu is selected */
|
|
61
|
-
let href = e.target.href;
|
|
62
|
-
href && location.href === href && navigate(href + '#force', true);
|
|
63
|
-
});
|
|
64
|
-
/* to hide scrollbar during transition */
|
|
65
|
-
this.renderRoot.addEventListener('transitionstart', e => {
|
|
66
|
-
e.target.removeAttribute('settled');
|
|
67
|
-
});
|
|
68
|
-
this.renderRoot.addEventListener('transitionend', e => {
|
|
69
|
-
e.target.setAttribute('settled', '');
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
customElements.define('dynamic-menu-portrait', DynamicMenuPortrait);
|
|
74
|
-
//# sourceMappingURL=dynamic-menu-portrait.js.map
|
|
@@ -1 +0,0 @@
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B,IAAI,WAAW,CAAC,iBAAiB,EAAE;oBACjC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE,IAAI,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;iBACxD,CAAC,CACH,CAAA;aACF;YAED,wDAAwD;YACxD,IAAI,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAA;YACxB,IAAI,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,IAAI,QAAQ,CAAC,IAAI,GAAG,QAAQ,EAAE,IAAI,CAAC,CAAA;QACnE,CAAC,CAAC,CAAA;QAEF,yCAAyC;QACzC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE;YACtD,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE;YACpD,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QACtC,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAA","sourcesContent":["import '@material/mwc-icon'\n\nimport { html, LitElement } from 'lit'\n\nimport { navigate } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { DynamicMenuPortraitStyles } from './dynamic-menu-portrait-styles'\n\nexport class DynamicMenuPortrait extends LitElement {\n static get styles() {\n return [ScrollbarStyles, DynamicMenuPortraitStyles]\n }\n\n static get properties() {\n return {\n menus: Array,\n activeTopLevel: Object,\n activeMenu: Object,\n path: String\n }\n }\n\n renderMenus(menus, activeTopLevel, activeMenu) {\n return html`\n <ul>\n ${menus.map(menu => {\n var { type, active, path, name, badge, icon, menus } = menu\n active = active && typeof active === 'function' ? active.call(menu, { path: this.path }) : false\n badge = typeof badge === 'function' ? badge.call(menu) : badge ?? false\n\n return type == 'group'\n ? html`<li group-label>${name}</li>`\n : html`\n <li ?active=${activeTopLevel ? menu === activeTopLevel : active} .menu=${menu} menu>\n <a href=${path || '#'}>\n ${menus?.length > 0 ? html` <mwc-icon submenu-button></mwc-icon> ` : html``}\n <mwc-icon>${icon}</mwc-icon>\n ${name} ${badge !== false ? html`<div badge>${badge}</div>` : html``}\n </a>\n ${menus && this.renderMenus(menus, activeMenu)}\n </li>\n `\n })}\n </ul>\n `\n }\n\n render() {\n const { menus, activeTopLevel, activeMenu } = this\n return this.renderMenus(menus, activeTopLevel, activeMenu)\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('click', e => {\n const menuElement = e.target.closest('[menu]')\n\n if (menuElement?.menu) {\n let menu = menuElement.menu\n\n if (!menu.path) {\n /* protect to act move to href. */\n e.stopPropagation()\n e.preventDefault()\n }\n\n this.dispatchEvent(\n new CustomEvent('active-toplevel', {\n bubbles: true,\n detail: this.activeTopLevel === menu ? undefined : menu\n })\n )\n }\n\n /* to respond even if current acting menu is selected */\n let href = e.target.href\n href && location.href === href && navigate(href + '#force', true)\n })\n\n /* to hide scrollbar during transition */\n this.renderRoot.addEventListener('transitionstart', e => {\n e.target.removeAttribute('settled')\n })\n this.renderRoot.addEventListener('transitionend', e => {\n e.target.setAttribute('settled', '')\n })\n }\n}\n\ncustomElements.define('dynamic-menu-portrait', DynamicMenuPortrait)\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const DynamicTopMenuBar_base: (new (...args: any[]) => {
|
|
2
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
3
|
-
connectedCallback(): void;
|
|
4
|
-
disconnectedCallback(): void;
|
|
5
|
-
stateChanged(_state: unknown): void;
|
|
6
|
-
readonly isConnected: boolean;
|
|
7
|
-
}) & typeof LitElement;
|
|
8
|
-
export class DynamicTopMenuBar extends DynamicTopMenuBar_base {
|
|
9
|
-
static get styles(): import("lit").CSSResult;
|
|
10
|
-
static get properties(): {
|
|
11
|
-
page: StringConstructor;
|
|
12
|
-
resourceId: StringConstructor;
|
|
13
|
-
menus: ArrayConstructor;
|
|
14
|
-
_activeTopLevel: ObjectConstructor;
|
|
15
|
-
};
|
|
16
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
-
stateChanged(state: any): void;
|
|
18
|
-
page: any;
|
|
19
|
-
resourceId: any;
|
|
20
|
-
menus: any;
|
|
21
|
-
slotTemplate: any;
|
|
22
|
-
updated(changes: any): void;
|
|
23
|
-
_findActivePage(): void;
|
|
24
|
-
_activeTopLevel: any;
|
|
25
|
-
}
|
|
26
|
-
import { LitElement } from "lit-element/lit-element";
|
|
27
|
-
export {};
|