@3mo/data-grid 0.2.3 → 0.2.5
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/CsvGenerator.js +2 -2
- package/dist/DataGrid.js +292 -292
- package/dist/DataGridCell.js +40 -40
- package/dist/DataGridFooter.js +78 -78
- package/dist/DataGridHeader.js +76 -76
- package/dist/DataGridHeaderSeparator.js +42 -42
- package/dist/DataGridPrimaryContextMenuItem.js +5 -5
- package/dist/DataGridSidePanel.js +98 -98
- package/dist/FieldSelectDataGridPageSize.js +7 -7
- package/dist/columns/DataGridColumnBoolean.js +9 -9
- package/dist/columns/DataGridColumnCurrency.js +8 -8
- package/dist/columns/DataGridColumnDate.js +7 -7
- package/dist/columns/DataGridColumnDeletion.d.ts +23 -0
- package/dist/columns/DataGridColumnDeletion.d.ts.map +1 -0
- package/dist/columns/{DataGridColumnDelete.js → DataGridColumnDeletion.js} +12 -9
- package/dist/columns/DataGridColumnImage.js +2 -2
- package/dist/columns/DataGridColumnNumber.js +5 -5
- package/dist/columns/DataGridColumnPercent.js +6 -6
- package/dist/columns/DataGridColumnText.js +5 -5
- package/dist/columns/DataGridFooterSum.js +20 -20
- package/dist/columns/index.d.ts +1 -1
- package/dist/columns/index.d.ts.map +1 -1
- package/dist/columns/index.js +1 -1
- package/dist/rows/DataGridDefaultRow.js +47 -47
- package/dist/rows/DataGridRow.js +133 -133
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +53 -53
- package/dist/columns/DataGridColumnDelete.d.ts +0 -20
- package/dist/columns/DataGridColumnDelete.d.ts.map +0 -1
|
@@ -24,117 +24,117 @@ let DataGridSidePanel = class DataGridSidePanel extends Component {
|
|
|
24
24
|
this.dataGrid.requestUpdate();
|
|
25
25
|
await this.dataGrid.updateComplete;
|
|
26
26
|
};
|
|
27
|
-
return html `
|
|
28
|
-
<mo-checkbox ${style({ height: '30px' })}
|
|
29
|
-
label=${column.heading}
|
|
30
|
-
?checked=${column.hidden === false}
|
|
31
|
-
@change=${change}
|
|
32
|
-
></mo-checkbox>
|
|
27
|
+
return html `
|
|
28
|
+
<mo-checkbox ${style({ height: '30px' })}
|
|
29
|
+
label=${column.heading}
|
|
30
|
+
?checked=${column.hidden === false}
|
|
31
|
+
@change=${change}
|
|
32
|
+
></mo-checkbox>
|
|
33
33
|
`;
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
static get styles() {
|
|
37
|
-
return css `
|
|
38
|
-
:host {
|
|
39
|
-
display: inline-block !important;
|
|
40
|
-
transition: 250ms;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
transform-origin: right center;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:host(:not([hidden])) {
|
|
47
|
-
border-inline-start: var(--mo-data-grid-border);
|
|
48
|
-
background: var(--mo-color-transparent-gray-1);
|
|
49
|
-
opacity: 1;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
:host([hidden]) {
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transform: scale(0, 1);
|
|
55
|
-
width: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#flexHeading {
|
|
59
|
-
border-top: var(--mo-data-grid-border);
|
|
60
|
-
border-bottom: var(--mo-data-grid-border);
|
|
61
|
-
height: var(--mo-data-grid-header-height);
|
|
62
|
-
padding-inline-start: 14px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
mo-scroller {
|
|
66
|
-
width: calc(100% - calc(2 * 14px));
|
|
67
|
-
padding: 0 14px;
|
|
68
|
-
margin-top: 14px;
|
|
69
|
-
overflow-x: hidden;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
mo-scroller::part(container) {
|
|
73
|
-
width: calc(100% - calc(2 * 14px));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
mo-section mo-checkbox {
|
|
77
|
-
margin-inline-start: -6px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
mo-section mo-icon-button {
|
|
81
|
-
margin-inline-start: -10px;
|
|
82
|
-
}
|
|
37
|
+
return css `
|
|
38
|
+
:host {
|
|
39
|
+
display: inline-block !important;
|
|
40
|
+
transition: 250ms;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
transform-origin: right center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host(:not([hidden])) {
|
|
47
|
+
border-inline-start: var(--mo-data-grid-border);
|
|
48
|
+
background: var(--mo-color-transparent-gray-1);
|
|
49
|
+
opacity: 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([hidden]) {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transform: scale(0, 1);
|
|
55
|
+
width: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#flexHeading {
|
|
59
|
+
border-top: var(--mo-data-grid-border);
|
|
60
|
+
border-bottom: var(--mo-data-grid-border);
|
|
61
|
+
height: var(--mo-data-grid-header-height);
|
|
62
|
+
padding-inline-start: 14px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
mo-scroller {
|
|
66
|
+
width: calc(100% - calc(2 * 14px));
|
|
67
|
+
padding: 0 14px;
|
|
68
|
+
margin-top: 14px;
|
|
69
|
+
overflow-x: hidden;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
mo-scroller::part(container) {
|
|
73
|
+
width: calc(100% - calc(2 * 14px));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
mo-section mo-checkbox {
|
|
77
|
+
margin-inline-start: -6px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
mo-section mo-icon-button {
|
|
81
|
+
margin-inline-start: -10px;
|
|
82
|
+
}
|
|
83
83
|
`;
|
|
84
84
|
}
|
|
85
85
|
get template() {
|
|
86
|
-
return html `
|
|
87
|
-
<mo-flex ${style({ height: '100%' })}>
|
|
88
|
-
${this.dataGrid.hasToolbar || this.dataGrid.hasFilters === false ? nothing : html `
|
|
89
|
-
<mo-tab-bar
|
|
90
|
-
value=${ifDefined(this.dataGrid.sidePanelTab)}
|
|
91
|
-
@change=${(e) => { var _a; return this.dataGrid.navigateToSidePanelTab((_a = e.detail) !== null && _a !== void 0 ? _a : "settings" /* DataGridSidePanelTab.Settings */); }}
|
|
92
|
-
>
|
|
93
|
-
<mo-tab icon='filter_list' value=${"filters" /* DataGridSidePanelTab.Filters */}></mo-tab>
|
|
94
|
-
<mo-tab icon='settings' value=${"settings" /* DataGridSidePanelTab.Settings */}></mo-tab>
|
|
95
|
-
</mo-tab-bar>
|
|
96
|
-
`}
|
|
97
|
-
|
|
98
|
-
${this.dataGrid.hasToolbar === false && this.dataGrid.hasFilters === true ? nothing : html `
|
|
99
|
-
<mo-flex id='flexHeading' direction='horizontal' alignItems='center'>
|
|
100
|
-
<mo-heading typography='heading6' ${style({ width: '*', color: 'var(--mo-color-on-surface)' })}>${t(this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? 'Extended Filters' : 'Settings')}</mo-heading>
|
|
101
|
-
<mo-icon-button icon='close' dense
|
|
102
|
-
${tooltip(t('Close'))}
|
|
103
|
-
${style({ cursor: 'pointer', color: 'var(--mo-color-gray)' })}
|
|
104
|
-
@click=${() => this.dataGrid.navigateToSidePanelTab(undefined)}
|
|
105
|
-
></mo-icon-button>
|
|
106
|
-
</mo-flex>
|
|
107
|
-
`}
|
|
108
|
-
|
|
109
|
-
<mo-scroller ${style({ height: '*' })}>
|
|
110
|
-
${this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? this.filtersTemplate : this.settingsTemplate}
|
|
111
|
-
</mo-scroller>
|
|
112
|
-
</mo-flex>
|
|
86
|
+
return html `
|
|
87
|
+
<mo-flex ${style({ height: '100%' })}>
|
|
88
|
+
${this.dataGrid.hasToolbar || this.dataGrid.hasFilters === false ? nothing : html `
|
|
89
|
+
<mo-tab-bar
|
|
90
|
+
value=${ifDefined(this.dataGrid.sidePanelTab)}
|
|
91
|
+
@change=${(e) => { var _a; return this.dataGrid.navigateToSidePanelTab((_a = e.detail) !== null && _a !== void 0 ? _a : "settings" /* DataGridSidePanelTab.Settings */); }}
|
|
92
|
+
>
|
|
93
|
+
<mo-tab icon='filter_list' value=${"filters" /* DataGridSidePanelTab.Filters */}></mo-tab>
|
|
94
|
+
<mo-tab icon='settings' value=${"settings" /* DataGridSidePanelTab.Settings */}></mo-tab>
|
|
95
|
+
</mo-tab-bar>
|
|
96
|
+
`}
|
|
97
|
+
|
|
98
|
+
${this.dataGrid.hasToolbar === false && this.dataGrid.hasFilters === true ? nothing : html `
|
|
99
|
+
<mo-flex id='flexHeading' direction='horizontal' alignItems='center'>
|
|
100
|
+
<mo-heading typography='heading6' ${style({ width: '*', color: 'var(--mo-color-on-surface)' })}>${t(this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? 'Extended Filters' : 'Settings')}</mo-heading>
|
|
101
|
+
<mo-icon-button icon='close' dense
|
|
102
|
+
${tooltip(t('Close'))}
|
|
103
|
+
${style({ cursor: 'pointer', color: 'var(--mo-color-gray)' })}
|
|
104
|
+
@click=${() => this.dataGrid.navigateToSidePanelTab(undefined)}
|
|
105
|
+
></mo-icon-button>
|
|
106
|
+
</mo-flex>
|
|
107
|
+
`}
|
|
108
|
+
|
|
109
|
+
<mo-scroller ${style({ height: '*' })}>
|
|
110
|
+
${this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? this.filtersTemplate : this.settingsTemplate}
|
|
111
|
+
</mo-scroller>
|
|
112
|
+
</mo-flex>
|
|
113
113
|
`;
|
|
114
114
|
}
|
|
115
115
|
get filtersTemplate() {
|
|
116
|
-
return html `
|
|
117
|
-
<mo-flex gap='14px'>
|
|
118
|
-
<slot name='filter'></slot>
|
|
119
|
-
</mo-flex>
|
|
116
|
+
return html `
|
|
117
|
+
<mo-flex gap='14px'>
|
|
118
|
+
<slot name='filter'></slot>
|
|
119
|
+
</mo-flex>
|
|
120
120
|
`;
|
|
121
121
|
}
|
|
122
122
|
get settingsTemplate() {
|
|
123
|
-
return html `
|
|
124
|
-
<mo-flex gap='14px'>
|
|
125
|
-
<slot name='settings'></slot>
|
|
126
|
-
|
|
127
|
-
<mo-section heading=${t('Columns')}>
|
|
128
|
-
${this.dataGrid.columns.map(this.getColumnTemplate)}
|
|
129
|
-
</mo-section>
|
|
130
|
-
|
|
131
|
-
<mo-section heading='Tools'>
|
|
132
|
-
<mo-icon-button icon='file_download'
|
|
133
|
-
${tooltip('Export as Excel file')}
|
|
134
|
-
@click=${() => this.dataGrid.exportExcelFile()}
|
|
135
|
-
></mo-icon-button>
|
|
136
|
-
</mo-section>
|
|
137
|
-
</mo-flex>
|
|
123
|
+
return html `
|
|
124
|
+
<mo-flex gap='14px'>
|
|
125
|
+
<slot name='settings'></slot>
|
|
126
|
+
|
|
127
|
+
<mo-section heading=${t('Columns')}>
|
|
128
|
+
${this.dataGrid.columns.map(this.getColumnTemplate)}
|
|
129
|
+
</mo-section>
|
|
130
|
+
|
|
131
|
+
<mo-section heading='Tools'>
|
|
132
|
+
<mo-icon-button icon='file_download'
|
|
133
|
+
${tooltip('Export as Excel file')}
|
|
134
|
+
@click=${() => this.dataGrid.exportExcelFile()}
|
|
135
|
+
></mo-icon-button>
|
|
136
|
+
</mo-section>
|
|
137
|
+
</mo-flex>
|
|
138
138
|
`;
|
|
139
139
|
}
|
|
140
140
|
};
|
|
@@ -4,13 +4,13 @@ import { component, html, property, nothing } from '@a11d/lit';
|
|
|
4
4
|
import { FieldSelect } from '@3mo/select-field';
|
|
5
5
|
let FieldSelectDataGridPageSize = FieldSelectDataGridPageSize_1 = class FieldSelectDataGridPageSize extends FieldSelect {
|
|
6
6
|
get optionsTemplate() {
|
|
7
|
-
return html `
|
|
8
|
-
${!this.dataGrid || !this.dataGrid.supportsDynamicPageSize ? nothing : html `
|
|
9
|
-
<mo-option value='auto'>Auto</mo-option>
|
|
10
|
-
`}
|
|
11
|
-
${FieldSelectDataGridPageSize_1.data.map(size => html `
|
|
12
|
-
<mo-option value=${size}>${size.format()}</mo-option>
|
|
13
|
-
`)}
|
|
7
|
+
return html `
|
|
8
|
+
${!this.dataGrid || !this.dataGrid.supportsDynamicPageSize ? nothing : html `
|
|
9
|
+
<mo-option value='auto'>Auto</mo-option>
|
|
10
|
+
`}
|
|
11
|
+
${FieldSelectDataGridPageSize_1.data.map(size => html `
|
|
12
|
+
<mo-option value=${size}>${size.format()}</mo-option>
|
|
13
|
+
`)}
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
@@ -19,18 +19,18 @@ let DataGridColumnBoolean = class DataGridColumnBoolean extends DataGridColumn {
|
|
|
19
19
|
}
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
21
|
getContentTemplate(value, _data) {
|
|
22
|
-
return html `
|
|
23
|
-
<mo-flex justifyContent='center' ${style({ height: '100%' })}>
|
|
24
|
-
<mo-icon icon=${value ? this.trueIcon : this.falseIcon} ${style({ color: value ? this.trueIconColor : this.falseIconColor })}></mo-icon>
|
|
25
|
-
</mo-flex>
|
|
22
|
+
return html `
|
|
23
|
+
<mo-flex justifyContent='center' ${style({ height: '100%' })}>
|
|
24
|
+
<mo-icon icon=${value ? this.trueIcon : this.falseIcon} ${style({ color: value ? this.trueIconColor : this.falseIconColor })}></mo-icon>
|
|
25
|
+
</mo-flex>
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
28
|
getEditContentTemplate(value, data) {
|
|
29
|
-
return html `
|
|
30
|
-
<mo-checkbox label=${this.heading} data-focus
|
|
31
|
-
?checked=${value}
|
|
32
|
-
@change=${(e) => this.handleEdit(e.detail === 'checked', data)}
|
|
33
|
-
></mo-checkbox>
|
|
29
|
+
return html `
|
|
30
|
+
<mo-checkbox label=${this.heading} data-focus
|
|
31
|
+
?checked=${value}
|
|
32
|
+
@change=${(e) => this.handleEdit(e.detail === 'checked', data)}
|
|
33
|
+
></mo-checkbox>
|
|
34
34
|
`;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
@@ -13,17 +13,17 @@ let DataGridColumnCurrency = class DataGridColumnCurrency extends DataGridColumn
|
|
|
13
13
|
return html `${(value !== null && value !== void 0 ? value : 0).formatAsCurrency(this.currency)}`;
|
|
14
14
|
}
|
|
15
15
|
getEditContentTemplate(value, data) {
|
|
16
|
-
return html `
|
|
17
|
-
<mo-field-currency dense data-focus
|
|
18
|
-
label=${this.heading}
|
|
19
|
-
value=${ifDefined(value)}
|
|
20
|
-
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
21
|
-
></mo-field-currency>
|
|
16
|
+
return html `
|
|
17
|
+
<mo-field-currency dense data-focus
|
|
18
|
+
label=${this.heading}
|
|
19
|
+
value=${ifDefined(value)}
|
|
20
|
+
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
21
|
+
></mo-field-currency>
|
|
22
22
|
`;
|
|
23
23
|
}
|
|
24
24
|
getSumTemplate(sum) {
|
|
25
|
-
return html `
|
|
26
|
-
<span ${style({ fontWeight: '500', color: 'var(--mo-color-accent)' })}>${sum.formatAsCurrency(this.currency)}</span>
|
|
25
|
+
return html `
|
|
26
|
+
<span ${style({ fontWeight: '500', color: 'var(--mo-color-accent)' })}>${sum.formatAsCurrency(this.currency)}</span>
|
|
27
27
|
`;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
@@ -16,13 +16,13 @@ let DataGridColumnDate = class DataGridColumnDate extends DataGridColumn {
|
|
|
16
16
|
return html `${value ? (_a = value.formatAsDate()) !== null && _a !== void 0 ? _a : '' : ''}`;
|
|
17
17
|
}
|
|
18
18
|
getEditContentTemplate(value, data) {
|
|
19
|
-
return html `
|
|
20
|
-
<mo-field-date dense data-focus
|
|
21
|
-
?hideDatePicker=${this.hideDatePicker}
|
|
22
|
-
label=${this.heading}
|
|
23
|
-
.value=${value}
|
|
24
|
-
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
25
|
-
></mo-field-date>
|
|
19
|
+
return html `
|
|
20
|
+
<mo-field-date dense data-focus
|
|
21
|
+
?hideDatePicker=${this.hideDatePicker}
|
|
22
|
+
label=${this.heading}
|
|
23
|
+
.value=${value}
|
|
24
|
+
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
25
|
+
></mo-field-date>
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataGridColumn } from './DataGridColumn.js';
|
|
2
|
+
/**
|
|
3
|
+
* @element mo-data-grid-column-deletion
|
|
4
|
+
*
|
|
5
|
+
* @attr prevent - Prevents the deletion button from being displayed
|
|
6
|
+
*
|
|
7
|
+
* @fires delete
|
|
8
|
+
*/
|
|
9
|
+
export declare class DataGridColumnDeletion<TData> extends DataGridColumn<TData, never> {
|
|
10
|
+
readonly delete: EventDispatcher<TData>;
|
|
11
|
+
prevent: boolean;
|
|
12
|
+
width: string;
|
|
13
|
+
nonSortable: boolean;
|
|
14
|
+
nonEditable: boolean;
|
|
15
|
+
getContentTemplate: (_: never, data?: TData) => import("lit-html").HTMLTemplateResult;
|
|
16
|
+
getEditContentTemplate: undefined;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
'mo-data-grid-column-deletion': DataGridColumnDeletion<unknown>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=DataGridColumnDeletion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGridColumnDeletion.d.ts","sourceRoot":"","sources":["../../columns/DataGridColumnDeletion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAMpD;;;;;;GAMG;AACH,qBACa,sBAAsB,CAAC,KAAK,CAAE,SAAQ,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC;IACrE,QAAQ,CAAC,MAAM,EAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IAEpB,OAAO,UAAQ;IAEnC,KAAK,SAAS;IACd,WAAW,UAAO;IAClB,WAAW,UAAO;IAE3B,kBAAkB,MAAO,KAAK,SAAS,KAAK,2CAK3C;IAED,sBAAsB,YAAY;CAClC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,8BAA8B,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAA;KAC/D;CACD"}
|
|
@@ -7,16 +7,19 @@ Localizer.register("de" /* LanguageCode.German */, {
|
|
|
7
7
|
'Delete position': 'Position entfernen'
|
|
8
8
|
});
|
|
9
9
|
/**
|
|
10
|
-
* @element mo-data-grid-column-
|
|
10
|
+
* @element mo-data-grid-column-deletion
|
|
11
11
|
*
|
|
12
|
-
* @attr prevent - Prevents the
|
|
12
|
+
* @attr prevent - Prevents the deletion button from being displayed
|
|
13
13
|
*
|
|
14
14
|
* @fires delete
|
|
15
15
|
*/
|
|
16
|
-
let
|
|
16
|
+
let DataGridColumnDeletion = class DataGridColumnDeletion extends DataGridColumn {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.prevent = false;
|
|
20
|
+
this.width = '40px';
|
|
21
|
+
this.nonSortable = true;
|
|
22
|
+
this.nonEditable = true;
|
|
20
23
|
this.getContentTemplate = (_, data) => this.prevent ? nothing : html `
|
|
21
24
|
<mo-icon-button icon='delete' ${tooltip('Delete position')}
|
|
22
25
|
${style({ color: 'var(--mo-color-gray)', height: '40px' })}
|
|
@@ -28,11 +31,11 @@ let DataGridColumnDelete = class DataGridColumnDelete extends DataGridColumn {
|
|
|
28
31
|
};
|
|
29
32
|
__decorate([
|
|
30
33
|
event()
|
|
31
|
-
],
|
|
34
|
+
], DataGridColumnDeletion.prototype, "delete", void 0);
|
|
32
35
|
__decorate([
|
|
33
36
|
property({ type: Boolean })
|
|
34
|
-
],
|
|
35
|
-
|
|
36
|
-
component('mo-data-grid-column-
|
|
37
|
-
],
|
|
38
|
-
export {
|
|
37
|
+
], DataGridColumnDeletion.prototype, "prevent", void 0);
|
|
38
|
+
DataGridColumnDeletion = __decorate([
|
|
39
|
+
component('mo-data-grid-column-deletion')
|
|
40
|
+
], DataGridColumnDeletion);
|
|
41
|
+
export { DataGridColumnDeletion };
|
|
@@ -9,8 +9,8 @@ let DataGridColumnImage = class DataGridColumnImage extends DataGridColumn {
|
|
|
9
9
|
}
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
11
|
getContentTemplate(value, _data) {
|
|
12
|
-
return !value ? nothing : html `
|
|
13
|
-
<img style='vertical-align: middle' src=${value} onload='this.hidden = false' onerror='this.hidden = true'/>
|
|
12
|
+
return !value ? nothing : html `
|
|
13
|
+
<img style='vertical-align: middle' src=${value} onload='this.hidden = false' onerror='this.hidden = true'/>
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
@@ -9,11 +9,11 @@ let DataGridColumnNumber = class DataGridColumnNumber extends DataGridColumnNumb
|
|
|
9
9
|
return html `${Number.isFinite(value) ? (_a = value === null || value === void 0 ? void 0 : value.format()) !== null && _a !== void 0 ? _a : nothing : nothing}`;
|
|
10
10
|
}
|
|
11
11
|
getEditContentTemplate(value, data) {
|
|
12
|
-
return html `
|
|
13
|
-
<mo-field-number dense label=${this.heading} data-focus
|
|
14
|
-
value=${ifDefined(value)}
|
|
15
|
-
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
16
|
-
></mo-field-number>
|
|
12
|
+
return html `
|
|
13
|
+
<mo-field-number dense label=${this.heading} data-focus
|
|
14
|
+
value=${ifDefined(value)}
|
|
15
|
+
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
16
|
+
></mo-field-number>
|
|
17
17
|
`;
|
|
18
18
|
}
|
|
19
19
|
getSumTemplate(sum) {
|
|
@@ -9,12 +9,12 @@ let DataGridColumnPercent = class DataGridColumnPercent extends DataGridColumnNu
|
|
|
9
9
|
return html `${Number.isFinite(value) ? (_a = value === null || value === void 0 ? void 0 : value.formatAsPercent()) !== null && _a !== void 0 ? _a : nothing : nothing}`;
|
|
10
10
|
}
|
|
11
11
|
getEditContentTemplate(value, data) {
|
|
12
|
-
return html `
|
|
13
|
-
<mo-field-percent dense data-focus
|
|
14
|
-
label=${this.heading}
|
|
15
|
-
value=${ifDefined(value)}
|
|
16
|
-
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
17
|
-
></mo-field-percent>
|
|
12
|
+
return html `
|
|
13
|
+
<mo-field-percent dense data-focus
|
|
14
|
+
label=${this.heading}
|
|
15
|
+
value=${ifDefined(value)}
|
|
16
|
+
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
17
|
+
></mo-field-percent>
|
|
18
18
|
`;
|
|
19
19
|
}
|
|
20
20
|
getSumTemplate(sum) {
|
|
@@ -8,11 +8,11 @@ let DataGridColumnText = class DataGridColumnText extends DataGridColumn {
|
|
|
8
8
|
return html `${value !== null && value !== void 0 ? value : ''}`;
|
|
9
9
|
}
|
|
10
10
|
getEditContentTemplate(value, data) {
|
|
11
|
-
return html `
|
|
12
|
-
<mo-field-text dense label=${this.heading} data-focus
|
|
13
|
-
value=${ifDefined(value)}
|
|
14
|
-
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
15
|
-
></mo-field-text>
|
|
11
|
+
return html `
|
|
12
|
+
<mo-field-text dense label=${this.heading} data-focus
|
|
13
|
+
value=${ifDefined(value)}
|
|
14
|
+
@change=${(e) => this.handleEdit(e.detail, data)}
|
|
15
|
+
></mo-field-text>
|
|
16
16
|
`;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -11,29 +11,29 @@ let DataGridFooterSum = class DataGridFooterSum extends Component {
|
|
|
11
11
|
this.heading = '';
|
|
12
12
|
}
|
|
13
13
|
static get styles() {
|
|
14
|
-
return css `
|
|
15
|
-
:host {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
position: relative;
|
|
19
|
-
max-height: 100%;
|
|
20
|
-
line-height: 1em;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
div {
|
|
24
|
-
color: var(--mo-color-foreground-transparent);
|
|
25
|
-
font-size: x-small;
|
|
26
|
-
text-transform: uppercase;
|
|
27
|
-
text-align: center;
|
|
28
|
-
}
|
|
14
|
+
return css `
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
position: relative;
|
|
19
|
+
max-height: 100%;
|
|
20
|
+
line-height: 1em;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
div {
|
|
24
|
+
color: var(--mo-color-foreground-transparent);
|
|
25
|
+
font-size: x-small;
|
|
26
|
+
text-transform: uppercase;
|
|
27
|
+
text-align: center;
|
|
28
|
+
}
|
|
29
29
|
`;
|
|
30
30
|
}
|
|
31
31
|
get template() {
|
|
32
|
-
return html `
|
|
33
|
-
<div>${this.heading}</div>
|
|
34
|
-
<mo-flex direction='horizontal' justifyContent='center'>
|
|
35
|
-
<slot></slot>
|
|
36
|
-
</mo-flex>
|
|
32
|
+
return html `
|
|
33
|
+
<div>${this.heading}</div>
|
|
34
|
+
<mo-flex direction='horizontal' justifyContent='center'>
|
|
35
|
+
<slot></slot>
|
|
36
|
+
</mo-flex>
|
|
37
37
|
`;
|
|
38
38
|
}
|
|
39
39
|
};
|
package/dist/columns/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './DataGridColumnImage.js';
|
|
|
8
8
|
export * from './DataGridColumnNumber.js';
|
|
9
9
|
export * from './DataGridColumnText.js';
|
|
10
10
|
export * from './DataGridFooterSum.js';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './DataGridColumnDeletion.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../columns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../columns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA"}
|
package/dist/columns/index.js
CHANGED
|
@@ -3,48 +3,48 @@ import { css, component, html } from '@a11d/lit';
|
|
|
3
3
|
import { DataGridRow } from './DataGridRow.js';
|
|
4
4
|
let DataGridDefaultRow = class DataGridDefaultRow extends DataGridRow {
|
|
5
5
|
static get styles() {
|
|
6
|
-
return css `
|
|
7
|
-
${super.styles}
|
|
8
|
-
|
|
9
|
-
mo-grid {
|
|
10
|
-
height: var(--mo-data-grid-row-height);
|
|
11
|
-
grid-template-columns: var(--mo-data-grid-columns);
|
|
12
|
-
column-gap: var(--mo-data-grid-columns-gap);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
mo-flex {
|
|
16
|
-
white-space: nowrap;
|
|
17
|
-
text-overflow: ellipsis;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
#selectionContainer {
|
|
22
|
-
height: var(--mo-data-grid-row-height);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#detailsContainer [instanceof*=mo-data-grid] {
|
|
26
|
-
--mo-data-grid-header-background: rgba(var(--mo-color-foreground-base), 0.04);
|
|
27
|
-
--mo-data-grid-alternating-background: transparent;
|
|
28
|
-
--mo-data-grid-content-min-height: 0px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#detailsContainer [instanceof*=mo-data-grid]:not([headerHidden]) {
|
|
32
|
-
background: var(--mo-color-transparent-gray-1);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host-context(:not([hasDetails]):not([selectionMode=single]):not([selectionMode=multiple])) #detailsContainer > [instanceof*=mo-data-grid]:not([headerHidden]) {
|
|
36
|
-
margin: 16px var(--mo-details-data-grid-start-margin);
|
|
37
|
-
width: calc(100% - calc(var(--mo-details-data-grid-start-margin) * 2));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host-context(:not([hasDetails]):not([selectionMode=single]):not([selectionMode=multiple])) #detailsContainer > [instanceof*=mo-data-grid] {
|
|
41
|
-
padding: 0px !important;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
:host-context(:not([hasDetails]):not([selectionMode=single]):not([selectionMode=multiple])) #detailsContainer > [instanceof*=mo-data-grid][headerHidden] {
|
|
45
|
-
margin-inline-start: var(--mo-details-data-grid-start-margin);
|
|
46
|
-
width: calc(100% - var(--mo-details-data-grid-start-margin));
|
|
47
|
-
}
|
|
6
|
+
return css `
|
|
7
|
+
${super.styles}
|
|
8
|
+
|
|
9
|
+
mo-grid {
|
|
10
|
+
height: var(--mo-data-grid-row-height);
|
|
11
|
+
grid-template-columns: var(--mo-data-grid-columns);
|
|
12
|
+
column-gap: var(--mo-data-grid-columns-gap);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
mo-flex {
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
text-overflow: ellipsis;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#selectionContainer {
|
|
22
|
+
height: var(--mo-data-grid-row-height);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#detailsContainer [instanceof*=mo-data-grid] {
|
|
26
|
+
--mo-data-grid-header-background: rgba(var(--mo-color-foreground-base), 0.04);
|
|
27
|
+
--mo-data-grid-alternating-background: transparent;
|
|
28
|
+
--mo-data-grid-content-min-height: 0px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#detailsContainer [instanceof*=mo-data-grid]:not([headerHidden]) {
|
|
32
|
+
background: var(--mo-color-transparent-gray-1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host-context(:not([hasDetails]):not([selectionMode=single]):not([selectionMode=multiple])) #detailsContainer > [instanceof*=mo-data-grid]:not([headerHidden]) {
|
|
36
|
+
margin: 16px var(--mo-details-data-grid-start-margin);
|
|
37
|
+
width: calc(100% - calc(var(--mo-details-data-grid-start-margin) * 2));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host-context(:not([hasDetails]):not([selectionMode=single]):not([selectionMode=multiple])) #detailsContainer > [instanceof*=mo-data-grid] {
|
|
41
|
+
padding: 0px !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host-context(:not([hasDetails]):not([selectionMode=single]):not([selectionMode=multiple])) #detailsContainer > [instanceof*=mo-data-grid][headerHidden] {
|
|
45
|
+
margin-inline-start: var(--mo-details-data-grid-start-margin);
|
|
46
|
+
width: calc(100% - var(--mo-details-data-grid-start-margin));
|
|
47
|
+
}
|
|
48
48
|
`;
|
|
49
49
|
}
|
|
50
50
|
updated(...parameters) {
|
|
@@ -55,11 +55,11 @@ let DataGridDefaultRow = class DataGridDefaultRow extends DataGridRow {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
get rowTemplate() {
|
|
58
|
-
return html `
|
|
59
|
-
${this.detailsExpanderTemplate}
|
|
60
|
-
${this.selectionTemplate}
|
|
61
|
-
${this.dataGrid.columns.map(column => this.getCellTemplate(column))}
|
|
62
|
-
${this.contextMenuIconButtonTemplate}
|
|
58
|
+
return html `
|
|
59
|
+
${this.detailsExpanderTemplate}
|
|
60
|
+
${this.selectionTemplate}
|
|
61
|
+
${this.dataGrid.columns.map(column => this.getCellTemplate(column))}
|
|
62
|
+
${this.contextMenuIconButtonTemplate}
|
|
63
63
|
`;
|
|
64
64
|
}
|
|
65
65
|
};
|