@ai-table/grid 0.1.33 → 0.1.34

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, input, EventEmitter, inject, ElementRef, effect, Output, ChangeDetectionStrategy, Component, signal, computed, output, Input, ChangeDetectorRef, ViewChild, Renderer2, Pipe, model, booleanAttribute, Injectable, DestroyRef, NgZone, ViewContainerRef, viewChild, afterNextRender, untracked } from '@angular/core';
2
+ import { InjectionToken, input, EventEmitter, inject, ElementRef, effect, Output, ChangeDetectionStrategy, Component, signal, computed, output, Input, ChangeDetectorRef, ViewChild, untracked, model, Renderer2, Pipe, booleanAttribute, Injectable, DestroyRef, NgZone, ViewContainerRef, viewChild, afterNextRender } from '@angular/core';
3
3
  import Konva from 'konva';
4
4
  import { Shape } from 'konva/lib/Shape';
5
5
  import { Sprite } from 'konva/lib/shapes/Sprite';
@@ -25,7 +25,7 @@ import { Transformer } from 'konva/lib/shapes/Transformer';
25
25
  import { Wedge } from 'konva/lib/shapes/Wedge';
26
26
  import * as i1$1 from 'ngx-tethys/popover';
27
27
  import { ThyPopoverRef, ThyPopover, ThyPopoverModule } from 'ngx-tethys/popover';
28
- import { AITableFieldGroup, AITableFieldType, AITableRowColumnType, DragType, isUndefinedOrNull, idCreator as idCreator$1, isUrl, AITableSelectOptionStyle, isEmpty, AITableFilterOperation, AttachmentFieldBase, AITableStatType, DateFieldBase, DEFAULT_FIELD_STAT_TYPE_ITEMS, isDateValid, isDateAndReturnDate, LinkFieldBase, MemberFieldBase, NumberFieldBase, ProgressFieldBase, isProgressAndReturnValue, RateFieldBase, RichTextFieldBase, SelectFieldBase, generateOptionsByTexts, TextFieldBase, CheckboxFieldBase, FieldModelBaseMap, numberFormat } from '@ai-table/utils';
28
+ import { AITableFieldGroup, AITableFieldType, AITableRowColumnType, DragType, isUndefinedOrNull, idCreator as idCreator$1, isUrl, isEmpty, AITableFilterOperation, AttachmentFieldBase, AITableStatType, DateFieldBase, DEFAULT_FIELD_STAT_TYPE_ITEMS, isDateValid, isDateAndReturnDate, LinkFieldBase, MemberFieldBase, NumberFieldBase, ProgressFieldBase, isProgressAndReturnValue, RateFieldBase, RichTextFieldBase, SelectFieldBase, AITableSelectOptionStyle, generateOptionsByTexts, TextFieldBase, CheckboxFieldBase, FieldModelBaseMap, numberFormat, DragDirection, AI_TABLE_MIN_FROZEN_COLUMN_COUNT } from '@ai-table/utils';
29
29
  import ObjectID from 'bson-objectid';
30
30
  import { customAlphabet } from 'nanoid';
31
31
  import * as _ from 'lodash';
@@ -46,22 +46,22 @@ import * as i2 from 'ngx-tethys/form';
46
46
  import { ThyFormSubmitDirective, ThyFormModule, ThyUniqueCheckValidator } from 'ngx-tethys/form';
47
47
  import { ThyNotifyService } from 'ngx-tethys/notify';
48
48
  import { ThyInputNumber } from 'ngx-tethys/input-number';
49
+ import { isKeyHotkey } from 'is-hotkey';
50
+ import { LRUCache } from 'lru-cache';
51
+ import { fromUnixTime, subDays, differenceInDays, differenceInMonths } from 'date-fns';
52
+ import { isArray, TinyDate, helpers } from 'ngx-tethys/util';
53
+ import { DEFAULT_COLORS } from 'ngx-tethys/color-picker';
54
+ import GraphemeSplitter from 'grapheme-splitter';
49
55
  import * as i1$2 from '@angular/common';
50
56
  import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common';
57
+ import { ThyDropdownAbstractMenu, ThyDropdownMenuItemDirective, ThyDropdownMenuComponent, ThyDropdownMenuGroup, ThyDropdownDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownMenuItemMetaDirective } from 'ngx-tethys/dropdown';
51
58
  import { ThyEmptyModule } from 'ngx-tethys/empty';
52
59
  import { ThySelect, ThySelectModule } from 'ngx-tethys/select';
53
60
  import { ThyDot } from 'ngx-tethys/dot';
54
61
  import { ThyIcon } from 'ngx-tethys/icon';
55
62
  import { ThyTag } from 'ngx-tethys/tag';
56
- import { ThyDropdownAbstractMenu, ThyDropdownMenuItemDirective, ThyDropdownMenuComponent, ThyDropdownMenuGroup, ThyDropdownDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownMenuItemMetaDirective } from 'ngx-tethys/dropdown';
57
63
  import { ThySwitch } from 'ngx-tethys/switch';
58
64
  import { of, Subject, fromEvent, debounceTime, mergeWith, animationFrames, filter } from 'rxjs';
59
- import { isKeyHotkey } from 'is-hotkey';
60
- import { LRUCache } from 'lru-cache';
61
- import { fromUnixTime, subDays, differenceInDays, differenceInMonths } from 'date-fns';
62
- import { isArray, TinyDate, helpers } from 'ngx-tethys/util';
63
- import { DEFAULT_COLORS } from 'ngx-tethys/color-picker';
64
- import GraphemeSplitter from 'grapheme-splitter';
65
65
  import { ThyDivider } from 'ngx-tethys/divider';
66
66
  import * as i4 from 'ngx-tethys/avatar';
67
67
  import { ThyAvatarModule } from 'ngx-tethys/avatar';
@@ -1541,7 +1541,8 @@ const AITableQueries = {
1541
1541
 
1542
1542
  class RendererContext {
1543
1543
  constructor(options) {
1544
- const { rowHeadWidth, linearRows, pointPosition, scrollState, visibleColumnsIndexMap, visibleRowsIndexMap, frozenColumnCount, references, aiFieldConfig, scrollAction, maxFields, maxRecords, maxSelectOptions, fieldOptions, fieldOptionMap, readonly } = options;
1544
+ const { containerRect, rowHeadWidth, linearRows, pointPosition, scrollState, visibleColumnsIndexMap, visibleRowsIndexMap, frozenColumnCount, references, aiFieldConfig, scrollAction, maxFields, maxRecords, maxSelectOptions, fieldOptions, fieldOptionMap, readonly } = options;
1545
+ this.containerRect = containerRect;
1545
1546
  this.rowHeadWidth = rowHeadWidth;
1546
1547
  this.linearRows = linearRows;
1547
1548
  this.pointPosition = pointPosition;
@@ -1872,387 +1873,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
1872
1873
  args: ['inputElement', { static: false }]
1873
1874
  }] } });
1874
1875
 
1875
- class NumberCellEditorComponent extends AbstractEditCellEditor {
1876
- updateValue() {
1877
- super.update();
1878
- this.closePopover();
1879
- }
1880
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NumberCellEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1881
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: NumberCellEditorComponent, isStandalone: true, selector: "number-cell-editor", host: { classAttribute: "number-cell-editor" }, usesInheritance: true, ngImport: i0, template: `<thy-input-number
1882
- class="h-100"
1883
- [thyAutoFocus]="true"
1884
- [(ngModel)]="modelValue"
1885
- (thyEnter)="updateValue()"
1886
- (thyBlur)="updateValue()"
1887
- /> `, isInline: true, dependencies: [{ 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: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }, { kind: "component", type: ThyInputNumber, selector: "thy-input-number", inputs: ["thyAutoFocus", "thyPlaceholder", "thyDisabled", "thyMax", "thyMin", "thyStep", "thyStepDelay", "thySize", "thyPrecision", "thySuffix"], outputs: ["thyBlur", "thyFocus", "thyStepChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1888
- }
1889
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NumberCellEditorComponent, decorators: [{
1890
- type: Component,
1891
- args: [{
1892
- selector: 'number-cell-editor',
1893
- template: `<thy-input-number
1894
- class="h-100"
1895
- [thyAutoFocus]="true"
1896
- [(ngModel)]="modelValue"
1897
- (thyEnter)="updateValue()"
1898
- (thyBlur)="updateValue()"
1899
- /> `,
1900
- changeDetection: ChangeDetectionStrategy.OnPush,
1901
- imports: [FormsModule, ThyEnterDirective, ThyInputNumber],
1902
- host: {
1903
- class: 'number-cell-editor'
1904
- }
1905
- }]
1906
- }] });
1907
-
1908
- class SelectOptionComponent {
1909
- constructor() {
1910
- this.field = input.required();
1911
- this.displayOption = input.required();
1912
- this.optionStyle = computed(() => {
1913
- return this.field().settings.option_style || AITableSelectOptionStyle.text;
1914
- });
1915
- this.AITableSelectOptionStyle = AITableSelectOptionStyle;
1916
- }
1917
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1918
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: SelectOptionComponent, isStandalone: true, selector: "select-option", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, displayOption: { classPropertyName: "displayOption", publicName: "displayOption", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.select-option-tag": "optionStyle === AITableSelectOptionStyle.tag" }, classAttribute: "select-option thy-text" }, ngImport: i0, template: "@if (displayOption(); as displayOption) {\n @switch (optionStyle()) {\n @case (AITableSelectOptionStyle.dot) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @case (AITableSelectOptionStyle.tag) {\n @if (displayOption.bg_color || displayOption.color || 'default'; as color) {\n <thy-tag thyTheme=\"fill\" thyShape=\"pill\" [thyColor]=\"color\">\n @if (displayOption['icon']) {\n <thy-icon class=\"text-white\" [thyIconName]=\"displayOption['icon']\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n </thy-tag>\n }\n }\n @case (AITableSelectOptionStyle.piece) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot thyShape=\"square\" [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @default {\n @if (displayOption['icon']) {\n <thy-icon [thyIconName]=\"displayOption['icon']\" [style.color]=\"displayOption.color\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n }\n}\n", dependencies: [{ kind: "component", type: ThyTag, selector: "thy-tag,[thyTag]", inputs: ["thyTag", "thyShape", "thyColor", "thyTheme", "thySize", "thyHoverable"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: ThyDot, selector: "thy-dot,[thy-dot],[thyDot]", inputs: ["thyColor", "thySize", "thyTheme", "thyShape"] }, { kind: "component", type: ThyFlexibleText, selector: "thy-flexible-text,[thyFlexibleText]", inputs: ["thyTooltipTrigger", "thyContainerClass", "thyTooltipContent", "thyTooltipPlacement", "thyTooltipOffset"], exportAs: ["thyFlexibleText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1919
- }
1920
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionComponent, decorators: [{
1921
- type: Component,
1922
- args: [{ selector: 'select-option', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1923
- class: 'select-option thy-text',
1924
- '[class.select-option-tag]': 'optionStyle === AITableSelectOptionStyle.tag'
1925
- }, imports: [ThyTag, ThyIcon, ThyTooltipModule, ThyDot, ThyFlexibleText], template: "@if (displayOption(); as displayOption) {\n @switch (optionStyle()) {\n @case (AITableSelectOptionStyle.dot) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @case (AITableSelectOptionStyle.tag) {\n @if (displayOption.bg_color || displayOption.color || 'default'; as color) {\n <thy-tag thyTheme=\"fill\" thyShape=\"pill\" [thyColor]=\"color\">\n @if (displayOption['icon']) {\n <thy-icon class=\"text-white\" [thyIconName]=\"displayOption['icon']\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n </thy-tag>\n }\n }\n @case (AITableSelectOptionStyle.piece) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot thyShape=\"square\" [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @default {\n @if (displayOption['icon']) {\n <thy-icon [thyIconName]=\"displayOption['icon']\" [style.color]=\"displayOption.color\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n }\n}\n" }]
1926
- }] });
1927
-
1928
- class SelectCellEditorComponent extends AbstractEditCellEditor {
1929
- get isMultiple() {
1930
- return !!this.field().settings.is_multiple;
1931
- }
1932
- constructor() {
1933
- super();
1934
- this.selectOptions = computed(() => {
1935
- return this.field().settings.options;
1936
- });
1937
- this.preset = computed(() => {
1938
- return this.field().settings.is_multiple && this.field().settings.option_style === AITableSelectOptionStyle.tag ? 'tag' : '';
1939
- });
1940
- }
1941
- ngOnInit() {
1942
- this.modelValue = computed(() => {
1943
- const value = AITableQueries.getFieldValue(this.aiTable, [this.record()._id, this.field()._id]);
1944
- if (!this.isMultiple) {
1945
- return value?.length > 0 ? value[0] : null;
1946
- }
1947
- return value || [];
1948
- })();
1949
- }
1950
- onOpenChange(value) {
1951
- if (!value) {
1952
- this.closePopover();
1876
+ const buildGridLinearRows = (visibleRecords, isAddingVisible = true) => {
1877
+ const linearRows = [];
1878
+ let displayRowIndex = 0;
1879
+ [...visibleRecords, { _id: '' }].forEach((row) => {
1880
+ if (row._id) {
1881
+ displayRowIndex++;
1882
+ linearRows.push({
1883
+ type: AITableRowType.record,
1884
+ _id: row._id,
1885
+ displayIndex: displayRowIndex
1886
+ });
1953
1887
  }
1954
- }
1955
- onModelChange(event) {
1956
- this.updateValueFn();
1957
- }
1958
- updateValueFn() {
1959
- const value = (this.isMultiple ? this.modelValue : (this.modelValue && [this.modelValue]) || []);
1960
- const originValue = AITableQueries.getFieldValue(this.aiTable, [this.record()._id, this.field()._id]) || [];
1961
- if (value.length !== originValue.length || !value.every((v, i) => v === originValue[i])) {
1962
- this.updateFieldValues.emit([
1963
- {
1964
- value: value,
1965
- path: [this.record()._id, this.field()._id]
1966
- }
1967
- ]);
1888
+ if (isAddingVisible && !row._id) {
1889
+ linearRows.push({
1890
+ type: AITableRowType.add,
1891
+ _id: ''
1892
+ });
1968
1893
  }
1969
- }
1970
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1971
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: SelectCellEditorComponent, isStandalone: true, selector: "select-cell-editor", host: { classAttribute: "d-block h-100 select-cell-editor" }, usesInheritance: true, ngImport: i0, template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option\n [thyValue]=\"option._id\"\n [hidden]=\"!!option.is_disabled\"\n [thyRawValue]=\"option\"\n [thyShowOptionCustom]=\"true\"\n [thyLabelText]=\"option.text\"\n >\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n", dependencies: [{ kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange", "visibleChange"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ThyEmptyModule }, { kind: "ngmodule", type: ThyFormModule }, { 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: "ngmodule", type: ThySelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1972
- }
1973
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectCellEditorComponent, decorators: [{
1974
- type: Component,
1975
- args: [{ selector: 'select-cell-editor', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1976
- class: 'd-block h-100 select-cell-editor'
1977
- }, imports: [
1978
- ThySelect,
1979
- ThyOption,
1980
- ThyTooltipModule,
1981
- SelectOptionComponent,
1982
- CommonModule,
1983
- ThyEmptyModule,
1984
- ThyFormModule,
1985
- FormsModule,
1986
- ThySelectModule
1987
- ], template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option\n [thyValue]=\"option._id\"\n [hidden]=\"!!option.is_disabled\"\n [thyRawValue]=\"option\"\n [thyShowOptionCustom]=\"true\"\n [thyLabelText]=\"option.text\"\n >\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n" }]
1988
- }], ctorParameters: () => [] });
1894
+ });
1895
+ return linearRows;
1896
+ };
1897
+ const buildGridData = (aiTable, recordValue, fieldsValue) => {
1898
+ const fieldOptions = getFieldOptions(aiTable);
1899
+ const fields = fieldsValue.map((value) => {
1900
+ const fieldOption = fieldOptions.find((item) => item.type === value.type);
1901
+ return {
1902
+ ...value,
1903
+ icon: value.icon || fieldOption.icon
1904
+ };
1905
+ });
1906
+ return {
1907
+ type: 'grid',
1908
+ fields,
1909
+ records: recordValue
1910
+ };
1911
+ };
1989
1912
 
1990
- class TextCellEditorComponent extends AbstractEditCellEditor {
1991
- constructor() {
1992
- super();
1993
- this.render2 = inject(Renderer2);
1994
- this.maxHeight = 148;
1995
- this.minHeight = 24;
1996
- this.isSelectAll = input(false);
1913
+ function getColumnIndicesSizeMap(aiTable, fields) {
1914
+ const fieldSizeMap = aiTable.gridData().fieldsSizeMap;
1915
+ const columnIndicesSizeMap = {};
1916
+ fields?.forEach((field, index) => {
1917
+ columnIndicesSizeMap[index] = fieldSizeMap[field._id] ?? getFieldOptionByField(aiTable, field).width;
1918
+ });
1919
+ return columnIndicesSizeMap;
1920
+ }
1921
+ /**
1922
+ * 获取单元格位置
1923
+ * 根据单元格是否是第一列/最后一列确定单元格所在的位置
1924
+ */
1925
+ function getCellHorizontalPosition(options) {
1926
+ const { columnWidth } = options;
1927
+ return { width: columnWidth, offset: 0 };
1928
+ }
1929
+ function transformToCellText(cellValue, options) {
1930
+ const { aiTable, field } = options;
1931
+ const fieldRenderers = aiTable?.context?.aiFieldConfig()?.fieldRenderers;
1932
+ if (!fieldRenderers || !field) {
1933
+ return cellValue;
1997
1934
  }
1998
- ngAfterViewInit() {
1999
- setTimeout(() => {
2000
- this.updateStyle();
2001
- this.handleSelectAll();
2002
- }, 0);
1935
+ const toText = fieldRenderers[field.type]?.toText;
1936
+ if (!toText) {
1937
+ return cellValue;
2003
1938
  }
2004
- updateStyle() {
2005
- const textarea = this.elementRef.nativeElement.querySelector('textarea');
2006
- if (textarea) {
2007
- this.render2.setStyle(textarea, 'height', 'auto');
2008
- const scrollHeight = textarea.scrollHeight;
2009
- const newHeight = Math.max(this.minHeight, Math.min(scrollHeight, this.maxHeight)) + 4;
2010
- this.render2.setStyle(textarea, 'max-height', `${this.maxHeight}px`);
2011
- this.render2.setStyle(textarea, 'height', `${newHeight}px`);
2012
- this.render2.setStyle(textarea, 'resize', 'none');
2013
- }
1939
+ const cellText = toText(field, cellValue);
1940
+ if (cellText == null) {
1941
+ return cellValue;
2014
1942
  }
2015
- handleSelectAll() {
2016
- if (this.isSelectAll()) {
2017
- const textarea = this.elementRef.nativeElement.querySelector('textarea');
2018
- textarea.select();
2019
- }
1943
+ return cellText;
1944
+ }
1945
+ /**
1946
+ * `\u4e00`: https://www.compart.com/en/unicode/U+4E00
1947
+ * `\u9fa5`: https://www.compart.com/en/unicode/U+9FA5
1948
+ */
1949
+ const UNIFIED_IDEOGRAPHS_REGEX = /^[\u4e00-\u9fa5]+$/;
1950
+ const SET_OF_LETTERS_REGEX = /^[a-zA-Z\/ ]+$/;
1951
+ function getAvatarShortName(name) {
1952
+ if (!name) {
1953
+ return '';
2020
1954
  }
2021
- valueChange() {
2022
- this.updateStyle();
1955
+ name = name.trim();
1956
+ if (UNIFIED_IDEOGRAPHS_REGEX.test(name) && name.length > 2) {
1957
+ return name.slice(name.length - 2);
2023
1958
  }
2024
- updateValue() {
2025
- super.update();
2026
- this.closePopover();
1959
+ if (SET_OF_LETTERS_REGEX.test(name) && name.indexOf(' ') > 0) {
1960
+ const words = name.split(' ');
1961
+ return (words[0].slice(0, 1) + words[1].slice(0, 1)).toUpperCase();
2027
1962
  }
2028
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: TextCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2029
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: TextCellEditorComponent, isStandalone: true, selector: "text-cell-editor", inputs: { isSelectAll: { classPropertyName: "isSelectAll", publicName: "isSelectAll", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "text-cell-editor" }, usesInheritance: true, ngImport: i0, template: `
2030
- <textarea
2031
- #textarea
2032
- placeholder=""
2033
- rows="1"
2034
- thyInput
2035
- [thyAutofocus]="true"
2036
- [(ngModel)]="modelValue"
2037
- (ngModelChange)="valueChange()"
2038
- (thyEnter)="updateValue()"
2039
- (blur)="updateValue()"
2040
- ></textarea>
2041
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: "directive", type: ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutofocus", "thyAutoSelect"] }, { kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2042
- }
2043
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: TextCellEditorComponent, decorators: [{
2044
- type: Component,
2045
- args: [{
2046
- selector: 'text-cell-editor',
2047
- template: `
2048
- <textarea
2049
- #textarea
2050
- placeholder=""
2051
- rows="1"
2052
- thyInput
2053
- [thyAutofocus]="true"
2054
- [(ngModel)]="modelValue"
2055
- (ngModelChange)="valueChange()"
2056
- (thyEnter)="updateValue()"
2057
- (blur)="updateValue()"
2058
- ></textarea>
2059
- `,
2060
- changeDetection: ChangeDetectionStrategy.OnPush,
2061
- imports: [FormsModule, ThyAutofocusDirective, ThyInputDirective, ThyEnterDirective],
2062
- host: {
2063
- class: 'text-cell-editor'
2064
- }
2065
- }]
2066
- }], ctorParameters: () => [] });
2067
-
2068
- class SelectOptionPipe {
2069
- transform(_id, options) {
2070
- return options?.length && options.find((item) => item._id === _id);
2071
- }
2072
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2073
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" }); }
2074
- }
2075
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionPipe, decorators: [{
2076
- type: Pipe,
2077
- args: [{
2078
- name: 'selectOption'
2079
- }]
2080
- }] });
2081
- class SelectOptionsPipe {
2082
- transform(ids, options = []) {
2083
- return ((ids?.length &&
2084
- ids.map((id) => {
2085
- return options.find((item) => item._id === id);
2086
- })) ||
2087
- []);
2088
- }
2089
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2090
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionsPipe, isStandalone: true, name: "selectOptions" }); }
2091
- }
2092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionsPipe, decorators: [{
2093
- type: Pipe,
2094
- args: [{
2095
- name: 'selectOptions'
2096
- }]
2097
- }] });
2098
- class IsSelectRecordPipe {
2099
- transform(recordId, selection) {
2100
- return selection.selectedRecords.has(recordId);
2101
- }
2102
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: IsSelectRecordPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2103
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: IsSelectRecordPipe, isStandalone: true, name: "isSelectRecord" }); }
2104
- }
2105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: IsSelectRecordPipe, decorators: [{
2106
- type: Pipe,
2107
- args: [{
2108
- name: 'isSelectRecord'
2109
- }]
2110
- }] });
2111
- class UserPipe {
2112
- transform(values, references) {
2113
- return ((values.length &&
2114
- values.map((item) => {
2115
- return references.members[item] || {};
2116
- })) ||
2117
- []);
2118
- }
2119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: UserPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2120
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: UserPipe, isStandalone: true, name: "user" }); }
2121
- }
2122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: UserPipe, decorators: [{
2123
- type: Pipe,
2124
- args: [{
2125
- name: 'user'
2126
- }]
2127
- }] });
2128
- class SelectSettingPipe {
2129
- transform(settings) {
2130
- return settings;
2131
- }
2132
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2133
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: SelectSettingPipe, isStandalone: true, name: "selectSetting" }); }
2134
- }
2135
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectSettingPipe, decorators: [{
2136
- type: Pipe,
2137
- args: [{
2138
- name: 'selectSetting'
2139
- }]
2140
- }] });
2141
- class MemberSettingPipe {
2142
- transform(settings) {
2143
- return settings;
2144
- }
2145
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: MemberSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2146
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: MemberSettingPipe, isStandalone: true, name: "memberSetting" }); }
2147
- }
2148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: MemberSettingPipe, decorators: [{
2149
- type: Pipe,
2150
- args: [{
2151
- name: 'memberSetting'
2152
- }]
2153
- }] });
2154
- class AITableFieldIsSameOptionPipe {
2155
- transform(fieldOption, field) {
2156
- return isSameFieldOption(fieldOption, field);
2157
- }
2158
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldIsSameOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2159
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldIsSameOptionPipe, isStandalone: true, name: "fieldIsSameOption" }); }
2160
- }
2161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldIsSameOptionPipe, decorators: [{
2162
- type: Pipe,
2163
- args: [{
2164
- name: 'fieldIsSameOption'
2165
- }]
2166
- }] });
2167
-
2168
- const buildGridLinearRows = (visibleRecords, isAddingVisible = true) => {
2169
- const linearRows = [];
2170
- let displayRowIndex = 0;
2171
- [...visibleRecords, { _id: '' }].forEach((row) => {
2172
- if (row._id) {
2173
- displayRowIndex++;
2174
- linearRows.push({
2175
- type: AITableRowType.record,
2176
- _id: row._id,
2177
- displayIndex: displayRowIndex
2178
- });
2179
- }
2180
- if (isAddingVisible && !row._id) {
2181
- linearRows.push({
2182
- type: AITableRowType.add,
2183
- _id: ''
2184
- });
2185
- }
2186
- });
2187
- return linearRows;
2188
- };
2189
- const buildGridData = (aiTable, recordValue, fieldsValue) => {
2190
- const fieldOptions = getFieldOptions(aiTable);
2191
- const fields = fieldsValue.map((value) => {
2192
- const fieldOption = fieldOptions.find((item) => item.type === value.type);
2193
- return {
2194
- ...value,
2195
- icon: value.icon || fieldOption.icon
2196
- };
2197
- });
2198
- return {
2199
- type: 'grid',
2200
- fields,
2201
- records: recordValue
2202
- };
2203
- };
2204
-
2205
- function getColumnIndicesSizeMap(aiTable, fields) {
2206
- const fieldSizeMap = aiTable.gridData().fieldsSizeMap;
2207
- const columnIndicesSizeMap = {};
2208
- fields?.forEach((field, index) => {
2209
- columnIndicesSizeMap[index] = fieldSizeMap[field._id] ?? getFieldOptionByField(aiTable, field).width;
2210
- });
2211
- return columnIndicesSizeMap;
2212
- }
2213
- /**
2214
- * 获取单元格位置
2215
- * 根据单元格是否是第一列/最后一列确定单元格所在的位置
2216
- */
2217
- function getCellHorizontalPosition(options) {
2218
- const { columnWidth } = options;
2219
- return { width: columnWidth, offset: 0 };
2220
- }
2221
- function transformToCellText(cellValue, options) {
2222
- const { aiTable, field } = options;
2223
- const fieldRenderers = aiTable?.context?.aiFieldConfig()?.fieldRenderers;
2224
- if (!fieldRenderers || !field) {
2225
- return cellValue;
2226
- }
2227
- const toText = fieldRenderers[field.type]?.toText;
2228
- if (!toText) {
2229
- return cellValue;
2230
- }
2231
- const cellText = toText(field, cellValue);
2232
- if (cellText == null) {
2233
- return cellValue;
2234
- }
2235
- return cellText;
2236
- }
2237
- /**
2238
- * `\u4e00`: https://www.compart.com/en/unicode/U+4E00
2239
- * `\u9fa5`: https://www.compart.com/en/unicode/U+9FA5
2240
- */
2241
- const UNIFIED_IDEOGRAPHS_REGEX = /^[\u4e00-\u9fa5]+$/;
2242
- const SET_OF_LETTERS_REGEX = /^[a-zA-Z\/ ]+$/;
2243
- function getAvatarShortName(name) {
2244
- if (!name) {
2245
- return '';
2246
- }
2247
- name = name.trim();
2248
- if (UNIFIED_IDEOGRAPHS_REGEX.test(name) && name.length > 2) {
2249
- return name.slice(name.length - 2);
2250
- }
2251
- if (SET_OF_LETTERS_REGEX.test(name) && name.indexOf(' ') > 0) {
2252
- const words = name.split(' ');
2253
- return (words[0].slice(0, 1) + words[1].slice(0, 1)).toUpperCase();
2254
- }
2255
- return name.length > 2 ? name.slice(0, 2).toUpperCase() : name.toUpperCase();
1963
+ return name.length > 2 ? name.slice(0, 2).toUpperCase() : name.toUpperCase();
2256
1964
  }
2257
1965
  function getAvatarBgColor(name) {
2258
1966
  if (!name) {
@@ -2272,9 +1980,17 @@ function expandCell(aiTable, path) {
2272
1980
  const [recordId, fieldId] = path;
2273
1981
  aiTable.selection.set({
2274
1982
  ...aiTable.selection(),
1983
+ activeCell: [recordId, fieldId],
1984
+ selectedCells: new Set([`${recordId}:${fieldId}`]),
2275
1985
  expandCell: [recordId, fieldId]
2276
1986
  });
2277
1987
  }
1988
+ function setExpandCellInfo(aiTable, expandCellInfo) {
1989
+ aiTable.selection.set({
1990
+ ...aiTable.selection(),
1991
+ expandCellInfo: expandCellInfo
1992
+ });
1993
+ }
2278
1994
 
2279
1995
  /**
2280
1996
  * 生成目标名称
@@ -5062,6 +4778,24 @@ class CoverCellBase {
5062
4778
  constructor() {
5063
4779
  this.config = input();
5064
4780
  this.onlyDisplayBorder = input(false);
4781
+ this.height = computed(() => {
4782
+ const { render } = this.config();
4783
+ return render.rowHeight;
4784
+ });
4785
+ this.isExpand = computed(() => {
4786
+ const { isExpand } = this.config();
4787
+ return isExpand;
4788
+ });
4789
+ effect(() => {
4790
+ const height = this.height();
4791
+ if (this.isExpand()) {
4792
+ untracked(() => {
4793
+ const { render, aiTable } = this.config();
4794
+ const { columnWidth } = render;
4795
+ setExpandCellInfo(aiTable, { width: columnWidth, height });
4796
+ });
4797
+ }
4798
+ });
5065
4799
  }
5066
4800
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: CoverCellBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5067
4801
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: CoverCellBase, isStandalone: true, selector: "ai-table-cover-cell-base", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, onlyDisplayBorder: { classPropertyName: "onlyDisplayBorder", publicName: "onlyDisplayBorder", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -5073,7 +4807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
5073
4807
  template: '',
5074
4808
  changeDetection: ChangeDetectionStrategy.OnPush
5075
4809
  }]
5076
- }] });
4810
+ }], ctorParameters: () => [] });
5077
4811
 
5078
4812
  class AITableCellLink extends CoverCellBase {
5079
4813
  constructor() {
@@ -8859,9 +8593,8 @@ class AITableFillHandle {
8859
8593
  const { aiTable, readonly } = this.config();
8860
8594
  const selection = aiTable.selection();
8861
8595
  const hasSelectedCells = selection.selectedCells.size > 0;
8862
- const isExpandCell = selection.expandCell;
8863
8596
  const isEditingCell = selection.editingCell;
8864
- return hasSelectedCells && !readonly && !isEditingCell && !isExpandCell;
8597
+ return hasSelectedCells && !readonly && !isEditingCell;
8865
8598
  });
8866
8599
  this.handleConfig = computed(() => {
8867
8600
  const { aiTable, coordinate } = this.config();
@@ -8875,9 +8608,10 @@ class AITableFillHandle {
8875
8608
  const rowOffset = coordinate.getRowOffset(rowIndex);
8876
8609
  const width = 6;
8877
8610
  const height = 6;
8611
+ const cellHeight = aiTable.selection().expandCellInfo?.height ?? AI_TABLE_ROW_HEIGHT;
8878
8612
  return {
8879
8613
  x: columnOffset + columnWidth - width / 2 + AI_TABLE_OFFSET,
8880
- y: rowOffset + AI_TABLE_ROW_HEIGHT - height + AI_TABLE_CELL_BORDER + AI_TABLE_OFFSET,
8614
+ y: rowOffset + cellHeight - height + AI_TABLE_CELL_BORDER + AI_TABLE_OFFSET,
8881
8615
  width,
8882
8616
  height,
8883
8617
  fill: Colors.primary,
@@ -10272,7 +10006,7 @@ class AITableCellText extends CoverCellBase {
10272
10006
  if (isExpand) {
10273
10007
  return {
10274
10008
  width: columnWidth - AI_TABLE_CELL_BORDER / 2,
10275
- height: this.renderHeight(),
10009
+ height: this.height(),
10276
10010
  stroke: Colors.primary,
10277
10011
  strokeWidth: 2,
10278
10012
  listening: false
@@ -10286,9 +10020,9 @@ class AITableCellText extends CoverCellBase {
10286
10020
  const { height } = this.expandTextBounds();
10287
10021
  return {
10288
10022
  width: columnWidth,
10289
- height: this.renderHeight(),
10023
+ height: this.height(),
10290
10024
  contentWidth: columnWidth, // 内容宽度大于容器宽度,会显示横向滚动条
10291
- contentHeight: height + this.startY() * 2, // 内容高度大于容器高度,会显示竖向滚动条
10025
+ contentHeight: height + this.startY() * 2 - AI_TABLE_CELL_LINE_BORDER, // 内容高度大于容器高度,会显示竖向滚动条
10292
10026
  scrollbarSize: 9,
10293
10027
  scrollbarColor: Colors.gray700,
10294
10028
  x: 0,
@@ -10329,9 +10063,9 @@ class AITableCellText extends CoverCellBase {
10329
10063
  }
10330
10064
  return textRender.replace(/\r|\n/g, ' ');
10331
10065
  });
10332
- this.renderHeight = computed(() => {
10066
+ this.height = computed(() => {
10333
10067
  const { height } = this.expandTextBounds() || { height: 0 };
10334
- return Math.min(Math.max(height, this.config()?.render.rowHeight || AI_TABLE_FIELD_HEAD_HEIGHT), 147);
10068
+ return Math.min(Math.max(height, this.config().render.rowHeight - AI_TABLE_CELL_LINE_BORDER || AI_TABLE_ROW_BLANK_HEIGHT), 146);
10335
10069
  });
10336
10070
  this.startY = computed(() => {
10337
10071
  const { y, rowHeight } = this.config()?.render;
@@ -10366,9 +10100,7 @@ class AITableCellText extends CoverCellBase {
10366
10100
  return;
10367
10101
  });
10368
10102
  this.textConfig = computed(() => {
10369
- const { isExpand } = this.config();
10370
10103
  const render = this.config()?.render;
10371
- this.isExpand();
10372
10104
  if (render) {
10373
10105
  const { x, y, transformValue, field, columnWidth, rowHeight, style, zIndex } = render;
10374
10106
  let textRender = this.textString();
@@ -10391,10 +10123,6 @@ class AITableCellText extends CoverCellBase {
10391
10123
  }
10392
10124
  return;
10393
10125
  });
10394
- this.isExpand = computed(() => {
10395
- const { isExpand } = this.config();
10396
- return isExpand;
10397
- });
10398
10126
  }
10399
10127
  static { this.fieldType = AITableFieldType.text; }
10400
10128
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
@@ -10732,32 +10460,329 @@ function getStartAndEndCell(selectedCells) {
10732
10460
  return { startCell, endCell };
10733
10461
  }
10734
10462
 
10735
- class AITableFieldSetting {
10736
- constructor() {
10737
- this.aiEditField = model.required();
10738
- this.aiTable = input.required();
10739
- this.aiExternalTemplate = input(null);
10740
- this.aiReferences = input();
10741
- this.isUpdate = input(false, { transform: booleanAttribute });
10742
- this.addField = output();
10743
- this.setField = output();
10744
- this.selectedFieldOption = computed(() => {
10745
- return getFieldOptionByField(this.aiTable(), this.aiEditField());
10746
- });
10747
- this.fieldMaxLength = 32;
10748
- this.validatorConfig = computed(() => {
10749
- return {
10750
- validationMessages: {
10751
- fieldName: {
10752
- required: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldNameRequired),
10753
- thyUniqueCheck: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldNameDuplicate)
10754
- }
10755
- }
10756
- };
10757
- });
10758
- this.fieldOptions = computed(() => {
10759
- const fieldOptions = getFieldOptions(this.aiTable());
10760
- return _.groupBy(fieldOptions, 'group');
10463
+ class NumberCellEditorComponent extends AbstractEditCellEditor {
10464
+ updateValue() {
10465
+ if (this.modelValue === '') {
10466
+ const fieldModel = FieldModelMap[this.field().type];
10467
+ this.modelValue = fieldModel.transformCellValue(this.modelValue, { aiTable: this.aiTable, field: this.field() });
10468
+ }
10469
+ super.update();
10470
+ this.closePopover();
10471
+ }
10472
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NumberCellEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
10473
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: NumberCellEditorComponent, isStandalone: true, selector: "number-cell-editor", host: { classAttribute: "number-cell-editor" }, usesInheritance: true, ngImport: i0, template: `<thy-input-number
10474
+ class="h-100"
10475
+ [thyAutoFocus]="true"
10476
+ [(ngModel)]="modelValue"
10477
+ (thyEnter)="updateValue()"
10478
+ (thyBlur)="updateValue()"
10479
+ /> `, isInline: true, dependencies: [{ 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: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }, { kind: "component", type: ThyInputNumber, selector: "thy-input-number", inputs: ["thyAutoFocus", "thyPlaceholder", "thyDisabled", "thyMax", "thyMin", "thyStep", "thyStepDelay", "thySize", "thyPrecision", "thySuffix"], outputs: ["thyBlur", "thyFocus", "thyStepChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10480
+ }
10481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NumberCellEditorComponent, decorators: [{
10482
+ type: Component,
10483
+ args: [{
10484
+ selector: 'number-cell-editor',
10485
+ template: `<thy-input-number
10486
+ class="h-100"
10487
+ [thyAutoFocus]="true"
10488
+ [(ngModel)]="modelValue"
10489
+ (thyEnter)="updateValue()"
10490
+ (thyBlur)="updateValue()"
10491
+ /> `,
10492
+ changeDetection: ChangeDetectionStrategy.OnPush,
10493
+ imports: [FormsModule, ThyEnterDirective, ThyInputNumber],
10494
+ host: {
10495
+ class: 'number-cell-editor'
10496
+ }
10497
+ }]
10498
+ }] });
10499
+
10500
+ class SelectOptionComponent {
10501
+ constructor() {
10502
+ this.field = input.required();
10503
+ this.displayOption = input.required();
10504
+ this.optionStyle = computed(() => {
10505
+ return this.field().settings.option_style || AITableSelectOptionStyle.text;
10506
+ });
10507
+ this.AITableSelectOptionStyle = AITableSelectOptionStyle;
10508
+ }
10509
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10510
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: SelectOptionComponent, isStandalone: true, selector: "select-option", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, displayOption: { classPropertyName: "displayOption", publicName: "displayOption", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.select-option-tag": "optionStyle === AITableSelectOptionStyle.tag" }, classAttribute: "select-option thy-text" }, ngImport: i0, template: "@if (displayOption(); as displayOption) {\n @switch (optionStyle()) {\n @case (AITableSelectOptionStyle.dot) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @case (AITableSelectOptionStyle.tag) {\n @if (displayOption.bg_color || displayOption.color || 'default'; as color) {\n <thy-tag thyTheme=\"fill\" thyShape=\"pill\" [thyColor]=\"color\">\n @if (displayOption['icon']) {\n <thy-icon class=\"text-white\" [thyIconName]=\"displayOption['icon']\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n </thy-tag>\n }\n }\n @case (AITableSelectOptionStyle.piece) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot thyShape=\"square\" [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @default {\n @if (displayOption['icon']) {\n <thy-icon [thyIconName]=\"displayOption['icon']\" [style.color]=\"displayOption.color\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n }\n}\n", dependencies: [{ kind: "component", type: ThyTag, selector: "thy-tag,[thyTag]", inputs: ["thyTag", "thyShape", "thyColor", "thyTheme", "thySize", "thyHoverable"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: ThyDot, selector: "thy-dot,[thy-dot],[thyDot]", inputs: ["thyColor", "thySize", "thyTheme", "thyShape"] }, { kind: "component", type: ThyFlexibleText, selector: "thy-flexible-text,[thyFlexibleText]", inputs: ["thyTooltipTrigger", "thyContainerClass", "thyTooltipContent", "thyTooltipPlacement", "thyTooltipOffset"], exportAs: ["thyFlexibleText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10511
+ }
10512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionComponent, decorators: [{
10513
+ type: Component,
10514
+ args: [{ selector: 'select-option', changeDetection: ChangeDetectionStrategy.OnPush, host: {
10515
+ class: 'select-option thy-text',
10516
+ '[class.select-option-tag]': 'optionStyle === AITableSelectOptionStyle.tag'
10517
+ }, imports: [ThyTag, ThyIcon, ThyTooltipModule, ThyDot, ThyFlexibleText], template: "@if (displayOption(); as displayOption) {\n @switch (optionStyle()) {\n @case (AITableSelectOptionStyle.dot) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @case (AITableSelectOptionStyle.tag) {\n @if (displayOption.bg_color || displayOption.color || 'default'; as color) {\n <thy-tag thyTheme=\"fill\" thyShape=\"pill\" [thyColor]=\"color\">\n @if (displayOption['icon']) {\n <thy-icon class=\"text-white\" [thyIconName]=\"displayOption['icon']\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n </thy-tag>\n }\n }\n @case (AITableSelectOptionStyle.piece) {\n @if (displayOption.bg_color || displayOption.color; as color) {\n <thy-dot thyShape=\"square\" [thyColor]=\"color\" [thySize]=\"'md'\" class=\"mr-2\"></thy-dot>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n @default {\n @if (displayOption['icon']) {\n <thy-icon [thyIconName]=\"displayOption['icon']\" [style.color]=\"displayOption.color\"></thy-icon>\n }\n <span thyFlexibleText [thyTooltipContent]=\"displayOption.text\">{{ displayOption.text }}</span>\n }\n }\n}\n" }]
10518
+ }] });
10519
+
10520
+ class SelectCellEditorComponent extends AbstractEditCellEditor {
10521
+ get isMultiple() {
10522
+ return !!this.field().settings.is_multiple;
10523
+ }
10524
+ constructor() {
10525
+ super();
10526
+ this.selectOptions = computed(() => {
10527
+ return this.field().settings.options;
10528
+ });
10529
+ this.preset = computed(() => {
10530
+ return this.field().settings.is_multiple && this.field().settings.option_style === AITableSelectOptionStyle.tag ? 'tag' : '';
10531
+ });
10532
+ }
10533
+ ngOnInit() {
10534
+ this.modelValue = computed(() => {
10535
+ const value = AITableQueries.getFieldValue(this.aiTable, [this.record()._id, this.field()._id]);
10536
+ if (!this.isMultiple) {
10537
+ return value?.length > 0 ? value[0] : null;
10538
+ }
10539
+ return value || [];
10540
+ })();
10541
+ }
10542
+ onOpenChange(value) {
10543
+ if (!value) {
10544
+ this.closePopover();
10545
+ }
10546
+ }
10547
+ onModelChange(event) {
10548
+ this.updateValueFn();
10549
+ }
10550
+ updateValueFn() {
10551
+ const value = (this.isMultiple ? this.modelValue : (this.modelValue && [this.modelValue]) || []);
10552
+ const originValue = AITableQueries.getFieldValue(this.aiTable, [this.record()._id, this.field()._id]) || [];
10553
+ if (value.length !== originValue.length || !value.every((v, i) => v === originValue[i])) {
10554
+ this.updateFieldValues.emit([
10555
+ {
10556
+ value: value,
10557
+ path: [this.record()._id, this.field()._id]
10558
+ }
10559
+ ]);
10560
+ }
10561
+ }
10562
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10563
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: SelectCellEditorComponent, isStandalone: true, selector: "select-cell-editor", host: { classAttribute: "d-block h-100 select-cell-editor" }, usesInheritance: true, ngImport: i0, template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option\n [thyValue]=\"option._id\"\n [hidden]=\"!!option.is_disabled\"\n [thyRawValue]=\"option\"\n [thyShowOptionCustom]=\"true\"\n [thyLabelText]=\"option.text\"\n >\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n", dependencies: [{ kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange", "visibleChange"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ThyEmptyModule }, { kind: "ngmodule", type: ThyFormModule }, { 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: "ngmodule", type: ThySelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10564
+ }
10565
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectCellEditorComponent, decorators: [{
10566
+ type: Component,
10567
+ args: [{ selector: 'select-cell-editor', changeDetection: ChangeDetectionStrategy.OnPush, host: {
10568
+ class: 'd-block h-100 select-cell-editor'
10569
+ }, imports: [
10570
+ ThySelect,
10571
+ ThyOption,
10572
+ ThyTooltipModule,
10573
+ SelectOptionComponent,
10574
+ CommonModule,
10575
+ ThyEmptyModule,
10576
+ ThyFormModule,
10577
+ FormsModule,
10578
+ ThySelectModule
10579
+ ], template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option\n [thyValue]=\"option._id\"\n [hidden]=\"!!option.is_disabled\"\n [thyRawValue]=\"option\"\n [thyShowOptionCustom]=\"true\"\n [thyLabelText]=\"option.text\"\n >\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n" }]
10580
+ }], ctorParameters: () => [] });
10581
+
10582
+ class TextCellEditorComponent extends AbstractEditCellEditor {
10583
+ constructor() {
10584
+ super();
10585
+ this.render2 = inject(Renderer2);
10586
+ this.maxHeight = 148;
10587
+ this.minHeight = 24;
10588
+ this.isSelectAll = input(false);
10589
+ }
10590
+ ngAfterViewInit() {
10591
+ setTimeout(() => {
10592
+ this.updateStyle();
10593
+ this.handleSelectAll();
10594
+ }, 0);
10595
+ }
10596
+ updateStyle() {
10597
+ const textarea = this.elementRef.nativeElement.querySelector('textarea');
10598
+ if (textarea) {
10599
+ this.render2.setStyle(textarea, 'height', 'auto');
10600
+ const scrollHeight = textarea.scrollHeight;
10601
+ const newHeight = Math.max(this.minHeight, Math.min(scrollHeight, this.maxHeight)) + 4;
10602
+ this.render2.setStyle(textarea, 'max-height', `${this.maxHeight}px`);
10603
+ this.render2.setStyle(textarea, 'height', `${newHeight}px`);
10604
+ this.render2.setStyle(textarea, 'resize', 'none');
10605
+ }
10606
+ }
10607
+ handleSelectAll() {
10608
+ if (this.isSelectAll()) {
10609
+ const textarea = this.elementRef.nativeElement.querySelector('textarea');
10610
+ textarea.select();
10611
+ }
10612
+ }
10613
+ valueChange() {
10614
+ this.updateStyle();
10615
+ }
10616
+ updateValue() {
10617
+ super.update();
10618
+ this.closePopover();
10619
+ }
10620
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: TextCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10621
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: TextCellEditorComponent, isStandalone: true, selector: "text-cell-editor", inputs: { isSelectAll: { classPropertyName: "isSelectAll", publicName: "isSelectAll", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "text-cell-editor" }, usesInheritance: true, ngImport: i0, template: `
10622
+ <textarea
10623
+ #textarea
10624
+ placeholder=""
10625
+ rows="1"
10626
+ thyInput
10627
+ [thyAutofocus]="true"
10628
+ [(ngModel)]="modelValue"
10629
+ (ngModelChange)="valueChange()"
10630
+ (thyEnter)="updateValue()"
10631
+ (blur)="updateValue()"
10632
+ ></textarea>
10633
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: "directive", type: ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutofocus", "thyAutoSelect"] }, { kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10634
+ }
10635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: TextCellEditorComponent, decorators: [{
10636
+ type: Component,
10637
+ args: [{
10638
+ selector: 'text-cell-editor',
10639
+ template: `
10640
+ <textarea
10641
+ #textarea
10642
+ placeholder=""
10643
+ rows="1"
10644
+ thyInput
10645
+ [thyAutofocus]="true"
10646
+ [(ngModel)]="modelValue"
10647
+ (ngModelChange)="valueChange()"
10648
+ (thyEnter)="updateValue()"
10649
+ (blur)="updateValue()"
10650
+ ></textarea>
10651
+ `,
10652
+ changeDetection: ChangeDetectionStrategy.OnPush,
10653
+ imports: [FormsModule, ThyAutofocusDirective, ThyInputDirective, ThyEnterDirective],
10654
+ host: {
10655
+ class: 'text-cell-editor'
10656
+ }
10657
+ }]
10658
+ }], ctorParameters: () => [] });
10659
+
10660
+ class SelectOptionPipe {
10661
+ transform(_id, options) {
10662
+ return options?.length && options.find((item) => item._id === _id);
10663
+ }
10664
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10665
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" }); }
10666
+ }
10667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionPipe, decorators: [{
10668
+ type: Pipe,
10669
+ args: [{
10670
+ name: 'selectOption'
10671
+ }]
10672
+ }] });
10673
+ class SelectOptionsPipe {
10674
+ transform(ids, options = []) {
10675
+ return ((ids?.length &&
10676
+ ids.map((id) => {
10677
+ return options.find((item) => item._id === id);
10678
+ })) ||
10679
+ []);
10680
+ }
10681
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10682
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionsPipe, isStandalone: true, name: "selectOptions" }); }
10683
+ }
10684
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectOptionsPipe, decorators: [{
10685
+ type: Pipe,
10686
+ args: [{
10687
+ name: 'selectOptions'
10688
+ }]
10689
+ }] });
10690
+ class IsSelectRecordPipe {
10691
+ transform(recordId, selection) {
10692
+ return selection.selectedRecords.has(recordId);
10693
+ }
10694
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: IsSelectRecordPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10695
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: IsSelectRecordPipe, isStandalone: true, name: "isSelectRecord" }); }
10696
+ }
10697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: IsSelectRecordPipe, decorators: [{
10698
+ type: Pipe,
10699
+ args: [{
10700
+ name: 'isSelectRecord'
10701
+ }]
10702
+ }] });
10703
+ class UserPipe {
10704
+ transform(values, references) {
10705
+ return ((values.length &&
10706
+ values.map((item) => {
10707
+ return references.members[item] || {};
10708
+ })) ||
10709
+ []);
10710
+ }
10711
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: UserPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10712
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: UserPipe, isStandalone: true, name: "user" }); }
10713
+ }
10714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: UserPipe, decorators: [{
10715
+ type: Pipe,
10716
+ args: [{
10717
+ name: 'user'
10718
+ }]
10719
+ }] });
10720
+ class SelectSettingPipe {
10721
+ transform(settings) {
10722
+ return settings;
10723
+ }
10724
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10725
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: SelectSettingPipe, isStandalone: true, name: "selectSetting" }); }
10726
+ }
10727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: SelectSettingPipe, decorators: [{
10728
+ type: Pipe,
10729
+ args: [{
10730
+ name: 'selectSetting'
10731
+ }]
10732
+ }] });
10733
+ class MemberSettingPipe {
10734
+ transform(settings) {
10735
+ return settings;
10736
+ }
10737
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: MemberSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10738
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: MemberSettingPipe, isStandalone: true, name: "memberSetting" }); }
10739
+ }
10740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: MemberSettingPipe, decorators: [{
10741
+ type: Pipe,
10742
+ args: [{
10743
+ name: 'memberSetting'
10744
+ }]
10745
+ }] });
10746
+ class AITableFieldIsSameOptionPipe {
10747
+ transform(fieldOption, field) {
10748
+ return isSameFieldOption(fieldOption, field);
10749
+ }
10750
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldIsSameOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10751
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldIsSameOptionPipe, isStandalone: true, name: "fieldIsSameOption" }); }
10752
+ }
10753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldIsSameOptionPipe, decorators: [{
10754
+ type: Pipe,
10755
+ args: [{
10756
+ name: 'fieldIsSameOption'
10757
+ }]
10758
+ }] });
10759
+
10760
+ class AITableFieldSetting {
10761
+ constructor() {
10762
+ this.aiEditField = model.required();
10763
+ this.aiTable = input.required();
10764
+ this.aiExternalTemplate = input(null);
10765
+ this.aiReferences = input();
10766
+ this.isUpdate = input(false, { transform: booleanAttribute });
10767
+ this.addField = output();
10768
+ this.setField = output();
10769
+ this.selectedFieldOption = computed(() => {
10770
+ return getFieldOptionByField(this.aiTable(), this.aiEditField());
10771
+ });
10772
+ this.fieldMaxLength = 32;
10773
+ this.validatorConfig = computed(() => {
10774
+ return {
10775
+ validationMessages: {
10776
+ fieldName: {
10777
+ required: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldNameRequired),
10778
+ thyUniqueCheck: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldNameDuplicate)
10779
+ }
10780
+ }
10781
+ };
10782
+ });
10783
+ this.fieldOptions = computed(() => {
10784
+ const fieldOptions = getFieldOptions(this.aiTable());
10785
+ return _.groupBy(fieldOptions, 'group');
10761
10786
  });
10762
10787
  this.aITableFieldType = AITableFieldType;
10763
10788
  this.isMultipleMember = false;
@@ -10900,7 +10925,8 @@ class AITableGridSelectionService {
10900
10925
  activeCell: null,
10901
10926
  expandCell: null,
10902
10927
  editingCell: null,
10903
- selectAllState: AITableSelectAllState.none
10928
+ selectAllState: AITableSelectAllState.none,
10929
+ expandCellInfo: null
10904
10930
  });
10905
10931
  }
10906
10932
  setActiveCell(activeCell) {
@@ -11418,6 +11444,7 @@ class AITableGridBase {
11418
11444
  this.aiBuildRenderDataFn = input();
11419
11445
  this.aiGetI18nTextByKey = input();
11420
11446
  this.aiKeywords = input();
11447
+ this.aiFrozenColumnCountFn = input();
11421
11448
  this.AITableFieldType = AITableFieldType;
11422
11449
  this.AITableSelectOptionStyle = AITableSelectOptionStyle;
11423
11450
  this.isSelectedAll = computed(() => {
@@ -11537,7 +11564,7 @@ class AITableGridBase {
11537
11564
  }
11538
11565
  }
11539
11566
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11540
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", 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 }, aiFieldsSizeMap: { classPropertyName: "aiFieldsSizeMap", publicName: "aiFieldsSizeMap", 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 }, aiMaxFields: { classPropertyName: "aiMaxFields", publicName: "aiMaxFields", isSignal: true, isRequired: false, transformFunction: null }, aiMaxRecords: { classPropertyName: "aiMaxRecords", publicName: "aiMaxRecords", isSignal: true, isRequired: false, transformFunction: null }, aiMaxSelectOptions: { classPropertyName: "aiMaxSelectOptions", publicName: "aiMaxSelectOptions", 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 }, aiGetI18nTextByKey: { classPropertyName: "aiGetI18nTextByKey", publicName: "aiGetI18nTextByKey", isSignal: true, isRequired: false, transformFunction: null }, aiKeywords: { classPropertyName: "aiKeywords", publicName: "aiKeywords", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiRecords: "aiRecordsChange", aiFields: "aiFieldsChange", aiFieldsSizeMap: "aiFieldsSizeMapChange", aiTableInitialized: "aiTableInitialized", aiAddRecord: "aiAddRecord", aiAddField: "aiAddField", aiMoveField: "aiMoveField", aiUpdateFieldValues: "aiUpdateFieldValues", aiSetField: "aiSetField", aiSetFieldWidth: "aiSetFieldWidth", aiSetFieldStatType: "aiSetFieldStatType", aiMoveRecords: "aiMoveRecords", aiClick: "aiClick", aiDbClick: "aiDbClick" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11567
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", 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 }, aiFieldsSizeMap: { classPropertyName: "aiFieldsSizeMap", publicName: "aiFieldsSizeMap", 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 }, aiMaxFields: { classPropertyName: "aiMaxFields", publicName: "aiMaxFields", isSignal: true, isRequired: false, transformFunction: null }, aiMaxRecords: { classPropertyName: "aiMaxRecords", publicName: "aiMaxRecords", isSignal: true, isRequired: false, transformFunction: null }, aiMaxSelectOptions: { classPropertyName: "aiMaxSelectOptions", publicName: "aiMaxSelectOptions", 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 }, aiGetI18nTextByKey: { classPropertyName: "aiGetI18nTextByKey", publicName: "aiGetI18nTextByKey", isSignal: true, isRequired: false, transformFunction: null }, aiKeywords: { classPropertyName: "aiKeywords", publicName: "aiKeywords", isSignal: true, isRequired: false, transformFunction: null }, aiFrozenColumnCountFn: { classPropertyName: "aiFrozenColumnCountFn", publicName: "aiFrozenColumnCountFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiRecords: "aiRecordsChange", aiFields: "aiFieldsChange", aiFieldsSizeMap: "aiFieldsSizeMapChange", aiTableInitialized: "aiTableInitialized", aiAddRecord: "aiAddRecord", aiAddField: "aiAddField", aiMoveField: "aiMoveField", aiUpdateFieldValues: "aiUpdateFieldValues", aiSetField: "aiSetField", aiSetFieldWidth: "aiSetFieldWidth", aiSetFieldStatType: "aiSetFieldStatType", aiMoveRecords: "aiMoveRecords", aiClick: "aiClick", aiDbClick: "aiDbClick" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11541
11568
  }
11542
11569
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridBase, decorators: [{
11543
11570
  type: Component,
@@ -11878,9 +11905,16 @@ class AITableDragComponent {
11878
11905
  this.containerHeight = this.elementRef.nativeElement.offsetHeight;
11879
11906
  const moveX = e.x - (this.mouseStartPosition?.x || 0);
11880
11907
  const moveY = e.y - (this.mouseStartPosition?.y || 0);
11908
+ let direction = DragDirection.none;
11881
11909
  switch (drag.type) {
11882
11910
  case DragType.field:
11883
- this.movingColumn(drag, moveX);
11911
+ if (e.movementX > 0) {
11912
+ direction = DragDirection.right;
11913
+ }
11914
+ else if (e.movementX < 0) {
11915
+ direction = DragDirection.left;
11916
+ }
11917
+ this.movingColumn(drag, moveX, direction);
11884
11918
  break;
11885
11919
  case DragType.record:
11886
11920
  this.movingRecord(drag, moveY);
@@ -11890,19 +11924,20 @@ class AITableDragComponent {
11890
11924
  break;
11891
11925
  }
11892
11926
  }
11893
- movingColumn(drag, moveX) {
11927
+ movingColumn(drag, moveX, direction) {
11894
11928
  const aiTable = this.aiTableGridSelectionService.aiTable;
11895
11929
  const scroll = { x: this.horizontalBarElement?.scrollLeft || 0, y: 0 };
11896
11930
  const coordinate = drag.coordinate;
11897
11931
  const fields = aiTable.gridData().fields;
11898
11932
  const width = this.calculateDragWidth(fields, coordinate, drag);
11899
11933
  const visibleColumnIndexMap = aiTable.context.visibleColumnsIndexMap();
11934
+ const rowHeadWidth = aiTable.context.rowHeadWidth();
11900
11935
  const sourceColumnIndex = visibleColumnIndexMap.get(drag.sourceIds.values().next().value) || 0;
11901
11936
  const sourceColumnStartX = coordinate.getColumnOffset(sourceColumnIndex);
11902
11937
  const sourceColumnWidth = coordinate.getColumnWidth(sourceColumnIndex);
11903
- // TODO: 目前默认第一列为冻结列,后期支持设置冻结列需要处理
11904
- const isSourceColumnFrozen = sourceColumnIndex === 0;
11905
- const frozenColumnWidth = coordinate.getColumnWidth(0);
11938
+ const frozenColumnCount = aiTable.context.frozenColumnCount();
11939
+ const isSourceColumnFrozen = sourceColumnIndex === frozenColumnCount - 1;
11940
+ const frozenColumnWidth = Array.from({ length: frozenColumnCount }).reduce((acc, _, index) => acc + coordinate.getColumnWidth(index), 0);
11906
11941
  const pointerX = moveX + sourceColumnStartX;
11907
11942
  // 拖拽中心点
11908
11943
  const dragCenter = sourceColumnWidth / 2;
@@ -11932,8 +11967,8 @@ class AITableDragComponent {
11932
11967
  if ((targetColumnIndex >= 0 && (targetColumnIndex - sourceColumnIndex > 1 || targetColumnIndex - sourceColumnIndex < 0)) ||
11933
11968
  isLastColumn) {
11934
11969
  let lineLeft = targetColumnStartX - scrollPosition.x;
11935
- const lineForFrozenX = lineLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
11936
- const rectDistanceFrozenX = rectLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
11970
+ const lineForFrozenX = lineLeft - frozenColumnWidth - rowHeadWidth;
11971
+ const rectDistanceFrozenX = rectLeft - frozenColumnWidth - rowHeadWidth;
11937
11972
  if (lineForFrozenX < 0) {
11938
11973
  if (Math.abs(rectDistanceFrozenX) < dragCenter) {
11939
11974
  // 滚动中保持上一个位置
@@ -11949,6 +11984,12 @@ class AITableDragComponent {
11949
11984
  };
11950
11985
  return;
11951
11986
  }
11987
+ if (isSourceColumnFrozen) {
11988
+ // 拖拽的列是冻结列,且目标列在冻结列左侧,不显示辅助线
11989
+ this.resetAuxiliaryLine();
11990
+ this.draggedData = null;
11991
+ return;
11992
+ }
11952
11993
  }
11953
11994
  this.setAuxiliaryLineStyles({
11954
11995
  width: '2px',
@@ -11973,6 +12014,12 @@ class AITableDragComponent {
11973
12014
  }
11974
12015
  };
11975
12016
  updateTargetAndLine(currentRectLeft, newScrollPosition);
12017
+ if (isSourceColumnFrozen &&
12018
+ (direction === DragDirection.right || direction === DragDirection.none) &&
12019
+ currentRectLeft < frozenColumnWidth + rowHeadWidth + AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD) {
12020
+ // 拖拽的列是冻结列,方向是向右,且当前列在冻结列左侧,不滚动
12021
+ return;
12022
+ }
11976
12023
  this.scrollControllerService.scroll({
11977
12024
  container: {
11978
12025
  width: this.containerWidth,
@@ -11989,7 +12036,7 @@ class AITableDragComponent {
11989
12036
  horizontalElement: this.horizontalBarElement
11990
12037
  },
11991
12038
  frozenArea: {
11992
- left: frozenColumnWidth + aiTable.context.rowHeadWidth()
12039
+ left: frozenColumnWidth + rowHeadWidth
11993
12040
  },
11994
12041
  edgeThreshold: {
11995
12042
  left: AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD,
@@ -12214,7 +12261,14 @@ class AITableGrid extends AITableGridBase {
12214
12261
  this.isPopoverOpen = false;
12215
12262
  this.fieldHeadHeight = AI_TABLE_FIELD_HEAD_HEIGHT;
12216
12263
  this.containerRect = signal({ width: 0, height: 0 });
12217
- this.frozenColumnCount = signal(1);
12264
+ this.frozenColumnCount = computed(() => {
12265
+ const containerWidth = this.containerRect().width;
12266
+ const aiFrozenColumnCountFn = this.aiFrozenColumnCountFn();
12267
+ if (aiFrozenColumnCountFn) {
12268
+ return aiFrozenColumnCountFn(containerWidth);
12269
+ }
12270
+ return AI_TABLE_MIN_FROZEN_COLUMN_COUNT;
12271
+ });
12218
12272
  this.hasContainerRect = computed(() => {
12219
12273
  return this.containerRect().width > 0 && this.containerRect().height > 0;
12220
12274
  });
@@ -12421,6 +12475,7 @@ class AITableGrid extends AITableGridBase {
12421
12475
  }
12422
12476
  initContext() {
12423
12477
  this.aiTable.context = new RendererContext({
12478
+ containerRect: this.containerRect,
12424
12479
  rowHeadWidth: computed(() => {
12425
12480
  const aiFieldConfig = this.aiFieldConfig();
12426
12481
  let width = AI_TABLE_ROW_HEAD_WIDTH_AND_DRAG_ICON_WIDTH;
@@ -12556,6 +12611,7 @@ class AITableGrid extends AITableGridBase {
12556
12611
  if (expandRecordId !== recordId || expandFieldId !== fieldId) {
12557
12612
  const field = this.aiTable.fieldsMap()[fieldId];
12558
12613
  if (field.type === AITableFieldType.text) {
12614
+ this.aiTableGridSelectionService.clearSelection();
12559
12615
  expandCell(this.aiTable, [recordId, fieldId]);
12560
12616
  }
12561
12617
  else {
@@ -13067,5 +13123,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
13067
13123
  * Generated bundle index. Do not edit.
13068
13124
  */
13069
13125
 
13070
- export { AITable, AITableActionIcon, AITableAddField, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableBackground, AITableCellAttachment, AITableCellCheckbox, AITableCellLink, AITableCellProgress, AITableCellRate, AITableCellRichText, AITableCellText, AITableCells, AITableCheckType, AITableColumnHeads, AITableContextMenu, AITableDomGrid, AITableFieldHead, AITableFieldIcon, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFrozenCells, AITableFrozenColumnHeads, AITableFrozenFieldShadow, AITableFrozenPlaceholderCells, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridI18nText, AITableGridSelectionService, AITableHoverRowHeads, AITableIcon, AITableMemberType, AITableMouseDownType, AITableOtherRows, AITablePlaceholderCells, AITableQueries, AITableRenderer, AITableRowType, AITableScrollableGroup, AITableSelectAllState, AITableTextComponent, AI_TABLE_ACTION_COMMON_RADIUS, AI_TABLE_ACTION_COMMON_RIGHT_PADDING, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD, AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD, AI_TABLE_AUTO_SCROLL_RIGHT_THRESHOLD, AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_ATTACHMENT_ADD, AI_TABLE_CELL_ATTACHMENT_FILE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EDIT, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, AI_TABLE_CELL_FIELD_ITEM_HEIGHT, AI_TABLE_CELL_LINE_BORDER, AI_TABLE_CELL_MAX_ROW_COUNT, AI_TABLE_CELL_MEMBER_ITEM_HEIGHT, AI_TABLE_CELL_MEMBER_ITEM_PADDING, AI_TABLE_CELL_MEMBER_MAX_HEIGHT, AI_TABLE_CELL_MULTI_DOT_RADIUS, AI_TABLE_CELL_MULTI_ITEM_MARGIN_LEFT, AI_TABLE_CELL_MULTI_ITEM_MARGIN_TOP, AI_TABLE_CELL_MULTI_ITEM_MIN_WIDTH, AI_TABLE_CELL_MULTI_PADDING_LEFT, AI_TABLE_CELL_MULTI_PADDING_TOP, AI_TABLE_CELL_PADDING, AI_TABLE_COMMON_FONT_SIZE, AI_TABLE_DEFAULT_COLUMN_WIDTH, AI_TABLE_DOT_RADIUS, AI_TABLE_FIELD_ADD_BUTTON, AI_TABLE_FIELD_ADD_BUTTON_WIDTH, AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_HEIGHT, AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, AI_TABLE_FIELD_HEAD_MORE, AI_TABLE_FIELD_HEAD_OPACITY_LINE, AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX, AI_TABLE_FIELD_HEAD_TEXT_MIN_WIDTH, AI_TABLE_FIELD_ITEM_MARGIN_RIGHT, AI_TABLE_FIELD_MAX_WIDTH, AI_TABLE_FIELD_MIDDLE_WIDTH, AI_TABLE_FIELD_MINI_WIDTH, AI_TABLE_FIELD_MIN_WIDTH, AI_TABLE_FIELD_STAT_BG, AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT, AI_TABLE_FIELD_STAT_INNER_HEIGHT, AI_TABLE_FILE_ICON_ITEM_HEIGHT, AI_TABLE_FILE_ICON_SIZE, AI_TABLE_FILL_HANDLE, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, AI_TABLE_INDEX_FIELD_TEXT, AI_TABLE_MEMBER_AVATAR_SIZE, AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT, AI_TABLE_MEMBER_ITEM_PADDING_RIGHT, AI_TABLE_MIN_TEXT_WIDTH, AI_TABLE_OFFSET, AI_TABLE_OPTION_ITEM_FONT_SIZE, AI_TABLE_OPTION_ITEM_HEIGHT, AI_TABLE_OPTION_ITEM_PADDING, AI_TABLE_OPTION_ITEM_RADIUS, AI_TABLE_OPTION_MULTI_ITEM_FONT_SIZE, AI_TABLE_PIECE_RADIUS, AI_TABLE_PIECE_WIDTH, AI_TABLE_POPOVER_LEFT_OFFSET, AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS, AI_TABLE_PROGRESS_BAR_HEIGHT, AI_TABLE_PROGRESS_BAR_POINTER_HEIGHT, AI_TABLE_PROGRESS_BAR_POINTER_WIDTH, AI_TABLE_PROGRESS_BAR_RADIUS, AI_TABLE_PROGRESS_TEXT_WIDTH, AI_TABLE_RATE_MAX, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_DRAG, AI_TABLE_ROW_DRAG_ICON_WIDTH, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEAD_WIDTH_AND_DRAG_ICON_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_SCROLL_BAR_SIZE, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AI_TABLE_TEXT_LINE_HEIGHT, AbstractEditCellEditor, AddOutlinedPath, AngleDownPath, AttachmentField, AttachmentPath, CellDrawer, Check, Colors, ColumnCalendarFilledPath, ColumnCheckboxFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnRichTextFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, CoverCellBase, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DateField, DepartmentOutlinedPath, Drawer, EditPath, FONT_SIZE_SM, FieldModelMap, IconPathMap, IsSelectRecordPipe, KO_CONTAINER_TOKEN, KoComponent, KoContainer, KoShape, KoShapeTypes, KoStage, LinkCellEditorComponent, LinkField, MIN_COLUMN_WIDTH, MemberField, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, NumberField, ProgressField, RateField, RendererContext, RichTextField, RowDragPath, RowHeight, SelectCellEditorComponent, SelectField, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextField, TextMeasure, Unchecked, UserPipe, WebOutlinedPath, aiTableFragmentAttribute, aiTableImageConfigToKonvaConfig, aiTableRectConfigToKonvaConfig, aiTableTextConfigToKonvaConfig, applyNodeProps, buildClipboardData, buildGridData, buildGridLinearRows, castToString, cellDrawer, clearCells, compareNumber, compareOption, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, createListener, dragFillHighlightArea, drawer, expandCell, extractLinkUrl, extractText, generateNewName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getCoverCell, getDateFieldValues, getDefaultFieldOptions, getDefaultFieldValue, getDefaultI18nTextByKey, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getFieldOptionMap, getFieldOptions, getFieldValue, getFileThumbnailSvgString, getFillDirection, getHoverEditorBoxOffset, getHoverEditorSpace, getI18nTextByKey, getMousePosition, getName, getOptionsByFieldAndRecords, getPlaceHolderCellsConfigs, getStartAndEndCell, getSystemFieldValue, getTargetName, getTextWidth, getVisibleRangeInfo, graphemeSplitter, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isActiveCell, isArrayField, isCellMatchKeywords, isClipboardReadSupported, isClipboardReadTextSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isDateFiled, isEmptyOrNot, isMac, isMeetFilter, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isVirtualKey, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, performFill, processPastedValueForSelect, readFromClipboard, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, statDateRangeOfDays, statDateRangeOfMonths, statEarliestTime, statLatestTime, stringInclude, textDataCache, toAttachmentFieldValue, toDateFieldValue, toLinkFieldValue, toMemberFieldValue, toNumberFieldValue, toProgressFieldValue, toRateFieldValue, toRichTextFieldValue, toSelectFieldValue, toTextFieldValue, transformToCellText, updatePicture, writeToAITable, writeToClipboard, zhIntlCollator };
13126
+ export { AITable, AITableActionIcon, AITableAddField, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableBackground, AITableCellAttachment, AITableCellCheckbox, AITableCellLink, AITableCellProgress, AITableCellRate, AITableCellRichText, AITableCellText, AITableCells, AITableCheckType, AITableColumnHeads, AITableContextMenu, AITableDomGrid, AITableFieldHead, AITableFieldIcon, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFrozenCells, AITableFrozenColumnHeads, AITableFrozenFieldShadow, AITableFrozenPlaceholderCells, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridI18nText, AITableGridSelectionService, AITableHoverRowHeads, AITableIcon, AITableMemberType, AITableMouseDownType, AITableOtherRows, AITablePlaceholderCells, AITableQueries, AITableRenderer, AITableRowType, AITableScrollableGroup, AITableSelectAllState, AITableTextComponent, AI_TABLE_ACTION_COMMON_RADIUS, AI_TABLE_ACTION_COMMON_RIGHT_PADDING, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD, AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD, AI_TABLE_AUTO_SCROLL_RIGHT_THRESHOLD, AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_ATTACHMENT_ADD, AI_TABLE_CELL_ATTACHMENT_FILE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EDIT, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, AI_TABLE_CELL_FIELD_ITEM_HEIGHT, AI_TABLE_CELL_LINE_BORDER, AI_TABLE_CELL_MAX_ROW_COUNT, AI_TABLE_CELL_MEMBER_ITEM_HEIGHT, AI_TABLE_CELL_MEMBER_ITEM_PADDING, AI_TABLE_CELL_MEMBER_MAX_HEIGHT, AI_TABLE_CELL_MULTI_DOT_RADIUS, AI_TABLE_CELL_MULTI_ITEM_MARGIN_LEFT, AI_TABLE_CELL_MULTI_ITEM_MARGIN_TOP, AI_TABLE_CELL_MULTI_ITEM_MIN_WIDTH, AI_TABLE_CELL_MULTI_PADDING_LEFT, AI_TABLE_CELL_MULTI_PADDING_TOP, AI_TABLE_CELL_PADDING, AI_TABLE_COMMON_FONT_SIZE, AI_TABLE_DEFAULT_COLUMN_WIDTH, AI_TABLE_DOT_RADIUS, AI_TABLE_FIELD_ADD_BUTTON, AI_TABLE_FIELD_ADD_BUTTON_WIDTH, AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_HEIGHT, AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, AI_TABLE_FIELD_HEAD_MORE, AI_TABLE_FIELD_HEAD_OPACITY_LINE, AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX, AI_TABLE_FIELD_HEAD_TEXT_MIN_WIDTH, AI_TABLE_FIELD_ITEM_MARGIN_RIGHT, AI_TABLE_FIELD_MAX_WIDTH, AI_TABLE_FIELD_MIDDLE_WIDTH, AI_TABLE_FIELD_MINI_WIDTH, AI_TABLE_FIELD_MIN_WIDTH, AI_TABLE_FIELD_STAT_BG, AI_TABLE_FIELD_STAT_CONTAINER_HEIGHT, AI_TABLE_FIELD_STAT_INNER_HEIGHT, AI_TABLE_FILE_ICON_ITEM_HEIGHT, AI_TABLE_FILE_ICON_SIZE, AI_TABLE_FILL_HANDLE, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, AI_TABLE_INDEX_FIELD_TEXT, AI_TABLE_MEMBER_AVATAR_SIZE, AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT, AI_TABLE_MEMBER_ITEM_PADDING_RIGHT, AI_TABLE_MIN_TEXT_WIDTH, AI_TABLE_OFFSET, AI_TABLE_OPTION_ITEM_FONT_SIZE, AI_TABLE_OPTION_ITEM_HEIGHT, AI_TABLE_OPTION_ITEM_PADDING, AI_TABLE_OPTION_ITEM_RADIUS, AI_TABLE_OPTION_MULTI_ITEM_FONT_SIZE, AI_TABLE_PIECE_RADIUS, AI_TABLE_PIECE_WIDTH, AI_TABLE_POPOVER_LEFT_OFFSET, AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS, AI_TABLE_PROGRESS_BAR_HEIGHT, AI_TABLE_PROGRESS_BAR_POINTER_HEIGHT, AI_TABLE_PROGRESS_BAR_POINTER_WIDTH, AI_TABLE_PROGRESS_BAR_RADIUS, AI_TABLE_PROGRESS_TEXT_WIDTH, AI_TABLE_RATE_MAX, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_DRAG, AI_TABLE_ROW_DRAG_ICON_WIDTH, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEAD_WIDTH_AND_DRAG_ICON_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_SCROLL_BAR_SIZE, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AI_TABLE_TEXT_LINE_HEIGHT, AbstractEditCellEditor, AddOutlinedPath, AngleDownPath, AttachmentField, AttachmentPath, CellDrawer, Check, Colors, ColumnCalendarFilledPath, ColumnCheckboxFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnRichTextFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, CoverCellBase, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DateField, DepartmentOutlinedPath, Drawer, EditPath, FONT_SIZE_SM, FieldModelMap, IconPathMap, IsSelectRecordPipe, KO_CONTAINER_TOKEN, KoComponent, KoContainer, KoShape, KoShapeTypes, KoStage, LinkCellEditorComponent, LinkField, MIN_COLUMN_WIDTH, MemberField, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, NumberField, ProgressField, RateField, RendererContext, RichTextField, RowDragPath, RowHeight, SelectCellEditorComponent, SelectField, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextField, TextMeasure, Unchecked, UserPipe, WebOutlinedPath, aiTableFragmentAttribute, aiTableImageConfigToKonvaConfig, aiTableRectConfigToKonvaConfig, aiTableTextConfigToKonvaConfig, applyNodeProps, buildClipboardData, buildGridData, buildGridLinearRows, castToString, cellDrawer, clearCells, compareNumber, compareOption, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, createListener, dragFillHighlightArea, drawer, expandCell, extractLinkUrl, extractText, generateNewName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getCoverCell, getDateFieldValues, getDefaultFieldOptions, getDefaultFieldValue, getDefaultI18nTextByKey, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getFieldOptionMap, getFieldOptions, getFieldValue, getFileThumbnailSvgString, getFillDirection, getHoverEditorBoxOffset, getHoverEditorSpace, getI18nTextByKey, getMousePosition, getName, getOptionsByFieldAndRecords, getPlaceHolderCellsConfigs, getStartAndEndCell, getSystemFieldValue, getTargetName, getTextWidth, getVisibleRangeInfo, graphemeSplitter, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isActiveCell, isArrayField, isCellMatchKeywords, isClipboardReadSupported, isClipboardReadTextSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isDateFiled, isEmptyOrNot, isMac, isMeetFilter, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isVirtualKey, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, performFill, processPastedValueForSelect, readFromClipboard, scrollMax, setExpandCellInfo, setMouseStyle, shortIdCreator, shortIdsCreator, statDateRangeOfDays, statDateRangeOfMonths, statEarliestTime, statLatestTime, stringInclude, textDataCache, toAttachmentFieldValue, toDateFieldValue, toLinkFieldValue, toMemberFieldValue, toNumberFieldValue, toProgressFieldValue, toRateFieldValue, toRichTextFieldValue, toSelectFieldValue, toTextFieldValue, transformToCellText, updatePicture, writeToAITable, writeToClipboard, zhIntlCollator };
13071
13127
  //# sourceMappingURL=ai-table-grid.mjs.map