@3mo/data-grid 0.17.2 → 0.18.0
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/DataGrid.d.ts +1 -3
- package/dist/DataGrid.d.ts.map +1 -1
- package/dist/DataGrid.js +3 -17
- package/dist/DataGridCell.js +2 -2
- package/dist/DataGridColumnsController.js +1 -1
- package/dist/DataGridHeader.js +1 -1
- package/dist/DataGridSelectionController.d.ts +4 -7
- package/dist/DataGridSelectionController.d.ts.map +1 -1
- package/dist/DataGridSelectionController.js +39 -59
- package/dist/custom-elements.json +4 -28
- package/dist/rows/DataGridRow.d.ts +0 -2
- package/dist/rows/DataGridRow.d.ts.map +1 -1
- package/dist/rows/DataGridRow.js +9 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/DataGrid.d.ts
CHANGED
|
@@ -26,11 +26,10 @@ export declare enum DataGridEditability {
|
|
|
26
26
|
* @attr page - The current page.
|
|
27
27
|
* @attr pagination - The pagination mode. It can be either `auto` or a number.
|
|
28
28
|
* @attr sorting - The sorting mode. It is an object with `selector` and `strategy` properties.
|
|
29
|
-
* @attr selectability - The selection mode. Default to 'single'
|
|
29
|
+
* @attr selectability - The selection mode. Default to 'single' if context menus available, 'undefined' otherwise.
|
|
30
30
|
* @attr isDataSelectable - Whether data of a given row is selectable.
|
|
31
31
|
* @attr selectedData - The selected data.
|
|
32
32
|
* @attr selectOnClick - Whether the row should be selected on click.
|
|
33
|
-
* @attr selectionCheckboxesHidden - Whether the selection checkboxes should be hidden. This activates selection on row click ignoring the `selectOnClick` attribute.
|
|
34
33
|
* @attr selectionBehaviorOnDataChange - The behavior of the selection when the data changes.
|
|
35
34
|
* @attr multipleDetails - Whether multiple details can be opened at the same time.
|
|
36
35
|
* @attr subDataGridDataSelector - The key path of the sub data grid data.
|
|
@@ -108,7 +107,6 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
|
|
|
108
107
|
isDataSelectable?: (data: TData) => boolean;
|
|
109
108
|
selectedData: TData[];
|
|
110
109
|
selectOnClick: boolean;
|
|
111
|
-
selectionCheckboxesHidden: boolean;
|
|
112
110
|
selectionBehaviorOnDataChange: DataGridSelectionBehaviorOnDataChange;
|
|
113
111
|
getRowDetailsTemplate?: (data: TData) => HTMLTemplateResult;
|
|
114
112
|
multipleDetails: boolean;
|
package/dist/DataGrid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../DataGrid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAA+B,KAAK,cAAc,EAAqC,KAAK,kBAAkB,EAAwD,MAAM,WAAW,CAAA;AAC9N,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAGhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,qCAAqC,EAAE,2BAA2B,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACjJ,OAAO,EAAE,yBAAyB,EAAE,KAAK,4BAA4B,EAAE,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACnI,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAA4C,KAAK,WAAW,EAA0B,6BAA6B,EAAE,MAAM,YAAY,CAAA;AACnO,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAO5C,MAAM,MAAM,kBAAkB,GAAG,MAAM,G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AAS,KAAK,gBAAgB,uBAgB7B;IAED,SAAS,KAAK,cAAc,uBAI3B;IAED,OAAO,KAAK,YAAY,GAMvB;IAED;;;;;OAKG;IACH,OAAO,KAAK,2BAA2B,GAgDtC;IAED,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,SAAI;IASvD,SAAS,KAAK,cAAc,uBAa3B;IAED,IAAI,YAAY,IAAI,kBAAkB,CAIrC;IAED,SAAS,KAAK,eAAe,uBAU5B;IAED,SAAS,KAAK,sBAAsB,uBAEnC;IAED,SAAS,KAAK,4BAA4B,uBAEzC;IAED,SAAS,KAAK,kBAAkB,uBAE/B;IAED,SAAS,KAAK,sBAAsB,uBAgBnC;IAED,OAAO,CAAC,oBAAoB,CAAI;IAEhC,OAAO,CAAC,YAAY;IAkBpB,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,YAAY;IAI/C,SAAS,CAAE,gBAAgB,CAAC,MAAM,UAAY,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IA+B9F,IAAI,WAAW,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAO1C;IAED,IAAI,iBAAiB,wBAUpB;IAED,SAAS,KAAK,QAAQ,WAErB;IAED,SAAS,KAAK,QAAQ,WAErB;IAEM,UAAU;CAIjB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;KAC5C;CACD"}
|
package/dist/DataGrid.js
CHANGED
|
@@ -35,11 +35,10 @@ export var DataGridEditability;
|
|
|
35
35
|
* @attr page - The current page.
|
|
36
36
|
* @attr pagination - The pagination mode. It can be either `auto` or a number.
|
|
37
37
|
* @attr sorting - The sorting mode. It is an object with `selector` and `strategy` properties.
|
|
38
|
-
* @attr selectability - The selection mode. Default to 'single'
|
|
38
|
+
* @attr selectability - The selection mode. Default to 'single' if context menus available, 'undefined' otherwise.
|
|
39
39
|
* @attr isDataSelectable - Whether data of a given row is selectable.
|
|
40
40
|
* @attr selectedData - The selected data.
|
|
41
41
|
* @attr selectOnClick - Whether the row should be selected on click.
|
|
42
|
-
* @attr selectionCheckboxesHidden - Whether the selection checkboxes should be hidden. This activates selection on row click ignoring the `selectOnClick` attribute.
|
|
43
42
|
* @attr selectionBehaviorOnDataChange - The behavior of the selection when the data changes.
|
|
44
43
|
* @attr multipleDetails - Whether multiple details can be opened at the same time.
|
|
45
44
|
* @attr subDataGridDataSelector - The key path of the sub data grid data.
|
|
@@ -96,7 +95,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
|
|
|
96
95
|
this.page = 1;
|
|
97
96
|
this.selectedData = new Array();
|
|
98
97
|
this.selectOnClick = false;
|
|
99
|
-
this.selectionCheckboxesHidden = false;
|
|
100
98
|
this.selectionBehaviorOnDataChange = DataGridSelectionBehaviorOnDataChange.Reset;
|
|
101
99
|
this.multipleDetails = false;
|
|
102
100
|
this.detailsOnClick = false;
|
|
@@ -313,7 +311,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
|
|
|
313
311
|
--mo-data-grid-toolbar-padding: 0px 14px 14px 14px;
|
|
314
312
|
--mo-data-grid-border: 1px solid var(--mo-color-transparent-gray-3);
|
|
315
313
|
|
|
316
|
-
--mo-data-grid-row-tree-line-width: 8px;
|
|
317
314
|
--mo-details-data-grid-start-margin: 26px;
|
|
318
315
|
|
|
319
316
|
--mo-data-grid-sticky-part-color: var(--mo-color-surface);
|
|
@@ -349,14 +346,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
|
|
|
349
346
|
}
|
|
350
347
|
}
|
|
351
348
|
|
|
352
|
-
:host(:not([selectability="none"])) {
|
|
353
|
-
--mo-data-grid-row-tree-line-width: 18px;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
:host([hasDetails]) {
|
|
357
|
-
--mo-data-grid-row-tree-line-width: 18px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
349
|
#content {
|
|
361
350
|
width: fit-content;
|
|
362
351
|
min-width: 100%;
|
|
@@ -581,7 +570,7 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
|
|
|
581
570
|
</style>
|
|
582
571
|
<div id='size-anchor'>
|
|
583
572
|
${!this.hasDetails ? html.nothing : html `<span></span>`}
|
|
584
|
-
${!this.hasSelection
|
|
573
|
+
${!this.hasSelection ? html.nothing : html `<span></span>`}
|
|
585
574
|
${this.visibleColumns.map(column => html `
|
|
586
575
|
<div style='--_max-level: ${Math.max(...this.dataRecords.map(dr => dr.level))}'>
|
|
587
576
|
${getLongestContent(column)}
|
|
@@ -601,7 +590,7 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
|
|
|
601
590
|
get footerTemplate() {
|
|
602
591
|
return html `
|
|
603
592
|
<mo-flex ${style({ position: 'relative' })}>
|
|
604
|
-
<mo-flex id='fab' direction='vertical-reversed' gap='
|
|
593
|
+
<mo-flex id='fab' direction='vertical-reversed' gap='0.5rem'>
|
|
605
594
|
${this.fabTemplate}
|
|
606
595
|
</mo-flex>
|
|
607
596
|
${this.hasFooter === false ? html.nothing : html `
|
|
@@ -802,9 +791,6 @@ __decorate([
|
|
|
802
791
|
__decorate([
|
|
803
792
|
property({ type: Boolean })
|
|
804
793
|
], DataGrid.prototype, "selectOnClick", void 0);
|
|
805
|
-
__decorate([
|
|
806
|
-
property({ type: Boolean })
|
|
807
|
-
], DataGrid.prototype, "selectionCheckboxesHidden", void 0);
|
|
808
794
|
__decorate([
|
|
809
795
|
property()
|
|
810
796
|
], DataGrid.prototype, "selectionBehaviorOnDataChange", void 0);
|
package/dist/DataGridCell.js
CHANGED
|
@@ -102,8 +102,8 @@ let DataGridCell = class DataGridCell extends Component {
|
|
|
102
102
|
event.preventDefault();
|
|
103
103
|
cell.focus();
|
|
104
104
|
this.setEditing(false);
|
|
105
|
-
if (this.dataGrid.
|
|
106
|
-
this.dataGrid.
|
|
105
|
+
if (this.dataGrid.selectOnClick) {
|
|
106
|
+
this.dataGrid.selectionController.setSelection(cell.row.data, true, event.shiftKey);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -58,7 +58,7 @@ export class DataGridColumnsController extends Controller {
|
|
|
58
58
|
return !this.host.hasDetails ? undefined : window.getComputedStyle(this.host).getPropertyValue('--mo-data-grid-column-details-width');
|
|
59
59
|
}
|
|
60
60
|
get selectionColumnWidth() {
|
|
61
|
-
return !this.host.hasSelection
|
|
61
|
+
return !this.host.hasSelection ? undefined : window.getComputedStyle(this.host).getPropertyValue('--mo-data-grid-column-selection-width');
|
|
62
62
|
}
|
|
63
63
|
get dataColumnsWidths() {
|
|
64
64
|
return this.visibleColumns
|
package/dist/DataGridHeader.js
CHANGED
|
@@ -121,7 +121,7 @@ let DataGridHeader = class DataGridHeader extends Component {
|
|
|
121
121
|
`;
|
|
122
122
|
}
|
|
123
123
|
get selectionTemplate() {
|
|
124
|
-
return this.dataGrid.hasSelection
|
|
124
|
+
return !this.dataGrid.hasSelection ? html.nothing : html `
|
|
125
125
|
<mo-flex class='selection' justifyContent='center' alignItems='center'
|
|
126
126
|
${style({ insetInlineStart: this.dataGrid.hasDetails ? '20px' : '0px' })}
|
|
127
127
|
${this.getResizeObserver('selectionColumnWidthInPixels')}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DataRecord } from './DataRecord.js';
|
|
2
2
|
export declare enum DataGridSelectability {
|
|
3
|
-
None = "none",
|
|
4
3
|
Single = "single",
|
|
5
4
|
Multiple = "multiple"
|
|
6
5
|
}
|
|
@@ -17,7 +16,6 @@ interface SelectableComponent<TData> {
|
|
|
17
16
|
readonly dataRecords: Array<DataRecord<TData>>;
|
|
18
17
|
selectedData: Array<TData>;
|
|
19
18
|
isDataSelectable?(data: TData): boolean;
|
|
20
|
-
selectionCheckboxesHidden?: boolean;
|
|
21
19
|
readonly selectionChange?: EventDispatcher<Array<TData>>;
|
|
22
20
|
readonly selectionBehaviorOnDataChange?: DataGridSelectionBehaviorOnDataChange;
|
|
23
21
|
readonly hasContextMenu?: boolean;
|
|
@@ -26,8 +24,7 @@ export declare class DataGridSelectionController<TData> {
|
|
|
26
24
|
readonly host: SelectableComponent<TData>;
|
|
27
25
|
private lastActiveSelection?;
|
|
28
26
|
constructor(host: SelectableComponent<TData>);
|
|
29
|
-
private get
|
|
30
|
-
private setDefaultsIfNotDefined;
|
|
27
|
+
private get selectability();
|
|
31
28
|
get hasSelection(): boolean;
|
|
32
29
|
private get data();
|
|
33
30
|
private get selectableData();
|
|
@@ -36,12 +33,12 @@ export declare class DataGridSelectionController<TData> {
|
|
|
36
33
|
private get previouslySelectedData();
|
|
37
34
|
isSelectable(data: TData): boolean;
|
|
38
35
|
isSelected(data: TData): boolean;
|
|
36
|
+
handleDataChange(behavior: DataGridSelectionBehaviorOnDataChange): void;
|
|
37
|
+
selectPreviouslySelectedData(): void;
|
|
38
|
+
setSelection(data: TData, selected: boolean, preservePreviousSelections?: boolean): void;
|
|
39
39
|
selectAll(): void;
|
|
40
40
|
deselectAll(): void;
|
|
41
41
|
select(data: Array<TData>): void;
|
|
42
|
-
handleDataChange(behavior: DataGridSelectionBehaviorOnDataChange): void;
|
|
43
|
-
selectPreviouslySelectedData(): void;
|
|
44
|
-
setSelection(data: TData, selected: boolean): void;
|
|
45
42
|
}
|
|
46
43
|
export {};
|
|
47
44
|
//# sourceMappingURL=DataGridSelectionController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridSelectionController.d.ts","sourceRoot":"","sources":["../DataGridSelectionController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,oBAAY,qBAAqB;IAChC,
|
|
1
|
+
{"version":3,"file":"DataGridSelectionController.d.ts","sourceRoot":"","sources":["../DataGridSelectionController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA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I,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,0BAA0B,UAAQ;IA8B/E,SAAS;IAMT,WAAW;IAIX,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC;CAOzB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { KeyboardController } from '@3mo/keyboard-controller';
|
|
2
2
|
export var DataGridSelectability;
|
|
3
3
|
(function (DataGridSelectability) {
|
|
4
|
-
DataGridSelectability["None"] = "none";
|
|
5
4
|
DataGridSelectability["Single"] = "single";
|
|
6
5
|
DataGridSelectability["Multiple"] = "multiple";
|
|
7
6
|
})(DataGridSelectability || (DataGridSelectability = {}));
|
|
@@ -18,23 +17,14 @@ export class DataGridSelectionController {
|
|
|
18
17
|
constructor(host) {
|
|
19
18
|
this.host = host;
|
|
20
19
|
}
|
|
21
|
-
get
|
|
22
|
-
this.setDefaultsIfNotDefined();
|
|
23
|
-
return this.host.selectability;
|
|
24
|
-
}
|
|
25
|
-
setDefaultsIfNotDefined() {
|
|
26
|
-
if (this.host.selectability !== undefined) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
20
|
+
get selectability() {
|
|
29
21
|
if (this.host.hasContextMenu === true && this.host.selectability === undefined) {
|
|
30
22
|
this.host.selectability = DataGridSelectability.Single;
|
|
31
|
-
this.host.selectionCheckboxesHidden = true;
|
|
32
|
-
return;
|
|
33
23
|
}
|
|
34
|
-
this.host.selectability
|
|
24
|
+
return this.host.selectability;
|
|
35
25
|
}
|
|
36
26
|
get hasSelection() {
|
|
37
|
-
return this.
|
|
27
|
+
return !!this.selectability;
|
|
38
28
|
}
|
|
39
29
|
get data() { return this.host.dataRecords.map(d => d.data); }
|
|
40
30
|
get selectableData() { return this.data.filter(d => this.isSelectable(d)); }
|
|
@@ -57,21 +47,6 @@ export class DataGridSelectionController {
|
|
|
57
47
|
isSelected(data) {
|
|
58
48
|
return this.selectedData.includes(data);
|
|
59
49
|
}
|
|
60
|
-
selectAll() {
|
|
61
|
-
if (this.mode === DataGridSelectability.Multiple) {
|
|
62
|
-
this.select([...this.data]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
deselectAll() {
|
|
66
|
-
this.select([]);
|
|
67
|
-
}
|
|
68
|
-
select(data) {
|
|
69
|
-
if (this.hasSelection) {
|
|
70
|
-
const selectableData = data.filter(d => this.isSelectable(d));
|
|
71
|
-
this.selectedData = selectableData;
|
|
72
|
-
this.host.selectionChange?.dispatch(selectableData);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
50
|
handleDataChange(behavior) {
|
|
76
51
|
switch (behavior) {
|
|
77
52
|
case DataGridSelectionBehaviorOnDataChange.Reset:
|
|
@@ -85,41 +60,46 @@ export class DataGridSelectionController {
|
|
|
85
60
|
selectPreviouslySelectedData() {
|
|
86
61
|
this.select(this.previouslySelectedData);
|
|
87
62
|
}
|
|
88
|
-
setSelection(data, selected) {
|
|
63
|
+
setSelection(data, selected, preservePreviousSelections = false) {
|
|
89
64
|
if (!this.hasSelection || !this.isSelectable(data)) {
|
|
90
65
|
return;
|
|
91
66
|
}
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
? [data]
|
|
111
|
-
: [...dataToSelect, data];
|
|
67
|
+
const dataToSelect = [...new Set((() => {
|
|
68
|
+
switch (true) {
|
|
69
|
+
case this.selectability === DataGridSelectability.Multiple && KeyboardController.shift && !!this.lastActiveSelection:
|
|
70
|
+
const lastActiveSelection = this.lastActiveSelection;
|
|
71
|
+
const indexes = [
|
|
72
|
+
this.selectableData.findIndex(data => lastActiveSelection.data === data),
|
|
73
|
+
this.selectableData.findIndex(d => d === data)
|
|
74
|
+
].sort((a, b) => a - b);
|
|
75
|
+
const range = this.selectableData.slice(indexes[0], indexes[1] + 1);
|
|
76
|
+
return lastActiveSelection.selected
|
|
77
|
+
? [...this.selectedData, ...range]
|
|
78
|
+
: this.selectedData.filter(d => range.includes(d) === false);
|
|
79
|
+
case preservePreviousSelections && selected && this.selectability === DataGridSelectability.Multiple:
|
|
80
|
+
return [...this.selectedData, data];
|
|
81
|
+
case selected:
|
|
82
|
+
return [data];
|
|
83
|
+
default:
|
|
84
|
+
return this.selectedData.filter(d => d !== data);
|
|
112
85
|
}
|
|
113
|
-
|
|
114
|
-
dataToSelect = [data];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
dataToSelect = dataToSelect.filter(d => d !== data);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
86
|
+
})())];
|
|
121
87
|
this.lastActiveSelection = { data, selected };
|
|
122
|
-
|
|
123
|
-
|
|
88
|
+
this.select(dataToSelect);
|
|
89
|
+
}
|
|
90
|
+
selectAll() {
|
|
91
|
+
if (this.selectability === DataGridSelectability.Multiple) {
|
|
92
|
+
this.select([...this.data]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
deselectAll() {
|
|
96
|
+
this.select([]);
|
|
97
|
+
}
|
|
98
|
+
select(data) {
|
|
99
|
+
if (this.hasSelection) {
|
|
100
|
+
const selectableData = data.filter(d => this.isSelectable(d));
|
|
101
|
+
this.selectedData = selectableData;
|
|
102
|
+
this.host.selectionChange?.dispatch(selectableData);
|
|
103
|
+
}
|
|
124
104
|
}
|
|
125
105
|
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"name": "selectability",
|
|
50
|
-
"description": "The selection mode. Default to 'single'
|
|
50
|
+
"description": "The selection mode. Default to 'single' if context menus available, 'undefined' otherwise.",
|
|
51
51
|
"type": "DataGridSelectability | undefined"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -67,12 +67,6 @@
|
|
|
67
67
|
"type": "boolean",
|
|
68
68
|
"default": "false"
|
|
69
69
|
},
|
|
70
|
-
{
|
|
71
|
-
"name": "selectionCheckboxesHidden",
|
|
72
|
-
"description": "Whether the selection checkboxes should be hidden. This activates selection on row click ignoring the `selectOnClick` attribute.",
|
|
73
|
-
"type": "boolean",
|
|
74
|
-
"default": "false"
|
|
75
|
-
},
|
|
76
70
|
{
|
|
77
71
|
"name": "selectionBehaviorOnDataChange",
|
|
78
72
|
"description": "The behavior of the selection when the data changes.",
|
|
@@ -408,7 +402,7 @@
|
|
|
408
402
|
{
|
|
409
403
|
"name": "selectability",
|
|
410
404
|
"attribute": "selectability",
|
|
411
|
-
"description": "The selection mode. Default to 'single'
|
|
405
|
+
"description": "The selection mode. Default to 'single' if context menus available, 'undefined' otherwise.",
|
|
412
406
|
"type": "DataGridSelectability | undefined"
|
|
413
407
|
},
|
|
414
408
|
{
|
|
@@ -431,13 +425,6 @@
|
|
|
431
425
|
"type": "boolean",
|
|
432
426
|
"default": "false"
|
|
433
427
|
},
|
|
434
|
-
{
|
|
435
|
-
"name": "selectionCheckboxesHidden",
|
|
436
|
-
"attribute": "selectionCheckboxesHidden",
|
|
437
|
-
"description": "Whether the selection checkboxes should be hidden. This activates selection on row click ignoring the `selectOnClick` attribute.",
|
|
438
|
-
"type": "boolean",
|
|
439
|
-
"default": "false"
|
|
440
|
-
},
|
|
441
428
|
{
|
|
442
429
|
"name": "selectionBehaviorOnDataChange",
|
|
443
430
|
"attribute": "selectionBehaviorOnDataChange",
|
|
@@ -3067,7 +3054,7 @@
|
|
|
3067
3054
|
},
|
|
3068
3055
|
{
|
|
3069
3056
|
"name": "selectability",
|
|
3070
|
-
"description": "The selection mode. Default to 'single'
|
|
3057
|
+
"description": "The selection mode. Default to 'single' if context menus available, 'undefined' otherwise.",
|
|
3071
3058
|
"type": "DataGridSelectability | undefined"
|
|
3072
3059
|
},
|
|
3073
3060
|
{
|
|
@@ -3085,11 +3072,6 @@
|
|
|
3085
3072
|
"description": "Whether the row should be selected on click.",
|
|
3086
3073
|
"type": "boolean"
|
|
3087
3074
|
},
|
|
3088
|
-
{
|
|
3089
|
-
"name": "selectionCheckboxesHidden",
|
|
3090
|
-
"description": "Whether the selection checkboxes should be hidden. This activates selection on row click ignoring the `selectOnClick` attribute.",
|
|
3091
|
-
"type": "boolean"
|
|
3092
|
-
},
|
|
3093
3075
|
{
|
|
3094
3076
|
"name": "selectionBehaviorOnDataChange",
|
|
3095
3077
|
"description": "The behavior of the selection when the data changes.",
|
|
@@ -3401,7 +3383,7 @@
|
|
|
3401
3383
|
{
|
|
3402
3384
|
"name": "selectability",
|
|
3403
3385
|
"attribute": "selectability",
|
|
3404
|
-
"description": "The selection mode. Default to 'single'
|
|
3386
|
+
"description": "The selection mode. Default to 'single' if context menus available, 'undefined' otherwise.",
|
|
3405
3387
|
"type": "DataGridSelectability | undefined"
|
|
3406
3388
|
},
|
|
3407
3389
|
{
|
|
@@ -3422,12 +3404,6 @@
|
|
|
3422
3404
|
"description": "Whether the row should be selected on click.",
|
|
3423
3405
|
"type": "boolean"
|
|
3424
3406
|
},
|
|
3425
|
-
{
|
|
3426
|
-
"name": "selectionCheckboxesHidden",
|
|
3427
|
-
"attribute": "selectionCheckboxesHidden",
|
|
3428
|
-
"description": "Whether the selection checkboxes should be hidden. This activates selection on row click ignoring the `selectOnClick` attribute.",
|
|
3429
|
-
"type": "boolean"
|
|
3430
|
-
},
|
|
3431
3407
|
{
|
|
3432
3408
|
"name": "selectionBehaviorOnDataChange",
|
|
3433
3409
|
"attribute": "selectionBehaviorOnDataChange",
|
|
@@ -30,14 +30,12 @@ export declare abstract class DataGridRow<TData, TDetailsElement extends Element
|
|
|
30
30
|
protected get fillerTemplate(): HTMLTemplateResult;
|
|
31
31
|
protected get contextMenuIconButtonTemplate(): HTMLTemplateResult;
|
|
32
32
|
protected get detailsTemplate(): HTMLTemplateResult;
|
|
33
|
-
private setSelection;
|
|
34
33
|
protected handleContentClick(): void;
|
|
35
34
|
protected handleContentDoubleClick(): Promise<void>;
|
|
36
35
|
protected handleContentMiddleClick(): Promise<void>;
|
|
37
36
|
private clickOnPrimaryContextMenuItemIfApplicable;
|
|
38
37
|
openContextMenu(event?: PointerEvent): Promise<void>;
|
|
39
38
|
protected handleContextMenuOpenChange(open: boolean): void;
|
|
40
|
-
private get contextMenuData();
|
|
41
39
|
private get contextMenuTemplate();
|
|
42
40
|
closeContextMenu(): Promise<void>;
|
|
43
41
|
toggleDetails(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridRow.d.ts","sourceRoot":"","sources":["../../rows/DataGridRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAyB,KAAK,kBAAkB,EAAoB,MAAM,WAAW,CAAA;AAKtH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"DataGridRow.d.ts","sourceRoot":"","sources":["../../rows/DataGridRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAyB,KAAK,kBAAkB,EAAoB,MAAM,WAAW,CAAA;AAKtH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAkC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAEhG,8BAAsB,WAAW,CAAC,KAAK,EAAE,eAAe,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,CAAE,SAAQ,SAAS;IACnF,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAA;IAChE,QAAQ,CAAC,OAAO,EAAG,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAA;IACjE,QAAQ,CAAC,OAAO,EAAG,WAAW,CAAA;IAE7B,cAAc,UAAO;IAEtB,UAAU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AE,WAAW,CAAC,OAAO,CAAC,CAAA;KACxC;CACD"}
|
package/dist/rows/DataGridRow.js
CHANGED
|
@@ -4,7 +4,7 @@ import { equals } from '@a11d/equals';
|
|
|
4
4
|
import { DirectionsByLanguage } from '@3mo/localization';
|
|
5
5
|
import { popover } from '@3mo/popover';
|
|
6
6
|
import { ContextMenu } from '@3mo/context-menu';
|
|
7
|
-
import { DataGridPrimaryContextMenuItem
|
|
7
|
+
import { DataGridPrimaryContextMenuItem } from '../index.js';
|
|
8
8
|
export class DataGridRow extends Component {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -229,7 +229,7 @@ export class DataGridRow extends Component {
|
|
|
229
229
|
`;
|
|
230
230
|
}
|
|
231
231
|
get selectionTemplate() {
|
|
232
|
-
return this.dataGrid.hasSelection
|
|
232
|
+
return !this.dataGrid.hasSelection ? html.nothing : html `
|
|
233
233
|
<mo-flex id='selectionContainer' justifyContent='center' alignItems='center'
|
|
234
234
|
?data-has-details=${this.dataGrid.hasDetails}
|
|
235
235
|
@click=${(e) => e.stopPropagation()}
|
|
@@ -239,7 +239,7 @@ export class DataGridRow extends Component {
|
|
|
239
239
|
tabindex='-1'
|
|
240
240
|
?disabled=${this.dataRecord.isSelectable === false}
|
|
241
241
|
.selected=${live(this.selected)}
|
|
242
|
-
@change=${(e) => this.setSelection(e.detail)}
|
|
242
|
+
@change=${(e) => this.dataGrid.selectionController.setSelection(this.data, e.detail, true)}
|
|
243
243
|
></mo-checkbox>
|
|
244
244
|
</mo-flex>
|
|
245
245
|
`;
|
|
@@ -279,12 +279,9 @@ export class DataGridRow extends Component {
|
|
|
279
279
|
${this.dataRecord.getSubDataByLevel(this.level + 1)?.map(data => this.dataGrid.getRowTemplate(data))}
|
|
280
280
|
`;
|
|
281
281
|
}
|
|
282
|
-
setSelection(selected) {
|
|
283
|
-
this.dataGrid.selectionController.setSelection(this.data, selected);
|
|
284
|
-
}
|
|
285
282
|
handleContentClick() {
|
|
286
|
-
if (this.dataGrid.selectOnClick
|
|
287
|
-
this.setSelection(this.
|
|
283
|
+
if (this.dataGrid.selectOnClick) {
|
|
284
|
+
this.dataGrid.selectionController.setSelection(this.data, true);
|
|
288
285
|
}
|
|
289
286
|
if (this.dataGrid.detailsOnClick && this.dataGrid.hasDetails) {
|
|
290
287
|
this.toggleDetails();
|
|
@@ -318,16 +315,13 @@ export class DataGridRow extends Component {
|
|
|
318
315
|
handleContextMenuOpenChange(open) {
|
|
319
316
|
this.toggleAttribute('data-context-menu-open', open);
|
|
320
317
|
if (this.dataRecord.isSelected === false) {
|
|
321
|
-
this.dataGrid.select(
|
|
318
|
+
this.dataGrid.select([this.data]);
|
|
322
319
|
}
|
|
323
320
|
}
|
|
324
|
-
get contextMenuData() {
|
|
325
|
-
return this.dataGrid.selectability === DataGridSelectability.None || this.dataGrid.selectedData.length === 0
|
|
326
|
-
? [this.data]
|
|
327
|
-
: this.dataGrid.selectedData;
|
|
328
|
-
}
|
|
329
321
|
get contextMenuTemplate() {
|
|
330
|
-
return this.dataGrid.contextMenuController.getMenuContentTemplate(this.
|
|
322
|
+
return this.dataGrid.contextMenuController.getMenuContentTemplate(!this.dataGrid.selectability || !this.dataGrid.selectedData.length
|
|
323
|
+
? [this.data]
|
|
324
|
+
: this.dataGrid.selectedData);
|
|
331
325
|
}
|
|
332
326
|
async closeContextMenu() {
|
|
333
327
|
ContextMenu.openInstance?.close();
|