overview-components 1.1.173 → 1.1.174
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/dist/components/lit-data-grid-tanstack.d.ts +2 -0
- package/dist/components/lit-data-grid-tanstack.d.ts.map +1 -1
- package/dist/components/lit-data-grid-tanstack.js +101 -88
- package/dist/components/lit-data-grid-tanstack.js.map +1 -1
- package/dist/shared/lit-data-grid-density-popover.d.ts +6 -3
- package/dist/shared/lit-data-grid-density-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-density-popover.js +52 -30
- package/dist/shared/lit-data-grid-density-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-export-popover.d.ts +6 -3
- package/dist/shared/lit-data-grid-export-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-export-popover.js +45 -21
- package/dist/shared/lit-data-grid-export-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-operators-popover.d.ts +5 -6
- package/dist/shared/lit-data-grid-operators-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-operators-popover.js +40 -38
- package/dist/shared/lit-data-grid-operators-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-row-actions.d.ts +18 -14
- package/dist/shared/lit-data-grid-row-actions.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-row-actions.js +129 -59
- package/dist/shared/lit-data-grid-row-actions.js.map +1 -1
- package/dist/shared/simple-popper.d.ts +23 -1
- package/dist/shared/simple-popper.d.ts.map +1 -1
- package/dist/shared/simple-popper.js +51 -0
- package/dist/shared/simple-popper.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,19 +5,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, css } from 'lit';
|
|
8
|
-
import { property } from 'lit/decorators.js';
|
|
8
|
+
import { property, query } from 'lit/decorators.js';
|
|
9
9
|
import { msg } from '@lit/localize';
|
|
10
|
-
import './simple-popper.js';
|
|
11
10
|
import './lit-button.js';
|
|
12
11
|
import './lit-responsive-button.js';
|
|
13
12
|
import './lit-menu.js';
|
|
14
13
|
import './lit-menu-item.js';
|
|
14
|
+
import { openSharedPopper, closeSharedPopper, isSharedPopperOpenFor, } from './simple-popper.js';
|
|
15
15
|
export class LitDataGridDensityPopover extends LitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.setDensity = (density) => { };
|
|
19
|
+
this.toggleMenu = () => {
|
|
20
|
+
if (!this.referenceButton)
|
|
21
|
+
return;
|
|
22
|
+
if (isSharedPopperOpenFor(this.referenceButton)) {
|
|
23
|
+
closeSharedPopper(this.referenceButton);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
openSharedPopper({
|
|
27
|
+
target: this.referenceButton,
|
|
28
|
+
placement: 'top-end',
|
|
29
|
+
content: this.menuTemplate(),
|
|
30
|
+
renderOptions: { host: this },
|
|
31
|
+
});
|
|
32
|
+
};
|
|
19
33
|
}
|
|
20
34
|
handleDensity(density) {
|
|
35
|
+
closeSharedPopper(this.referenceButton);
|
|
21
36
|
if (typeof this.setDensity === 'function') {
|
|
22
37
|
this.setDensity(density); // Trigger the provided set function
|
|
23
38
|
}
|
|
@@ -25,6 +40,37 @@ export class LitDataGridDensityPopover extends LitElement {
|
|
|
25
40
|
console.error('setDensity is not a function');
|
|
26
41
|
}
|
|
27
42
|
}
|
|
43
|
+
menuTemplate() {
|
|
44
|
+
return html `<lit-menu>
|
|
45
|
+
<lit-menu-item
|
|
46
|
+
id="${1}"
|
|
47
|
+
icon="rowmall"
|
|
48
|
+
.onClick="${() => this.handleDensity('compact')}"
|
|
49
|
+
.isActive="${this.density === 'compact'}"
|
|
50
|
+
>${msg('Kompaktní')}
|
|
51
|
+
</lit-menu-item>
|
|
52
|
+
<lit-menu-item
|
|
53
|
+
id="${2}"
|
|
54
|
+
icon="rowmedium"
|
|
55
|
+
.onClick="${() => this.handleDensity('standard')}"
|
|
56
|
+
.isActive="${this.density === 'standard'}"
|
|
57
|
+
>${msg('Standardní')}
|
|
58
|
+
</lit-menu-item>
|
|
59
|
+
<lit-menu-item
|
|
60
|
+
id="${3}"
|
|
61
|
+
icon="rowlarge"
|
|
62
|
+
.onClick="${() => this.handleDensity('comfort')}"
|
|
63
|
+
.isActive="${this.density === 'comfort'}"
|
|
64
|
+
>${msg('Komfortní')}
|
|
65
|
+
</lit-menu-item>
|
|
66
|
+
</lit-menu>`;
|
|
67
|
+
}
|
|
68
|
+
disconnectedCallback() {
|
|
69
|
+
super.disconnectedCallback();
|
|
70
|
+
if (this.referenceButton) {
|
|
71
|
+
closeSharedPopper(this.referenceButton);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
28
74
|
render() {
|
|
29
75
|
return html `
|
|
30
76
|
<lit-responsive-button
|
|
@@ -33,39 +79,12 @@ export class LitDataGridDensityPopover extends LitElement {
|
|
|
33
79
|
color="secondary"
|
|
34
80
|
label=${msg('Zobrazení')}
|
|
35
81
|
icon="rowmedium"
|
|
36
|
-
|
|
82
|
+
@click=${this.toggleMenu}
|
|
37
83
|
></lit-responsive-button>
|
|
38
|
-
|
|
39
|
-
<simple-popper placement="top-end">
|
|
40
|
-
<lit-menu>
|
|
41
|
-
<lit-menu-item
|
|
42
|
-
id="${1}"
|
|
43
|
-
icon="rowmall"
|
|
44
|
-
.onClick="${() => this.handleDensity('compact')}"
|
|
45
|
-
.isActive="${this.density === 'compact'}"
|
|
46
|
-
>${msg('Kompaktní')}
|
|
47
|
-
</lit-menu-item>
|
|
48
|
-
<lit-menu-item
|
|
49
|
-
id="${2}"
|
|
50
|
-
icon="rowmedium"
|
|
51
|
-
.onClick="${() => this.handleDensity('standard')}"
|
|
52
|
-
.isActive="${this.density === 'standard'}"
|
|
53
|
-
>${msg('Standardní')}
|
|
54
|
-
</lit-menu-item>
|
|
55
|
-
<lit-menu-item
|
|
56
|
-
id="${3}"
|
|
57
|
-
icon="rowlarge"
|
|
58
|
-
.onClick="${() => this.handleDensity('comfort')}"
|
|
59
|
-
.isActive="${this.density === 'comfort'}"
|
|
60
|
-
>${msg('Komfortní')}
|
|
61
|
-
</lit-menu-item>
|
|
62
|
-
</lit-menu>
|
|
63
|
-
</simple-popper>
|
|
64
84
|
`;
|
|
65
85
|
}
|
|
66
86
|
}
|
|
67
87
|
LitDataGridDensityPopover.styles = [
|
|
68
|
-
// styles,
|
|
69
88
|
css `
|
|
70
89
|
:host {
|
|
71
90
|
font-family: 'Inter', sans-serif;
|
|
@@ -78,6 +97,9 @@ __decorate([
|
|
|
78
97
|
__decorate([
|
|
79
98
|
property({ type: String })
|
|
80
99
|
], LitDataGridDensityPopover.prototype, "density", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
query('lit-responsive-button')
|
|
102
|
+
], LitDataGridDensityPopover.prototype, "referenceButton", void 0);
|
|
81
103
|
if (!window.customElements.get('lit-data-grid-density-popover')) {
|
|
82
104
|
window.customElements.define('lit-data-grid-density-popover', LitDataGridDensityPopover);
|
|
83
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-density-popover.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-density-popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"lit-data-grid-density-popover.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-density-popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,iBAAiB,CAAC;AACzB,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC;AACvB,OAAO,oB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KAAK,UAAU;mBACrC,GAAG,CAAC,YAAY,CAAC;;;sBAGd,CAAC;;4BAEK,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;6BAClC,IAAI,CAAC,OAAO,KAAK,SAAS;mBACpC,GAAG,CAAC,WAAW,CAAC;;oBAEf,CAAC;IACjB,CAAC;IAED,oBAAoB;QAChB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAA;;;;;wBAKK,GAAG,CAAC,WAAW,CAAC;;yBAEf,IAAI,CAAC,UAAU;;SAE/B,CAAC;IACN,CAAC;;AA3EM,gCAAM,GAAG;IACZ,GAAG,CAAA;;;;SAIF;CACJ,AANY,CAMX;AAX4B;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;6DAA0D;AAC3D;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAmB;AAEN;IAAvC,KAAK,CAAC,uBAAuB,CAAC;kEAAuC;AAgF1E,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,+BAA+B,CAAC,EAAE,CAAC;IAC9D,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,+BAA+B,EAAE,yBAAyB,CAAC,CAAC;AAC7F,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import './simple-popper.js';
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
3
2
|
import './lit-button.js';
|
|
4
3
|
import './lit-responsive-button.js';
|
|
5
4
|
import './lit-menu.js';
|
|
@@ -8,8 +7,12 @@ export declare class LitDataGridExportPopover extends LitElement {
|
|
|
8
7
|
exportToExcel: () => void;
|
|
9
8
|
exportToCsv: () => void;
|
|
10
9
|
disabledButtons: boolean;
|
|
10
|
+
private referenceButton?;
|
|
11
11
|
private handleExport;
|
|
12
|
-
|
|
12
|
+
private toggleMenu;
|
|
13
|
+
private menuTemplate;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
render(): TemplateResult<1>;
|
|
13
16
|
}
|
|
14
17
|
declare global {
|
|
15
18
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-export-popover.d.ts","sourceRoot":"","sources":["../../src/shared/lit-data-grid-export-popover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"lit-data-grid-export-popover.d.ts","sourceRoot":"","sources":["../../src/shared/lit-data-grid-export-popover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG5D,OAAO,iBAAiB,CAAC;AACzB,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAO5B,qBAAa,wBAAyB,SAAQ,UAAU;IACtB,aAAa,EAAE,MAAM,IAAI,CAAY;IACrC,WAAW,EAAE,MAAM,IAAI,CAAY;IACpC,eAAe,EAAE,OAAO,CAAS;IAE9B,OAAO,CAAC,eAAe,CAAC,CAAc;IAEtE,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,UAAU,CAYhB;IAEF,OAAO,CAAC,YAAY;IAmBpB,oBAAoB,IAAI,IAAI;IAO5B,MAAM;CAYT;AAMD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,8BAA8B,EAAE,wBAAwB,CAAC;KAC5D;CACJ"}
|
|
@@ -5,23 +5,62 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html } from 'lit';
|
|
8
|
-
import { property } from 'lit/decorators.js';
|
|
8
|
+
import { property, query } from 'lit/decorators.js';
|
|
9
9
|
import { msg } from '@lit/localize';
|
|
10
|
-
import './simple-popper.js';
|
|
11
10
|
import './lit-button.js';
|
|
12
11
|
import './lit-responsive-button.js';
|
|
13
12
|
import './lit-menu.js';
|
|
14
13
|
import './lit-menu-item.js';
|
|
14
|
+
import { openSharedPopper, closeSharedPopper, isSharedPopperOpenFor, } from './simple-popper.js';
|
|
15
15
|
export class LitDataGridExportPopover extends LitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.exportToExcel = () => { };
|
|
19
19
|
this.exportToCsv = () => { };
|
|
20
20
|
this.disabledButtons = false;
|
|
21
|
+
this.toggleMenu = () => {
|
|
22
|
+
if (!this.referenceButton)
|
|
23
|
+
return;
|
|
24
|
+
if (isSharedPopperOpenFor(this.referenceButton)) {
|
|
25
|
+
closeSharedPopper(this.referenceButton);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
openSharedPopper({
|
|
29
|
+
target: this.referenceButton,
|
|
30
|
+
placement: 'top-end',
|
|
31
|
+
content: this.menuTemplate(),
|
|
32
|
+
renderOptions: { host: this },
|
|
33
|
+
});
|
|
34
|
+
};
|
|
21
35
|
}
|
|
22
36
|
handleExport(exportFn) {
|
|
37
|
+
closeSharedPopper(this.referenceButton);
|
|
23
38
|
exportFn(); // Trigger the provided export function
|
|
24
39
|
}
|
|
40
|
+
menuTemplate() {
|
|
41
|
+
return html `<lit-menu>
|
|
42
|
+
<lit-menu-item
|
|
43
|
+
id="${1}"
|
|
44
|
+
icon="csv"
|
|
45
|
+
.onClick=${() => this.handleExport(this.exportToCsv)}
|
|
46
|
+
.disabled=${this.disabledButtons}
|
|
47
|
+
>${msg('Export do CSV')}
|
|
48
|
+
</lit-menu-item>
|
|
49
|
+
<lit-menu-item
|
|
50
|
+
id="${1}"
|
|
51
|
+
icon="csv"
|
|
52
|
+
.onClick=${() => this.handleExport(this.exportToExcel)}
|
|
53
|
+
.disabled=${this.disabledButtons}
|
|
54
|
+
>${msg('Export do Excel')}
|
|
55
|
+
</lit-menu-item>
|
|
56
|
+
</lit-menu>`;
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
super.disconnectedCallback();
|
|
60
|
+
if (this.referenceButton) {
|
|
61
|
+
closeSharedPopper(this.referenceButton);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
25
64
|
render() {
|
|
26
65
|
return html `
|
|
27
66
|
<lit-responsive-button
|
|
@@ -30,26 +69,8 @@ export class LitDataGridExportPopover extends LitElement {
|
|
|
30
69
|
color="secondary"
|
|
31
70
|
label=${msg('Export')}
|
|
32
71
|
icon="csv"
|
|
33
|
-
|
|
72
|
+
@click=${this.toggleMenu}
|
|
34
73
|
></lit-responsive-button>
|
|
35
|
-
<simple-popper placement="top-end">
|
|
36
|
-
<lit-menu>
|
|
37
|
-
<lit-menu-item
|
|
38
|
-
id="${1}"
|
|
39
|
-
icon="csv"
|
|
40
|
-
.onClick=${() => this.handleExport(this.exportToCsv)}
|
|
41
|
-
.disabled=${this.disabledButtons}
|
|
42
|
-
>${msg('Export do CSV')}
|
|
43
|
-
</lit-menu-item>
|
|
44
|
-
<lit-menu-item
|
|
45
|
-
id="${1}"
|
|
46
|
-
icon="csv"
|
|
47
|
-
.onClick=${() => this.handleExport(this.exportToExcel)}
|
|
48
|
-
.disabled=${this.disabledButtons}
|
|
49
|
-
>${msg('Export do Excel')}
|
|
50
|
-
</lit-menu-item>
|
|
51
|
-
</lit-menu>
|
|
52
|
-
</simple-popper>
|
|
53
74
|
`;
|
|
54
75
|
}
|
|
55
76
|
}
|
|
@@ -62,6 +83,9 @@ __decorate([
|
|
|
62
83
|
__decorate([
|
|
63
84
|
property({ type: Boolean })
|
|
64
85
|
], LitDataGridExportPopover.prototype, "disabledButtons", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
query('lit-responsive-button')
|
|
88
|
+
], LitDataGridExportPopover.prototype, "referenceButton", void 0);
|
|
65
89
|
if (!window.customElements.get('lit-data-grid-export-popover')) {
|
|
66
90
|
window.customElements.define('lit-data-grid-export-popover', LitDataGridExportPopover);
|
|
67
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-export-popover.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-export-popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"lit-data-grid-export-popover.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-export-popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,iBAAiB,CAAC;AACzB,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IAAxD;;QACkC,kBAAa,GAAe,GAAG,EAAE,GAAE,CAAC,CAAC;QACrC,gBAAW,GAAe,GAAG,EAAE,GAAE,CAAC,CAAC;QACpC,oBAAe,GAAY,KAAK,CAAC;QAStD,eAAU,GAAG,GAAG,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,eAAe;gBAAE,OAAO;YAClC,IAAI,qBAAqB,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC9C,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBACxC,OAAO;YACX,CAAC;YACD,gBAAgB,CAAC;gBACb,MAAM,EAAE,I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AC;iEAAuC;AA6D1E,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,8BAA8B,CAAC,EAAE,CAAC;IAC7D,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,8BAA8B,EAAE,wBAAwB,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import './simple-popper.js';
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
3
2
|
import './lit-icon-button.js';
|
|
4
3
|
import './lit-menu.js';
|
|
5
4
|
import './lit-menu-item.js';
|
|
@@ -12,13 +11,13 @@ export declare class LitDataGridOperatorsPopover extends LitElement {
|
|
|
12
11
|
operator?: Operator;
|
|
13
12
|
disabled?: boolean;
|
|
14
13
|
filterOperators?: ColumnCustomFilter[];
|
|
15
|
-
private
|
|
14
|
+
private referenceButton?;
|
|
16
15
|
private handleOperator;
|
|
17
|
-
private
|
|
18
|
-
private
|
|
16
|
+
private toggleMenu;
|
|
17
|
+
private menuTemplate;
|
|
19
18
|
disconnectedCallback(): void;
|
|
20
19
|
static styles: import("lit").CSSResult[];
|
|
21
|
-
protected render():
|
|
20
|
+
protected render(): TemplateResult<1>;
|
|
22
21
|
}
|
|
23
22
|
declare global {
|
|
24
23
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-operators-popover.d.ts","sourceRoot":"","sources":["../../src/shared/lit-data-grid-operators-popover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lit-data-grid-operators-popover.d.ts","sourceRoot":"","sources":["../../src/shared/lit-data-grid-operators-popover.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AACjE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAO5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAElF,qBAAa,2BAA4B,SAAQ,UAAU;IACzB,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAoB;IAC/D,IAAI,EAAE,SAAS,CAAY;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAS;IAC7B,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAM;IAE7C,OAAO,CAAC,eAAe,CAAC,CAAc;IAEhE,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,UAAU,CAchB;IAEF,OAAO,CAAC,YAAY;IAepB,oBAAoB,IAAI,IAAI;IAO5B,MAAM,CAAC,MAAM,4BAUX;IAEF,SAAS,CAAC,MAAM;CAYnB;AAMD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iCAAiC,EAAE,2BAA2B,CAAC;KAClE;CACJ"}
|
|
@@ -4,12 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { property,
|
|
7
|
+
import { property, query } from 'lit/decorators.js';
|
|
8
8
|
import { css, html, LitElement } from 'lit';
|
|
9
|
-
import './simple-popper.js';
|
|
10
9
|
import './lit-icon-button.js';
|
|
11
10
|
import './lit-menu.js';
|
|
12
11
|
import './lit-menu-item.js';
|
|
12
|
+
import { openSharedPopper, closeSharedPopper, isSharedPopperOpenFor, renderSharedPopperContent, } from './simple-popper.js';
|
|
13
13
|
export class LitDataGridOperatorsPopover extends LitElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
@@ -17,41 +17,56 @@ export class LitDataGridOperatorsPopover extends LitElement {
|
|
|
17
17
|
this.type = 'string';
|
|
18
18
|
this.disabled = false;
|
|
19
19
|
this.filterOperators = [];
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
this.toggleMenu = async (e) => {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
await this.updateComplete;
|
|
23
|
+
if (!this.referenceButton)
|
|
24
|
+
return;
|
|
25
|
+
if (isSharedPopperOpenFor(this.referenceButton)) {
|
|
26
|
+
closeSharedPopper(this.referenceButton);
|
|
27
|
+
return;
|
|
27
28
|
}
|
|
29
|
+
openSharedPopper({
|
|
30
|
+
target: this.referenceButton,
|
|
31
|
+
placement: 'bottom-end',
|
|
32
|
+
content: this.menuTemplate(),
|
|
33
|
+
renderOptions: { host: this },
|
|
34
|
+
});
|
|
28
35
|
};
|
|
29
36
|
}
|
|
30
37
|
handleOperator(operator) {
|
|
31
38
|
if (typeof this.setOperator === 'function') {
|
|
32
39
|
this.operator = operator;
|
|
33
40
|
this.setOperator(operator);
|
|
41
|
+
// Keep the open menu's active highlight in sync (the menu is rendered
|
|
42
|
+
// imperatively into the shared popper, so it won't re-render on its own).
|
|
43
|
+
if (this.referenceButton) {
|
|
44
|
+
renderSharedPopperContent(this.referenceButton, this.menuTemplate(), {
|
|
45
|
+
host: this,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
34
48
|
}
|
|
35
49
|
else {
|
|
36
50
|
console.error('setOperator is not a function');
|
|
37
51
|
}
|
|
38
52
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
53
|
+
menuTemplate() {
|
|
54
|
+
return html `<lit-menu>
|
|
55
|
+
${this.filterOperators?.map((operator) => html `
|
|
56
|
+
<lit-menu-item
|
|
57
|
+
.onClick="${() => this.handleOperator(operator.value)}"
|
|
58
|
+
.isActive="${this.operator === operator.value}"
|
|
59
|
+
>
|
|
60
|
+
${operator.label}
|
|
61
|
+
</lit-menu-item>
|
|
62
|
+
`)}
|
|
63
|
+
</lit-menu>`;
|
|
51
64
|
}
|
|
52
65
|
disconnectedCallback() {
|
|
53
66
|
super.disconnectedCallback();
|
|
54
|
-
|
|
67
|
+
if (this.referenceButton) {
|
|
68
|
+
closeSharedPopper(this.referenceButton);
|
|
69
|
+
}
|
|
55
70
|
}
|
|
56
71
|
render() {
|
|
57
72
|
return html `
|
|
@@ -60,22 +75,9 @@ export class LitDataGridOperatorsPopover extends LitElement {
|
|
|
60
75
|
size="small"
|
|
61
76
|
variant="text"
|
|
62
77
|
color="secondary"
|
|
63
|
-
|
|
64
|
-
@click=${this.toggleCustomPopover}
|
|
78
|
+
@click=${this.toggleMenu}
|
|
65
79
|
>
|
|
66
80
|
</lit-icon-button>
|
|
67
|
-
<simple-popper placement="bottom-end" manualOpening=${true} .showing=${this.isOpen}>
|
|
68
|
-
<lit-menu>
|
|
69
|
-
${this.filterOperators?.map((operator) => html `
|
|
70
|
-
<lit-menu-item
|
|
71
|
-
.onClick="${() => this.handleOperator(operator.value)}"
|
|
72
|
-
.isActive="${this.operator === operator.value}"
|
|
73
|
-
>
|
|
74
|
-
${operator.label}
|
|
75
|
-
</lit-menu-item>
|
|
76
|
-
`)}
|
|
77
|
-
</lit-menu>
|
|
78
|
-
</simple-popper>
|
|
79
81
|
`;
|
|
80
82
|
}
|
|
81
83
|
}
|
|
@@ -106,8 +108,8 @@ __decorate([
|
|
|
106
108
|
property({ type: Array })
|
|
107
109
|
], LitDataGridOperatorsPopover.prototype, "filterOperators", void 0);
|
|
108
110
|
__decorate([
|
|
109
|
-
|
|
110
|
-
], LitDataGridOperatorsPopover.prototype, "
|
|
111
|
+
query('lit-icon-button')
|
|
112
|
+
], LitDataGridOperatorsPopover.prototype, "referenceButton", void 0);
|
|
111
113
|
if (!window.customElements.get('lit-data-grid-operators-popover')) {
|
|
112
114
|
window.customElements.define('lit-data-grid-operators-popover', LitDataGridOperatorsPopover);
|
|
113
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-operators-popover.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-operators-popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"lit-data-grid-operators-popover.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-operators-popover.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,GAC5B,MAAM,oBAAoB,CAAC;AAK5B,MAAM,OAAO,2BAA4B,SAAQ,UAAU;IAA3D;;QACkC,gBAAW,GAAiC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC;QAC/D,SAAI,GAAc,QAAQ,CAAC;QAE1B,aAAQ,GAAa,KAAK,CAAC;QAC7B,oBAAe,GAA0B,EAAE,CAAC;QAoB/D,eAAU,GAAG,KAAK,EAAE,CAAa,EAAE,EAAE;YACzC,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,cAAc,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,eAAe;gBAAE,OAAO;YAClC,IAAI,qBAAqB,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC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C,CAAC;QAC5C,CAAC;IACL,CAAC;IAcS,MAAM;QACZ,OAAO,IAAI,CAAA;;;;;;yBAMM,IAAI,CAAC,UAAU;;;SAG/B,CAAC;IACN,CAAC;;AAvBM,kCAAM,GAAG;IACZ,GAAG,CAAA;;;;;;;;SAQF;CACJ,AAVY,CAUX;AAxE4B;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;gEAA8D;AAC/D;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAA4B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAqB;AACnB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6DAA4B;AAC7B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oEAA6C;AAErC;IAAjC,KAAK,CAAC,iBAAiB,CAAC;oEAAuC;AAkFpE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,iCAAiC,CAAC,EAAE,CAAC;IAChE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,iCAAiC,EAAE,2BAA2B,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import './lit-icon-button.js';
|
|
3
|
-
import './lit-responsive-button.js';
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
4
2
|
import './lit-menu.js';
|
|
5
3
|
import './lit-menu-item.js';
|
|
6
|
-
import './simple-popper.js';
|
|
7
4
|
export type ActionButton = {
|
|
8
5
|
id: string | number;
|
|
9
6
|
icon: string;
|
|
@@ -16,23 +13,30 @@ export type ActionButton = {
|
|
|
16
13
|
export type LitDataGridRowActionsProps = {
|
|
17
14
|
buttons: ActionButton[];
|
|
18
15
|
};
|
|
16
|
+
type RowActionButton = {
|
|
17
|
+
id: string;
|
|
18
|
+
icon: string;
|
|
19
|
+
label: string;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
showInMenu: boolean;
|
|
23
|
+
marked?: boolean;
|
|
24
|
+
};
|
|
19
25
|
export declare class LitDataGridRowActions extends LitElement {
|
|
20
|
-
buttons:
|
|
21
|
-
id: string;
|
|
22
|
-
icon: string;
|
|
23
|
-
label: string;
|
|
24
|
-
onClick: () => void;
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
showInMenu: boolean;
|
|
27
|
-
marked?: boolean;
|
|
28
|
-
}>;
|
|
26
|
+
buttons: RowActionButton[];
|
|
29
27
|
private menuOpen;
|
|
28
|
+
private kebabButton?;
|
|
29
|
+
static styles: import("lit").CSSResult;
|
|
30
30
|
private handleOnClick;
|
|
31
|
-
|
|
31
|
+
private openMenu;
|
|
32
|
+
private renderMenu;
|
|
33
|
+
disconnectedCallback(): void;
|
|
34
|
+
render(): TemplateResult<1>;
|
|
32
35
|
}
|
|
33
36
|
declare global {
|
|
34
37
|
interface HTMLElementTagNameMap {
|
|
35
38
|
'lit-data-grid-row-actions': LitDataGridRowActions;
|
|
36
39
|
}
|
|
37
40
|
}
|
|
41
|
+
export {};
|
|
38
42
|
//# sourceMappingURL=lit-data-grid-row-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-row-actions.d.ts","sourceRoot":"","sources":["../../src/shared/lit-data-grid-row-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"lit-data-grid-row-actions.d.ts","sourceRoot":"","sources":["../../src/shared/lit-data-grid-row-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1E,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAS5B,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAA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