@ai-table/grid 0.0.34 → 0.0.36

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 (61) hide show
  1. package/core/utils/common.d.ts.map +1 -1
  2. package/esm2022/components/cell-editors/link/link-editor.component.mjs +3 -3
  3. package/esm2022/core/utils/common.mjs +4 -2
  4. package/esm2022/grid.component.mjs +22 -4
  5. package/esm2022/renderer/components/cells/cells.mjs +6 -0
  6. package/esm2022/renderer/components/cells/index.mjs +2 -0
  7. package/esm2022/renderer/components/cells/link.component.mjs +90 -0
  8. package/esm2022/renderer/components/field-head.component.mjs +2 -2
  9. package/esm2022/renderer/components/frozen-heads.component.mjs +4 -4
  10. package/esm2022/renderer/components/hover-cell.component.mjs +103 -0
  11. package/esm2022/renderer/components/index.mjs +2 -1
  12. package/esm2022/renderer/components/text.component.mjs +13 -4
  13. package/esm2022/renderer/creations/create-cells.mjs +9 -3
  14. package/esm2022/renderer/drawers/cell-drawer.mjs +22 -6
  15. package/esm2022/renderer/interfaces/hover-cell.mjs +4 -0
  16. package/esm2022/renderer/interfaces/index.mjs +2 -0
  17. package/esm2022/renderer/renderer.component.mjs +8 -4
  18. package/esm2022/services/selection.service.mjs +33 -10
  19. package/esm2022/types/cell.mjs +1 -1
  20. package/esm2022/types/component-config.mjs +1 -1
  21. package/esm2022/types/grid.mjs +7 -1
  22. package/esm2022/utils/get-placeholder-cells.mjs +5 -5
  23. package/esm2022/utils/hover-cell.mjs +31 -0
  24. package/esm2022/utils/index.mjs +2 -1
  25. package/fesm2022/ai-table-grid.mjs +1246 -954
  26. package/fesm2022/ai-table-grid.mjs.map +1 -1
  27. package/grid.component.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/renderer/components/cells/cells.d.ts +5 -0
  30. package/renderer/components/cells/cells.d.ts.map +1 -0
  31. package/renderer/components/cells/index.d.ts +2 -0
  32. package/renderer/components/cells/index.d.ts.map +1 -0
  33. package/renderer/components/cells/link.component.d.ts +23 -0
  34. package/renderer/components/cells/link.component.d.ts.map +1 -0
  35. package/renderer/components/frozen-heads.component.d.ts.map +1 -1
  36. package/renderer/components/hover-cell.component.d.ts +23 -0
  37. package/renderer/components/hover-cell.component.d.ts.map +1 -0
  38. package/renderer/components/index.d.ts +1 -0
  39. package/renderer/components/index.d.ts.map +1 -1
  40. package/renderer/components/text.component.d.ts +6 -1
  41. package/renderer/components/text.component.d.ts.map +1 -1
  42. package/renderer/creations/create-cells.d.ts +2 -0
  43. package/renderer/creations/create-cells.d.ts.map +1 -1
  44. package/renderer/drawers/cell-drawer.d.ts.map +1 -1
  45. package/renderer/interfaces/hover-cell.d.ts +8 -0
  46. package/renderer/interfaces/hover-cell.d.ts.map +1 -0
  47. package/renderer/interfaces/index.d.ts +2 -0
  48. package/renderer/interfaces/index.d.ts.map +1 -0
  49. package/renderer/renderer.component.d.ts.map +1 -1
  50. package/services/selection.service.d.ts +2 -0
  51. package/services/selection.service.d.ts.map +1 -1
  52. package/types/cell.d.ts +1 -0
  53. package/types/cell.d.ts.map +1 -1
  54. package/types/component-config.d.ts +10 -0
  55. package/types/component-config.d.ts.map +1 -1
  56. package/types/grid.d.ts +6 -0
  57. package/types/grid.d.ts.map +1 -1
  58. package/utils/hover-cell.d.ts +8 -0
  59. package/utils/hover-cell.d.ts.map +1 -0
  60. package/utils/index.d.ts +1 -0
  61. package/utils/index.d.ts.map +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, output, inject, ElementRef, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, ChangeDetectorRef, ViewChild, HostListener, Pipe, input, Renderer2, model, booleanAttribute, Injectable, DestroyRef, NgZone, InjectionToken, effect, ViewContainerRef, viewChild, afterNextRender } from '@angular/core';
2
+ import { signal, computed, output, inject, ElementRef, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, ChangeDetectorRef, ViewChild, HostListener, Pipe, input, Renderer2, model, booleanAttribute, Injectable, InjectionToken, effect, DestroyRef, NgZone, ViewContainerRef, viewChild, afterNextRender, untracked } from '@angular/core';
3
3
  import * as i1$1 from 'ngx-tethys/popover';
4
4
  import { ThyPopoverRef, ThyPopover, ThyPopoverModule } from 'ngx-tethys/popover';
5
5
  import ObjectID from 'bson-objectid';
@@ -47,6 +47,7 @@ import { fromUnixTime, subDays } from 'date-fns';
47
47
  import Konva from 'konva';
48
48
  import { Shape } from 'konva/lib/Shape';
49
49
  import { Sprite } from 'konva/lib/shapes/Sprite';
50
+ import GraphemeSplitter from 'grapheme-splitter';
50
51
  import { Stage } from 'konva/lib/Stage';
51
52
  import { FastLayer } from 'konva/lib/FastLayer';
52
53
  import { Group } from 'konva/lib/Group';
@@ -67,7 +68,6 @@ import { Text } from 'konva/lib/shapes/Text';
67
68
  import { TextPath } from 'konva/lib/shapes/TextPath';
68
69
  import { Transformer } from 'konva/lib/shapes/Transformer';
69
70
  import { Wedge } from 'konva/lib/shapes/Wedge';
70
- import GraphemeSplitter from 'grapheme-splitter';
71
71
 
72
72
  const Colors = {
73
73
  primary: '#6698FF',
@@ -340,6 +340,12 @@ var AITableAreaType;
340
340
  AITableAreaType["grid"] = "grid";
341
341
  AITableAreaType["none"] = "none";
342
342
  })(AITableAreaType || (AITableAreaType = {}));
343
+ var AITableSelectAllState;
344
+ (function (AITableSelectAllState) {
345
+ AITableSelectAllState["all"] = "all";
346
+ AITableSelectAllState["partial"] = "partial";
347
+ AITableSelectAllState["none"] = "none";
348
+ })(AITableSelectAllState || (AITableSelectAllState = {}));
343
349
 
344
350
  var AITableRowType;
345
351
  (function (AITableRowType) {
@@ -707,7 +713,8 @@ function createAITable(records, fields) {
707
713
  selectedRecords: new Set(),
708
714
  selectedFields: new Set(),
709
715
  selectedCells: new Set(),
710
- activeCell: null
716
+ activeCell: null,
717
+ selectAllState: AITableSelectAllState.none
711
718
  }),
712
719
  keywordsMatchedCells: signal(new Set()),
713
720
  recordsMap: computed(() => {
@@ -1049,8 +1056,8 @@ class LinkCellEditorComponent extends AbstractEditCellEditor {
1049
1056
  ngOnInit() {
1050
1057
  super.ngOnInit();
1051
1058
  this.originValue = this.modelValue;
1052
- this.text = this.modelValue.text ?? '';
1053
- this.url = this.modelValue.url ?? '';
1059
+ this.text = this.modelValue?.text ?? '';
1060
+ this.url = this.modelValue?.url ?? '';
1054
1061
  }
1055
1062
  updateValue() {
1056
1063
  if (!this.isValidLink({ text: this.text, url: this.url ?? '' })) {
@@ -1566,7 +1573,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1566
1573
  }] } });
1567
1574
 
1568
1575
  class AITableGridSelectionService {
1569
- constructor() { }
1576
+ constructor() {
1577
+ this.selectAllState = computed(() => {
1578
+ const selectedRecords = this.aiTable.selection().selectedRecords;
1579
+ return selectedRecords.size === this.aiTable.records().length
1580
+ ? AITableSelectAllState.all
1581
+ : selectedRecords.size === 0
1582
+ ? AITableSelectAllState.none
1583
+ : AITableSelectAllState.partial;
1584
+ });
1585
+ }
1570
1586
  initialize(aiTable) {
1571
1587
  this.aiTable = aiTable;
1572
1588
  }
@@ -1575,7 +1591,8 @@ class AITableGridSelectionService {
1575
1591
  selectedRecords: new Set(),
1576
1592
  selectedFields: new Set(),
1577
1593
  selectedCells: new Set(),
1578
- activeCell: null
1594
+ activeCell: null,
1595
+ selectAllState: AITableSelectAllState.none
1579
1596
  });
1580
1597
  }
1581
1598
  setActiveCell(activeCell) {
@@ -1595,19 +1612,31 @@ class AITableGridSelectionService {
1595
1612
  else {
1596
1613
  this.aiTable.selection().selectedRecords.add(recordId);
1597
1614
  }
1615
+ const selectedRecords = this.aiTable.selection().selectedRecords;
1598
1616
  this.aiTable.selection.set({
1599
- selectedRecords: this.aiTable.selection().selectedRecords,
1617
+ selectedRecords: selectedRecords,
1600
1618
  selectedFields: new Set(),
1601
1619
  selectedCells: new Set(),
1602
- activeCell: null
1620
+ activeCell: null,
1621
+ selectAllState: this.selectAllState()
1603
1622
  });
1604
1623
  }
1605
1624
  toggleSelectAll(checked) {
1606
- this.clearSelection();
1607
1625
  if (checked) {
1608
- this.aiTable.records().forEach((item) => {
1609
- this.selectRecord(item._id);
1610
- });
1626
+ if (this.aiTable.records().length === 0) {
1627
+ this.aiTable.selection.set({
1628
+ ...this.aiTable.selection(),
1629
+ selectAllState: AITableSelectAllState.all
1630
+ });
1631
+ }
1632
+ else {
1633
+ this.aiTable.records().forEach((item) => {
1634
+ this.selectRecord(item._id);
1635
+ });
1636
+ }
1637
+ }
1638
+ else {
1639
+ this.clearSelection();
1611
1640
  }
1612
1641
  }
1613
1642
  updateSelect(event) {
@@ -2121,7 +2150,7 @@ function getPlaceHolderCellsConfigs(options) {
2121
2150
  return [];
2122
2151
  }
2123
2152
  // 当前列的 X 轴偏移量和列宽度
2124
- const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
2153
+ const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET * 2;
2125
2154
  const columnWidth = coordinate.getColumnWidth(columnIndex);
2126
2155
  for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
2127
2156
  // 当前行索引是否超出总行数范围,超出则退出循环
@@ -2134,13 +2163,13 @@ function getPlaceHolderCellsConfigs(options) {
2134
2163
  continue;
2135
2164
  }
2136
2165
  // 当前行的 Y 轴偏移量,并根据列宽和列索引获取单元格的水平位置(宽度和偏移量)
2137
- const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
2166
+ const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET * 2;
2138
2167
  const { width, offset } = getCellHorizontalPosition({
2139
2168
  columnWidth,
2140
2169
  columnIndex,
2141
2170
  columnCount
2142
2171
  });
2143
- const height = rowHeight;
2172
+ const height = rowHeight - AI_TABLE_OFFSET * 4;
2144
2173
  configs.unshift({
2145
2174
  key: `placeholder-cell-${fieldId}-${recordId}`,
2146
2175
  name: generateTargetName({
@@ -2150,7 +2179,7 @@ function getPlaceHolderCellsConfigs(options) {
2150
2179
  }),
2151
2180
  x: x + offset,
2152
2181
  y,
2153
- width,
2182
+ width: width - AI_TABLE_OFFSET * 4,
2154
2183
  height,
2155
2184
  fill: Colors.transparent,
2156
2185
  strokeEnabled: false,
@@ -2893,613 +2922,190 @@ const isCellMatchKeywords = (aiTable, field, recordId, keywords, references) =>
2893
2922
  return keywords && cellFullText.length && cellFullText.some((text) => text.toLowerCase().includes(keywords.toLowerCase()));
2894
2923
  };
2895
2924
 
2896
- class AITableGridEventService {
2897
- constructor() {
2898
- this.dblClickEvent$ = new Subject();
2899
- this.mousedownEvent$ = new Subject();
2900
- this.mouseoverEvent$ = new Subject();
2901
- this.globalMouseoverEvent$ = new Subject();
2902
- this.globalMousedownEvent$ = new Subject();
2903
- this.destroyRef = inject(DestroyRef);
2904
- this.thyPopover = inject(ThyPopover);
2905
- }
2906
- initialize(aiTable, aiFieldRenderers) {
2907
- this.aiTable = aiTable;
2908
- this.aiFieldRenderers = aiFieldRenderers;
2925
+ function updatePicture(node) {
2926
+ const drawingNode = node.getLayer() || node.getStage();
2927
+ if (drawingNode) {
2928
+ drawingNode.batchDraw();
2909
2929
  }
2910
- registerEvents(element) {
2911
- fromEvent(element, 'dblclick', { passive: true })
2912
- .pipe(takeUntilDestroyed(this.destroyRef))
2913
- .subscribe((event) => {
2914
- this.dblClickEvent$.next(event);
2915
- });
2916
- fromEvent(element, 'mouseover', { passive: true })
2917
- .pipe(debounceTime(80), takeUntilDestroyed(this.destroyRef))
2918
- .subscribe((event) => {
2919
- this.mouseoverEvent$.next(event);
2920
- });
2921
- fromEvent(document, 'mouseover', { passive: true })
2922
- .pipe(takeUntilDestroyed(this.destroyRef))
2923
- .subscribe((event) => {
2924
- this.globalMouseoverEvent$.next(event);
2925
- });
2926
- fromEvent(element, 'mousedown', { passive: true })
2927
- .pipe(takeUntilDestroyed(this.destroyRef))
2928
- .subscribe((event) => {
2929
- this.mousedownEvent$.next(event);
2930
- });
2931
- fromEvent(document, 'mousedown', { passive: true })
2932
- .pipe(takeUntilDestroyed(this.destroyRef))
2933
- .subscribe((event) => {
2934
- this.globalMousedownEvent$.next(event);
2935
- });
2930
+ }
2931
+
2932
+ // adapted FROM: https://github.com/lavrton/react-konva/blob/master/src/react-konva-fiber.js
2933
+ function applyNodeProps(component, props = {}, oldProps = {}) {
2934
+ if ('id' in props) {
2935
+ const message = `You are using "id" attribute for Konva node. In some very rare cases it may produce bugs. Currently we recommend not to use it and use "name" attribute instead.`;
2936
+ console.warn(message);
2936
2937
  }
2937
- getEditorComponent(type) {
2938
- const filedRenderSchema = this.aiFieldRenderers && this.aiFieldRenderers[type];
2939
- if (filedRenderSchema && filedRenderSchema.editor) {
2940
- return filedRenderSchema.editor;
2938
+ const instance = component.getNode();
2939
+ const updatedProps = {};
2940
+ let hasUpdates = false;
2941
+ Object.keys(oldProps).forEach((key) => {
2942
+ const isEvent = key.slice(0, 2) === 'ko';
2943
+ const propChanged = oldProps[key] !== props[key];
2944
+ if (isEvent && propChanged) {
2945
+ let eventName = key.slice(2).toLowerCase();
2946
+ if (eventName.slice(0, 7) === 'content') {
2947
+ eventName = 'content' + eventName.slice(7, 8).toUpperCase() + eventName.slice(8);
2948
+ }
2949
+ instance.off(eventName, oldProps[key]);
2941
2950
  }
2942
- return GRID_CELL_EDITOR_MAP[type];
2943
- }
2944
- openEdit(cellDom) {
2945
- const { x, y, width, height } = cellDom.getBoundingClientRect();
2946
- const fieldId = cellDom.getAttribute('fieldId');
2947
- const recordId = cellDom.getAttribute('recordId');
2948
- const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
2949
- const ref = this.thyPopover.open(component, {
2950
- origin: cellDom,
2951
- originPosition: {
2952
- x: x - 1,
2953
- y: y + 1,
2954
- width: width + 2,
2955
- height: height + 2
2956
- },
2957
- width: width + 1 + 'px',
2958
- height: height + 2 + 'px',
2959
- placement: 'top',
2960
- offset: -(height + 4),
2961
- minWidth: width,
2962
- initialState: {
2963
- fieldId: fieldId,
2964
- recordId: recordId,
2965
- aiTable: this.aiTable
2966
- },
2967
- panelClass: 'grid-cell-editor',
2968
- outsideClosable: false,
2969
- hasBackdrop: false,
2970
- manualClosure: true,
2971
- animationDisabled: true,
2972
- autoAdaptive: true
2973
- });
2974
- return ref;
2975
- }
2976
- getOriginPosition(aiTable, options) {
2977
- const { container, coordinate, recordId, fieldId, isHoverEdit } = options;
2978
- const { scrollState } = aiTable.context;
2979
- const { rowHeight, columnCount } = coordinate;
2980
- const cell = [recordId, fieldId];
2981
- const { rowIndex, columnIndex } = AITable.getCellIndex(aiTable, cell);
2982
- const originX = coordinate.getColumnOffset(columnIndex);
2983
- const originY = coordinate.getRowOffset(rowIndex);
2984
- const columnWidth = coordinate.getColumnWidth(columnIndex);
2985
- const { width: originWidth, offset: originOffset } = getCellHorizontalPosition({
2986
- columnWidth,
2987
- columnIndex,
2988
- columnCount
2989
- });
2990
- const originRect = container.getBoundingClientRect();
2991
- const isFrozenColumn = AITable.isFrozenColumn(aiTable, columnIndex);
2992
- const scrollLeft = isFrozenColumn ? 0 : scrollState().scrollLeft;
2993
- const scrollTop = scrollState().scrollTop;
2994
- const originPosition = {
2995
- x: originX + originOffset - scrollLeft + originRect.x,
2996
- y: originY - scrollTop + originRect.y,
2997
- width: originWidth,
2998
- height: rowHeight
2999
- };
3000
- let x = originPosition.x + getEditorBoxOffset();
3001
- let y = originPosition.y + getEditorBoxOffset();
3002
- let width = getEditorSpace(originPosition.width);
3003
- let height = getEditorSpace(originPosition.height);
3004
- // hover 编辑组件无边框
3005
- if (isHoverEdit) {
3006
- x = originPosition.x + getHoverEditorBoxOffset();
3007
- y = originPosition.y + getHoverEditorBoxOffset();
3008
- width = getHoverEditorSpace(originPosition.width);
3009
- height = getHoverEditorSpace(originPosition.height);
2951
+ const toRemove = !Object.hasOwn(props, key);
2952
+ if (toRemove) {
2953
+ instance.setAttr(key, undefined);
3010
2954
  }
3011
- return {
3012
- ...originPosition,
3013
- x: x,
3014
- y: y,
3015
- width: width,
3016
- height: height
3017
- };
3018
- }
3019
- openCellEditor(aiTable, options) {
3020
- const { container, recordId, fieldId, isHoverEdit, references } = options;
3021
- const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
3022
- const offsetOriginPosition = this.getOriginPosition(aiTable, options);
3023
- this.cellEditorPopoverRef = this.thyPopover.open(component, {
3024
- origin: container,
3025
- originPosition: offsetOriginPosition,
3026
- width: offsetOriginPosition.width + 'px',
3027
- height: offsetOriginPosition.height + 'px',
3028
- minWidth: offsetOriginPosition.width + 'px',
3029
- placement: 'bottom',
3030
- offset: -offsetOriginPosition.height,
3031
- initialState: {
3032
- fieldId: fieldId,
3033
- recordId: recordId,
3034
- references,
3035
- aiTable: aiTable
3036
- },
3037
- panelClass: 'grid-cell-editor',
3038
- outsideClosable: false,
3039
- hasBackdrop: false,
3040
- manualClosure: true,
3041
- animationDisabled: true,
3042
- autoAdaptive: true
3043
- });
3044
- if (this.cellEditorPopoverRef) {
3045
- const wheelEvent = fromEvent(this.cellEditorPopoverRef.componentInstance.elementRef.nativeElement, 'wheel').subscribe((event) => {
3046
- const field = aiTable.fieldsMap()[fieldId];
3047
- if (field.type === AITableFieldType.text || field.type === AITableFieldType.richText) {
3048
- return;
3049
- }
3050
- event.preventDefault();
3051
- this.aiTable.context?.scrollAction({
3052
- deltaX: event.deltaX,
3053
- deltaY: event.deltaY,
3054
- shiftKey: event.shiftKey,
3055
- callback: () => {
3056
- const originPosition = this.getOriginPosition(aiTable, options);
3057
- const positionStrategy = this.cellEditorPopoverRef
3058
- .getOverlayRef()
3059
- .getConfig().positionStrategy;
3060
- positionStrategy.setOrigin(originPosition);
3061
- positionStrategy.apply();
3062
- }
2955
+ });
2956
+ Object.keys(props).forEach((key) => {
2957
+ const isEvent = key.slice(0, 2) === 'ko';
2958
+ const toAdd = oldProps[key] !== props[key];
2959
+ if (isEvent && toAdd) {
2960
+ let eventName = key.slice(2).toLowerCase();
2961
+ if (eventName.slice(0, 7) === 'content') {
2962
+ eventName = 'content' + eventName.slice(7, 8).toUpperCase() + eventName.slice(8);
2963
+ }
2964
+ if (props[key]) {
2965
+ instance.off(eventName);
2966
+ instance.on(eventName, (event) => {
2967
+ props[key]({
2968
+ angularComponent: component,
2969
+ event
2970
+ });
3063
2971
  });
3064
- });
3065
- this.cellEditorPopoverRef.afterClosed().subscribe(() => {
3066
- wheelEvent.unsubscribe();
3067
- this.cellEditorPopoverRef = null;
3068
- });
3069
- this.cellEditorPopoverRef.componentInstance.updateFieldValue.subscribe((value) => {
3070
- options.updateFieldValue(value);
3071
- });
3072
- }
3073
- return this.cellEditorPopoverRef;
3074
- }
3075
- closeCellEditor() {
3076
- if (this.cellEditorPopoverRef) {
3077
- this.cellEditorPopoverRef.close();
3078
- this.cellEditorPopoverRef = null;
3079
- }
3080
- }
3081
- getCurrentEditCell() {
3082
- if (this.cellEditorPopoverRef) {
3083
- const recordId = this.cellEditorPopoverRef.componentInstance?.recordId;
3084
- const fieldId = this.cellEditorPopoverRef.componentInstance?.fieldId;
3085
- if (recordId && fieldId) {
3086
- return {
3087
- recordId,
3088
- fieldId
3089
- };
3090
2972
  }
3091
- return null;
3092
2973
  }
3093
- return null;
3094
- }
3095
- openContextMenu(aiTable, options) {
3096
- const { origin, position, menuItems, targetName, viewContainerRef } = options;
3097
- const ref = this.thyPopover.open(AITableContextMenu, {
3098
- origin: origin,
3099
- originPosition: position,
3100
- placement: 'bottomLeft',
3101
- insideClosable: true,
3102
- viewContainerRef,
3103
- initialState: {
3104
- aiTable,
3105
- menuItems,
3106
- targetName,
3107
- position
2974
+ if (!isEvent && (props[key] !== oldProps[key] || props[key] !== instance.getAttr(key))) {
2975
+ hasUpdates = true;
2976
+ updatedProps[key] = props[key];
2977
+ }
2978
+ });
2979
+ if (hasUpdates) {
2980
+ instance.setAttrs(updatedProps);
2981
+ updatePicture(instance);
2982
+ let val;
2983
+ Object.keys(updatedProps).forEach((prop) => {
2984
+ val = updatedProps[prop];
2985
+ if (val instanceof Image && !val.complete) {
2986
+ const node = instance;
2987
+ val.addEventListener('load', function () {
2988
+ const layer = node.getLayer();
2989
+ if (layer) {
2990
+ layer.batchDraw();
2991
+ }
2992
+ });
3108
2993
  }
3109
2994
  });
3110
- return ref;
3111
2995
  }
3112
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3113
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridEventService }); }
3114
2996
  }
3115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridEventService, decorators: [{
3116
- type: Injectable
3117
- }] });
3118
2997
 
3119
- class AITableGridBase {
2998
+ function camelize(str) {
2999
+ return str
3000
+ .replace(/^\w|[A-Z]|\b\w/g, function (letter, index) {
3001
+ return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
3002
+ })
3003
+ .replace(/\s+/g, '');
3004
+ }
3005
+ function capitalizeFirstLetter(string) {
3006
+ return string.charAt(0).toUpperCase() + string.slice(1);
3007
+ }
3008
+ function getName(componentTag) {
3009
+ return capitalizeFirstLetter(camelize(componentTag.slice(3).replace('-', ' ')));
3010
+ }
3011
+ function createListener(instance) {
3012
+ const output = {};
3013
+ [
3014
+ 'koMouseover',
3015
+ 'koMousemove',
3016
+ 'koMouseout',
3017
+ 'koMouseenter',
3018
+ 'koMouseleave',
3019
+ 'koMousedown',
3020
+ 'koMouseup',
3021
+ 'koWheel',
3022
+ 'koContextmenu',
3023
+ 'koClick',
3024
+ 'koDblclick',
3025
+ 'koTouchstart',
3026
+ 'koTouchmove',
3027
+ 'koTouchend',
3028
+ 'koTap',
3029
+ 'koDbltap',
3030
+ 'koDragstart',
3031
+ 'koDragmove',
3032
+ 'koDragend'
3033
+ ].forEach((eventName) => {
3034
+ const name = eventName;
3035
+ const eventEmitter = instance[name];
3036
+ if (eventEmitter.observed) {
3037
+ output[eventName] = eventEmitter.emit.bind(eventEmitter);
3038
+ }
3039
+ });
3040
+ return output;
3041
+ }
3042
+
3043
+ const KO_CONTAINER_TOKEN = new InjectionToken('KO_CONTAINER_TOKEN');
3044
+
3045
+ class KoShape {
3120
3046
  constructor() {
3121
- this.aiRecords = model.required();
3122
- this.aiFields = model.required();
3123
- this.aiContextMenuItems = input([]);
3124
- this.aiFieldConfig = input();
3125
- this.aiReadonly = input();
3126
- this.aiPlugins = input();
3127
- this.aiReferences = input.required();
3128
- this.aiBuildRenderDataFn = input();
3129
- this.aiKeywords = input();
3130
- this.AITableFieldType = AITableFieldType;
3131
- this.AITableSelectOptionStyle = AITableSelectOptionStyle;
3132
- this.isSelectedAll = computed(() => {
3133
- return this.aiTable.selection().selectedRecords.size === this.aiRecords().length;
3134
- });
3135
- this.aiTableInitialized = output();
3136
- this.aiAddRecord = output();
3137
- this.aiAddField = output();
3138
- this.aiUpdateFieldValue = output();
3139
- this.fieldMenus = computed(() => {
3140
- return this.aiFieldConfig()?.fieldMenus || [];
3141
- });
3142
- this.gridData = computed(() => {
3143
- if (this.aiBuildRenderDataFn && this.aiBuildRenderDataFn() && this.aiTable) {
3144
- return this.aiBuildRenderDataFn()(this.aiTable);
3047
+ this.config = input();
3048
+ this.koMouseover = new EventEmitter();
3049
+ this.koMousemove = new EventEmitter();
3050
+ this.koMouseout = new EventEmitter();
3051
+ this.koMouseenter = new EventEmitter();
3052
+ this.koMouseleave = new EventEmitter();
3053
+ this.koMousedown = new EventEmitter();
3054
+ this.koMouseup = new EventEmitter();
3055
+ this.koWheel = new EventEmitter();
3056
+ this.koContextmenu = new EventEmitter();
3057
+ this.koClick = new EventEmitter();
3058
+ this.koDblclick = new EventEmitter();
3059
+ this.koTouchstart = new EventEmitter();
3060
+ this.koTouchmove = new EventEmitter();
3061
+ this.koTouchend = new EventEmitter();
3062
+ this.koTap = new EventEmitter();
3063
+ this.koDbltap = new EventEmitter();
3064
+ this.koDragstart = new EventEmitter();
3065
+ this.koDragmove = new EventEmitter();
3066
+ this.koDragend = new EventEmitter();
3067
+ this.elementRef = inject((ElementRef));
3068
+ this.container = inject(KO_CONTAINER_TOKEN, { skipSelf: true });
3069
+ this.cacheProps = {};
3070
+ this.nameNode = getName(this.elementRef.nativeElement.localName);
3071
+ effect(() => {
3072
+ if (this.config()) {
3073
+ this.updateNode(this.config());
3145
3074
  }
3146
- return {
3147
- records: this.aiRecords(),
3148
- fields: this.aiFields()
3149
- };
3150
- });
3151
- this.ngZone = inject(NgZone);
3152
- this.elementRef = inject(ElementRef);
3153
- this.destroyRef = inject(DestroyRef);
3154
- this.aiTableGridFieldService = inject(AITableGridFieldService);
3155
- this.aiTableGridEventService = inject(AITableGridEventService);
3156
- this.aiTableGridSelectionService = inject(AITableGridSelectionService);
3157
- }
3158
- ngOnInit() {
3159
- this.initAITable();
3160
- this.initService();
3161
- }
3162
- initAITable() {
3163
- this.aiTable = createAITable(this.aiRecords, this.aiFields);
3164
- this.aiPlugins()?.forEach((plugin) => {
3165
- this.aiTable = plugin(this.aiTable);
3166
- });
3167
- this.aiTableInitialized.emit(this.aiTable);
3168
- }
3169
- initService() {
3170
- this.aiTableGridEventService.initialize(this.aiTable, this.aiFieldConfig()?.fieldRenderers);
3171
- this.aiTableGridSelectionService.initialize(this.aiTable);
3172
- this.aiTableGridEventService.registerEvents(this.elementRef.nativeElement);
3173
- this.aiTableGridFieldService.initAIFieldConfig(this.aiFieldConfig());
3174
- AI_TABLE_GRID_FIELD_SERVICE_MAP.set(this.aiTable, this.aiTableGridFieldService);
3175
- }
3176
- addRecord() {
3177
- const records = this.gridData().records;
3178
- const recordCount = records.length;
3179
- this.aiAddRecord.emit({
3180
- originId: recordCount > 0 ? records[records.length - 1]._id : ''
3181
3075
  });
3182
3076
  }
3183
- selectRecord(recordId) {
3184
- this.aiTableGridSelectionService.selectRecord(recordId);
3077
+ getNode() {
3078
+ return this._node;
3185
3079
  }
3186
- toggleSelectAll(checked) {
3187
- this.aiTableGridSelectionService.toggleSelectAll(checked);
3080
+ ngOnInit() {
3081
+ this.initKonva();
3188
3082
  }
3189
- addField(gridColumnBlank, position) {
3190
- const field = createDefaultField(this.aiTable, AITableFieldType.text);
3191
- const popoverRef = this.aiTableGridFieldService.editFieldProperty(this.aiTable, {
3192
- field,
3193
- isUpdate: false,
3194
- origin: gridColumnBlank,
3195
- position
3196
- });
3197
- if (popoverRef && !this.aiFieldConfig()?.fieldSettingComponent) {
3198
- popoverRef.componentInstance.addField.subscribe((defaultValue) => {
3199
- const fields = this.gridData().fields;
3200
- const fieldCount = fields.length;
3201
- this.aiAddField.emit({
3202
- originId: fieldCount > 0 ? fields[fields.length - 1]._id : '',
3203
- defaultValue
3204
- });
3205
- });
3083
+ initKonva() {
3084
+ if (!this._node) {
3085
+ this._node = new Shape();
3206
3086
  }
3207
- }
3208
- subscribeEvents() {
3209
- this.ngZone.runOutsideAngular(() => {
3210
- this.aiTableGridEventService.dblClickEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
3211
- this.dblClick(event);
3212
- });
3213
- this.aiTableGridEventService.mousedownEvent$
3214
- .pipe(mergeWith(this.aiTableGridEventService.globalMousedownEvent$), takeUntilDestroyed(this.destroyRef))
3215
- .subscribe((event) => {
3216
- this.aiTableGridSelectionService.updateSelect(event);
3217
- });
3218
- this.aiTableGridEventService.mouseoverEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
3219
- this.mouseoverHandle(event);
3220
- });
3221
- this.aiTableGridEventService.globalMouseoverEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
3222
- this.closeHoverCellEditor(event);
3223
- });
3224
- });
3225
- }
3226
- dblClick(event) {
3227
- const cellDom = event.target.closest('.grid-cell');
3228
- const type = cellDom && cellDom.getAttribute('type');
3229
- if (type && DBL_CLICK_EDIT_TYPE.includes(type)) {
3230
- this.aiTableGridEventService.openEdit(cellDom);
3087
+ if (this.nameNode === 'Shape') {
3088
+ this._node = new Shape();
3231
3089
  }
3232
- }
3233
- mouseoverHandle(event) {
3234
- if (this.mouseoverRef) {
3235
- this.mouseoverRef?.close();
3090
+ else if (this.nameNode === 'Sprite') {
3091
+ this._node = new Sprite(this.config());
3236
3092
  }
3237
- const cellDom = event.target.closest('.grid-cell');
3238
- const type = cellDom && cellDom.getAttribute('type');
3239
- if (type && MOUSEOVER_EDIT_TYPE.includes(type)) {
3240
- this.mouseoverRef = this.aiTableGridEventService.openEdit(cellDom);
3093
+ else {
3094
+ this._node = new Konva[this.nameNode](undefined);
3241
3095
  }
3242
- }
3243
- closeHoverCellEditor(e) {
3244
- if (this.mouseoverRef) {
3245
- const hasGrid = e.target && e.target.closest('.ai-table-grid');
3246
- const hasCellEditor = e.target && e.target.closest('.grid-cell-editor');
3247
- if (!hasGrid && !hasCellEditor) {
3248
- this.mouseoverRef.close();
3249
- }
3250
- }
3251
- }
3252
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3253
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableGridBase, isStandalone: true, selector: "ai-table-grid-base", inputs: { aiRecords: { classPropertyName: "aiRecords", publicName: "aiRecords", isSignal: true, isRequired: true, transformFunction: null }, aiFields: { classPropertyName: "aiFields", publicName: "aiFields", isSignal: true, isRequired: true, transformFunction: null }, aiContextMenuItems: { classPropertyName: "aiContextMenuItems", publicName: "aiContextMenuItems", isSignal: true, isRequired: false, transformFunction: null }, aiFieldConfig: { classPropertyName: "aiFieldConfig", publicName: "aiFieldConfig", isSignal: true, isRequired: false, transformFunction: null }, aiReadonly: { classPropertyName: "aiReadonly", publicName: "aiReadonly", isSignal: true, isRequired: false, transformFunction: null }, aiPlugins: { classPropertyName: "aiPlugins", publicName: "aiPlugins", isSignal: true, isRequired: false, transformFunction: null }, aiReferences: { classPropertyName: "aiReferences", publicName: "aiReferences", isSignal: true, isRequired: true, transformFunction: null }, aiBuildRenderDataFn: { classPropertyName: "aiBuildRenderDataFn", publicName: "aiBuildRenderDataFn", isSignal: true, isRequired: false, transformFunction: null }, aiKeywords: { classPropertyName: "aiKeywords", publicName: "aiKeywords", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiRecords: "aiRecordsChange", aiFields: "aiFieldsChange", aiTableInitialized: "aiTableInitialized", aiAddRecord: "aiAddRecord", aiAddField: "aiAddField", aiUpdateFieldValue: "aiUpdateFieldValue" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3254
- }
3255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, decorators: [{
3256
- type: Component,
3257
- args: [{
3258
- selector: 'ai-table-grid-base',
3259
- template: '',
3260
- standalone: true,
3261
- changeDetection: ChangeDetectionStrategy.OnPush
3262
- }]
3263
- }] });
3264
-
3265
- class AITableDomGrid extends AITableGridBase {
3266
- ngOnInit() {
3267
- super.ngOnInit();
3268
- this.subscribeEvents();
3269
- }
3270
- openFieldMenu(e, field, fieldAction) {
3271
- const moreBtn = e.target.closest('.grid-field-action');
3272
- this.aiTableGridFieldService.openFieldMenu(this.aiTable, {
3273
- origin: moreBtn,
3274
- editOrigin: fieldAction,
3275
- fieldId: field._id,
3276
- fieldMenus: this.fieldMenus()
3277
- });
3278
- }
3279
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDomGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3280
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableDomGrid, isStandalone: true, selector: "ai-table-dom-grid", host: { classAttribute: "ai-table-grid ai-table-dom-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], 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: field.width + '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)=\"selectRecord(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: field.width + '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"] }, { 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 }); }
3281
- }
3282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDomGrid, decorators: [{
3283
- type: Component,
3284
- args: [{ selector: 'ai-table-dom-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
3285
- class: 'ai-table-grid ai-table-dom-grid'
3286
- }, imports: [
3287
- NgClass,
3288
- NgComponentOutlet,
3289
- CommonModule,
3290
- FormsModule,
3291
- SelectOptionPipe,
3292
- SelectOptionsPipe,
3293
- ThyTag,
3294
- ThyPopoverModule,
3295
- ThyIcon,
3296
- ThyRate,
3297
- ThyProgress,
3298
- AITableFieldSetting,
3299
- ThyDatePickerFormatPipe,
3300
- ThyFlexibleText,
3301
- ThyStopPropagationDirective,
3302
- AITableFieldMenu,
3303
- ThyAction,
3304
- ThyDropdownDirective,
3305
- ThyDropdownMenuComponent,
3306
- ThyCheckboxModule,
3307
- ProgressEditorComponent,
3308
- ThyAvatarModule,
3309
- NgTemplateOutlet,
3310
- IsSelectRecordPipe,
3311
- ProgressEditorComponent,
3312
- SelectOptionComponent,
3313
- UserPipe,
3314
- SelectSettingPipe,
3315
- MemberSettingPipe
3316
- ], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], 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: field.width + '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)=\"selectRecord(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: field.width + '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" }]
3317
- }] });
3318
-
3319
- const KO_CONTAINER_TOKEN = new InjectionToken('KO_CONTAINER_TOKEN');
3320
-
3321
- function updatePicture(node) {
3322
- const drawingNode = node.getLayer() || node.getStage();
3323
- if (drawingNode) {
3324
- drawingNode.batchDraw();
3325
- }
3326
- }
3327
-
3328
- // adapted FROM: https://github.com/lavrton/react-konva/blob/master/src/react-konva-fiber.js
3329
- function applyNodeProps(component, props = {}, oldProps = {}) {
3330
- if ('id' in props) {
3331
- const message = `You are using "id" attribute for Konva node. In some very rare cases it may produce bugs. Currently we recommend not to use it and use "name" attribute instead.`;
3332
- console.warn(message);
3333
- }
3334
- const instance = component.getNode();
3335
- const updatedProps = {};
3336
- let hasUpdates = false;
3337
- Object.keys(oldProps).forEach((key) => {
3338
- const isEvent = key.slice(0, 2) === 'ko';
3339
- const propChanged = oldProps[key] !== props[key];
3340
- if (isEvent && propChanged) {
3341
- let eventName = key.slice(2).toLowerCase();
3342
- if (eventName.slice(0, 7) === 'content') {
3343
- eventName = 'content' + eventName.slice(7, 8).toUpperCase() + eventName.slice(8);
3344
- }
3345
- instance.off(eventName, oldProps[key]);
3346
- }
3347
- const toRemove = !Object.hasOwn(props, key);
3348
- if (toRemove) {
3349
- instance.setAttr(key, undefined);
3350
- }
3351
- });
3352
- Object.keys(props).forEach((key) => {
3353
- const isEvent = key.slice(0, 2) === 'ko';
3354
- const toAdd = oldProps[key] !== props[key];
3355
- if (isEvent && toAdd) {
3356
- let eventName = key.slice(2).toLowerCase();
3357
- if (eventName.slice(0, 7) === 'content') {
3358
- eventName = 'content' + eventName.slice(7, 8).toUpperCase() + eventName.slice(8);
3359
- }
3360
- if (props[key]) {
3361
- instance.off(eventName);
3362
- instance.on(eventName, (event) => {
3363
- props[key]({
3364
- angularComponent: component,
3365
- event
3366
- });
3367
- });
3368
- }
3369
- }
3370
- if (!isEvent && (props[key] !== oldProps[key] || props[key] !== instance.getAttr(key))) {
3371
- hasUpdates = true;
3372
- updatedProps[key] = props[key];
3373
- }
3374
- });
3375
- if (hasUpdates) {
3376
- instance.setAttrs(updatedProps);
3377
- updatePicture(instance);
3378
- let val;
3379
- Object.keys(updatedProps).forEach((prop) => {
3380
- val = updatedProps[prop];
3381
- if (val instanceof Image && !val.complete) {
3382
- const node = instance;
3383
- val.addEventListener('load', function () {
3384
- const layer = node.getLayer();
3385
- if (layer) {
3386
- layer.batchDraw();
3387
- }
3388
- });
3389
- }
3390
- });
3391
- }
3392
- }
3393
-
3394
- function camelize(str) {
3395
- return str
3396
- .replace(/^\w|[A-Z]|\b\w/g, function (letter, index) {
3397
- return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
3398
- })
3399
- .replace(/\s+/g, '');
3400
- }
3401
- function capitalizeFirstLetter(string) {
3402
- return string.charAt(0).toUpperCase() + string.slice(1);
3403
- }
3404
- function getName(componentTag) {
3405
- return capitalizeFirstLetter(camelize(componentTag.slice(3).replace('-', ' ')));
3406
- }
3407
- function createListener(instance) {
3408
- const output = {};
3409
- [
3410
- 'koMouseover',
3411
- 'koMousemove',
3412
- 'koMouseout',
3413
- 'koMouseenter',
3414
- 'koMouseleave',
3415
- 'koMousedown',
3416
- 'koMouseup',
3417
- 'koWheel',
3418
- 'koContextmenu',
3419
- 'koClick',
3420
- 'koDblclick',
3421
- 'koTouchstart',
3422
- 'koTouchmove',
3423
- 'koTouchend',
3424
- 'koTap',
3425
- 'koDbltap',
3426
- 'koDragstart',
3427
- 'koDragmove',
3428
- 'koDragend'
3429
- ].forEach((eventName) => {
3430
- const name = eventName;
3431
- const eventEmitter = instance[name];
3432
- if (eventEmitter.observed) {
3433
- output[eventName] = eventEmitter.emit.bind(eventEmitter);
3434
- }
3435
- });
3436
- return output;
3437
- }
3438
-
3439
- class KoShape {
3440
- constructor() {
3441
- this.config = input();
3442
- this.koMouseover = new EventEmitter();
3443
- this.koMousemove = new EventEmitter();
3444
- this.koMouseout = new EventEmitter();
3445
- this.koMouseenter = new EventEmitter();
3446
- this.koMouseleave = new EventEmitter();
3447
- this.koMousedown = new EventEmitter();
3448
- this.koMouseup = new EventEmitter();
3449
- this.koWheel = new EventEmitter();
3450
- this.koContextmenu = new EventEmitter();
3451
- this.koClick = new EventEmitter();
3452
- this.koDblclick = new EventEmitter();
3453
- this.koTouchstart = new EventEmitter();
3454
- this.koTouchmove = new EventEmitter();
3455
- this.koTouchend = new EventEmitter();
3456
- this.koTap = new EventEmitter();
3457
- this.koDbltap = new EventEmitter();
3458
- this.koDragstart = new EventEmitter();
3459
- this.koDragmove = new EventEmitter();
3460
- this.koDragend = new EventEmitter();
3461
- this.elementRef = inject((ElementRef));
3462
- this.container = inject(KO_CONTAINER_TOKEN, { skipSelf: true });
3463
- this.cacheProps = {};
3464
- this.nameNode = getName(this.elementRef.nativeElement.localName);
3465
- effect(() => {
3466
- if (this.config()) {
3467
- this.updateNode(this.config());
3468
- }
3469
- });
3470
- }
3471
- getNode() {
3472
- return this._node;
3473
- }
3474
- ngOnInit() {
3475
- this.initKonva();
3476
- }
3477
- initKonva() {
3478
- if (!this._node) {
3479
- this._node = new Shape();
3480
- }
3481
- if (this.nameNode === 'Shape') {
3482
- this._node = new Shape();
3483
- }
3484
- else if (this.nameNode === 'Sprite') {
3485
- this._node = new Sprite(this.config());
3486
- }
3487
- else {
3488
- this._node = new Konva[this.nameNode](undefined);
3489
- }
3490
- const animationStage = this._node.to.bind(this._node);
3491
- this._node.to = (newConfig) => {
3492
- animationStage(newConfig);
3493
- setTimeout(() => {
3494
- Object.keys(this._node.attrs).forEach((key) => {
3495
- if (typeof this._node.attrs[key] !== 'function') {
3496
- this.config()[key] = this._node.attrs[key];
3497
- }
3498
- });
3499
- }, 200);
3500
- };
3501
- if (this.config()) {
3502
- this.updateNode(this.config());
3096
+ const animationStage = this._node.to.bind(this._node);
3097
+ this._node.to = (newConfig) => {
3098
+ animationStage(newConfig);
3099
+ setTimeout(() => {
3100
+ Object.keys(this._node.attrs).forEach((key) => {
3101
+ if (typeof this._node.attrs[key] !== 'function') {
3102
+ this.config()[key] = this._node.attrs[key];
3103
+ }
3104
+ });
3105
+ }, 200);
3106
+ };
3107
+ if (this.config()) {
3108
+ this.updateNode(this.config());
3503
3109
  }
3504
3110
  }
3505
3111
  updateNode(config) {
@@ -3596,309 +3202,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3596
3202
  }]
3597
3203
  }] });
3598
3204
 
3599
- class KoStage {
3600
- constructor() {
3601
- this.config = input();
3602
- this.koMouseover = new EventEmitter();
3603
- this.koMousemove = new EventEmitter();
3604
- this.koMouseout = new EventEmitter();
3605
- this.koMouseenter = new EventEmitter();
3606
- this.koMouseleave = new EventEmitter();
3607
- this.koMousedown = new EventEmitter();
3608
- this.koMouseup = new EventEmitter();
3609
- this.koWheel = new EventEmitter();
3610
- this.koContextmenu = new EventEmitter();
3611
- this.koClick = new EventEmitter();
3612
- this.koDblclick = new EventEmitter();
3613
- this.koTouchstart = new EventEmitter();
3614
- this.koTouchmove = new EventEmitter();
3615
- this.koTouchend = new EventEmitter();
3616
- this.koTap = new EventEmitter();
3617
- this.koDbltap = new EventEmitter();
3618
- this.koDragstart = new EventEmitter();
3619
- this.koDragmove = new EventEmitter();
3620
- this.koDragend = new EventEmitter();
3621
- this.cacheProps = {};
3622
- this.nodeContainer = inject(ElementRef).nativeElement;
3623
- effect(() => {
3624
- if (this.config()) {
3625
- if (!this._stage) {
3626
- this.initStage();
3627
- }
3628
- this.updateNode(this.config());
3629
- }
3630
- });
3631
- }
3632
- ngOnInit() {
3633
- this.initStage();
3634
- }
3635
- getNode() {
3636
- return this._stage;
3637
- }
3638
- initStage() {
3639
- this._stage = new Stage({
3640
- ...this.config(),
3641
- container: this.nodeContainer
3642
- });
3643
- }
3644
- updateNode(config) {
3645
- const props = {
3646
- ...config,
3647
- ...createListener(this)
3648
- };
3649
- applyNodeProps(this, props, this.cacheProps);
3650
- this.cacheProps = props;
3651
- }
3652
- ngOnDestroy() {
3653
- this._stage?.destroy();
3654
- }
3655
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KoStage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3656
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: KoStage, isStandalone: true, selector: "ko-stage", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { koMouseover: "koMouseover", koMousemove: "koMousemove", koMouseout: "koMouseout", koMouseenter: "koMouseenter", koMouseleave: "koMouseleave", koMousedown: "koMousedown", koMouseup: "koMouseup", koWheel: "koWheel", koContextmenu: "koContextmenu", koClick: "koClick", koDblclick: "koDblclick", koTouchstart: "koTouchstart", koTouchmove: "koTouchmove", koTouchend: "koTouchend", koTap: "koTap", koDbltap: "koDbltap", koDragstart: "koDragstart", koDragmove: "koDragmove", koDragend: "koDragend" }, providers: [
3657
- {
3658
- provide: KO_CONTAINER_TOKEN,
3659
- useExisting: KoStage
3660
- }
3661
- ], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3662
- }
3663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KoStage, decorators: [{
3664
- type: Component,
3665
- args: [{
3666
- selector: 'ko-stage',
3667
- standalone: true,
3668
- template: `<ng-content></ng-content>`,
3669
- providers: [
3670
- {
3671
- provide: KO_CONTAINER_TOKEN,
3672
- useExisting: KoStage
3673
- }
3674
- ],
3675
- changeDetection: ChangeDetectionStrategy.OnPush
3676
- }]
3677
- }], ctorParameters: () => [], propDecorators: { koMouseover: [{
3678
- type: Output
3679
- }], koMousemove: [{
3680
- type: Output
3681
- }], koMouseout: [{
3682
- type: Output
3683
- }], koMouseenter: [{
3684
- type: Output
3685
- }], koMouseleave: [{
3686
- type: Output
3687
- }], koMousedown: [{
3688
- type: Output
3689
- }], koMouseup: [{
3690
- type: Output
3691
- }], koWheel: [{
3692
- type: Output
3693
- }], koContextmenu: [{
3694
- type: Output
3695
- }], koClick: [{
3696
- type: Output
3697
- }], koDblclick: [{
3698
- type: Output
3699
- }], koTouchstart: [{
3700
- type: Output
3701
- }], koTouchmove: [{
3702
- type: Output
3703
- }], koTouchend: [{
3704
- type: Output
3705
- }], koTap: [{
3706
- type: Output
3707
- }], koDbltap: [{
3708
- type: Output
3709
- }], koDragstart: [{
3710
- type: Output
3711
- }], koDragmove: [{
3712
- type: Output
3713
- }], koDragend: [{
3714
- type: Output
3715
- }] } });
3716
-
3717
- class KoComponent extends Component {
3718
- }
3719
-
3720
- const KoShapeTypes = {
3721
- Arc,
3722
- Arrow,
3723
- Circle,
3724
- Ellipse,
3725
- Image: Image$1,
3726
- Label,
3727
- Tag,
3728
- Line,
3729
- Path,
3730
- Rect,
3731
- RegularPolygon,
3732
- Ring,
3733
- Star,
3734
- Text,
3735
- TextPath,
3736
- Transformer,
3737
- Wedge,
3738
- Group,
3739
- Layer,
3740
- FastLayer
3741
- };
3742
-
3743
- class AITableIcon {
3205
+ class AITableText {
3744
3206
  constructor() {
3745
3207
  this.config = input.required();
3746
- this.groupConfig = computed(() => {
3747
- const { x, y, listening } = this.config();
3748
- return { x, y, listening };
3749
- });
3750
- this.squareShapeConfig = computed(() => {
3751
- const { name, backgroundWidth, backgroundHeight, size = DEFAULT_ICON_SIZE, strokeWidth = 1, background, cornerRadius, opacity } = this.config();
3752
- return {
3753
- name,
3754
- width: backgroundWidth || size,
3755
- height: backgroundHeight || size,
3756
- strokeWidth: strokeWidth,
3757
- fill: background || Colors.transparent,
3758
- cornerRadius,
3759
- opacity
3760
- };
3761
- });
3762
- this.iconConfig = computed(() => {
3763
- const { type, data, backgroundWidth, backgroundHeight, size = DEFAULT_ICON_SIZE, stroke, strokeWidth = 1, scaleX, scaleY, offsetX, offsetY, rotation, fill = Colors.gray600, transformsEnabled = 'position' } = this.config();
3764
- let pathData = data;
3765
- switch (type) {
3766
- case AITableCheckType.checked:
3767
- pathData = Check;
3768
- break;
3769
- case AITableCheckType.unchecked:
3770
- pathData = Unchecked;
3771
- break;
3772
- }
3208
+ // @Output() koClick = new EventEmitter<KoEventObject<MouseEvent>>();
3209
+ this.koClick = output();
3210
+ this.koMouseMove = output();
3211
+ this.textConfig = computed(() => {
3212
+ const { x, y, width, height, text, padding, align = DEFAULT_TEXT_ALIGN_LEFT, verticalAlign = DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, fill = DEFAULT_TEXT_FILL, textDecoration, fontSize = DEFAULT_FONT_SIZE, fontStyle = DEFAULT_FONT_STYLE, ellipsis = DEFAULT_TEXT_ELLIPSIS, wrap = DEFAULT_TEXT_WRAP, transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED, listening = DEFAULT_TEXT_LISTENING, fontFamily = DEFAULT_FONT_FAMILY, ...rest } = this.config();
3773
3213
  return {
3774
- x: backgroundWidth && (backgroundWidth - size * (scaleX || 1)) / 2,
3775
- y: backgroundHeight && (backgroundHeight - size * (scaleY || 1)) / 2,
3776
- data: pathData,
3777
- width: size,
3778
- height: size,
3214
+ x,
3215
+ y,
3216
+ width,
3217
+ height,
3218
+ text,
3219
+ padding,
3220
+ align,
3221
+ verticalAlign,
3779
3222
  fill,
3780
- offsetX,
3781
- offsetY,
3782
- scaleX,
3783
- scaleY,
3784
- rotation,
3785
- stroke,
3786
- strokeWidth,
3223
+ textDecoration,
3224
+ fontSize,
3225
+ fontStyle,
3226
+ ellipsis,
3227
+ wrap,
3787
3228
  transformsEnabled,
3788
- perfectDrawEnabled: false,
3789
- listening: false
3229
+ listening,
3230
+ fontFamily,
3231
+ ...rest
3790
3232
  };
3791
3233
  });
3792
3234
  }
3793
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3794
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableIcon, isStandalone: true, selector: "ai-table-icon", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3795
- <ko-group [config]="groupConfig()">
3796
- <ko-rect [config]="squareShapeConfig()"></ko-rect>
3797
- <ko-path [config]="iconConfig()"></ko-path>
3798
- </ko-group>
3799
- `, 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3235
+ onClick(e) {
3236
+ this.koClick.emit(e);
3237
+ }
3238
+ onMousemove(e) {
3239
+ this.koMouseMove.emit(e);
3240
+ }
3241
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3242
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableText, isStandalone: true, selector: "ai-table-text", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koClick: "koClick", koMouseMove: "koMouseMove" }, ngImport: i0, template: ` <ko-text [config]="textConfig()" (koClick)="onClick($event)" (koMousemove)="onMousemove($event)"></ko-text> `, 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 }); }
3800
3243
  }
3801
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableIcon, decorators: [{
3244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableText, decorators: [{
3802
3245
  type: Component,
3803
3246
  args: [{
3804
- selector: 'ai-table-icon',
3805
- template: `
3806
- <ko-group [config]="groupConfig()">
3807
- <ko-rect [config]="squareShapeConfig()"></ko-rect>
3808
- <ko-path [config]="iconConfig()"></ko-path>
3809
- </ko-group>
3810
- `,
3247
+ selector: 'ai-table-text',
3248
+ template: ` <ko-text [config]="textConfig()" (koClick)="onClick($event)" (koMousemove)="onMousemove($event)"></ko-text> `,
3811
3249
  standalone: true,
3812
- imports: [KoContainer, KoShape],
3250
+ imports: [KoShape],
3813
3251
  changeDetection: ChangeDetectionStrategy.OnPush
3814
3252
  }]
3815
3253
  }] });
3816
3254
 
3817
- class AITableAddField {
3818
- constructor() {
3819
- this.config = input.required();
3820
- this.btnWidth = AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
3821
- this.x = computed(() => {
3822
- const lastColumnWidth = this.config().coordinate.getColumnWidth(this.config().columnStopIndex);
3823
- const lastColumnOffset = this.config().coordinate.getColumnOffset(this.config().columnStopIndex);
3824
- return lastColumnWidth + lastColumnOffset;
3825
- });
3826
- this.rectConfig = computed(() => {
3827
- const { pointPosition: { targetName }, readonly } = this.config();
3828
- const fill = targetName === AI_TABLE_FIELD_ADD_BUTTON ? Colors.gray80 : Colors.white;
3829
- return {
3830
- name: generateTargetName({
3831
- targetName: AI_TABLE_FIELD_ADD_BUTTON,
3832
- fieldId: this.config().fields[this.config().columnStopIndex]._id,
3833
- mouseStyle: readonly ? 'default' : 'pointer'
3834
- }),
3835
- x: AI_TABLE_OFFSET,
3836
- y: AI_TABLE_OFFSET,
3837
- width: this.config().coordinate.containerWidth - this.x() < this.btnWidth
3838
- ? this.btnWidth
3839
- : this.config().coordinate.containerWidth - this.x(),
3840
- height: this.config().coordinate.rowInitSize,
3841
- stroke: Colors.gray200,
3842
- strokeWidth: 1,
3843
- listening: true,
3844
- fill
3845
- };
3846
- });
3847
- this.addIconConfig = computed(() => {
3848
- const { readonly } = this.config();
3849
- const offsetY = (this.config().coordinate.rowInitSize - AI_TABLE_ICON_COMMON_SIZE) / 2;
3850
- return {
3851
- x: AI_TABLE_CELL_PADDING,
3852
- y: offsetY,
3853
- data: AddOutlinedPath,
3854
- fill: Colors.gray600,
3855
- listening: false,
3856
- visible: isNil(readonly) ? true : !readonly
3857
- };
3858
- });
3859
- }
3860
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableAddField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3861
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableAddField, isStandalone: true, selector: "ai-table-add-field", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
3862
- <ko-group [config]="{ x: x() }">
3863
- <ko-group>
3864
- <ko-rect [config]="rectConfig()"></ko-rect>
3865
- </ko-group>
3866
- <ko-group>
3867
- @if (addIconConfig().visible) {
3868
- <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
3869
- }
3870
- </ko-group>
3871
- </ko-group>
3872
- `, 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 }); }
3873
- }
3874
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableAddField, decorators: [{
3875
- type: Component,
3876
- args: [{
3877
- selector: 'ai-table-add-field',
3878
- template: `
3879
- <ko-group [config]="{ x: x() }">
3880
- <ko-group>
3881
- <ko-rect [config]="rectConfig()"></ko-rect>
3882
- </ko-group>
3883
- <ko-group>
3884
- @if (addIconConfig().visible) {
3885
- <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
3886
- }
3887
- </ko-group>
3888
- </ko-group>
3889
- `,
3890
- standalone: true,
3891
- imports: [KoContainer, KoShape, AITableIcon],
3892
- changeDetection: ChangeDetectionStrategy.OnPush
3893
- }]
3894
- }] });
3895
-
3896
- // 用于正确地分割字符串,包括表情符号
3897
- const graphemeSplitter = new GraphemeSplitter();
3898
- /**
3899
- * 用于在 Canvas 上进行的各种绘图操作,包含了文本绘制、矩形绘制、路径绘制以及一些几何计算等功能
3900
- */
3901
- class Drawer {
3255
+ // 用于正确地分割字符串,包括表情符号
3256
+ const graphemeSplitter = new GraphemeSplitter();
3257
+ /**
3258
+ * 用于在 Canvas 上进行的各种绘图操作,包含了文本绘制、矩形绘制、路径绘制以及一些几何计算等功能
3259
+ */
3260
+ class Drawer {
3902
3261
  constructor() {
3903
3262
  this.ctx = TextMeasure().context;
3904
3263
  this.needDraw = false;
@@ -4809,22 +4168,860 @@ class Drawer {
4809
4168
  this.ctx.rotate(-psi);
4810
4169
  this.ctx.translate(-cx, -cy);
4811
4170
  break;
4812
- case 'z':
4813
- isClosed = true;
4814
- this.ctx.closePath();
4171
+ case 'z':
4172
+ isClosed = true;
4173
+ this.ctx.closePath();
4174
+ break;
4175
+ }
4176
+ }
4177
+ if (!isClosed) {
4178
+ this.ctx.stroke();
4179
+ }
4180
+ else {
4181
+ this.ctx.fill();
4182
+ }
4183
+ this.ctx.restore();
4184
+ }
4185
+ }
4186
+ const drawer = new Drawer();
4187
+
4188
+ class AITableCellLink {
4189
+ constructor() {
4190
+ this.config = input();
4191
+ this.textOffset = AI_TABLE_CELL_PADDING + AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
4192
+ this.render = computed(() => this.config()?.render);
4193
+ this.transformValue = computed(() => this.render()?.transformValue);
4194
+ this.showLink = computed(() => !!this.transformValue()?.text);
4195
+ this.textConfig = computed(() => {
4196
+ const render = this.config()?.render;
4197
+ if (render) {
4198
+ const { x, y, transformValue, field, columnWidth, rowHeight, style, zIndex } = render;
4199
+ let textRender = transformValue.text;
4200
+ if (textRender == null) {
4201
+ return;
4202
+ }
4203
+ textRender = textRender.replace(/\r|\n/g, ' ');
4204
+ const fontWeight = style?.fontWeight;
4205
+ const textMaxWidth = columnWidth - 2 * AI_TABLE_CELL_PADDING;
4206
+ const { text, textWidth } = drawer.textEllipsis({
4207
+ text: textRender,
4208
+ maxWidth: textMaxWidth,
4209
+ fontWeight
4210
+ });
4211
+ return {
4212
+ x,
4213
+ y,
4214
+ text,
4215
+ wrap: 'none',
4216
+ width: textWidth,
4217
+ fillStyle: Colors.primary,
4218
+ fill: Colors.primary,
4219
+ height: rowHeight + 2,
4220
+ lineHeight: 1.84,
4221
+ listening: true,
4222
+ ellipsis: true,
4223
+ zIndex
4224
+ };
4225
+ }
4226
+ return;
4227
+ });
4228
+ }
4229
+ static { this.fieldType = AITableFieldType.link; }
4230
+ linkClick(e) {
4231
+ e.event.cancelBubble = true;
4232
+ window.open(this.transformValue().url, '_blank', 'noopener,noreferrer');
4233
+ }
4234
+ linkMouseMove(e) {
4235
+ e.event.cancelBubble = true;
4236
+ const { aiTable, coordinate } = this.config();
4237
+ const targetName = e.event.target.name();
4238
+ const gridStage = e.event.currentTarget.getStage();
4239
+ const pos = gridStage?.getPointerPosition();
4240
+ if (pos == null)
4241
+ return;
4242
+ const { context } = aiTable;
4243
+ const { x, y } = pos;
4244
+ const curMousePosition = getMousePosition(x, y, coordinate, AITable.getVisibleFields(aiTable), context, targetName);
4245
+ handleMouseStyle(AI_TABLE_FIELD_HEAD_MORE, curMousePosition.areaType, coordinate.container);
4246
+ }
4247
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableCellLink, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4248
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableCellLink, isStandalone: true, selector: "ai-table-link", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
4249
+ @if (showLink()) {
4250
+ <ai-table-text [config]="textConfig()!" (koClick)="linkClick($event)" (koMouseMove)="linkMouseMove($event)"></ai-table-text>
4251
+ }
4252
+ `, isInline: true, dependencies: [{ kind: "component", type: AITableText, selector: "ai-table-text", inputs: ["config"], outputs: ["koClick", "koMouseMove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4253
+ }
4254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableCellLink, decorators: [{
4255
+ type: Component,
4256
+ args: [{
4257
+ selector: 'ai-table-link',
4258
+ template: `
4259
+ @if (showLink()) {
4260
+ <ai-table-text [config]="textConfig()!" (koClick)="linkClick($event)" (koMouseMove)="linkMouseMove($event)"></ai-table-text>
4261
+ }
4262
+ `,
4263
+ standalone: true,
4264
+ imports: [KoContainer, KoShape, AITableText],
4265
+ changeDetection: ChangeDetectionStrategy.OnPush
4266
+ }]
4267
+ }] });
4268
+
4269
+ var cellComponents = /*#__PURE__*/Object.freeze({
4270
+ __proto__: null,
4271
+ AITableCellLink: AITableCellLink
4272
+ });
4273
+
4274
+ const componentMap = {};
4275
+ Object.values(cellComponents).forEach((cellComponent) => {
4276
+ componentMap[cellComponent.fieldType] = cellComponent;
4277
+ });
4278
+
4279
+ function getHoverCell(aiTable) {
4280
+ const pointPosition = aiTable.context.pointPosition();
4281
+ const { fieldId, recordId } = getDetailByTargetName(pointPosition.realTargetName) ?? {};
4282
+ if (!recordId || !fieldId) {
4283
+ return;
4284
+ }
4285
+ const field = aiTable.fieldsMap()[fieldId];
4286
+ if (!field || !recordId || !fieldId) {
4287
+ return;
4288
+ }
4289
+ const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, fieldId]);
4290
+ const transformValue = transformCellValue(aiTable, field, cellValue) || {};
4291
+ if (Object.keys(transformValue).length === 0) {
4292
+ return;
4293
+ }
4294
+ const renderComponentDefinition = componentMap[field?.type];
4295
+ if (!renderComponentDefinition) {
4296
+ return;
4297
+ }
4298
+ return {
4299
+ field,
4300
+ recordId,
4301
+ fieldId,
4302
+ renderComponentDefinition
4303
+ };
4304
+ }
4305
+
4306
+ class AITableGridEventService {
4307
+ constructor() {
4308
+ this.dblClickEvent$ = new Subject();
4309
+ this.mousedownEvent$ = new Subject();
4310
+ this.mouseoverEvent$ = new Subject();
4311
+ this.globalMouseoverEvent$ = new Subject();
4312
+ this.globalMousedownEvent$ = new Subject();
4313
+ this.destroyRef = inject(DestroyRef);
4314
+ this.thyPopover = inject(ThyPopover);
4315
+ }
4316
+ initialize(aiTable, aiFieldRenderers) {
4317
+ this.aiTable = aiTable;
4318
+ this.aiFieldRenderers = aiFieldRenderers;
4319
+ }
4320
+ registerEvents(element) {
4321
+ fromEvent(element, 'dblclick', { passive: true })
4322
+ .pipe(takeUntilDestroyed(this.destroyRef))
4323
+ .subscribe((event) => {
4324
+ this.dblClickEvent$.next(event);
4325
+ });
4326
+ fromEvent(element, 'mouseover', { passive: true })
4327
+ .pipe(debounceTime(80), takeUntilDestroyed(this.destroyRef))
4328
+ .subscribe((event) => {
4329
+ this.mouseoverEvent$.next(event);
4330
+ });
4331
+ fromEvent(document, 'mouseover', { passive: true })
4332
+ .pipe(takeUntilDestroyed(this.destroyRef))
4333
+ .subscribe((event) => {
4334
+ this.globalMouseoverEvent$.next(event);
4335
+ });
4336
+ fromEvent(element, 'mousedown', { passive: true })
4337
+ .pipe(takeUntilDestroyed(this.destroyRef))
4338
+ .subscribe((event) => {
4339
+ this.mousedownEvent$.next(event);
4340
+ });
4341
+ fromEvent(document, 'mousedown', { passive: true })
4342
+ .pipe(takeUntilDestroyed(this.destroyRef))
4343
+ .subscribe((event) => {
4344
+ this.globalMousedownEvent$.next(event);
4345
+ });
4346
+ }
4347
+ getEditorComponent(type) {
4348
+ const filedRenderSchema = this.aiFieldRenderers && this.aiFieldRenderers[type];
4349
+ if (filedRenderSchema && filedRenderSchema.editor) {
4350
+ return filedRenderSchema.editor;
4351
+ }
4352
+ return GRID_CELL_EDITOR_MAP[type];
4353
+ }
4354
+ openEdit(cellDom) {
4355
+ const { x, y, width, height } = cellDom.getBoundingClientRect();
4356
+ const fieldId = cellDom.getAttribute('fieldId');
4357
+ const recordId = cellDom.getAttribute('recordId');
4358
+ const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
4359
+ const ref = this.thyPopover.open(component, {
4360
+ origin: cellDom,
4361
+ originPosition: {
4362
+ x: x - 1,
4363
+ y: y + 1,
4364
+ width: width + 2,
4365
+ height: height + 2
4366
+ },
4367
+ width: width + 1 + 'px',
4368
+ height: height + 2 + 'px',
4369
+ placement: 'top',
4370
+ offset: -(height + 4),
4371
+ minWidth: width,
4372
+ initialState: {
4373
+ fieldId: fieldId,
4374
+ recordId: recordId,
4375
+ aiTable: this.aiTable
4376
+ },
4377
+ panelClass: 'grid-cell-editor',
4378
+ outsideClosable: false,
4379
+ hasBackdrop: false,
4380
+ manualClosure: true,
4381
+ animationDisabled: true,
4382
+ autoAdaptive: true
4383
+ });
4384
+ return ref;
4385
+ }
4386
+ getOriginPosition(aiTable, options) {
4387
+ const { container, coordinate, recordId, fieldId, isHoverEdit } = options;
4388
+ const { scrollState } = aiTable.context;
4389
+ const { rowHeight, columnCount } = coordinate;
4390
+ const cell = [recordId, fieldId];
4391
+ const { rowIndex, columnIndex } = AITable.getCellIndex(aiTable, cell);
4392
+ const originX = coordinate.getColumnOffset(columnIndex);
4393
+ const originY = coordinate.getRowOffset(rowIndex);
4394
+ const columnWidth = coordinate.getColumnWidth(columnIndex);
4395
+ const { width: originWidth, offset: originOffset } = getCellHorizontalPosition({
4396
+ columnWidth,
4397
+ columnIndex,
4398
+ columnCount
4399
+ });
4400
+ const originRect = container.getBoundingClientRect();
4401
+ const isFrozenColumn = AITable.isFrozenColumn(aiTable, columnIndex);
4402
+ const scrollLeft = isFrozenColumn ? 0 : scrollState().scrollLeft;
4403
+ const scrollTop = scrollState().scrollTop;
4404
+ const originPosition = {
4405
+ x: originX + originOffset - scrollLeft + originRect.x,
4406
+ y: originY - scrollTop + originRect.y,
4407
+ width: originWidth,
4408
+ height: rowHeight
4409
+ };
4410
+ let x = originPosition.x + getEditorBoxOffset();
4411
+ let y = originPosition.y + getEditorBoxOffset();
4412
+ let width = getEditorSpace(originPosition.width);
4413
+ let height = getEditorSpace(originPosition.height);
4414
+ // hover 编辑组件无边框
4415
+ if (isHoverEdit) {
4416
+ x = originPosition.x + getHoverEditorBoxOffset();
4417
+ y = originPosition.y + getHoverEditorBoxOffset();
4418
+ width = getHoverEditorSpace(originPosition.width);
4419
+ height = getHoverEditorSpace(originPosition.height);
4420
+ }
4421
+ return {
4422
+ ...originPosition,
4423
+ x: x,
4424
+ y: y,
4425
+ width: width,
4426
+ height: height
4427
+ };
4428
+ }
4429
+ openCellEditor(aiTable, options) {
4430
+ const { container, recordId, fieldId, isHoverEdit, references } = options;
4431
+ const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
4432
+ const offsetOriginPosition = this.getOriginPosition(aiTable, options);
4433
+ this.cellEditorPopoverRef = this.thyPopover.open(component, {
4434
+ origin: container,
4435
+ originPosition: offsetOriginPosition,
4436
+ width: offsetOriginPosition.width + 'px',
4437
+ height: offsetOriginPosition.height + 'px',
4438
+ minWidth: offsetOriginPosition.width + 'px',
4439
+ placement: 'bottom',
4440
+ offset: -offsetOriginPosition.height,
4441
+ initialState: {
4442
+ fieldId: fieldId,
4443
+ recordId: recordId,
4444
+ references,
4445
+ aiTable: aiTable
4446
+ },
4447
+ panelClass: 'grid-cell-editor',
4448
+ outsideClosable: false,
4449
+ hasBackdrop: false,
4450
+ manualClosure: true,
4451
+ animationDisabled: true,
4452
+ autoAdaptive: true
4453
+ });
4454
+ if (this.cellEditorPopoverRef) {
4455
+ const wheelEvent = fromEvent(this.cellEditorPopoverRef.componentInstance.elementRef.nativeElement, 'wheel').subscribe((event) => {
4456
+ const field = aiTable.fieldsMap()[fieldId];
4457
+ if (field.type === AITableFieldType.text || field.type === AITableFieldType.richText) {
4458
+ return;
4459
+ }
4460
+ event.preventDefault();
4461
+ this.aiTable.context?.scrollAction({
4462
+ deltaX: event.deltaX,
4463
+ deltaY: event.deltaY,
4464
+ shiftKey: event.shiftKey,
4465
+ callback: () => {
4466
+ const originPosition = this.getOriginPosition(aiTable, options);
4467
+ const positionStrategy = this.cellEditorPopoverRef
4468
+ .getOverlayRef()
4469
+ .getConfig().positionStrategy;
4470
+ positionStrategy.setOrigin(originPosition);
4471
+ positionStrategy.apply();
4472
+ }
4473
+ });
4474
+ });
4475
+ this.cellEditorPopoverRef.afterClosed().subscribe(() => {
4476
+ wheelEvent.unsubscribe();
4477
+ this.cellEditorPopoverRef = null;
4478
+ });
4479
+ this.cellEditorPopoverRef.componentInstance.updateFieldValue.subscribe((value) => {
4480
+ options.updateFieldValue(value);
4481
+ });
4482
+ }
4483
+ return this.cellEditorPopoverRef;
4484
+ }
4485
+ closeCellEditor() {
4486
+ if (this.cellEditorPopoverRef) {
4487
+ this.cellEditorPopoverRef.close();
4488
+ this.cellEditorPopoverRef = null;
4489
+ }
4490
+ }
4491
+ getCurrentEditCell() {
4492
+ if (this.cellEditorPopoverRef) {
4493
+ const recordId = this.cellEditorPopoverRef.componentInstance?.recordId;
4494
+ const fieldId = this.cellEditorPopoverRef.componentInstance?.fieldId;
4495
+ if (recordId && fieldId) {
4496
+ return {
4497
+ recordId,
4498
+ fieldId
4499
+ };
4500
+ }
4501
+ return null;
4502
+ }
4503
+ return null;
4504
+ }
4505
+ openContextMenu(aiTable, options) {
4506
+ const { origin, position, menuItems, targetName, viewContainerRef } = options;
4507
+ const ref = this.thyPopover.open(AITableContextMenu, {
4508
+ origin: origin,
4509
+ originPosition: position,
4510
+ placement: 'bottomLeft',
4511
+ insideClosable: true,
4512
+ viewContainerRef,
4513
+ initialState: {
4514
+ aiTable,
4515
+ menuItems,
4516
+ targetName,
4517
+ position
4518
+ }
4519
+ });
4520
+ return ref;
4521
+ }
4522
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4523
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridEventService }); }
4524
+ }
4525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridEventService, decorators: [{
4526
+ type: Injectable
4527
+ }] });
4528
+
4529
+ class AITableGridBase {
4530
+ constructor() {
4531
+ this.aiRecords = model.required();
4532
+ this.aiFields = model.required();
4533
+ this.aiContextMenuItems = input([]);
4534
+ this.aiFieldConfig = input();
4535
+ this.aiReadonly = input();
4536
+ this.aiPlugins = input();
4537
+ this.aiReferences = input.required();
4538
+ this.aiBuildRenderDataFn = input();
4539
+ this.aiKeywords = input();
4540
+ this.AITableFieldType = AITableFieldType;
4541
+ this.AITableSelectOptionStyle = AITableSelectOptionStyle;
4542
+ this.isSelectedAll = computed(() => {
4543
+ return this.aiTable.selection().selectedRecords.size === this.aiRecords().length;
4544
+ });
4545
+ this.aiTableInitialized = output();
4546
+ this.aiAddRecord = output();
4547
+ this.aiAddField = output();
4548
+ this.aiUpdateFieldValue = output();
4549
+ this.fieldMenus = computed(() => {
4550
+ return this.aiFieldConfig()?.fieldMenus || [];
4551
+ });
4552
+ this.gridData = computed(() => {
4553
+ if (this.aiBuildRenderDataFn && this.aiBuildRenderDataFn() && this.aiTable) {
4554
+ return this.aiBuildRenderDataFn()(this.aiTable);
4555
+ }
4556
+ return {
4557
+ records: this.aiRecords(),
4558
+ fields: this.aiFields()
4559
+ };
4560
+ });
4561
+ this.ngZone = inject(NgZone);
4562
+ this.elementRef = inject(ElementRef);
4563
+ this.destroyRef = inject(DestroyRef);
4564
+ this.aiTableGridFieldService = inject(AITableGridFieldService);
4565
+ this.aiTableGridEventService = inject(AITableGridEventService);
4566
+ this.aiTableGridSelectionService = inject(AITableGridSelectionService);
4567
+ }
4568
+ ngOnInit() {
4569
+ this.initAITable();
4570
+ this.initService();
4571
+ }
4572
+ initAITable() {
4573
+ this.aiTable = createAITable(this.aiRecords, this.aiFields);
4574
+ this.aiPlugins()?.forEach((plugin) => {
4575
+ this.aiTable = plugin(this.aiTable);
4576
+ });
4577
+ this.aiTableInitialized.emit(this.aiTable);
4578
+ }
4579
+ initService() {
4580
+ this.aiTableGridEventService.initialize(this.aiTable, this.aiFieldConfig()?.fieldRenderers);
4581
+ this.aiTableGridSelectionService.initialize(this.aiTable);
4582
+ this.aiTableGridEventService.registerEvents(this.elementRef.nativeElement);
4583
+ this.aiTableGridFieldService.initAIFieldConfig(this.aiFieldConfig());
4584
+ AI_TABLE_GRID_FIELD_SERVICE_MAP.set(this.aiTable, this.aiTableGridFieldService);
4585
+ }
4586
+ addRecord() {
4587
+ const records = this.gridData().records;
4588
+ const recordCount = records.length;
4589
+ this.aiAddRecord.emit({
4590
+ originId: recordCount > 0 ? records[records.length - 1]._id : ''
4591
+ });
4592
+ }
4593
+ selectRecord(recordId) {
4594
+ this.aiTableGridSelectionService.selectRecord(recordId);
4595
+ }
4596
+ toggleSelectAll(checked) {
4597
+ this.aiTableGridSelectionService.toggleSelectAll(checked);
4598
+ }
4599
+ addField(gridColumnBlank, position) {
4600
+ const field = createDefaultField(this.aiTable, AITableFieldType.text);
4601
+ const popoverRef = this.aiTableGridFieldService.editFieldProperty(this.aiTable, {
4602
+ field,
4603
+ isUpdate: false,
4604
+ origin: gridColumnBlank,
4605
+ position
4606
+ });
4607
+ if (popoverRef && !this.aiFieldConfig()?.fieldSettingComponent) {
4608
+ popoverRef.componentInstance.addField.subscribe((defaultValue) => {
4609
+ const fields = this.gridData().fields;
4610
+ const fieldCount = fields.length;
4611
+ this.aiAddField.emit({
4612
+ originId: fieldCount > 0 ? fields[fields.length - 1]._id : '',
4613
+ defaultValue
4614
+ });
4615
+ });
4616
+ }
4617
+ }
4618
+ subscribeEvents() {
4619
+ this.ngZone.runOutsideAngular(() => {
4620
+ this.aiTableGridEventService.dblClickEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
4621
+ this.dblClick(event);
4622
+ });
4623
+ this.aiTableGridEventService.mousedownEvent$
4624
+ .pipe(mergeWith(this.aiTableGridEventService.globalMousedownEvent$), takeUntilDestroyed(this.destroyRef))
4625
+ .subscribe((event) => {
4626
+ this.aiTableGridSelectionService.updateSelect(event);
4627
+ });
4628
+ this.aiTableGridEventService.mouseoverEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
4629
+ this.mouseoverHandle(event);
4630
+ });
4631
+ this.aiTableGridEventService.globalMouseoverEvent$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
4632
+ this.closeHoverCellEditor(event);
4633
+ });
4634
+ });
4635
+ }
4636
+ dblClick(event) {
4637
+ const cellDom = event.target.closest('.grid-cell');
4638
+ const type = cellDom && cellDom.getAttribute('type');
4639
+ if (type && DBL_CLICK_EDIT_TYPE.includes(type)) {
4640
+ this.aiTableGridEventService.openEdit(cellDom);
4641
+ }
4642
+ }
4643
+ mouseoverHandle(event) {
4644
+ if (this.mouseoverRef) {
4645
+ this.mouseoverRef?.close();
4646
+ }
4647
+ const cellDom = event.target.closest('.grid-cell');
4648
+ const type = cellDom && cellDom.getAttribute('type');
4649
+ if (type && MOUSEOVER_EDIT_TYPE.includes(type)) {
4650
+ this.mouseoverRef = this.aiTableGridEventService.openEdit(cellDom);
4651
+ }
4652
+ }
4653
+ closeHoverCellEditor(e) {
4654
+ if (this.mouseoverRef) {
4655
+ const hasGrid = e.target && e.target.closest('.ai-table-grid');
4656
+ const hasCellEditor = e.target && e.target.closest('.grid-cell-editor');
4657
+ if (!hasGrid && !hasCellEditor) {
4658
+ this.mouseoverRef.close();
4659
+ }
4660
+ }
4661
+ }
4662
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4663
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableGridBase, isStandalone: true, selector: "ai-table-grid-base", inputs: { aiRecords: { classPropertyName: "aiRecords", publicName: "aiRecords", isSignal: true, isRequired: true, transformFunction: null }, aiFields: { classPropertyName: "aiFields", publicName: "aiFields", isSignal: true, isRequired: true, transformFunction: null }, aiContextMenuItems: { classPropertyName: "aiContextMenuItems", publicName: "aiContextMenuItems", isSignal: true, isRequired: false, transformFunction: null }, aiFieldConfig: { classPropertyName: "aiFieldConfig", publicName: "aiFieldConfig", isSignal: true, isRequired: false, transformFunction: null }, aiReadonly: { classPropertyName: "aiReadonly", publicName: "aiReadonly", isSignal: true, isRequired: false, transformFunction: null }, aiPlugins: { classPropertyName: "aiPlugins", publicName: "aiPlugins", isSignal: true, isRequired: false, transformFunction: null }, aiReferences: { classPropertyName: "aiReferences", publicName: "aiReferences", isSignal: true, isRequired: true, transformFunction: null }, aiBuildRenderDataFn: { classPropertyName: "aiBuildRenderDataFn", publicName: "aiBuildRenderDataFn", isSignal: true, isRequired: false, transformFunction: null }, aiKeywords: { classPropertyName: "aiKeywords", publicName: "aiKeywords", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiRecords: "aiRecordsChange", aiFields: "aiFieldsChange", aiTableInitialized: "aiTableInitialized", aiAddRecord: "aiAddRecord", aiAddField: "aiAddField", aiUpdateFieldValue: "aiUpdateFieldValue" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4664
+ }
4665
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, decorators: [{
4666
+ type: Component,
4667
+ args: [{
4668
+ selector: 'ai-table-grid-base',
4669
+ template: '',
4670
+ standalone: true,
4671
+ changeDetection: ChangeDetectionStrategy.OnPush
4672
+ }]
4673
+ }] });
4674
+
4675
+ class AITableDomGrid extends AITableGridBase {
4676
+ ngOnInit() {
4677
+ super.ngOnInit();
4678
+ this.subscribeEvents();
4679
+ }
4680
+ openFieldMenu(e, field, fieldAction) {
4681
+ const moreBtn = e.target.closest('.grid-field-action');
4682
+ this.aiTableGridFieldService.openFieldMenu(this.aiTable, {
4683
+ origin: moreBtn,
4684
+ editOrigin: fieldAction,
4685
+ fieldId: field._id,
4686
+ fieldMenus: this.fieldMenus()
4687
+ });
4688
+ }
4689
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDomGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4690
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableDomGrid, isStandalone: true, selector: "ai-table-dom-grid", host: { classAttribute: "ai-table-grid ai-table-dom-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], 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: field.width + '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)=\"selectRecord(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: field.width + '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"] }, { 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 }); }
4691
+ }
4692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDomGrid, decorators: [{
4693
+ type: Component,
4694
+ args: [{ selector: 'ai-table-dom-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
4695
+ class: 'ai-table-grid ai-table-dom-grid'
4696
+ }, imports: [
4697
+ NgClass,
4698
+ NgComponentOutlet,
4699
+ CommonModule,
4700
+ FormsModule,
4701
+ SelectOptionPipe,
4702
+ SelectOptionsPipe,
4703
+ ThyTag,
4704
+ ThyPopoverModule,
4705
+ ThyIcon,
4706
+ ThyRate,
4707
+ ThyProgress,
4708
+ AITableFieldSetting,
4709
+ ThyDatePickerFormatPipe,
4710
+ ThyFlexibleText,
4711
+ ThyStopPropagationDirective,
4712
+ AITableFieldMenu,
4713
+ ThyAction,
4714
+ ThyDropdownDirective,
4715
+ ThyDropdownMenuComponent,
4716
+ ThyCheckboxModule,
4717
+ ProgressEditorComponent,
4718
+ ThyAvatarModule,
4719
+ NgTemplateOutlet,
4720
+ IsSelectRecordPipe,
4721
+ ProgressEditorComponent,
4722
+ SelectOptionComponent,
4723
+ UserPipe,
4724
+ SelectSettingPipe,
4725
+ MemberSettingPipe
4726
+ ], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], 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: field.width + '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)=\"selectRecord(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: field.width + '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" }]
4727
+ }] });
4728
+
4729
+ class KoStage {
4730
+ constructor() {
4731
+ this.config = input();
4732
+ this.koMouseover = new EventEmitter();
4733
+ this.koMousemove = new EventEmitter();
4734
+ this.koMouseout = new EventEmitter();
4735
+ this.koMouseenter = new EventEmitter();
4736
+ this.koMouseleave = new EventEmitter();
4737
+ this.koMousedown = new EventEmitter();
4738
+ this.koMouseup = new EventEmitter();
4739
+ this.koWheel = new EventEmitter();
4740
+ this.koContextmenu = new EventEmitter();
4741
+ this.koClick = new EventEmitter();
4742
+ this.koDblclick = new EventEmitter();
4743
+ this.koTouchstart = new EventEmitter();
4744
+ this.koTouchmove = new EventEmitter();
4745
+ this.koTouchend = new EventEmitter();
4746
+ this.koTap = new EventEmitter();
4747
+ this.koDbltap = new EventEmitter();
4748
+ this.koDragstart = new EventEmitter();
4749
+ this.koDragmove = new EventEmitter();
4750
+ this.koDragend = new EventEmitter();
4751
+ this.cacheProps = {};
4752
+ this.nodeContainer = inject(ElementRef).nativeElement;
4753
+ effect(() => {
4754
+ if (this.config()) {
4755
+ if (!this._stage) {
4756
+ this.initStage();
4757
+ }
4758
+ this.updateNode(this.config());
4759
+ }
4760
+ });
4761
+ }
4762
+ ngOnInit() {
4763
+ this.initStage();
4764
+ }
4765
+ getNode() {
4766
+ return this._stage;
4767
+ }
4768
+ initStage() {
4769
+ this._stage = new Stage({
4770
+ ...this.config(),
4771
+ container: this.nodeContainer
4772
+ });
4773
+ }
4774
+ updateNode(config) {
4775
+ const props = {
4776
+ ...config,
4777
+ ...createListener(this)
4778
+ };
4779
+ applyNodeProps(this, props, this.cacheProps);
4780
+ this.cacheProps = props;
4781
+ }
4782
+ ngOnDestroy() {
4783
+ this._stage?.destroy();
4784
+ }
4785
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KoStage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4786
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: KoStage, isStandalone: true, selector: "ko-stage", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { koMouseover: "koMouseover", koMousemove: "koMousemove", koMouseout: "koMouseout", koMouseenter: "koMouseenter", koMouseleave: "koMouseleave", koMousedown: "koMousedown", koMouseup: "koMouseup", koWheel: "koWheel", koContextmenu: "koContextmenu", koClick: "koClick", koDblclick: "koDblclick", koTouchstart: "koTouchstart", koTouchmove: "koTouchmove", koTouchend: "koTouchend", koTap: "koTap", koDbltap: "koDbltap", koDragstart: "koDragstart", koDragmove: "koDragmove", koDragend: "koDragend" }, providers: [
4787
+ {
4788
+ provide: KO_CONTAINER_TOKEN,
4789
+ useExisting: KoStage
4790
+ }
4791
+ ], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4792
+ }
4793
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KoStage, decorators: [{
4794
+ type: Component,
4795
+ args: [{
4796
+ selector: 'ko-stage',
4797
+ standalone: true,
4798
+ template: `<ng-content></ng-content>`,
4799
+ providers: [
4800
+ {
4801
+ provide: KO_CONTAINER_TOKEN,
4802
+ useExisting: KoStage
4803
+ }
4804
+ ],
4805
+ changeDetection: ChangeDetectionStrategy.OnPush
4806
+ }]
4807
+ }], ctorParameters: () => [], propDecorators: { koMouseover: [{
4808
+ type: Output
4809
+ }], koMousemove: [{
4810
+ type: Output
4811
+ }], koMouseout: [{
4812
+ type: Output
4813
+ }], koMouseenter: [{
4814
+ type: Output
4815
+ }], koMouseleave: [{
4816
+ type: Output
4817
+ }], koMousedown: [{
4818
+ type: Output
4819
+ }], koMouseup: [{
4820
+ type: Output
4821
+ }], koWheel: [{
4822
+ type: Output
4823
+ }], koContextmenu: [{
4824
+ type: Output
4825
+ }], koClick: [{
4826
+ type: Output
4827
+ }], koDblclick: [{
4828
+ type: Output
4829
+ }], koTouchstart: [{
4830
+ type: Output
4831
+ }], koTouchmove: [{
4832
+ type: Output
4833
+ }], koTouchend: [{
4834
+ type: Output
4835
+ }], koTap: [{
4836
+ type: Output
4837
+ }], koDbltap: [{
4838
+ type: Output
4839
+ }], koDragstart: [{
4840
+ type: Output
4841
+ }], koDragmove: [{
4842
+ type: Output
4843
+ }], koDragend: [{
4844
+ type: Output
4845
+ }] } });
4846
+
4847
+ class KoComponent extends Component {
4848
+ }
4849
+
4850
+ const KoShapeTypes = {
4851
+ Arc,
4852
+ Arrow,
4853
+ Circle,
4854
+ Ellipse,
4855
+ Image: Image$1,
4856
+ Label,
4857
+ Tag,
4858
+ Line,
4859
+ Path,
4860
+ Rect,
4861
+ RegularPolygon,
4862
+ Ring,
4863
+ Star,
4864
+ Text,
4865
+ TextPath,
4866
+ Transformer,
4867
+ Wedge,
4868
+ Group,
4869
+ Layer,
4870
+ FastLayer
4871
+ };
4872
+
4873
+ class AITableIcon {
4874
+ constructor() {
4875
+ this.config = input.required();
4876
+ this.groupConfig = computed(() => {
4877
+ const { x, y, listening } = this.config();
4878
+ return { x, y, listening };
4879
+ });
4880
+ this.squareShapeConfig = computed(() => {
4881
+ const { name, backgroundWidth, backgroundHeight, size = DEFAULT_ICON_SIZE, strokeWidth = 1, background, cornerRadius, opacity } = this.config();
4882
+ return {
4883
+ name,
4884
+ width: backgroundWidth || size,
4885
+ height: backgroundHeight || size,
4886
+ strokeWidth: strokeWidth,
4887
+ fill: background || Colors.transparent,
4888
+ cornerRadius,
4889
+ opacity
4890
+ };
4891
+ });
4892
+ this.iconConfig = computed(() => {
4893
+ const { type, data, backgroundWidth, backgroundHeight, size = DEFAULT_ICON_SIZE, stroke, strokeWidth = 1, scaleX, scaleY, offsetX, offsetY, rotation, fill = Colors.gray600, transformsEnabled = 'position' } = this.config();
4894
+ let pathData = data;
4895
+ switch (type) {
4896
+ case AITableCheckType.checked:
4897
+ pathData = Check;
4898
+ break;
4899
+ case AITableCheckType.unchecked:
4900
+ pathData = Unchecked;
4815
4901
  break;
4816
4902
  }
4817
- }
4818
- if (!isClosed) {
4819
- this.ctx.stroke();
4820
- }
4821
- else {
4822
- this.ctx.fill();
4823
- }
4824
- this.ctx.restore();
4903
+ return {
4904
+ x: backgroundWidth && (backgroundWidth - size * (scaleX || 1)) / 2,
4905
+ y: backgroundHeight && (backgroundHeight - size * (scaleY || 1)) / 2,
4906
+ data: pathData,
4907
+ width: size,
4908
+ height: size,
4909
+ fill,
4910
+ offsetX,
4911
+ offsetY,
4912
+ scaleX,
4913
+ scaleY,
4914
+ rotation,
4915
+ stroke,
4916
+ strokeWidth,
4917
+ transformsEnabled,
4918
+ perfectDrawEnabled: false,
4919
+ listening: false
4920
+ };
4921
+ });
4825
4922
  }
4923
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4924
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableIcon, isStandalone: true, selector: "ai-table-icon", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
4925
+ <ko-group [config]="groupConfig()">
4926
+ <ko-rect [config]="squareShapeConfig()"></ko-rect>
4927
+ <ko-path [config]="iconConfig()"></ko-path>
4928
+ </ko-group>
4929
+ `, 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4826
4930
  }
4827
- const drawer = new Drawer();
4931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableIcon, decorators: [{
4932
+ type: Component,
4933
+ args: [{
4934
+ selector: 'ai-table-icon',
4935
+ template: `
4936
+ <ko-group [config]="groupConfig()">
4937
+ <ko-rect [config]="squareShapeConfig()"></ko-rect>
4938
+ <ko-path [config]="iconConfig()"></ko-path>
4939
+ </ko-group>
4940
+ `,
4941
+ standalone: true,
4942
+ imports: [KoContainer, KoShape],
4943
+ changeDetection: ChangeDetectionStrategy.OnPush
4944
+ }]
4945
+ }] });
4946
+
4947
+ class AITableAddField {
4948
+ constructor() {
4949
+ this.config = input.required();
4950
+ this.btnWidth = AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
4951
+ this.x = computed(() => {
4952
+ const lastColumnWidth = this.config().coordinate.getColumnWidth(this.config().columnStopIndex);
4953
+ const lastColumnOffset = this.config().coordinate.getColumnOffset(this.config().columnStopIndex);
4954
+ return lastColumnWidth + lastColumnOffset;
4955
+ });
4956
+ this.rectConfig = computed(() => {
4957
+ const { pointPosition: { targetName }, readonly } = this.config();
4958
+ const fill = targetName === AI_TABLE_FIELD_ADD_BUTTON ? Colors.gray80 : Colors.white;
4959
+ return {
4960
+ name: generateTargetName({
4961
+ targetName: AI_TABLE_FIELD_ADD_BUTTON,
4962
+ fieldId: this.config().fields[this.config().columnStopIndex]._id,
4963
+ mouseStyle: readonly ? 'default' : 'pointer'
4964
+ }),
4965
+ x: AI_TABLE_OFFSET,
4966
+ y: AI_TABLE_OFFSET,
4967
+ width: this.config().coordinate.containerWidth - this.x() < this.btnWidth
4968
+ ? this.btnWidth
4969
+ : this.config().coordinate.containerWidth - this.x(),
4970
+ height: this.config().coordinate.rowInitSize,
4971
+ stroke: Colors.gray200,
4972
+ strokeWidth: 1,
4973
+ listening: true,
4974
+ fill
4975
+ };
4976
+ });
4977
+ this.addIconConfig = computed(() => {
4978
+ const { readonly } = this.config();
4979
+ const offsetY = (this.config().coordinate.rowInitSize - AI_TABLE_ICON_COMMON_SIZE) / 2;
4980
+ return {
4981
+ x: AI_TABLE_CELL_PADDING,
4982
+ y: offsetY,
4983
+ data: AddOutlinedPath,
4984
+ fill: Colors.gray600,
4985
+ listening: false,
4986
+ visible: isNil(readonly) ? true : !readonly
4987
+ };
4988
+ });
4989
+ }
4990
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableAddField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4991
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableAddField, isStandalone: true, selector: "ai-table-add-field", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
4992
+ <ko-group [config]="{ x: x() }">
4993
+ <ko-group>
4994
+ <ko-rect [config]="rectConfig()"></ko-rect>
4995
+ </ko-group>
4996
+ <ko-group>
4997
+ @if (addIconConfig().visible) {
4998
+ <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
4999
+ }
5000
+ </ko-group>
5001
+ </ko-group>
5002
+ `, 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 }); }
5003
+ }
5004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableAddField, decorators: [{
5005
+ type: Component,
5006
+ args: [{
5007
+ selector: 'ai-table-add-field',
5008
+ template: `
5009
+ <ko-group [config]="{ x: x() }">
5010
+ <ko-group>
5011
+ <ko-rect [config]="rectConfig()"></ko-rect>
5012
+ </ko-group>
5013
+ <ko-group>
5014
+ @if (addIconConfig().visible) {
5015
+ <ai-table-icon [config]="addIconConfig()"></ai-table-icon>
5016
+ }
5017
+ </ko-group>
5018
+ </ko-group>
5019
+ `,
5020
+ standalone: true,
5021
+ imports: [KoContainer, KoShape, AITableIcon],
5022
+ changeDetection: ChangeDetectionStrategy.OnPush
5023
+ }]
5024
+ }] });
4828
5025
 
4829
5026
  /**
4830
5027
  * 用于处理表格行或单元格的布局和绘制。
@@ -5033,7 +5230,7 @@ class CellDrawer extends Drawer {
5033
5230
  renderCellText(render, ctx) {
5034
5231
  const { x, y, transformValue, field, columnWidth, style } = render;
5035
5232
  const fieldType = field.type;
5036
- let renderText = fieldType === AITableFieldType.link ? transformValue.text : transformValue;
5233
+ let renderText = fieldType === AITableFieldType.link ? transformValue?.text : transformValue;
5037
5234
  if (renderText == null) {
5038
5235
  return;
5039
5236
  }
@@ -5482,10 +5679,10 @@ class CellDrawer extends Drawer {
5482
5679
  const avatarSize = AI_TABLE_MEMBER_AVATAR_SIZE;
5483
5680
  const itemHeight = AI_TABLE_CELL_MEMBER_ITEM_HEIGHT;
5484
5681
  const isOperating = isActive;
5485
- const isMulti = settings?.is_multiple;
5682
+ const isMultiple = settings?.is_multiple;
5486
5683
  let currentX = AI_TABLE_CELL_PADDING;
5487
5684
  let currentY = (AI_TABLE_ROW_BLANK_HEIGHT - avatarSize) / 2;
5488
- const itemOtherWidth = avatarSize + AI_TABLE_MEMBER_ITEM_PADDING_RIGHT + AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT;
5685
+ const itemOtherWidth = avatarSize + AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT;
5489
5686
  const maxHeight = isActive ? 130 - AI_TABLE_CELL_MULTI_PADDING_TOP : rowHeight - AI_TABLE_CELL_MULTI_PADDING_TOP;
5490
5687
  const maxTextWidth = isOperating
5491
5688
  ? columnWidth - 2 * AI_TABLE_CELL_PADDING - itemOtherWidth - AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE - 12
@@ -5497,7 +5694,7 @@ class CellDrawer extends Drawer {
5497
5694
  if (!userInfo)
5498
5695
  continue;
5499
5696
  const { uid, display_name, avatar } = userInfo;
5500
- const itemWidth = AITableAvatarSize.size24 + (isMulti ? AI_TABLE_CELL_MEMBER_ITEM_PADDING : 0);
5697
+ const itemWidth = AITableAvatarSize.size24 + (isMultiple ? AI_TABLE_CELL_MEMBER_ITEM_PADDING : 0);
5501
5698
  currentX = AI_TABLE_CELL_PADDING + index * itemWidth;
5502
5699
  let realMaxTextWidth = maxTextWidth < 0 ? 0 : maxTextWidth;
5503
5700
  if (index === 0 && isOperating) {
@@ -5540,6 +5737,22 @@ class CellDrawer extends Drawer {
5540
5737
  type: AITableAvatarType.member,
5541
5738
  size: AITableAvatarSize.size24
5542
5739
  });
5740
+ // 在非多选模式下显示名称
5741
+ if (!isMultiple) {
5742
+ const textX = x + currentX + AITableAvatarSize.size24 + AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT;
5743
+ this.text({
5744
+ x: textX,
5745
+ y: y + AI_TABLE_ROW_BLANK_HEIGHT / 2,
5746
+ text: this.textEllipsis({
5747
+ text: display_name || '',
5748
+ maxWidth: maxTextWidth,
5749
+ fontSize: AI_TABLE_COMMON_FONT_SIZE
5750
+ }).text,
5751
+ fillStyle: this.colors.gray800,
5752
+ fontSize: AI_TABLE_COMMON_FONT_SIZE,
5753
+ verticalAlign: DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE
5754
+ });
5755
+ }
5543
5756
  if (isMore) {
5544
5757
  ctx.save();
5545
5758
  ctx.globalAlpha = 0.3;
@@ -5693,6 +5906,7 @@ const createCells = (config) => {
5693
5906
  cellDrawer.initCtx(ctx);
5694
5907
  addRowLayout.initCtx(ctx);
5695
5908
  recordRowLayout.initCtx(ctx);
5909
+ const hoverCell = getHoverCell(aiTable);
5696
5910
  // 遍历列, 确定在哪些列上绘制单元格
5697
5911
  for (let columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
5698
5912
  if (columnIndex > columnCount - 1)
@@ -5782,6 +5996,11 @@ const createCells = (config) => {
5782
5996
  style,
5783
5997
  colors
5784
5998
  };
5999
+ // hover 组件渲染时,底层的 cell 渲染为空
6000
+ if (hoverCell && hoverCell.recordId === recordId && hoverCell.fieldId === fieldId) {
6001
+ render.cellValue = '';
6002
+ render.transformValue = '';
6003
+ }
5785
6004
  cellDrawer.initStyle(field, style);
5786
6005
  // 最后一列,且单元格内容存在,需要裁剪内容,以防止文本溢出单元格边界
5787
6006
  // 然后,根据计算好的样式和布局绘制单元格内容
@@ -5942,47 +6161,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
5942
6161
  }]
5943
6162
  }] });
5944
6163
 
5945
- class AITableText {
5946
- constructor() {
5947
- this.config = input.required();
5948
- this.textConfig = computed(() => {
5949
- const { x, y, width, height, text, padding, align = DEFAULT_TEXT_ALIGN_LEFT, verticalAlign = DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, fill = DEFAULT_TEXT_FILL, textDecoration, fontSize = DEFAULT_FONT_SIZE, fontStyle = DEFAULT_FONT_STYLE, ellipsis = DEFAULT_TEXT_ELLIPSIS, wrap = DEFAULT_TEXT_WRAP, transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED, listening = DEFAULT_TEXT_LISTENING, fontFamily = DEFAULT_FONT_FAMILY, ...rest } = this.config();
5950
- return {
5951
- x,
5952
- y,
5953
- width,
5954
- height,
5955
- text,
5956
- padding,
5957
- align,
5958
- verticalAlign,
5959
- fill,
5960
- textDecoration,
5961
- fontSize,
5962
- fontStyle,
5963
- ellipsis,
5964
- wrap,
5965
- transformsEnabled,
5966
- listening,
5967
- fontFamily,
5968
- ...rest
5969
- };
5970
- });
5971
- }
5972
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5973
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableText, isStandalone: true, selector: "ai-table-text", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: ` <ko-text [config]="textConfig()"></ko-text> `, 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 }); }
5974
- }
5975
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableText, decorators: [{
5976
- type: Component,
5977
- args: [{
5978
- selector: 'ai-table-text',
5979
- template: ` <ko-text [config]="textConfig()"></ko-text> `,
5980
- standalone: true,
5981
- imports: [KoShape],
5982
- changeDetection: ChangeDetectionStrategy.OnPush
5983
- }]
5984
- }] });
5985
-
5986
6164
  class AITableFieldHead {
5987
6165
  constructor() {
5988
6166
  this.config = input.required();
@@ -6081,7 +6259,7 @@ class AITableFieldHead {
6081
6259
  }
6082
6260
  </ko-group>
6083
6261
  </ko-group>
6084
- `, 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: AITableFieldIcon, selector: "ai-table-field-icon", inputs: ["config"] }, { kind: "component", type: AITableText, selector: "ai-table-text", inputs: ["config"] }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6262
+ `, 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: AITableFieldIcon, selector: "ai-table-field-icon", inputs: ["config"] }, { kind: "component", type: AITableText, selector: "ai-table-text", inputs: ["config"], outputs: ["koClick", "koMouseMove"] }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6085
6263
  }
6086
6264
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldHead, decorators: [{
6087
6265
  type: Component,
@@ -6193,8 +6371,8 @@ class AITableFrozenColumnHeads {
6193
6371
  return this.config().coordinate;
6194
6372
  });
6195
6373
  this.isChecked = computed(() => {
6196
- const { selection, records } = this.config().aiTable;
6197
- return selection().selectedRecords.size === records().length;
6374
+ // 目前只需要展示全部选中和空的状态
6375
+ return this.config().aiTable.selection().selectAllState === AITableSelectAllState.all;
6198
6376
  });
6199
6377
  this.fieldHeadHeight = computed(() => {
6200
6378
  return this.coordinate().rowInitSize;
@@ -6622,6 +6800,100 @@ const createActiveCellBorder = (config) => {
6622
6800
  };
6623
6801
  };
6624
6802
 
6803
+ class AITableHoverCells {
6804
+ constructor() {
6805
+ this.config = input.required();
6806
+ this.componentMap = {};
6807
+ this.groupConfig = computed(() => {
6808
+ return {
6809
+ x: this.hoverCellConfig()?.x,
6810
+ y: this.hoverCellConfig()?.y
6811
+ };
6812
+ });
6813
+ this.hoverCellConfig = computed(() => {
6814
+ const { aiTable, coordinate } = this.config();
6815
+ const pointPosition = aiTable.context.pointPosition();
6816
+ const hoverCell = this.hoverCell();
6817
+ if (!hoverCell) {
6818
+ return;
6819
+ }
6820
+ const { field, recordId, fieldId, renderComponentDefinition } = hoverCell;
6821
+ const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
6822
+ const transformValue = transformCellValue(aiTable, field, cellValue) || {};
6823
+ if (Object.keys(transformValue).length === 0) {
6824
+ return;
6825
+ }
6826
+ const { rowHeight, columnCount, rowCount } = coordinate;
6827
+ const columnIndex = pointPosition.columnIndex;
6828
+ const rowIndex = pointPosition.rowIndex;
6829
+ const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
6830
+ const columnWidth = coordinate.getColumnWidth(columnIndex);
6831
+ const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
6832
+ const { width } = getCellHorizontalPosition({
6833
+ columnWidth,
6834
+ columnIndex,
6835
+ columnCount
6836
+ });
6837
+ const style = {
6838
+ textAlign: DEFAULT_TEXT_ALIGN_LEFT
6839
+ };
6840
+ const textAlign = style.textAlign;
6841
+ const renderX = textAlign === DEFAULT_TEXT_ALIGN_RIGHT
6842
+ ? columnWidth - AI_TABLE_CELL_PADDING + AI_TABLE_OFFSET
6843
+ : AI_TABLE_CELL_PADDING + AI_TABLE_OFFSET;
6844
+ const renderY = 0 - AI_TABLE_OFFSET * 2;
6845
+ const result = {
6846
+ field,
6847
+ aiTable,
6848
+ coordinate,
6849
+ x,
6850
+ y,
6851
+ render: {
6852
+ aiTable,
6853
+ recordId,
6854
+ field,
6855
+ isActive: isSelectedField(field._id, aiTable),
6856
+ x: renderX,
6857
+ y: renderY,
6858
+ columnWidth: width,
6859
+ rowHeight,
6860
+ cellValue,
6861
+ transformValue,
6862
+ style
6863
+ }
6864
+ };
6865
+ return result;
6866
+ });
6867
+ this.hoverCell = computed(() => getHoverCell(this.config().aiTable));
6868
+ }
6869
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableHoverCells, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6870
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableHoverCells, isStandalone: true, selector: "ai-table-hover-cell", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
6871
+ @if (hoverCell()) {
6872
+ <ko-group [config]="groupConfig()">
6873
+ <ng-container *ngComponentOutlet="hoverCell()!.renderComponentDefinition; inputs: { config: hoverCellConfig() }">
6874
+ </ng-container>
6875
+ </ko-group>
6876
+ }
6877
+ `, 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6878
+ }
6879
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableHoverCells, decorators: [{
6880
+ type: Component,
6881
+ args: [{
6882
+ selector: 'ai-table-hover-cell',
6883
+ template: `
6884
+ @if (hoverCell()) {
6885
+ <ko-group [config]="groupConfig()">
6886
+ <ng-container *ngComponentOutlet="hoverCell()!.renderComponentDefinition; inputs: { config: hoverCellConfig() }">
6887
+ </ng-container>
6888
+ </ko-group>
6889
+ }
6890
+ `,
6891
+ standalone: true,
6892
+ imports: [KoShape, KoContainer, CommonModule],
6893
+ changeDetection: ChangeDetectionStrategy.OnPush
6894
+ }]
6895
+ }] });
6896
+
6625
6897
  Konva.pixelRatio = 2;
6626
6898
  class AITableRenderer {
6627
6899
  constructor() {
@@ -6776,7 +7048,7 @@ class AITableRenderer {
6776
7048
  this.koDblclick.emit(e);
6777
7049
  }
6778
7050
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6779
- 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" }, 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>\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 </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 }); }
7051
+ 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" }, 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>\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 <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\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 </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 }); }
6780
7052
  }
6781
7053
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableRenderer, decorators: [{
6782
7054
  type: Component,
@@ -6789,11 +7061,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
6789
7061
  AITableCells,
6790
7062
  AITableFrozenCells,
6791
7063
  AITableFrozenPlaceholderCells,
7064
+ AITableHoverCells,
6792
7065
  AITablePlaceholderCells,
6793
7066
  AITableAddField,
6794
7067
  AITableHoverRowHeads,
6795
- AITableOtherRows
6796
- ], 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>\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 </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" }]
7068
+ AITableOtherRows,
7069
+ AITableCellLink
7070
+ ], 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>\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 <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\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 </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
6797
7071
  }] });
6798
7072
 
6799
7073
  class AITableGrid extends AITableGridBase {
@@ -6908,6 +7182,24 @@ class AITableGrid extends AITableGridBase {
6908
7182
  effect(() => {
6909
7183
  this.setKeywordsMatchedCells();
6910
7184
  }, { allowSignalWrites: true });
7185
+ effect(() => {
7186
+ const recordIdSet = new Set(this.aiTable.records().map((item) => item._id));
7187
+ untracked(() => {
7188
+ const selectedRecords = this.aiTable.selection().selectedRecords;
7189
+ for (const selectedRecordId of selectedRecords.values()) {
7190
+ if (!recordIdSet.has(selectedRecordId)) {
7191
+ selectedRecords.delete(selectedRecordId);
7192
+ }
7193
+ }
7194
+ this.aiTable.selection.update((item) => {
7195
+ return {
7196
+ ...item,
7197
+ selectedRecords,
7198
+ selectAllState: this.aiTableGridSelectionService.selectAllState()
7199
+ };
7200
+ });
7201
+ });
7202
+ }, { allowSignalWrites: true });
6911
7203
  }
6912
7204
  ngOnInit() {
6913
7205
  super.ngOnInit();
@@ -7054,7 +7346,7 @@ class AITableGrid extends AITableGridBase {
7054
7346
  return;
7055
7347
  }
7056
7348
  case AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX: {
7057
- const isChecked = this.aiTable.selection().selectedRecords.size === this.aiTable.records().length;
7349
+ const isChecked = this.aiTable.selection().selectAllState === AITableSelectAllState.all;
7058
7350
  this.toggleSelectAll(!isChecked);
7059
7351
  return;
7060
7352
  }
@@ -7243,5 +7535,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7243
7535
  * Generated bundle index. Do not edit.
7244
7536
  */
7245
7537
 
7246
- export { AITable, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableCheckType, AITableContextMenu, AITableDomGrid, AITableFieldIsMultiplePipe, AITableFieldSetting, AITableFieldType, AITableFilterOperation, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridSelectionService, AITableMemberType, AITableMouseDownType, AITableQueries, AITableRenderer, AITableRowColumnType, AITableRowType, AITableSelectOptionStyle, AITableStatType, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, 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_SELECT_CHECKBOX, AI_TABLE_FIELD_HEAD_TEXT_MIN_WIDTH, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, 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_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_RADIUS, AI_TABLE_PROGRESS_TEXT_Width, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AbstractEditCellEditor, AddOutlinedPath, Check, Colors, ColumnCalendarFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, 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, DepartmentOutlinedPath, Direction, FONT_SIZE_SM, FieldOptions, GRID_CELL_EDITOR_MAP, IsSelectRecordPipe, LinkCellEditorComponent, MIN_COLUMN_WIDTH, MOUSEOVER_EDIT_TYPE, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, ProgressEditorComponent, RatingCellEditorComponent, RendererContext, RowHeight, SelectCellEditorComponent, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextMeasure, Unchecked, UserPipe, ViewOperationMap, WebOutlinedPath, buildGridData, buildGridLinearRows, castToString, compareNumber, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getDefaultFieldValue, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getHoverEditorBoxOffset, getHoverEditorSpace, getMousePosition, getPlaceHolderCellsConfigs, getTargetName, getTextWidth, getVisibleRangeInfo, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isArrayField, isCellMatchKeywords, isEmpty, isMac, isNumberFiled, isSameFieldOption, isSystemField, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, stringInclude, textDataCache, transformCellValue, zhIntlCollator };
7538
+ export { AITable, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableCheckType, AITableContextMenu, AITableDomGrid, AITableFieldIsMultiplePipe, AITableFieldSetting, AITableFieldType, AITableFilterOperation, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridSelectionService, AITableMemberType, AITableMouseDownType, AITableQueries, AITableRenderer, AITableRowColumnType, AITableRowType, AITableSelectAllState, AITableSelectOptionStyle, AITableStatType, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, 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_SELECT_CHECKBOX, AI_TABLE_FIELD_HEAD_TEXT_MIN_WIDTH, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, 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_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_RADIUS, AI_TABLE_PROGRESS_TEXT_Width, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AbstractEditCellEditor, AddOutlinedPath, Check, Colors, ColumnCalendarFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, 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, DepartmentOutlinedPath, Direction, FONT_SIZE_SM, FieldOptions, GRID_CELL_EDITOR_MAP, IsSelectRecordPipe, LinkCellEditorComponent, MIN_COLUMN_WIDTH, MOUSEOVER_EDIT_TYPE, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, ProgressEditorComponent, RatingCellEditorComponent, RendererContext, RowHeight, SelectCellEditorComponent, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextMeasure, Unchecked, UserPipe, ViewOperationMap, WebOutlinedPath, buildGridData, buildGridLinearRows, castToString, compareNumber, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getDefaultFieldValue, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getHoverCell, getHoverEditorBoxOffset, getHoverEditorSpace, getMousePosition, getPlaceHolderCellsConfigs, getTargetName, getTextWidth, getVisibleRangeInfo, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isArrayField, isCellMatchKeywords, isEmpty, isMac, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, stringInclude, textDataCache, transformCellValue, zhIntlCollator };
7247
7539
  //# sourceMappingURL=ai-table-grid.mjs.map