@ai-table/grid 0.1.34 → 0.1.36
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/angular-konva/components/shape.component.d.ts.map +1 -1
- package/components/context-menu/context-menu.component.d.ts +0 -2
- package/components/context-menu/context-menu.component.d.ts.map +1 -1
- package/components/drag/drag.component.d.ts +1 -1
- package/components/drag/drag.component.d.ts.map +1 -1
- package/core/types/ai-table.d.ts +3 -1
- package/core/types/ai-table.d.ts.map +1 -1
- package/core/utils/common.d.ts.map +1 -1
- package/dom-grid.component.d.ts.map +1 -1
- package/fesm2022/ai-table-grid.mjs +204 -254
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid-base.component.d.ts +1 -3
- package/grid-base.component.d.ts.map +1 -1
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/renderer/components/cells/cover-cell-base.d.ts +0 -2
- package/renderer/components/cells/cover-cell-base.d.ts.map +1 -1
- package/renderer/components/cells/single-text.component.d.ts +1 -0
- package/renderer/components/cells/single-text.component.d.ts.map +1 -1
- package/renderer/components/fill-handle.component.d.ts.map +1 -1
- package/renderer/components/frozen-heads.component.d.ts.map +1 -1
- package/renderer/components/scrollable-group/scrollable-group.component.d.ts +0 -1
- package/renderer/components/scrollable-group/scrollable-group.component.d.ts.map +1 -1
- package/services/event.service.d.ts +0 -1
- package/services/event.service.d.ts.map +1 -1
- package/services/index.d.ts +0 -1
- package/services/index.d.ts.map +1 -1
- package/types/cell.d.ts +6 -1
- package/types/cell.d.ts.map +1 -1
- package/types/grid.d.ts +0 -7
- package/types/grid.d.ts.map +1 -1
- package/types/row.d.ts +1 -2
- package/types/row.d.ts.map +1 -1
- package/utils/cell.d.ts +14 -5
- package/utils/cell.d.ts.map +1 -1
- package/utils/field/field.d.ts +2 -0
- package/utils/field/field.d.ts.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/utils/record.d.ts +4 -0
- package/utils/record.d.ts.map +1 -0
- package/services/selection.service.d.ts +0 -24
- package/services/selection.service.d.ts.map +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, input, EventEmitter, inject, ElementRef, effect, Output, ChangeDetectionStrategy, Component, signal, computed, output, Input, ChangeDetectorRef, ViewChild,
|
2
|
+
import { InjectionToken, input, EventEmitter, inject, ElementRef, effect, Output, ChangeDetectionStrategy, Component, signal, computed, output, Input, ChangeDetectorRef, ViewChild, model, untracked, Renderer2, Pipe, booleanAttribute, DestroyRef, Injectable, NgZone, ViewContainerRef, viewChild, afterNextRender } from '@angular/core';
|
3
3
|
import Konva from 'konva';
|
4
4
|
import { Shape } from 'konva/lib/Shape';
|
5
5
|
import { Sprite } from 'konva/lib/shapes/Sprite';
|
@@ -61,7 +61,7 @@ import { ThyDot } from 'ngx-tethys/dot';
|
|
61
61
|
import { ThyIcon } from 'ngx-tethys/icon';
|
62
62
|
import { ThyTag } from 'ngx-tethys/tag';
|
63
63
|
import { ThySwitch } from 'ngx-tethys/switch';
|
64
|
-
import { of, Subject, fromEvent, debounceTime,
|
64
|
+
import { of, Subject, fromEvent, debounceTime, animationFrames, filter } from 'rxjs';
|
65
65
|
import { ThyDivider } from 'ngx-tethys/divider';
|
66
66
|
import * as i4 from 'ngx-tethys/avatar';
|
67
67
|
import { ThyAvatarModule } from 'ngx-tethys/avatar';
|
@@ -222,6 +222,9 @@ class KoShape {
|
|
222
222
|
if (this.config()) {
|
223
223
|
this.updateNode(this.config());
|
224
224
|
}
|
225
|
+
else {
|
226
|
+
this.updateNode({});
|
227
|
+
}
|
225
228
|
});
|
226
229
|
}
|
227
230
|
getNode() {
|
@@ -254,9 +257,6 @@ class KoShape {
|
|
254
257
|
});
|
255
258
|
}, 200);
|
256
259
|
};
|
257
|
-
if (this.config()) {
|
258
|
-
this.updateNode(this.config());
|
259
|
-
}
|
260
260
|
}
|
261
261
|
updateNode(config) {
|
262
262
|
if (!this._node)
|
@@ -1362,11 +1362,10 @@ function createAITable(records, fields, gridData) {
|
|
1362
1362
|
selectedRecords: new Set(),
|
1363
1363
|
selectedFields: new Set(),
|
1364
1364
|
selectedCells: new Set(),
|
1365
|
-
activeCell: null
|
1366
|
-
expandCell: null,
|
1367
|
-
editingCell: null,
|
1368
|
-
selectAllState: AITableSelectAllState.none
|
1365
|
+
activeCell: null
|
1369
1366
|
}),
|
1367
|
+
expendCell: signal({ path: null }),
|
1368
|
+
editingCell: signal({ path: null }),
|
1370
1369
|
keywordsMatchedCells: signal(new Set()),
|
1371
1370
|
recordsMap: computed(() => {
|
1372
1371
|
return records().reduce((object, item) => {
|
@@ -1976,19 +1975,100 @@ function getAvatarBgColor(name) {
|
|
1976
1975
|
: 0;
|
1977
1976
|
return colors[code % 9];
|
1978
1977
|
}
|
1979
|
-
function
|
1980
|
-
|
1978
|
+
function clearCoverCell(aiTable) {
|
1979
|
+
clearSelection(aiTable);
|
1980
|
+
closeEditingCell(aiTable);
|
1981
|
+
closeExpendCell(aiTable);
|
1982
|
+
}
|
1983
|
+
function clearSelection(aiTable) {
|
1981
1984
|
aiTable.selection.set({
|
1982
|
-
|
1983
|
-
|
1984
|
-
selectedCells: new Set(
|
1985
|
-
|
1985
|
+
selectedRecords: new Set(),
|
1986
|
+
selectedFields: new Set(),
|
1987
|
+
selectedCells: new Set(),
|
1988
|
+
activeCell: null
|
1989
|
+
});
|
1990
|
+
}
|
1991
|
+
function clearSelectionRecords(aiTable) {
|
1992
|
+
setSelection(aiTable, {
|
1993
|
+
selectedRecords: new Set()
|
1994
|
+
});
|
1995
|
+
}
|
1996
|
+
function clearSelectionFields(aiTable) {
|
1997
|
+
setSelection(aiTable, {
|
1998
|
+
selectedFields: new Set()
|
1999
|
+
});
|
2000
|
+
}
|
2001
|
+
function clearSelectedCells(aiTable) {
|
2002
|
+
setSelection(aiTable, {
|
2003
|
+
selectedCells: new Set()
|
1986
2004
|
});
|
1987
2005
|
}
|
1988
2006
|
function setExpandCellInfo(aiTable, expandCellInfo) {
|
2007
|
+
aiTable.expendCell.set({
|
2008
|
+
...aiTable.expendCell(),
|
2009
|
+
...expandCellInfo
|
2010
|
+
});
|
2011
|
+
}
|
2012
|
+
function expandCell(aiTable, cellPath) {
|
2013
|
+
setExpandCellInfo(aiTable, { path: cellPath });
|
2014
|
+
}
|
2015
|
+
function closeExpendCell(aiTable) {
|
2016
|
+
setExpandCellInfo(aiTable, { path: null, width: undefined, height: undefined });
|
2017
|
+
}
|
2018
|
+
function setSelection(aiTable, selection) {
|
2019
|
+
aiTable.selection.set({
|
2020
|
+
...aiTable.selection(),
|
2021
|
+
...selection
|
2022
|
+
});
|
2023
|
+
}
|
2024
|
+
function setActiveCell(aiTable, activeCell) {
|
1989
2025
|
aiTable.selection.set({
|
1990
2026
|
...aiTable.selection(),
|
1991
|
-
|
2027
|
+
...activeCell
|
2028
|
+
});
|
2029
|
+
}
|
2030
|
+
function setEditingCell(aiTable, editingCell) {
|
2031
|
+
aiTable.editingCell.set({
|
2032
|
+
...aiTable.editingCell(),
|
2033
|
+
...editingCell
|
2034
|
+
});
|
2035
|
+
}
|
2036
|
+
function closeEditingCell(aiTable) {
|
2037
|
+
setEditingCell(aiTable, { path: null });
|
2038
|
+
}
|
2039
|
+
function selectCells(aiTable, startCell, endCell, activeCell) {
|
2040
|
+
const [startRecordId, startFieldId] = startCell;
|
2041
|
+
const records = aiTable.context.linearRows();
|
2042
|
+
const fields = AITable.getVisibleFields(aiTable);
|
2043
|
+
const selectedCells = new Set();
|
2044
|
+
if (!endCell) {
|
2045
|
+
selectedCells.add(`${startRecordId}:${startFieldId}`);
|
2046
|
+
}
|
2047
|
+
else {
|
2048
|
+
// 数据的存储设计结构,决定了最后一条就是endCell
|
2049
|
+
const lastItem = Array.from(aiTable.selection().selectedCells).pop();
|
2050
|
+
if (endCell.join(':') === lastItem) {
|
2051
|
+
return;
|
2052
|
+
}
|
2053
|
+
const [endRecordId, endFieldId] = endCell;
|
2054
|
+
const startRowIndex = aiTable.context.visibleRowsIndexMap().get(startRecordId);
|
2055
|
+
const endRowIndex = aiTable.context.visibleRowsIndexMap().get(endRecordId);
|
2056
|
+
const startColIndex = aiTable.context.visibleColumnsIndexMap().get(startFieldId);
|
2057
|
+
const endColIndex = aiTable.context.visibleColumnsIndexMap().get(endFieldId);
|
2058
|
+
const minRowIndex = Math.min(startRowIndex, endRowIndex);
|
2059
|
+
const maxRowIndex = Math.max(startRowIndex, endRowIndex);
|
2060
|
+
const minColIndex = Math.min(startColIndex, endColIndex);
|
2061
|
+
const maxColIndex = Math.max(startColIndex, endColIndex);
|
2062
|
+
for (let i = minRowIndex; i <= maxRowIndex; i++) {
|
2063
|
+
for (let j = minColIndex; j <= maxColIndex; j++) {
|
2064
|
+
selectedCells.add(`${records[i]._id}:${fields[j]._id}`);
|
2065
|
+
}
|
2066
|
+
}
|
2067
|
+
}
|
2068
|
+
clearSelection(aiTable);
|
2069
|
+
setSelection(aiTable, {
|
2070
|
+
activeCell: activeCell || startCell,
|
2071
|
+
selectedCells: selectedCells
|
1992
2072
|
});
|
1993
2073
|
}
|
1994
2074
|
|
@@ -3227,6 +3307,17 @@ const FieldModelMap = {
|
|
3227
3307
|
[AITableFieldType.attachment]: new AttachmentField(),
|
3228
3308
|
[AITableFieldType.checkbox]: new CheckboxField()
|
3229
3309
|
};
|
3310
|
+
function selectField(aiTable, fieldId) {
|
3311
|
+
if (aiTable.selection().selectedFields.has(fieldId)) {
|
3312
|
+
return;
|
3313
|
+
}
|
3314
|
+
aiTable.selection.set({
|
3315
|
+
selectedRecords: new Set(),
|
3316
|
+
selectedFields: new Set([fieldId]),
|
3317
|
+
selectedCells: new Set(),
|
3318
|
+
activeCell: null
|
3319
|
+
});
|
3320
|
+
}
|
3230
3321
|
|
3231
3322
|
const aiTableFragmentAttribute = 'ai-table-fragment';
|
3232
3323
|
const buildClipboardData = (aiTable) => {
|
@@ -4778,24 +4869,10 @@ class CoverCellBase {
|
|
4778
4869
|
constructor() {
|
4779
4870
|
this.config = input();
|
4780
4871
|
this.onlyDisplayBorder = input(false);
|
4781
|
-
this.height = computed(() => {
|
4782
|
-
const { render } = this.config();
|
4783
|
-
return render.rowHeight;
|
4784
|
-
});
|
4785
4872
|
this.isExpand = computed(() => {
|
4786
4873
|
const { isExpand } = this.config();
|
4787
4874
|
return isExpand;
|
4788
4875
|
});
|
4789
|
-
effect(() => {
|
4790
|
-
const height = this.height();
|
4791
|
-
if (this.isExpand()) {
|
4792
|
-
untracked(() => {
|
4793
|
-
const { render, aiTable } = this.config();
|
4794
|
-
const { columnWidth } = render;
|
4795
|
-
setExpandCellInfo(aiTable, { width: columnWidth, height });
|
4796
|
-
});
|
4797
|
-
}
|
4798
|
-
});
|
4799
4876
|
}
|
4800
4877
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: CoverCellBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4801
4878
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: CoverCellBase, isStandalone: true, selector: "ai-table-cover-cell-base", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, onlyDisplayBorder: { classPropertyName: "onlyDisplayBorder", publicName: "onlyDisplayBorder", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
@@ -4807,7 +4884,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
4807
4884
|
template: '',
|
4808
4885
|
changeDetection: ChangeDetectionStrategy.OnPush
|
4809
4886
|
}]
|
4810
|
-
}]
|
4887
|
+
}] });
|
4811
4888
|
|
4812
4889
|
class AITableCellLink extends CoverCellBase {
|
4813
4890
|
constructor() {
|
@@ -5210,7 +5287,7 @@ const createActiveCellBorder = (config) => {
|
|
5210
5287
|
!!activeCell.length &&
|
5211
5288
|
aiTable.context.visibleRowsIndexMap().has(activeCell[0]) &&
|
5212
5289
|
aiTable.context.visibleColumnsIndexMap().has(activeCell[1]) &&
|
5213
|
-
!aiTable.
|
5290
|
+
!aiTable.expendCell()?.path) {
|
5214
5291
|
const fieldId = activeCell[1];
|
5215
5292
|
const { rowIndex, columnIndex } = AITable.getCellIndex(aiTable, activeCell);
|
5216
5293
|
const checkIsVisible = (rowIndex, columnIndex) => {
|
@@ -7412,7 +7489,13 @@ class AITableFrozenColumnHeads {
|
|
7412
7489
|
const config = this.config();
|
7413
7490
|
if (!config)
|
7414
7491
|
return false;
|
7415
|
-
|
7492
|
+
const selectedRecords = config.aiTable.selection().selectedRecords;
|
7493
|
+
const selectedAllState = selectedRecords.size === config.aiTable.records().length
|
7494
|
+
? AITableSelectAllState.all
|
7495
|
+
: selectedRecords.size === 0
|
7496
|
+
? AITableSelectAllState.none
|
7497
|
+
: AITableSelectAllState.partial;
|
7498
|
+
return selectedAllState === AITableSelectAllState.all;
|
7416
7499
|
});
|
7417
7500
|
this.fieldHeadHeight = computed(() => {
|
7418
7501
|
const coord = this.coordinate();
|
@@ -8365,9 +8448,6 @@ class AITableScrollableGroup {
|
|
8365
8448
|
this.rootGroup.getNode().moveTo(this.parentContainer().getNode());
|
8366
8449
|
}
|
8367
8450
|
}
|
8368
|
-
stopBubble(e) {
|
8369
|
-
e.event.cancelBubble = true;
|
8370
|
-
}
|
8371
8451
|
verticalScrollbarClick(e) {
|
8372
8452
|
e.event.cancelBubble = true;
|
8373
8453
|
const { contentHeight, height } = this.config();
|
@@ -8456,13 +8536,7 @@ class AITableScrollableGroup {
|
|
8456
8536
|
}
|
8457
8537
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableScrollableGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
8458
8538
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableScrollableGroup, isStandalone: true, selector: "ai-table-scrollable-group", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, contentTemplate: { classPropertyName: "contentTemplate", publicName: "contentTemplate", isSignal: true, isRequired: true, transformFunction: null }, parentContainer: { classPropertyName: "parentContainer", publicName: "parentContainer", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scrollPosition: "scrollPosition" }, viewQueries: [{ propertyName: "verticalTrack", first: true, predicate: ["verticalTrack"], descendants: true }, { propertyName: "verticalThumb", first: true, predicate: ["verticalThumb"], descendants: true }, { propertyName: "horizontalTrack", first: true, predicate: ["horizontalTrack"], descendants: true }, { propertyName: "contentGroup", first: true, predicate: ["contentGroup"], descendants: true }, { propertyName: "rootGroup", first: true, predicate: ["rootGroup"], descendants: true }], ngImport: i0, template: `
|
8459
|
-
<ko-group
|
8460
|
-
#rootGroup
|
8461
|
-
[config]="containerConfig()"
|
8462
|
-
(koWheel)="stageWheel($event)"
|
8463
|
-
(koMousedown)="stopBubble($event)"
|
8464
|
-
(koMouseup)="stopBubble($event)"
|
8465
|
-
>
|
8539
|
+
<ko-group #rootGroup [config]="containerConfig()" (koWheel)="stageWheel($event)">
|
8466
8540
|
<ko-group>
|
8467
8541
|
<ko-rect [config]="bgConfig()"></ko-rect>
|
8468
8542
|
</ko-group>
|
@@ -8514,13 +8588,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8514
8588
|
args: [{
|
8515
8589
|
selector: 'ai-table-scrollable-group',
|
8516
8590
|
template: `
|
8517
|
-
<ko-group
|
8518
|
-
#rootGroup
|
8519
|
-
[config]="containerConfig()"
|
8520
|
-
(koWheel)="stageWheel($event)"
|
8521
|
-
(koMousedown)="stopBubble($event)"
|
8522
|
-
(koMouseup)="stopBubble($event)"
|
8523
|
-
>
|
8591
|
+
<ko-group #rootGroup [config]="containerConfig()" (koWheel)="stageWheel($event)">
|
8524
8592
|
<ko-group>
|
8525
8593
|
<ko-rect [config]="bgConfig()"></ko-rect>
|
8526
8594
|
</ko-group>
|
@@ -8593,7 +8661,7 @@ class AITableFillHandle {
|
|
8593
8661
|
const { aiTable, readonly } = this.config();
|
8594
8662
|
const selection = aiTable.selection();
|
8595
8663
|
const hasSelectedCells = selection.selectedCells.size > 0;
|
8596
|
-
const isEditingCell =
|
8664
|
+
const isEditingCell = !!aiTable.editingCell()?.path;
|
8597
8665
|
return hasSelectedCells && !readonly && !isEditingCell;
|
8598
8666
|
});
|
8599
8667
|
this.handleConfig = computed(() => {
|
@@ -8608,7 +8676,12 @@ class AITableFillHandle {
|
|
8608
8676
|
const rowOffset = coordinate.getRowOffset(rowIndex);
|
8609
8677
|
const width = 6;
|
8610
8678
|
const height = 6;
|
8611
|
-
const
|
8679
|
+
const [expandRecordId, expandFieldId] = aiTable.expendCell()?.path || [null, null];
|
8680
|
+
const cellHeight = expandRecordId === recordId && expandFieldId === fieldId && aiTable.expendCell()?.height
|
8681
|
+
? aiTable.expendCell()?.height
|
8682
|
+
? aiTable.expendCell().height + AI_TABLE_CELL_LINE_BORDER
|
8683
|
+
: AI_TABLE_ROW_HEIGHT
|
8684
|
+
: AI_TABLE_ROW_HEIGHT;
|
8612
8685
|
return {
|
8613
8686
|
x: columnOffset + columnWidth - width / 2 + AI_TABLE_OFFSET,
|
8614
8687
|
y: rowOffset + cellHeight - height + AI_TABLE_CELL_BORDER + AI_TABLE_OFFSET,
|
@@ -9451,7 +9524,7 @@ class AITableRenderer {
|
|
9451
9524
|
let expandCellBorder = false;
|
9452
9525
|
let frozenExpandCellBorder = false;
|
9453
9526
|
const { aiTable } = this.config();
|
9454
|
-
const expandCellPath = aiTable.
|
9527
|
+
const expandCellPath = aiTable.expendCell()?.path;
|
9455
9528
|
if (expandCellPath) {
|
9456
9529
|
const { rowIndex, columnIndex } = AITable.getCellIndex(aiTable, expandCellPath);
|
9457
9530
|
const isFrozenColumn = columnIndex < aiTable.context.frozenColumnCount();
|
@@ -9998,8 +10071,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9998
10071
|
}] });
|
9999
10072
|
|
10000
10073
|
class AITableCellText extends CoverCellBase {
|
10074
|
+
static { this.fieldType = AITableFieldType.text; }
|
10001
10075
|
constructor() {
|
10002
|
-
super(
|
10076
|
+
super();
|
10003
10077
|
this.expandBorderConfig = computed(() => {
|
10004
10078
|
const { render, field, recordId, readonly, isExpand } = this.config();
|
10005
10079
|
const { columnWidth } = render;
|
@@ -10123,9 +10197,18 @@ class AITableCellText extends CoverCellBase {
|
|
10123
10197
|
}
|
10124
10198
|
return;
|
10125
10199
|
});
|
10200
|
+
effect(() => {
|
10201
|
+
const height = this.height();
|
10202
|
+
if (this.isExpand()) {
|
10203
|
+
untracked(() => {
|
10204
|
+
const { render, aiTable } = this.config();
|
10205
|
+
const { columnWidth } = render;
|
10206
|
+
setExpandCellInfo(aiTable, { width: columnWidth, height });
|
10207
|
+
});
|
10208
|
+
}
|
10209
|
+
});
|
10126
10210
|
}
|
10127
|
-
static { this
|
10128
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
10211
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
10129
10212
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellText, isStandalone: true, selector: "ai-table-single-text", usesInheritance: true, ngImport: i0, template: `
|
10130
10213
|
<ko-group>
|
10131
10214
|
@if (isExpand()) {
|
@@ -10178,7 +10261,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
10178
10261
|
imports: [AITableTextComponent, KoShape, KoContainer, AITableScrollableGroup],
|
10179
10262
|
changeDetection: ChangeDetectionStrategy.OnPush
|
10180
10263
|
}]
|
10181
|
-
}] });
|
10264
|
+
}], ctorParameters: () => [] });
|
10182
10265
|
|
10183
10266
|
// TODO: components下的cells组件考虑移出 components ,这些组件都属于
|
10184
10267
|
|
@@ -10202,10 +10285,10 @@ function getCoverCell(aiTable) {
|
|
10202
10285
|
const pointPosition = aiTable.context.pointPosition();
|
10203
10286
|
let fieldId;
|
10204
10287
|
let recordId;
|
10205
|
-
const
|
10206
|
-
if (
|
10207
|
-
fieldId =
|
10208
|
-
recordId =
|
10288
|
+
const expandCellPath = aiTable.expendCell()?.path;
|
10289
|
+
if (expandCellPath) {
|
10290
|
+
fieldId = expandCellPath[1];
|
10291
|
+
recordId = expandCellPath[0];
|
10209
10292
|
}
|
10210
10293
|
else {
|
10211
10294
|
const { fieldId: fieldIdDetail, recordId: recordIdDetail } = getDetailByTargetName(pointPosition.realTargetName) ?? {};
|
@@ -10232,7 +10315,7 @@ function getCoverCell(aiTable) {
|
|
10232
10315
|
field,
|
10233
10316
|
recordId,
|
10234
10317
|
fieldId,
|
10235
|
-
isExpand: !!
|
10318
|
+
isExpand: !!expandCellPath,
|
10236
10319
|
renderComponentDefinition
|
10237
10320
|
};
|
10238
10321
|
}
|
@@ -10460,6 +10543,32 @@ function getStartAndEndCell(selectedCells) {
|
|
10460
10543
|
return { startCell, endCell };
|
10461
10544
|
}
|
10462
10545
|
|
10546
|
+
function toggleSelectRecord(aiTable, recordId) {
|
10547
|
+
if (aiTable.selection().selectedRecords.has(recordId)) {
|
10548
|
+
aiTable.selection().selectedRecords.delete(recordId);
|
10549
|
+
}
|
10550
|
+
else {
|
10551
|
+
aiTable.selection().selectedRecords.add(recordId);
|
10552
|
+
}
|
10553
|
+
const selectedRecords = aiTable.selection().selectedRecords;
|
10554
|
+
aiTable.selection.set({
|
10555
|
+
selectedRecords: selectedRecords,
|
10556
|
+
selectedFields: new Set(),
|
10557
|
+
selectedCells: new Set(),
|
10558
|
+
activeCell: null
|
10559
|
+
});
|
10560
|
+
}
|
10561
|
+
function toggleSelectAllRecords(aiTable, checked) {
|
10562
|
+
if (checked) {
|
10563
|
+
setSelection(aiTable, {
|
10564
|
+
selectedRecords: new Set(aiTable.records().map((item) => item._id))
|
10565
|
+
});
|
10566
|
+
}
|
10567
|
+
else {
|
10568
|
+
clearSelection(aiTable);
|
10569
|
+
}
|
10570
|
+
}
|
10571
|
+
|
10463
10572
|
class NumberCellEditorComponent extends AbstractEditCellEditor {
|
10464
10573
|
updateValue() {
|
10465
10574
|
if (this.modelValue === '') {
|
@@ -10903,157 +11012,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
10903
11012
|
}, template: "<form thyForm name=\"createPropertyForm\" [thyFormValidatorConfig]=\"validatorConfig()\" thyLayout=\"vertical\">\n <thy-form-group thyLabelRequired [thyLabelText]=\"i18nTexts().columnName\">\n <thy-input-group>\n <input\n thyInput\n [thyAutofocus]=\"true\"\n name=\"fieldName\"\n [maxlength]=\"fieldMaxLength\"\n [(ngModel)]=\"aiEditField().name\"\n (ngModelChange)=\"nameChange($event)\"\n required\n [placeholder]=\"i18nTexts().columnNamePlaceholder\"\n [thyUniqueCheck]=\"checkUniqueName\"\n />\n <ng-template #suffix>\n <thy-input-count></thy-input-count>\n </ng-template>\n </thy-input-group>\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().fieldType\">\n <div class=\"thy-dropdown-menu py-0\">\n <div class=\"ml-n5 mr-n5\">\n <span thyDropdownMenuItem [thyDropdown]=\"menu\" thyTrigger=\"hover\" thyPlacement=\"right\" (click)=\"fieldTypeClick($event)\">\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"selectedFieldOption().icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ selectedFieldOption().name }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\" class=\"text-desc\"></thy-icon>\n </span>\n </div>\n </div>\n\n @if (selectedFieldOption().type === aITableFieldType.member) {\n <div class=\"d-flex justify-content-between mt-3\">\n {{ i18nTexts().allowMultipleMembers }}\n <thy-switch\n name=\"isMultipleMember\"\n [(ngModel)]=\"isMultipleMember\"\n (ngModelChange)=\"multipleMemberChange()\"\n thySize=\"sm\"\n ></thy-switch>\n </div>\n }\n </thy-form-group>\n @if (aiExternalTemplate()) {\n <ng-container *ngTemplateOutlet=\"aiExternalTemplate()\"></ng-container>\n }\n <thy-form-group-footer thyAlign=\"right\">\n <button thyButton=\"link-secondary\" (click)=\"cancel()\" thySize=\"sm\">{{ i18nTexts().cancel }}</button>\n <button thyButton=\"primary\" (thyFormSubmit)=\"editFieldProperty()\" thySize=\"sm\">{{ i18nTexts().confirm }}</button>\n </thy-form-group-footer>\n</form>\n\n<thy-dropdown-menu #menu>\n <div class=\"ai-table-field-type-menu\">\n <thy-dropdown-menu-group [thyTitle]=\"i18nTexts().base\">\n @for (item of fieldOptions().base; track $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: (item | fieldIsSameOption: aiEditField())\n }\"\n (click)=\"selectFieldType(item)\"\n >\n <thy-icon [thyIconName]=\"item.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ item.name }}</span>\n </a>\n }\n </thy-dropdown-menu-group>\n <thy-dropdown-menu-group [thyTitle]=\"i18nTexts().advanced\">\n @for (item of fieldOptions().advanced; track $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: (item | fieldIsSameOption: aiEditField())\n }\"\n (click)=\"selectFieldType(item)\"\n >\n <thy-icon [thyIconName]=\"item.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ item.name }}</span>\n </a>\n }\n </thy-dropdown-menu-group>\n </div>\n</thy-dropdown-menu>\n", styles: [":host{width:350px}\n"] }]
|
10904
11013
|
}] });
|
10905
11014
|
|
10906
|
-
class AITableGridSelectionService {
|
10907
|
-
constructor() {
|
10908
|
-
this.selectAllState = computed(() => {
|
10909
|
-
const selectedRecords = this.aiTable.selection().selectedRecords;
|
10910
|
-
return selectedRecords.size === this.aiTable.records().length
|
10911
|
-
? AITableSelectAllState.all
|
10912
|
-
: selectedRecords.size === 0
|
10913
|
-
? AITableSelectAllState.none
|
10914
|
-
: AITableSelectAllState.partial;
|
10915
|
-
});
|
10916
|
-
}
|
10917
|
-
initialize(aiTable) {
|
10918
|
-
this.aiTable = aiTable;
|
10919
|
-
}
|
10920
|
-
clearSelection() {
|
10921
|
-
this.aiTable.selection.set({
|
10922
|
-
selectedRecords: new Set(),
|
10923
|
-
selectedFields: new Set(),
|
10924
|
-
selectedCells: new Set(),
|
10925
|
-
activeCell: null,
|
10926
|
-
expandCell: null,
|
10927
|
-
editingCell: null,
|
10928
|
-
selectAllState: AITableSelectAllState.none,
|
10929
|
-
expandCellInfo: null
|
10930
|
-
});
|
10931
|
-
}
|
10932
|
-
setActiveCell(activeCell) {
|
10933
|
-
this.aiTable.selection().activeCell = activeCell;
|
10934
|
-
}
|
10935
|
-
setExpandCell(expandCell) {
|
10936
|
-
this.aiTable.selection.set({
|
10937
|
-
...this.aiTable.selection(),
|
10938
|
-
expandCell: expandCell
|
10939
|
-
});
|
10940
|
-
}
|
10941
|
-
setEditingCell(editingCell) {
|
10942
|
-
this.aiTable.selection.set({
|
10943
|
-
...this.aiTable.selection(),
|
10944
|
-
editingCell: editingCell
|
10945
|
-
});
|
10946
|
-
}
|
10947
|
-
selectField(fieldId) {
|
10948
|
-
if (this.aiTable.selection().selectedFields.has(fieldId)) {
|
10949
|
-
return;
|
10950
|
-
}
|
10951
|
-
this.clearSelection();
|
10952
|
-
this.aiTable.selection().selectedFields.add(fieldId);
|
10953
|
-
}
|
10954
|
-
get selectedFields() {
|
10955
|
-
return this.aiTable.selection().selectedFields;
|
10956
|
-
}
|
10957
|
-
get selectedRecords() {
|
10958
|
-
return this.aiTable.selection().selectedRecords;
|
10959
|
-
}
|
10960
|
-
selectRecord(recordId) {
|
10961
|
-
if (this.aiTable.selection().selectedRecords.has(recordId)) {
|
10962
|
-
this.aiTable.selection().selectedRecords.delete(recordId);
|
10963
|
-
}
|
10964
|
-
else {
|
10965
|
-
this.aiTable.selection().selectedRecords.add(recordId);
|
10966
|
-
}
|
10967
|
-
const selectedRecords = this.aiTable.selection().selectedRecords;
|
10968
|
-
this.aiTable.selection.set({
|
10969
|
-
selectedRecords: selectedRecords,
|
10970
|
-
selectedFields: new Set(),
|
10971
|
-
selectedCells: new Set(),
|
10972
|
-
activeCell: null,
|
10973
|
-
expandCell: null,
|
10974
|
-
editingCell: null,
|
10975
|
-
selectAllState: this.selectAllState()
|
10976
|
-
});
|
10977
|
-
}
|
10978
|
-
toggleSelectAll(checked) {
|
10979
|
-
if (checked) {
|
10980
|
-
if (this.aiTable.records().length === 0) {
|
10981
|
-
this.aiTable.selection.set({
|
10982
|
-
...this.aiTable.selection(),
|
10983
|
-
selectAllState: AITableSelectAllState.all
|
10984
|
-
});
|
10985
|
-
}
|
10986
|
-
else {
|
10987
|
-
this.aiTable.records().forEach((item) => {
|
10988
|
-
this.selectRecord(item._id);
|
10989
|
-
});
|
10990
|
-
}
|
10991
|
-
}
|
10992
|
-
else {
|
10993
|
-
this.clearSelection();
|
10994
|
-
}
|
10995
|
-
}
|
10996
|
-
updateSelect(event) {
|
10997
|
-
const target = event?.target;
|
10998
|
-
if (!target) {
|
10999
|
-
return;
|
11000
|
-
}
|
11001
|
-
const cellDom = target.closest('.grid-cell');
|
11002
|
-
const colDom = target.closest('.grid-field');
|
11003
|
-
const checkbox = target.tagName === 'INPUT' && target.type === 'checkbox' && target.closest('.grid-checkbox');
|
11004
|
-
const fieldAction = target.closest('.grid-field-action');
|
11005
|
-
if (cellDom) {
|
11006
|
-
const fieldId = cellDom.getAttribute('fieldId');
|
11007
|
-
const recordId = cellDom.getAttribute('recordId');
|
11008
|
-
fieldId && recordId && this.selectCells([recordId, fieldId]);
|
11009
|
-
}
|
11010
|
-
if (colDom && !fieldAction) {
|
11011
|
-
const fieldId = colDom.getAttribute('fieldId');
|
11012
|
-
fieldId && this.selectField(fieldId);
|
11013
|
-
}
|
11014
|
-
if (!cellDom && !colDom && !checkbox) {
|
11015
|
-
this.clearSelection();
|
11016
|
-
}
|
11017
|
-
}
|
11018
|
-
selectCells(startCell, endCell, activeCell) {
|
11019
|
-
const [startRecordId, startFieldId] = startCell;
|
11020
|
-
const records = this.aiTable.context.linearRows();
|
11021
|
-
const fields = AITable.getVisibleFields(this.aiTable);
|
11022
|
-
const selectedCells = new Set();
|
11023
|
-
if (!endCell) {
|
11024
|
-
selectedCells.add(`${startRecordId}:${startFieldId}`);
|
11025
|
-
}
|
11026
|
-
else {
|
11027
|
-
const [endRecordId, endFieldId] = endCell;
|
11028
|
-
const startRowIndex = this.aiTable.context.visibleRowsIndexMap().get(startRecordId);
|
11029
|
-
const endRowIndex = this.aiTable.context.visibleRowsIndexMap().get(endRecordId);
|
11030
|
-
const startColIndex = this.aiTable.context.visibleColumnsIndexMap().get(startFieldId);
|
11031
|
-
const endColIndex = this.aiTable.context.visibleColumnsIndexMap().get(endFieldId);
|
11032
|
-
const minRowIndex = Math.min(startRowIndex, endRowIndex);
|
11033
|
-
const maxRowIndex = Math.max(startRowIndex, endRowIndex);
|
11034
|
-
const minColIndex = Math.min(startColIndex, endColIndex);
|
11035
|
-
const maxColIndex = Math.max(startColIndex, endColIndex);
|
11036
|
-
for (let i = minRowIndex; i <= maxRowIndex; i++) {
|
11037
|
-
for (let j = minColIndex; j <= maxColIndex; j++) {
|
11038
|
-
selectedCells.add(`${records[i]._id}:${fields[j]._id}`);
|
11039
|
-
}
|
11040
|
-
}
|
11041
|
-
}
|
11042
|
-
this.clearSelection();
|
11043
|
-
this.setActiveCell(activeCell || startCell);
|
11044
|
-
this.aiTable.selection().selectedCells = selectedCells;
|
11045
|
-
}
|
11046
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
11047
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridSelectionService }); }
|
11048
|
-
}
|
11049
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridSelectionService, decorators: [{
|
11050
|
-
type: Injectable
|
11051
|
-
}], ctorParameters: () => [] });
|
11052
|
-
|
11053
11015
|
class AITableContextMenu extends ThyDropdownAbstractMenu {
|
11054
11016
|
constructor() {
|
11055
11017
|
super(...arguments);
|
11056
|
-
this.aiTableGridSelectionService = inject(AITableGridSelectionService);
|
11057
11018
|
this.notifyService = inject(ThyNotifyService);
|
11058
11019
|
this.thyPopoverRef = inject(ThyPopoverRef);
|
11059
11020
|
this.aiTable = input.required();
|
@@ -11064,8 +11025,7 @@ class AITableContextMenu extends ThyDropdownAbstractMenu {
|
|
11064
11025
|
}
|
11065
11026
|
execute(menu) {
|
11066
11027
|
if ((menu.disabled && !menu.disabled(this.aiTable(), this.targetName(), this.position())) || !menu.disabled) {
|
11067
|
-
menu.exec &&
|
11068
|
-
menu.exec(this.aiTable(), this.targetName(), this.position(), this.aiTableGridSelectionService, this.notifyService, menu.count);
|
11028
|
+
menu.exec && menu.exec(this.aiTable(), this.targetName(), this.position(), this.notifyService, menu.count);
|
11069
11029
|
}
|
11070
11030
|
}
|
11071
11031
|
inputNumberFocus(e) {
|
@@ -11115,7 +11075,6 @@ class AITableGridEventService {
|
|
11115
11075
|
this.globalMousedownEvent$ = new Subject();
|
11116
11076
|
this.destroyRef = inject(DestroyRef);
|
11117
11077
|
this.thyPopover = inject(ThyPopover);
|
11118
|
-
this.selectionService = inject(AITableGridSelectionService);
|
11119
11078
|
}
|
11120
11079
|
initialize(aiTable, aiFieldRenderers) {
|
11121
11080
|
this.aiTable = aiTable;
|
@@ -11234,7 +11193,7 @@ class AITableGridEventService {
|
|
11234
11193
|
const fieldType = this.aiTable.fieldsMap()[fieldId].type;
|
11235
11194
|
const { component, isInternalComponent } = this.getEditorComponent(fieldType);
|
11236
11195
|
const offsetOriginPosition = this.getOriginPosition(aiTable, options);
|
11237
|
-
|
11196
|
+
setEditingCell(aiTable, { path: [recordId, fieldId] });
|
11238
11197
|
this.cellEditorPopoverRef = this.thyPopover.open(component, {
|
11239
11198
|
viewContainerRef: isInternalComponent ? undefined : options?.viewContainerRef,
|
11240
11199
|
origin: container,
|
@@ -11282,7 +11241,7 @@ class AITableGridEventService {
|
|
11282
11241
|
this.cellEditorPopoverRef.afterClosed().subscribe(() => {
|
11283
11242
|
wheelEvent.unsubscribe();
|
11284
11243
|
this.cellEditorPopoverRef = null;
|
11285
|
-
this.
|
11244
|
+
closeEditingCell(this.aiTable);
|
11286
11245
|
});
|
11287
11246
|
this.cellEditorPopoverRef.componentInstance.updateFieldValues.subscribe((value) => {
|
11288
11247
|
options.updateFieldValues(value);
|
@@ -11294,7 +11253,7 @@ class AITableGridEventService {
|
|
11294
11253
|
if (this.cellEditorPopoverRef) {
|
11295
11254
|
this.cellEditorPopoverRef.close();
|
11296
11255
|
this.cellEditorPopoverRef = null;
|
11297
|
-
this.
|
11256
|
+
closeEditingCell(this.aiTable);
|
11298
11257
|
}
|
11299
11258
|
}
|
11300
11259
|
getCurrentEditCell() {
|
@@ -11484,7 +11443,6 @@ class AITableGridBase {
|
|
11484
11443
|
this.destroyRef = inject(DestroyRef);
|
11485
11444
|
this.aiTableGridFieldService = inject(AITableGridFieldService);
|
11486
11445
|
this.aiTableGridEventService = inject(AITableGridEventService);
|
11487
|
-
this.aiTableGridSelectionService = inject(AITableGridSelectionService);
|
11488
11446
|
}
|
11489
11447
|
ngOnInit() {
|
11490
11448
|
this.initAITable();
|
@@ -11502,7 +11460,6 @@ class AITableGridBase {
|
|
11502
11460
|
}
|
11503
11461
|
initService() {
|
11504
11462
|
this.aiTableGridEventService.initialize(this.aiTable, this.aiFieldConfig()?.fieldRenderers);
|
11505
|
-
this.aiTableGridSelectionService.initialize(this.aiTable);
|
11506
11463
|
this.aiTableGridEventService.registerEvents(this.elementRef.nativeElement);
|
11507
11464
|
this.aiTableGridFieldService.initAIFieldConfig(this.aiFieldConfig());
|
11508
11465
|
AI_TABLE_GRID_FIELD_SERVICE_MAP.set(this.aiTable, this.aiTableGridFieldService);
|
@@ -11515,11 +11472,11 @@ class AITableGridBase {
|
|
11515
11472
|
}
|
11516
11473
|
this.aiAddRecord.emit(options || {});
|
11517
11474
|
}
|
11518
|
-
|
11519
|
-
this.
|
11475
|
+
toggleSelectRecord(recordId) {
|
11476
|
+
toggleSelectRecord(this.aiTable, recordId);
|
11520
11477
|
}
|
11521
11478
|
toggleSelectAll(checked) {
|
11522
|
-
this.
|
11479
|
+
toggleSelectAllRecords(this.aiTable, checked);
|
11523
11480
|
}
|
11524
11481
|
addField(gridColumnBlank, position) {
|
11525
11482
|
if (this.aiMaxFields() && this.aiTable.fields().length >= this.aiMaxFields()) {
|
@@ -11549,11 +11506,6 @@ class AITableGridBase {
|
|
11549
11506
|
this.aiTableGridEventService.dblClickEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
|
11550
11507
|
this.dblClick(event);
|
11551
11508
|
});
|
11552
|
-
this.aiTableGridEventService.mousedownEvent$
|
11553
|
-
.pipe(mergeWith(this.aiTableGridEventService.globalMousedownEvent$), takeUntilDestroyed(this.destroyRef))
|
11554
|
-
.subscribe((event) => {
|
11555
|
-
this.aiTableGridSelectionService.updateSelect(event);
|
11556
|
-
});
|
11557
11509
|
});
|
11558
11510
|
}
|
11559
11511
|
dblClick(event) {
|
@@ -11590,7 +11542,7 @@ class AITableDomGrid extends AITableGridBase {
|
|
11590
11542
|
});
|
11591
11543
|
}
|
11592
11544
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableDomGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
11593
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableDomGrid, isStandalone: true, selector: "ai-table-dom-grid", host: { classAttribute: "ai-table-grid ai-table-dom-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], usesInheritance: true, ngImport: i0, template: "<div class=\"grid-header d-flex\">\n <div class=\"grid-column-checkbox grid-cell grid-checkbox\">\n <label thyCheckbox thyLabelText=\"\" [ngModel]=\"isSelectedAll()\" (ngModelChange)=\"toggleSelectAll($event)\"></label>\n </div>\n @for (field of gridData().fields; track field._id) {\n <div\n class=\"grid-cell grid-field\"\n #fieldAction\n [attr.fieldId]=\"field._id\"\n [ngClass]=\"{ highlight: aiTable.selection().selectedFields.has(field._id) }\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n <span class=\"text-truncate\">\n <thy-icon [thyIconName]=\"field.icon!\" class=\"mr-2 text-muted\"></thy-icon>\n <span>{{ field.name }}</span>\n </span>\n <a\n href=\"javascript:;\"\n class=\"grid-field-action\"\n thyAction\n thyIcon=\"more-vertical\"\n (click)=\"openFieldMenu($event, field, fieldAction)\"\n >\n </a>\n </div>\n }\n <div class=\"grid-column-blank cursor-pointer\" #gridColumnBlank (click)=\"addField(gridColumnBlank)\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n<div class=\"grid-body d-flex\">\n @for (record of gridData().records; track record._id; let index = $index) {\n <div class=\"grid-row d-flex\" [ngClass]=\"{ highlight: (record._id | isSelectRecord: aiTable.selection()) }\">\n <div class=\"grid-row-index grid-checkbox\">\n <label\n [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'checked-box' : 'unchecked-box'\"\n thyCheckbox\n thyLabelText=\"\"\n [ngModel]=\"record._id | isSelectRecord: aiTable.selection()\"\n (ngModelChange)=\"selectRecord(record._id)\"\n ></label>\n <span [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'grid-row-no-number' : 'grid-row-number'\">\n {{ index + 1 }}\n </span>\n </div>\n @for (field of gridData().fields; track field._id) {\n <!-- [ngClass]=\"{\n highlight: aiTable.selection().selectedCells.has(record._id) || aiTable.selection().selectedFields.has(field._id),\n selected: aiTable.selection().selectedCells.get(record._id)?.hasOwnProperty(field._id)\n }\" -->\n <div\n #cell\n class=\"grid-cell\"\n [attr.type]=\"[field.type]\"\n [attr.fieldId]=\"[field._id]\"\n [attr.recordId]=\"[record._id]\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n @switch (field.type) {\n @case (AITableFieldType.select) {\n @let fieldValue = record.values[field._id];\n @let settings = field.settings! | selectSetting;\n @let options = settings['options'];\n @let optionStyle = settings['option_style'] || AITableSelectOptionStyle.tag;\n @let isTagStyle = optionStyle === AITableSelectOptionStyle.tag;\n\n @if (!settings['is_multiple'] && fieldValue | selectOption: options; as selectedOption) {\n @if (isTagStyle) {\n <select-option class=\"mb-1 mr-1\" [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n </div>\n }\n } @else {\n @let maxShowCount = 2;\n\n <div class=\"d-flex\">\n @if (fieldValue | selectOptions: options; as selectedOptions) {\n @for (option of selectedOptions; track option!._id; let i = $index) {\n @if (i + 1 <= maxShowCount) {\n @if (isTagStyle) {\n <select-option\n class=\"mb-1 mr-1\"\n [field]=\"field\"\n [displayOption]=\"option!\"\n ></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"option!\"></select-option>\n </div>\n }\n }\n }\n\n @let selectedLength = selectedOptions.length || 0;\n @if (selectedOptions && maxShowCount < selectedLength) {\n @let shape = isTagStyle ? 'pill' : 'rectangle';\n @let isHidden = maxShowCount >= selectedLength;\n\n <thy-tag\n class=\"cursor-pointer\"\n [class.multi-property-value-hidden]=\"isHidden\"\n [thyShape]=\"shape\"\n >\n <span class=\"text-truncate\"> +{{ selectedLength - maxShowCount }} </span>\n </thy-tag>\n }\n }\n </div>\n }\n }\n @case (AITableFieldType.date) {\n {{ record.values[field._id].timestamp | thyDatePickerFormat }}\n }\n @case (AITableFieldType.updatedAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.createdAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.rate) {\n <thy-rate [ngModel]=\"record.values[field._id]\"></thy-rate>\n }\n @case (AITableFieldType.link) {\n <a\n class=\"d-block\"\n target=\"_blank\"\n [href]=\"record.values[field._id]?.url\"\n thyStopPropagation\n thyFlexibleText\n [thyTooltipContent]=\"record.values[field._id]?.text\"\n >\n {{ record.values[field._id]?.text }}\n </a>\n }\n @case (AITableFieldType.progress) {\n <thy-progress\n class=\"w-100\"\n [thyValue]=\"record.values[field._id] || 0\"\n [thySize]=\"record.values[field._id]?.config?.size || 'md'\"\n [thyMax]=\"record.values[field._id]?.config?.max || 100\"\n [thyType]=\"record.values[field._id]?.config?.progressType || 'success'\"\n >\n <span> {{ record.values[field._id] || 0 }}{{ record.values[field._id]?.config?.suffix || '%' }} </span>\n </thy-progress>\n }\n @case (AITableFieldType.member) {\n @let settings = field.settings! | memberSetting;\n\n @if (!settings!['is_multiple']) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n } @else {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n <thy-avatar-list thyAvatarSize=\"xs\">\n @for (item of recordValues; track $index) {\n <thy-avatar [thyName]=\"item.display_name!\" [thySrc]=\"item.avatar!\"></thy-avatar>\n }\n </thy-avatar-list>\n }\n }\n @case (AITableFieldType.createdBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @case (AITableFieldType.updatedBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @default {\n <span class=\"text-truncate\"> {{ record.values[field._id] }}</span>\n }\n }\n <div class=\"autofill-container\"></div>\n </div>\n }\n <div class=\"grid-column-blank\"></div>\n </div>\n }\n <div class=\"grid-row-insert grid-row cursor-pointer\" (click)=\"addRecord()\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n\n<div #activeBorder class=\"active-border\"></div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: SelectOptionPipe, name: "selectOption" }, { kind: "pipe", type: SelectOptionsPipe, name: "selectOptions" }, { kind: "component", type: ThyTag, selector: "thy-tag,[thyTag]", inputs: ["thyTag", "thyShape", "thyColor", "thyTheme", "thySize", "thyHoverable"] }, { kind: "ngmodule", type: ThyPopoverModule }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: ThyRate, selector: "thy-rate", inputs: ["thyCount", "thyDisabled", "thyAllowHalf", "thyAllowClear", "thyTooltips", "thyIconTemplate"], outputs: ["thyItemHoverChange"] }, { kind: "component", type: ThyProgress, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }, { kind: "pipe", type: ThyDatePickerFormatPipe, name: "thyDatePickerFormat" }, { kind: "component", type: ThyFlexibleText, selector: "thy-flexible-text,[thyFlexibleText]", inputs: ["thyTooltipTrigger", "thyContainerClass", "thyTooltipContent", "thyTooltipPlacement", "thyTooltipOffset"], exportAs: ["thyFlexibleText"] }, { kind: "directive", type: ThyStopPropagationDirective, selector: "[thyStopPropagation]", inputs: ["thyStopPropagation"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "ngmodule", type: ThyCheckboxModule }, { kind: "component", type: i3$1.ThyCheckbox, selector: "thy-checkbox,[thy-checkbox],[thyCheckbox]", inputs: ["thyIndeterminate"] }, { kind: "ngmodule", type: ThyAvatarModule }, { kind: "component", type: i4.ThyAvatar, selector: "thy-avatar", inputs: ["thyShowName", "thySrc", "thyName", "thySize", "thyShowRemove", "thyRemovable", "thyImgClass", "thyDisabled", "thyLoading", "thyFetchPriority"], outputs: ["thyOnRemove", "thyRemove", "thyError", "thySizeChange"] }, { kind: "component", type: i4.ThyAvatarList, selector: "thy-avatar-list", inputs: ["thyMode", "thyAvatarSize"] }, { kind: "pipe", type: IsSelectRecordPipe, name: "isSelectRecord" }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "pipe", type: UserPipe, name: "user" }, { kind: "pipe", type: SelectSettingPipe, name: "selectSetting" }, { kind: "pipe", type: MemberSettingPipe, name: "memberSetting" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
11545
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableDomGrid, isStandalone: true, selector: "ai-table-dom-grid", host: { classAttribute: "ai-table-grid ai-table-dom-grid" }, providers: [AITableGridEventService, AITableGridFieldService], usesInheritance: true, ngImport: i0, template: "<div class=\"grid-header d-flex\">\n <div class=\"grid-column-checkbox grid-cell grid-checkbox\">\n <label thyCheckbox thyLabelText=\"\" [ngModel]=\"isSelectedAll()\" (ngModelChange)=\"toggleSelectAll($event)\"></label>\n </div>\n @for (field of gridData().fields; track field._id) {\n <div\n class=\"grid-cell grid-field\"\n #fieldAction\n [attr.fieldId]=\"field._id\"\n [ngClass]=\"{ highlight: aiTable.selection().selectedFields.has(field._id) }\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n <span class=\"text-truncate\">\n <thy-icon [thyIconName]=\"field.icon!\" class=\"mr-2 text-muted\"></thy-icon>\n <span>{{ field.name }}</span>\n </span>\n <a\n href=\"javascript:;\"\n class=\"grid-field-action\"\n thyAction\n thyIcon=\"more-vertical\"\n (click)=\"openFieldMenu($event, field, fieldAction)\"\n >\n </a>\n </div>\n }\n <div class=\"grid-column-blank cursor-pointer\" #gridColumnBlank (click)=\"addField(gridColumnBlank)\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n<div class=\"grid-body d-flex\">\n @for (record of gridData().records; track record._id; let index = $index) {\n <div class=\"grid-row d-flex\" [ngClass]=\"{ highlight: (record._id | isSelectRecord: aiTable.selection()) }\">\n <div class=\"grid-row-index grid-checkbox\">\n <label\n [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'checked-box' : 'unchecked-box'\"\n thyCheckbox\n thyLabelText=\"\"\n [ngModel]=\"record._id | isSelectRecord: aiTable.selection()\"\n (ngModelChange)=\"toggleSelectRecord(record._id)\"\n ></label>\n <span [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'grid-row-no-number' : 'grid-row-number'\">\n {{ index + 1 }}\n </span>\n </div>\n @for (field of gridData().fields; track field._id) {\n <!-- [ngClass]=\"{\n highlight: aiTable.selection().selectedCells.has(record._id) || aiTable.selection().selectedFields.has(field._id),\n selected: aiTable.selection().selectedCells.get(record._id)?.hasOwnProperty(field._id)\n }\" -->\n <div\n #cell\n class=\"grid-cell\"\n [attr.type]=\"[field.type]\"\n [attr.fieldId]=\"[field._id]\"\n [attr.recordId]=\"[record._id]\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n @switch (field.type) {\n @case (AITableFieldType.select) {\n @let fieldValue = record.values[field._id];\n @let settings = field.settings! | selectSetting;\n @let options = settings['options'];\n @let optionStyle = settings['option_style'] || AITableSelectOptionStyle.tag;\n @let isTagStyle = optionStyle === AITableSelectOptionStyle.tag;\n\n @if (!settings['is_multiple'] && fieldValue | selectOption: options; as selectedOption) {\n @if (isTagStyle) {\n <select-option class=\"mb-1 mr-1\" [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n </div>\n }\n } @else {\n @let maxShowCount = 2;\n\n <div class=\"d-flex\">\n @if (fieldValue | selectOptions: options; as selectedOptions) {\n @for (option of selectedOptions; track option!._id; let i = $index) {\n @if (i + 1 <= maxShowCount) {\n @if (isTagStyle) {\n <select-option\n class=\"mb-1 mr-1\"\n [field]=\"field\"\n [displayOption]=\"option!\"\n ></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"option!\"></select-option>\n </div>\n }\n }\n }\n\n @let selectedLength = selectedOptions.length || 0;\n @if (selectedOptions && maxShowCount < selectedLength) {\n @let shape = isTagStyle ? 'pill' : 'rectangle';\n @let isHidden = maxShowCount >= selectedLength;\n\n <thy-tag\n class=\"cursor-pointer\"\n [class.multi-property-value-hidden]=\"isHidden\"\n [thyShape]=\"shape\"\n >\n <span class=\"text-truncate\"> +{{ selectedLength - maxShowCount }} </span>\n </thy-tag>\n }\n }\n </div>\n }\n }\n @case (AITableFieldType.date) {\n {{ record.values[field._id].timestamp | thyDatePickerFormat }}\n }\n @case (AITableFieldType.updatedAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.createdAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.rate) {\n <thy-rate [ngModel]=\"record.values[field._id]\"></thy-rate>\n }\n @case (AITableFieldType.link) {\n <a\n class=\"d-block\"\n target=\"_blank\"\n [href]=\"record.values[field._id]?.url\"\n thyStopPropagation\n thyFlexibleText\n [thyTooltipContent]=\"record.values[field._id]?.text\"\n >\n {{ record.values[field._id]?.text }}\n </a>\n }\n @case (AITableFieldType.progress) {\n <thy-progress\n class=\"w-100\"\n [thyValue]=\"record.values[field._id] || 0\"\n [thySize]=\"record.values[field._id]?.config?.size || 'md'\"\n [thyMax]=\"record.values[field._id]?.config?.max || 100\"\n [thyType]=\"record.values[field._id]?.config?.progressType || 'success'\"\n >\n <span> {{ record.values[field._id] || 0 }}{{ record.values[field._id]?.config?.suffix || '%' }} </span>\n </thy-progress>\n }\n @case (AITableFieldType.member) {\n @let settings = field.settings! | memberSetting;\n\n @if (!settings!['is_multiple']) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n } @else {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n <thy-avatar-list thyAvatarSize=\"xs\">\n @for (item of recordValues; track $index) {\n <thy-avatar [thyName]=\"item.display_name!\" [thySrc]=\"item.avatar!\"></thy-avatar>\n }\n </thy-avatar-list>\n }\n }\n @case (AITableFieldType.createdBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @case (AITableFieldType.updatedBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @default {\n <span class=\"text-truncate\"> {{ record.values[field._id] }}</span>\n }\n }\n <div class=\"autofill-container\"></div>\n </div>\n }\n <div class=\"grid-column-blank\"></div>\n </div>\n }\n <div class=\"grid-row-insert grid-row cursor-pointer\" (click)=\"addRecord()\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n\n<div #activeBorder class=\"active-border\"></div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: SelectOptionPipe, name: "selectOption" }, { kind: "pipe", type: SelectOptionsPipe, name: "selectOptions" }, { kind: "component", type: ThyTag, selector: "thy-tag,[thyTag]", inputs: ["thyTag", "thyShape", "thyColor", "thyTheme", "thySize", "thyHoverable"] }, { kind: "ngmodule", type: ThyPopoverModule }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: ThyRate, selector: "thy-rate", inputs: ["thyCount", "thyDisabled", "thyAllowHalf", "thyAllowClear", "thyTooltips", "thyIconTemplate"], outputs: ["thyItemHoverChange"] }, { kind: "component", type: ThyProgress, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }, { kind: "pipe", type: ThyDatePickerFormatPipe, name: "thyDatePickerFormat" }, { kind: "component", type: ThyFlexibleText, selector: "thy-flexible-text,[thyFlexibleText]", inputs: ["thyTooltipTrigger", "thyContainerClass", "thyTooltipContent", "thyTooltipPlacement", "thyTooltipOffset"], exportAs: ["thyFlexibleText"] }, { kind: "directive", type: ThyStopPropagationDirective, selector: "[thyStopPropagation]", inputs: ["thyStopPropagation"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "ngmodule", type: ThyCheckboxModule }, { kind: "component", type: i3$1.ThyCheckbox, selector: "thy-checkbox,[thy-checkbox],[thyCheckbox]", inputs: ["thyIndeterminate"] }, { kind: "ngmodule", type: ThyAvatarModule }, { kind: "component", type: i4.ThyAvatar, selector: "thy-avatar", inputs: ["thyShowName", "thySrc", "thyName", "thySize", "thyShowRemove", "thyRemovable", "thyImgClass", "thyDisabled", "thyLoading", "thyFetchPriority"], outputs: ["thyOnRemove", "thyRemove", "thyError", "thySizeChange"] }, { kind: "component", type: i4.ThyAvatarList, selector: "thy-avatar-list", inputs: ["thyMode", "thyAvatarSize"] }, { kind: "pipe", type: IsSelectRecordPipe, name: "isSelectRecord" }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "pipe", type: UserPipe, name: "user" }, { kind: "pipe", type: SelectSettingPipe, name: "selectSetting" }, { kind: "pipe", type: MemberSettingPipe, name: "memberSetting" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
11594
11546
|
}
|
11595
11547
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableDomGrid, decorators: [{
|
11596
11548
|
type: Component,
|
@@ -11618,7 +11570,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
11618
11570
|
UserPipe,
|
11619
11571
|
SelectSettingPipe,
|
11620
11572
|
MemberSettingPipe
|
11621
|
-
], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], template: "<div class=\"grid-header d-flex\">\n <div class=\"grid-column-checkbox grid-cell grid-checkbox\">\n <label thyCheckbox thyLabelText=\"\" [ngModel]=\"isSelectedAll()\" (ngModelChange)=\"toggleSelectAll($event)\"></label>\n </div>\n @for (field of gridData().fields; track field._id) {\n <div\n class=\"grid-cell grid-field\"\n #fieldAction\n [attr.fieldId]=\"field._id\"\n [ngClass]=\"{ highlight: aiTable.selection().selectedFields.has(field._id) }\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n <span class=\"text-truncate\">\n <thy-icon [thyIconName]=\"field.icon!\" class=\"mr-2 text-muted\"></thy-icon>\n <span>{{ field.name }}</span>\n </span>\n <a\n href=\"javascript:;\"\n class=\"grid-field-action\"\n thyAction\n thyIcon=\"more-vertical\"\n (click)=\"openFieldMenu($event, field, fieldAction)\"\n >\n </a>\n </div>\n }\n <div class=\"grid-column-blank cursor-pointer\" #gridColumnBlank (click)=\"addField(gridColumnBlank)\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n<div class=\"grid-body d-flex\">\n @for (record of gridData().records; track record._id; let index = $index) {\n <div class=\"grid-row d-flex\" [ngClass]=\"{ highlight: (record._id | isSelectRecord: aiTable.selection()) }\">\n <div class=\"grid-row-index grid-checkbox\">\n <label\n [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'checked-box' : 'unchecked-box'\"\n thyCheckbox\n thyLabelText=\"\"\n [ngModel]=\"record._id | isSelectRecord: aiTable.selection()\"\n (ngModelChange)=\"selectRecord(record._id)\"\n ></label>\n <span [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'grid-row-no-number' : 'grid-row-number'\">\n {{ index + 1 }}\n </span>\n </div>\n @for (field of gridData().fields; track field._id) {\n <!-- [ngClass]=\"{\n highlight: aiTable.selection().selectedCells.has(record._id) || aiTable.selection().selectedFields.has(field._id),\n selected: aiTable.selection().selectedCells.get(record._id)?.hasOwnProperty(field._id)\n }\" -->\n <div\n #cell\n class=\"grid-cell\"\n [attr.type]=\"[field.type]\"\n [attr.fieldId]=\"[field._id]\"\n [attr.recordId]=\"[record._id]\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n @switch (field.type) {\n @case (AITableFieldType.select) {\n @let fieldValue = record.values[field._id];\n @let settings = field.settings! | selectSetting;\n @let options = settings['options'];\n @let optionStyle = settings['option_style'] || AITableSelectOptionStyle.tag;\n @let isTagStyle = optionStyle === AITableSelectOptionStyle.tag;\n\n @if (!settings['is_multiple'] && fieldValue | selectOption: options; as selectedOption) {\n @if (isTagStyle) {\n <select-option class=\"mb-1 mr-1\" [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n </div>\n }\n } @else {\n @let maxShowCount = 2;\n\n <div class=\"d-flex\">\n @if (fieldValue | selectOptions: options; as selectedOptions) {\n @for (option of selectedOptions; track option!._id; let i = $index) {\n @if (i + 1 <= maxShowCount) {\n @if (isTagStyle) {\n <select-option\n class=\"mb-1 mr-1\"\n [field]=\"field\"\n [displayOption]=\"option!\"\n ></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"option!\"></select-option>\n </div>\n }\n }\n }\n\n @let selectedLength = selectedOptions.length || 0;\n @if (selectedOptions && maxShowCount < selectedLength) {\n @let shape = isTagStyle ? 'pill' : 'rectangle';\n @let isHidden = maxShowCount >= selectedLength;\n\n <thy-tag\n class=\"cursor-pointer\"\n [class.multi-property-value-hidden]=\"isHidden\"\n [thyShape]=\"shape\"\n >\n <span class=\"text-truncate\"> +{{ selectedLength - maxShowCount }} </span>\n </thy-tag>\n }\n }\n </div>\n }\n }\n @case (AITableFieldType.date) {\n {{ record.values[field._id].timestamp | thyDatePickerFormat }}\n }\n @case (AITableFieldType.updatedAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.createdAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.rate) {\n <thy-rate [ngModel]=\"record.values[field._id]\"></thy-rate>\n }\n @case (AITableFieldType.link) {\n <a\n class=\"d-block\"\n target=\"_blank\"\n [href]=\"record.values[field._id]?.url\"\n thyStopPropagation\n thyFlexibleText\n [thyTooltipContent]=\"record.values[field._id]?.text\"\n >\n {{ record.values[field._id]?.text }}\n </a>\n }\n @case (AITableFieldType.progress) {\n <thy-progress\n class=\"w-100\"\n [thyValue]=\"record.values[field._id] || 0\"\n [thySize]=\"record.values[field._id]?.config?.size || 'md'\"\n [thyMax]=\"record.values[field._id]?.config?.max || 100\"\n [thyType]=\"record.values[field._id]?.config?.progressType || 'success'\"\n >\n <span> {{ record.values[field._id] || 0 }}{{ record.values[field._id]?.config?.suffix || '%' }} </span>\n </thy-progress>\n }\n @case (AITableFieldType.member) {\n @let settings = field.settings! | memberSetting;\n\n @if (!settings!['is_multiple']) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n } @else {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n <thy-avatar-list thyAvatarSize=\"xs\">\n @for (item of recordValues; track $index) {\n <thy-avatar [thyName]=\"item.display_name!\" [thySrc]=\"item.avatar!\"></thy-avatar>\n }\n </thy-avatar-list>\n }\n }\n @case (AITableFieldType.createdBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @case (AITableFieldType.updatedBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @default {\n <span class=\"text-truncate\"> {{ record.values[field._id] }}</span>\n }\n }\n <div class=\"autofill-container\"></div>\n </div>\n }\n <div class=\"grid-column-blank\"></div>\n </div>\n }\n <div class=\"grid-row-insert grid-row cursor-pointer\" (click)=\"addRecord()\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n\n<div #activeBorder class=\"active-border\"></div>\n" }]
|
11573
|
+
], providers: [AITableGridEventService, AITableGridFieldService], template: "<div class=\"grid-header d-flex\">\n <div class=\"grid-column-checkbox grid-cell grid-checkbox\">\n <label thyCheckbox thyLabelText=\"\" [ngModel]=\"isSelectedAll()\" (ngModelChange)=\"toggleSelectAll($event)\"></label>\n </div>\n @for (field of gridData().fields; track field._id) {\n <div\n class=\"grid-cell grid-field\"\n #fieldAction\n [attr.fieldId]=\"field._id\"\n [ngClass]=\"{ highlight: aiTable.selection().selectedFields.has(field._id) }\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n <span class=\"text-truncate\">\n <thy-icon [thyIconName]=\"field.icon!\" class=\"mr-2 text-muted\"></thy-icon>\n <span>{{ field.name }}</span>\n </span>\n <a\n href=\"javascript:;\"\n class=\"grid-field-action\"\n thyAction\n thyIcon=\"more-vertical\"\n (click)=\"openFieldMenu($event, field, fieldAction)\"\n >\n </a>\n </div>\n }\n <div class=\"grid-column-blank cursor-pointer\" #gridColumnBlank (click)=\"addField(gridColumnBlank)\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n<div class=\"grid-body d-flex\">\n @for (record of gridData().records; track record._id; let index = $index) {\n <div class=\"grid-row d-flex\" [ngClass]=\"{ highlight: (record._id | isSelectRecord: aiTable.selection()) }\">\n <div class=\"grid-row-index grid-checkbox\">\n <label\n [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'checked-box' : 'unchecked-box'\"\n thyCheckbox\n thyLabelText=\"\"\n [ngModel]=\"record._id | isSelectRecord: aiTable.selection()\"\n (ngModelChange)=\"toggleSelectRecord(record._id)\"\n ></label>\n <span [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'grid-row-no-number' : 'grid-row-number'\">\n {{ index + 1 }}\n </span>\n </div>\n @for (field of gridData().fields; track field._id) {\n <!-- [ngClass]=\"{\n highlight: aiTable.selection().selectedCells.has(record._id) || aiTable.selection().selectedFields.has(field._id),\n selected: aiTable.selection().selectedCells.get(record._id)?.hasOwnProperty(field._id)\n }\" -->\n <div\n #cell\n class=\"grid-cell\"\n [attr.type]=\"[field.type]\"\n [attr.fieldId]=\"[field._id]\"\n [attr.recordId]=\"[record._id]\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n @switch (field.type) {\n @case (AITableFieldType.select) {\n @let fieldValue = record.values[field._id];\n @let settings = field.settings! | selectSetting;\n @let options = settings['options'];\n @let optionStyle = settings['option_style'] || AITableSelectOptionStyle.tag;\n @let isTagStyle = optionStyle === AITableSelectOptionStyle.tag;\n\n @if (!settings['is_multiple'] && fieldValue | selectOption: options; as selectedOption) {\n @if (isTagStyle) {\n <select-option class=\"mb-1 mr-1\" [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n </div>\n }\n } @else {\n @let maxShowCount = 2;\n\n <div class=\"d-flex\">\n @if (fieldValue | selectOptions: options; as selectedOptions) {\n @for (option of selectedOptions; track option!._id; let i = $index) {\n @if (i + 1 <= maxShowCount) {\n @if (isTagStyle) {\n <select-option\n class=\"mb-1 mr-1\"\n [field]=\"field\"\n [displayOption]=\"option!\"\n ></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"option!\"></select-option>\n </div>\n }\n }\n }\n\n @let selectedLength = selectedOptions.length || 0;\n @if (selectedOptions && maxShowCount < selectedLength) {\n @let shape = isTagStyle ? 'pill' : 'rectangle';\n @let isHidden = maxShowCount >= selectedLength;\n\n <thy-tag\n class=\"cursor-pointer\"\n [class.multi-property-value-hidden]=\"isHidden\"\n [thyShape]=\"shape\"\n >\n <span class=\"text-truncate\"> +{{ selectedLength - maxShowCount }} </span>\n </thy-tag>\n }\n }\n </div>\n }\n }\n @case (AITableFieldType.date) {\n {{ record.values[field._id].timestamp | thyDatePickerFormat }}\n }\n @case (AITableFieldType.updatedAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.createdAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.rate) {\n <thy-rate [ngModel]=\"record.values[field._id]\"></thy-rate>\n }\n @case (AITableFieldType.link) {\n <a\n class=\"d-block\"\n target=\"_blank\"\n [href]=\"record.values[field._id]?.url\"\n thyStopPropagation\n thyFlexibleText\n [thyTooltipContent]=\"record.values[field._id]?.text\"\n >\n {{ record.values[field._id]?.text }}\n </a>\n }\n @case (AITableFieldType.progress) {\n <thy-progress\n class=\"w-100\"\n [thyValue]=\"record.values[field._id] || 0\"\n [thySize]=\"record.values[field._id]?.config?.size || 'md'\"\n [thyMax]=\"record.values[field._id]?.config?.max || 100\"\n [thyType]=\"record.values[field._id]?.config?.progressType || 'success'\"\n >\n <span> {{ record.values[field._id] || 0 }}{{ record.values[field._id]?.config?.suffix || '%' }} </span>\n </thy-progress>\n }\n @case (AITableFieldType.member) {\n @let settings = field.settings! | memberSetting;\n\n @if (!settings!['is_multiple']) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n } @else {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n <thy-avatar-list thyAvatarSize=\"xs\">\n @for (item of recordValues; track $index) {\n <thy-avatar [thyName]=\"item.display_name!\" [thySrc]=\"item.avatar!\"></thy-avatar>\n }\n </thy-avatar-list>\n }\n }\n @case (AITableFieldType.createdBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @case (AITableFieldType.updatedBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @default {\n <span class=\"text-truncate\"> {{ record.values[field._id] }}</span>\n }\n }\n <div class=\"autofill-container\"></div>\n </div>\n }\n <div class=\"grid-column-blank\"></div>\n </div>\n }\n <div class=\"grid-row-insert grid-row cursor-pointer\" (click)=\"addRecord()\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n\n<div #activeBorder class=\"active-border\"></div>\n" }]
|
11622
11574
|
}] });
|
11623
11575
|
|
11624
11576
|
class AITableScrollControllerService {
|
@@ -11821,7 +11773,7 @@ class AITableDragComponent {
|
|
11821
11773
|
this.horizontalBar = input();
|
11822
11774
|
this.verticalBar = input();
|
11823
11775
|
this.dragEnd = output();
|
11824
|
-
this.
|
11776
|
+
this.aiTableGridEventService = inject(AITableGridEventService);
|
11825
11777
|
this.render2 = inject(Renderer2);
|
11826
11778
|
this.scrollControllerService = inject(AITableScrollControllerService);
|
11827
11779
|
this.elementRef = inject((ElementRef));
|
@@ -11886,7 +11838,7 @@ class AITableDragComponent {
|
|
11886
11838
|
});
|
11887
11839
|
}
|
11888
11840
|
handleDragStateChange() {
|
11889
|
-
const drag = this.
|
11841
|
+
const drag = this.aiTableGridEventService.aiTable.dragState?.();
|
11890
11842
|
if (!drag) {
|
11891
11843
|
this.aiTableDrag = null;
|
11892
11844
|
return;
|
@@ -11925,7 +11877,7 @@ class AITableDragComponent {
|
|
11925
11877
|
}
|
11926
11878
|
}
|
11927
11879
|
movingColumn(drag, moveX, direction) {
|
11928
|
-
const aiTable = this.
|
11880
|
+
const aiTable = this.aiTableGridEventService.aiTable;
|
11929
11881
|
const scroll = { x: this.horizontalBarElement?.scrollLeft || 0, y: 0 };
|
11930
11882
|
const coordinate = drag.coordinate;
|
11931
11883
|
const fields = aiTable.gridData().fields;
|
@@ -12052,7 +12004,7 @@ class AITableDragComponent {
|
|
12052
12004
|
}
|
12053
12005
|
movingColumnWidth(drag, moveX) {
|
12054
12006
|
this.setCursorStyle('col-resize');
|
12055
|
-
const aiTable = this.
|
12007
|
+
const aiTable = this.aiTableGridEventService.aiTable;
|
12056
12008
|
const visibleColumnIndexMap = aiTable.context.visibleColumnsIndexMap();
|
12057
12009
|
const sourceColumnIndex = visibleColumnIndexMap.get(drag.sourceIds.values().next().value) || 0;
|
12058
12010
|
const sourceColumnStartX = drag.coordinate.getColumnOffset(sourceColumnIndex);
|
@@ -12082,7 +12034,7 @@ class AITableDragComponent {
|
|
12082
12034
|
};
|
12083
12035
|
}
|
12084
12036
|
movingRecord(drag, moveY) {
|
12085
|
-
const aiTable = this.
|
12037
|
+
const aiTable = this.aiTableGridEventService.aiTable;
|
12086
12038
|
const scroll = { x: 0, y: this.verticalBarElement?.scrollTop || 0 };
|
12087
12039
|
const coordinate = drag.coordinate;
|
12088
12040
|
const visibleRowIndexMap = aiTable.context.visibleRowsIndexMap();
|
@@ -12458,8 +12410,7 @@ class AITableGrid extends AITableGridBase {
|
|
12458
12410
|
this.aiTable.selection.update((item) => {
|
12459
12411
|
return {
|
12460
12412
|
...item,
|
12461
|
-
selectedRecords
|
12462
|
-
selectAllState: this.aiTableGridSelectionService.selectAllState()
|
12413
|
+
selectedRecords
|
12463
12414
|
};
|
12464
12415
|
});
|
12465
12416
|
});
|
@@ -12571,7 +12522,7 @@ class AITableGrid extends AITableGridBase {
|
|
12571
12522
|
endCell = [recordId, fieldId];
|
12572
12523
|
}
|
12573
12524
|
if (startCell && !!startCell.length) {
|
12574
|
-
this.
|
12525
|
+
selectCells(this.aiTable, startCell, endCell, activeCell);
|
12575
12526
|
this.scrollViewToCell(pos, startCell, endCell, this.coordinate(), this.horizontalBarRef(), this.verticalBarRef());
|
12576
12527
|
}
|
12577
12528
|
}
|
@@ -12593,7 +12544,7 @@ class AITableGrid extends AITableGridBase {
|
|
12593
12544
|
mouseEvent.preventDefault();
|
12594
12545
|
if (!fieldId)
|
12595
12546
|
return;
|
12596
|
-
this.
|
12547
|
+
selectField(this.aiTable, fieldId);
|
12597
12548
|
this.handleFieldDragStart();
|
12598
12549
|
return;
|
12599
12550
|
case AI_TABLE_FIELD_HEAD_OPACITY_LINE:
|
@@ -12607,16 +12558,15 @@ class AITableGrid extends AITableGridBase {
|
|
12607
12558
|
return;
|
12608
12559
|
const startCell = [recordId, fieldId];
|
12609
12560
|
this.updateDragSelectState(true, startCell);
|
12610
|
-
const [expandRecordId, expandFieldId] = this.aiTable.
|
12561
|
+
const [expandRecordId, expandFieldId] = this.aiTable.expendCell()?.path || [null, null];
|
12611
12562
|
if (expandRecordId !== recordId || expandFieldId !== fieldId) {
|
12612
12563
|
const field = this.aiTable.fieldsMap()[fieldId];
|
12564
|
+
closeEditingCell(this.aiTable);
|
12565
|
+
selectCells(this.aiTable, startCell);
|
12566
|
+
closeExpendCell(this.aiTable);
|
12613
12567
|
if (field.type === AITableFieldType.text) {
|
12614
|
-
this.aiTableGridSelectionService.clearSelection();
|
12615
12568
|
expandCell(this.aiTable, [recordId, fieldId]);
|
12616
12569
|
}
|
12617
|
-
else {
|
12618
|
-
this.aiTableGridSelectionService.selectCells(startCell);
|
12619
|
-
}
|
12620
12570
|
}
|
12621
12571
|
return;
|
12622
12572
|
case AI_TABLE_FILL_HANDLE:
|
@@ -12650,7 +12600,7 @@ class AITableGrid extends AITableGridBase {
|
|
12650
12600
|
case AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX:
|
12651
12601
|
return;
|
12652
12602
|
default:
|
12653
|
-
this.
|
12603
|
+
clearCoverCell(this.aiTable);
|
12654
12604
|
}
|
12655
12605
|
}
|
12656
12606
|
stageMouseup(e) {
|
@@ -12740,23 +12690,23 @@ class AITableGrid extends AITableGridBase {
|
|
12740
12690
|
return;
|
12741
12691
|
switch (targetName) {
|
12742
12692
|
case AI_TABLE_ROW_ADD_BUTTON: {
|
12743
|
-
this.
|
12693
|
+
clearCoverCell(this.aiTable);
|
12744
12694
|
this.addRecord();
|
12745
12695
|
break;
|
12746
12696
|
}
|
12747
12697
|
case AI_TABLE_ROW_SELECT_CHECKBOX: {
|
12748
12698
|
const { rowIndex: pointRowIndex } = context.pointPosition();
|
12749
12699
|
const pointRecordId = context.linearRows()[pointRowIndex]?._id;
|
12750
|
-
this.
|
12700
|
+
this.toggleSelectRecord(pointRecordId);
|
12751
12701
|
break;
|
12752
12702
|
}
|
12753
12703
|
case AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX: {
|
12754
|
-
const isChecked = this.aiTable.selection().
|
12704
|
+
const isChecked = this.aiTable.selection().selectedRecords.size === this.aiTable.records().length;
|
12755
12705
|
this.toggleSelectAll(!isChecked);
|
12756
12706
|
break;
|
12757
12707
|
}
|
12758
12708
|
case AI_TABLE_FIELD_ADD_BUTTON: {
|
12759
|
-
this.
|
12709
|
+
clearCoverCell(this.aiTable);
|
12760
12710
|
const fieldGroupRect = e.event.target.getParent()?.getClientRect();
|
12761
12711
|
const containerRect = this.containerElement().getBoundingClientRect();
|
12762
12712
|
this.addField(this.containerElement(), {
|
@@ -12857,7 +12807,7 @@ class AITableGrid extends AITableGridBase {
|
|
12857
12807
|
!e.target.closest(AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS)), takeUntilDestroyed(this.destroyRef))
|
12858
12808
|
.subscribe(() => {
|
12859
12809
|
this.updateDragSelectState(false, null);
|
12860
|
-
this.
|
12810
|
+
clearCoverCell(this.aiTable);
|
12861
12811
|
});
|
12862
12812
|
}
|
12863
12813
|
updateDragSelectState(isDragging, startCell) {
|
@@ -12977,10 +12927,10 @@ class AITableGrid extends AITableGridBase {
|
|
12977
12927
|
});
|
12978
12928
|
}
|
12979
12929
|
handleFieldDragStart() {
|
12980
|
-
if (!this.aiReadonly() && this.
|
12930
|
+
if (!this.aiReadonly() && this.aiTable.selection().selectedFields.size > 0) {
|
12981
12931
|
this.setDragState({
|
12982
12932
|
type: DragType.field,
|
12983
|
-
sourceIds: this.
|
12933
|
+
sourceIds: this.aiTable.selection().selectedFields,
|
12984
12934
|
coordinate: this.coordinate()
|
12985
12935
|
});
|
12986
12936
|
}
|
@@ -13099,7 +13049,7 @@ class AITableGrid extends AITableGridBase {
|
|
13099
13049
|
newEndCell = [nextRecord._id, nextField._id];
|
13100
13050
|
newActiveCell = null;
|
13101
13051
|
}
|
13102
|
-
this.
|
13052
|
+
selectCells(this.aiTable, newStartCell, newEndCell, newActiveCell);
|
13103
13053
|
}
|
13104
13054
|
}
|
13105
13055
|
},
|
@@ -13110,18 +13060,18 @@ class AITableGrid extends AITableGridBase {
|
|
13110
13060
|
});
|
13111
13061
|
}
|
13112
13062
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
13113
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableGrid, isStandalone: true, selector: "ai-table-grid", host: { classAttribute: "ai-table-grid" }, providers: [AITableGridEventService, AITableGridFieldService,
|
13063
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableGrid, isStandalone: true, selector: "ai-table-grid", host: { classAttribute: "ai-table-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableScrollControllerService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "verticalBarRef", first: true, predicate: ["verticalBar"], descendants: true, isSignal: true }, { propertyName: "horizontalBarRef", first: true, predicate: ["horizontalBar"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n (koWheel)=\"stageWheel($event)\"\n >\n @if (domToolTips().length > 0) {\n <div\n class=\"ai-table-left-background-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n @for (domToolTip of domToolTips(); track trackBy(idx, domToolTip); let idx = $index) {\n <div\n class=\"ai-table-left-background\"\n [thyTooltip]=\"i18nTexts().rowAddFilterTooltip\"\n [style.--scroll-top.px]=\"domToolTip.top\"\n >\n <thy-icon class=\"text-white\" thyIconName=\"filter-line\"></thy-icon>\n </div>\n }\n </div>\n }\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n <ai-table-drag [horizontalBar]=\"horizontalBarRef()\" [verticalBar]=\"verticalBarRef()\" (dragEnd)=\"dragEnd($event)\"></ai-table-drag>\n</div>\n", dependencies: [{ kind: "component", type: AITableRenderer, selector: "ai-table-renderer", inputs: ["config"], outputs: ["koMousemove", "koMousedown", "koMouseup", "koContextmenu", "koWheel", "koClick", "koDblclick", "koMouseleave", "onScrollPosition"] }, { kind: "component", type: AITableDragComponent, selector: "ai-table-drag", inputs: ["horizontalBar", "verticalBar"], outputs: ["dragEnd"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
13114
13064
|
}
|
13115
13065
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGrid, decorators: [{
|
13116
13066
|
type: Component,
|
13117
13067
|
args: [{ selector: 'ai-table-grid', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
13118
13068
|
class: 'ai-table-grid'
|
13119
|
-
}, imports: [AITableRenderer, AITableDragComponent, ThyTooltipDirective, ThyIcon], providers: [AITableGridEventService, AITableGridFieldService,
|
13069
|
+
}, imports: [AITableRenderer, AITableDragComponent, ThyTooltipDirective, ThyIcon], providers: [AITableGridEventService, AITableGridFieldService, AITableScrollControllerService], template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n (koWheel)=\"stageWheel($event)\"\n >\n @if (domToolTips().length > 0) {\n <div\n class=\"ai-table-left-background-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n @for (domToolTip of domToolTips(); track trackBy(idx, domToolTip); let idx = $index) {\n <div\n class=\"ai-table-left-background\"\n [thyTooltip]=\"i18nTexts().rowAddFilterTooltip\"\n [style.--scroll-top.px]=\"domToolTip.top\"\n >\n <thy-icon class=\"text-white\" thyIconName=\"filter-line\"></thy-icon>\n </div>\n }\n </div>\n }\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n <ai-table-drag [horizontalBar]=\"horizontalBarRef()\" [verticalBar]=\"verticalBarRef()\" (dragEnd)=\"dragEnd($event)\"></ai-table-drag>\n</div>\n" }]
|
13120
13070
|
}], ctorParameters: () => [] });
|
13121
13071
|
|
13122
13072
|
/**
|
13123
13073
|
* Generated bundle index. Do not edit.
|
13124
13074
|
*/
|
13125
13075
|
|
13126
|
-
export { AITable, AITableActionIcon, AITableAddField, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableBackground, AITableCellAttachment, AITableCellCheckbox, AITableCellLink, AITableCellProgress, AITableCellRate, AITableCellRichText, AITableCellText, AITableCells, AITableCheckType, AITableColumnHeads, AITableContextMenu, AITableDomGrid, AITableFieldHead, AITableFieldIcon, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFrozenCells, AITableFrozenColumnHeads, AITableFrozenFieldShadow, AITableFrozenPlaceholderCells, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridI18nText,
|
13076
|
+
export { AITable, AITableActionIcon, AITableAddField, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableBackground, AITableCellAttachment, AITableCellCheckbox, AITableCellLink, AITableCellProgress, AITableCellRate, AITableCellRichText, AITableCellText, AITableCells, AITableCheckType, AITableColumnHeads, AITableContextMenu, AITableDomGrid, AITableFieldHead, AITableFieldIcon, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFrozenCells, AITableFrozenColumnHeads, AITableFrozenFieldShadow, AITableFrozenPlaceholderCells, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridI18nText, AITableHoverRowHeads, AITableIcon, AITableMemberType, AITableMouseDownType, AITableOtherRows, AITablePlaceholderCells, AITableQueries, AITableRenderer, AITableRowType, AITableScrollableGroup, AITableSelectAllState, AITableTextComponent, AI_TABLE_ACTION_COMMON_RADIUS, AI_TABLE_ACTION_COMMON_RIGHT_PADDING, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD, AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD, AI_TABLE_AUTO_SCROLL_RIGHT_THRESHOLD, AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_ATTACHMENT_ADD, AI_TABLE_CELL_ATTACHMENT_FILE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EDIT, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, AI_TABLE_CELL_FIELD_ITEM_HEIGHT, AI_TABLE_CELL_LINE_BORDER, AI_TABLE_CELL_MAX_ROW_COUNT, AI_TABLE_CELL_MEMBER_ITEM_HEIGHT, AI_TABLE_CELL_MEMBER_ITEM_PADDING, AI_TABLE_CELL_MEMBER_MAX_HEIGHT, AI_TABLE_CELL_MULTI_DOT_RADIUS, AI_TABLE_CELL_MULTI_ITEM_MARGIN_LEFT, AI_TABLE_CELL_MULTI_ITEM_MARGIN_TOP, AI_TABLE_CELL_MULTI_ITEM_MIN_WIDTH, AI_TABLE_CELL_MULTI_PADDING_LEFT, AI_TABLE_CELL_MULTI_PADDING_TOP, AI_TABLE_CELL_PADDING, AI_TABLE_COMMON_FONT_SIZE, AI_TABLE_DEFAULT_COLUMN_WIDTH, AI_TABLE_DOT_RADIUS, AI_TABLE_FIELD_ADD_BUTTON, AI_TABLE_FIELD_ADD_BUTTON_WIDTH, AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_HEIGHT, AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, AI_TABLE_FIELD_HEAD_MORE, AI_TABLE_FIELD_HEAD_OPACITY_LINE, AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX, AI_TABLE_FIELD_HEAD_TEXT_MIN_WIDTH, AI_TABLE_FIELD_ITEM_MARGIN_RIGHT, AI_TABLE_FIELD_MAX_WIDTH, AI_TABLE_FIELD_MIDDLE_WIDTH, AI_TABLE_FIELD_MINI_WIDTH, AI_TABLE_FIELD_MIN_WIDTH, AI_TABLE_FIELD_STAT_BG, AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT, AI_TABLE_FIELD_STAT_INNER_HEIGHT, AI_TABLE_FILE_ICON_ITEM_HEIGHT, AI_TABLE_FILE_ICON_SIZE, AI_TABLE_FILL_HANDLE, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, AI_TABLE_INDEX_FIELD_TEXT, AI_TABLE_MEMBER_AVATAR_SIZE, AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT, AI_TABLE_MEMBER_ITEM_PADDING_RIGHT, AI_TABLE_MIN_TEXT_WIDTH, AI_TABLE_OFFSET, AI_TABLE_OPTION_ITEM_FONT_SIZE, AI_TABLE_OPTION_ITEM_HEIGHT, AI_TABLE_OPTION_ITEM_PADDING, AI_TABLE_OPTION_ITEM_RADIUS, AI_TABLE_OPTION_MULTI_ITEM_FONT_SIZE, AI_TABLE_PIECE_RADIUS, AI_TABLE_PIECE_WIDTH, AI_TABLE_POPOVER_LEFT_OFFSET, AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS, AI_TABLE_PROGRESS_BAR_HEIGHT, AI_TABLE_PROGRESS_BAR_POINTER_HEIGHT, AI_TABLE_PROGRESS_BAR_POINTER_WIDTH, AI_TABLE_PROGRESS_BAR_RADIUS, AI_TABLE_PROGRESS_TEXT_WIDTH, AI_TABLE_RATE_MAX, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_DRAG, AI_TABLE_ROW_DRAG_ICON_WIDTH, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEAD_WIDTH_AND_DRAG_ICON_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_SCROLL_BAR_SIZE, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AI_TABLE_TEXT_LINE_HEIGHT, AbstractEditCellEditor, AddOutlinedPath, AngleDownPath, AttachmentField, AttachmentPath, CellDrawer, Check, Colors, ColumnCalendarFilledPath, ColumnCheckboxFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnRichTextFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, CoverCellBase, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DateField, DepartmentOutlinedPath, Drawer, EditPath, FONT_SIZE_SM, FieldModelMap, IconPathMap, IsSelectRecordPipe, KO_CONTAINER_TOKEN, KoComponent, KoContainer, KoShape, KoShapeTypes, KoStage, LinkCellEditorComponent, LinkField, MIN_COLUMN_WIDTH, MemberField, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, NumberField, ProgressField, RateField, RendererContext, RichTextField, RowDragPath, RowHeight, SelectCellEditorComponent, SelectField, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextField, TextMeasure, Unchecked, UserPipe, WebOutlinedPath, aiTableFragmentAttribute, aiTableImageConfigToKonvaConfig, aiTableRectConfigToKonvaConfig, aiTableTextConfigToKonvaConfig, applyNodeProps, buildClipboardData, buildGridData, buildGridLinearRows, castToString, cellDrawer, clearCells, clearCoverCell, clearSelectedCells, clearSelection, clearSelectionFields, clearSelectionRecords, closeEditingCell, closeExpendCell, compareNumber, compareOption, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, createListener, dragFillHighlightArea, drawer, expandCell, extractLinkUrl, extractText, generateNewName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getCoverCell, getDateFieldValues, getDefaultFieldOptions, getDefaultFieldValue, getDefaultI18nTextByKey, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getFieldOptionMap, getFieldOptions, getFieldValue, getFileThumbnailSvgString, getFillDirection, getHoverEditorBoxOffset, getHoverEditorSpace, getI18nTextByKey, getMousePosition, getName, getOptionsByFieldAndRecords, getPlaceHolderCellsConfigs, getStartAndEndCell, getSystemFieldValue, getTargetName, getTextWidth, getVisibleRangeInfo, graphemeSplitter, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isActiveCell, isArrayField, isCellMatchKeywords, isClipboardReadSupported, isClipboardReadTextSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isDateFiled, isEmptyOrNot, isMac, isMeetFilter, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isVirtualKey, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, performFill, processPastedValueForSelect, readFromClipboard, scrollMax, selectCells, selectField, setActiveCell, setEditingCell, setExpandCellInfo, setMouseStyle, setSelection, shortIdCreator, shortIdsCreator, statDateRangeOfDays, statDateRangeOfMonths, statEarliestTime, statLatestTime, stringInclude, textDataCache, toAttachmentFieldValue, toDateFieldValue, toLinkFieldValue, toMemberFieldValue, toNumberFieldValue, toProgressFieldValue, toRateFieldValue, toRichTextFieldValue, toSelectFieldValue, toTextFieldValue, toggleSelectAllRecords, toggleSelectRecord, transformToCellText, updatePicture, writeToAITable, writeToClipboard, zhIntlCollator };
|
13127
13077
|
//# sourceMappingURL=ai-table-grid.mjs.map
|