@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,85 @@
1
+ /* @description Find an array in a JSON object
2
+ * @param json {object} A Json object or array.
3
+ * @param arrayName {array} The name of a key that represents an array to use. If not specified, the first array found will be returned.
4
+ * @returns {Array} An array if found, otherwise null.
5
+ */
6
+ function getArray(json, arrayName) {
7
+ if (typeof json === 'string') {
8
+ try {
9
+ json = JSON.parse(json);
10
+ }
11
+ catch (error) {
12
+ console.error('Error parsing JSON string:', error);
13
+ return null;
14
+ }
15
+ }
16
+ if (Array.isArray(json)) {
17
+ return json;
18
+ }
19
+ if (typeof json === 'object' && json !== null) {
20
+ for (const key in json) {
21
+ const value = json[key];
22
+ if (Array.isArray(value)) {
23
+ return value;
24
+ }
25
+ else if (typeof value === 'object') {
26
+ const nestedResult = getArray(value, arrayName);
27
+ if (nestedResult) {
28
+ return nestedResult;
29
+ }
30
+ }
31
+ }
32
+ }
33
+ return null; // No array found
34
+ }
35
+ /* @description Perform string substitution on a template using a JSON object
36
+ */
37
+ function interpolate(template, data) {
38
+ try {
39
+ return new Function("return `" + template + "`;").call(data);
40
+ }
41
+ catch (err) {
42
+ document.dispatchEvent(new CustomEvent('qbo-warning', { detail: { 'error': err, 'message': 'Unable to substitute template.', 'template': template, 'data': data } }));
43
+ return template;
44
+ }
45
+ }
46
+ /* @description Perform string substitution of ${expression} using one or more JSON objects.
47
+ * @example substitute('Hello ${name}!', { name: 'World' }) => 'Hello World!'
48
+ */
49
+ function substitute(inputString, ...jsonData) {
50
+ // Use a regular expression to match ${key} expressions
51
+ const regex = /\${(.*?)}/g;
52
+ let resultString = inputString;
53
+ for (let i = 0; i < jsonData.length; i++) {
54
+ const data = jsonData[i];
55
+ resultString = resultString.replace(regex, (match, expression) => {
56
+ const parts = expression.split('|');
57
+ const key = parts[0].trim();
58
+ const format = (parts.lenth > 1) ? parts[1].trim() : null;
59
+ // todo: handle formatting (dates, currency, etc.)
60
+ const replacement = data[key];
61
+ // If the key exists in the JSON data, replace it; otherwise, keep the original string
62
+ return replacement !== undefined ? replacement : match;
63
+ });
64
+ }
65
+ resultString = resultString.replace(regex, () => '');
66
+ return resultString;
67
+ }
68
+ /* @description Replicates content in a target element for each item in a JSON array.
69
+ */
70
+ function replicate(target, template, sourceData, emptyContent = true) {
71
+ if (target != null && template != null) {
72
+ while (emptyContent && target.firstChild) {
73
+ target.removeChild(target.firstChild);
74
+ }
75
+ sourceData.map((data, index) => {
76
+ const row = template.content.cloneNode(true);
77
+ if (row.firstElementChild != null) {
78
+ row.firstElementChild.setAttribute("data-index", `${index}`);
79
+ row.firstElementChild.innerHTML = substitute(row.firstElementChild?.innerHTML ?? '', data);
80
+ }
81
+ target.appendChild(row);
82
+ });
83
+ }
84
+ }
85
+ export { getArray, substitute, replicate };
@@ -0,0 +1,92 @@
1
+ 
2
+ /* @description Find an array in a JSON object
3
+ * @param json {object} A Json object or array.
4
+ * @param arrayName {array} The name of a key that represents an array to use. If not specified, the first array found will be returned.
5
+ * @returns {Array} An array if found, otherwise null.
6
+ */
7
+ function getArray(json: any, arrayName?: string): Array<{ [key: string]: string }> | null {
8
+ if (typeof json === 'string') {
9
+ try {
10
+ json = JSON.parse(json);
11
+ } catch (error) {
12
+ console.error('Error parsing JSON string:', error);
13
+ return null;
14
+ }
15
+ }
16
+
17
+ if (Array.isArray(json)) {
18
+ return json;
19
+ }
20
+
21
+ if (typeof json === 'object' && json !== null) {
22
+ for (const key in json ) {
23
+ const value = json [key];
24
+ if (Array.isArray(value)) {
25
+ return value;
26
+ } else if (typeof value === 'object') {
27
+ const nestedResult = getArray(value, arrayName);
28
+ if (nestedResult) {
29
+ return nestedResult;
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ return null; // No array found
36
+ }
37
+
38
+ /* @description Perform string substitution on a template using a JSON object
39
+ */
40
+ function interpolate(template: string, data: { [key: string]: string }) {
41
+ try {
42
+ return new Function("return `" + template + "`;").call(data);
43
+ } catch (err) {
44
+ document.dispatchEvent(new CustomEvent('qbo-warning', { detail: { 'error': err, 'message': 'Unable to substitute template.', 'template': template, 'data': data } }));
45
+ return template;
46
+ }
47
+ }
48
+
49
+ /* @description Perform string substitution of ${expression} using one or more JSON objects.
50
+ * @example substitute('Hello ${name}!', { name: 'World' }) => 'Hello World!'
51
+ */
52
+ function substitute(inputString: string, ...jsonData: any): string {
53
+ // Use a regular expression to match ${key} expressions
54
+ const regex = /\${(.*?)}/g;
55
+ let resultString = inputString;
56
+ for (let i = 0; i < jsonData.length; i++) {
57
+ const data = jsonData[i] as Record<string, any>;
58
+ resultString = resultString.replace(regex, (match, expression) => {
59
+ const parts = expression.split('|');
60
+ const key = parts[0].trim();
61
+ const format = (parts.lenth>1) ? parts[1].trim() : null;
62
+ // todo: handle formatting (dates, currency, etc.)
63
+ const replacement = data[key];
64
+ // If the key exists in the JSON data, replace it; otherwise, keep the original string
65
+ return replacement !== undefined ? replacement : match;
66
+ });
67
+ }
68
+ resultString = resultString.replace(regex, () => '');
69
+
70
+ return resultString;
71
+ }
72
+
73
+
74
+ /* @description Replicates content in a target element for each item in a JSON array.
75
+ */
76
+ function replicate(target: HTMLElement | null, template: HTMLTemplateElement | null, sourceData: Array<{ [key: string]: string }>, emptyContent: boolean = true) {
77
+ if (target != null && template != null) {
78
+ while (emptyContent && target.firstChild) {
79
+ target.removeChild(target.firstChild);
80
+ }
81
+ sourceData.map((data, index) => {
82
+ const row = template.content.cloneNode(true) as DocumentFragment;
83
+ if (row.firstElementChild != null) {
84
+ row.firstElementChild.setAttribute("data-index", `${index}`);
85
+ row.firstElementChild.innerHTML = substitute(row.firstElementChild?.innerHTML ?? '', data)
86
+ }
87
+ target.appendChild(row);
88
+ });
89
+ }
90
+ }
91
+
92
+ export { getArray, substitute, replicate };
@@ -0,0 +1,15 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * Renders CodeMirror to edit HTML.
4
+ */
5
+ export declare class QboLink extends LitElement {
6
+ id: any;
7
+ name: any;
8
+ link: any;
9
+ href: any;
10
+ data: {
11
+ [key: string]: any;
12
+ } | null;
13
+ connectedCallback(): Promise<void>;
14
+ render(): import("lit").TemplateResult<1> | undefined;
15
+ }
@@ -0,0 +1,48 @@
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
+ /**
13
+ * Renders CodeMirror to edit HTML.
14
+ */
15
+ let QboLink = class QboLink extends LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.data = null;
19
+ }
20
+ async connectedCallback() {
21
+ super.connectedCallback();
22
+ this.data = { "ID": 1, "Name": "John Doe" };
23
+ }
24
+ render() {
25
+ if (this.data != null)
26
+ return html `<a href="${this.href}">${this.data[this.name]}</a>`;
27
+ }
28
+ };
29
+ __decorate([
30
+ property(),
31
+ __metadata("design:type", Object)
32
+ ], QboLink.prototype, "id", void 0);
33
+ __decorate([
34
+ property(),
35
+ __metadata("design:type", Object)
36
+ ], QboLink.prototype, "name", void 0);
37
+ __decorate([
38
+ property(),
39
+ __metadata("design:type", Object)
40
+ ], QboLink.prototype, "link", void 0);
41
+ __decorate([
42
+ property(),
43
+ __metadata("design:type", Object)
44
+ ], QboLink.prototype, "href", void 0);
45
+ QboLink = __decorate([
46
+ customElement('qbo-linkn')
47
+ ], QboLink);
48
+ export { QboLink };
@@ -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,34 @@
1
+ import { html, css, LitElement } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+
4
+ /**
5
+ * Renders CodeMirror to edit HTML.
6
+ */
7
+ @customElement('qbo-linkn')
8
+ export class QboLink extends LitElement {
9
+
10
+ @property()
11
+ id;
12
+
13
+ @property()
14
+ name;
15
+
16
+ @property()
17
+ link;
18
+
19
+ @property()
20
+ href;
21
+
22
+ data: { [key: string]: any } | null = null;
23
+
24
+ async connectedCallback() {
25
+ super.connectedCallback();
26
+ this.data = { "ID": 1, "Name": "John Doe" };
27
+ }
28
+
29
+ render() {
30
+ if (this.data != null)
31
+ return html`<a href="${this.href}">${this.data[this.name]}</a>`;
32
+ }
33
+ }
34
+
@@ -0,0 +1,13 @@
1
+ import { LitElement, PropertyValues, CSSResult } from 'lit';
2
+ export declare class QboLogging extends LitElement {
3
+ static styles: CSSResult[];
4
+ errorCount: number;
5
+ warningCount: number;
6
+ infoCount: number;
7
+ errorClass: string;
8
+ warningClass: string;
9
+ infoClass: string;
10
+ firstUpdated(changedProperties: PropertyValues): void;
11
+ connectedCallback(): Promise<void>;
12
+ render(): import("lit").TemplateResult<1>;
13
+ }
@@ -0,0 +1,92 @@
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 { LitElement, html, css } from 'lit';
11
+ import { customElement, property } from 'lit/decorators.js';
12
+ import { bootstrap } from './styles.js';
13
+ let QboLogging = class QboLogging extends LitElement {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.errorCount = 0;
17
+ this.warningCount = 0;
18
+ this.infoCount = 0;
19
+ this.errorClass = 'badge text-bg-danger';
20
+ this.warningClass = 'badge text-bg-warning';
21
+ this.infoClass = 'badge text-bg-info';
22
+ }
23
+ static { this.styles = [
24
+ bootstrap,
25
+ css `/* Add any custom styles here */`
26
+ ]; }
27
+ firstUpdated(changedProperties) {
28
+ super.firstUpdated(changedProperties);
29
+ const root = this.renderRoot;
30
+ this.renderRoot.querySelectorAll('span').forEach(tag => {
31
+ tag.addEventListener('click', (e) => {
32
+ if (e.currentTarget != null && e.currentTarget instanceof HTMLElement) {
33
+ // console.log(e.currentTarget.style.display);
34
+ e.currentTarget.style.display = 'none';
35
+ root.querySelectorAll('span').forEach(child => {
36
+ child.style.fontSize = "2em";
37
+ });
38
+ }
39
+ console.log('tag is', tag);
40
+ console.log('e is', e);
41
+ });
42
+ });
43
+ }
44
+ async connectedCallback() {
45
+ super.connectedCallback();
46
+ document.addEventListener('qbo-error', (e) => {
47
+ this.errorCount++;
48
+ console.log(e);
49
+ });
50
+ document.addEventListener('qbo-warning', (e) => {
51
+ this.warningCount++;
52
+ console.log(e);
53
+ });
54
+ document.addEventListener('qbo-info', (e) => {
55
+ this.infoCount++;
56
+ console.log(e);
57
+ });
58
+ }
59
+ render() {
60
+ return html `<span class="${this.errorClass}">${this.errorCount}</span>
61
+ <span class="${this.warningClass}">${this.warningCount}</span>
62
+ <span class="boo ${this.infoClass}">${this.infoCount}</span>`;
63
+ }
64
+ };
65
+ __decorate([
66
+ property({ type: Number }),
67
+ __metadata("design:type", Object)
68
+ ], QboLogging.prototype, "errorCount", void 0);
69
+ __decorate([
70
+ property({ type: Number }),
71
+ __metadata("design:type", Object)
72
+ ], QboLogging.prototype, "warningCount", void 0);
73
+ __decorate([
74
+ property({ type: Number }),
75
+ __metadata("design:type", Object)
76
+ ], QboLogging.prototype, "infoCount", void 0);
77
+ __decorate([
78
+ property(),
79
+ __metadata("design:type", Object)
80
+ ], QboLogging.prototype, "errorClass", void 0);
81
+ __decorate([
82
+ property(),
83
+ __metadata("design:type", Object)
84
+ ], QboLogging.prototype, "warningClass", void 0);
85
+ __decorate([
86
+ property(),
87
+ __metadata("design:type", Object)
88
+ ], QboLogging.prototype, "infoClass", void 0);
89
+ QboLogging = __decorate([
90
+ customElement('qbo-logging')
91
+ ], QboLogging);
92
+ export { QboLogging };
@@ -0,0 +1,72 @@
1
+ import { LitElement, html, css, PropertyValues, CSSResult, unsafeCSS } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { bootstrap } from './styles.js';
4
+
5
+ @customElement('qbo-logging')
6
+ export class QboLogging extends LitElement
7
+ {
8
+ static styles = [
9
+ bootstrap,
10
+ css`/* Add any custom styles here */`
11
+ ];
12
+
13
+ @property({ type: Number })
14
+ errorCount = 0;
15
+
16
+ @property({ type: Number })
17
+ warningCount = 0;
18
+
19
+ @property({ type: Number })
20
+ infoCount = 0;
21
+
22
+ @property()
23
+ errorClass = 'badge text-bg-danger';
24
+
25
+ @property()
26
+ warningClass = 'badge text-bg-warning';
27
+
28
+ @property()
29
+ infoClass = 'badge text-bg-info';
30
+
31
+ firstUpdated(changedProperties: PropertyValues) {
32
+ super.firstUpdated(changedProperties);
33
+ const root = this.renderRoot;
34
+ this.renderRoot.querySelectorAll('span').forEach(tag => {
35
+ tag.addEventListener('click', (e) => {
36
+ if (e.currentTarget != null && e.currentTarget instanceof HTMLElement) {
37
+ // console.log(e.currentTarget.style.display);
38
+ e.currentTarget.style.display = 'none';
39
+ root.querySelectorAll('span').forEach(child => {
40
+ child.style.fontSize = "2em";
41
+ });
42
+ }
43
+ console.log('tag is', tag);
44
+ console.log('e is', e);
45
+ })
46
+ });
47
+ }
48
+
49
+ async connectedCallback()
50
+ {
51
+ super.connectedCallback();
52
+ document.addEventListener('qbo-error', (e) => {
53
+ this.errorCount++;
54
+ console.log(e);
55
+ });
56
+ document.addEventListener('qbo-warning', (e) => {
57
+ this.warningCount++;
58
+ console.log(e);
59
+ });
60
+ document.addEventListener('qbo-info', (e) => {
61
+ this.infoCount++;
62
+ console.log(e);
63
+ });
64
+ }
65
+
66
+ render() {
67
+ return html`<span class="${this.errorClass}">${this.errorCount}</span>
68
+ <span class="${this.warningClass}">${this.warningCount}</span>
69
+ <span class="boo ${this.infoClass}">${this.infoCount}</span>`;
70
+ }
71
+ }
72
+
@@ -0,0 +1,41 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { QboFetch } from './qbo-fetch.js';
3
+ export declare class QboMainMenu extends QboFetch {
4
+ ariaExpanded: string;
5
+ ariaLabel: string;
6
+ buttonType: string;
7
+ collapseToggle: string;
8
+ dblClickClass: string;
9
+ dropdownId: string;
10
+ dropdownToggle: string;
11
+ iconClass: string;
12
+ liLinkToggleClass: string;
13
+ liLinkClass: string;
14
+ liAMenuClass: string;
15
+ navClass: string;
16
+ popoverContainer: string;
17
+ popoverHtml: string;
18
+ popoverPlacement: string;
19
+ popoverToggle: string;
20
+ popoverTrigger: string;
21
+ spanMenuClass: string;
22
+ spanMenuValue: string;
23
+ ulMainMenuToggleClass: string;
24
+ ulSubMenuClass: string;
25
+ ulSubMenuToggleClass: string;
26
+ apiEndpoint: URL;
27
+ renderInHost: boolean;
28
+ targetElement: Element | null;
29
+ createRenderRoot(): Element | ShadowRoot;
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
32
+ handleResize: () => void;
33
+ updated(changedProperties: PropertyValues): void;
34
+ renderImage(image: any): import("lit").TemplateResult<1>;
35
+ renderMenu(json: any, isDropdown: any, isSubmenu: any): import("lit").TemplateResult<1>;
36
+ renderMenuDivider(): import("lit").TemplateResult<1>;
37
+ renderMenuDropdown(json: any, isSubmenu: any): import("lit").TemplateResult<1>;
38
+ renderMenuDropdownLink(url: any, text: any, icon: any): import("lit").TemplateResult<1>;
39
+ renderMenuLink(menu: any): import("lit").TemplateResult<1>;
40
+ render(): import("lit").TemplateResult<1>;
41
+ }