@ai-table/grid 0.0.67 → 0.0.69

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.
Files changed (48) hide show
  1. package/core/context.d.ts +1 -0
  2. package/core/context.d.ts.map +1 -1
  3. package/esm2022/components/drag/drag.component.mjs +3 -3
  4. package/esm2022/core/context.mjs +3 -2
  5. package/esm2022/grid.component.mjs +3 -2
  6. package/esm2022/renderer/components/frozen-heads.component.mjs +123 -38
  7. package/esm2022/renderer/components/hover-cell.component.mjs +4 -3
  8. package/esm2022/renderer/components/hover-row-heads.component.mjs +3 -3
  9. package/esm2022/renderer/creations/create-cells.mjs +10 -5
  10. package/esm2022/renderer/drawers/add-row-layout-drawer.mjs +7 -7
  11. package/esm2022/renderer/drawers/layout-drawer.mjs +7 -3
  12. package/esm2022/renderer/drawers/record-row-layout-drawer.mjs +46 -30
  13. package/esm2022/renderer/renderer.component.mjs +7 -5
  14. package/esm2022/types/grid.mjs +1 -1
  15. package/esm2022/types/layout.mjs +1 -1
  16. package/esm2022/utils/cell.mjs +4 -1
  17. package/esm2022/utils/clipboard/copy.mjs +4 -4
  18. package/esm2022/utils/field/model/date.mjs +5 -1
  19. package/esm2022/utils/field/model/rich-text.mjs +6 -3
  20. package/esm2022/utils/match-keywords.mjs +2 -3
  21. package/esm2022/utils/position.mjs +6 -6
  22. package/esm2022/utils/visible-range.mjs +3 -3
  23. package/fesm2022/ai-table-grid.mjs +217 -91
  24. package/fesm2022/ai-table-grid.mjs.map +1 -1
  25. package/grid.component.d.ts.map +1 -1
  26. package/package.json +1 -1
  27. package/renderer/components/frozen-heads.component.d.ts +39 -3
  28. package/renderer/components/frozen-heads.component.d.ts.map +1 -1
  29. package/renderer/components/hover-cell.component.d.ts.map +1 -1
  30. package/renderer/components/hover-row-heads.component.d.ts.map +1 -1
  31. package/renderer/creations/create-cells.d.ts.map +1 -1
  32. package/renderer/drawers/add-row-layout-drawer.d.ts.map +1 -1
  33. package/renderer/drawers/layout-drawer.d.ts +3 -1
  34. package/renderer/drawers/layout-drawer.d.ts.map +1 -1
  35. package/renderer/drawers/record-row-layout-drawer.d.ts.map +1 -1
  36. package/renderer/renderer.component.d.ts +1 -0
  37. package/renderer/renderer.component.d.ts.map +1 -1
  38. package/types/grid.d.ts +2 -0
  39. package/types/grid.d.ts.map +1 -1
  40. package/types/layout.d.ts +2 -0
  41. package/types/layout.d.ts.map +1 -1
  42. package/utils/cell.d.ts.map +1 -1
  43. package/utils/field/model/date.d.ts +2 -1
  44. package/utils/field/model/date.d.ts.map +1 -1
  45. package/utils/field/model/rich-text.d.ts +2 -1
  46. package/utils/field/model/rich-text.d.ts.map +1 -1
  47. package/utils/position.d.ts +1 -1
  48. package/utils/position.d.ts.map +1 -1
@@ -1291,7 +1291,8 @@ const AITableQueries = {
1291
1291
 
1292
1292
  class RendererContext {
1293
1293
  constructor(options) {
1294
- const { linearRows, pointPosition, scrollState, visibleColumnsIndexMap, visibleRowsIndexMap, frozenColumnCount, references, aiFieldConfig, scrollAction } = options;
1294
+ const { rowHeadWidth, linearRows, pointPosition, scrollState, visibleColumnsIndexMap, visibleRowsIndexMap, frozenColumnCount, references, aiFieldConfig, scrollAction } = options;
1295
+ this.rowHeadWidth = rowHeadWidth;
1295
1296
  this.linearRows = linearRows;
1296
1297
  this.pointPosition = pointPosition;
1297
1298
  this.scrollState = scrollState;
@@ -2642,6 +2643,9 @@ function cellValueToSortValue$5(cellValue, field, references, sortKey = 'title')
2642
2643
  }
2643
2644
 
2644
2645
  class DateField extends DateFieldBase {
2646
+ transformCellValue(cellValue, options) {
2647
+ return transformCellValue(options.aiTable, options.field, cellValue);
2648
+ }
2645
2649
  isMeetFilter(condition, cellValue) {
2646
2650
  const [left, right] = this.getTimeRange(condition.value);
2647
2651
  if (isNil(cellValue)) {
@@ -2977,8 +2981,9 @@ function buildClipboardContent(aiTable, fieldIds, recordIds) {
2977
2981
  html: ''
2978
2982
  };
2979
2983
  if (FieldModelMap[field.type].isValid(cellValue)) {
2980
- const transformValue = transformCellValue(aiTable, field, cellValue);
2981
- const cellTexts = FieldModelMap[field.type].cellFullText(transformValue, field, references);
2984
+ const fieldModel = FieldModelMap[field.type];
2985
+ const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
2986
+ const cellTexts = fieldModel.cellFullText(transformValue, field, references);
2982
2987
  cellContent = {
2983
2988
  text: cellTexts.join(','),
2984
2989
  html: cellTexts.join(',')
@@ -3613,6 +3618,9 @@ function toRateFieldValue(plainText, targetField, originData) {
3613
3618
  }
3614
3619
 
3615
3620
  class RichTextField extends RichTextFieldBase {
3621
+ transformCellValue(cellValue, options) {
3622
+ return transformCellValue(options.aiTable, options.field, cellValue);
3623
+ }
3616
3624
  isMeetFilter(condition, cellValue, options) {
3617
3625
  const textValue = transformCellValue(options.aiTable, options.field, cellValue || []);
3618
3626
  switch (condition.operation) {
@@ -3627,8 +3635,8 @@ class RichTextField extends RichTextFieldBase {
3627
3635
  }
3628
3636
  }
3629
3637
  compare(cellValue1, cellValue2, references, sortKey, options) {
3630
- const value1 = transformCellValue(options.aiTable, options.field, cellValue1 || []);
3631
- const value2 = transformCellValue(options.aiTable, options.field, cellValue2 || []);
3638
+ const value1 = this.transformCellValue(cellValue1 || [], options);
3639
+ const value2 = this.transformCellValue(cellValue2 || [], options);
3632
3640
  return compareString(value1, value2);
3633
3641
  }
3634
3642
  toFieldValue(plainText, targetField, originData) {
@@ -3708,6 +3716,9 @@ function getCellHorizontalPosition(options) {
3708
3716
  const { columnWidth } = options;
3709
3717
  return { width: columnWidth, offset: 0 };
3710
3718
  }
3719
+ // @deprecated 请使用 FieldModelMap 的 transformCellValue 方法
3720
+ // const fieldModel = FieldModelMap[field.type];
3721
+ // const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
3711
3722
  function transformCellValue(aiTable, field, cellValue) {
3712
3723
  const fieldModel = FieldModelMap[field.type];
3713
3724
  if (!fieldModel.isValid(cellValue)) {
@@ -4012,7 +4023,7 @@ const scrollMax = (aiTable, coordinate, visibleColumns) => {
4012
4023
  const scrollMaxWidth = visibleColumns.reduce((pre, cur) => {
4013
4024
  const index = visibleColumnIndexMap.get(cur._id);
4014
4025
  return pre + (isNumber(index) ? coordinate.getColumnWidth(index) : 0);
4015
- }, AI_TABLE_ROW_HEAD_WIDTH) + AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
4026
+ }, aiTable.context.rowHeadWidth()) + AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
4016
4027
  const scrollMaxHeight = coordinate.getRowOffset(coordinate.rowCount - 1) + 32;
4017
4028
  return { scrollMaxWidth: Math.max(scrollMaxWidth, coordinate.containerWidth), scrollMaxHeight };
4018
4029
  };
@@ -4022,7 +4033,7 @@ const getMousePosition = (aiTable, x, y, coordinate, fields, context, _targetNam
4022
4033
  const { scrollMaxWidth, scrollMaxHeight } = scrollMax(aiTable, coordinate, fields);
4023
4034
  const offsetTop = scrollTop + y;
4024
4035
  const rowIndex = coordinate.getRowStartIndex(offsetTop);
4025
- const offsetLeft = isWithinFrozenColumnBoundary(x, coordinate.frozenColumnWidth) ? x : scrollLeft + x;
4036
+ const offsetLeft = isWithinFrozenColumnBoundary(x, coordinate.frozenColumnWidth, context.rowHeadWidth()) ? x : scrollLeft + x;
4026
4037
  const columnIndex = coordinate.getColumnStartIndex(offsetLeft);
4027
4038
  const areaType = offsetLeft <= scrollMaxWidth && offsetTop <= scrollMaxHeight ? AITableAreaType.grid : AITableAreaType.none;
4028
4039
  const targetName = getTargetName(_targetName);
@@ -4038,9 +4049,9 @@ const getMousePosition = (aiTable, x, y, coordinate, fields, context, _targetNam
4038
4049
  y
4039
4050
  };
4040
4051
  };
4041
- const isWithinFrozenColumnBoundary = (x, frozenColumnWidth) => {
4042
- const max = AI_TABLE_ROW_HEAD_WIDTH + frozenColumnWidth;
4043
- const min = AI_TABLE_ROW_HEAD_WIDTH;
4052
+ const isWithinFrozenColumnBoundary = (x, frozenColumnWidth, rowHeadWidth) => {
4053
+ const max = rowHeadWidth + frozenColumnWidth;
4054
+ const min = rowHeadWidth;
4044
4055
  return x > min && x < max;
4045
4056
  };
4046
4057
  const getEditorSpace = (widthOrHeight) => {
@@ -4219,7 +4230,7 @@ const isCellMatchKeywords = (aiTable, field, recordId, keywords, references) =>
4219
4230
  const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
4220
4231
  const fieldMethod = FieldModelMap[field.type];
4221
4232
  if (fieldMethod.isValid(cellValue)) {
4222
- const transformValue = transformCellValue(aiTable, field, cellValue);
4233
+ const transformValue = fieldMethod.transformCellValue(cellValue, { aiTable, field });
4223
4234
  let cellFullText = fieldMethod.cellFullText(transformValue, field, references);
4224
4235
  return keywords && cellFullText.length && cellFullText.some((text) => text.toLowerCase().includes(keywords.toLowerCase()));
4225
4236
  }
@@ -5698,9 +5709,11 @@ class Layout extends Drawer {
5698
5709
  // 列数
5699
5710
  this.columnCount = 0;
5700
5711
  this.containerWidth = 0;
5712
+ this.rowHeadWidth = AI_TABLE_ROW_HEAD_WIDTH;
5713
+ this.hiddenIndexColumn = false;
5701
5714
  }
5702
5715
  // 用于初始化或重置布局的基本属性。这个方法通常在每次渲染新的一行或单元格时调用,确保布局信息是最新的
5703
- init({ x, y, rowIndex, columnIndex, rowHeight, columnWidth, columnCount, containerWidth }) {
5716
+ init({ x, y, rowIndex, columnIndex, rowHeight, columnWidth, columnCount, containerWidth, rowHeadWidth, hiddenIndexColumn }) {
5704
5717
  this.x = x;
5705
5718
  this.y = y;
5706
5719
  this.rowIndex = rowIndex;
@@ -5709,6 +5722,8 @@ class Layout extends Drawer {
5709
5722
  this.columnWidth = columnWidth;
5710
5723
  this.columnCount = columnCount;
5711
5724
  this.containerWidth = containerWidth;
5725
+ this.rowHeadWidth = rowHeadWidth;
5726
+ this.hiddenIndexColumn = hiddenIndexColumn;
5712
5727
  }
5713
5728
  // 当前单元格是否是行的第一列
5714
5729
  get isFirst() {
@@ -5775,20 +5790,20 @@ class AddRowLayout extends Layout {
5775
5790
  const frozenOffset = AI_TABLE_OFFSET;
5776
5791
  const fill = isHoverRow ? this.colors.gray80 : this.colors.transparent;
5777
5792
  this.rect({
5778
- x: frozenOffset + AI_TABLE_ROW_DRAG_ICON_WIDTH,
5793
+ x: this.hiddenIndexColumn ? frozenOffset : frozenOffset + AI_TABLE_ROW_DRAG_ICON_WIDTH,
5779
5794
  y: y + AI_TABLE_OFFSET,
5780
- width: columnWidth + AI_TABLE_ROW_HEAD_WIDTH - frozenOffset + 1,
5795
+ width: columnWidth + this.rowHeadWidth - frozenOffset + 1,
5781
5796
  height: rowHeight,
5782
5797
  fill
5783
5798
  });
5784
5799
  this.line({
5785
- x: frozenOffset + AI_TABLE_ROW_DRAG_ICON_WIDTH,
5800
+ x: this.hiddenIndexColumn ? frozenOffset : frozenOffset + AI_TABLE_ROW_DRAG_ICON_WIDTH,
5786
5801
  y,
5787
- points: [0, rowHeight, columnWidth + AI_TABLE_ROW_HEAD_WIDTH - frozenOffset + 1, rowHeight],
5802
+ points: [0, rowHeight, columnWidth + this.rowHeadWidth - frozenOffset + 1, rowHeight],
5788
5803
  stroke: this.colors.gray200
5789
5804
  });
5790
5805
  this.path({
5791
- x: AI_TABLE_CELL_PADDING + AI_TABLE_ROW_DRAG_ICON_WIDTH,
5806
+ x: this.hiddenIndexColumn ? AI_TABLE_CELL_PADDING : AI_TABLE_CELL_PADDING + AI_TABLE_ROW_DRAG_ICON_WIDTH,
5792
5807
  y: y + (rowHeight - AI_TABLE_ICON_COMMON_SIZE) / 2 - AI_TABLE_OFFSET,
5793
5808
  data: AddOutlinedPath,
5794
5809
  size: AI_TABLE_ROW_HEAD_SIZE,
@@ -6985,35 +7000,51 @@ class RecordRowLayout extends Layout {
6985
7000
  else if (isHoverRow) {
6986
7001
  fillBg = colors.gray80;
6987
7002
  }
6988
- this.customRect({
6989
- x: AI_TABLE_OFFSET + AI_TABLE_ROW_DRAG_ICON_WIDTH,
6990
- y,
6991
- width: AI_TABLE_ROW_HEAD_WIDTH - AI_TABLE_OFFSET - AI_TABLE_ROW_DRAG_ICON_WIDTH,
6992
- height: rowHeight,
6993
- fill: fillBg,
6994
- strokes: {
6995
- right: colors.gray200,
6996
- bottom: colors.gray200
7003
+ if (!this.hiddenIndexColumn) {
7004
+ this.customRect({
7005
+ x: AI_TABLE_OFFSET + AI_TABLE_ROW_DRAG_ICON_WIDTH,
7006
+ y,
7007
+ width: this.rowHeadWidth - AI_TABLE_OFFSET - AI_TABLE_ROW_DRAG_ICON_WIDTH,
7008
+ height: rowHeight,
7009
+ fill: fillBg,
7010
+ strokes: {
7011
+ right: colors.gray200,
7012
+ bottom: colors.gray200
7013
+ }
7014
+ });
7015
+ if (!isCheckedRow && !isHoverRow) {
7016
+ // 设置字体样式,居中绘制行号
7017
+ this.setStyle({ fontSize: DEFAULT_FONT_SIZE });
7018
+ this.text({
7019
+ x: (this.rowHeadWidth + AI_TABLE_ROW_DRAG_ICON_WIDTH) / 2,
7020
+ y: y + AI_TABLE_FIELD_HEAD_HEIGHT / 2,
7021
+ text: String(row.displayIndex),
7022
+ textAlign: DEFAULT_TEXT_ALIGN_CENTER,
7023
+ verticalAlign: DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE
7024
+ });
6997
7025
  }
6998
- });
6999
- // 第一列单元格
7000
- this.rect({
7001
- x: AI_TABLE_ROW_HEAD_WIDTH,
7002
- y,
7003
- width: columnWidth + AI_TABLE_OFFSET,
7004
- height: rowHeight,
7005
- fill: fill,
7006
- stroke: colors.gray200
7007
- });
7008
- if (!isCheckedRow && !isHoverRow) {
7009
- // 设置字体样式,居中绘制行号
7010
- this.setStyle({ fontSize: DEFAULT_FONT_SIZE });
7011
- this.text({
7012
- x: (AI_TABLE_ROW_HEAD_WIDTH + AI_TABLE_ROW_DRAG_ICON_WIDTH) / 2,
7013
- y: y + AI_TABLE_FIELD_HEAD_HEIGHT / 2,
7014
- text: String(row.displayIndex),
7015
- textAlign: DEFAULT_TEXT_ALIGN_CENTER,
7016
- verticalAlign: DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE
7026
+ // 第一列单元格
7027
+ this.rect({
7028
+ x: this.rowHeadWidth,
7029
+ y,
7030
+ width: columnWidth + AI_TABLE_OFFSET,
7031
+ height: rowHeight,
7032
+ fill: fill,
7033
+ stroke: colors.gray200
7034
+ });
7035
+ }
7036
+ else {
7037
+ // 第一列单元格
7038
+ this.customRect({
7039
+ x: this.rowHeadWidth,
7040
+ y,
7041
+ width: columnWidth + AI_TABLE_OFFSET,
7042
+ height: rowHeight,
7043
+ fill: fill,
7044
+ strokes: {
7045
+ right: colors.gray200,
7046
+ bottom: colors.gray200
7047
+ }
7017
7048
  });
7018
7049
  }
7019
7050
  if (this.isLast) {
@@ -7114,7 +7145,9 @@ const createCells = (config) => {
7114
7145
  columnWidth,
7115
7146
  rowHeight: AI_TABLE_FIELD_HEAD_HEIGHT,
7116
7147
  columnCount,
7117
- containerWidth: coordinate.containerWidth
7148
+ containerWidth: coordinate.containerWidth,
7149
+ rowHeadWidth: context.rowHeadWidth(),
7150
+ hiddenIndexColumn: !!context.aiFieldConfig()?.hiddenIndexColumn
7118
7151
  });
7119
7152
  addRowLayout.render({
7120
7153
  isHoverRow,
@@ -7134,7 +7167,9 @@ const createCells = (config) => {
7134
7167
  columnWidth,
7135
7168
  rowHeight,
7136
7169
  columnCount,
7137
- containerWidth: coordinate.containerWidth
7170
+ containerWidth: coordinate.containerWidth,
7171
+ rowHeadWidth: context.rowHeadWidth(),
7172
+ hiddenIndexColumn: !!context.aiFieldConfig()?.hiddenIndexColumn
7138
7173
  });
7139
7174
  recordRowLayout.render({
7140
7175
  row,
@@ -7151,7 +7186,8 @@ const createCells = (config) => {
7151
7186
  const realY = y + AI_TABLE_OFFSET;
7152
7187
  const style = { fontWeight: DEFAULT_FONT_STYLE };
7153
7188
  const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, fieldId]);
7154
- const transformValue = transformCellValue(aiTable, field, cellValue);
7189
+ const fieldModel = FieldModelMap[field.type];
7190
+ const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
7155
7191
  const render = {
7156
7192
  aiTable,
7157
7193
  x: realX,
@@ -7721,20 +7757,43 @@ class AITableFrozenColumnHeads {
7721
7757
  constructor() {
7722
7758
  this.config = input.required();
7723
7759
  this.coordinate = computed(() => {
7724
- return this.config().coordinate;
7760
+ const config = this.config();
7761
+ if (!config)
7762
+ return null;
7763
+ return config.coordinate;
7764
+ });
7765
+ this.hiddenIndexColumn = computed(() => {
7766
+ const context = this.context();
7767
+ if (!context)
7768
+ return false;
7769
+ return context?.aiFieldConfig()?.hiddenIndexColumn;
7770
+ });
7771
+ this.context = computed(() => {
7772
+ const config = this.config();
7773
+ if (!config)
7774
+ return null;
7775
+ return config?.aiTable.context;
7725
7776
  });
7726
7777
  this.isChecked = computed(() => {
7727
- // 目前只需要展示全部选中和空的状态
7728
- return this.config().aiTable.selection().selectAllState === AITableSelectAllState.all;
7778
+ const config = this.config();
7779
+ if (!config)
7780
+ return false;
7781
+ return config.aiTable.selection().selectAllState === AITableSelectAllState.all;
7729
7782
  });
7730
7783
  this.fieldHeadHeight = computed(() => {
7731
- return this.coordinate().rowInitSize;
7784
+ const coord = this.coordinate();
7785
+ if (!coord)
7786
+ return 0;
7787
+ return coord.rowInitSize;
7732
7788
  });
7733
7789
  this.headConfigs = computed(() => {
7790
+ const coord = this.coordinate();
7791
+ if (!coord)
7792
+ return [];
7734
7793
  return createColumnHeads({
7735
7794
  ...this.config(),
7736
7795
  columnStartIndex: 0,
7737
- columnStopIndex: this.coordinate().frozenColumnCount - 1
7796
+ columnStopIndex: coord.frozenColumnCount - 1
7738
7797
  });
7739
7798
  });
7740
7799
  this.dragHeadBgConfig = computed(() => {
@@ -7748,28 +7807,39 @@ class AITableFrozenColumnHeads {
7748
7807
  };
7749
7808
  });
7750
7809
  this.numberHeadBgConfig = computed(() => {
7810
+ const ctx = this.context();
7811
+ if (!ctx)
7812
+ return { width: 0, height: 0 };
7751
7813
  return {
7752
7814
  x: AI_TABLE_OFFSET,
7753
7815
  y: AI_TABLE_OFFSET,
7754
- width: AI_TABLE_ROW_HEAD_WIDTH,
7816
+ width: ctx.rowHeadWidth() || 0,
7755
7817
  height: this.fieldHeadHeight(),
7756
7818
  fill: Colors.white,
7757
7819
  listening: false
7758
7820
  };
7759
7821
  });
7760
- this.topLineConfig = {
7761
- x: AI_TABLE_OFFSET + AI_TABLE_ROW_DRAG_ICON_WIDTH,
7762
- y: AI_TABLE_OFFSET,
7763
- points: [0, 0, AI_TABLE_ROW_HEAD_WIDTH, 0],
7764
- stroke: Colors.gray200,
7765
- strokeWidth: 1,
7766
- listening: false
7767
- };
7822
+ this.topLineConfig = computed(() => {
7823
+ const ctx = this.context();
7824
+ if (!ctx)
7825
+ return { points: [0, 0, 0, 0] };
7826
+ return {
7827
+ x: AI_TABLE_OFFSET + AI_TABLE_ROW_DRAG_ICON_WIDTH,
7828
+ y: AI_TABLE_OFFSET,
7829
+ points: [0, 0, ctx.rowHeadWidth(), 0],
7830
+ stroke: Colors.gray200,
7831
+ strokeWidth: 1,
7832
+ listening: false
7833
+ };
7834
+ });
7768
7835
  this.bottomLineConfig = computed(() => {
7836
+ const ctx = this.context();
7837
+ if (!ctx)
7838
+ return { points: [0, 0, 0, 0] };
7769
7839
  return {
7770
7840
  x: AI_TABLE_OFFSET + AI_TABLE_ROW_DRAG_ICON_WIDTH,
7771
7841
  y: AI_TABLE_OFFSET,
7772
- points: [AI_TABLE_ROW_HEAD_WIDTH, this.fieldHeadHeight(), 0, this.fieldHeadHeight()],
7842
+ points: [ctx.rowHeadWidth(), this.fieldHeadHeight(), 0, this.fieldHeadHeight()],
7773
7843
  stroke: Colors.gray200,
7774
7844
  strokeWidth: 1,
7775
7845
  listening: false
@@ -7787,32 +7857,77 @@ class AITableFrozenColumnHeads {
7787
7857
  };
7788
7858
  });
7789
7859
  this.headBgConfig = computed(() => {
7790
- const { frozenColumnWidth } = this.coordinate();
7860
+ const coord = this.coordinate();
7861
+ const ctx = this.context();
7862
+ if (!coord || !ctx)
7863
+ return { width: 0, height: 0 };
7791
7864
  return {
7792
- x: AI_TABLE_ROW_HEAD_WIDTH,
7865
+ x: ctx.rowHeadWidth(),
7793
7866
  y: AI_TABLE_OFFSET,
7794
- width: frozenColumnWidth + AI_TABLE_OFFSET,
7867
+ width: coord.frozenColumnWidth + AI_TABLE_OFFSET,
7795
7868
  height: this.fieldHeadHeight(),
7796
7869
  stroke: Colors.gray200,
7797
- strokeWidth: 1,
7870
+ strokeWidth: this.hiddenIndexColumn() ? 0 : 1,
7798
7871
  fill: Colors.transparent,
7799
- listening: false
7872
+ listening: false,
7873
+ zIndex: 10
7800
7874
  };
7801
7875
  });
7876
+ this.cellLinesConfig = computed(() => {
7877
+ const coord = this.coordinate();
7878
+ const ctx = this.context();
7879
+ if (!coord || !ctx)
7880
+ return [];
7881
+ return [
7882
+ {
7883
+ x: ctx.rowHeadWidth(),
7884
+ y: AI_TABLE_OFFSET,
7885
+ points: [0, 0, coord.frozenColumnWidth + AI_TABLE_OFFSET, 0],
7886
+ stroke: Colors.gray200,
7887
+ strokeWidth: 1,
7888
+ listening: false,
7889
+ zIndex: 10
7890
+ },
7891
+ {
7892
+ x: ctx.rowHeadWidth(),
7893
+ y: AI_TABLE_OFFSET,
7894
+ points: [coord.frozenColumnWidth + AI_TABLE_OFFSET, 0, coord.frozenColumnWidth + AI_TABLE_OFFSET, this.fieldHeadHeight()],
7895
+ stroke: Colors.gray200,
7896
+ strokeWidth: 1,
7897
+ listening: false,
7898
+ zIndex: 10
7899
+ },
7900
+ {
7901
+ x: ctx.rowHeadWidth(),
7902
+ y: AI_TABLE_OFFSET,
7903
+ points: [0, this.fieldHeadHeight(), coord.frozenColumnWidth + AI_TABLE_OFFSET, this.fieldHeadHeight()],
7904
+ stroke: Colors.gray200,
7905
+ strokeWidth: 1,
7906
+ listening: false,
7907
+ zIndex: 10
7908
+ }
7909
+ ];
7910
+ });
7802
7911
  }
7803
7912
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFrozenColumnHeads, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7804
7913
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableFrozenColumnHeads, isStandalone: true, selector: "ai-table-frozen-column-heads", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
7805
- <ko-rect [config]="dragHeadBgConfig()"></ko-rect>
7806
- <ko-rect [config]="numberHeadBgConfig()"></ko-rect>
7807
- <ko-line [config]="topLineConfig"></ko-line>
7808
- <ko-line [config]="bottomLineConfig()"></ko-line>
7809
- <ko-group>
7810
- <ai-table-icon [config]="iconConfig()"></ai-table-icon>
7811
- </ko-group>
7914
+ <ko-rect [config]="headBgConfig()"></ko-rect>
7915
+ @if (!hiddenIndexColumn()) {
7916
+ <ko-rect [config]="dragHeadBgConfig()"></ko-rect>
7917
+ <ko-rect [config]="numberHeadBgConfig()"></ko-rect>
7918
+ <ko-line [config]="topLineConfig()"></ko-line>
7919
+ <ko-line [config]="bottomLineConfig()"></ko-line>
7920
+ <ko-group>
7921
+ <ai-table-icon [config]="iconConfig()"></ai-table-icon>
7922
+ </ko-group>
7923
+ } @else {
7924
+ @for (lineConfig of cellLinesConfig(); track $index) {
7925
+ <ko-line [config]="lineConfig"></ko-line>
7926
+ }
7927
+ }
7812
7928
  @for (config of headConfigs(); track $index) {
7813
7929
  <ai-table-field-head [config]="config"></ai-table-field-head>
7814
7930
  }
7815
- <ko-rect [config]="headBgConfig()"></ko-rect>
7816
7931
  `, 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"] }, { kind: "component", type: AITableFieldHead, selector: "ai-table-field-head", inputs: ["config"] }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"] }, { kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7817
7932
  }
7818
7933
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFrozenColumnHeads, decorators: [{
@@ -7820,17 +7935,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7820
7935
  args: [{
7821
7936
  selector: 'ai-table-frozen-column-heads',
7822
7937
  template: `
7823
- <ko-rect [config]="dragHeadBgConfig()"></ko-rect>
7824
- <ko-rect [config]="numberHeadBgConfig()"></ko-rect>
7825
- <ko-line [config]="topLineConfig"></ko-line>
7826
- <ko-line [config]="bottomLineConfig()"></ko-line>
7827
- <ko-group>
7828
- <ai-table-icon [config]="iconConfig()"></ai-table-icon>
7829
- </ko-group>
7938
+ <ko-rect [config]="headBgConfig()"></ko-rect>
7939
+ @if (!hiddenIndexColumn()) {
7940
+ <ko-rect [config]="dragHeadBgConfig()"></ko-rect>
7941
+ <ko-rect [config]="numberHeadBgConfig()"></ko-rect>
7942
+ <ko-line [config]="topLineConfig()"></ko-line>
7943
+ <ko-line [config]="bottomLineConfig()"></ko-line>
7944
+ <ko-group>
7945
+ <ai-table-icon [config]="iconConfig()"></ai-table-icon>
7946
+ </ko-group>
7947
+ } @else {
7948
+ @for (lineConfig of cellLinesConfig(); track $index) {
7949
+ <ko-line [config]="lineConfig"></ko-line>
7950
+ }
7951
+ }
7830
7952
  @for (config of headConfigs(); track $index) {
7831
7953
  <ai-table-field-head [config]="config"></ai-table-field-head>
7832
7954
  }
7833
- <ko-rect [config]="headBgConfig()"></ko-rect>
7834
7955
  `,
7835
7956
  standalone: true,
7836
7957
  imports: [KoShape, AITableFieldHead, AITableIcon, KoContainer],
@@ -7953,7 +8074,7 @@ class AITableHoverRowHeads {
7953
8074
  y: coordinate.getRowOffset(rowIndex),
7954
8075
  bgConfig: {
7955
8076
  name: generateTargetName({ targetName: AI_TABLE_ROW_HEAD, recordId }),
7956
- width: AI_TABLE_ROW_HEAD_WIDTH + 1,
8077
+ width: context.rowHeadWidth() + 1,
7957
8078
  height: coordinate.rowHeight,
7958
8079
  fill: Colors.transparent
7959
8080
  }
@@ -8141,7 +8262,8 @@ class AITableHoverCells {
8141
8262
  }
8142
8263
  const { field, recordId } = hoverCell;
8143
8264
  const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
8144
- const transformValue = transformCellValue(aiTable, field, cellValue);
8265
+ const fieldModel = FieldModelMap[field.type];
8266
+ const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
8145
8267
  const { rowHeight, columnCount, rowCount } = coordinate;
8146
8268
  const columnIndex = pointPosition.columnIndex;
8147
8269
  const rowIndex = pointPosition.rowIndex;
@@ -8235,6 +8357,9 @@ class AITableRenderer {
8235
8357
  this.readonly = computed(() => {
8236
8358
  return this.config()?.readonly;
8237
8359
  });
8360
+ this.hiddenIndexColumn = computed(() => {
8361
+ return this.config()?.aiTable.context?.aiFieldConfig()?.hiddenIndexColumn;
8362
+ });
8238
8363
  this.rowDragDisabled = computed(() => {
8239
8364
  return this.config()?.rowDragDisabled;
8240
8365
  });
@@ -8254,7 +8379,7 @@ class AITableRenderer {
8254
8379
  return getVisibleRangeInfo(this.coordinate(), this.scrollState());
8255
8380
  });
8256
8381
  this.frozenAreaWidth = computed(() => {
8257
- return AI_TABLE_ROW_HEAD_WIDTH + this.coordinate().frozenColumnWidth;
8382
+ return this.config().aiTable.context.rowHeadWidth() + this.coordinate().frozenColumnWidth;
8258
8383
  });
8259
8384
  this.lastColumnWidth = computed(() => {
8260
8385
  return this.coordinate().getColumnWidth(this.visibleRangeInfo().columnStopIndex);
@@ -8381,7 +8506,7 @@ class AITableRenderer {
8381
8506
  this.koMouseleave.emit(e);
8382
8507
  }
8383
8508
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8384
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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" }, 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>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\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 <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\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 <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\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: AITableHoverCells, selector: "ai-table-hover-cell", inputs: ["config"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8509
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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" }, 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>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\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-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\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 <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\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: AITableHoverCells, selector: "ai-table-hover-cell", inputs: ["config"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8385
8510
  }
8386
8511
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableRenderer, decorators: [{
8387
8512
  type: Component,
@@ -8399,7 +8524,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
8399
8524
  AITableAddField,
8400
8525
  AITableHoverRowHeads,
8401
8526
  AITableOtherRows
8402
- ], 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>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\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 <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\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 <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
8527
+ ], 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>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\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-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\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 <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
8403
8528
  }] });
8404
8529
 
8405
8530
  class AITableCellRate {
@@ -9390,7 +9515,7 @@ class AITableDragComponent {
9390
9515
  if ((targetColumnIndex >= 0 && (targetColumnIndex - sourceColumnIndex > 1 || targetColumnIndex - sourceColumnIndex < 0)) ||
9391
9516
  isLastColumn) {
9392
9517
  let lineLeft = targetColumnStartX - scroll.x;
9393
- const lineForFrozenX = lineLeft - frozenColumnWidth - AI_TABLE_ROW_HEAD_WIDTH;
9518
+ const lineForFrozenX = lineLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
9394
9519
  if (lineForFrozenX < 0) {
9395
9520
  lineLeft = coordinate.getColumnOffset(0);
9396
9521
  targetColumnIndex = 0;
@@ -9592,7 +9717,7 @@ class AITableGrid extends AITableGridBase {
9592
9717
  rowCount: this.linearRows().length,
9593
9718
  columnCount: fields.length,
9594
9719
  rowInitSize: AI_TABLE_FIELD_HEAD_HEIGHT,
9595
- columnInitSize: AI_TABLE_ROW_HEAD_WIDTH,
9720
+ columnInitSize: this.aiTable.context.rowHeadWidth(),
9596
9721
  rowIndicesSizeMap: {},
9597
9722
  columnIndicesSizeMap: getColumnIndicesSizeMap(this.aiTable, fields),
9598
9723
  frozenColumnCount: this.frozenColumnCount()
@@ -9710,6 +9835,7 @@ class AITableGrid extends AITableGridBase {
9710
9835
  }
9711
9836
  initContext() {
9712
9837
  this.aiTable.context = new RendererContext({
9838
+ rowHeadWidth: computed(() => (this.aiFieldConfig()?.hiddenIndexColumn ? 0 : AI_TABLE_ROW_HEAD_WIDTH)),
9713
9839
  linearRows: this.linearRows,
9714
9840
  visibleColumnsIndexMap: this.visibleColumnsIndexMap,
9715
9841
  visibleRowsIndexMap: this.visibleRowsIndexMap,