@quandis/qbo4.ui 4.0.1-CI-20240405-163539 → 4.0.1-CI-20240406-034601

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Quandis, Inc.",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "4.0.1-CI-20240405-163539",
6
+ "version": "4.0.1-CI-20240406-034601",
7
7
  "workspaces": [
8
8
  "code"
9
9
  ],
@@ -4,5 +4,5 @@ export declare class ApiServiceComponent extends LitElement {
4
4
  apiEndpoint: string | null;
5
5
  method: string;
6
6
  firstUpdated(): void;
7
- render(): import("lit").TemplateResult<1>;
7
+ render(): import("lit-html").TemplateResult<1>;
8
8
  }
@@ -18,6 +18,6 @@ export declare class QboBreadcrumb extends QboFetch {
18
18
  renderInHost: boolean;
19
19
  createRenderRoot(): Element | ShadowRoot;
20
20
  connectedCallback(): void;
21
- renderItem(option: any): import("lit").TemplateResult<1>;
22
- render(): import("lit").TemplateResult<1>;
21
+ renderItem(option: any): import("lit-html").TemplateResult<1>;
22
+ render(): import("lit-html").TemplateResult<1>;
23
23
  }
@@ -18,5 +18,5 @@ export declare class QboDataList extends QboFetch {
18
18
  createRenderRoot(): Element | ShadowRoot;
19
19
  buildDataList(e: any): Promise<void>;
20
20
  setOutputValue(e: any): void;
21
- render(): import("lit").TemplateResult<1>;
21
+ render(): import("lit-html").TemplateResult<1>;
22
22
  }
@@ -11,5 +11,5 @@ export declare class QboDocViewer extends QboFetch {
11
11
  renderInHost: boolean;
12
12
  static styles: import("lit").CSSResult[];
13
13
  connectedCallback(): Promise<void>;
14
- render(): import("lit").TemplateResult<1>;
14
+ render(): import("lit-html").TemplateResult<1>;
15
15
  }
@@ -13,7 +13,7 @@ export declare class QboFormElement extends LitElement {
13
13
  connectedCallback(): void;
14
14
  disconnectedCallback(): void;
15
15
  updated(changedProperties: PropertyValues): void;
16
- render(): import("lit").TemplateResult<1>;
16
+ render(): import("lit-html").TemplateResult<1>;
17
17
  establishFormData(): void;
18
18
  handleFormChange: (event: any) => void;
19
19
  augment: (event: any) => void;
@@ -1,121 +1,121 @@
1
1
  import { ILoggerService, ILoggerServiceToken, services } from '@quandis/qbo4.logging';
2
- import { html, css, LitElement, PropertyValues } from 'lit';
3
- import { customElement, property } from 'lit/decorators.js';
2
+ import { html, css, LitElement, PropertyValues } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
4
  import { substitute } from './qbo-json.js';
5
-
6
- @customElement('qbo-form-element')
7
- export class QboFormElement extends LitElement {
8
- static formAssociated = true;
9
-
10
- @property({ type: FormData })
11
- value: FormData = new FormData();
12
-
13
- @property({ type: String })
14
- template = '';
15
-
16
- @property({ type: String })
17
- name = '';
18
-
19
- @property({ type: Object })
20
- data = null;
21
-
22
- private templateNode: HTMLTemplateElement | null = null;
23
-
24
- private internals: ElementInternals;
5
+
6
+ @customElement('qbo-form-element')
7
+ export class QboFormElement extends LitElement {
8
+ static formAssociated = true;
9
+
10
+ @property({ type: FormData })
11
+ value: FormData = new FormData();
12
+
13
+ @property({ type: String })
14
+ template = '';
15
+
16
+ @property({ type: String })
17
+ name = '';
18
+
19
+ @property({ type: Object })
20
+ data = null;
21
+
22
+ private templateNode: HTMLTemplateElement | null = null;
23
+
24
+ private internals: ElementInternals;
25
25
  logger: ILoggerService;
26
-
27
- constructor() {
28
- super();
29
- this.internals = this.attachInternals(); // Attach the form internals
30
- this.logger = services.container.resolve<ILoggerService>(ILoggerServiceToken);
31
- }
32
-
33
- connectedCallback() {
34
- super.connectedCallback();
35
- this.templateNode = document.getElementById(this.template) as HTMLTemplateElement;
36
-
37
- if (this.templateNode) {
38
- this.appendChild(this.templateNode.content.cloneNode(true));
39
- this.innerHTML = substitute(this.innerHTML, this.data);
40
- }
41
- this.shadowRoot?.addEventListener('change', this.handleFormChange);
42
- this.shadowRoot?.addEventListener('qbo-form-update', this.augment);
43
-
44
- }
45
-
46
- disconnectedCallback() {
47
- super.disconnectedCallback();
48
- this.shadowRoot?.removeEventListener('change', this.handleFormChange);
49
- this.shadowRoot?.removeEventListener('qbo-form-update', this.augment);
50
- }
51
-
52
- updated(changedProperties: PropertyValues) {
53
- super.updated(changedProperties);
54
- this.establishFormData();
55
- }
56
-
57
- render() {
58
- return html`<slot></slot>`;
59
- }
60
-
61
- establishFormData() {
62
- const elements = this.shadowRoot?.querySelectorAll('input, select, textarea');
63
- const inputs = Array.from(elements!).filter(e => !e.assignedSlot
64
- && (e instanceof HTMLInputElement
65
- || e instanceof HTMLSelectElement
66
- || e instanceof HTMLTextAreaElement
67
- || e instanceof QboFormElement
68
- ) && e.name
69
- );
70
- inputs!.forEach(element => {
71
- const input = element as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | QboFormElement;
72
-
73
- if (input instanceof HTMLSelectElement) {
74
- this.value.set(`${this.name}${input.name}`, input.value);
75
- } else if (input instanceof HTMLTextAreaElement) {
76
- this.value.set(`${this.name}${input.name}`, input.value);
77
- } else if (input instanceof QboFormElement) {
78
- for (let [key, value] of input.value.entries()) {
79
- this.value.set(`${this.name}${key}`, value);
26
+
27
+ constructor() {
28
+ super();
29
+ this.internals = this.attachInternals(); // Attach the form internals
30
+ this.logger = services.container.resolve<ILoggerService>(ILoggerServiceToken);
31
+ }
32
+
33
+ connectedCallback() {
34
+ super.connectedCallback();
35
+ this.templateNode = document.getElementById(this.template) as HTMLTemplateElement;
36
+
37
+ if (this.templateNode) {
38
+ this.appendChild(this.templateNode.content.cloneNode(true));
39
+ this.innerHTML = substitute(this.innerHTML, this.data);
40
+ }
41
+ this.shadowRoot?.addEventListener('change', this.handleFormChange);
42
+ this.shadowRoot?.addEventListener('qbo-form-update', this.augment);
43
+
44
+ }
45
+
46
+ disconnectedCallback() {
47
+ super.disconnectedCallback();
48
+ this.shadowRoot?.removeEventListener('change', this.handleFormChange);
49
+ this.shadowRoot?.removeEventListener('qbo-form-update', this.augment);
50
+ }
51
+
52
+ updated(changedProperties: PropertyValues) {
53
+ super.updated(changedProperties);
54
+ this.establishFormData();
55
+ }
56
+
57
+ render() {
58
+ return html`<slot></slot>`;
59
+ }
60
+
61
+ establishFormData() {
62
+ const elements = this.shadowRoot?.querySelectorAll('input, select, textarea');
63
+ const inputs = Array.from(elements!).filter(e => !e.assignedSlot
64
+ && (e instanceof HTMLInputElement
65
+ || e instanceof HTMLSelectElement
66
+ || e instanceof HTMLTextAreaElement
67
+ || e instanceof QboFormElement
68
+ ) && e.name
69
+ );
70
+ inputs!.forEach(element => {
71
+ const input = element as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | QboFormElement;
72
+
73
+ if (input instanceof HTMLSelectElement) {
74
+ this.value.set(`${this.name}${input.name}`, input.value);
75
+ } else if (input instanceof HTMLTextAreaElement) {
76
+ this.value.set(`${this.name}${input.name}`, input.value);
77
+ } else if (input instanceof QboFormElement) {
78
+ for (let [key, value] of input.value.entries()) {
79
+ this.value.set(`${this.name}${key}`, value);
80
80
  }
81
- } else if (input instanceof HTMLInputElement) {
82
- if (input.type === 'checkbox' || input.type === 'radio') {
83
- if (input.checked) {
84
- this.value.set(`${this.name}${input.name}`, input.value);
85
- }
86
- } else {
87
- this.value.set(`${this.name}${input.name}`, input.value);
88
- }
89
- }
90
- });
91
- this.internals.setFormValue(this.value);
92
- this.logger.logTrace(`Set ${this.name} values to `, this.value);
93
- }
94
-
95
-
96
- handleFormChange = (event) => {
97
- const target = event.target;
98
- if (target.matches('input, select, textarea') && target.name && !target.assignedSlot) {
99
- // if the element is assigned to a slot, it's already visible to the parent. Ignore it.
100
- this.value.set(`${this.name}${target.name}`, target.value);
101
- this.logger.logTrace(`${this.name}${target.name} was set to ${target.value}`);
102
- }
103
- this.internals.setFormValue(this.value);
104
- this.dispatchEvent(new CustomEvent('qbo-form-update', { bubbles: true, composed: true, detail: { formData: this.value } }));
105
- }
106
-
107
- augment = (event) => {
108
- event.stopPropagation();
109
- console.log(event)
110
- if (event instanceof CustomEvent && event.detail.formData instanceof FormData) {
111
- // To replace existing entries instead of appending
112
- for (let [key, value] of event.detail.formData.entries()) {
113
- this.value.set(key, value);
114
- console.log(`Added ${key}=${value} to ${this.name}`);
115
- }
116
- }
117
- this.internals.setFormValue(this.value);
118
- this.dispatchEvent(new CustomEvent('qbo-form-update', { bubbles: true, composed: true, detail: { formData: this.value } }));
119
- }
120
- }
121
-
81
+ } else if (input instanceof HTMLInputElement) {
82
+ if (input.type === 'checkbox' || input.type === 'radio') {
83
+ if (input.checked) {
84
+ this.value.set(`${this.name}${input.name}`, input.value);
85
+ }
86
+ } else {
87
+ this.value.set(`${this.name}${input.name}`, input.value);
88
+ }
89
+ }
90
+ });
91
+ this.internals.setFormValue(this.value);
92
+ this.logger.logTrace(`Set ${this.name} values to `, this.value);
93
+ }
94
+
95
+
96
+ handleFormChange = (event) => {
97
+ const target = event.target;
98
+ if (target.matches('input, select, textarea') && target.name && !target.assignedSlot) {
99
+ // if the element is assigned to a slot, it's already visible to the parent. Ignore it.
100
+ this.value.set(`${this.name}${target.name}`, target.value);
101
+ this.logger.logTrace(`${this.name}${target.name} was set to ${target.value}`);
102
+ }
103
+ this.internals.setFormValue(this.value);
104
+ this.dispatchEvent(new CustomEvent('qbo-form-update', { bubbles: true, composed: true, detail: { formData: this.value } }));
105
+ }
106
+
107
+ augment = (event) => {
108
+ event.stopPropagation();
109
+ console.log(event)
110
+ if (event instanceof CustomEvent && event.detail.formData instanceof FormData) {
111
+ // To replace existing entries instead of appending
112
+ for (let [key, value] of event.detail.formData.entries()) {
113
+ this.value.set(key, value);
114
+ console.log(`Added ${key}=${value} to ${this.name}`);
115
+ }
116
+ }
117
+ this.internals.setFormValue(this.value);
118
+ this.dispatchEvent(new CustomEvent('qbo-form-update', { bubbles: true, composed: true, detail: { formData: this.value } }));
119
+ }
120
+ }
121
+
@@ -11,5 +11,5 @@ export declare class QboLink extends LitElement {
11
11
  [key: string]: any;
12
12
  } | null;
13
13
  connectedCallback(): Promise<void>;
14
- render(): import("lit").TemplateResult<1> | undefined;
14
+ render(): import("lit-html").TemplateResult<1> | undefined;
15
15
  }
@@ -9,5 +9,5 @@ export declare class QboLogging extends LitElement {
9
9
  infoClass: string;
10
10
  firstUpdated(changedProperties: PropertyValues): void;
11
11
  connectedCallback(): Promise<void>;
12
- render(): import("lit").TemplateResult<1>;
12
+ render(): import("lit-html").TemplateResult<1>;
13
13
  }
@@ -31,11 +31,11 @@ export declare class QboMainMenu extends QboFetch {
31
31
  disconnectedCallback(): void;
32
32
  handleResize: () => void;
33
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>;
34
+ renderImage(image: any): import("lit-html").TemplateResult<1>;
35
+ renderMenu(json: any, isDropdown: any, isSubmenu: any): import("lit-html").TemplateResult<1>;
36
+ renderMenuDivider(): import("lit-html").TemplateResult<1>;
37
+ renderMenuDropdown(json: any, isSubmenu: any): import("lit-html").TemplateResult<1>;
38
+ renderMenuDropdownLink(url: any, text: any, icon: any): import("lit-html").TemplateResult<1>;
39
+ renderMenuLink(menu: any): import("lit-html").TemplateResult<1>;
40
+ render(): import("lit-html").TemplateResult<1>;
41
41
  }
@@ -5,5 +5,5 @@ import { LitElement } from 'lit';
5
5
  export declare class QboMarkdown extends LitElement {
6
6
  src: any;
7
7
  connectedCallback(): Promise<void>;
8
- render(): import("lit").TemplateResult<1>;
8
+ render(): import("lit-html").TemplateResult<1>;
9
9
  }
@@ -27,5 +27,5 @@ export declare class QboMicrophone extends LitElement {
27
27
  start(): void;
28
28
  stop(e: any): void;
29
29
  error(e: any): void;
30
- render(): import("lit").TemplateResult<1>;
30
+ render(): import("lit-html").TemplateResult<1>;
31
31
  }
@@ -4,5 +4,5 @@ export declare class QboPopover extends LitElement {
4
4
  renderInHost: boolean;
5
5
  createRenderRoot(): Element | ShadowRoot;
6
6
  updated(changedProperties: PropertyValues): void;
7
- render(): import("lit").TemplateResult<1>;
7
+ render(): import("lit-html").TemplateResult<1>;
8
8
  }
@@ -21,5 +21,5 @@ export declare class QboPopupListener extends LitElement {
21
21
  handleOutsideClick(event: any): void;
22
22
  firstUpdated(): void;
23
23
  showElement(el: any): void;
24
- render(): import("lit").TemplateResult<1>;
24
+ render(): import("lit-html").TemplateResult<1>;
25
25
  }
@@ -15,5 +15,5 @@ export declare class QboPopup extends QboFetch {
15
15
  show(): void;
16
16
  hide(event: any): void;
17
17
  handleOutsideClick(event: any): void;
18
- render(): import("lit").TemplateResult<1>;
18
+ render(): import("lit-html").TemplateResult<1>;
19
19
  }
@@ -18,5 +18,5 @@ export declare class QboSelect extends QboFetch {
18
18
  static styles: import("lit").CSSResult[];
19
19
  connectedCallback(): Promise<void>;
20
20
  createRenderRoot(): Element | ShadowRoot;
21
- render(): import("lit").TemplateResult<1>;
21
+ render(): import("lit-html").TemplateResult<1>;
22
22
  }
@@ -6,5 +6,5 @@ export declare class QboSideBar extends LitElement {
6
6
  menuExpanded: string;
7
7
  menuShow: string;
8
8
  updated(changedProperties: PropertyValues): void;
9
- render(): import("lit").TemplateResult<1>;
9
+ render(): import("lit-html").TemplateResult<1>;
10
10
  }
@@ -16,7 +16,7 @@ export declare class QboTable extends QboFetch {
16
16
  }> | null;
17
17
  connectedCallback(): Promise<void>;
18
18
  createRenderRoot(): Element | ShadowRoot;
19
- render(): import("lit").TemplateResult<1>;
19
+ render(): import("lit-html").TemplateResult<1>;
20
20
  loadData(): Array<{
21
21
  [key: string]: string;
22
22
  }> | null;
@@ -34,5 +34,5 @@ export declare class QboValidate extends LitElement {
34
34
  disconnectedCallback(): Promise<void>;
35
35
  validate: (event: Event) => Promise<void>;
36
36
  validateElement: (source: Event | HTMLElement) => Promise<void>;
37
- render(): import("lit").TemplateResult<1>;
37
+ render(): import("lit-html").TemplateResult<1>;
38
38
  }
@@ -1,37 +1,37 @@
1
- import { InjectionToken } from 'tsyringe';
2
- /**
3
- * Defines a contract for form field validation.
4
- * @remarks
5
- * External classes may define custom validators by implementing this interface.
6
- * Register the custom validator with the tsyringe DI container using {@link ValidateToken}.
7
- */
8
- export interface IValidate {
9
- validate(input: HTMLElement): Promise<boolean>;
10
- message: string;
11
- selector: string;
12
- }
13
- /**
14
- * Define a token for the validators
15
- */
16
- export declare const ValidateToken: InjectionToken<IValidate>;
17
- /**
18
- * A validator for a US zip code.
19
- */
20
- export declare class ZipCodeValidator implements IValidate {
21
- validate(input: HTMLElement): Promise<boolean>;
22
- message: string;
23
- selector: string;
24
- }
25
- /**
26
- * A validator for an email address.
27
- */
28
- export declare class EmailValidator implements IValidate {
29
- validate(input: HTMLElement): Promise<boolean>;
30
- message: string;
31
- selector: string;
32
- }
33
- export declare class ExistsValidator implements IValidate {
34
- validate(input: HTMLElement): Promise<boolean>;
35
- message: string;
36
- selector: string;
37
- }
1
+ import { InjectionToken } from 'tsyringe';
2
+ /**
3
+ * Defines a contract for form field validation.
4
+ * @remarks
5
+ * External classes may define custom validators by implementing this interface.
6
+ * Register the custom validator with the tsyringe DI container using {@link ValidateToken}.
7
+ */
8
+ export interface IValidate {
9
+ validate(input: HTMLElement): Promise<boolean>;
10
+ message: string;
11
+ selector: string;
12
+ }
13
+ /**
14
+ * Define a token for the validators
15
+ */
16
+ export declare const ValidateToken: InjectionToken<IValidate>;
17
+ /**
18
+ * A validator for a US zip code.
19
+ */
20
+ export declare class ZipCodeValidator implements IValidate {
21
+ validate(input: HTMLElement): Promise<boolean>;
22
+ message: string;
23
+ selector: string;
24
+ }
25
+ /**
26
+ * A validator for an email address.
27
+ */
28
+ export declare class EmailValidator implements IValidate {
29
+ validate(input: HTMLElement): Promise<boolean>;
30
+ message: string;
31
+ selector: string;
32
+ }
33
+ export declare class ExistsValidator implements IValidate {
34
+ validate(input: HTMLElement): Promise<boolean>;
35
+ message: string;
36
+ selector: string;
37
+ }
@@ -40,6 +40,6 @@ export declare class QboFlowchart extends LitElement {
40
40
  createTemplate(options: TemplateOptions): dia.Element<dia.Element.Attributes, dia.ModelSetOptions>;
41
41
  createPort(position: String, radius?: Number, tagName?: String, fill?: String, stroke?: String): Object;
42
42
  showLinkTools(linkView: any): void;
43
- render(): import("lit").TemplateResult<1>;
43
+ render(): import("lit-html").TemplateResult<1>;
44
44
  }
45
45
  export {};