@quandis/qbo4.configuration 4.0.1-CI-20241007-232230 → 4.0.1-CI-20241009-155903

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.
@@ -1,20 +1,20 @@
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 { property } from 'lit/decorators.js';
12
- import { JsonConfigurationSource } from './Configuration.js';
13
- export class QboConfigEditor extends LitElement {
14
- static get formAssociated() {
15
- return true;
16
- }
17
- // configSource = new JsonConfigurationSource({});
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 { property } from 'lit/decorators.js';
12
+ import { JsonConfigurationSource } from './Configuration.js';
13
+ export class QboConfigEditor extends LitElement {
14
+ static get formAssociated() {
15
+ return true;
16
+ }
17
+ // configSource = new JsonConfigurationSource({});
18
18
  static { this.styles = css `
19
19
  :host {
20
20
  display: block;
@@ -23,65 +23,65 @@ export class QboConfigEditor extends LitElement {
23
23
  .form-group {
24
24
  margin-bottom: 10px;
25
25
  }
26
- `; }
27
- constructor() {
28
- super();
29
- // @property({ type: Object })
30
- this.configData = {};
31
- // Use attachInternals() to get access to form internals
32
- this._internals = this.attachInternals();
33
- }
34
- _handleInput(e) {
35
- // Update the value on input events
36
- this.value = e.target.value;
37
- this._internals.setFormValue(this.value);
38
- }
39
- async connectedCallback() {
40
- super.connectedCallback();
41
- // check payload
42
- if (this.value) {
43
- this.configData = JSON.parse(this.value);
44
- }
45
- }
46
- handleInputChange(key, event) {
47
- event.preventDefault();
48
- const target = event.target;
49
- this.configData[key] = target.value;
50
- this.requestUpdate();
51
- }
52
- updateConfigData(key, newValue, event, isKey = false) {
53
- event.preventDefault();
54
- if (isKey) {
55
- const oldValue = this.configData[key];
56
- delete this.configData[key];
57
- this.configData[newValue] = oldValue;
58
- }
59
- else {
60
- this.configData[key] = newValue;
61
- }
62
- this.requestUpdate();
63
- }
64
- addKeyValuePair(event) {
65
- event.preventDefault();
66
- const newKey = `newKey${Object.keys(this.configData).length}`;
67
- this.configData[newKey] = 'newValue';
68
- this.requestUpdate();
69
- }
70
- deleteKeyValuePair(key, event) {
71
- event.preventDefault();
72
- delete this.configData[key];
73
- this.requestUpdate();
74
- }
75
- saveChanges(event) {
76
- event.preventDefault();
77
- console.log('Saving changes:', this.configData);
78
- }
79
- cancelChanges(event) {
80
- event.preventDefault();
81
- console.log('Cancelling changes');
82
- }
83
- render() {
84
- const source = new JsonConfigurationSource(this.configData);
26
+ `; }
27
+ constructor() {
28
+ super();
29
+ // @property({ type: Object })
30
+ this.configData = {};
31
+ // Use attachInternals() to get access to form internals
32
+ this._internals = this.attachInternals();
33
+ }
34
+ _handleInput(e) {
35
+ // Update the value on input events
36
+ this.value = e.target.value;
37
+ this._internals.setFormValue(this.value);
38
+ }
39
+ async connectedCallback() {
40
+ super.connectedCallback();
41
+ // check payload
42
+ if (this.value) {
43
+ this.configData = JSON.parse(this.value);
44
+ }
45
+ }
46
+ handleInputChange(key, event) {
47
+ event.preventDefault();
48
+ const target = event.target;
49
+ this.configData[key] = target.value;
50
+ this.requestUpdate();
51
+ }
52
+ updateConfigData(key, newValue, event, isKey = false) {
53
+ event.preventDefault();
54
+ if (isKey) {
55
+ const oldValue = this.configData[key];
56
+ delete this.configData[key];
57
+ this.configData[newValue] = oldValue;
58
+ }
59
+ else {
60
+ this.configData[key] = newValue;
61
+ }
62
+ this.requestUpdate();
63
+ }
64
+ addKeyValuePair(event) {
65
+ event.preventDefault();
66
+ const newKey = `newKey${Object.keys(this.configData).length}`;
67
+ this.configData[newKey] = 'newValue';
68
+ this.requestUpdate();
69
+ }
70
+ deleteKeyValuePair(key, event) {
71
+ event.preventDefault();
72
+ delete this.configData[key];
73
+ this.requestUpdate();
74
+ }
75
+ saveChanges(event) {
76
+ event.preventDefault();
77
+ console.log('Saving changes:', this.configData);
78
+ }
79
+ cancelChanges(event) {
80
+ event.preventDefault();
81
+ console.log('Cancelling changes');
82
+ }
83
+ render() {
84
+ const source = new JsonConfigurationSource(this.configData);
85
85
  return html `<slot></slot>
86
86
  <form>
87
87
  ${Array.from(source.getValues()).map(({ key, value }) => html `
@@ -96,12 +96,12 @@ export class QboConfigEditor extends LitElement {
96
96
  <button class="btn btn-secondary" @click="${this.cancelChanges}">Cancel</button>
97
97
  </div>
98
98
  </form>
99
- `;
100
- }
101
- }
102
- __decorate([
103
- property({ type: String }),
104
- __metadata("design:type", Object)
105
- ], QboConfigEditor.prototype, "value", void 0);
106
- customElements.define('qbo-config-editor', QboConfigEditor);
99
+ `;
100
+ }
101
+ }
102
+ __decorate([
103
+ property({ type: String }),
104
+ __metadata("design:type", Object)
105
+ ], QboConfigEditor.prototype, "value", void 0);
106
+ customElements.define('qbo-config-editor', QboConfigEditor);
107
107
  //# sourceMappingURL=qbo-config-editor.js.map
package/src/qbo-css.d.ts CHANGED
@@ -1,35 +1,35 @@
1
- import { LitElement } from 'lit';
2
- import { EditorView } from "@codemirror/view";
3
- export declare class QboCss extends LitElement {
4
- static styles: import("lit").CSSResult[];
5
- dragging: boolean;
6
- resizing: boolean;
7
- offsetX: number;
8
- offsetY: number;
9
- startWidth: number;
10
- startHeight: number;
11
- editorError: any;
12
- editing: boolean;
13
- storageKey: string;
14
- customcss: string;
15
- editorCoding: boolean;
16
- templateEndpoint: string;
17
- editor: EditorView | null;
18
- styleElement: HTMLElement | null;
19
- connectedCallback(): Promise<void>;
20
- disconnectedCallback(): Promise<void>;
21
- _onMouseDown(event: any): void;
22
- _onResizeMouseDown(event: any): void;
23
- _onMouseMove(event: any): void;
24
- _onMouseUp(): void;
25
- requestEdit(event: any): void;
26
- toggleEdit(editing: boolean): void;
27
- cancel(): void;
28
- firstUpdated(changedProperties: any): void;
29
- updated(changedProperties: any): void;
30
- code(event: Event): Promise<void>;
31
- save(): void;
32
- setCss(content: any): void;
33
- edit(): import("lit-html").TemplateResult<1>;
34
- render(): import("lit-html").TemplateResult<1>;
35
- }
1
+ import { LitElement } from 'lit';
2
+ import { EditorView } from "@codemirror/view";
3
+ export declare class QboCss extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ dragging: boolean;
6
+ resizing: boolean;
7
+ offsetX: number;
8
+ offsetY: number;
9
+ startWidth: number;
10
+ startHeight: number;
11
+ editorError: any;
12
+ editing: boolean;
13
+ storageKey: string;
14
+ customcss: string;
15
+ editorCoding: boolean;
16
+ templateEndpoint: string;
17
+ editor: EditorView | null;
18
+ styleElement: HTMLElement | null;
19
+ connectedCallback(): Promise<void>;
20
+ disconnectedCallback(): Promise<void>;
21
+ _onMouseDown(event: any): void;
22
+ _onResizeMouseDown(event: any): void;
23
+ _onMouseMove(event: any): void;
24
+ _onMouseUp(): void;
25
+ requestEdit(event: any): void;
26
+ toggleEdit(editing: boolean): void;
27
+ cancel(): void;
28
+ firstUpdated(changedProperties: any): void;
29
+ updated(changedProperties: any): void;
30
+ code(event: Event): Promise<void>;
31
+ save(): void;
32
+ setCss(content: any): void;
33
+ edit(): import("lit-html").TemplateResult<1>;
34
+ render(): import("lit-html").TemplateResult<1>;
35
+ }