@ai-table/grid 0.1.42 → 0.1.44
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/components/cell-editors/date/date-editor.component.d.ts +1 -1
- package/components/cell-editors/date/date-editor.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/fesm2022/ai-table-grid.mjs +70 -36
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/renderer/components/cover-cell.component.d.ts.map +1 -1
- package/renderer/creations/create-active-cell-border.d.ts.map +1 -1
- package/renderer/creations/create-cells.d.ts.map +1 -1
- package/renderer/creations/create-groups.d.ts.map +1 -1
- package/renderer/drawers/cell-drawer.d.ts.map +1 -1
- package/renderer/drawers/group-layout.d.ts.map +1 -1
- package/services/event.service.d.ts.map +1 -1
- package/types/cell.d.ts +1 -0
- package/types/cell.d.ts.map +1 -1
- package/utils/cell.d.ts +5 -0
- package/utils/cell.d.ts.map +1 -1
- package/utils/get-placeholder-cells.d.ts.map +1 -1
- package/utils/record.d.ts.map +1 -1
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DateCellEditorComponent extends AbstractEditCellEditor<DateFieldValue> {
|
5
5
|
placeholder: string;
|
6
6
|
ngOnInit(): void;
|
7
|
-
updateValue(
|
7
|
+
updateValue(timestamp: number): void;
|
8
8
|
thyOpenChange(isOpen: Boolean): void;
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateCellEditorComponent, never>;
|
10
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<DateCellEditorComponent, "date-cell-editor", never, {}, {}, never, never, true, never>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"date-editor.component.d.ts","sourceRoot":"","sources":["../../../../../packages/grid/src/components/cell-editors/date/date-editor.component.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAI3E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;;AAEjD,qBAyBa,uBAAwB,SAAQ,sBAAsB,CAAC,cAAc,CAAC;IAC/E,WAAW,SAAM;IAER,QAAQ,IAAI,IAAI;IAazB,WAAW,CAAC,
|
1
|
+
{"version":3,"file":"date-editor.component.d.ts","sourceRoot":"","sources":["../../../../../packages/grid/src/components/cell-editors/date/date-editor.component.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAI3E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;;AAEjD,qBAyBa,uBAAwB,SAAQ,sBAAsB,CAAC,cAAc,CAAC;IAC/E,WAAW,SAAM;IAER,QAAQ,IAAI,IAAI;IAazB,WAAW,CAAC,SAAS,EAAE,MAAM;IAW7B,aAAa,CAAC,MAAM,EAAE,OAAO;yCA3BpB,uBAAuB;2CAAvB,uBAAuB;CAgCnC"}
|
@@ -36,7 +36,7 @@ export declare class AITableDragComponent implements OnInit, OnDestroy {
|
|
36
36
|
private movingColumn;
|
37
37
|
private movingColumnWidth;
|
38
38
|
private movingRecord;
|
39
|
-
private
|
39
|
+
private setMovingRecordDragData;
|
40
40
|
private handleDragEnd;
|
41
41
|
private clearDragState;
|
42
42
|
private calculateDragWidth;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"drag.component.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/components/drag/drag.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,UAAU,EAIV,SAAS,EACT,MAAM,EAIT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAiB,WAAW,EAAY,MAAM,iBAAiB,CAAC;;AAiBvE,qBAQa,oBAAqB,YAAW,MAAM,EAAE,SAAS;IAC1D,aAAa,2EAAgD;IAE7D,WAAW,2EAAgD;IAE3D,OAAO,wDAAyB;IAEhC,OAAO,CAAC,uB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,sBAAsB;IAM9B,OAAO,CAAC,kBAAkB;IAI1B,WAAW;yCAtfF,oBAAoB;2CAApB,oBAAoB;CAigBhC"}
|
@@ -1731,10 +1731,11 @@ class DateCellEditorComponent extends AbstractEditCellEditor {
|
|
1731
1731
|
})();
|
1732
1732
|
this.placeholder = getI18nTextByKey(this.aiTable, AITableGridI18nKey.dataPickerPlaceholder);
|
1733
1733
|
}
|
1734
|
-
updateValue(
|
1734
|
+
updateValue(timestamp) {
|
1735
|
+
const value = timestamp ? { timestamp: timestamp } : null;
|
1735
1736
|
this.updateFieldValues.emit([
|
1736
1737
|
{
|
1737
|
-
value
|
1738
|
+
value,
|
1738
1739
|
path: [this.record()._id, this.field()._id]
|
1739
1740
|
}
|
1740
1741
|
]);
|
@@ -2018,16 +2019,19 @@ function getColumnIndicesSizeMap(aiTable, fields) {
|
|
2018
2019
|
*/
|
2019
2020
|
function getCellHorizontalPosition(options) {
|
2020
2021
|
let { columnWidth, columnIndex, columnCount, depth = 0 } = options;
|
2022
|
+
const isGroupAndFirstColumn = depth > 0 && columnIndex === 0;
|
2023
|
+
columnWidth = isGroupAndFirstColumn ? columnWidth - AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE : columnWidth;
|
2021
2024
|
depth += 1;
|
2022
2025
|
if (!depth)
|
2023
2026
|
return { width: columnWidth, offset: 0 };
|
2024
2027
|
const firstIndent = columnIndex === 0 && depth;
|
2025
2028
|
const lastIndent = columnIndex === columnCount - 1 && depth === 3;
|
2026
|
-
|
2029
|
+
let offset = firstIndent ? (depth - 1) * AI_TABLE_ROW_GROUP_OFFSET + 0.5 : 0;
|
2027
2030
|
const width = lastIndent && !firstIndent ? columnWidth - AI_TABLE_ROW_GROUP_OFFSET : columnWidth - offset;
|
2028
2031
|
return {
|
2029
2032
|
width,
|
2030
|
-
offset
|
2033
|
+
offset,
|
2034
|
+
isGroupAndFirstColumn
|
2031
2035
|
};
|
2032
2036
|
}
|
2033
2037
|
function transformToCellText(cellValue, options) {
|
@@ -2282,12 +2286,15 @@ function getPlaceHolderCellsConfigs(options) {
|
|
2282
2286
|
}
|
2283
2287
|
// 当前行的 Y 轴偏移量,并根据列宽和列索引获取单元格的水平位置(宽度和偏移量)
|
2284
2288
|
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET * 2;
|
2285
|
-
|
2289
|
+
let { width, offset, isGroupAndFirstColumn } = getCellHorizontalPosition({
|
2286
2290
|
columnWidth,
|
2287
2291
|
columnIndex,
|
2288
2292
|
columnCount,
|
2289
2293
|
depth
|
2290
2294
|
});
|
2295
|
+
if (isGroupAndFirstColumn) {
|
2296
|
+
offset += AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
2297
|
+
}
|
2291
2298
|
const height = rowHeight - AI_TABLE_OFFSET * 4;
|
2292
2299
|
configs.unshift({
|
2293
2300
|
key: `placeholder-cell-${fieldId}-${recordId}`,
|
@@ -5457,11 +5464,17 @@ const createActiveCellBorder = (config) => {
|
|
5457
5464
|
const y = coordinate.getRowOffset(rowIndex);
|
5458
5465
|
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
5459
5466
|
const isFrozenColumn = columnIndex < frozenColumnCount;
|
5460
|
-
const
|
5467
|
+
const row = aiTable.context?.linearRows()[rowIndex];
|
5468
|
+
const depth = row?.depth ?? 0;
|
5469
|
+
let { offset, width, isGroupAndFirstColumn } = getCellHorizontalPosition({
|
5461
5470
|
columnWidth,
|
5462
5471
|
columnIndex,
|
5463
|
-
columnCount: totalColumnCount
|
5472
|
+
columnCount: totalColumnCount,
|
5473
|
+
depth
|
5464
5474
|
});
|
5475
|
+
if (isGroupAndFirstColumn) {
|
5476
|
+
offset += AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
5477
|
+
}
|
5465
5478
|
const currentConfig = {
|
5466
5479
|
x: x + offset + AI_TABLE_OFFSET,
|
5467
5480
|
y: y + AI_TABLE_OFFSET,
|
@@ -6202,13 +6215,13 @@ class CellDrawer extends Drawer {
|
|
6202
6215
|
}
|
6203
6216
|
}
|
6204
6217
|
renderCellCheckbox(render, ctx) {
|
6205
|
-
const { x, y, field, columnWidth, transformValue, isCoverCell } = render;
|
6218
|
+
const { x, y, field, columnWidth, transformValue, isCoverCell, isGroupFirstRender } = render;
|
6206
6219
|
if (isCoverCell) {
|
6207
6220
|
return;
|
6208
6221
|
}
|
6209
6222
|
const isChecked = !isEmpty(transformValue) && !!transformValue;
|
6210
6223
|
const checkboxSize = AI_TABLE_ICON_COMMON_SIZE;
|
6211
|
-
const checkboxX = x + (columnWidth - checkboxSize) / 2;
|
6224
|
+
const checkboxX = isGroupFirstRender ? x + AI_TABLE_CELL_PADDING : x + (columnWidth - checkboxSize) / 2;
|
6212
6225
|
const checkboxY = y + (AI_TABLE_ROW_BLANK_HEIGHT - checkboxSize) / 2;
|
6213
6226
|
this.path({
|
6214
6227
|
x: checkboxX,
|
@@ -6219,7 +6232,7 @@ class CellDrawer extends Drawer {
|
|
6219
6232
|
});
|
6220
6233
|
}
|
6221
6234
|
renderCellText(render, ctx) {
|
6222
|
-
const { x, y, transformValue, field, columnWidth, style } = render;
|
6235
|
+
const { x, y, transformValue, field, columnWidth, style, isGroupFirstRender } = render;
|
6223
6236
|
if (isUndefinedOrNull(transformValue)) {
|
6224
6237
|
return;
|
6225
6238
|
}
|
@@ -6273,7 +6286,7 @@ class CellDrawer extends Drawer {
|
|
6273
6286
|
lineHeight: DEFAULT_TEXT_LINE_HEIGHT,
|
6274
6287
|
textAlign,
|
6275
6288
|
verticalAlign: DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE,
|
6276
|
-
fillStyle: fieldType === AITableFieldType.link ? Colors.primary : color,
|
6289
|
+
fillStyle: fieldType === AITableFieldType.link && !isGroupFirstRender ? Colors.primary : color,
|
6277
6290
|
fontWeight,
|
6278
6291
|
textDecoration,
|
6279
6292
|
fieldType,
|
@@ -6995,12 +7008,13 @@ class GroupLayout extends Layout {
|
|
6995
7008
|
});
|
6996
7009
|
}
|
6997
7010
|
const iconContainerWidth = AI_TABLE_ICON_COMMON_SIZE + AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
6998
|
-
if (!isEmpty(groupValue)) {
|
7011
|
+
if (!isEmpty(groupValue) || field.type === AITableFieldType.checkbox) {
|
6999
7012
|
cellDrawer.initStyle(field, style);
|
7000
7013
|
cellDrawer.renderCell({
|
7001
7014
|
...render,
|
7002
7015
|
x: render.x + iconContainerWidth,
|
7003
|
-
columnWidth: render.columnWidth - iconContainerWidth
|
7016
|
+
columnWidth: render.columnWidth - iconContainerWidth,
|
7017
|
+
isGroupFirstRender: true
|
7004
7018
|
}, this.ctx, columnWidth);
|
7005
7019
|
}
|
7006
7020
|
else {
|
@@ -7141,10 +7155,9 @@ const createCells = (config) => {
|
|
7141
7155
|
isHoverRow: isHoverRecord(isHover, targetName),
|
7142
7156
|
isCheckedRow: isSelectedRecord(recordId, aiTable)
|
7143
7157
|
});
|
7144
|
-
const
|
7145
|
-
const { width, offset } = getCellHorizontalPosition({
|
7158
|
+
const { width, offset, isGroupAndFirstColumn } = getCellHorizontalPosition({
|
7146
7159
|
columnIndex,
|
7147
|
-
columnWidth
|
7160
|
+
columnWidth,
|
7148
7161
|
columnCount,
|
7149
7162
|
depth
|
7150
7163
|
});
|
@@ -7213,12 +7226,15 @@ const createCells = (config) => {
|
|
7213
7226
|
frozenColumnCount,
|
7214
7227
|
xIsScroll
|
7215
7228
|
});
|
7216
|
-
|
7229
|
+
let { width, offset, isGroupAndFirstColumn } = getCellHorizontalPosition({
|
7217
7230
|
columnIndex,
|
7218
7231
|
columnWidth,
|
7219
7232
|
columnCount,
|
7220
7233
|
depth
|
7221
7234
|
});
|
7235
|
+
if (isGroupAndFirstColumn) {
|
7236
|
+
width += AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
7237
|
+
}
|
7222
7238
|
const realX = x + offset + AI_TABLE_OFFSET;
|
7223
7239
|
const realY = y + AI_TABLE_OFFSET;
|
7224
7240
|
const style = { fontWeight: DEFAULT_FONT_STYLE };
|
@@ -8969,10 +8985,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8969
8985
|
const createGroupCells = (config) => {
|
8970
8986
|
const { coordinate, rowStartIndex, rowStopIndex, columnStartIndex, columnStopIndex, aiTable, actions, readonly } = config;
|
8971
8987
|
const linearRows = aiTable.context?.linearRows();
|
8972
|
-
const { columnCount } = coordinate;
|
8988
|
+
const { rowCount, columnCount } = coordinate;
|
8973
8989
|
const groups = [];
|
8974
8990
|
for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
|
8975
|
-
if (rowIndex >
|
8991
|
+
if (rowIndex > rowCount - 1)
|
8976
8992
|
break;
|
8977
8993
|
if (rowIndex < 0)
|
8978
8994
|
continue;
|
@@ -9745,10 +9761,9 @@ class AITableCoverCellEntry {
|
|
9745
9761
|
const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
|
9746
9762
|
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9747
9763
|
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
|
9748
|
-
const
|
9749
|
-
const { width, offset } = getCellHorizontalPosition({
|
9764
|
+
const { width, offset, isGroupAndFirstColumn } = getCellHorizontalPosition({
|
9750
9765
|
columnIndex,
|
9751
|
-
columnWidth
|
9766
|
+
columnWidth,
|
9752
9767
|
columnCount,
|
9753
9768
|
depth
|
9754
9769
|
});
|
@@ -11889,11 +11904,18 @@ class AITableGridEventService {
|
|
11889
11904
|
const originX = coordinate.getColumnOffset(columnIndex);
|
11890
11905
|
const originY = coordinate.getRowOffset(rowIndex);
|
11891
11906
|
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
11892
|
-
const
|
11907
|
+
const row = aiTable.context?.linearRows()[rowIndex];
|
11908
|
+
const depth = row?.depth ?? 0;
|
11909
|
+
const isGroupAndFirstColumn = depth > 0 && columnIndex === 0;
|
11910
|
+
let { width: originWidth, offset: originOffset } = getCellHorizontalPosition({
|
11893
11911
|
columnWidth,
|
11894
11912
|
columnIndex,
|
11895
|
-
columnCount
|
11913
|
+
columnCount,
|
11914
|
+
depth
|
11896
11915
|
});
|
11916
|
+
if (isGroupAndFirstColumn) {
|
11917
|
+
originOffset += AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
11918
|
+
}
|
11897
11919
|
const originRect = container.getBoundingClientRect();
|
11898
11920
|
const isFrozenColumn = AITable.isFrozenColumn(aiTable, columnIndex);
|
11899
11921
|
const scrollLeft = isFrozenColumn ? 0 : scrollState().scrollLeft;
|
@@ -12781,6 +12803,7 @@ class AITableDragComponent {
|
|
12781
12803
|
const aiTable = this.aiTableGridEventService.aiTable;
|
12782
12804
|
const scroll = { x: 0, y: this.verticalBarElement?.scrollTop || 0 };
|
12783
12805
|
const coordinate = drag.coordinate;
|
12806
|
+
const linearRows = aiTable.context.linearRows();
|
12784
12807
|
const visibleRowIndexMap = aiTable.context.visibleRowsIndexMap();
|
12785
12808
|
const sourceRowId = drag.sourceIds.values().next().value;
|
12786
12809
|
const sourceRowIndex = visibleRowIndexMap.get(sourceRowId) || 0;
|
@@ -12809,16 +12832,20 @@ class AITableDragComponent {
|
|
12809
12832
|
this.setAuxiliaryLineStyles({
|
12810
12833
|
top: `${nextColumnStartY - scrollPosition.y}px`
|
12811
12834
|
});
|
12812
|
-
this.
|
12835
|
+
this.setMovingRecordDragData(DragType.record, drag.sourceIds, targetRowIndex + 1);
|
12813
12836
|
return;
|
12814
12837
|
}
|
12815
|
-
|
12816
|
-
|
12817
|
-
|
12818
|
-
|
12819
|
-
|
12820
|
-
|
12821
|
-
|
12838
|
+
const currentLinearRow = linearRows[targetRowIndex];
|
12839
|
+
const rowType = currentLinearRow.type;
|
12840
|
+
if (rowType === AITableRowType.record || rowType === AITableRowType.add) {
|
12841
|
+
this.setAuxiliaryLineStyles({
|
12842
|
+
width: `calc(100% - ${AI_TABLE_ROW_DRAG_ICON_WIDTH}px)`,
|
12843
|
+
height: `${lineHeight}px`,
|
12844
|
+
top: `${lineTop}px`,
|
12845
|
+
left: `${AI_TABLE_ROW_DRAG_ICON_WIDTH}px`
|
12846
|
+
});
|
12847
|
+
this.setMovingRecordDragData(DragType.record, drag.sourceIds, targetRowIndex);
|
12848
|
+
}
|
12822
12849
|
}
|
12823
12850
|
else {
|
12824
12851
|
this.resetAuxiliaryLine();
|
@@ -12857,7 +12884,7 @@ class AITableDragComponent {
|
|
12857
12884
|
}
|
12858
12885
|
});
|
12859
12886
|
}
|
12860
|
-
|
12887
|
+
setMovingRecordDragData(type, sourceIds, targetIndex) {
|
12861
12888
|
const aiTable = this.aiTableGridEventService.aiTable;
|
12862
12889
|
const linearRows = aiTable.context.linearRows();
|
12863
12890
|
this.draggedData = {
|
@@ -12869,7 +12896,13 @@ class AITableDragComponent {
|
|
12869
12896
|
this.draggedData.beforeRecordId = linearRows[0]._id;
|
12870
12897
|
}
|
12871
12898
|
else {
|
12872
|
-
|
12899
|
+
const targetLinearRow = linearRows[targetIndex - 1];
|
12900
|
+
if (targetLinearRow.type === AITableRowType.group) {
|
12901
|
+
this.draggedData.beforeRecordId = linearRows[targetIndex]._id;
|
12902
|
+
}
|
12903
|
+
else {
|
12904
|
+
this.draggedData.afterRecordId = targetLinearRow._id;
|
12905
|
+
}
|
12873
12906
|
}
|
12874
12907
|
}
|
12875
12908
|
handleDragEnd() {
|
@@ -12985,8 +13018,9 @@ class AITableGrid extends AITableGridBase {
|
|
12985
13018
|
const scrollTop = this.aiTable.context.scrollState().scrollTop;
|
12986
13019
|
const rowIndices = this.toolTipRowIndices();
|
12987
13020
|
return rowIndices.map((rowIndex) => {
|
13021
|
+
const offset = this.coordinate().getRowOffset(rowIndex);
|
12988
13022
|
return {
|
12989
|
-
top:
|
13023
|
+
top: offset - scrollTop - AI_TABLE_FIELD_HEAD_HEIGHT,
|
12990
13024
|
left: 0
|
12991
13025
|
};
|
12992
13026
|
});
|
@@ -13244,7 +13278,7 @@ class AITableGrid extends AITableGridBase {
|
|
13244
13278
|
if (keywords) {
|
13245
13279
|
const references = this.aiReferences();
|
13246
13280
|
this.aiTable.gridData().records.forEach((record) => {
|
13247
|
-
this.aiTable.
|
13281
|
+
this.aiTable.gridData().fields.forEach((field) => {
|
13248
13282
|
if (isCellMatchKeywords(this.aiTable, field, record._id, keywords, references)) {
|
13249
13283
|
matchedCells.add(`${record._id}:${field._id}`);
|
13250
13284
|
}
|