@ai-table/grid 0.0.15 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/esm2022/components/cell-editors/select/select-editor.component.mjs +2 -2
  2. package/esm2022/grid.component.mjs +11 -9
  3. package/esm2022/renderer/components/add-field-column.component.mjs +29 -18
  4. package/esm2022/renderer/components/field-head.component.mjs +5 -5
  5. package/esm2022/renderer/components/frozen-heads.component.mjs +3 -3
  6. package/esm2022/renderer/components/heads.component.mjs +1 -1
  7. package/esm2022/renderer/creations/create-cells.mjs +4 -4
  8. package/esm2022/renderer/creations/create-heads.mjs +1 -1
  9. package/esm2022/renderer/drawers/add-row-layout-drawer.mjs +4 -4
  10. package/esm2022/renderer/drawers/cell-drawer.mjs +4 -1
  11. package/esm2022/renderer/drawers/layout-drawer.mjs +12 -10
  12. package/esm2022/renderer/drawers/record-row-layout-drawer.mjs +16 -7
  13. package/esm2022/renderer/renderer.component.mjs +7 -10
  14. package/esm2022/services/field.service.mjs +4 -7
  15. package/esm2022/types/component-config.mjs +1 -1
  16. package/esm2022/types/field.mjs +1 -1
  17. package/fesm2022/ai-table-grid.mjs +80 -59
  18. package/fesm2022/ai-table-grid.mjs.map +1 -1
  19. package/grid.component.d.ts +1 -1
  20. package/grid.component.d.ts.map +1 -1
  21. package/package.json +1 -1
  22. package/renderer/components/add-field-column.component.d.ts +3 -6
  23. package/renderer/components/add-field-column.component.d.ts.map +1 -1
  24. package/renderer/components/frozen-heads.component.d.ts +2 -2
  25. package/renderer/components/heads.component.d.ts +2 -2
  26. package/renderer/creations/create-heads.d.ts +2 -2
  27. package/renderer/drawers/add-row-layout-drawer.d.ts +1 -1
  28. package/renderer/drawers/add-row-layout-drawer.d.ts.map +1 -1
  29. package/renderer/drawers/cell-drawer.d.ts.map +1 -1
  30. package/renderer/drawers/layout-drawer.d.ts +2 -2
  31. package/renderer/drawers/layout-drawer.d.ts.map +1 -1
  32. package/renderer/drawers/record-row-layout-drawer.d.ts.map +1 -1
  33. package/renderer/renderer.component.d.ts +1 -1
  34. package/renderer/renderer.component.d.ts.map +1 -1
  35. package/services/field.service.d.ts.map +1 -1
  36. package/types/component-config.d.ts +8 -1
  37. package/types/component-config.d.ts.map +1 -1
  38. package/types/field.d.ts +1 -1
  39. package/types/field.d.ts.map +1 -1
@@ -1252,7 +1252,7 @@ class SelectCellEditorComponent extends AbstractEditCellEditor {
1252
1252
  }
1253
1253
  updateValue(value) {
1254
1254
  if (!value) {
1255
- const value = this.isMultiple ? this.modelValue : [this.modelValue];
1255
+ const value = this.isMultiple ? this.modelValue : (this.modelValue && [this.modelValue]) || [];
1256
1256
  this.updateFieldValue.emit({
1257
1257
  value: value,
1258
1258
  path: [this.record()._id, this.field()._id]
@@ -1681,8 +1681,8 @@ class AITableGridFieldService {
1681
1681
  return this.thyPopover.open(component, {
1682
1682
  origin,
1683
1683
  originPosition: position,
1684
- manualClosure: true,
1685
1684
  placement: 'bottomLeft',
1685
+ originActiveClass: undefined,
1686
1686
  initialState: {
1687
1687
  aiTable,
1688
1688
  aiEditField: field,
@@ -1696,13 +1696,10 @@ class AITableGridFieldService {
1696
1696
  origin,
1697
1697
  originPosition: position,
1698
1698
  placement: 'bottomLeft',
1699
- originActiveClass: origin ? 'active' : undefined,
1700
- hasBackdrop: false,
1701
- insideClosable: true,
1702
- outsideClosable: true,
1699
+ originActiveClass: undefined,
1703
1700
  initialState: {
1704
1701
  origin: editOrigin,
1705
- position: options.editOriginPosition,
1702
+ position: options.editFieldPosition,
1706
1703
  aiTable,
1707
1704
  fieldId,
1708
1705
  fieldMenus
@@ -3190,33 +3187,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
3190
3187
 
3191
3188
  class AITableAddField {
3192
3189
  constructor() {
3193
- this.coordinate = input.required();
3194
- this.fields = input.required();
3195
- this.columnStopIndex = input.required();
3190
+ this.config = input.required();
3196
3191
  this.btnWidth = AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
3197
3192
  this.x = computed(() => {
3198
- const lastColumnWidth = this.coordinate().getColumnWidth(this.columnStopIndex());
3199
- const lastColumnOffset = this.coordinate().getColumnOffset(this.columnStopIndex());
3193
+ const lastColumnWidth = this.config().coordinate.getColumnWidth(this.config().columnStopIndex);
3194
+ const lastColumnOffset = this.config().coordinate.getColumnOffset(this.config().columnStopIndex);
3200
3195
  return lastColumnWidth + lastColumnOffset;
3201
3196
  });
3202
3197
  this.rectConfig = computed(() => {
3198
+ const { targetName } = this.config().pointPosition;
3199
+ const fill = targetName === AI_TABLE_FIELD_ADD_BUTTON ? Colors.gray80 : Colors.white;
3203
3200
  return {
3204
3201
  name: generateTargetName({
3205
3202
  targetName: AI_TABLE_FIELD_ADD_BUTTON,
3206
- fieldId: this.fields()[this.columnStopIndex()]._id,
3203
+ fieldId: this.config().fields[this.config().columnStopIndex]._id,
3207
3204
  mouseStyle: 'pointer'
3208
3205
  }),
3209
3206
  x: AI_TABLE_OFFSET,
3210
3207
  y: AI_TABLE_OFFSET,
3211
- width: this.coordinate().containerWidth - this.x() < this.btnWidth ? this.btnWidth : this.coordinate().containerWidth - this.x(),
3212
- height: this.coordinate().rowInitSize,
3208
+ width: this.config().coordinate.containerWidth - this.x() < this.btnWidth
3209
+ ? this.btnWidth
3210
+ : this.config().coordinate.containerWidth - this.x(),
3211
+ height: this.config().coordinate.rowInitSize,
3213
3212
  stroke: Colors.gray200,
3214
3213
  strokeWidth: 1,
3215
- listening: true
3214
+ listening: true,
3215
+ fill
3216
3216
  };
3217
3217
  });
3218
3218
  this.addIconConfig = computed(() => {
3219
- const offsetY = (this.coordinate().rowInitSize - AI_TABLE_ICON_COMMON_SIZE) / 2;
3219
+ const offsetY = (this.config().coordinate.rowInitSize - AI_TABLE_ICON_COMMON_SIZE) / 2;
3220
3220
  return {
3221
3221
  x: AI_TABLE_CELL_PADDING,
3222
3222
  y: offsetY,
@@ -3227,10 +3227,14 @@ class AITableAddField {
3227
3227
  });
3228
3228
  }
3229
3229
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableAddField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3230
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.0", type: AITableAddField, isStandalone: true, selector: "ai-table-add-field", inputs: { coordinate: { classPropertyName: "coordinate", publicName: "coordinate", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: true, transformFunction: null }, columnStopIndex: { classPropertyName: "columnStopIndex", publicName: "columnStopIndex", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3230
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.0", type: AITableAddField, isStandalone: true, selector: "ai-table-add-field", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3231
3231
  <ko-group [config]="{ x: x() }">
3232
- <ko-rect [config]="rectConfig()"></ko-rect>
3233
- <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
3232
+ <ko-group>
3233
+ <ko-rect [config]="rectConfig()"></ko-rect>
3234
+ </ko-group>
3235
+ <ko-group>
3236
+ <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
3237
+ </ko-group>
3234
3238
  </ko-group>
3235
3239
  `, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { 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: AITableIcon, selector: "ai-table-icon", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3236
3240
  }
@@ -3240,12 +3244,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
3240
3244
  selector: 'ai-table-add-field',
3241
3245
  template: `
3242
3246
  <ko-group [config]="{ x: x() }">
3243
- <ko-rect [config]="rectConfig()"></ko-rect>
3244
- <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
3247
+ <ko-group>
3248
+ <ko-rect [config]="rectConfig()"></ko-rect>
3249
+ </ko-group>
3250
+ <ko-group>
3251
+ <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
3252
+ </ko-group>
3245
3253
  </ko-group>
3246
3254
  `,
3247
3255
  standalone: true,
3248
- imports: [KoContainer, KoStage, KoShape, AITableIcon],
3256
+ imports: [KoContainer, KoShape, AITableIcon],
3249
3257
  changeDetection: ChangeDetectionStrategy.OnPush
3250
3258
  }]
3251
3259
  }] });
@@ -4223,23 +4231,25 @@ class Layout extends Drawer {
4223
4231
  get isLast() {
4224
4232
  return this.columnIndex === this.columnCount - 1;
4225
4233
  }
4226
- renderAddFieldBlank() {
4227
- const width = AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
4228
- const y = this.y;
4234
+ renderAddFieldBlank({ style, isHoverRow }) {
4229
4235
  const rowHeight = this.rowHeight;
4236
+ const fill = style?.fill || (isHoverRow ? this.colors.gray80 : this.colors.transparent);
4237
+ const addFieldBlankX = this.x + this.columnWidth + AI_TABLE_OFFSET;
4230
4238
  this.rect({
4231
- x: this.x + 0.5,
4232
- y: y - 0.5,
4233
- width: this.containerWidth - this.x < width ? width : this.containerWidth - this.x,
4234
- height: rowHeight + 1,
4235
- fill: this.colors.transparent
4239
+ x: addFieldBlankX,
4240
+ y: this.y + AI_TABLE_OFFSET,
4241
+ width: this.containerWidth - addFieldBlankX < AI_TABLE_FIELD_ADD_BUTTON_WIDTH
4242
+ ? AI_TABLE_FIELD_ADD_BUTTON_WIDTH
4243
+ : this.containerWidth - addFieldBlankX,
4244
+ height: rowHeight,
4245
+ fill
4236
4246
  });
4237
4247
  }
4238
4248
  }
4239
4249
 
4240
4250
  class AddRowLayout extends Layout {
4241
- renderAddFieldBlank() {
4242
- super.renderAddFieldBlank();
4251
+ renderAddFieldBlank({ isHoverRow }) {
4252
+ super.renderAddFieldBlank({ isHoverRow });
4243
4253
  const rowHeight = this.rowHeight;
4244
4254
  const defaultWidth = AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
4245
4255
  const width = this.containerWidth - this.x < defaultWidth ? defaultWidth : this.containerWidth - this.x;
@@ -4308,7 +4318,7 @@ class AddRowLayout extends Layout {
4308
4318
  isHoverRow
4309
4319
  });
4310
4320
  }
4311
- this.renderAddFieldBlank();
4321
+ this.renderAddFieldBlank({ isHoverRow });
4312
4322
  }
4313
4323
  renderCommonCell({ isHoverRow }) {
4314
4324
  if (this.isFirst || this.isLast)
@@ -4652,6 +4662,9 @@ class CellDrawer extends Drawer {
4652
4662
  if (!isValid || transformValue.length === 0) {
4653
4663
  return;
4654
4664
  }
4665
+ if (!transformValue[0]) {
4666
+ console.warn(`single select field unexpected value: ${transformValue[0]}`);
4667
+ }
4655
4668
  const isOperating = isActive;
4656
4669
  const item = field.settings.options?.find((option) => option._id === transformValue[0]);
4657
4670
  const itemName = item?.text || '';
@@ -4968,22 +4981,31 @@ class RecordRowLayout extends Layout {
4968
4981
  }
4969
4982
  }
4970
4983
  // 尾列
4971
- renderLastCell({ style }) {
4984
+ renderLastCell({ style, isHoverRow }) {
4972
4985
  if (!this.isLast || this.isFirst)
4973
4986
  return;
4974
4987
  const { fill, stroke } = style;
4975
- const columnWidth = this.columnWidth;
4976
- const width = columnWidth;
4977
4988
  const colors = AITable.getColors();
4978
4989
  // 背景、边框
4979
4990
  this.rect({
4980
4991
  x: this.x,
4981
4992
  y: this.y,
4982
- width,
4993
+ width: this.columnWidth,
4983
4994
  height: this.rowHeight,
4984
4995
  fill: fill || colors.white,
4985
4996
  stroke: stroke || colors.gray200
4986
4997
  });
4998
+ // 延伸到 FIELD_ADD_BUTTON
4999
+ super.renderAddFieldBlank({ style, isHoverRow });
5000
+ const rowHeight = this.rowHeight;
5001
+ const startX = this.x + this.columnWidth;
5002
+ const lineWidth = this.containerWidth - startX < AI_TABLE_FIELD_ADD_BUTTON_WIDTH ? AI_TABLE_FIELD_ADD_BUTTON_WIDTH : this.containerWidth - startX;
5003
+ this.line({
5004
+ x: startX,
5005
+ y: this.y,
5006
+ points: [0, rowHeight, lineWidth, rowHeight],
5007
+ stroke: this.colors.gray200
5008
+ });
4987
5009
  }
4988
5010
  // 绘制中间的普通单元格
4989
5011
  renderCommonCell({ style }) {
@@ -5005,7 +5027,7 @@ class RecordRowLayout extends Layout {
5005
5027
  const { row, style, isCheckedRow, isHoverRow } = config;
5006
5028
  this.renderFirstCell({ row, style, isCheckedRow, isHoverRow });
5007
5029
  this.renderCommonCell({ style });
5008
- this.renderLastCell({ style });
5030
+ this.renderLastCell({ style, isHoverRow });
5009
5031
  }
5010
5032
  }
5011
5033
  const recordRowLayout = new RecordRowLayout();
@@ -5047,8 +5069,8 @@ const createCells = (config) => {
5047
5069
  const row = context.linearRows()[rowIndex];
5048
5070
  const { _id: recordId, type } = row;
5049
5071
  const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
5050
- const { rowIndex: pointRowIndex, areaType, targetName } = context.pointPosition();
5051
- const isHover = pointRowIndex === rowIndex && areaType !== AITableAreaType.none;
5072
+ const { rowIndex: pointRowIndex, targetName } = context.pointPosition();
5073
+ const isHover = pointRowIndex === rowIndex;
5052
5074
  switch (type) {
5053
5075
  case AITableRowType.add: {
5054
5076
  const isHoverRow = isHover && targetName === AI_TABLE_ROW_ADD_BUTTON;
@@ -5346,11 +5368,11 @@ class AITableFieldHead {
5346
5368
  targetName: AI_TABLE_FIELD_HEAD_MORE,
5347
5369
  fieldId: field._id
5348
5370
  }),
5349
- x: width - AI_TABLE_CELL_PADDING - AI_TABLE_ACTION_COMMON_SIZE,
5371
+ x: width - AI_TABLE_ACTION_COMMON_SIZE,
5350
5372
  y: commonIconOffsetY,
5351
5373
  data: MoreStandOutlinedPath,
5352
5374
  fill: isHoverIcon ? Colors.primary : Colors.gray600,
5353
- background: isSelected || isHoverIcon ? Colors.itemActiveBgColor : Colors.gray80,
5375
+ background: Colors.transparent,
5354
5376
  backgroundWidth: AI_TABLE_ACTION_COMMON_SIZE,
5355
5377
  backgroundHeight: AI_TABLE_ACTION_COMMON_SIZE,
5356
5378
  cornerRadius: 4
@@ -5388,7 +5410,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
5388
5410
  </ko-group>
5389
5411
  `,
5390
5412
  standalone: true,
5391
- imports: [KoContainer, KoStage, KoShape, AITableFieldIcon, AITableText, AITableIcon],
5413
+ imports: [KoContainer, KoShape, AITableFieldIcon, AITableText, AITableIcon],
5392
5414
  changeDetection: ChangeDetectionStrategy.OnPush
5393
5415
  }]
5394
5416
  }] });
@@ -5573,7 +5595,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
5573
5595
  <ko-rect [config]="headBgConfig()"></ko-rect>
5574
5596
  `,
5575
5597
  standalone: true,
5576
- imports: [KoStage, KoShape, AITableFieldHead, AITableIcon, KoContainer],
5598
+ imports: [KoShape, AITableFieldHead, AITableIcon, KoContainer],
5577
5599
  changeDetection: ChangeDetectionStrategy.OnPush
5578
5600
  }]
5579
5601
  }] });
@@ -5939,8 +5961,7 @@ class AITableRenderer {
5939
5961
  return this.coordinate().getColumnOffset(this.visibleRangeInfo().columnStopIndex);
5940
5962
  });
5941
5963
  this.cellGroupClipWidth = computed(() => {
5942
- const { scrollLeft } = this.scrollState();
5943
- return Math.min(this.containerWidth() - this.frozenAreaWidth(), AI_TABLE_FIELD_ADD_BUTTON_WIDTH + this.lastColumnOffset() + this.lastColumnWidth() - scrollLeft - this.frozenAreaWidth());
5964
+ return this.containerWidth() - this.frozenAreaWidth();
5944
5965
  });
5945
5966
  this.stageConfig = computed(() => {
5946
5967
  const { isScrolling } = this.scrollState();
@@ -6001,7 +6022,7 @@ class AITableRenderer {
6001
6022
  offsetY: scrollTop
6002
6023
  };
6003
6024
  });
6004
- this.columnHeadConfig = computed(() => {
6025
+ this.columnHeadOrAddFieldConfig = computed(() => {
6005
6026
  const { columnStartIndex, columnStopIndex } = this.visibleRangeInfo();
6006
6027
  const { aiTable, coordinate } = this.config();
6007
6028
  const { pointPosition } = aiTable.context;
@@ -6045,7 +6066,7 @@ class AITableRenderer {
6045
6066
  this.koDblclick.emit(e);
6046
6067
  }
6047
6068
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6048
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", 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", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($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]=\"columnHeadConfig()\"></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]=\"columnHeadConfig()\"></ai-table-column-heads>\n <ai-table-add-field\n [coordinate]=\"coordinate()\"\n [fields]=\"fields()\"\n [columnStopIndex]=\"visibleRangeInfo().columnStopIndex\"\n ></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 </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 </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: AITablePlaceholderCells, selector: "ai-table-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITableAddField, selector: "ai-table-add-field", inputs: ["coordinate", "fields", "columnStopIndex"] }, { 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 }); }
6069
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", 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", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($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\n [config]=\"columnHeadOrAddFieldConfig()\"\n ></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 </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 </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: 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 }); }
6049
6070
  }
6050
6071
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableRenderer, decorators: [{
6051
6072
  type: Component,
@@ -6053,8 +6074,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
6053
6074
  KoContainer,
6054
6075
  KoStage,
6055
6076
  KoShape,
6056
- AITableIcon,
6057
- AITableFieldHead,
6058
6077
  AITableColumnHeads,
6059
6078
  AITableFrozenColumnHeads,
6060
6079
  AITableCells,
@@ -6064,14 +6083,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
6064
6083
  AITableAddField,
6065
6084
  AITableHoverRowHeads,
6066
6085
  AITableOtherRows
6067
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($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]=\"columnHeadConfig()\"></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]=\"columnHeadConfig()\"></ai-table-column-heads>\n <ai-table-add-field\n [coordinate]=\"coordinate()\"\n [fields]=\"fields()\"\n [columnStopIndex]=\"visibleRangeInfo().columnStopIndex\"\n ></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 </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 </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
6086
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($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\n [config]=\"columnHeadOrAddFieldConfig()\"\n ></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 </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 </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
6068
6087
  }] });
6069
6088
 
6070
6089
  class AITableGrid extends AITableGridBase {
6071
6090
  constructor() {
6072
6091
  super();
6073
6092
  this.fieldHeadHeight = AI_TABLE_FIELD_HEAD_HEIGHT;
6074
- this.ADD_BUTTON_WIDTH = AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
6075
6093
  this.containerRect = signal({ width: 0, height: 0 });
6076
6094
  this.hasContainerRect = computed(() => {
6077
6095
  return this.containerRect().width > 0 && this.containerRect().height > 0;
@@ -6120,6 +6138,9 @@ class AITableGrid extends AITableGridBase {
6120
6138
  this.scrollTotalHeight = computed(() => {
6121
6139
  return Math.max(this.coordinate().totalHeight, this.containerRect().height - this.fieldHeadHeight);
6122
6140
  });
6141
+ this.scrollbarWidth = computed(() => {
6142
+ return this.coordinate().totalWidth + AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
6143
+ });
6123
6144
  this.scrollAction = (options) => {
6124
6145
  if (this.timer) {
6125
6146
  cancelAnimationFrame(this.timer);
@@ -6276,8 +6297,8 @@ class AITableGrid extends AITableGridBase {
6276
6297
  x: containerRect.x + moreRect.x,
6277
6298
  y: containerRect.y + moreRect.y + moreRect.height
6278
6299
  };
6279
- const editOriginPosition = {
6280
- x: AI_TABLE_POPOVER_LEFT_OFFSET + fieldGroupRect.x,
6300
+ const editFieldPosition = {
6301
+ x: containerRect.x + fieldGroupRect.x - AI_TABLE_CELL_PADDING,
6281
6302
  y: containerRect.y + fieldGroupRect.y + fieldGroupRect.height
6282
6303
  };
6283
6304
  const editOrigin = this.containerElement().querySelector('.konvajs-content');
@@ -6287,7 +6308,7 @@ class AITableGrid extends AITableGridBase {
6287
6308
  origin: this.containerElement(),
6288
6309
  position,
6289
6310
  editOrigin: editOrigin,
6290
- editOriginPosition
6311
+ editFieldPosition
6291
6312
  });
6292
6313
  }
6293
6314
  return;
@@ -6361,7 +6382,7 @@ class AITableGrid extends AITableGridBase {
6361
6382
  containerResizeListener() {
6362
6383
  this.resizeObserver = new ResizeObserver(() => {
6363
6384
  const containerWidth = this.containerElement().offsetWidth;
6364
- const totalWidth = this.coordinate().totalWidth + this.ADD_BUTTON_WIDTH;
6385
+ const totalWidth = this.coordinate().totalWidth + AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
6365
6386
  this.setContainerRect();
6366
6387
  if (containerWidth >= totalWidth) {
6367
6388
  this.aiTable.context.setScrollState({ scrollLeft: 0 });
@@ -6414,13 +6435,13 @@ class AITableGrid extends AITableGridBase {
6414
6435
  }
6415
6436
  }
6416
6437
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6417
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AITableGrid, isStandalone: true, selector: "ai-table-grid", host: { classAttribute: "ai-table-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "verticalBarRef", first: true, predicate: ["verticalBar"], descendants: true, isSignal: true }, { propertyName: "horizontalBarRef", first: true, predicate: ["horizontalBar"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n >\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"coordinate().totalWidth + ADD_BUTTON_WIDTH\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n</div>\n", dependencies: [{ kind: "component", type: AITableRenderer, selector: "ai-table-renderer", inputs: ["config"], outputs: ["koMousemove", "koMousedown", "koWheel", "koClick", "koDblclick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6438
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AITableGrid, isStandalone: true, selector: "ai-table-grid", host: { classAttribute: "ai-table-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "verticalBarRef", first: true, predicate: ["verticalBar"], descendants: true, isSignal: true }, { propertyName: "horizontalBarRef", first: true, predicate: ["horizontalBar"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n >\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n</div>\n", dependencies: [{ kind: "component", type: AITableRenderer, selector: "ai-table-renderer", inputs: ["config"], outputs: ["koMousemove", "koMousedown", "koWheel", "koClick", "koDblclick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6418
6439
  }
6419
6440
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableGrid, decorators: [{
6420
6441
  type: Component,
6421
6442
  args: [{ selector: 'ai-table-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
6422
6443
  class: 'ai-table-grid'
6423
- }, imports: [AITableRenderer], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n >\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"coordinate().totalWidth + ADD_BUTTON_WIDTH\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n</div>\n" }]
6444
+ }, imports: [AITableRenderer], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n >\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n</div>\n" }]
6424
6445
  }], ctorParameters: () => [] });
6425
6446
 
6426
6447
  /**