@ai-table/grid 0.1.41 → 0.1.42
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/drag/drag.component.d.ts +1 -0
- package/components/drag/drag.component.d.ts.map +1 -1
- package/constants/table.d.ts +1 -0
- package/constants/table.d.ts.map +1 -1
- package/fesm2022/ai-table-grid.mjs +769 -407
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid.component.d.ts +1 -0
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/renderer/components/background.component.d.ts.map +1 -1
- package/renderer/components/cover-cell.component.d.ts.map +1 -1
- package/renderer/components/field-stat/stat.component.d.ts +13 -4
- package/renderer/components/field-stat/stat.component.d.ts.map +1 -1
- package/renderer/components/group/frozen-groups.component.d.ts +8 -3
- package/renderer/components/group/frozen-groups.component.d.ts.map +1 -1
- package/renderer/components/group/groups.component.d.ts +14 -0
- package/renderer/components/group/groups.component.d.ts.map +1 -0
- package/renderer/components/group/index.d.ts +3 -0
- package/renderer/components/group/index.d.ts.map +1 -0
- package/renderer/components/index.d.ts +2 -1
- package/renderer/components/index.d.ts.map +1 -1
- package/renderer/components/other-rows.component.d.ts +2 -2
- package/renderer/components/other-rows.component.d.ts.map +1 -1
- package/renderer/components/shadow.component.d.ts +10 -0
- package/renderer/components/shadow.component.d.ts.map +1 -0
- package/renderer/creations/create-cells.d.ts.map +1 -1
- package/renderer/creations/create-groups.d.ts.map +1 -1
- package/renderer/creations/create-stats.d.ts +2 -1
- package/renderer/creations/create-stats.d.ts.map +1 -1
- package/renderer/drawers/group-layout.d.ts.map +1 -1
- package/renderer/drawers/layout-drawer.d.ts +3 -1
- package/renderer/drawers/layout-drawer.d.ts.map +1 -1
- package/renderer/drawers/record-row-layout-drawer.d.ts.map +1 -1
- package/renderer/renderer.component.d.ts +5 -0
- package/renderer/renderer.component.d.ts.map +1 -1
- package/types/cell.d.ts +3 -4
- package/types/cell.d.ts.map +1 -1
- package/types/component-config.d.ts +10 -7
- package/types/component-config.d.ts.map +1 -1
- package/types/layout.d.ts +1 -0
- package/types/layout.d.ts.map +1 -1
- package/types/row.d.ts +5 -2
- package/types/row.d.ts.map +1 -1
- package/utils/build.d.ts.map +1 -1
- package/utils/cell.d.ts.map +1 -1
- package/utils/clipboard/paste.d.ts.map +1 -1
- package/utils/drag-fill/drag-fill.d.ts.map +1 -1
- package/utils/group.d.ts +3 -0
- package/utils/group.d.ts.map +1 -0
- package/utils/i18n.d.ts +3 -1
- package/utils/i18n.d.ts.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/renderer/components/frozen-field-shadow.component.d.ts +0 -14
- package/renderer/components/frozen-field-shadow.component.d.ts.map +0 -1
@@ -53,7 +53,7 @@ import { isArray, TinyDate, helpers, hexToRgb } from 'ngx-tethys/util';
|
|
53
53
|
import { DEFAULT_COLORS } from 'ngx-tethys/color-picker';
|
54
54
|
import GraphemeSplitter from 'grapheme-splitter';
|
55
55
|
import * as i1$2 from '@angular/common';
|
56
|
-
import {
|
56
|
+
import { NgClass, CommonModule, NgTemplateOutlet, NgComponentOutlet } from '@angular/common';
|
57
57
|
import { ThyDropdownAbstractMenu, ThyDropdownMenuItemDirective, ThyDropdownMenuComponent, ThyDropdownMenuGroup, ThyDropdownDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownMenuItemMetaDirective } from 'ngx-tethys/dropdown';
|
58
58
|
import { ThyEmptyModule } from 'ngx-tethys/empty';
|
59
59
|
import { ThySelect, ThySelectModule } from 'ngx-tethys/select';
|
@@ -546,6 +546,7 @@ var AITableGridI18nKey;
|
|
546
546
|
AITableGridI18nKey["selectedRecordsCount"] = "selectedRecordsCount";
|
547
547
|
AITableGridI18nKey["selectedCellsCount"] = "selectedCellsCount";
|
548
548
|
AITableGridI18nKey["stat"] = "stat";
|
549
|
+
AITableGridI18nKey["emptyGroup"] = "emptyGroup";
|
549
550
|
})(AITableGridI18nKey || (AITableGridI18nKey = {}));
|
550
551
|
const AITableGridI18nText = {
|
551
552
|
[AITableGridI18nKey.dataPickerPlaceholder]: '选择日期',
|
@@ -598,7 +599,8 @@ const AITableGridI18nText = {
|
|
598
599
|
[AITableGridI18nKey.dateRangeOfMonthsResult]: '时间范围 {{statValue}} 月',
|
599
600
|
[AITableGridI18nKey.selectedRecordsCount]: '已经选择 {count} 条记录',
|
600
601
|
[AITableGridI18nKey.selectedCellsCount]: '已经选择 {count} 个单元格',
|
601
|
-
[AITableGridI18nKey.stat]: '统计'
|
602
|
+
[AITableGridI18nKey.stat]: '统计',
|
603
|
+
[AITableGridI18nKey.emptyGroup]: '(空)'
|
602
604
|
};
|
603
605
|
const getDefaultI18nTextByKey = (key) => {
|
604
606
|
return AITableGridI18nText[key] || key;
|
@@ -919,10 +921,11 @@ const AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD = AI_TABLE_FIELD_HEAD_HEIGHT / 2;
|
|
919
921
|
const AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD = AI_TABLE_FIELD_HEAD_HEIGHT / 2;
|
920
922
|
const AI_TABLE_FIELD_STAT_INNER_HEIGHT = 47; // 字段统计内部高度
|
921
923
|
const AI_TABLE_TEXT_LINE_HEIGHT = 1.84; // 默认文本行高
|
922
|
-
const AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT = AI_TABLE_FIELD_STAT_INNER_HEIGHT +
|
924
|
+
const AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT = AI_TABLE_FIELD_STAT_INNER_HEIGHT + AI_TABLE_CELL_LINE_BORDER * 2; // 统计容器高度
|
923
925
|
const AI_TABLE_GROUP_MAX_LEVEL = 3;
|
924
926
|
const AI_TABLE_ROW_GROUP_COLLAPSE_BUTTON = 'AI_TABLE_ROW_GROUP_COLLAPSE_BUTTON';
|
925
927
|
const AI_TABLE_ROW_GROUP_OFFSET = 16;
|
928
|
+
const AI_TABLE_SHADOW_DEFAULT_WIDTH = 8;
|
926
929
|
|
927
930
|
const MIN_COLUMN_WIDTH = 80;
|
928
931
|
const DBL_CLICK_EDIT_TYPE = [
|
@@ -1971,13 +1974,15 @@ const buildGridLinearRows = (visibleRecords, isAddingVisible = true, aiTable, ai
|
|
1971
1974
|
linearRows.push({
|
1972
1975
|
type: AITableRowType.record,
|
1973
1976
|
_id: row._id,
|
1974
|
-
displayIndex: displayRowIndex
|
1977
|
+
displayIndex: displayRowIndex,
|
1978
|
+
depth: 0
|
1975
1979
|
});
|
1976
1980
|
}
|
1977
1981
|
if (isAddingVisible && !row._id) {
|
1978
1982
|
linearRows.push({
|
1979
1983
|
type: AITableRowType.add,
|
1980
|
-
_id: ''
|
1984
|
+
_id: '',
|
1985
|
+
depth: 0
|
1981
1986
|
});
|
1982
1987
|
}
|
1983
1988
|
});
|
@@ -2146,7 +2151,13 @@ function selectCells(aiTable, startCell, endCell, activeCell) {
|
|
2146
2151
|
selectedCells.add(`${startRecordId}:${startFieldId}`);
|
2147
2152
|
}
|
2148
2153
|
else {
|
2149
|
-
|
2154
|
+
const startCellPath = startCell.join(':');
|
2155
|
+
const endCellPath = endCell.join(':');
|
2156
|
+
const selectCells = Array.from(aiTable.selection().selectedCells);
|
2157
|
+
const startSelectedCellPath = selectCells[0];
|
2158
|
+
const endSelectedCellPath = selectCells[selectCells.length - 1];
|
2159
|
+
if ((startCellPath === startSelectedCellPath || startCellPath === endSelectedCellPath) &&
|
2160
|
+
(endCellPath === startSelectedCellPath || endCellPath === endSelectedCellPath)) {
|
2150
2161
|
return;
|
2151
2162
|
}
|
2152
2163
|
const [endRecordId, endFieldId] = endCell;
|
@@ -2159,8 +2170,11 @@ function selectCells(aiTable, startCell, endCell, activeCell) {
|
|
2159
2170
|
const minColIndex = Math.min(startColIndex, endColIndex);
|
2160
2171
|
const maxColIndex = Math.max(startColIndex, endColIndex);
|
2161
2172
|
for (let i = minRowIndex; i <= maxRowIndex; i++) {
|
2162
|
-
|
2163
|
-
|
2173
|
+
const row = records[i];
|
2174
|
+
if (row && row.type === AITableRowType.record) {
|
2175
|
+
for (let j = minColIndex; j <= maxColIndex; j++) {
|
2176
|
+
selectedCells.add(`${row._id}:${fields[j]._id}`);
|
2177
|
+
}
|
2164
2178
|
}
|
2165
2179
|
}
|
2166
2180
|
}
|
@@ -3526,6 +3540,20 @@ function buildClipboardContent(aiTable, fieldIds, recordIds) {
|
|
3526
3540
|
return clipboardContent;
|
3527
3541
|
}
|
3528
3542
|
|
3543
|
+
function getGroupLastRecordIndex(aiTable, startRowIndex) {
|
3544
|
+
const linearRows = aiTable.context.linearRows();
|
3545
|
+
if (startRowIndex + 1 >= linearRows.length) {
|
3546
|
+
return startRowIndex;
|
3547
|
+
}
|
3548
|
+
for (let i = startRowIndex + 1; i < linearRows.length; i++) {
|
3549
|
+
const row = linearRows[i];
|
3550
|
+
if (row.type !== AITableRowType.record) {
|
3551
|
+
return i - 1;
|
3552
|
+
}
|
3553
|
+
}
|
3554
|
+
return linearRows.length - 1;
|
3555
|
+
}
|
3556
|
+
|
3529
3557
|
const aiTableAttributePattern = new RegExp(`${aiTableFragmentAttribute}="(.+?)"`, 'm');
|
3530
3558
|
const decodeClipboardJsonData = (encoded) => {
|
3531
3559
|
const decoded = decodeURIComponent(window.atob(encoded));
|
@@ -3671,14 +3699,20 @@ const writeToAITable = async (aiTable, actions) => {
|
|
3671
3699
|
const maxFields = aiTable.context.maxFields();
|
3672
3700
|
const maxRecords = aiTable.context.maxRecords();
|
3673
3701
|
const startRowIndex = aiTable.context.visibleRowsIndexMap().get(startRecordId) ?? 0;
|
3674
|
-
const lastRowIndex = aiTable
|
3702
|
+
const lastRowIndex = getGroupLastRecordIndex(aiTable, startRowIndex);
|
3703
|
+
let appendRowCount = clipboardContent.length - (lastRowIndex - startRowIndex) - 1;
|
3675
3704
|
const recordsCount = aiTable.records().length;
|
3676
|
-
let appendRowCount = clipboardContent.length - (lastRowIndex - startRowIndex);
|
3677
3705
|
if (maxRecords && recordsCount + appendRowCount > maxRecords) {
|
3678
3706
|
appendRowCount = maxRecords - recordsCount;
|
3679
3707
|
result.isPasteOverMaxRecords = true;
|
3680
3708
|
}
|
3681
|
-
|
3709
|
+
if (appendRowCount > 0) {
|
3710
|
+
actions.addRecord({
|
3711
|
+
count: appendRowCount,
|
3712
|
+
afterRecordId: startRecordId,
|
3713
|
+
forGroupId: startRecordId
|
3714
|
+
});
|
3715
|
+
}
|
3682
3716
|
const startColIndex = aiTable.context.visibleColumnsIndexMap().get(startFieldId) ?? 0;
|
3683
3717
|
const lastColIndex = aiTable.context.visibleColumnsIndexMap().size - 1;
|
3684
3718
|
const copiedFieldLength = clipboardContent[0].length;
|
@@ -3702,12 +3736,12 @@ const writeToAITable = async (aiTable, actions) => {
|
|
3702
3736
|
if (maxRecords && targetRowIndex >= maxRecords) {
|
3703
3737
|
return;
|
3704
3738
|
}
|
3739
|
+
const targetRecord = linearRows[targetRowIndex];
|
3705
3740
|
row.forEach((plainText, j) => {
|
3706
3741
|
const targetColIndex = startColIndex + j;
|
3707
3742
|
if (maxFields && targetColIndex >= maxFields) {
|
3708
3743
|
return;
|
3709
3744
|
}
|
3710
|
-
const targetRecord = linearRows[targetRowIndex];
|
3711
3745
|
const targetField = visibleFields[targetColIndex];
|
3712
3746
|
const recordIndex = i;
|
3713
3747
|
const fieldIndex = j;
|
@@ -5480,9 +5514,10 @@ class Layout extends Drawer {
|
|
5480
5514
|
this.hiddenIndexColumn = false;
|
5481
5515
|
this.hiddenRowDrag = false;
|
5482
5516
|
this.readonly = false;
|
5517
|
+
this.xIsScroll = false;
|
5483
5518
|
}
|
5484
5519
|
// 用于初始化或重置布局的基本属性。这个方法通常在每次渲染新的一行或单元格时调用,确保布局信息是最新的
|
5485
|
-
init({ x, y, rowIndex, columnIndex, rowHeight, columnWidth, columnCount, containerWidth, rowHeadWidth, hiddenIndexColumn, hiddenRowDrag, readonly, frozenColumnCount }) {
|
5520
|
+
init({ x, y, rowIndex, columnIndex, rowHeight, columnWidth, columnCount, containerWidth, rowHeadWidth, hiddenIndexColumn, hiddenRowDrag, readonly, frozenColumnCount, xIsScroll }) {
|
5486
5521
|
this.x = x;
|
5487
5522
|
this.y = y;
|
5488
5523
|
this.rowIndex = rowIndex;
|
@@ -5496,6 +5531,7 @@ class Layout extends Drawer {
|
|
5496
5531
|
this.hiddenRowDrag = hiddenRowDrag;
|
5497
5532
|
this.readonly = readonly;
|
5498
5533
|
this.frozenColumnCount = frozenColumnCount;
|
5534
|
+
this.xIsScroll = xIsScroll;
|
5499
5535
|
}
|
5500
5536
|
// 当前单元格是否是行的第一列
|
5501
5537
|
get isFirst() {
|
@@ -5523,6 +5559,22 @@ class Layout extends Drawer {
|
|
5523
5559
|
fill
|
5524
5560
|
});
|
5525
5561
|
}
|
5562
|
+
renderFrozenShadow() {
|
5563
|
+
if (this.isLastFrozenColumn && this.xIsScroll) {
|
5564
|
+
const shadowWidth = AI_TABLE_SHADOW_DEFAULT_WIDTH;
|
5565
|
+
const shadowGradient = this.ctx.createLinearGradient(this.x + this.columnWidth + 0, this.y, this.x + this.columnWidth + 0 + shadowWidth, this.y);
|
5566
|
+
// 阴影从分割线处最深,逐渐变浅
|
5567
|
+
shadowGradient.addColorStop(0, 'rgba(0,0,0,0.05)');
|
5568
|
+
shadowGradient.addColorStop(1, this.colors.transparent);
|
5569
|
+
this.rect({
|
5570
|
+
x: this.x + this.columnWidth + 0,
|
5571
|
+
y: this.y,
|
5572
|
+
width: shadowWidth,
|
5573
|
+
height: this.rowHeight,
|
5574
|
+
fill: shadowGradient
|
5575
|
+
});
|
5576
|
+
}
|
5577
|
+
}
|
5526
5578
|
}
|
5527
5579
|
|
5528
5580
|
class AddRowLayout extends Layout {
|
@@ -6890,6 +6942,7 @@ class RecordRowLayout extends Layout {
|
|
6890
6942
|
this.renderFirstCell({ row, style, indexStyle, isCheckedRow, isHoverRow });
|
6891
6943
|
this.renderCommonCell({ style });
|
6892
6944
|
this.renderLastCell({ style, isCheckedRow, isHoverRow });
|
6945
|
+
this.renderFrozenShadow();
|
6893
6946
|
}
|
6894
6947
|
}
|
6895
6948
|
const recordRowLayout = new RecordRowLayout();
|
@@ -6933,7 +6986,7 @@ class GroupLayout extends Layout {
|
|
6933
6986
|
// 第一列单元格
|
6934
6987
|
this.rect({
|
6935
6988
|
x: AI_TABLE_CELL_PADDING + dragOccupyWidth + 2,
|
6936
|
-
y: this.y + (
|
6989
|
+
y: this.y + (rowHeight - AI_TABLE_ICON_COMMON_SIZE) / 2,
|
6937
6990
|
width: AI_TABLE_ICON_COMMON_SIZE,
|
6938
6991
|
height: AI_TABLE_ICON_COMMON_SIZE,
|
6939
6992
|
fill: hexToRgb(this.colors.gray400, 0.2),
|
@@ -6950,6 +7003,14 @@ class GroupLayout extends Layout {
|
|
6950
7003
|
columnWidth: render.columnWidth - iconContainerWidth
|
6951
7004
|
}, this.ctx, columnWidth);
|
6952
7005
|
}
|
7006
|
+
else {
|
7007
|
+
const emptyGroupString = getI18nTextByKey(aiTable, AITableGridI18nKey.emptyGroup);
|
7008
|
+
this.text({
|
7009
|
+
x: render.x + iconContainerWidth + AI_TABLE_CELL_PADDING,
|
7010
|
+
y: this.y + (rowHeight - AI_TABLE_COMMON_FONT_SIZE) / 2,
|
7011
|
+
text: emptyGroupString
|
7012
|
+
});
|
7013
|
+
}
|
6953
7014
|
}
|
6954
7015
|
renderCommonCellBorder({ style }) {
|
6955
7016
|
const { fill, stroke } = style || {};
|
@@ -6978,6 +7039,7 @@ class GroupLayout extends Layout {
|
|
6978
7039
|
this.renderFirstCell(render, config);
|
6979
7040
|
this.renderCommonCellBorder({ style });
|
6980
7041
|
this.renderLastCell({ style, isHoverRow, isCheckedRow });
|
7042
|
+
this.renderFrozenShadow();
|
6981
7043
|
}
|
6982
7044
|
}
|
6983
7045
|
const groupLayout = new GroupLayout();
|
@@ -6993,7 +7055,7 @@ const createCells = (config) => {
|
|
6993
7055
|
const { rowHeight, columnCount, rowCount } = coordinate;
|
6994
7056
|
const colors = AITable.getColors();
|
6995
7057
|
const visibleColumns = AITable.getVisibleFields(aiTable);
|
6996
|
-
const
|
7058
|
+
const xIsScroll = aiTable.context.scrollState().scrollLeft > 0;
|
6997
7059
|
// 初始化绘图上下文, 为后续的绘制操作做准备
|
6998
7060
|
cellDrawer.initCtx(ctx);
|
6999
7061
|
addRowLayout.initCtx(ctx);
|
@@ -7069,7 +7131,8 @@ const createCells = (config) => {
|
|
7069
7131
|
hiddenIndexColumn: !!context.aiFieldConfig()?.hiddenIndexColumn,
|
7070
7132
|
hiddenRowDrag: !!context.aiFieldConfig()?.hiddenRowDrag,
|
7071
7133
|
readonly: aiTable.context?.readonly?.(),
|
7072
|
-
frozenColumnCount
|
7134
|
+
frozenColumnCount,
|
7135
|
+
xIsScroll
|
7073
7136
|
});
|
7074
7137
|
recordRowLayout.render({
|
7075
7138
|
row,
|
@@ -7082,7 +7145,6 @@ const createCells = (config) => {
|
|
7082
7145
|
const { width, offset } = getCellHorizontalPosition({
|
7083
7146
|
columnIndex,
|
7084
7147
|
columnWidth: isGroupAndFirstColumn ? columnWidth - AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE : columnWidth,
|
7085
|
-
// columnWidth,
|
7086
7148
|
columnCount,
|
7087
7149
|
depth
|
7088
7150
|
});
|
@@ -7148,7 +7210,8 @@ const createCells = (config) => {
|
|
7148
7210
|
hiddenIndexColumn: !!context.aiFieldConfig()?.hiddenIndexColumn,
|
7149
7211
|
hiddenRowDrag: !!context.aiFieldConfig()?.hiddenRowDrag,
|
7150
7212
|
readonly: aiTable.context?.readonly?.(),
|
7151
|
-
frozenColumnCount
|
7213
|
+
frozenColumnCount,
|
7214
|
+
xIsScroll
|
7152
7215
|
});
|
7153
7216
|
const { width, offset } = getCellHorizontalPosition({
|
7154
7217
|
columnIndex,
|
@@ -8176,9 +8239,10 @@ class AITableOtherRows {
|
|
8176
8239
|
break;
|
8177
8240
|
if (maxRecords && aiTable.records().length >= maxRecords)
|
8178
8241
|
break;
|
8179
|
-
const
|
8180
|
-
if (type === AITableRowType.record)
|
8242
|
+
const linearRow = aiTable.context.linearRows()[rowIndex];
|
8243
|
+
if (linearRow.type === AITableRowType.record)
|
8181
8244
|
continue;
|
8245
|
+
const { _id, type } = linearRow;
|
8182
8246
|
const y = coordinate.getRowOffset(rowIndex);
|
8183
8247
|
const curHeight = coordinate.getRowHeight(rowIndex);
|
8184
8248
|
otherRowConfigs.push({
|
@@ -8186,7 +8250,10 @@ class AITableOtherRows {
|
|
8186
8250
|
addBtnConfig: {
|
8187
8251
|
key: `row-add-${_id}`,
|
8188
8252
|
y: y + 1,
|
8189
|
-
name:
|
8253
|
+
name: generateTargetName({
|
8254
|
+
targetName: AI_TABLE_ROW_ADD_BUTTON,
|
8255
|
+
source: _id
|
8256
|
+
}),
|
8190
8257
|
width: coordinate.containerWidth,
|
8191
8258
|
height: curHeight - 1,
|
8192
8259
|
fill: 'transparent'
|
@@ -8335,14 +8402,17 @@ class AITableBackground {
|
|
8335
8402
|
return { x, y };
|
8336
8403
|
});
|
8337
8404
|
this.bgConfig = computed(() => {
|
8338
|
-
const { name, width, height, fill = Colors.transparent,
|
8405
|
+
const { name, width, height, fill = Colors.transparent, opacity, hoverFill, hoverOpacity, listening, borders } = this.config();
|
8406
|
+
const [top, right, bottom, left] = borders || [false, false, false, false];
|
8339
8407
|
const active = this.isHover() || this.isActive();
|
8408
|
+
const strokeWidth = this.strokeWidth() || AI_TABLE_OFFSET;
|
8340
8409
|
const result = {
|
8410
|
+
x: left ? 0 : strokeWidth,
|
8411
|
+
y: top ? 0 : strokeWidth,
|
8412
|
+
width: width - (left ? 0 : strokeWidth) - (right ? 0 : strokeWidth),
|
8413
|
+
height: height - (top ? 0 : strokeWidth) - (bottom ? 0 : strokeWidth),
|
8341
8414
|
name,
|
8342
|
-
width,
|
8343
|
-
height,
|
8344
8415
|
fill: active ? hoverFill || fill : fill,
|
8345
|
-
cornerRadius,
|
8346
8416
|
opacity: active ? hoverOpacity || opacity : opacity,
|
8347
8417
|
listening
|
8348
8418
|
};
|
@@ -8420,46 +8490,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8420
8490
|
}]
|
8421
8491
|
}] });
|
8422
8492
|
|
8423
|
-
class
|
8493
|
+
class AITableShadow {
|
8424
8494
|
constructor() {
|
8425
8495
|
this.config = input.required();
|
8426
|
-
this.
|
8427
|
-
|
8428
|
-
return this.config().coordinate;
|
8429
|
-
});
|
8430
|
-
this.scrollState = computed(() => {
|
8431
|
-
return this.config().aiTable.context.scrollState();
|
8432
|
-
});
|
8433
|
-
this.frozenAreaWidth = computed(() => {
|
8434
|
-
return this.config().aiTable.context.rowHeadWidth() + this.config().coordinate.frozenColumnWidth;
|
8435
|
-
});
|
8436
|
-
this.frozenShadowConfig = computed(() => {
|
8437
|
-
const { aiTable } = this.config();
|
8438
|
-
const coordinate = this.coordinate();
|
8439
|
-
const rowCount = aiTable.gridData().records.length;
|
8440
|
-
const height = this.position() !== 'fieldStats'
|
8441
|
-
? rowCount * coordinate.rowHeight + AI_TABLE_FIELD_HEAD_HEIGHT
|
8442
|
-
: this.config().height;
|
8496
|
+
this.shadowConfig = computed(() => {
|
8497
|
+
const { visible, x, y, width = AI_TABLE_SHADOW_DEFAULT_WIDTH, height } = this.config();
|
8443
8498
|
return {
|
8444
|
-
visible
|
8445
|
-
x
|
8446
|
-
y
|
8447
|
-
width
|
8499
|
+
visible,
|
8500
|
+
x,
|
8501
|
+
y,
|
8502
|
+
width,
|
8448
8503
|
height,
|
8449
8504
|
fillLinearGradientStartPoint: { x: 0, y: 0 },
|
8450
|
-
fillLinearGradientEndPoint: { x:
|
8505
|
+
fillLinearGradientEndPoint: { x: width, y: 0 },
|
8451
8506
|
fillLinearGradientColorStops: [0, 'rgba(0,0,0,0.05)', 1, Colors.transparent]
|
8452
8507
|
};
|
8453
8508
|
});
|
8454
8509
|
}
|
8455
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
8456
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type:
|
8510
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableShadow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
8511
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: AITableShadow, isStandalone: true, selector: "ai-table-shadow", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<ko-rect [config]="shadowConfig()"></ko-rect>`, isInline: true, dependencies: [{ kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
8457
8512
|
}
|
8458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
8513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableShadow, decorators: [{
|
8459
8514
|
type: Component,
|
8460
8515
|
args: [{
|
8461
|
-
selector: 'ai-table-
|
8462
|
-
template: `<ko-rect [config]="
|
8516
|
+
selector: 'ai-table-shadow',
|
8517
|
+
template: `<ko-rect [config]="shadowConfig()"></ko-rect>`,
|
8463
8518
|
imports: [KoShape],
|
8464
8519
|
changeDetection: ChangeDetectionStrategy.OnPush
|
8465
8520
|
}]
|
@@ -8911,177 +8966,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8911
8966
|
args: ['rootGroup']
|
8912
8967
|
}] } });
|
8913
8968
|
|
8914
|
-
|
8915
|
-
|
8916
|
-
|
8917
|
-
|
8918
|
-
|
8919
|
-
|
8920
|
-
|
8921
|
-
|
8922
|
-
|
8923
|
-
|
8924
|
-
|
8925
|
-
|
8926
|
-
|
8927
|
-
|
8928
|
-
|
8929
|
-
|
8930
|
-
|
8931
|
-
|
8932
|
-
|
8933
|
-
|
8934
|
-
|
8935
|
-
|
8936
|
-
|
8937
|
-
|
8938
|
-
? aiTable.expendCell()?.height
|
8939
|
-
? aiTable.expendCell().height + AI_TABLE_CELL_LINE_BORDER
|
8940
|
-
: AI_TABLE_ROW_HEIGHT
|
8941
|
-
: AI_TABLE_ROW_HEIGHT;
|
8942
|
-
return {
|
8943
|
-
x: columnOffset + columnWidth - width / 2 + AI_TABLE_OFFSET,
|
8944
|
-
y: rowOffset + cellHeight - height + AI_TABLE_CELL_BORDER + AI_TABLE_OFFSET,
|
8945
|
-
width,
|
8946
|
-
height,
|
8947
|
-
fill: Colors.primary,
|
8948
|
-
stroke: Colors.white,
|
8949
|
-
strokeWidth: 2,
|
8950
|
-
zIndex: 20,
|
8951
|
-
name: generateTargetName({
|
8952
|
-
targetName: AI_TABLE_FILL_HANDLE,
|
8953
|
-
fieldId,
|
8954
|
-
recordId
|
8955
|
-
})
|
8956
|
-
};
|
8957
|
-
});
|
8958
|
-
}
|
8959
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFillHandle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
8960
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFillHandle, isStandalone: true, selector: "ai-table-fill-handle", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
8961
|
-
@if (showFillHandle()) {
|
8962
|
-
<ko-rect [config]="handleConfig()"></ko-rect>
|
8963
|
-
}
|
8964
|
-
`, isInline: true, dependencies: [{ kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }] }); }
|
8965
|
-
}
|
8966
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFillHandle, decorators: [{
|
8967
|
-
type: Component,
|
8968
|
-
args: [{
|
8969
|
-
selector: 'ai-table-fill-handle',
|
8970
|
-
template: `
|
8971
|
-
@if (showFillHandle()) {
|
8972
|
-
<ko-rect [config]="handleConfig()"></ko-rect>
|
8973
|
-
}
|
8974
|
-
`,
|
8975
|
-
imports: [KoShape]
|
8976
|
-
}]
|
8977
|
-
}] });
|
8978
|
-
|
8979
|
-
class AITableCoverCellEntry {
|
8980
|
-
constructor() {
|
8981
|
-
this.config = input.required();
|
8982
|
-
this.onlyDisplayBorder = input(false);
|
8983
|
-
this.componentMap = {};
|
8984
|
-
this.groupConfig = computed(() => {
|
8985
|
-
return {
|
8986
|
-
x: this.coverCellConfig()?.x,
|
8987
|
-
y: this.coverCellConfig()?.y,
|
8988
|
-
listening: true
|
8989
|
-
};
|
8990
|
-
});
|
8991
|
-
this.coverCellConfig = computed(() => {
|
8992
|
-
const { aiTable, coordinate, references, readonly, actions } = this.config();
|
8993
|
-
const coverCell = this.coverCell();
|
8994
|
-
if (!coverCell) {
|
8995
|
-
return;
|
8996
|
-
}
|
8997
|
-
const { field, recordId, isExpand } = coverCell;
|
8998
|
-
const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
|
8999
|
-
const fieldModel = FieldModelMap[field.type];
|
9000
|
-
const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
|
9001
|
-
const { rowHeight, columnCount, rowCount } = coordinate;
|
9002
|
-
const columnIndex = aiTable.context?.visibleColumnsIndexMap().get(field._id) ?? 0;
|
9003
|
-
const rowIndex = aiTable.context?.visibleRowsIndexMap().get(recordId) ?? 0;
|
9004
|
-
const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
|
9005
|
-
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9006
|
-
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
|
9007
|
-
const { width } = getCellHorizontalPosition({
|
9008
|
-
columnWidth,
|
9009
|
-
columnIndex,
|
9010
|
-
columnCount
|
9011
|
-
});
|
9012
|
-
const style = {
|
9013
|
-
textAlign: DEFAULT_TEXT_ALIGN_LEFT
|
9014
|
-
};
|
9015
|
-
const textAlign = style.textAlign;
|
9016
|
-
const renderX = textAlign === DEFAULT_TEXT_ALIGN_RIGHT
|
9017
|
-
? columnWidth - AI_TABLE_CELL_PADDING + AI_TABLE_OFFSET
|
9018
|
-
: AI_TABLE_CELL_PADDING + AI_TABLE_OFFSET;
|
9019
|
-
const renderY = 0 - AI_TABLE_OFFSET * 2;
|
9020
|
-
const result = {
|
9021
|
-
field,
|
9022
|
-
recordId,
|
9023
|
-
aiTable,
|
9024
|
-
coordinate,
|
9025
|
-
x,
|
9026
|
-
y,
|
9027
|
-
readonly,
|
9028
|
-
actions,
|
9029
|
-
isExpand,
|
9030
|
-
render: {
|
9031
|
-
aiTable,
|
9032
|
-
recordId,
|
9033
|
-
field,
|
9034
|
-
isActive: isSelectedField(field._id, aiTable),
|
9035
|
-
x: renderX,
|
9036
|
-
y: renderY,
|
9037
|
-
columnWidth: width,
|
9038
|
-
rowHeight,
|
9039
|
-
cellValue,
|
9040
|
-
transformValue,
|
9041
|
-
style,
|
9042
|
-
references
|
9043
|
-
}
|
9044
|
-
};
|
9045
|
-
return result;
|
8969
|
+
const createGroupCells = (config) => {
|
8970
|
+
const { coordinate, rowStartIndex, rowStopIndex, columnStartIndex, columnStopIndex, aiTable, actions, readonly } = config;
|
8971
|
+
const linearRows = aiTable.context?.linearRows();
|
8972
|
+
const { columnCount } = coordinate;
|
8973
|
+
const groups = [];
|
8974
|
+
for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
|
8975
|
+
if (rowIndex > columnCount - 1)
|
8976
|
+
break;
|
8977
|
+
if (rowIndex < 0)
|
8978
|
+
continue;
|
8979
|
+
const row = linearRows[rowIndex];
|
8980
|
+
const { depth } = row;
|
8981
|
+
if (row == null)
|
8982
|
+
continue;
|
8983
|
+
if (row.type !== AITableRowType.group)
|
8984
|
+
continue;
|
8985
|
+
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
|
8986
|
+
const rowHeight = coordinate.getRowHeight(rowIndex);
|
8987
|
+
const columnWidth = coordinate.getColumnWidth(columnStartIndex);
|
8988
|
+
const { offset } = getCellHorizontalPosition({
|
8989
|
+
columnIndex: columnStartIndex,
|
8990
|
+
columnWidth,
|
8991
|
+
columnCount,
|
8992
|
+
depth
|
9046
8993
|
});
|
9047
|
-
|
8994
|
+
const x = coordinate.getColumnOffset(columnStartIndex);
|
8995
|
+
const group = {
|
8996
|
+
aiTable,
|
8997
|
+
coordinate,
|
8998
|
+
rowIndex,
|
8999
|
+
x: x + offset + AI_TABLE_CELL_PADDING,
|
9000
|
+
y,
|
9001
|
+
height: rowHeight,
|
9002
|
+
row: {
|
9003
|
+
...row,
|
9004
|
+
rowIndex
|
9005
|
+
},
|
9006
|
+
readonly
|
9007
|
+
};
|
9008
|
+
groups.push(group);
|
9048
9009
|
}
|
9049
|
-
|
9050
|
-
|
9051
|
-
@if (coverCell()) {
|
9052
|
-
<ko-group #rootGroup [config]="groupConfig()">
|
9053
|
-
<ng-container
|
9054
|
-
*ngComponentOutlet="
|
9055
|
-
coverCell()!.renderComponentDefinition;
|
9056
|
-
inputs: { config: coverCellConfig(), onlyDisplayBorder: onlyDisplayBorder() }
|
9057
|
-
"
|
9058
|
-
>
|
9059
|
-
</ng-container>
|
9060
|
-
</ko-group>
|
9061
|
-
}
|
9062
|
-
`, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9063
|
-
}
|
9064
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCoverCellEntry, decorators: [{
|
9065
|
-
type: Component,
|
9066
|
-
args: [{
|
9067
|
-
selector: 'ai-table-cover-cell-entry',
|
9068
|
-
template: `
|
9069
|
-
@if (coverCell()) {
|
9070
|
-
<ko-group #rootGroup [config]="groupConfig()">
|
9071
|
-
<ng-container
|
9072
|
-
*ngComponentOutlet="
|
9073
|
-
coverCell()!.renderComponentDefinition;
|
9074
|
-
inputs: { config: coverCellConfig(), onlyDisplayBorder: onlyDisplayBorder() }
|
9075
|
-
"
|
9076
|
-
>
|
9077
|
-
</ng-container>
|
9078
|
-
</ko-group>
|
9079
|
-
}
|
9080
|
-
`,
|
9081
|
-
imports: [KoContainer, CommonModule],
|
9082
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
9083
|
-
}]
|
9084
|
-
}] });
|
9010
|
+
return groups;
|
9011
|
+
};
|
9085
9012
|
|
9086
9013
|
const createFieldStats = (config) => {
|
9087
9014
|
const { coordinate, columnStartIndex, columnStopIndex, aiTable, actions, y, isHoverStatContainer, readonly } = config;
|
@@ -9097,7 +9024,7 @@ const createFieldStats = (config) => {
|
|
9097
9024
|
const field = fields[columnIndex];
|
9098
9025
|
if (field == null)
|
9099
9026
|
continue;
|
9100
|
-
const x = coordinate.getColumnOffset(columnIndex);
|
9027
|
+
const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
|
9101
9028
|
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9102
9029
|
const fieldStat = {
|
9103
9030
|
aiTable,
|
@@ -9107,7 +9034,7 @@ const createFieldStats = (config) => {
|
|
9107
9034
|
x,
|
9108
9035
|
y,
|
9109
9036
|
width: columnWidth,
|
9110
|
-
height:
|
9037
|
+
height: AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT,
|
9111
9038
|
field,
|
9112
9039
|
stroke: columnIndex === 0 ? colors.transparent : undefined,
|
9113
9040
|
isHoverStatContainer: isHoverStatContainer,
|
@@ -9117,27 +9044,62 @@ const createFieldStats = (config) => {
|
|
9117
9044
|
}
|
9118
9045
|
return fieldStats;
|
9119
9046
|
};
|
9120
|
-
|
9121
|
-
|
9122
|
-
|
9123
|
-
|
9124
|
-
|
9125
|
-
|
9126
|
-
|
9127
|
-
|
9128
|
-
|
9129
|
-
|
9130
|
-
|
9131
|
-
|
9132
|
-
|
9133
|
-
|
9134
|
-
|
9135
|
-
|
9136
|
-
|
9137
|
-
|
9138
|
-
|
9139
|
-
|
9140
|
-
|
9047
|
+
const createGroupFieldStats = (config) => {
|
9048
|
+
const { coordinate, columnStartIndex, columnStopIndex, aiTable, actions, y, height, isHoverStatContainer, readonly, groupRow } = config;
|
9049
|
+
const colors = Colors;
|
9050
|
+
const { columnCount, rowInitSize: fieldHeadHeight } = coordinate;
|
9051
|
+
const fields = aiTable.gridData().fields;
|
9052
|
+
const fieldStats = [];
|
9053
|
+
for (let columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
|
9054
|
+
if (columnIndex > columnCount - 1)
|
9055
|
+
break;
|
9056
|
+
if (columnIndex < 0)
|
9057
|
+
continue;
|
9058
|
+
const field = fields[columnIndex];
|
9059
|
+
if (field == null)
|
9060
|
+
continue;
|
9061
|
+
const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
|
9062
|
+
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9063
|
+
const fieldStat = {
|
9064
|
+
aiTable,
|
9065
|
+
coordinate,
|
9066
|
+
actions,
|
9067
|
+
columnIndex,
|
9068
|
+
x,
|
9069
|
+
y: y,
|
9070
|
+
width: columnWidth,
|
9071
|
+
height: height ?? AI_TABLE_FIELD_HEAD_HEIGHT,
|
9072
|
+
field,
|
9073
|
+
isHoverStatContainer: isHoverStatContainer,
|
9074
|
+
readonly,
|
9075
|
+
isGroupStat: true,
|
9076
|
+
groupRow: groupRow
|
9077
|
+
};
|
9078
|
+
fieldStats.push(fieldStat);
|
9079
|
+
}
|
9080
|
+
return fieldStats;
|
9081
|
+
};
|
9082
|
+
|
9083
|
+
class AITableStatTypeMenu extends ThyDropdownAbstractMenu {
|
9084
|
+
constructor() {
|
9085
|
+
super(...arguments);
|
9086
|
+
this.field = input.required();
|
9087
|
+
this.aiTable = input.required();
|
9088
|
+
this.statMenus = input.required();
|
9089
|
+
this.menuClick = output();
|
9090
|
+
this.selectStatType = computed(() => this.field().stat_type || AITableStatType.None);
|
9091
|
+
}
|
9092
|
+
execute(menu) {
|
9093
|
+
this.menuClick.emit({
|
9094
|
+
menu,
|
9095
|
+
field: this.field()
|
9096
|
+
});
|
9097
|
+
}
|
9098
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableStatTypeMenu, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
9099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableStatTypeMenu, isStandalone: true, selector: "ai-table-stat-type-menu", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: true, transformFunction: null }, statMenus: { classPropertyName: "statMenus", publicName: "statMenus", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { menuClick: "menuClick" }, host: { classAttribute: "stat-type-menu" }, usesInheritance: true, ngImport: i0, template: "@if (field()) {\n @for (menu of statMenus(); track index; let index = $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: selectStatType() === menu.type\n }\"\n (click)=\"execute(menu)\"\n >\n <span>{{ menu.name }}</span>\n </a>\n }\n}\n", dependencies: [{ kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9100
|
+
}
|
9101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableStatTypeMenu, decorators: [{
|
9102
|
+
type: Component,
|
9141
9103
|
args: [{ selector: 'ai-table-stat-type-menu', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
9142
9104
|
class: 'stat-type-menu'
|
9143
9105
|
}, imports: [ThyDropdownMenuItemDirective, NgClass], template: "@if (field()) {\n @for (menu of statMenus(); track index; let index = $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: selectStatType() === menu.type\n }\"\n (click)=\"execute(menu)\"\n >\n <span>{{ menu.name }}</span>\n </a>\n }\n}\n" }]
|
@@ -9161,8 +9123,11 @@ class AITableFieldStat {
|
|
9161
9123
|
y: this.config().y
|
9162
9124
|
};
|
9163
9125
|
});
|
9126
|
+
this.isGroupStat = computed(() => {
|
9127
|
+
return this.config().isGroupStat;
|
9128
|
+
});
|
9164
9129
|
this.bgConfig = computed(() => {
|
9165
|
-
const { field, width, height, coordinate, readonly, aiTable } = this.config();
|
9130
|
+
const { field, width, height, coordinate, readonly, aiTable, isGroupStat, columnIndex } = this.config();
|
9166
9131
|
const rowHeadWidth = aiTable.context.rowHeadWidth();
|
9167
9132
|
const config = {
|
9168
9133
|
coordinate,
|
@@ -9173,27 +9138,50 @@ class AITableFieldStat {
|
|
9173
9138
|
fieldId: field._id,
|
9174
9139
|
mouseStyle: 'pointer'
|
9175
9140
|
}),
|
9176
|
-
width:
|
9141
|
+
width: width,
|
9177
9142
|
height: height,
|
9178
9143
|
fill: Colors.white,
|
9179
9144
|
hoverFill: Colors.gray100,
|
9180
9145
|
opacity: 1,
|
9181
9146
|
listening: !readonly
|
9182
9147
|
};
|
9183
|
-
if (
|
9184
|
-
|
9185
|
-
|
9186
|
-
|
9148
|
+
if (isGroupStat) {
|
9149
|
+
if (columnIndex === 0) {
|
9150
|
+
const textsConfig = this.textsConfig();
|
9151
|
+
if (textsConfig) {
|
9152
|
+
config.x = textsConfig[0].x - AI_TABLE_CELL_PADDING;
|
9153
|
+
config.width = config.width - config.x;
|
9154
|
+
}
|
9155
|
+
else {
|
9156
|
+
config.width = this.noneStatWidth();
|
9157
|
+
config.x = width - this.noneStatWidth();
|
9158
|
+
config.fill = Colors.transparent;
|
9159
|
+
}
|
9160
|
+
}
|
9187
9161
|
}
|
9188
|
-
|
9189
|
-
if (
|
9162
|
+
else {
|
9163
|
+
if (this.renderTexts()) {
|
9164
|
+
config.borders = [false, true, false, true];
|
9165
|
+
config.stroke = Colors.gray200;
|
9166
|
+
config.strokeWidth = AI_TABLE_CELL_LINE_BORDER;
|
9167
|
+
}
|
9168
|
+
else if (this.isLastFrozenColumn()) {
|
9190
9169
|
config.borders = [false, true, false, false];
|
9170
|
+
config.stroke = Colors.gray200;
|
9171
|
+
config.strokeWidth = AI_TABLE_CELL_LINE_BORDER;
|
9191
9172
|
}
|
9192
|
-
|
9193
|
-
|
9173
|
+
if (this.isFirstColumn()) {
|
9174
|
+
if (rowHeadWidth === 0) {
|
9175
|
+
config.borders = [false, true, false, false];
|
9176
|
+
}
|
9177
|
+
else {
|
9178
|
+
config.x = -AI_TABLE_OFFSET;
|
9179
|
+
config.width = config.width + AI_TABLE_OFFSET;
|
9180
|
+
config.borders = [false, true, false, true];
|
9181
|
+
}
|
9182
|
+
config.stroke = Colors.gray200;
|
9183
|
+
config.strokeWidth = AI_TABLE_CELL_LINE_BORDER;
|
9194
9184
|
}
|
9195
|
-
config.stroke = Colors.gray200;
|
9196
|
-
config.strokeWidth = AI_TABLE_CELL_LINE_BORDER;
|
9197
9185
|
}
|
9198
9186
|
return config;
|
9199
9187
|
});
|
@@ -9201,9 +9189,28 @@ class AITableFieldStat {
|
|
9201
9189
|
const { field } = this.config();
|
9202
9190
|
return field;
|
9203
9191
|
});
|
9204
|
-
this.
|
9192
|
+
this.linearRows = computed(() => {
|
9205
9193
|
const { aiTable } = this.config();
|
9206
|
-
return aiTable.
|
9194
|
+
return aiTable.context?.linearRows();
|
9195
|
+
});
|
9196
|
+
this.recordsMap = computed(() => {
|
9197
|
+
const { aiTable } = this.config();
|
9198
|
+
return aiTable.recordsMap();
|
9199
|
+
});
|
9200
|
+
this.groupRow = computed(() => this.config().groupRow);
|
9201
|
+
this.gridData = computed(() => this.config().aiTable.gridData());
|
9202
|
+
this.records = computed(() => {
|
9203
|
+
let records = [];
|
9204
|
+
const groupRow = this.groupRow();
|
9205
|
+
if (this.isGroupStat()) {
|
9206
|
+
if (groupRow.range?.length === 2) {
|
9207
|
+
records = this.gridData().records.slice(groupRow.range[0], groupRow.range[1] + 1);
|
9208
|
+
}
|
9209
|
+
}
|
9210
|
+
else {
|
9211
|
+
records = this.gridData().records;
|
9212
|
+
}
|
9213
|
+
return records;
|
9207
9214
|
});
|
9208
9215
|
this.aiFieldConfig = computed(() => {
|
9209
9216
|
const { aiTable } = this.config();
|
@@ -9236,6 +9243,15 @@ class AITableFieldStat {
|
|
9236
9243
|
const { width } = this.config();
|
9237
9244
|
return width;
|
9238
9245
|
});
|
9246
|
+
this.noneStatWidth = computed(() => {
|
9247
|
+
const noneStatString = getI18nTextByKey(this.aiTable(), AITableGridI18nKey.stat);
|
9248
|
+
const { text, textWidth } = drawer.textEllipsis({
|
9249
|
+
text: noneStatString,
|
9250
|
+
fontSize: DEFAULT_FONT_SIZE,
|
9251
|
+
fontWeight: DEFAULT_FONT_WEIGHT
|
9252
|
+
});
|
9253
|
+
return textWidth + AI_TABLE_ACTION_COMMON_SIZE + AI_TABLE_OFFSET;
|
9254
|
+
});
|
9239
9255
|
this.renderTexts = computed(() => {
|
9240
9256
|
const width = this.containerBoxWidth();
|
9241
9257
|
const field = this.field();
|
@@ -9245,7 +9261,7 @@ class AITableFieldStat {
|
|
9245
9261
|
let resultString = null;
|
9246
9262
|
let formatString = null;
|
9247
9263
|
let statValue = '';
|
9248
|
-
if (this.isFirstColumn() && selectedInfo.isSelected) {
|
9264
|
+
if (this.isFirstColumn() && selectedInfo.isSelected && !this.isGroupStat()) {
|
9249
9265
|
if (selectedInfo.selectedType === 'records') {
|
9250
9266
|
formatString = getI18nTextByKey(this.aiTable(), AITableGridI18nKey.selectedRecordsCount);
|
9251
9267
|
}
|
@@ -9373,6 +9389,10 @@ class AITableFieldStat {
|
|
9373
9389
|
const { columnIndex } = this.config();
|
9374
9390
|
return columnIndex === 0;
|
9375
9391
|
});
|
9392
|
+
this.isLastFrozenColumn = computed(() => {
|
9393
|
+
const { columnIndex, coordinate } = this.config();
|
9394
|
+
return columnIndex === coordinate.frozenColumnCount - 1;
|
9395
|
+
});
|
9376
9396
|
this.iconConfig = computed(() => {
|
9377
9397
|
const { field, width, height } = this.config();
|
9378
9398
|
const commonIconOffsetY = (height - AI_TABLE_ACTION_COMMON_SIZE) / 2;
|
@@ -9489,140 +9509,361 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9489
9509
|
}]
|
9490
9510
|
}] });
|
9491
9511
|
|
9492
|
-
class
|
9512
|
+
class AITableGroups {
|
9493
9513
|
constructor() {
|
9494
9514
|
this.config = input.required();
|
9495
|
-
this.
|
9496
|
-
|
9497
|
-
|
9498
|
-
|
9499
|
-
|
9500
|
-
|
9501
|
-
|
9502
|
-
|
9503
|
-
this.
|
9515
|
+
this.frozenColumnCount = computed(() => {
|
9516
|
+
const { coordinate } = this.config();
|
9517
|
+
return coordinate.frozenColumnCount ?? 0;
|
9518
|
+
});
|
9519
|
+
this.columnStartIndex = computed(() => {
|
9520
|
+
const { columnStartIndex } = this.config();
|
9521
|
+
return Math.max(columnStartIndex, this.frozenColumnCount());
|
9522
|
+
});
|
9523
|
+
this.groups = computed(() => {
|
9524
|
+
return createGroupCells({
|
9525
|
+
...this.config(),
|
9526
|
+
columnStartIndex: this.columnStartIndex()
|
9527
|
+
});
|
9528
|
+
});
|
9529
|
+
this.groupCells = computed(() => {
|
9530
|
+
const groups = this.groups();
|
9531
|
+
const groupCells = [];
|
9532
|
+
groups.forEach((group) => {
|
9533
|
+
const { row, x = 0, y = 0 } = group;
|
9534
|
+
const groupStats = createGroupFieldStats({
|
9535
|
+
...this.config(),
|
9536
|
+
groupRow: row,
|
9537
|
+
x,
|
9538
|
+
y,
|
9539
|
+
columnStartIndex: this.columnStartIndex()
|
9540
|
+
});
|
9541
|
+
groupStats.forEach((groupStat) => {
|
9542
|
+
groupCells.push({ groupStat: groupStat });
|
9543
|
+
});
|
9544
|
+
});
|
9545
|
+
return groupCells;
|
9546
|
+
});
|
9504
9547
|
}
|
9505
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
9506
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type:
|
9507
|
-
|
9508
|
-
|
9509
|
-
|
9510
|
-
|
9511
|
-
</ko-group>
|
9512
|
-
`, isInline: true, dependencies: [{ kind: "component", type: AITableFieldStat, selector: "ai-table-field-stat", inputs: ["config"], outputs: ["hover"] }, { kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9548
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGroups, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9549
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableGroups, isStandalone: true, selector: "ai-table-groups", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
9550
|
+
@for (groupCell of groupCells(); track $index) {
|
9551
|
+
<ai-table-field-stat [config]="groupCell.groupStat!"></ai-table-field-stat>
|
9552
|
+
}
|
9553
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AITableFieldStat, selector: "ai-table-field-stat", inputs: ["config"], outputs: ["hover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9513
9554
|
}
|
9514
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
9555
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGroups, decorators: [{
|
9515
9556
|
type: Component,
|
9516
9557
|
args: [{
|
9517
|
-
selector: 'ai-table-
|
9558
|
+
selector: 'ai-table-groups',
|
9518
9559
|
template: `
|
9519
|
-
|
9520
|
-
|
9521
|
-
|
9522
|
-
}
|
9523
|
-
</ko-group>
|
9560
|
+
@for (groupCell of groupCells(); track $index) {
|
9561
|
+
<ai-table-field-stat [config]="groupCell.groupStat!"></ai-table-field-stat>
|
9562
|
+
}
|
9524
9563
|
`,
|
9525
|
-
imports: [
|
9564
|
+
imports: [CommonModule, AITableFieldStat],
|
9526
9565
|
changeDetection: ChangeDetectionStrategy.OnPush
|
9527
9566
|
}]
|
9528
9567
|
}] });
|
9529
9568
|
|
9530
|
-
const createGroupCells = (config) => {
|
9531
|
-
const { coordinate, rowStartIndex, rowStopIndex, columnStartIndex, columnStopIndex, aiTable, actions, readonly } = config;
|
9532
|
-
const linearRows = aiTable.context?.linearRows();
|
9533
|
-
const { columnCount } = coordinate;
|
9534
|
-
const groups = [];
|
9535
|
-
for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
|
9536
|
-
if (rowIndex > columnCount - 1)
|
9537
|
-
break;
|
9538
|
-
if (rowIndex < 0)
|
9539
|
-
continue;
|
9540
|
-
const row = linearRows[rowIndex];
|
9541
|
-
const { depth } = row;
|
9542
|
-
if (row == null)
|
9543
|
-
continue;
|
9544
|
-
if (row.type !== AITableRowType.group)
|
9545
|
-
continue;
|
9546
|
-
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
|
9547
|
-
const rowHeight = coordinate.getRowHeight(rowIndex);
|
9548
|
-
for (let columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
|
9549
|
-
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9550
|
-
const { width, offset } = getCellHorizontalPosition({
|
9551
|
-
columnIndex,
|
9552
|
-
columnWidth,
|
9553
|
-
columnCount,
|
9554
|
-
depth
|
9555
|
-
});
|
9556
|
-
const x = coordinate.getColumnOffset(columnIndex);
|
9557
|
-
const group = {
|
9558
|
-
aiTable,
|
9559
|
-
coordinate,
|
9560
|
-
columnIndex,
|
9561
|
-
x: x + offset + AI_TABLE_CELL_PADDING,
|
9562
|
-
y,
|
9563
|
-
width,
|
9564
|
-
height: rowHeight,
|
9565
|
-
row,
|
9566
|
-
readonly
|
9567
|
-
};
|
9568
|
-
groups.push(group);
|
9569
|
-
}
|
9570
|
-
}
|
9571
|
-
return groups;
|
9572
|
-
};
|
9573
|
-
|
9574
9569
|
class AITableFrozenGroups {
|
9575
9570
|
constructor() {
|
9576
9571
|
this.config = input.required();
|
9577
|
-
this.
|
9572
|
+
this.frozenColumnCount = computed(() => {
|
9578
9573
|
const { coordinate } = this.config();
|
9579
|
-
|
9574
|
+
return coordinate.frozenColumnCount ?? 0;
|
9575
|
+
});
|
9576
|
+
this.columnStopIndex = computed(() => {
|
9577
|
+
return this.frozenColumnCount() - 1;
|
9578
|
+
});
|
9579
|
+
this.groups = computed(() => {
|
9580
9580
|
return createGroupCells({
|
9581
9581
|
...this.config(),
|
9582
9582
|
columnStartIndex: 0,
|
9583
|
-
columnStopIndex:
|
9583
|
+
columnStopIndex: this.columnStopIndex()
|
9584
9584
|
});
|
9585
9585
|
});
|
9586
|
-
this.
|
9587
|
-
const
|
9588
|
-
const
|
9589
|
-
|
9590
|
-
const { row, x, y, height,
|
9591
|
-
|
9592
|
-
|
9593
|
-
|
9594
|
-
|
9595
|
-
|
9596
|
-
|
9597
|
-
|
9598
|
-
|
9599
|
-
|
9600
|
-
|
9601
|
-
|
9602
|
-
|
9603
|
-
|
9604
|
-
|
9586
|
+
this.groupCells = computed(() => {
|
9587
|
+
const groups = this.groups();
|
9588
|
+
const groupCells = [];
|
9589
|
+
groups.forEach((group) => {
|
9590
|
+
const { row, x = 0, y = 0, height, readonly } = group;
|
9591
|
+
const { isCollapsed, fieldId, groupId } = row;
|
9592
|
+
const collapsedIcon = {
|
9593
|
+
name: generateTargetName({
|
9594
|
+
targetName: AI_TABLE_ROW_GROUP_COLLAPSE_BUTTON,
|
9595
|
+
fieldId: fieldId,
|
9596
|
+
source: groupId,
|
9597
|
+
mouseStyle: readonly ? 'default' : 'pointer'
|
9598
|
+
}),
|
9599
|
+
x,
|
9600
|
+
y: y + (height - AI_TABLE_ICON_COMMON_SIZE) / 2,
|
9601
|
+
data: isCollapsed ? AngleRightPath : AngleDownPath
|
9602
|
+
};
|
9603
|
+
const groupStats = createGroupFieldStats({
|
9604
|
+
...this.config(),
|
9605
|
+
groupRow: row,
|
9606
|
+
x,
|
9607
|
+
y,
|
9608
|
+
columnStartIndex: 0,
|
9609
|
+
columnStopIndex: this.columnStopIndex()
|
9610
|
+
});
|
9611
|
+
groupStats.forEach((groupStat) => {
|
9612
|
+
const groupCell = {
|
9613
|
+
collapsedIcon: undefined,
|
9614
|
+
groupStat: undefined
|
9615
|
+
};
|
9616
|
+
if (groupStat.columnIndex === 0) {
|
9617
|
+
groupCell.collapsedIcon = collapsedIcon;
|
9618
|
+
}
|
9619
|
+
groupCell.groupStat = groupStat;
|
9620
|
+
groupCells.push(groupCell);
|
9621
|
+
});
|
9605
9622
|
});
|
9606
|
-
return
|
9623
|
+
return groupCells;
|
9607
9624
|
});
|
9608
9625
|
}
|
9609
9626
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFrozenGroups, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9610
9627
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFrozenGroups, isStandalone: true, selector: "ai-table-frozen-groups", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
9611
|
-
@for (
|
9612
|
-
|
9628
|
+
@for (groupCell of groupCells(); track $index) {
|
9629
|
+
@if (groupCell.collapsedIcon) {
|
9630
|
+
<ai-table-icon [config]="groupCell.collapsedIcon"></ai-table-icon>
|
9631
|
+
}
|
9632
|
+
<ai-table-field-stat [config]="groupCell.groupStat!"></ai-table-field-stat>
|
9613
9633
|
}
|
9614
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"], outputs: ["koClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9634
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"], outputs: ["koClick"] }, { kind: "component", type: AITableFieldStat, selector: "ai-table-field-stat", inputs: ["config"], outputs: ["hover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9615
9635
|
}
|
9616
9636
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFrozenGroups, decorators: [{
|
9617
9637
|
type: Component,
|
9618
9638
|
args: [{
|
9619
9639
|
selector: 'ai-table-frozen-groups',
|
9620
9640
|
template: `
|
9621
|
-
@for (
|
9622
|
-
|
9641
|
+
@for (groupCell of groupCells(); track $index) {
|
9642
|
+
@if (groupCell.collapsedIcon) {
|
9643
|
+
<ai-table-icon [config]="groupCell.collapsedIcon"></ai-table-icon>
|
9644
|
+
}
|
9645
|
+
<ai-table-field-stat [config]="groupCell.groupStat!"></ai-table-field-stat>
|
9623
9646
|
}
|
9624
9647
|
`,
|
9625
|
-
imports: [CommonModule, AITableIcon],
|
9648
|
+
imports: [CommonModule, AITableIcon, AITableFieldStat],
|
9649
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
9650
|
+
}]
|
9651
|
+
}] });
|
9652
|
+
|
9653
|
+
class AITableFillHandle {
|
9654
|
+
constructor() {
|
9655
|
+
this.config = input.required();
|
9656
|
+
this.showFillHandle = computed(() => {
|
9657
|
+
const { aiTable, readonly } = this.config();
|
9658
|
+
const selection = aiTable.selection();
|
9659
|
+
const hasSelectedCells = selection.selectedCells.size > 0;
|
9660
|
+
const isEditingCell = !!aiTable.editingCell()?.path;
|
9661
|
+
return hasSelectedCells && !readonly && !isEditingCell;
|
9662
|
+
});
|
9663
|
+
this.handleConfig = computed(() => {
|
9664
|
+
const { aiTable, coordinate } = this.config();
|
9665
|
+
const selectedCells = Array.from(aiTable.selection().selectedCells);
|
9666
|
+
const lastCell = selectedCells[selectedCells.length - 1];
|
9667
|
+
const [recordId, fieldId] = lastCell.split(':');
|
9668
|
+
const columnIndex = aiTable.context.visibleColumnsIndexMap().get(fieldId);
|
9669
|
+
const columnOffset = coordinate.getColumnOffset(columnIndex);
|
9670
|
+
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9671
|
+
const rowIndex = aiTable.context.visibleRowsIndexMap().get(recordId);
|
9672
|
+
const rowOffset = coordinate.getRowOffset(rowIndex);
|
9673
|
+
const width = 6;
|
9674
|
+
const height = 6;
|
9675
|
+
const [expandRecordId, expandFieldId] = aiTable.expendCell()?.path || [null, null];
|
9676
|
+
const cellHeight = expandRecordId === recordId && expandFieldId === fieldId && aiTable.expendCell()?.height
|
9677
|
+
? aiTable.expendCell()?.height
|
9678
|
+
? aiTable.expendCell().height + AI_TABLE_CELL_LINE_BORDER
|
9679
|
+
: AI_TABLE_ROW_HEIGHT
|
9680
|
+
: AI_TABLE_ROW_HEIGHT;
|
9681
|
+
return {
|
9682
|
+
x: columnOffset + columnWidth - width / 2 + AI_TABLE_OFFSET,
|
9683
|
+
y: rowOffset + cellHeight - height + AI_TABLE_CELL_BORDER + AI_TABLE_OFFSET,
|
9684
|
+
width,
|
9685
|
+
height,
|
9686
|
+
fill: Colors.primary,
|
9687
|
+
stroke: Colors.white,
|
9688
|
+
strokeWidth: 2,
|
9689
|
+
zIndex: 20,
|
9690
|
+
name: generateTargetName({
|
9691
|
+
targetName: AI_TABLE_FILL_HANDLE,
|
9692
|
+
fieldId,
|
9693
|
+
recordId
|
9694
|
+
})
|
9695
|
+
};
|
9696
|
+
});
|
9697
|
+
}
|
9698
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFillHandle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9699
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFillHandle, isStandalone: true, selector: "ai-table-fill-handle", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
9700
|
+
@if (showFillHandle()) {
|
9701
|
+
<ko-rect [config]="handleConfig()"></ko-rect>
|
9702
|
+
}
|
9703
|
+
`, isInline: true, dependencies: [{ kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }] }); }
|
9704
|
+
}
|
9705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFillHandle, decorators: [{
|
9706
|
+
type: Component,
|
9707
|
+
args: [{
|
9708
|
+
selector: 'ai-table-fill-handle',
|
9709
|
+
template: `
|
9710
|
+
@if (showFillHandle()) {
|
9711
|
+
<ko-rect [config]="handleConfig()"></ko-rect>
|
9712
|
+
}
|
9713
|
+
`,
|
9714
|
+
imports: [KoShape]
|
9715
|
+
}]
|
9716
|
+
}] });
|
9717
|
+
|
9718
|
+
class AITableCoverCellEntry {
|
9719
|
+
constructor() {
|
9720
|
+
this.config = input.required();
|
9721
|
+
this.onlyDisplayBorder = input(false);
|
9722
|
+
this.componentMap = {};
|
9723
|
+
this.groupConfig = computed(() => {
|
9724
|
+
return {
|
9725
|
+
x: this.coverCellConfig()?.x,
|
9726
|
+
y: this.coverCellConfig()?.y,
|
9727
|
+
listening: true
|
9728
|
+
};
|
9729
|
+
});
|
9730
|
+
this.coverCellConfig = computed(() => {
|
9731
|
+
const { aiTable, coordinate, references, readonly, actions } = this.config();
|
9732
|
+
const coverCell = this.coverCell();
|
9733
|
+
if (!coverCell) {
|
9734
|
+
return;
|
9735
|
+
}
|
9736
|
+
const { field, recordId, isExpand } = coverCell;
|
9737
|
+
const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
|
9738
|
+
const fieldModel = FieldModelMap[field.type];
|
9739
|
+
const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
|
9740
|
+
const { rowHeight, columnCount, rowCount } = coordinate;
|
9741
|
+
const columnIndex = aiTable.context?.visibleColumnsIndexMap().get(field._id) ?? 0;
|
9742
|
+
const rowIndex = aiTable.context?.visibleRowsIndexMap().get(recordId) ?? 0;
|
9743
|
+
const row = aiTable.context?.linearRows()[rowIndex];
|
9744
|
+
const depth = row?.depth ?? 0;
|
9745
|
+
const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
|
9746
|
+
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
9747
|
+
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
|
9748
|
+
const isGroupAndFirstColumn = depth > 0 && columnIndex === 0;
|
9749
|
+
const { width, offset } = getCellHorizontalPosition({
|
9750
|
+
columnIndex,
|
9751
|
+
columnWidth: isGroupAndFirstColumn ? columnWidth - AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE : columnWidth,
|
9752
|
+
columnCount,
|
9753
|
+
depth
|
9754
|
+
});
|
9755
|
+
let realX = x + offset;
|
9756
|
+
if (isGroupAndFirstColumn) {
|
9757
|
+
realX += AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
9758
|
+
}
|
9759
|
+
const style = {
|
9760
|
+
textAlign: DEFAULT_TEXT_ALIGN_LEFT
|
9761
|
+
};
|
9762
|
+
const textAlign = style.textAlign;
|
9763
|
+
const renderX = textAlign === DEFAULT_TEXT_ALIGN_RIGHT
|
9764
|
+
? columnWidth - AI_TABLE_CELL_PADDING + AI_TABLE_OFFSET
|
9765
|
+
: AI_TABLE_CELL_PADDING + AI_TABLE_OFFSET;
|
9766
|
+
const renderY = 0 - AI_TABLE_OFFSET * 2;
|
9767
|
+
const result = {
|
9768
|
+
field,
|
9769
|
+
recordId,
|
9770
|
+
aiTable,
|
9771
|
+
coordinate,
|
9772
|
+
x: realX,
|
9773
|
+
y,
|
9774
|
+
readonly,
|
9775
|
+
actions,
|
9776
|
+
isExpand,
|
9777
|
+
render: {
|
9778
|
+
aiTable,
|
9779
|
+
recordId,
|
9780
|
+
field,
|
9781
|
+
isActive: isSelectedField(field._id, aiTable),
|
9782
|
+
x: renderX,
|
9783
|
+
y: renderY,
|
9784
|
+
columnWidth: width,
|
9785
|
+
rowHeight,
|
9786
|
+
cellValue,
|
9787
|
+
transformValue,
|
9788
|
+
style,
|
9789
|
+
references
|
9790
|
+
}
|
9791
|
+
};
|
9792
|
+
return result;
|
9793
|
+
});
|
9794
|
+
this.coverCell = computed(() => getCoverCell(this.config().aiTable));
|
9795
|
+
}
|
9796
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCoverCellEntry, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9797
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCoverCellEntry, isStandalone: true, selector: "ai-table-cover-cell-entry", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, onlyDisplayBorder: { classPropertyName: "onlyDisplayBorder", publicName: "onlyDisplayBorder", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
9798
|
+
@if (coverCell()) {
|
9799
|
+
<ko-group #rootGroup [config]="groupConfig()">
|
9800
|
+
<ng-container
|
9801
|
+
*ngComponentOutlet="
|
9802
|
+
coverCell()!.renderComponentDefinition;
|
9803
|
+
inputs: { config: coverCellConfig(), onlyDisplayBorder: onlyDisplayBorder() }
|
9804
|
+
"
|
9805
|
+
>
|
9806
|
+
</ng-container>
|
9807
|
+
</ko-group>
|
9808
|
+
}
|
9809
|
+
`, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9810
|
+
}
|
9811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCoverCellEntry, decorators: [{
|
9812
|
+
type: Component,
|
9813
|
+
args: [{
|
9814
|
+
selector: 'ai-table-cover-cell-entry',
|
9815
|
+
template: `
|
9816
|
+
@if (coverCell()) {
|
9817
|
+
<ko-group #rootGroup [config]="groupConfig()">
|
9818
|
+
<ng-container
|
9819
|
+
*ngComponentOutlet="
|
9820
|
+
coverCell()!.renderComponentDefinition;
|
9821
|
+
inputs: { config: coverCellConfig(), onlyDisplayBorder: onlyDisplayBorder() }
|
9822
|
+
"
|
9823
|
+
>
|
9824
|
+
</ng-container>
|
9825
|
+
</ko-group>
|
9826
|
+
}
|
9827
|
+
`,
|
9828
|
+
imports: [KoContainer, CommonModule],
|
9829
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
9830
|
+
}]
|
9831
|
+
}] });
|
9832
|
+
|
9833
|
+
class AITableFieldStats {
|
9834
|
+
constructor() {
|
9835
|
+
this.config = input.required();
|
9836
|
+
this.hover = output();
|
9837
|
+
this.isHover = signal(false);
|
9838
|
+
this.statConfigs = computed(() => createFieldStats(this.config()));
|
9839
|
+
}
|
9840
|
+
onMouseenter(e) {
|
9841
|
+
this.isHover.set(true);
|
9842
|
+
}
|
9843
|
+
onMouseleave(e) {
|
9844
|
+
this.isHover.set(false);
|
9845
|
+
}
|
9846
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldStats, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9847
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFieldStats, isStandalone: true, selector: "ai-table-column-stats", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { hover: "hover" }, ngImport: i0, template: `
|
9848
|
+
<ko-group>
|
9849
|
+
@for (config of statConfigs(); track $index) {
|
9850
|
+
<ai-table-field-stat [config]="config" (hover)="hover.emit($event)"></ai-table-field-stat>
|
9851
|
+
}
|
9852
|
+
</ko-group>
|
9853
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AITableFieldStat, selector: "ai-table-field-stat", inputs: ["config"], outputs: ["hover"] }, { kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9854
|
+
}
|
9855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldStats, decorators: [{
|
9856
|
+
type: Component,
|
9857
|
+
args: [{
|
9858
|
+
selector: 'ai-table-column-stats',
|
9859
|
+
template: `
|
9860
|
+
<ko-group>
|
9861
|
+
@for (config of statConfigs(); track $index) {
|
9862
|
+
<ai-table-field-stat [config]="config" (hover)="hover.emit($event)"></ai-table-field-stat>
|
9863
|
+
}
|
9864
|
+
</ko-group>
|
9865
|
+
`,
|
9866
|
+
imports: [AITableFieldStat, KoContainer],
|
9626
9867
|
changeDetection: ChangeDetectionStrategy.OnPush
|
9627
9868
|
}]
|
9628
9869
|
}] });
|
@@ -9710,6 +9951,14 @@ class AITableRenderer {
|
|
9710
9951
|
this.scrollTotalWidth = computed(() => {
|
9711
9952
|
return this.coordinate().totalWidth + AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
|
9712
9953
|
});
|
9954
|
+
this.frozenCommonGroupConfig = computed(() => {
|
9955
|
+
return {
|
9956
|
+
clipX: 0,
|
9957
|
+
clipY: AI_TABLE_FIELD_HEAD_HEIGHT,
|
9958
|
+
clipWidth: this.frozenAreaWidth() + AI_TABLE_SHADOW_DEFAULT_WIDTH,
|
9959
|
+
clipHeight: this.gridContainerHeight()
|
9960
|
+
};
|
9961
|
+
});
|
9713
9962
|
this.commonGroupConfig = computed(() => {
|
9714
9963
|
return {
|
9715
9964
|
clipX: this.frozenAreaWidth() + 1,
|
@@ -9809,11 +10058,32 @@ class AITableRenderer {
|
|
9809
10058
|
...this.columnHeadFieldConfig(),
|
9810
10059
|
width: this.cellGroupClipWidth(),
|
9811
10060
|
x: this.frozenAreaWidth(),
|
9812
|
-
y:
|
10061
|
+
y: 0,
|
9813
10062
|
height: AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT,
|
9814
10063
|
isHoverStatContainer: this.isHoverStatContainer()
|
9815
10064
|
};
|
9816
10065
|
});
|
10066
|
+
this.xIsScroll = computed(() => {
|
10067
|
+
return this.scrollState().scrollLeft > 0;
|
10068
|
+
});
|
10069
|
+
this.statShadowConfig = computed(() => {
|
10070
|
+
return {
|
10071
|
+
width: 8,
|
10072
|
+
x: this.frozenAreaWidth() + 1,
|
10073
|
+
y: AI_TABLE_OFFSET,
|
10074
|
+
height: AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT,
|
10075
|
+
visible: this.xIsScroll()
|
10076
|
+
};
|
10077
|
+
});
|
10078
|
+
this.fieldHeadShadowConfig = computed(() => {
|
10079
|
+
return {
|
10080
|
+
width: AI_TABLE_SHADOW_DEFAULT_WIDTH,
|
10081
|
+
x: this.frozenAreaWidth() + 1,
|
10082
|
+
y: AI_TABLE_OFFSET,
|
10083
|
+
height: AI_TABLE_FIELD_HEAD_HEIGHT,
|
10084
|
+
visible: this.xIsScroll()
|
10085
|
+
};
|
10086
|
+
});
|
9817
10087
|
this.columnFieldStatsBgConfig = computed(() => {
|
9818
10088
|
return {
|
9819
10089
|
x: 0,
|
@@ -9834,7 +10104,7 @@ class AITableRenderer {
|
|
9834
10104
|
...this.columnHeadFieldConfig(),
|
9835
10105
|
width: this.frozenAreaWidth(),
|
9836
10106
|
x: 0,
|
9837
|
-
y:
|
10107
|
+
y: 0,
|
9838
10108
|
columnStartIndex: 0,
|
9839
10109
|
columnStopIndex: this.coordinate().frozenColumnCount - 1,
|
9840
10110
|
height: AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT,
|
@@ -9883,13 +10153,16 @@ class AITableRenderer {
|
|
9883
10153
|
const { aiTable } = this.config();
|
9884
10154
|
const expandCellPath = aiTable.expendCell()?.path;
|
9885
10155
|
if (expandCellPath) {
|
9886
|
-
const
|
9887
|
-
|
9888
|
-
|
9889
|
-
|
9890
|
-
|
9891
|
-
|
9892
|
-
|
10156
|
+
const cellIndex = AITable.getCellIndex(aiTable, expandCellPath);
|
10157
|
+
if (cellIndex) {
|
10158
|
+
const { columnIndex } = cellIndex;
|
10159
|
+
const isFrozenColumn = columnIndex < aiTable.context.frozenColumnCount();
|
10160
|
+
if (isFrozenColumn) {
|
10161
|
+
frozenExpandCellBorder = true;
|
10162
|
+
}
|
10163
|
+
else {
|
10164
|
+
expandCellBorder = true;
|
10165
|
+
}
|
9893
10166
|
}
|
9894
10167
|
}
|
9895
10168
|
return {
|
@@ -9926,7 +10199,7 @@ class AITableRenderer {
|
|
9926
10199
|
this.isHoverStatContainer.set(isHover);
|
9927
10200
|
}
|
9928
10201
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9929
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableRenderer, isStandalone: true, selector: "ai-table-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koMousemove: "koMousemove", koMousedown: "koMousedown", koMouseup: "koMouseup", koContextmenu: "koContextmenu", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick", koMouseleave: "koMouseleave", onScrollPosition: "onScrollPosition" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\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 <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"
|
10202
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableRenderer, isStandalone: true, selector: "ai-table-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koMousemove: "koMousemove", koMousedown: "koMousedown", koMouseup: "koMouseup", koContextmenu: "koContextmenu", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick", koMouseleave: "koMouseleave", onScrollPosition: "onScrollPosition" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\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 <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <!-- \u53F3\u4FA7\u975E\u56FA\u5B9A\u5217\u7684\u533A\u57DF -->\n <ko-group [config]=\"commonGroupConfig()\">\n <!-- \u53F3\u4FA7x,y\u6EDA\u52A8\u533A\u57DF\u7684 cell -->\n <ko-group #commonOffsetGroup [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\"></ai-table-cover-cell-entry>\n <ai-table-groups [config]=\"cellsConfig()\"></ai-table-groups>\n </ko-group>\n\n <!-- \u53F3\u4FA7\u8868\u5934head \u548C \u65B0\u589E\u5217 + \u533A\u57DF -->\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <!-- \u5DE6\u4FA7\u56FA\u5B9A\u5217 y\u6EDA\u52A8\u533A\u57DF\u7684cell -->\n <ko-group [config]=\"frozenCommonGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n @if (!hiddenIndexColumn()) {\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n }\n <ai-table-frozen-groups [config]=\"cellsConfig()\"></ai-table-frozen-groups>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n </ko-group>\n\n <!-- \u5DE6\u4FA7\u56FA\u5B9A\u5217 \u8868\u5934 + \u8868\u5934\u53F3\u4FA7\u5206\u5272\u9634\u5F71 -->\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnFrozenHeadFieldConfig()\"></ai-table-frozen-column-heads>\n <ai-table-shadow [config]=\"fieldHeadShadowConfig()\"></ai-table-shadow>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().expandCellBorder) {\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-cover-cell-entry>\n }\n @if (!isLastSelectedCellInFrozenColumn()) {\n <ai-table-fill-handle [config]=\"fillHandleConfig()\"></ai-table-fill-handle>\n }\n </ko-group>\n </ko-group>\n <ko-group [config]=\"frozenCoverAttachGroupConfig()\">\n <ko-group #frozenCoverAttachOffsetGroup [config]=\"offsetYConfig()\">\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\"></ai-table-cover-cell-entry>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().frozenExpandCellBorder) {\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-cover-cell-entry>\n }\n @if (isLastSelectedCellInFrozenColumn()) {\n <ai-table-fill-handle [config]=\"fillHandleConfig()\"></ai-table-fill-handle>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"statGroupConfig()\">\n <ai-table-background [config]=\"columnFieldStatsBgConfig()\"></ai-table-background>\n <ko-group>\n <ai-table-column-stats\n [config]=\"columnFrozenFieldStatsConfig()\"\n (hover)=\"onStatContainerHover($event)\"\n ></ai-table-column-stats>\n </ko-group>\n <ko-group [config]=\"statCommonGroupConfig()\">\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-stats\n [config]=\"columnFieldStatsConfig()\"\n (hover)=\"onStatContainerHover($event)\"\n ></ai-table-column-stats>\n </ko-group>\n </ko-group>\n <ko-group>\n <ai-table-shadow [config]=\"statShadowConfig()\"></ai-table-shadow>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: KoStage, selector: "ko-stage", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: AITableColumnHeads, selector: "ai-table-column-heads", inputs: ["config"] }, { kind: "component", type: AITableFrozenColumnHeads, selector: "ai-table-frozen-column-heads", inputs: ["config"] }, { kind: "component", type: AITableCells, selector: "ai-table-cells", inputs: ["config"] }, { kind: "component", type: AITableFrozenCells, selector: "ai-table-frozen-cells", inputs: ["config"] }, { kind: "component", type: AITableFrozenPlaceholderCells, selector: "ai-table-frozen-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITableCoverCellEntry, selector: "ai-table-cover-cell-entry", inputs: ["config", "onlyDisplayBorder"] }, { kind: "component", type: AITablePlaceholderCells, selector: "ai-table-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITableAddField, selector: "ai-table-add-field", inputs: ["config"] }, { kind: "component", type: AITableHoverRowHeads, selector: "ai-table-hover-row-heads", inputs: ["config"] }, { kind: "component", type: AITableOtherRows, selector: "ai-table-other-rows", inputs: ["config"] }, { kind: "component", type: AITableFillHandle, selector: "ai-table-fill-handle", inputs: ["config"] }, { kind: "component", type: AITableFieldStats, selector: "ai-table-column-stats", inputs: ["config"], outputs: ["hover"] }, { kind: "component", type: AITableBackground, selector: "ai-table-background", inputs: ["config", "isActive", "isHover"], outputs: ["koClick", "hover", "koMouseenter", "koMouseleave", "isHoverChange"] }, { kind: "component", type: AITableFrozenGroups, selector: "ai-table-frozen-groups", inputs: ["config"] }, { kind: "component", type: AITableGroups, selector: "ai-table-groups", inputs: ["config"] }, { kind: "component", type: AITableShadow, selector: "ai-table-shadow", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9930
10203
|
}
|
9931
10204
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableRenderer, decorators: [{
|
9932
10205
|
type: Component,
|
@@ -9947,9 +10220,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9947
10220
|
AITableFillHandle,
|
9948
10221
|
AITableFieldStats,
|
9949
10222
|
AITableBackground,
|
9950
|
-
|
10223
|
+
AITableFrozenGroups,
|
10224
|
+
AITableGroups,
|
10225
|
+
AITableShadow,
|
9951
10226
|
AITableFrozenGroups
|
9952
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\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 <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"
|
10227
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\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 <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <!-- \u53F3\u4FA7\u975E\u56FA\u5B9A\u5217\u7684\u533A\u57DF -->\n <ko-group [config]=\"commonGroupConfig()\">\n <!-- \u53F3\u4FA7x,y\u6EDA\u52A8\u533A\u57DF\u7684 cell -->\n <ko-group #commonOffsetGroup [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\"></ai-table-cover-cell-entry>\n <ai-table-groups [config]=\"cellsConfig()\"></ai-table-groups>\n </ko-group>\n\n <!-- \u53F3\u4FA7\u8868\u5934head \u548C \u65B0\u589E\u5217 + \u533A\u57DF -->\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <!-- \u5DE6\u4FA7\u56FA\u5B9A\u5217 y\u6EDA\u52A8\u533A\u57DF\u7684cell -->\n <ko-group [config]=\"frozenCommonGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n @if (!hiddenIndexColumn()) {\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n }\n <ai-table-frozen-groups [config]=\"cellsConfig()\"></ai-table-frozen-groups>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n </ko-group>\n\n <!-- \u5DE6\u4FA7\u56FA\u5B9A\u5217 \u8868\u5934 + \u8868\u5934\u53F3\u4FA7\u5206\u5272\u9634\u5F71 -->\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnFrozenHeadFieldConfig()\"></ai-table-frozen-column-heads>\n <ai-table-shadow [config]=\"fieldHeadShadowConfig()\"></ai-table-shadow>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().expandCellBorder) {\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-cover-cell-entry>\n }\n @if (!isLastSelectedCellInFrozenColumn()) {\n <ai-table-fill-handle [config]=\"fillHandleConfig()\"></ai-table-fill-handle>\n }\n </ko-group>\n </ko-group>\n <ko-group [config]=\"frozenCoverAttachGroupConfig()\">\n <ko-group #frozenCoverAttachOffsetGroup [config]=\"offsetYConfig()\">\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\"></ai-table-cover-cell-entry>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().frozenExpandCellBorder) {\n <ai-table-cover-cell-entry [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-cover-cell-entry>\n }\n @if (isLastSelectedCellInFrozenColumn()) {\n <ai-table-fill-handle [config]=\"fillHandleConfig()\"></ai-table-fill-handle>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"statGroupConfig()\">\n <ai-table-background [config]=\"columnFieldStatsBgConfig()\"></ai-table-background>\n <ko-group>\n <ai-table-column-stats\n [config]=\"columnFrozenFieldStatsConfig()\"\n (hover)=\"onStatContainerHover($event)\"\n ></ai-table-column-stats>\n </ko-group>\n <ko-group [config]=\"statCommonGroupConfig()\">\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-stats\n [config]=\"columnFieldStatsConfig()\"\n (hover)=\"onStatContainerHover($event)\"\n ></ai-table-column-stats>\n </ko-group>\n </ko-group>\n <ko-group>\n <ai-table-shadow [config]=\"statShadowConfig()\"></ai-table-shadow>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
|
9953
10228
|
}] });
|
9954
10229
|
|
9955
10230
|
class AITableCellRate extends CoverCellBase {
|
@@ -10860,12 +11135,15 @@ function performFill(aiTable, sourceCells, mouseUpRecordId, actions) {
|
|
10860
11135
|
targetStartRowIndex = selectedFirstRowIndex;
|
10861
11136
|
targetEndRowIndex = sourceStartRowIndex - 1;
|
10862
11137
|
}
|
10863
|
-
const sourceRowCount = sourceEndRowIndex - sourceStartRowIndex + 1;
|
10864
11138
|
const sourceRows = [];
|
10865
11139
|
const linearRows = aiTable.context.linearRows();
|
10866
11140
|
for (let i = sourceStartRowIndex; i <= sourceEndRowIndex; i++) {
|
10867
|
-
|
11141
|
+
const row = linearRows[i];
|
11142
|
+
if (row.type === AITableRowType.record) {
|
11143
|
+
sourceRows.push(row._id);
|
11144
|
+
}
|
10868
11145
|
}
|
11146
|
+
const sourceRowCount = sourceRows.length;
|
10869
11147
|
const updateData = [];
|
10870
11148
|
const fields = AITable.getVisibleFields(aiTable);
|
10871
11149
|
const visibleColumnsIndexMap = aiTable.context.visibleColumnsIndexMap();
|
@@ -10878,17 +11156,44 @@ function performFill(aiTable, sourceCells, mouseUpRecordId, actions) {
|
|
10878
11156
|
if (isSystemField(field)) {
|
10879
11157
|
continue;
|
10880
11158
|
}
|
10881
|
-
|
10882
|
-
|
10883
|
-
|
10884
|
-
|
10885
|
-
|
10886
|
-
|
10887
|
-
|
10888
|
-
|
10889
|
-
|
10890
|
-
|
10891
|
-
|
11159
|
+
if (direction === 'downward') {
|
11160
|
+
let sourceRowIndexPointer = 0;
|
11161
|
+
for (let rowIndex = targetStartRowIndex; rowIndex <= targetEndRowIndex; rowIndex++) {
|
11162
|
+
const row = linearRows[rowIndex];
|
11163
|
+
if (row.type === AITableRowType.record) {
|
11164
|
+
const targetRecordId = linearRows[rowIndex]._id;
|
11165
|
+
const mod = sourceRowIndexPointer % sourceRowCount;
|
11166
|
+
const sourceRecordId = sourceRows[mod];
|
11167
|
+
const sourceValue = recordsMap[sourceRecordId]?.values[fieldId];
|
11168
|
+
updateData.push({
|
11169
|
+
path: [targetRecordId, fieldId],
|
11170
|
+
value: sourceValue
|
11171
|
+
});
|
11172
|
+
sourceRowIndexPointer++;
|
11173
|
+
}
|
11174
|
+
}
|
11175
|
+
}
|
11176
|
+
else {
|
11177
|
+
let sourceRowIndexPointer = sourceRowCount - 1;
|
11178
|
+
for (let rowIndex = targetEndRowIndex; rowIndex >= targetStartRowIndex; rowIndex--) {
|
11179
|
+
const row = linearRows[rowIndex];
|
11180
|
+
if (row.type === AITableRowType.record) {
|
11181
|
+
const targetRecordId = linearRows[rowIndex]._id;
|
11182
|
+
const mod = sourceRowIndexPointer % sourceRowCount;
|
11183
|
+
const sourceRecordId = sourceRows[mod];
|
11184
|
+
const sourceValue = recordsMap[sourceRecordId]?.values[fieldId];
|
11185
|
+
updateData.push({
|
11186
|
+
path: [targetRecordId, fieldId],
|
11187
|
+
value: sourceValue
|
11188
|
+
});
|
11189
|
+
if (sourceRowIndexPointer <= 0) {
|
11190
|
+
sourceRowIndexPointer = sourceRowCount - 1;
|
11191
|
+
}
|
11192
|
+
else {
|
11193
|
+
sourceRowIndexPointer--;
|
11194
|
+
}
|
11195
|
+
}
|
11196
|
+
}
|
10892
11197
|
}
|
10893
11198
|
}
|
10894
11199
|
if (updateData.length > 0) {
|
@@ -11971,7 +12276,7 @@ class AITableDomGrid extends AITableGridBase {
|
|
11971
12276
|
});
|
11972
12277
|
}
|
11973
12278
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableDomGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
11974
|
-
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 }); }
|
12279
|
+
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: ["thyValue", "currentValue", "hasHalf", "thyCount", "thyDisabled", "thyAllowHalf", "thyAllowClear", "thyTooltips", "thyIconTemplate"], outputs: ["thyValueChange", "currentValueChange", "hasHalfChange", "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 }); }
|
11975
12280
|
}
|
11976
12281
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableDomGrid, decorators: [{
|
11977
12282
|
type: Component,
|
@@ -12504,11 +12809,7 @@ class AITableDragComponent {
|
|
12504
12809
|
this.setAuxiliaryLineStyles({
|
12505
12810
|
top: `${nextColumnStartY - scrollPosition.y}px`
|
12506
12811
|
});
|
12507
|
-
this.
|
12508
|
-
type: DragType.record,
|
12509
|
-
recordIds: drag.sourceIds,
|
12510
|
-
targetIndex: targetRowIndex + 1
|
12511
|
-
};
|
12812
|
+
this.setDragData(DragType.record, drag.sourceIds, targetRowIndex + 1);
|
12512
12813
|
return;
|
12513
12814
|
}
|
12514
12815
|
this.setAuxiliaryLineStyles({
|
@@ -12517,11 +12818,7 @@ class AITableDragComponent {
|
|
12517
12818
|
top: `${lineTop}px`,
|
12518
12819
|
left: `${AI_TABLE_ROW_DRAG_ICON_WIDTH}px`
|
12519
12820
|
});
|
12520
|
-
this.
|
12521
|
-
type: DragType.record,
|
12522
|
-
recordIds: drag.sourceIds,
|
12523
|
-
targetIndex: targetRowIndex
|
12524
|
-
};
|
12821
|
+
this.setDragData(DragType.record, drag.sourceIds, targetRowIndex);
|
12525
12822
|
}
|
12526
12823
|
else {
|
12527
12824
|
this.resetAuxiliaryLine();
|
@@ -12560,6 +12857,21 @@ class AITableDragComponent {
|
|
12560
12857
|
}
|
12561
12858
|
});
|
12562
12859
|
}
|
12860
|
+
setDragData(type, sourceIds, targetIndex) {
|
12861
|
+
const aiTable = this.aiTableGridEventService.aiTable;
|
12862
|
+
const linearRows = aiTable.context.linearRows();
|
12863
|
+
this.draggedData = {
|
12864
|
+
type,
|
12865
|
+
recordIds: sourceIds,
|
12866
|
+
targetIndex
|
12867
|
+
};
|
12868
|
+
if (targetIndex === 0) {
|
12869
|
+
this.draggedData.beforeRecordId = linearRows[0]._id;
|
12870
|
+
}
|
12871
|
+
else {
|
12872
|
+
this.draggedData.afterRecordId = linearRows[targetIndex - 1]._id;
|
12873
|
+
}
|
12874
|
+
}
|
12563
12875
|
handleDragEnd() {
|
12564
12876
|
if (this.draggedData) {
|
12565
12877
|
this.dragEnd.emit({ ...this.draggedData });
|
@@ -12931,7 +13243,7 @@ class AITableGrid extends AITableGridBase {
|
|
12931
13243
|
let matchedCells = new Set();
|
12932
13244
|
if (keywords) {
|
12933
13245
|
const references = this.aiReferences();
|
12934
|
-
this.aiTable.
|
13246
|
+
this.aiTable.gridData().records.forEach((record) => {
|
12935
13247
|
this.aiTable.fields().forEach((field) => {
|
12936
13248
|
if (isCellMatchKeywords(this.aiTable, field, record._id, keywords, references)) {
|
12937
13249
|
matchedCells.add(`${record._id}:${field._id}`);
|
@@ -13169,7 +13481,9 @@ class AITableGrid extends AITableGridBase {
|
|
13169
13481
|
switch (targetName) {
|
13170
13482
|
case AI_TABLE_ROW_ADD_BUTTON: {
|
13171
13483
|
clearCoverCell(this.aiTable);
|
13172
|
-
this.addRecord(
|
13484
|
+
this.addRecord({
|
13485
|
+
forGroupId: targetNameDetail.source
|
13486
|
+
});
|
13173
13487
|
const { isCanFullRender, offsetY } = this.coordinate().getAddRowButtonIsFullRenderInfo(this.aiTable);
|
13174
13488
|
if (!isCanFullRender) {
|
13175
13489
|
this.scrollAction({
|
@@ -13344,14 +13658,46 @@ class AITableGrid extends AITableGridBase {
|
|
13344
13658
|
});
|
13345
13659
|
this.resizeObserver.observe(this.containerElement());
|
13346
13660
|
}
|
13661
|
+
getNextRecordRowId(currentRowIndex, event) {
|
13662
|
+
const linearRows = this.aiTable.context.linearRows();
|
13663
|
+
if (event.key === 'ArrowUp') {
|
13664
|
+
let nextRowIndex = currentRowIndex - 1;
|
13665
|
+
let findFlag = false;
|
13666
|
+
while (nextRowIndex > -1 && !findFlag) {
|
13667
|
+
const row = linearRows[nextRowIndex];
|
13668
|
+
if (row.type === AITableRowType.record) {
|
13669
|
+
findFlag = true;
|
13670
|
+
}
|
13671
|
+
else {
|
13672
|
+
nextRowIndex--;
|
13673
|
+
}
|
13674
|
+
}
|
13675
|
+
return findFlag ? linearRows[nextRowIndex]._id : null;
|
13676
|
+
}
|
13677
|
+
if (event.key === 'ArrowDown') {
|
13678
|
+
let nextRowIndex = currentRowIndex + 1;
|
13679
|
+
let findFlag = false;
|
13680
|
+
while (nextRowIndex < linearRows.length && !findFlag) {
|
13681
|
+
const row = linearRows[nextRowIndex];
|
13682
|
+
if (row.type === AITableRowType.record) {
|
13683
|
+
findFlag = true;
|
13684
|
+
}
|
13685
|
+
else {
|
13686
|
+
nextRowIndex++;
|
13687
|
+
}
|
13688
|
+
}
|
13689
|
+
return findFlag ? linearRows[nextRowIndex]._id : null;
|
13690
|
+
}
|
13691
|
+
return null;
|
13692
|
+
}
|
13347
13693
|
getNextCell(currentCell, event) {
|
13348
13694
|
const { rowIndex, columnIndex } = AITable.getCellIndex(this.aiTable, currentCell) || {};
|
13349
13695
|
let nextCellPath = null;
|
13350
|
-
if (event.key === 'ArrowUp'
|
13351
|
-
|
13352
|
-
|
13353
|
-
|
13354
|
-
|
13696
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
13697
|
+
const nextRowId = this.getNextRecordRowId(rowIndex, event);
|
13698
|
+
if (nextRowId) {
|
13699
|
+
nextCellPath = [nextRowId, currentCell[1]];
|
13700
|
+
}
|
13355
13701
|
}
|
13356
13702
|
if (event.key === 'ArrowLeft' && columnIndex) {
|
13357
13703
|
nextCellPath = [currentCell[0], this.aiTable.gridData().fields[columnIndex - 1]._id];
|
@@ -13368,6 +13714,14 @@ class AITableGrid extends AITableGridBase {
|
|
13368
13714
|
if (this.aiReadonly()) {
|
13369
13715
|
return;
|
13370
13716
|
}
|
13717
|
+
const focused = document.activeElement;
|
13718
|
+
if (!focused) {
|
13719
|
+
return;
|
13720
|
+
}
|
13721
|
+
const hasAITableGrid = focused.querySelector('ai-table-grid') !== null;
|
13722
|
+
if (!hasAITableGrid) {
|
13723
|
+
return;
|
13724
|
+
}
|
13371
13725
|
const hasSelectedCells = this.aiTable.selection().selectedCells.size > 0;
|
13372
13726
|
if (!hasSelectedCells) {
|
13373
13727
|
return;
|
@@ -13381,7 +13735,10 @@ class AITableGrid extends AITableGridBase {
|
|
13381
13735
|
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') {
|
13382
13736
|
return;
|
13383
13737
|
}
|
13384
|
-
|
13738
|
+
const hasContentEditable = target.contentEditable === 'true';
|
13739
|
+
if (hasContentEditable) {
|
13740
|
+
return;
|
13741
|
+
}
|
13385
13742
|
const isCopyOrPaste = (event.ctrlKey || event.metaKey) && (event.key === 'c' || event.key === 'v');
|
13386
13743
|
const isDeleteOrBackspace = event.key === 'Backspace' || event.key === 'Delete';
|
13387
13744
|
const isDirectionKey = event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'ArrowLeft' || event.key === 'ArrowRight';
|
@@ -13422,6 +13779,7 @@ class AITableGrid extends AITableGridBase {
|
|
13422
13779
|
}
|
13423
13780
|
}
|
13424
13781
|
}
|
13782
|
+
event.preventDefault();
|
13425
13783
|
return;
|
13426
13784
|
}
|
13427
13785
|
if (isCopyOrPaste) {
|
@@ -13431,10 +13789,12 @@ class AITableGrid extends AITableGridBase {
|
|
13431
13789
|
else if (event.key === 'v') {
|
13432
13790
|
this.pasteCells();
|
13433
13791
|
}
|
13792
|
+
event.preventDefault();
|
13434
13793
|
return;
|
13435
13794
|
}
|
13436
13795
|
if (isDeleteOrBackspace) {
|
13437
13796
|
clearCells(this.aiTable, this.actions);
|
13797
|
+
event.preventDefault();
|
13438
13798
|
return;
|
13439
13799
|
}
|
13440
13800
|
// quick enter cell editor
|
@@ -13455,6 +13815,7 @@ class AITableGrid extends AITableGridBase {
|
|
13455
13815
|
this.aiUpdateFieldValues.emit(value);
|
13456
13816
|
}
|
13457
13817
|
});
|
13818
|
+
event.preventDefault();
|
13458
13819
|
}
|
13459
13820
|
});
|
13460
13821
|
}
|
@@ -13531,10 +13892,11 @@ class AITableGrid extends AITableGridBase {
|
|
13531
13892
|
}
|
13532
13893
|
break;
|
13533
13894
|
case DragType.record:
|
13534
|
-
if (data.recordIds &&
|
13895
|
+
if (data.recordIds && (data.beforeRecordId || data.afterRecordId)) {
|
13535
13896
|
this.aiMoveRecords.emit({
|
13536
|
-
recordIds: Array.from(data.recordIds)
|
13537
|
-
|
13897
|
+
recordIds: Array.from(data.recordIds),
|
13898
|
+
beforeRecordId: data.beforeRecordId,
|
13899
|
+
afterRecordId: data.afterRecordId
|
13538
13900
|
});
|
13539
13901
|
}
|
13540
13902
|
return;
|
@@ -13629,5 +13991,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
13629
13991
|
* Generated bundle index. Do not edit.
|
13630
13992
|
*/
|
13631
13993
|
|
13632
|
-
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,
|
13994
|
+
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, AITableFrozenGroups, AITableFrozenPlaceholderCells, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridI18nText, AITableGroups, AITableHoverRowHeads, AITableIcon, AITableMemberType, AITableMouseDownType, AITableOtherRows, AITablePlaceholderCells, AITableQueries, AITableRenderer, AITableRowType, AITableScrollableGroup, AITableSelectAllState, AITableShadow, 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_GROUP_MAX_LEVEL, 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_GROUP_COLLAPSE_BUTTON, AI_TABLE_ROW_GROUP_OFFSET, 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_SHADOW_DEFAULT_WIDTH, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AI_TABLE_TEXT_LINE_HEIGHT, AbstractEditCellEditor, AddOutlinedPath, AngleDownPath, AngleRightPath, AttachmentField, AttachmentPath, CellDrawer, Check, CheckboxMenuSort, 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, getGroupLastRecordIndex, 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, scrollToMatchedCell, 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 };
|
13633
13995
|
//# sourceMappingURL=ai-table-grid.mjs.map
|