overview-components 1.1.172 → 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 -1
- package/dist/components/lit-data-grid-tanstack.d.ts.map +1 -1
- package/dist/components/lit-data-grid-tanstack.js +153 -125
- package/dist/components/lit-data-grid-tanstack.js.map +1 -1
- package/dist/shared/icon-svg.d.ts +13 -0
- package/dist/shared/icon-svg.d.ts.map +1 -0
- package/dist/shared/icon-svg.js +77 -0
- package/dist/shared/icon-svg.js.map +1 -0
- 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 +19 -14
- package/dist/shared/lit-data-grid-row-actions.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-row-actions.js +133 -43
- package/dist/shared/lit-data-grid-row-actions.js.map +1 -1
- package/dist/shared/lit-icon-button.d.ts +0 -1
- package/dist/shared/lit-icon-button.d.ts.map +1 -1
- package/dist/shared/lit-icon-button.js +6 -7
- package/dist/shared/lit-icon-button.js.map +1 -1
- package/dist/shared/lit-menu-item.d.ts +0 -1
- package/dist/shared/lit-menu-item.d.ts.map +1 -1
- package/dist/shared/lit-menu-item.js +5 -6
- package/dist/shared/lit-menu-item.js.map +1 -1
- package/dist/shared/lit-overflow-tooltip.d.ts.map +1 -1
- package/dist/shared/lit-overflow-tooltip.js +1 -6
- package/dist/shared/lit-overflow-tooltip.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/dist/shared/simple-tooltip.d.ts +2 -0
- package/dist/shared/simple-tooltip.d.ts.map +1 -1
- package/dist/shared/simple-tooltip.js +106 -5
- package/dist/shared/simple-tooltip.js.map +1 -1
- package/package.json +1 -1
|
@@ -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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AC;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,QAAQ,CAAC;;yBAEZ,IAAI,CAAC,UAAU;;SAE/B,CAAC;IACN,CAAC;CACJ;AA/DiC;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;+DAAsC;AACrC;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;6DAAoC;AACpC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iEAAkC;AAEtB;IAAvC,KAAK,CAAC,uBAAuB,CAAC;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,EAC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M,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,22 +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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
onClick: () => void;
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
showInMenu: boolean;
|
|
27
|
-
marked?: boolean;
|
|
28
|
-
}>;
|
|
26
|
+
buttons: RowActionButton[];
|
|
27
|
+
private menuOpen;
|
|
28
|
+
private kebabButton?;
|
|
29
|
+
static styles: import("lit").CSSResult;
|
|
29
30
|
private handleOnClick;
|
|
30
|
-
|
|
31
|
+
private openMenu;
|
|
32
|
+
private renderMenu;
|
|
33
|
+
disconnectedCallback(): void;
|
|
34
|
+
render(): TemplateResult<1>;
|
|
31
35
|
}
|
|
32
36
|
declare global {
|
|
33
37
|
interface HTMLElementTagNameMap {
|
|
34
38
|
'lit-data-grid-row-actions': LitDataGridRowActions;
|
|
35
39
|
}
|
|
36
40
|
}
|
|
41
|
+
export {};
|
|
37
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,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAOF,qBAAa,qBAAsB,SAAQ,UAAU;IACtB,OAAO,EAAE,eAAe,EAAE,CAAM;IAKlD,OAAO,CAAC,QAAQ,CAAS;IAEjB,OAAO,CAAC,WAAW,CAAC,CAAoB;IAEzD,MAAM,CAAC,MAAM,0BAuCX;IAEF,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,QAAQ,CAmBd;IAEF,OAAO,CAAC,UAAU;IAoBlB,oBAAoB,IAAI,IAAI;IAS5B,MAAM;CA2CT;AAMD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,2BAA2B,EAAE,qBAAqB,CAAC;KACtD;CACJ"}
|
|
@@ -4,83 +4,173 @@ 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 { LitElement, html } from 'lit';
|
|
8
|
-
import { property } from 'lit/decorators.js';
|
|
9
|
-
import '
|
|
10
|
-
import './lit-responsive-button.js';
|
|
7
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
8
|
+
import { property, state, query } from 'lit/decorators.js';
|
|
9
|
+
import { msg } from '@lit/localize';
|
|
11
10
|
import './lit-menu.js';
|
|
12
11
|
import './lit-menu-item.js';
|
|
13
12
|
import { tooltip } from './simple-tooltip.js';
|
|
14
|
-
import './
|
|
13
|
+
import { renderIcon } from './icon-svg.js';
|
|
14
|
+
import { openSharedPopper, closeSharedPopper, isSharedPopperOpenFor, } from './simple-popper.js';
|
|
15
|
+
// The row "kebab" menu opens into the shared singleton popper (see
|
|
16
|
+
// openSharedPopper in simple-popper.ts), which lives at document.body. No
|
|
17
|
+
// <simple-popper> is rendered per row, so a closed grid carries zero popper /
|
|
18
|
+
// menu custom elements — previously each row held one even while closed, which
|
|
19
|
+
// dominated synchronous teardown cost on route switch.
|
|
15
20
|
export class LitDataGridRowActions extends LitElement {
|
|
16
21
|
constructor() {
|
|
17
22
|
super(...arguments);
|
|
18
23
|
this.buttons = [];
|
|
24
|
+
// Drives aria-expanded on the kebab button only; the menu content is rendered
|
|
25
|
+
// into the shared body-level popper, not into this component's tree, so a
|
|
26
|
+
// closed grid carries zero menu custom elements.
|
|
27
|
+
this.menuOpen = false;
|
|
28
|
+
this.openMenu = () => {
|
|
29
|
+
if (!this.kebabButton)
|
|
30
|
+
return;
|
|
31
|
+
// Toggle: clicking the kebab while its menu is open closes it.
|
|
32
|
+
if (isSharedPopperOpenFor(this.kebabButton)) {
|
|
33
|
+
closeSharedPopper(this.kebabButton);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const showInMenuButtons = this.buttons.filter((button) => button.showInMenu);
|
|
37
|
+
openSharedPopper({
|
|
38
|
+
target: this.kebabButton,
|
|
39
|
+
placement: 'bottom-end',
|
|
40
|
+
offset: 0,
|
|
41
|
+
content: this.renderMenu(showInMenuButtons),
|
|
42
|
+
onClose: () => {
|
|
43
|
+
this.menuOpen = false;
|
|
44
|
+
},
|
|
45
|
+
renderOptions: { host: this },
|
|
46
|
+
});
|
|
47
|
+
this.menuOpen = true;
|
|
48
|
+
};
|
|
19
49
|
}
|
|
20
50
|
handleOnClick(e, onClick) {
|
|
21
51
|
e.stopPropagation(); // Prevent event bubbling
|
|
22
52
|
e.preventDefault(); // Prevent default action
|
|
23
|
-
onClick(); // Trigger the provided
|
|
53
|
+
onClick(); // Trigger the provided action
|
|
54
|
+
// The shared popper opens in manualOpening mode, which suppresses its
|
|
55
|
+
// own slot-click auto-close, so close it explicitly after a menu pick.
|
|
56
|
+
closeSharedPopper(this.kebabButton);
|
|
57
|
+
}
|
|
58
|
+
renderMenu(showInMenuButtons) {
|
|
59
|
+
return html `<lit-menu>
|
|
60
|
+
${showInMenuButtons.map((button) => html `
|
|
61
|
+
<lit-menu-item
|
|
62
|
+
id="${button.id}"
|
|
63
|
+
icon="${button.icon}"
|
|
64
|
+
.onClick="${(e) => this.handleOnClick(e, button.onClick)}"
|
|
65
|
+
.disabled="${button.disabled}"
|
|
66
|
+
@touchend=${(e) => {
|
|
67
|
+
this.handleOnClick(e, button.onClick);
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
${button.label}
|
|
71
|
+
</lit-menu-item>
|
|
72
|
+
`)}
|
|
73
|
+
</lit-menu>`;
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
super.disconnectedCallback();
|
|
77
|
+
// If this row's menu is the one currently open, close it so a removed row
|
|
78
|
+
// never leaves a dangling menu pointing at dead DOM.
|
|
79
|
+
if (this.kebabButton) {
|
|
80
|
+
closeSharedPopper(this.kebabButton);
|
|
81
|
+
}
|
|
24
82
|
}
|
|
25
83
|
render() {
|
|
26
84
|
const visibleButtons = this.buttons.filter((button) => !button.showInMenu);
|
|
27
85
|
const showInMenuButtons = this.buttons.filter((button) => button.showInMenu);
|
|
28
86
|
return html `
|
|
29
|
-
<div
|
|
30
|
-
style="display: flex; height: 100%; align-items: center; justify-content: flex-end;"
|
|
31
|
-
>
|
|
87
|
+
<div class="actions">
|
|
32
88
|
${visibleButtons.map((button) => html `
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.icon="${button.icon}"
|
|
89
|
+
<button
|
|
90
|
+
class="icon-button"
|
|
91
|
+
aria-label=${button.label}
|
|
92
|
+
?disabled=${button.disabled}
|
|
38
93
|
@click="${(e) => this.handleOnClick(e, button.onClick)}"
|
|
39
94
|
@touchend=${(e) => {
|
|
40
95
|
this.handleOnClick(e, button.onClick);
|
|
41
96
|
}}
|
|
42
|
-
.disabled="${button.disabled}"
|
|
43
|
-
.marked="${button.marked}"
|
|
44
97
|
${tooltip(button.label, 'left')}
|
|
45
|
-
|
|
98
|
+
>
|
|
99
|
+
${renderIcon(button.icon, {
|
|
100
|
+
size: '1rem',
|
|
101
|
+
isActive: !!button.marked,
|
|
102
|
+
})}
|
|
103
|
+
</button>
|
|
46
104
|
`)}
|
|
47
105
|
${showInMenuButtons.length > 0
|
|
48
|
-
? html
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
106
|
+
? html `<button
|
|
107
|
+
class="icon-button kebab"
|
|
108
|
+
aria-label=${msg('Další možnosti')}
|
|
109
|
+
aria-haspopup="menu"
|
|
110
|
+
aria-expanded=${this.menuOpen ? 'true' : 'false'}
|
|
111
|
+
@click=${this.openMenu}
|
|
112
|
+
@touchend=${(e) => {
|
|
55
113
|
e.stopPropagation();
|
|
56
114
|
e.preventDefault();
|
|
115
|
+
this.openMenu();
|
|
57
116
|
}}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<lit-menu-item
|
|
63
|
-
id="${button.id}"
|
|
64
|
-
icon="${button.icon}"
|
|
65
|
-
.onClick="${(e) => this.handleOnClick(e, button.onClick)}"
|
|
66
|
-
.disabled="${button.disabled}"
|
|
67
|
-
@touchend=${(e) => {
|
|
68
|
-
this.handleOnClick(e, button.onClick);
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
${button.label}
|
|
72
|
-
</lit-menu-item>
|
|
73
|
-
`)}
|
|
74
|
-
</lit-menu>
|
|
75
|
-
</simple-popper>`
|
|
76
|
-
: null}
|
|
117
|
+
>
|
|
118
|
+
${renderIcon('morevertical', { size: '1rem' })}
|
|
119
|
+
</button>`
|
|
120
|
+
: nothing}
|
|
77
121
|
</div>
|
|
78
122
|
`;
|
|
79
123
|
}
|
|
80
124
|
}
|
|
125
|
+
LitDataGridRowActions.styles = css `
|
|
126
|
+
.actions {
|
|
127
|
+
display: flex;
|
|
128
|
+
height: 100%;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: flex-end;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Native light-DOM replacement for <lit-icon-button variant="text"
|
|
134
|
+
color="secondary" size="small"> — no custom element, no shadow root. */
|
|
135
|
+
.icon-button {
|
|
136
|
+
width: 20px;
|
|
137
|
+
height: 20px;
|
|
138
|
+
padding: 0;
|
|
139
|
+
margin: 0;
|
|
140
|
+
border: none;
|
|
141
|
+
background: transparent;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
border-radius: var(--border-radius-small, 0.5rem);
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
color: var(--color-secondary-main, #6b7280);
|
|
148
|
+
transition:
|
|
149
|
+
background-color 0.3s,
|
|
150
|
+
color 0.3s;
|
|
151
|
+
}
|
|
152
|
+
.icon-button:not(:disabled):hover {
|
|
153
|
+
background-color: var(--color-primary-light, #f3f4f6);
|
|
154
|
+
}
|
|
155
|
+
.icon-button:disabled {
|
|
156
|
+
color: var(--color-primary-disabled, #d0d3db);
|
|
157
|
+
background: transparent;
|
|
158
|
+
cursor: not-allowed;
|
|
159
|
+
}
|
|
160
|
+
.icon-button:focus-visible {
|
|
161
|
+
outline: 2px solid var(--color-secondary-main, #6b7280);
|
|
162
|
+
outline-offset: 1px;
|
|
163
|
+
}
|
|
164
|
+
`;
|
|
81
165
|
__decorate([
|
|
82
166
|
property({ type: Array })
|
|
83
167
|
], LitDataGridRowActions.prototype, "buttons", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
state()
|
|
170
|
+
], LitDataGridRowActions.prototype, "menuOpen", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
query('.kebab')
|
|
173
|
+
], LitDataGridRowActions.prototype, "kebabButton", void 0);
|
|
84
174
|
if (!window.customElements.get('lit-data-grid-row-actions')) {
|
|
85
175
|
window.customElements.define('lit-data-grid-row-actions', LitDataGridRowActions);
|
|
86
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-row-actions.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-row-actions.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"lit-data-grid-row-actions.js","sourceRoot":"","sources":["../../src/shared/lit-data-grid-row-actions.ts"],"names":[],"mappings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CAAC;IACN,CAAC;;AA9IM,4BAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuClB,AAvCY,CAuCX;AAhDyB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;sDAAiC;AAK1C;IAAhB,KAAK,EAAE;uDAA0B;AAET;IAAxB,KAAK,CAAC,QAAQ,CAAC;0DAAyC;AAmJ7D,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAAE,CAAC;IAC1D,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,qBAAqB,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-icon-button.d.ts","sourceRoot":"","sources":["../../src/shared/lit-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"lit-icon-button.d.ts","sourceRoot":"","sources":["../../src/shared/lit-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM1C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;AAYnF,qBAAa,UAAW,SAAQ,UAAU;IAEV,OAAO,CAAC,EAAE,iBAAiB,CAAe;IAC1C,KAAK,CAAC,EAAE,eAAe,CAAa;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAS;IACZ,MAAM,CAAC,EAAE,OAAO,CAAS;IACzC,IAAI,CAAC,EAAE,IAAI,CAAS;IACnB,MAAM,CAAC,EAAE,OAAO,CAAS;IACzB,OAAO,CAAC,EAAE,OAAO,CAAS;IAGvD,MAAM,CAAC,MAAM,4BAmFX;IAGF,MAAM;CA0BT;AAMD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,UAAU,CAAC;KACjC;CACJ"}
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, css } from 'lit';
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
|
-
import './
|
|
9
|
+
import { renderIcon } from './icon-svg.js';
|
|
10
10
|
// styles
|
|
11
11
|
import buttonStyles from './styles/button-shared-styles.js';
|
|
12
12
|
export class IconButton extends LitElement {
|
|
@@ -39,12 +39,11 @@ export class IconButton extends LitElement {
|
|
|
39
39
|
: ''}
|
|
40
40
|
<slot name="icon"
|
|
41
41
|
>${this.icon &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
></lit-icon>`}</slot
|
|
42
|
+
renderIcon(this.icon, {
|
|
43
|
+
isActive: !!this.marked,
|
|
44
|
+
size: iconSize,
|
|
45
|
+
class: `out-ai ${this.loading ? 'icon-hidden' : ''}`,
|
|
46
|
+
})}</slot
|
|
48
47
|
>
|
|
49
48
|
</button>
|
|
50
49
|
`;
|