@things-factory/lite-menu 6.2.102 → 6.2.103

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.
Files changed (56) hide show
  1. package/dist-client/actions/lite-menu.d.ts +7 -0
  2. package/dist-client/actions/lite-menu.js +114 -0
  3. package/dist-client/actions/lite-menu.js.map +1 -0
  4. package/dist-client/bootstrap.d.ts +4 -0
  5. package/dist-client/bootstrap.js +14 -0
  6. package/dist-client/bootstrap.js.map +1 -0
  7. package/dist-client/index.d.ts +4 -0
  8. package/dist-client/index.js +5 -0
  9. package/dist-client/index.js.map +1 -0
  10. package/dist-client/lite-menu-setting-let.d.ts +13 -0
  11. package/dist-client/lite-menu-setting-let.js +83 -0
  12. package/dist-client/lite-menu-setting-let.js.map +1 -0
  13. package/dist-client/pages/addon-menu-setting.d.ts +7 -0
  14. package/dist-client/pages/addon-menu-setting.js +480 -0
  15. package/dist-client/pages/addon-menu-setting.js.map +1 -0
  16. package/dist-client/reducers/lite-menu.d.ts +14 -0
  17. package/dist-client/reducers/lite-menu.js +60 -0
  18. package/dist-client/reducers/lite-menu.js.map +1 -0
  19. package/dist-client/route.d.ts +1 -0
  20. package/dist-client/route.js +8 -0
  21. package/dist-client/route.js.map +1 -0
  22. package/dist-client/tsconfig.tsbuildinfo +1 -0
  23. package/dist-client/viewparts/lite-menu-landscape-styles.d.ts +1 -0
  24. package/dist-client/viewparts/lite-menu-landscape-styles.js +149 -0
  25. package/dist-client/viewparts/lite-menu-landscape-styles.js.map +1 -0
  26. package/dist-client/viewparts/lite-menu-landscape.d.ts +20 -0
  27. package/dist-client/viewparts/lite-menu-landscape.js +103 -0
  28. package/dist-client/viewparts/lite-menu-landscape.js.map +1 -0
  29. package/dist-client/viewparts/lite-menu-part.d.ts +28 -0
  30. package/dist-client/viewparts/lite-menu-part.js +143 -0
  31. package/dist-client/viewparts/lite-menu-part.js.map +1 -0
  32. package/dist-client/viewparts/lite-menu-portrait-styles.d.ts +1 -0
  33. package/dist-client/viewparts/lite-menu-portrait-styles.js +147 -0
  34. package/dist-client/viewparts/lite-menu-portrait-styles.js.map +1 -0
  35. package/dist-client/viewparts/lite-menu-portrait.d.ts +12 -0
  36. package/dist-client/viewparts/lite-menu-portrait.js +89 -0
  37. package/dist-client/viewparts/lite-menu-portrait.js.map +1 -0
  38. package/dist-client/viewparts/top-menu-bar.d.ts +22 -0
  39. package/dist-client/viewparts/top-menu-bar.js +150 -0
  40. package/dist-client/viewparts/top-menu-bar.js.map +1 -0
  41. package/dist-server/index.js +5 -0
  42. package/dist-server/index.js.map +1 -0
  43. package/dist-server/service/index.js +19 -0
  44. package/dist-server/service/index.js.map +1 -0
  45. package/dist-server/service/lite-menu/index.js +9 -0
  46. package/dist-server/service/lite-menu/index.js.map +1 -0
  47. package/dist-server/service/lite-menu/lite-menu-mutation.js +60 -0
  48. package/dist-server/service/lite-menu/lite-menu-mutation.js.map +1 -0
  49. package/dist-server/service/lite-menu/lite-menu-query.js +121 -0
  50. package/dist-server/service/lite-menu/lite-menu-query.js.map +1 -0
  51. package/dist-server/service/lite-menu/lite-menu-type.js +114 -0
  52. package/dist-server/service/lite-menu/lite-menu-type.js.map +1 -0
  53. package/dist-server/service/lite-menu/lite-menu.js +140 -0
  54. package/dist-server/service/lite-menu/lite-menu.js.map +1 -0
  55. package/dist-server/tsconfig.tsbuildinfo +1 -0
  56. package/package.json +9 -9
@@ -0,0 +1,143 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import './lite-menu-portrait';
4
+ import './lite-menu-landscape';
5
+ import { css, html, LitElement } from 'lit';
6
+ import { customElement, property, state } from 'lit/decorators.js';
7
+ import { connect } from 'pwa-helpers';
8
+ import { store } from '@operato/shell';
9
+ import { ScrollbarStyles } from '@operato/styles';
10
+ function isActiveMenu(menu, path) {
11
+ var _a;
12
+ return (((_a = menu.path) === null || _a === void 0 ? void 0 : _a.split('?')[0]) === path ||
13
+ (menu.active && typeof menu.active === 'function' && menu.active.call(menu, { path })));
14
+ }
15
+ let LiteMenuPart = class LiteMenuPart extends connect(store)(LitElement) {
16
+ render() {
17
+ return html `
18
+ <slot name="head"></slot>
19
+ ${this.orientation !== 'landscape'
20
+ ? html `<lite-menu-portrait
21
+ .menus=${this.menus}
22
+ .activeTopLevel=${this._activeTopLevel}
23
+ .activeMenu=${this._activeMenu}
24
+ .path=${this._path}
25
+ ></lite-menu-portrait>`
26
+ : html `<lite-menu-landscape
27
+ .menus=${this.menus}
28
+ .activeTopLevel=${this._activeTopLevel}
29
+ .activeMenu=${this._activeMenu}
30
+ .path=${this._path}
31
+ ></lite-menu-landscape>`}
32
+ <slot name="tail"></slot>
33
+ `;
34
+ }
35
+ firstUpdated() {
36
+ this.renderRoot.addEventListener('active-toplevel', (e) => {
37
+ e.stopPropagation();
38
+ e.preventDefault();
39
+ this._activeTopLevel = e.detail;
40
+ });
41
+ }
42
+ updated(changes) {
43
+ if (changes.has('menus') || changes.has('page') || changes.has('resourceId')) {
44
+ this.findActivePage();
45
+ }
46
+ if (changes.has('orientation')) {
47
+ if (this.orientation == 'portrait') {
48
+ this.removeAttribute('landscape');
49
+ }
50
+ else {
51
+ this.setAttribute('landscape', '');
52
+ }
53
+ }
54
+ if (changes.has('slotTemplate')) {
55
+ this.replaceChild(this.slotTemplate, this.renderRoot);
56
+ }
57
+ }
58
+ stateChanged(state) {
59
+ this.page = state.route.page;
60
+ this.resourceId = state.route.resourceId;
61
+ this.menus = state.liteMenu.menus || [];
62
+ this.slotTemplate = state.liteMenu.slotTemplate;
63
+ }
64
+ findActivePage() {
65
+ var path = this.resourceId ? `${this.page}/${this.resourceId}` : this.page;
66
+ var menus = this.menus || [];
67
+ var activeMenu;
68
+ this._activeTopLevel = menus.find(menu => {
69
+ if (isActiveMenu(menu, path)) {
70
+ activeMenu = menu;
71
+ return true;
72
+ }
73
+ else if (menu.menus) {
74
+ activeMenu = menu.menus.find(menu => isActiveMenu(menu, path));
75
+ return !!activeMenu;
76
+ }
77
+ });
78
+ this._path = path;
79
+ this._activeMenu = activeMenu || this._activeTopLevel;
80
+ }
81
+ };
82
+ LiteMenuPart.styles = [
83
+ ScrollbarStyles,
84
+ css `
85
+ :host {
86
+ display: flex;
87
+ overflow-y: auto;
88
+ flex-direction: column;
89
+ height: 100%;
90
+ min-width: 200px;
91
+ background-color: var(--theme-white-color);
92
+ }
93
+
94
+ :host([landscape]) {
95
+ overflow-x: auto;
96
+ flex-direction: row;
97
+ width: 100%;
98
+ min-height: 20px;
99
+ }
100
+
101
+ lite-menu-portrait,
102
+ lite-menu-landscape {
103
+ flex: 1;
104
+ }
105
+ `
106
+ ];
107
+ __decorate([
108
+ property({ type: String }),
109
+ __metadata("design:type", String)
110
+ ], LiteMenuPart.prototype, "page", void 0);
111
+ __decorate([
112
+ property({ type: String }),
113
+ __metadata("design:type", String)
114
+ ], LiteMenuPart.prototype, "resourceId", void 0);
115
+ __decorate([
116
+ property({ type: Array }),
117
+ __metadata("design:type", Array)
118
+ ], LiteMenuPart.prototype, "menus", void 0);
119
+ __decorate([
120
+ property({ type: String }),
121
+ __metadata("design:type", String)
122
+ ], LiteMenuPart.prototype, "orientation", void 0);
123
+ __decorate([
124
+ state(),
125
+ __metadata("design:type", Object)
126
+ ], LiteMenuPart.prototype, "slotTemplate", void 0);
127
+ __decorate([
128
+ state(),
129
+ __metadata("design:type", Object)
130
+ ], LiteMenuPart.prototype, "_activeTopLevel", void 0);
131
+ __decorate([
132
+ state(),
133
+ __metadata("design:type", Object)
134
+ ], LiteMenuPart.prototype, "_activeMenu", void 0);
135
+ __decorate([
136
+ state(),
137
+ __metadata("design:type", String)
138
+ ], LiteMenuPart.prototype, "_path", void 0);
139
+ LiteMenuPart = __decorate([
140
+ customElement('lite-menu-part')
141
+ ], LiteMenuPart);
142
+ export { LiteMenuPart };
143
+ //# sourceMappingURL=lite-menu-part.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lite-menu-part.js","sourceRoot":"","sources":["../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;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CA6GxB;SA7GY,YAAY","sourcesContent":["import '@material/mwc-icon'\nimport './lite-menu-portrait'\nimport './lite-menu-landscape'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nfunction isActiveMenu(menu, path) {\n return (\n menu.path?.split('?')[0] === path ||\n (menu.active && typeof menu.active === 'function' && menu.active.call(menu, { path }))\n )\n}\n\n@customElement('lite-menu-part')\nexport class LiteMenuPart extends connect(store)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n overflow-y: auto;\n flex-direction: column;\n height: 100%;\n min-width: 200px;\n background-color: var(--theme-white-color);\n }\n\n :host([landscape]) {\n overflow-x: auto;\n flex-direction: row;\n width: 100%;\n min-height: 20px;\n }\n\n lite-menu-portrait,\n lite-menu-landscape {\n flex: 1;\n }\n `\n ]\n\n @property({ type: String }) page?: string\n @property({ type: String }) resourceId?: string\n @property({ type: Array }) menus?: any[]\n @property({ type: String }) orientation?: string\n\n @state() slotTemplate: any\n @state() _activeTopLevel: any\n @state() _activeMenu: any\n @state() _path?: string\n\n render() {\n return html`\n <slot name=\"head\"></slot>\n ${this.orientation !== 'landscape'\n ? html`<lite-menu-portrait\n .menus=${this.menus}\n .activeTopLevel=${this._activeTopLevel}\n .activeMenu=${this._activeMenu}\n .path=${this._path}\n ></lite-menu-portrait>`\n : html`<lite-menu-landscape\n .menus=${this.menus}\n .activeTopLevel=${this._activeTopLevel}\n .activeMenu=${this._activeMenu}\n .path=${this._path}\n ></lite-menu-landscape>`}\n <slot name=\"tail\"></slot>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('active-toplevel', (e: Event) => {\n e.stopPropagation()\n e.preventDefault()\n\n this._activeTopLevel = (e as CustomEvent).detail\n })\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('menus') || changes.has('page') || changes.has('resourceId')) {\n this.findActivePage()\n }\n\n if (changes.has('orientation')) {\n if (this.orientation == 'portrait') {\n this.removeAttribute('landscape')\n } else {\n this.setAttribute('landscape', '')\n }\n }\n\n if (changes.has('slotTemplate')) {\n this.replaceChild(this.slotTemplate, this.renderRoot)\n }\n }\n\n stateChanged(state) {\n this.page = state.route.page\n this.resourceId = state.route.resourceId\n this.menus = state.liteMenu.menus || []\n this.slotTemplate = state.liteMenu.slotTemplate\n }\n\n private findActivePage() {\n var path = this.resourceId ? `${this.page}/${this.resourceId}` : this.page\n var menus = this.menus || []\n var activeMenu\n\n this._activeTopLevel = menus.find(menu => {\n if (isActiveMenu(menu, path)) {\n activeMenu = menu\n return true\n } else if (menu.menus) {\n activeMenu = menu.menus.find(menu => isActiveMenu(menu, path))\n return !!activeMenu\n }\n })\n\n this._path = path\n this._activeMenu = activeMenu || this._activeTopLevel\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const LiteMenuPortraitStyles: import("lit").CSSResult;
@@ -0,0 +1,147 @@
1
+ import { css } from 'lit';
2
+ export const LiteMenuPortraitStyles = 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
+
20
+ [group-label] {
21
+ padding: 25px 0 var(--padding-narrow) var(--padding-wide);
22
+ border-bottom: var(--border-dark-color);
23
+ font: bold 12px var(--theme-font);
24
+ color: rgba(var(--primary-color-rgb), 0.9);
25
+ text-transform: uppercase;
26
+ }
27
+
28
+ a {
29
+ display: flex;
30
+ align-items: center;
31
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07);
32
+ padding: var(--padding-default) var(--padding-default) var(--padding-default) var(--padding-wide);
33
+ text-decoration: none;
34
+ font: normal 14px var(--theme-font);
35
+ color: var(--secondary-color);
36
+ text-transform: capitalize;
37
+
38
+ overflow: hidden;
39
+ white-space: nowrap;
40
+ text-overflow: ellipsis;
41
+ }
42
+
43
+ a:hover {
44
+ color: var(--primary-color);
45
+ font-weight: bold;
46
+ }
47
+
48
+ a * {
49
+ vertical-align: middle;
50
+ }
51
+
52
+ a mwc-icon {
53
+ margin-right: var(--margin-narrow);
54
+ font-size: 15px;
55
+ color: rgba(var(--secondary-color-rgb), 0.7);
56
+ }
57
+
58
+ a [submenu-button] {
59
+ float: left;
60
+ font-size: 15px;
61
+ max-height: 20px;
62
+ }
63
+
64
+ a [submenu-button]::before {
65
+ content: 'add_box';
66
+ }
67
+
68
+ li[active] > a [submenu-button]::before {
69
+ content: 'indeterminate_check_box';
70
+ }
71
+
72
+ li[active] > a {
73
+ border-left: 3px solid var(--primary-color);
74
+ font-weight: bold;
75
+ color: var(--primary-color);
76
+ }
77
+
78
+ li li a {
79
+ padding: 7px 0 7px 35px;
80
+ font: normal 13px var(--theme-font);
81
+ color: var(--secondary-color);
82
+ }
83
+
84
+ li li[active] a {
85
+ background-color: rgba(var(--primary-color-rgb), 0.15);
86
+ font: bold 13px var(--theme-font);
87
+ color: var(--primary-color);
88
+ }
89
+
90
+ li > ul {
91
+ overflow-y: hidden;
92
+ max-height: 0;
93
+ background-color: #f6f6f6;
94
+
95
+ transition-property: all;
96
+ transition-duration: 0.7s;
97
+ }
98
+
99
+ li[active] > ul {
100
+ max-height: 500px;
101
+ }
102
+
103
+ li[active] > ul[settled] {
104
+ overflow-y: auto;
105
+ }
106
+
107
+ li li a::before {
108
+ margin-right: var(--margin-narrow);
109
+ }
110
+
111
+ a [badge] {
112
+ margin-left: auto;
113
+ background-color: var(--primary-background-color);
114
+ color: white;
115
+ border-radius: 999em;
116
+ padding: 0px 6px;
117
+ }
118
+
119
+ @media only screen and (max-width: 460px) {
120
+ :host {
121
+ min-width: 100vw;
122
+ }
123
+
124
+ a {
125
+ padding: var(--padding-wide);
126
+ font: normal 15px var(--theme-font);
127
+ }
128
+
129
+ li[active] ul {
130
+ border-bottom: 2px solid rgba(0, 0, 0, 0.1);
131
+ }
132
+
133
+ li li a {
134
+ display: block;
135
+ padding: var(--padding-wide) var(--padding-default) var(--padding-wide) 35px;
136
+ overflow: hidden;
137
+ text-overflow: ellipsis;
138
+ white-space: nowrap;
139
+ font: normal 14px var(--theme-font);
140
+ }
141
+
142
+ li li[active] a {
143
+ font: bold 14px var(--theme-font);
144
+ }
145
+ }
146
+ `;
147
+ //# sourceMappingURL=lite-menu-portrait-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lite-menu-portrait-styles.js","sourceRoot":"","sources":["../../client/viewparts/lite-menu-portrait-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJxC,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const LiteMenuPortraitStyles = 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\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\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\n a:hover {\n color: var(--primary-color);\n font-weight: bold;\n }\n\n a * {\n vertical-align: middle;\n }\n\n a mwc-icon {\n margin-right: var(--margin-narrow);\n font-size: 15px;\n color: rgba(var(--secondary-color-rgb), 0.7);\n }\n\n a [submenu-button] {\n float: left;\n font-size: 15px;\n max-height: 20px;\n }\n\n a [submenu-button]::before {\n content: 'add_box';\n }\n\n li[active] > a [submenu-button]::before {\n content: 'indeterminate_check_box';\n }\n\n li[active] > a {\n border-left: 3px solid var(--primary-color);\n font-weight: bold;\n color: var(--primary-color);\n }\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\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\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\n li[active] > ul {\n max-height: 500px;\n }\n\n li[active] > ul[settled] {\n overflow-y: auto;\n }\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\n a {\n padding: var(--padding-wide);\n font: normal 15px var(--theme-font);\n }\n\n li[active] ul {\n border-bottom: 2px solid rgba(0, 0, 0, 0.1);\n }\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\n li li[active] a {\n font: bold 14px var(--theme-font);\n }\n }\n`\n"]}
@@ -0,0 +1,12 @@
1
+ import '@material/mwc-icon';
2
+ import { LitElement } from 'lit';
3
+ export declare class LiteMenuPortrait extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ menus?: any[];
6
+ activeTopLevel: any;
7
+ activeMenu: any;
8
+ path?: string;
9
+ renderMenus(menus: any, activeTopLevel: any, activeMenu?: any): import("lit-html").TemplateResult<1>;
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ firstUpdated(): void;
12
+ }
@@ -0,0 +1,89 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import { html, LitElement } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { navigate } from '@operato/shell';
6
+ import { ScrollbarStyles } from '@operato/styles';
7
+ import { LiteMenuPortraitStyles } from './lite-menu-portrait-styles';
8
+ let LiteMenuPortrait = class LiteMenuPortrait extends LitElement {
9
+ renderMenus(menus, activeTopLevel, activeMenu) {
10
+ return html `
11
+ <ul>
12
+ ${menus.map(menu => {
13
+ var { type, active, path, name, badge, icon, menus } = menu;
14
+ active = active && typeof active === 'function' ? active.call(menu, { path: this.path }) : false;
15
+ badge = typeof badge === 'function' ? badge.call(menu) : badge !== null && badge !== void 0 ? badge : false;
16
+ return type == 'group'
17
+ ? html `<li group-label>${name}</li>`
18
+ : html `
19
+ <li ?active=${activeTopLevel ? menu === activeTopLevel : active} .menu=${menu} menu>
20
+ <a href=${path || '#'}>
21
+ ${(menus === null || menus === void 0 ? void 0 : menus.length) > 0 ? html ` <mwc-icon submenu-button></mwc-icon> ` : html ``}
22
+ <mwc-icon>${icon}</mwc-icon>
23
+ ${name} ${badge !== false ? html `<div badge>${badge}</div>` : html ``}
24
+ </a>
25
+ ${menus && this.renderMenus(menus, activeMenu)}
26
+ </li>
27
+ `;
28
+ })}
29
+ </ul>
30
+ `;
31
+ }
32
+ render() {
33
+ const { menus, activeTopLevel, activeMenu } = this;
34
+ return this.renderMenus(menus, activeTopLevel, activeMenu);
35
+ }
36
+ firstUpdated() {
37
+ this.renderRoot.addEventListener('click', (e) => {
38
+ const menuElement = e.target.closest('[menu]');
39
+ //@ts-ignore
40
+ if (menuElement === null || menuElement === void 0 ? void 0 : menuElement.menu) {
41
+ //@ts-ignore
42
+ let menu = menuElement.menu;
43
+ if (!menu.path) {
44
+ /* protect to act move to href. */
45
+ e.stopPropagation();
46
+ e.preventDefault();
47
+ }
48
+ this.dispatchEvent(new CustomEvent('active-toplevel', {
49
+ bubbles: true,
50
+ detail: this.activeTopLevel === menu ? undefined : menu
51
+ }));
52
+ }
53
+ /* to respond even if current acting menu is selected */
54
+ let href = e.target.href;
55
+ href && location.href === href && navigate(href + '#force', true);
56
+ });
57
+ /* to hide scrollbar during transition */
58
+ this.renderRoot.addEventListener('transitionstart', e => {
59
+ ;
60
+ e.target.removeAttribute('settled');
61
+ });
62
+ this.renderRoot.addEventListener('transitionend', e => {
63
+ ;
64
+ e.target.setAttribute('settled', '');
65
+ });
66
+ }
67
+ };
68
+ LiteMenuPortrait.styles = [ScrollbarStyles, LiteMenuPortraitStyles];
69
+ __decorate([
70
+ property({ type: Array }),
71
+ __metadata("design:type", Array)
72
+ ], LiteMenuPortrait.prototype, "menus", void 0);
73
+ __decorate([
74
+ property({ type: Object }),
75
+ __metadata("design:type", Object)
76
+ ], LiteMenuPortrait.prototype, "activeTopLevel", void 0);
77
+ __decorate([
78
+ property({ type: Object }),
79
+ __metadata("design:type", Object)
80
+ ], LiteMenuPortrait.prototype, "activeMenu", void 0);
81
+ __decorate([
82
+ property({ type: String }),
83
+ __metadata("design:type", String)
84
+ ], LiteMenuPortrait.prototype, "path", void 0);
85
+ LiteMenuPortrait = __decorate([
86
+ customElement('lite-menu-portrait')
87
+ ], LiteMenuPortrait);
88
+ export { LiteMenuPortrait };
89
+ //# sourceMappingURL=lite-menu-portrait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lite-menu-portrait.js","sourceRoot":"","sources":["../../client/viewparts/lite-menu-portrait.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,E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AI,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;YAAC,CAAC,CAAC,MAAkB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE;YACpD,CAAC;YAAC,CAAC,CAAC,MAAkB,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QACpD,CAAC,CAAC,CAAA;IACJ,CAAC;;AAxEM,uBAAM,GAAG,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAA;AAEzD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;+CAAc;AACxC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDAAoB;AAC/C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAgB;AAC3C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAc;AAN9B,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA0E5B;SA1EY,gBAAgB","sourcesContent":["import '@material/mwc-icon'\n\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { navigate } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { LiteMenuPortraitStyles } from './lite-menu-portrait-styles'\n\n@customElement('lite-menu-portrait')\nexport class LiteMenuPortrait extends LitElement {\n static styles = [ScrollbarStyles, LiteMenuPortraitStyles]\n\n @property({ type: Array }) menus?: any[]\n @property({ type: Object }) activeTopLevel: any\n @property({ type: Object }) activeMenu: any\n @property({ type: String }) path?: string\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: Event) => {\n const menuElement = (e.target as Element)!.closest('[menu]')\n\n //@ts-ignore\n if (menuElement?.menu) {\n //@ts-ignore\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 as HTMLAnchorElement)!.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 as Element).removeAttribute('settled')\n })\n this.renderRoot.addEventListener('transitionend', e => {\n ;(e.target as Element).setAttribute('settled', '')\n })\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import '@material/mwc-icon';
2
+ import { LitElement } from 'lit';
3
+ declare const TopMenuBar_base: (new (...args: any[]) => {
4
+ _storeUnsubscribe: import("redux").Unsubscribe;
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ stateChanged(_state: unknown): void;
8
+ readonly isConnected: boolean;
9
+ }) & typeof LitElement;
10
+ export declare class TopMenuBar extends TopMenuBar_base {
11
+ static styles: import("lit").CSSResult[];
12
+ page?: string;
13
+ resourceId?: string;
14
+ menus?: any[];
15
+ private slotTemplate;
16
+ private _activeTopLevel;
17
+ render(): import("lit-html").TemplateResult<1>;
18
+ stateChanged(state: any): void;
19
+ updated(changes: any): void;
20
+ _findActivePage(): void;
21
+ }
22
+ export {};
@@ -0,0 +1,150 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property, state } from 'lit/decorators.js';
5
+ import { connect } from 'pwa-helpers';
6
+ import { toggleOverlay } from '@operato/layout';
7
+ import { store } from '@operato/shell';
8
+ let TopMenuBar = class TopMenuBar extends connect(store)(LitElement) {
9
+ render() {
10
+ const { menus = [], _activeTopLevel } = this;
11
+ return html `
12
+ <slot name="head"></slot>
13
+ <ul>
14
+ ${menus.map(menu => menu.type == 'group'
15
+ ? html ``
16
+ : html `
17
+ <li ?active=${menu === _activeTopLevel}>
18
+ <a
19
+ href="#"
20
+ @click=${e => {
21
+ e.preventDefault();
22
+ toggleOverlay('lite-menu-part', {
23
+ backdrop: true
24
+ });
25
+ }}
26
+ >
27
+ ${menu.name}
28
+ <mwc-icon>expand_more</mwc-icon>
29
+ </a>
30
+ </li>
31
+ `)}
32
+ </ul>
33
+ <slot name="tail"></slot>
34
+ `;
35
+ }
36
+ stateChanged(state) {
37
+ this.page = state.route.page;
38
+ this.resourceId = state.route.resourceId;
39
+ this.menus = state.liteMenu.menus || [];
40
+ this.slotTemplate = state.liteMenu.slotTemplate;
41
+ }
42
+ // firstUpdated() {
43
+ // this.addEventListener('mousewheel', this.onWheelEvent.bind(this), false)
44
+ // }
45
+ updated(changes) {
46
+ if (changes.has('menus') || changes.has('page') || changes.has('resourceId')) {
47
+ this._findActivePage();
48
+ }
49
+ if (changes.has('slotTemplate')) {
50
+ this.replaceChild(this.slotTemplate, this.renderRoot);
51
+ }
52
+ }
53
+ // onWheelEvent(e) {
54
+ // var delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail))
55
+ // this.scrollLeft -= delta * 40
56
+ // console.log('delta', this.scrollLeft, delta, e.wheelDelta || -e.detail)
57
+ // e.preventDefault()
58
+ // }
59
+ _findActivePage() {
60
+ var path = this.resourceId ? `${this.page}/${this.resourceId}` : this.page;
61
+ var menus = this.menus || [];
62
+ this._activeTopLevel = menus.find(menu => {
63
+ var _a;
64
+ if (((_a = menu.path) === null || _a === void 0 ? void 0 : _a.split('?')[0]) === path) {
65
+ return true;
66
+ }
67
+ else if (menu.menus) {
68
+ return !!menu.menus.find(menu => { var _a; return ((_a = menu.path) === null || _a === void 0 ? void 0 : _a.split('?')[0]) === path; });
69
+ }
70
+ });
71
+ }
72
+ };
73
+ TopMenuBar.styles = [
74
+ css `
75
+ :host {
76
+ display: flex;
77
+ flex-direction: row;
78
+ }
79
+
80
+ span {
81
+ flex: 1;
82
+ }
83
+
84
+ ul {
85
+ display: flex;
86
+ align-items: center;
87
+ list-style: none;
88
+ margin: 0;
89
+ padding: 0;
90
+ }
91
+
92
+ li {
93
+ display: inline-flex;
94
+ flex-direction: row nowrap;
95
+ float: left;
96
+ overflow: none;
97
+ }
98
+
99
+ a {
100
+ display: inline-block;
101
+ white-space: nowrap;
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ padding: var(--padding-default) var(--padding-wide) var(--padding-narrow) var(--padding-wide);
105
+ text-decoration: none;
106
+ color: white;
107
+ }
108
+ a * {
109
+ vertical-align: middle;
110
+ }
111
+ a mwc-icon {
112
+ opacity: 0.5;
113
+ position: relative;
114
+ top: -2px;
115
+ font-size: 1em;
116
+ }
117
+
118
+ li[active] a {
119
+ font-weight: bold;
120
+ }
121
+ li[active] a mwc-icon {
122
+ opacity: 1;
123
+ }
124
+ `
125
+ ];
126
+ __decorate([
127
+ property({ type: String }),
128
+ __metadata("design:type", String)
129
+ ], TopMenuBar.prototype, "page", void 0);
130
+ __decorate([
131
+ property({ type: String }),
132
+ __metadata("design:type", String)
133
+ ], TopMenuBar.prototype, "resourceId", void 0);
134
+ __decorate([
135
+ property({ type: Array }),
136
+ __metadata("design:type", Array)
137
+ ], TopMenuBar.prototype, "menus", void 0);
138
+ __decorate([
139
+ state(),
140
+ __metadata("design:type", Object)
141
+ ], TopMenuBar.prototype, "slotTemplate", void 0);
142
+ __decorate([
143
+ state(),
144
+ __metadata("design:type", Object)
145
+ ], TopMenuBar.prototype, "_activeTopLevel", void 0);
146
+ TopMenuBar = __decorate([
147
+ customElement('top-menu-bar')
148
+ ], TopMenuBar);
149
+ export { TopMenuBar };
150
+ //# sourceMappingURL=top-menu-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-menu-bar.js","sourceRoot":"","sources":["../../client/viewparts/top-menu-bar.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAG/B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IA8DxD,MAAM;QACJ,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;QAE5C,OAAO,IAAI,CAAA;;;UAGL,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAC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,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAA;QAC1E,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;;YACvC,IAAI,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,MAAK,IAAI,EAAE;gBACrC,OAAO,IAAI,CAAA;aACZ;iBAAM,IAAI,IAAI,CAAC,KAAK,EAAE;gBACrB,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,MAAK,IAAI,CAAA,EAAA,CAAC,CAAA;aACpE;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;;AApIM,iBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAAc;AACzC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAoB;AAC/C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;yCAAc;AAExC;IAAC,KAAK,EAAE;;gDAA0B;AAClC;IAAC,KAAK,EAAE;;mDAA6B;AA5D1B,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CAsItB;SAtIY,UAAU","sourcesContent":["import '@material/mwc-icon'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { toggleOverlay } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('top-menu-bar')\nexport class TopMenuBar extends connect(store)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: row;\n }\n\n span {\n flex: 1;\n }\n\n ul {\n display: flex;\n align-items: center;\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n li {\n display: inline-flex;\n flex-direction: row nowrap;\n float: left;\n overflow: none;\n }\n\n a {\n display: inline-block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: var(--padding-default) var(--padding-wide) var(--padding-narrow) var(--padding-wide);\n text-decoration: none;\n color: white;\n }\n a * {\n vertical-align: middle;\n }\n a mwc-icon {\n opacity: 0.5;\n position: relative;\n top: -2px;\n font-size: 1em;\n }\n\n li[active] a {\n font-weight: bold;\n }\n li[active] a mwc-icon {\n opacity: 1;\n }\n `\n ]\n\n @property({ type: String }) page?: string\n @property({ type: String }) resourceId?: string\n @property({ type: Array }) menus?: any[]\n\n @state() private slotTemplate: any\n @state() private _activeTopLevel: any\n\n render() {\n const { menus = [], _activeTopLevel } = this\n\n return html`\n <slot name=\"head\"></slot>\n <ul>\n ${menus.map(menu =>\n menu.type == 'group'\n ? html``\n : html`\n <li ?active=${menu === _activeTopLevel}>\n <a\n href=\"#\"\n @click=${e => {\n e.preventDefault()\n toggleOverlay('lite-menu-part', {\n backdrop: true\n })\n }}\n >\n ${menu.name}\n <mwc-icon>expand_more</mwc-icon>\n </a>\n </li>\n `\n )}\n </ul>\n <slot name=\"tail\"></slot>\n `\n }\n\n stateChanged(state) {\n this.page = state.route.page\n this.resourceId = state.route.resourceId\n this.menus = state.liteMenu.menus || []\n this.slotTemplate = state.liteMenu.slotTemplate\n }\n\n // firstUpdated() {\n // this.addEventListener('mousewheel', this.onWheelEvent.bind(this), false)\n // }\n\n updated(changes) {\n if (changes.has('menus') || changes.has('page') || changes.has('resourceId')) {\n this._findActivePage()\n }\n\n if (changes.has('slotTemplate')) {\n this.replaceChild(this.slotTemplate, this.renderRoot)\n }\n }\n\n // onWheelEvent(e) {\n // var delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail))\n // this.scrollLeft -= delta * 40\n // console.log('delta', this.scrollLeft, delta, e.wheelDelta || -e.detail)\n\n // e.preventDefault()\n // }\n\n _findActivePage() {\n var path = this.resourceId ? `${this.page}/${this.resourceId}` : this.page\n var menus = this.menus || []\n\n this._activeTopLevel = menus.find(menu => {\n if (menu.path?.split('?')[0] === path) {\n return true\n } else if (menu.menus) {\n return !!menu.menus.find(menu => menu.path?.split('?')[0] === path)\n }\n })\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./service"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB","sourcesContent":["export * from './service'\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schema = exports.entities = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* EXPORT ENTITY TYPES */
6
+ tslib_1.__exportStar(require("./lite-menu/lite-menu"), exports);
7
+ /* IMPORT ENTITIES AND RESOLVERS */
8
+ const lite_menu_1 = require("./lite-menu");
9
+ exports.entities = [
10
+ /* ENTITIES */
11
+ ...lite_menu_1.entities,
12
+ ];
13
+ exports.schema = {
14
+ resolverClasses: [
15
+ /* RESOLVER CLASSES */
16
+ ...lite_menu_1.resolvers,
17
+ ]
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,gEAAqC;AAErC,mCAAmC;AACnC,2CAA0F;AAE7E,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,oBAAgB;CACnB,CAAA;AAGY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,qBAAiB;KACnB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './lite-menu/lite-menu'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as LiteMenuEntities, resolvers as LiteMenuResolvers } from './lite-menu'\n\nexport const entities = [ \n /* ENTITIES */\n\t...LiteMenuEntities,\n] \n\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n\t\t...LiteMenuResolvers,\n ] \n}\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const lite_menu_1 = require("./lite-menu");
5
+ const lite_menu_query_1 = require("./lite-menu-query");
6
+ const lite_menu_mutation_1 = require("./lite-menu-mutation");
7
+ exports.entities = [lite_menu_1.LiteMenu];
8
+ exports.resolvers = [lite_menu_query_1.LiteMenuQuery, lite_menu_mutation_1.LiteMenuMutation];
9
+ //# sourceMappingURL=index.js.map