@ai-table/grid 0.1.26 → 0.1.27

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.
@@ -8292,27 +8292,24 @@ class AITableFrozenFieldShadow {
8292
8292
  : this.config().height;
8293
8293
  return {
8294
8294
  visible: this.scrollState().scrollLeft > 0,
8295
- x: this.frozenAreaWidth(),
8295
+ x: this.frozenAreaWidth() + 1, // 偏移1,避免和边框重叠导致颜色太深
8296
8296
  y: 0,
8297
- points: [0, 0, 0, height],
8298
- stroke: Colors.gray200,
8299
- strokeWidth: 1,
8300
- shadowColor: Colors.black,
8301
- shadowBlur: 6,
8302
- shadowOffset: { x: 3.5, y: 0 },
8303
- shadowOpacity: 0.25,
8304
- shadowForStrokeEnabled: true
8297
+ width: 8,
8298
+ height,
8299
+ fillLinearGradientStartPoint: { x: 0, y: 0 },
8300
+ fillLinearGradientEndPoint: { x: 8, y: 0 },
8301
+ fillLinearGradientColorStops: [0, 'rgba(0,0,0,0.05)', 1, Colors.transparent]
8305
8302
  };
8306
8303
  });
8307
8304
  }
8308
8305
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFrozenFieldShadow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8309
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: AITableFrozenFieldShadow, isStandalone: true, selector: "ai-table-frozen-field-shadow", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<ko-line [config]="frozenShadowConfig()"></ko-line>`, 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 }); }
8306
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: AITableFrozenFieldShadow, isStandalone: true, selector: "ai-table-frozen-field-shadow", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<ko-rect [config]="frozenShadowConfig()"></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 }); }
8310
8307
  }
8311
8308
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFrozenFieldShadow, decorators: [{
8312
8309
  type: Component,
8313
8310
  args: [{
8314
8311
  selector: 'ai-table-frozen-field-shadow',
8315
- template: `<ko-line [config]="frozenShadowConfig()"></ko-line>`,
8312
+ template: `<ko-rect [config]="frozenShadowConfig()"></ko-rect>`,
8316
8313
  imports: [KoShape],
8317
8314
  changeDetection: ChangeDetectionStrategy.OnPush
8318
8315
  }]
@@ -11314,6 +11311,7 @@ class AITableGrid extends AITableGridBase {
11314
11311
  };
11315
11312
  this.dragFillState = {
11316
11313
  isDragging: false,
11314
+ activeCell: null,
11317
11315
  sourceCells: new Set()
11318
11316
  };
11319
11317
  this.notifyService = inject(ThyNotifyService);
@@ -11612,7 +11610,7 @@ class AITableGrid extends AITableGridBase {
11612
11610
  if (this.dragFillState.isDragging) {
11613
11611
  setMouseStyle('crosshair', this.containerElement());
11614
11612
  const { highlightStartCell, highlightEndCell } = dragFillHighlightArea(this.aiTable, this.dragFillState.sourceCells, recordId);
11615
- activeCell = this.aiTable.selection().activeCell;
11613
+ activeCell = this.dragFillState.activeCell;
11616
11614
  startCell = highlightStartCell;
11617
11615
  endCell = highlightEndCell;
11618
11616
  }
@@ -11667,6 +11665,7 @@ class AITableGrid extends AITableGridBase {
11667
11665
  return;
11668
11666
  this.updateDragFillState({
11669
11667
  isDragging: true,
11668
+ activeCell: this.aiTable.selection().activeCell,
11670
11669
  sourceCells: this.aiTable.selection().selectedCells
11671
11670
  });
11672
11671
  return;
@@ -11706,7 +11705,7 @@ class AITableGrid extends AITableGridBase {
11706
11705
  const gridStage = e.event.currentTarget.getStage();
11707
11706
  const pos = gridStage?.getPointerPosition();
11708
11707
  if (pos == null) {
11709
- this.updateDragFillState({ isDragging: false, sourceCells: new Set() });
11708
+ this.updateDragFillState({ isDragging: false, activeCell: null, sourceCells: new Set() });
11710
11709
  return;
11711
11710
  }
11712
11711
  const { context } = this.aiTable;
@@ -11716,7 +11715,7 @@ class AITableGrid extends AITableGridBase {
11716
11715
  if (recordId) {
11717
11716
  performFill(this.aiTable, this.dragFillState.sourceCells, recordId, this.actions);
11718
11717
  }
11719
- this.updateDragFillState({ isDragging: false, sourceCells: new Set() });
11718
+ this.updateDragFillState({ isDragging: false, activeCell: null, sourceCells: new Set() });
11720
11719
  }
11721
11720
  stageMouseleave(e) {
11722
11721
  if (!this.isDragSelectionAutoScrolling) {
@@ -12131,7 +12130,21 @@ class AITableGrid extends AITableGridBase {
12131
12130
  const nextField = gridData.fields[!isHorizontalScroll || scrollLeft > 0 ? nextCellIndex : nextCellIndex + 1];
12132
12131
  const nextRecord = gridData.records[nextRowIndex];
12133
12132
  if (nextField && nextRecord) {
12134
- this.aiTableGridSelectionService.selectCells([startCell[0], startCell[1]], [nextRecord._id, nextField._id]);
12133
+ let newStartCell = null;
12134
+ let newEndCell = null;
12135
+ let newActiveCell = null;
12136
+ if (this.dragFillState.isDragging) {
12137
+ const { highlightStartCell, highlightEndCell } = dragFillHighlightArea(this.aiTable, this.dragFillState.sourceCells, nextRecord._id);
12138
+ newStartCell = highlightStartCell;
12139
+ newEndCell = highlightEndCell;
12140
+ newActiveCell = this.dragFillState.activeCell;
12141
+ }
12142
+ else {
12143
+ newStartCell = [startCell[0], startCell[1]];
12144
+ newEndCell = [nextRecord._id, nextField._id];
12145
+ newActiveCell = null;
12146
+ }
12147
+ this.aiTableGridSelectionService.selectCells(newStartCell, newEndCell, newActiveCell);
12135
12148
  }
12136
12149
  }
12137
12150
  },