@quandis/qbo4.ui 4.0.1-CI-20240403-131518

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 (94) hide show
  1. package/package.json +52 -0
  2. package/readme.md +456 -0
  3. package/src/qbo/Program.d.ts +18 -0
  4. package/src/qbo/Program.js +18 -0
  5. package/src/qbo/Program.ts +19 -0
  6. package/src/qbo/qbo-api.d.ts +27 -0
  7. package/src/qbo/qbo-api.js +96 -0
  8. package/src/qbo/qbo-api.ts +106 -0
  9. package/src/qbo/qbo-badge.d.ts +32 -0
  10. package/src/qbo/qbo-badge.js +93 -0
  11. package/src/qbo/qbo-badge.js.map +1 -0
  12. package/src/qbo/qbo-badge.ts +80 -0
  13. package/src/qbo/qbo-breadcrumb.d.ts +23 -0
  14. package/src/qbo/qbo-breadcrumb.js +132 -0
  15. package/src/qbo/qbo-breadcrumb.ts +96 -0
  16. package/src/qbo/qbo-datalist.d.ts +22 -0
  17. package/src/qbo/qbo-datalist.js +126 -0
  18. package/src/qbo/qbo-datalist.ts +104 -0
  19. package/src/qbo/qbo-docviewer.d.ts +15 -0
  20. package/src/qbo/qbo-docviewer.js +55 -0
  21. package/src/qbo/qbo-docviewer.ts +39 -0
  22. package/src/qbo/qbo-fetch.d.ts +29 -0
  23. package/src/qbo/qbo-fetch.js +134 -0
  24. package/src/qbo/qbo-fetch.ts +127 -0
  25. package/src/qbo/qbo-json.d.ts +8 -0
  26. package/src/qbo/qbo-json.js +85 -0
  27. package/src/qbo/qbo-json.ts +92 -0
  28. package/src/qbo/qbo-link.d.ts +15 -0
  29. package/src/qbo/qbo-link.js +48 -0
  30. package/src/qbo/qbo-link.js.map +1 -0
  31. package/src/qbo/qbo-link.ts +34 -0
  32. package/src/qbo/qbo-logging.d.ts +13 -0
  33. package/src/qbo/qbo-logging.js +92 -0
  34. package/src/qbo/qbo-logging.ts +72 -0
  35. package/src/qbo/qbo-mainmenu.d.ts +41 -0
  36. package/src/qbo/qbo-mainmenu.js +307 -0
  37. package/src/qbo/qbo-mainmenu.ts +263 -0
  38. package/src/qbo/qbo-markdown.d.ts +9 -0
  39. package/src/qbo/qbo-markdown.js +33 -0
  40. package/src/qbo/qbo-markdown.js.map +1 -0
  41. package/src/qbo/qbo-markdown.ts +22 -0
  42. package/src/qbo/qbo-microphone.d.ts +31 -0
  43. package/src/qbo/qbo-microphone.js +149 -0
  44. package/src/qbo/qbo-microphone.js.map +1 -0
  45. package/src/qbo/qbo-microphone.ts +137 -0
  46. package/src/qbo/qbo-popover.d.ts +8 -0
  47. package/src/qbo/qbo-popover.js +41 -0
  48. package/src/qbo/qbo-popover.ts +26 -0
  49. package/src/qbo/qbo-popup-listener.d.ts +25 -0
  50. package/src/qbo/qbo-popup-listener.js +145 -0
  51. package/src/qbo/qbo-popup-listener.ts +129 -0
  52. package/src/qbo/qbo-popup.d.ts +19 -0
  53. package/src/qbo/qbo-popup.js +95 -0
  54. package/src/qbo/qbo-popup.ts +84 -0
  55. package/src/qbo/qbo-select.d.ts +22 -0
  56. package/src/qbo/qbo-select.js +87 -0
  57. package/src/qbo/qbo-select.ts +65 -0
  58. package/src/qbo/qbo-sidebar.d.ts +10 -0
  59. package/src/qbo/qbo-sidebar.js +65 -0
  60. package/src/qbo/qbo-sidebar.ts +41 -0
  61. package/src/qbo/qbo-table.d.ts +23 -0
  62. package/src/qbo/qbo-table.js +94 -0
  63. package/src/qbo/qbo-table.js.map +1 -0
  64. package/src/qbo/qbo-table.ts +80 -0
  65. package/src/qbo/qbo-validate.d.ts +20 -0
  66. package/src/qbo/qbo-validate.js +92 -0
  67. package/src/qbo/qbo-validate.js.map +1 -0
  68. package/src/qbo/qbo-validate.ts +77 -0
  69. package/src/qbo/qbo-validators.d.ts +37 -0
  70. package/src/qbo/qbo-validators.js +72 -0
  71. package/src/qbo/qbo-validators.ts +66 -0
  72. package/src/qbo/styles.d.ts +3 -0
  73. package/src/qbo/styles.js +27 -0
  74. package/src/qbo/styles.ts +30 -0
  75. package/src/qbo-code/qbo-code.d.ts +12 -0
  76. package/src/qbo-code/qbo-code.js +54 -0
  77. package/src/qbo-code/qbo-code.ts +40 -0
  78. package/src/qbo-flowchart/qbo-flowchart.d.ts +45 -0
  79. package/src/qbo-flowchart/qbo-flowchart.js +309 -0
  80. package/src/qbo-flowchart/qbo-flowchart.js.map +1 -0
  81. package/src/qbo-flowchart/qbo-flowchart.ts +320 -0
  82. package/src/qbo-flowchart/readme.md +2 -0
  83. package/wwwroot/js/qbo4.ui-code.js +37965 -0
  84. package/wwwroot/js/qbo4.ui-code.min.js +3 -0
  85. package/wwwroot/js/qbo4.ui-code.min.js.LICENSE.txt +32 -0
  86. package/wwwroot/js/qbo4.ui-code.min.js.map +1 -0
  87. package/wwwroot/js/qbo4.ui-flowchart.js +44909 -0
  88. package/wwwroot/js/qbo4.ui-flowchart.min.js +9 -0
  89. package/wwwroot/js/qbo4.ui-flowchart.min.js.LICENSE.txt +43 -0
  90. package/wwwroot/js/qbo4.ui-flowchart.min.js.map +1 -0
  91. package/wwwroot/js/qbo4.ui.js +18840 -0
  92. package/wwwroot/js/qbo4.ui.min.js +108 -0
  93. package/wwwroot/js/qbo4.ui.min.js.LICENSE.txt +53 -0
  94. package/wwwroot/js/qbo4.ui.min.js.map +1 -0
@@ -0,0 +1,307 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { html } from 'lit';
11
+ import { customElement, property } from 'lit/decorators.js';
12
+ import { QboFetch } from './qbo-fetch.js';
13
+ import { Popover } from 'bootstrap';
14
+ let QboMainMenu = class QboMainMenu extends QboFetch {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.ariaExpanded = 'false';
18
+ this.ariaLabel = 'Toggle menu';
19
+ this.buttonType = 'button';
20
+ this.collapseToggle = 'collapse';
21
+ this.dblClickClass = 'qbo-doubleclick';
22
+ this.dropdownId = 'qboMainMenu';
23
+ this.dropdownToggle = 'dropdown';
24
+ this.iconClass = 'qbo-icon';
25
+ this.liLinkToggleClass = 'qbo-dropdown';
26
+ this.liLinkClass = 'qbo-nav-item';
27
+ this.liAMenuClass = 'qbo-dropdown-item';
28
+ this.navClass = 'qbo-mainmenu';
29
+ this.popoverContainer = 'body';
30
+ this.popoverHtml = 'false';
31
+ this.popoverPlacement = 'bottom';
32
+ this.popoverToggle = 'popover';
33
+ this.popoverTrigger = 'hover';
34
+ this.spanMenuClass = 'qbo-submenuexpand';
35
+ this.spanMenuValue = '>';
36
+ this.ulMainMenuToggleClass = 'qbo-dropdown-mainmenu';
37
+ this.ulSubMenuClass = 'submenu';
38
+ this.ulSubMenuToggleClass = 'dropdown-menu';
39
+ this.apiEndpoint = new URL('config/mainmenu', this.baseURI);
40
+ this.renderInHost = true;
41
+ this.targetElement = null;
42
+ this.handleResize = () => {
43
+ if (window.innerWidth < 992) {
44
+ /* Collapse menu on small screens */
45
+ this.renderRoot.querySelectorAll(`button`).forEach(function (btn) {
46
+ if (btn != null && btn instanceof HTMLElement && btn.hasAttribute('aria-expanded') && btn.getAttribute('aria-expanded') == 'true')
47
+ btn.click();
48
+ });
49
+ }
50
+ else {
51
+ /* Remove collapsed styling on large screens*/
52
+ this.renderRoot.querySelectorAll(`.${this.ulSubMenuToggleClass} .${this.ulSubMenuClass}`).forEach(function (ul) {
53
+ if (ul != null && ul instanceof HTMLElement && ul.hasAttribute('style'))
54
+ ul.removeAttribute('style');
55
+ });
56
+ }
57
+ };
58
+ }
59
+ createRenderRoot() {
60
+ return this.renderInHost ? this : super.createRenderRoot();
61
+ }
62
+ connectedCallback() {
63
+ super.connectedCallback();
64
+ window.addEventListener('resize', this.handleResize);
65
+ }
66
+ disconnectedCallback() {
67
+ window.removeEventListener('resize', this.handleResize);
68
+ super.disconnectedCallback();
69
+ }
70
+ updated(changedProperties) {
71
+ super.updated(changedProperties);
72
+ if (changedProperties.get('jsonData') != undefined) {
73
+ /* Disable click */
74
+ this.renderRoot.querySelectorAll(`.${this.ulSubMenuToggleClass}`).forEach(ul => {
75
+ ul.addEventListener('click', function (e) {
76
+ e.stopPropagation();
77
+ });
78
+ });
79
+ /* Click for menu expansion on small screens */
80
+ const className = this.ulSubMenuClass;
81
+ this.renderRoot.querySelectorAll(`.${this.ulSubMenuToggleClass} a`).forEach(function (a) {
82
+ a.addEventListener('click', (e) => {
83
+ if (e.currentTarget != null && e.currentTarget instanceof HTMLElement && window.innerWidth < 992) {
84
+ const nextEl = e.currentTarget.nextElementSibling;
85
+ if (nextEl != null && nextEl instanceof HTMLElement && nextEl.classList.contains(className)) {
86
+ e.preventDefault();
87
+ nextEl.style.display = nextEl.style.display == 'block' ? 'none' : 'block';
88
+ }
89
+ }
90
+ });
91
+ });
92
+ /* Enable popovers */
93
+ this.renderRoot.querySelectorAll(`[data-bs-toggle="${this.popoverToggle}"]`).forEach(function (t) {
94
+ new Popover(t);
95
+ });
96
+ }
97
+ }
98
+ renderImage(image) {
99
+ if (image != null)
100
+ return html `<img src="${image}"/><span/>`;
101
+ else
102
+ return html ``;
103
+ }
104
+ renderMenu(json, isDropdown, isSubmenu) {
105
+ let result = html ``;
106
+ const jsonMenu = json != null && json.Menu != null ? json.Menu : json;
107
+ if (jsonMenu != null) {
108
+ if (jsonMenu.forEach) {
109
+ jsonMenu.forEach(mm => {
110
+ if (mm.Menu != null)
111
+ result = html `${result}${this.renderMenuDropdown(mm, isSubmenu)}`;
112
+ else if (mm.Type == "Divider")
113
+ result = html `${result}${this.renderMenuDivider()}`;
114
+ else if (isDropdown)
115
+ result = html `${result}${this.renderMenuDropdownLink(mm.URL, mm.Text, mm.Icon)}`;
116
+ else
117
+ result = html `${result}${this.renderMenuLink(mm)}`;
118
+ });
119
+ }
120
+ else {
121
+ if (jsonMenu.Menu != null)
122
+ result = html `${result}${this.renderMenuDropdown(jsonMenu, isSubmenu)}`;
123
+ else if (jsonMenu.Type == "Divider")
124
+ result = html `${result}${this.renderMenuDivider()}`;
125
+ else if (isDropdown)
126
+ result = html `${result}${this.renderMenuDropdownLink(jsonMenu.URL, jsonMenu.Text, jsonMenu.Icon)}`;
127
+ else
128
+ result = html `${result}${this.renderMenuLink(jsonMenu)}`;
129
+ }
130
+ }
131
+ return html `${result}`;
132
+ }
133
+ renderMenuDivider() {
134
+ return html `<li><hr/></li>`;
135
+ }
136
+ renderMenuDropdown(json, isSubmenu) {
137
+ const i = (json.Icon != null && json.Icon != '') ? html `<i class="${json.Icon} ${this.iconClass}" />` : ``;
138
+ if (isSubmenu)
139
+ return html `<li>
140
+ <a class="${this.liAMenuClass}" href="${json.URL}">
141
+ ${i}<span>${json.Text}</span>
142
+ <span class="${this.spanMenuClass}">${this.spanMenuValue}</span>
143
+ </a>
144
+ <ul class="${this.ulSubMenuClass} ${this.ulSubMenuToggleClass}">
145
+ ${this.renderMenu(json.Menu, true, true)}
146
+ </ul>
147
+ </li>`;
148
+ else
149
+ return html `<li class="${this.liLinkClass} ${this.liLinkToggleClass}">
150
+ <a href="${json.URL}" data-bs-toggle="${this.dropdownToggle}">
151
+ ${i}<span>${json.Text}</span>
152
+ </a>
153
+ <ul class="${this.ulSubMenuToggleClass} ${this.ulMainMenuToggleClass}">
154
+ ${this.renderMenu(json.Menu, true, true)}
155
+ </ul>
156
+ </li>`;
157
+ }
158
+ renderMenuDropdownLink(url, text, icon) {
159
+ const i = (icon != null && icon != '') ? html `<i class="${icon} ${this.iconClass}" />` : ``;
160
+ return html `<li><a class="${this.liAMenuClass}" href="${url}">${i}${text}</a></li>`;
161
+ }
162
+ renderMenuLink(menu) {
163
+ const i = (menu.Icon != null && menu.Icon != '') ? html `<i class="${menu.Icon} ${this.iconClass}" />` : ``;
164
+ const title = menu.Title;
165
+ const content = menu.DataContent;
166
+ const toggle = menu.DataToggle != null ? menu.DataToggle : this.popoverToggle;
167
+ const container = menu.DataContainer != null ? menu.DataContainer : this.popoverContainer;
168
+ const placement = menu.DataPlacement != null ? menu.DataPlacement : this.popoverPlacement;
169
+ const trigger = menu.DataTrigger != null ? menu.DataTrigger : this.popoverTrigger;
170
+ const isHtml = menu.DataHtml != null ? menu.DataHtml : this.popoverHtml;
171
+ if (menu.DoubleClick != null)
172
+ return html `<li class="${this.liLinkClass}">
173
+ <a class="${this.dblClickClass}" title="${title}" data-bs-trigger="${trigger}" data-bs-placement="${placement}" data-bs-container="${container}" data-bs-content="${content}" data-bs-toggle="${toggle}" data-bs-html="${isHtml}" ondblclick="${menu.DoubleClick}">
174
+ ${i}${menu.Text}
175
+ </a>
176
+ </li>`;
177
+ else
178
+ return html `<li class="${this.liLinkClass}">
179
+ <a title="${title}" data-bs-trigger="${trigger}" data-bs-placement="${placement}" data-bs-container="${container}" data-bs-content="${content}" data-bs-toggle="${toggle}" data-bs-html="${isHtml}" href="${menu.URL}">
180
+ ${i}${menu.Text}
181
+ </a>
182
+ </li>`;
183
+ }
184
+ render() {
185
+ if (this.jsonData.MainMenu) {
186
+ return html `
187
+ <nav class="${this.navClass}">
188
+ <div>
189
+ <a href="#">
190
+ ${this.renderImage(this.jsonData.MainMenu.Image)}
191
+ ${this.jsonData.MainMenu.Label}
192
+ </a>
193
+ <button type="${this.buttonType}" data-bs-toggle="${this.collapseToggle}" data-bs-target="#${this.dropdownId}" aria-expanded="${this.ariaExpanded}" aria-label="${this.ariaLabel}">
194
+ <span/>
195
+ </button>
196
+ <div id="${this.dropdownId}">
197
+ <ul>
198
+ ${this.renderMenu(this.jsonData.MainMenu, false, false)}
199
+ </ul>
200
+ </div>
201
+ </div>
202
+ </nav>`;
203
+ }
204
+ else
205
+ return html ``;
206
+ }
207
+ };
208
+ __decorate([
209
+ property({ type: String }),
210
+ __metadata("design:type", Object)
211
+ ], QboMainMenu.prototype, "ariaExpanded", void 0);
212
+ __decorate([
213
+ property({ type: String }),
214
+ __metadata("design:type", Object)
215
+ ], QboMainMenu.prototype, "ariaLabel", void 0);
216
+ __decorate([
217
+ property({ type: String }),
218
+ __metadata("design:type", Object)
219
+ ], QboMainMenu.prototype, "buttonType", void 0);
220
+ __decorate([
221
+ property({ type: String }),
222
+ __metadata("design:type", Object)
223
+ ], QboMainMenu.prototype, "collapseToggle", void 0);
224
+ __decorate([
225
+ property({ type: String }),
226
+ __metadata("design:type", Object)
227
+ ], QboMainMenu.prototype, "dblClickClass", void 0);
228
+ __decorate([
229
+ property({ type: String }),
230
+ __metadata("design:type", Object)
231
+ ], QboMainMenu.prototype, "dropdownId", void 0);
232
+ __decorate([
233
+ property({ type: String }),
234
+ __metadata("design:type", Object)
235
+ ], QboMainMenu.prototype, "dropdownToggle", void 0);
236
+ __decorate([
237
+ property({ type: String }),
238
+ __metadata("design:type", Object)
239
+ ], QboMainMenu.prototype, "iconClass", void 0);
240
+ __decorate([
241
+ property({ type: String }),
242
+ __metadata("design:type", Object)
243
+ ], QboMainMenu.prototype, "liLinkToggleClass", void 0);
244
+ __decorate([
245
+ property({ type: String }),
246
+ __metadata("design:type", Object)
247
+ ], QboMainMenu.prototype, "liLinkClass", void 0);
248
+ __decorate([
249
+ property({ type: String }),
250
+ __metadata("design:type", Object)
251
+ ], QboMainMenu.prototype, "liAMenuClass", void 0);
252
+ __decorate([
253
+ property({ type: String }),
254
+ __metadata("design:type", Object)
255
+ ], QboMainMenu.prototype, "navClass", void 0);
256
+ __decorate([
257
+ property({ type: String }),
258
+ __metadata("design:type", Object)
259
+ ], QboMainMenu.prototype, "popoverContainer", void 0);
260
+ __decorate([
261
+ property({ type: String }),
262
+ __metadata("design:type", Object)
263
+ ], QboMainMenu.prototype, "popoverHtml", void 0);
264
+ __decorate([
265
+ property({ type: String }),
266
+ __metadata("design:type", Object)
267
+ ], QboMainMenu.prototype, "popoverPlacement", void 0);
268
+ __decorate([
269
+ property({ type: String }),
270
+ __metadata("design:type", Object)
271
+ ], QboMainMenu.prototype, "popoverToggle", void 0);
272
+ __decorate([
273
+ property({ type: String }),
274
+ __metadata("design:type", Object)
275
+ ], QboMainMenu.prototype, "popoverTrigger", void 0);
276
+ __decorate([
277
+ property({ type: String }),
278
+ __metadata("design:type", Object)
279
+ ], QboMainMenu.prototype, "spanMenuClass", void 0);
280
+ __decorate([
281
+ property({ type: String }),
282
+ __metadata("design:type", Object)
283
+ ], QboMainMenu.prototype, "spanMenuValue", void 0);
284
+ __decorate([
285
+ property({ type: String }),
286
+ __metadata("design:type", Object)
287
+ ], QboMainMenu.prototype, "ulMainMenuToggleClass", void 0);
288
+ __decorate([
289
+ property({ type: String }),
290
+ __metadata("design:type", Object)
291
+ ], QboMainMenu.prototype, "ulSubMenuClass", void 0);
292
+ __decorate([
293
+ property({ type: String }),
294
+ __metadata("design:type", Object)
295
+ ], QboMainMenu.prototype, "ulSubMenuToggleClass", void 0);
296
+ __decorate([
297
+ property({ type: String }),
298
+ __metadata("design:type", Object)
299
+ ], QboMainMenu.prototype, "apiEndpoint", void 0);
300
+ __decorate([
301
+ property({ type: Boolean }),
302
+ __metadata("design:type", Object)
303
+ ], QboMainMenu.prototype, "renderInHost", void 0);
304
+ QboMainMenu = __decorate([
305
+ customElement('qbo-mainmenu')
306
+ ], QboMainMenu);
307
+ export { QboMainMenu };
@@ -0,0 +1,263 @@
1
+ import { html, PropertyValues } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { QboFetch } from './qbo-fetch.js';
4
+ import { Popover } from 'bootstrap';
5
+
6
+ @customElement('qbo-mainmenu')
7
+ export class QboMainMenu extends QboFetch {
8
+
9
+ @property({ type: String })
10
+ ariaExpanded = 'false';
11
+
12
+ @property({ type: String })
13
+ ariaLabel = 'Toggle menu';
14
+
15
+ @property({ type: String })
16
+ buttonType = 'button';
17
+
18
+ @property({ type: String })
19
+ collapseToggle = 'collapse';
20
+
21
+ @property({ type: String })
22
+ dblClickClass = 'qbo-doubleclick';
23
+
24
+ @property({ type: String })
25
+ dropdownId = 'qboMainMenu';
26
+
27
+ @property({ type: String })
28
+ dropdownToggle = 'dropdown';
29
+
30
+ @property({ type: String })
31
+ iconClass = 'qbo-icon';
32
+
33
+ @property({ type: String })
34
+ liLinkToggleClass = 'qbo-dropdown';
35
+
36
+ @property({ type: String })
37
+ liLinkClass = 'qbo-nav-item';
38
+
39
+ @property({ type: String })
40
+ liAMenuClass = 'qbo-dropdown-item';
41
+
42
+ @property({ type: String })
43
+ navClass = 'qbo-mainmenu';
44
+
45
+ @property({ type: String })
46
+ popoverContainer = 'body';
47
+
48
+ @property({ type: String })
49
+ popoverHtml = 'false';
50
+
51
+ @property({ type: String })
52
+ popoverPlacement = 'bottom';
53
+
54
+ @property({ type: String })
55
+ popoverToggle = 'popover';
56
+
57
+ @property({ type: String })
58
+ popoverTrigger = 'hover';
59
+
60
+ @property({ type: String })
61
+ spanMenuClass = 'qbo-submenuexpand';
62
+
63
+ @property({ type: String })
64
+ spanMenuValue = '>';
65
+
66
+ @property({ type: String })
67
+ ulMainMenuToggleClass = 'qbo-dropdown-mainmenu';
68
+
69
+ @property({ type: String })
70
+ ulSubMenuClass = 'submenu';
71
+
72
+ @property({ type: String })
73
+ ulSubMenuToggleClass = 'dropdown-menu';
74
+
75
+ @property({ type: String })
76
+ apiEndpoint = new URL('config/mainmenu', this.baseURI);
77
+
78
+ @property({ type: Boolean })
79
+ renderInHost = true;
80
+
81
+ targetElement: Element | null = null;
82
+
83
+ createRenderRoot() {
84
+ return this.renderInHost ? this : super.createRenderRoot();
85
+ }
86
+
87
+ connectedCallback() {
88
+ super.connectedCallback();
89
+ window.addEventListener('resize', this.handleResize);
90
+ }
91
+
92
+ disconnectedCallback() {
93
+ window.removeEventListener('resize', this.handleResize);
94
+ super.disconnectedCallback();
95
+ }
96
+
97
+ handleResize = () => {
98
+ if (window.innerWidth < 992) {
99
+ /* Collapse menu on small screens */
100
+ this.renderRoot.querySelectorAll(`button`).forEach(function (btn) {
101
+ if (btn != null && btn instanceof HTMLElement && btn.hasAttribute('aria-expanded') && btn.getAttribute('aria-expanded') == 'true')
102
+ btn.click();
103
+ });
104
+ } else {
105
+ /* Remove collapsed styling on large screens*/
106
+ this.renderRoot.querySelectorAll(`.${this.ulSubMenuToggleClass} .${this.ulSubMenuClass}`).forEach(function (ul) {
107
+ if (ul != null && ul instanceof HTMLElement && ul.hasAttribute('style'))
108
+ ul.removeAttribute('style');
109
+ });
110
+ }
111
+ }
112
+
113
+ updated(changedProperties: PropertyValues) {
114
+ super.updated(changedProperties);
115
+
116
+ if (changedProperties.get('jsonData') != undefined) {
117
+ /* Disable click */
118
+ this.renderRoot.querySelectorAll(`.${this.ulSubMenuToggleClass}`).forEach(ul => {
119
+ ul.addEventListener('click', function (e) {
120
+ e.stopPropagation();
121
+ });
122
+ });
123
+
124
+ /* Click for menu expansion on small screens */
125
+ const className = this.ulSubMenuClass;
126
+ this.renderRoot.querySelectorAll(`.${this.ulSubMenuToggleClass} a`).forEach(function (a) {
127
+ a.addEventListener('click', (e) => {
128
+ if (e.currentTarget != null && e.currentTarget instanceof HTMLElement && window.innerWidth < 992) {
129
+ const nextEl = e.currentTarget.nextElementSibling;
130
+ if (nextEl != null && nextEl instanceof HTMLElement && nextEl.classList.contains(className)) {
131
+ e.preventDefault();
132
+ nextEl.style.display = nextEl.style.display == 'block' ? 'none' : 'block';
133
+ }
134
+ }
135
+ });
136
+ });
137
+
138
+ /* Enable popovers */
139
+ this.renderRoot.querySelectorAll(`[data-bs-toggle="${this.popoverToggle}"]`).forEach(function (t) {
140
+ new Popover(t);
141
+ });
142
+ }
143
+ }
144
+
145
+ renderImage(image) {
146
+ if (image != null) return html`<img src="${image}"/><span/>`;
147
+ else return html``;
148
+ }
149
+
150
+ renderMenu(json, isDropdown, isSubmenu) {
151
+ let result = html``;
152
+ const jsonMenu = json != null && json.Menu != null ? json.Menu : json;
153
+
154
+ if (jsonMenu != null) {
155
+
156
+ if (jsonMenu.forEach) {
157
+ jsonMenu.forEach(mm => {
158
+ if (mm.Menu != null)
159
+ result = html`${result}${this.renderMenuDropdown(mm, isSubmenu)}`;
160
+ else if (mm.Type == "Divider")
161
+ result = html`${result}${this.renderMenuDivider()}`;
162
+ else if (isDropdown)
163
+ result = html`${result}${this.renderMenuDropdownLink(mm.URL, mm.Text, mm.Icon)}`;
164
+ else
165
+ result = html`${result}${this.renderMenuLink(mm)}`;
166
+ });
167
+ }
168
+ else {
169
+ if (jsonMenu.Menu != null)
170
+ result = html`${result}${this.renderMenuDropdown(jsonMenu, isSubmenu)}`;
171
+ else if (jsonMenu.Type == "Divider")
172
+ result = html`${result}${this.renderMenuDivider()}`;
173
+ else if (isDropdown)
174
+ result = html`${result}${this.renderMenuDropdownLink(jsonMenu.URL, jsonMenu.Text, jsonMenu.Icon)}`;
175
+ else
176
+ result = html`${result}${this.renderMenuLink(jsonMenu)}`;
177
+ }
178
+
179
+ }
180
+
181
+ return html`${result}`;
182
+ }
183
+
184
+ renderMenuDivider() {
185
+ return html`<li><hr/></li>`;
186
+ }
187
+
188
+ renderMenuDropdown(json, isSubmenu) {
189
+ const i = (json.Icon != null && json.Icon != '') ? html`<i class="${json.Icon} ${this.iconClass}" />` : ``;
190
+ if (isSubmenu)
191
+ return html`<li>
192
+ <a class="${this.liAMenuClass}" href="${json.URL}">
193
+ ${i}<span>${json.Text}</span>
194
+ <span class="${this.spanMenuClass}">${this.spanMenuValue}</span>
195
+ </a>
196
+ <ul class="${this.ulSubMenuClass} ${this.ulSubMenuToggleClass}">
197
+ ${this.renderMenu(json.Menu, true, true)}
198
+ </ul>
199
+ </li>`;
200
+ else
201
+ return html`<li class="${this.liLinkClass} ${this.liLinkToggleClass}">
202
+ <a href="${json.URL}" data-bs-toggle="${this.dropdownToggle}">
203
+ ${i}<span>${json.Text}</span>
204
+ </a>
205
+ <ul class="${this.ulSubMenuToggleClass} ${this.ulMainMenuToggleClass}">
206
+ ${this.renderMenu(json.Menu, true, true)}
207
+ </ul>
208
+ </li>`;
209
+ }
210
+
211
+ renderMenuDropdownLink(url, text, icon) {
212
+ const i = (icon != null && icon != '') ? html`<i class="${icon} ${this.iconClass}" />` : ``;
213
+ return html`<li><a class="${this.liAMenuClass}" href="${url}">${i}${text}</a></li>`;
214
+ }
215
+
216
+ renderMenuLink(menu) {
217
+ const i = (menu.Icon != null && menu.Icon != '') ? html`<i class="${menu.Icon} ${this.iconClass}" />` : ``;
218
+ const title = menu.Title;
219
+ const content = menu.DataContent;
220
+ const toggle = menu.DataToggle != null ? menu.DataToggle : this.popoverToggle;
221
+ const container = menu.DataContainer != null ? menu.DataContainer : this.popoverContainer;
222
+ const placement = menu.DataPlacement != null ? menu.DataPlacement : this.popoverPlacement;
223
+ const trigger = menu.DataTrigger != null ? menu.DataTrigger : this.popoverTrigger;
224
+ const isHtml = menu.DataHtml != null ? menu.DataHtml : this.popoverHtml;
225
+
226
+ if (menu.DoubleClick != null)
227
+ return html`<li class="${this.liLinkClass}">
228
+ <a class="${this.dblClickClass}" title="${title}" data-bs-trigger="${trigger}" data-bs-placement="${placement}" data-bs-container="${container}" data-bs-content="${content}" data-bs-toggle="${toggle}" data-bs-html="${isHtml}" ondblclick="${menu.DoubleClick}">
229
+ ${i}${menu.Text}
230
+ </a>
231
+ </li>`;
232
+ else
233
+ return html`<li class="${this.liLinkClass}">
234
+ <a title="${title}" data-bs-trigger="${trigger}" data-bs-placement="${placement}" data-bs-container="${container}" data-bs-content="${content}" data-bs-toggle="${toggle}" data-bs-html="${isHtml}" href="${menu.URL}">
235
+ ${i}${menu.Text}
236
+ </a>
237
+ </li>`;
238
+ }
239
+
240
+ render() {
241
+ if (this.jsonData.MainMenu) {
242
+ return html`
243
+ <nav class="${this.navClass}">
244
+ <div>
245
+ <a href="#">
246
+ ${this.renderImage(this.jsonData.MainMenu.Image)}
247
+ ${this.jsonData.MainMenu.Label}
248
+ </a>
249
+ <button type="${this.buttonType}" data-bs-toggle="${this.collapseToggle}" data-bs-target="#${this.dropdownId}" aria-expanded="${this.ariaExpanded}" aria-label="${this.ariaLabel}">
250
+ <span/>
251
+ </button>
252
+ <div id="${this.dropdownId}">
253
+ <ul>
254
+ ${this.renderMenu(this.jsonData.MainMenu, false, false)}
255
+ </ul>
256
+ </div>
257
+ </div>
258
+ </nav>`;
259
+ }
260
+ else
261
+ return html``;
262
+ }
263
+ }
@@ -0,0 +1,9 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * Renders CodeMirror to edit HTML.
4
+ */
5
+ export declare class QboMarkdown extends LitElement {
6
+ src: any;
7
+ connectedCallback(): Promise<void>;
8
+ render(): import("lit").TemplateResult<1>;
9
+ }
@@ -0,0 +1,33 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { html, LitElement } from 'lit';
11
+ import { customElement, property } from 'lit/decorators.js';
12
+ import { ZeroMd } from 'zero-md';
13
+ const md = ZeroMd;
14
+ /**
15
+ * Renders CodeMirror to edit HTML.
16
+ */
17
+ let QboMarkdown = class QboMarkdown extends LitElement {
18
+ async connectedCallback() {
19
+ super.connectedCallback();
20
+ }
21
+ render() {
22
+ const s = "script";
23
+ return html `<zero-md src="${this.src}"><script type="text/markdown">${this.querySelector('script')?.innerHTML}<\/script></zero-md>`;
24
+ }
25
+ };
26
+ __decorate([
27
+ property(),
28
+ __metadata("design:type", Object)
29
+ ], QboMarkdown.prototype, "src", void 0);
30
+ QboMarkdown = __decorate([
31
+ customElement('qbo-markdown')
32
+ ], QboMarkdown);
33
+ export { QboMarkdown };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qbo-select.js","sourceRoot":"","sources":["qbo-select.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;IAKI;AAEG,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,QAAQ;IAAhC;;QAGH,YAAO,GAAG,KAAK,CAAC;QAGhB,eAAU,GAAkB,IAAI,CAAC;QAGjC,gBAAW,GAAkB,IAAI,CAAC;QAGlC,iBAAY,GAAG,IAAI,CAAC;QAGpB,aAAQ,GAAG,IAAI,CAAC;QAGhB,YAAO,GAA4C,EAAE,CAAC;QAGtD,iBAAY,GAAG,IAAI,CAAC;IA+BxB,CAAC;aA7BU,WAAM,GAAG;QACZ,GAAG,CAAA;;;SAGF;KACJ,AALY,CAKX;IAEF,KAAK,CAAC,iBAAiB;QACnB,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,WAAW,CAAC;QACrC,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC9B,CAAC;IAED,gBAAgB;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC/D,CAAC;IAED,MAAM;QACF,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAC1C,OAAO,IAAI,CAAA,mBAAmB,CAAC;QAEnC,IAAI,CAAC,WAAW,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC;QAExE,OAAO,IAAI,CAAA;gCACa,IAAI,CAAC,QAAQ;sBACvB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAA,kBAAkB,MAAM,CAAC,IAAI,CAAC,WAAY,CAAC,gBAAgB,MAAM,CAAC,IAAI,CAAC,WAAY,CAAC,KAAK,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAW,CAAC,WAAW,CAAC;0BAC9K,CAAC;IACvB,CAAC;;AAhDD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACM;AAGjC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACO;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACP;AAGpB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;2CACrB;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;0CAC4B;AAGtD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACR;AArBX,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAoDrB"}
@@ -0,0 +1,22 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { ZeroMd } from 'zero-md'
4
+ const md = ZeroMd;
5
+ /**
6
+ * Renders CodeMirror to edit HTML.
7
+ */
8
+ @customElement('qbo-markdown')
9
+ export class QboMarkdown extends LitElement
10
+ {
11
+ @property()
12
+ src;
13
+
14
+ async connectedCallback() {
15
+ super.connectedCallback();
16
+ }
17
+ render() {
18
+ const s = "script";
19
+ return html`<zero-md src="${this.src}"><script type="text/markdown">${this.querySelector('script')?.innerHTML}<\/script></zero-md>`
20
+ }
21
+ }
22
+
@@ -0,0 +1,31 @@
1
+ import { LitElement } from 'lit';
2
+ declare global {
3
+ interface Window {
4
+ SpeechRecognition: any;
5
+ webkitSpeechRecognition: any;
6
+ }
7
+ }
8
+ /**
9
+ * Collect text input from the user.
10
+ */
11
+ export declare class QboMicrophone extends LitElement {
12
+ static activeInstance: QboMicrophone | null;
13
+ renderInHost: boolean;
14
+ continuous: boolean;
15
+ interimResults: boolean;
16
+ maxAlternatives: number;
17
+ for: string;
18
+ class: string;
19
+ activeClass: string;
20
+ _recognition: any;
21
+ target: Element | null | undefined;
22
+ listening: boolean;
23
+ connectedCallback(): void;
24
+ disconnectedCallback(): void;
25
+ onResult(e: any): void;
26
+ listen(e: any): void;
27
+ start(): void;
28
+ stop(e: any): void;
29
+ error(e: any): void;
30
+ render(): import("lit").TemplateResult<1>;
31
+ }