@ai-table/grid 0.1.32 → 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,436 +1873,151 @@ 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
- }] });
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
+ });
1887
+ }
1888
+ if (isAddingVisible && !row._id) {
1889
+ linearRows.push({
1890
+ type: AITableRowType.add,
1891
+ _id: ''
1892
+ });
1893
+ }
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
+ };
1907
1912
 
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 }); }
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;
1919
1920
  }
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;
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;
1931
1934
  }
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
- });
1935
+ const toText = fieldRenderers[field.type]?.toText;
1936
+ if (!toText) {
1937
+ return cellValue;
1940
1938
  }
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
- })();
1939
+ const cellText = toText(field, cellValue);
1940
+ if (cellText == null) {
1941
+ return cellValue;
1949
1942
  }
1950
- onOpenChange(value) {
1951
- if (!value) {
1952
- this.closePopover();
1953
- }
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 '';
1954
1954
  }
1955
- onModelChange(event) {
1956
- this.updateValueFn();
1955
+ name = name.trim();
1956
+ if (UNIFIED_IDEOGRAPHS_REGEX.test(name) && name.length > 2) {
1957
+ return name.slice(name.length - 2);
1957
1958
  }
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
- ]);
1968
- }
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();
1969
1962
  }
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 [thyValue]=\"option._id\" [thyRawValue]=\"option\" [thyShowOptionCustom]=\"true\" [thyLabelText]=\"option.text\">\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 }); }
1963
+ return name.length > 2 ? name.slice(0, 2).toUpperCase() : name.toUpperCase();
1964
+ }
1965
+ function getAvatarBgColor(name) {
1966
+ if (!name) {
1967
+ return;
1968
+ }
1969
+ const colors = ['#56abfb', '#5dcfff', '#84e17e', '#73d897', '#ff9f73', '#fa8888', '#fb7fb7', '#9a7ef4', '#868af6'];
1970
+ const nameArray = name.split('');
1971
+ const code = name && name.length > 0
1972
+ ? nameArray.reduce(function (result, item) {
1973
+ result.value += item.charCodeAt(0);
1974
+ return result;
1975
+ }, { value: 0 }).value
1976
+ : 0;
1977
+ return colors[code % 9];
1978
+ }
1979
+ function expandCell(aiTable, path) {
1980
+ const [recordId, fieldId] = path;
1981
+ aiTable.selection.set({
1982
+ ...aiTable.selection(),
1983
+ activeCell: [recordId, fieldId],
1984
+ selectedCells: new Set([`${recordId}:${fieldId}`]),
1985
+ expandCell: [recordId, fieldId]
1986
+ });
1987
+ }
1988
+ function setExpandCellInfo(aiTable, expandCellInfo) {
1989
+ aiTable.selection.set({
1990
+ ...aiTable.selection(),
1991
+ expandCellInfo: expandCellInfo
1992
+ });
1972
1993
  }
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 [thyValue]=\"option._id\" [thyRawValue]=\"option\" [thyShowOptionCustom]=\"true\" [thyLabelText]=\"option.text\">\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n" }]
1988
- }], ctorParameters: () => [] });
1989
1994
 
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);
1997
- }
1998
- ngAfterViewInit() {
1999
- setTimeout(() => {
2000
- this.updateStyle();
2001
- this.handleSelectAll();
2002
- }, 0);
2003
- }
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
- }
2014
- }
2015
- handleSelectAll() {
2016
- if (this.isSelectAll()) {
2017
- const textarea = this.elementRef.nativeElement.querySelector('textarea');
2018
- textarea.select();
2019
- }
2020
- }
2021
- valueChange() {
2022
- this.updateStyle();
2023
- }
2024
- updateValue() {
2025
- super.update();
2026
- this.closePopover();
2027
- }
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();
2256
- }
2257
- function getAvatarBgColor(name) {
2258
- if (!name) {
2259
- return;
2260
- }
2261
- const colors = ['#56abfb', '#5dcfff', '#84e17e', '#73d897', '#ff9f73', '#fa8888', '#fb7fb7', '#9a7ef4', '#868af6'];
2262
- const nameArray = name.split('');
2263
- const code = name && name.length > 0
2264
- ? nameArray.reduce(function (result, item) {
2265
- result.value += item.charCodeAt(0);
2266
- return result;
2267
- }, { value: 0 }).value
2268
- : 0;
2269
- return colors[code % 9];
2270
- }
2271
- function expandCell(aiTable, path) {
2272
- const [recordId, fieldId] = path;
2273
- aiTable.selection.set({
2274
- ...aiTable.selection(),
2275
- expandCell: [recordId, fieldId]
2276
- });
2277
- }
2278
-
2279
- /**
2280
- * 生成目标名称
2281
- */
2282
- const generateTargetName = ({ targetName, fieldId, recordId, mouseStyle, source }) => {
2283
- const flag = '$';
2284
- return `${targetName}.${fieldId || flag}.${recordId || flag}.${mouseStyle || flag}.${source || flag}`;
2285
- };
2286
- /**
2287
- * 取目标名称
2288
- */
2289
- const getTargetName = (targetName) => {
2290
- if (targetName == null || targetName === '')
2291
- return AI_TABLE_BLANK;
2292
- return targetName.split('.')[0];
2293
- };
2294
- /**
2295
- * Parse targetName for built-in information
2296
- */
2297
- const getDetailByTargetName = (_targetName) => {
2298
- if (_targetName == null) {
2299
- return {
2300
- targetName: null,
2301
- fieldId: null,
2302
- recordId: null,
2303
- mouseStyle: null
2304
- };
1995
+ /**
1996
+ * 生成目标名称
1997
+ */
1998
+ const generateTargetName = ({ targetName, fieldId, recordId, mouseStyle, source }) => {
1999
+ const flag = '$';
2000
+ return `${targetName}.${fieldId || flag}.${recordId || flag}.${mouseStyle || flag}.${source || flag}`;
2001
+ };
2002
+ /**
2003
+ * 取目标名称
2004
+ */
2005
+ const getTargetName = (targetName) => {
2006
+ if (targetName == null || targetName === '')
2007
+ return AI_TABLE_BLANK;
2008
+ return targetName.split('.')[0];
2009
+ };
2010
+ /**
2011
+ * Parse targetName for built-in information
2012
+ */
2013
+ const getDetailByTargetName = (_targetName) => {
2014
+ if (_targetName == null) {
2015
+ return {
2016
+ targetName: null,
2017
+ fieldId: null,
2018
+ recordId: null,
2019
+ mouseStyle: null
2020
+ };
2305
2021
  }
2306
2022
  const flag = '$';
2307
2023
  const [targetName, fieldId, recordId, mouseStyle, source] = _targetName.split('.');
@@ -4075,12 +3791,6 @@ class AITableTextComponent {
4075
3791
  this.koMouseMove = output();
4076
3792
  this.textConfig = computed(() => {
4077
3793
  const { x, y, width, height, text, padding, align = DEFAULT_TEXT_ALIGN_LEFT, verticalAlign = DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, fill = DEFAULT_TEXT_FILL, textDecoration, fontSize = DEFAULT_FONT_SIZE, fontStyle = DEFAULT_FONT_STYLE, ellipsis = DEFAULT_TEXT_ELLIPSIS, wrap = DEFAULT_TEXT_WRAP, transformsEnabled = DEFAULT_TEXT_TRANSFORMS_ENABLED, listening = DEFAULT_TEXT_LISTENING, fontFamily = DEFAULT_FONT_FAMILY, ...rest } = this.config();
4078
- const tmpText = new Konva.Text({
4079
- text,
4080
- fontSize,
4081
- fontFamily
4082
- });
4083
- const textBounds = tmpText.getClientRect();
4084
3794
  return {
4085
3795
  x,
4086
3796
  y,
@@ -4099,12 +3809,6 @@ class AITableTextComponent {
4099
3809
  transformsEnabled,
4100
3810
  listening,
4101
3811
  fontFamily,
4102
- hitFunc: function (context) {
4103
- context.beginPath();
4104
- context.rect(AI_TABLE_OFFSET, (height - textBounds.height) / 2 - AI_TABLE_OFFSET, textBounds.width, textBounds.height);
4105
- context.closePath();
4106
- context.fillStrokeShape(this);
4107
- },
4108
3812
  ...rest
4109
3813
  };
4110
3814
  });
@@ -5074,6 +4778,24 @@ class CoverCellBase {
5074
4778
  constructor() {
5075
4779
  this.config = input();
5076
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
+ });
5077
4799
  }
5078
4800
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: CoverCellBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5079
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 }); }
@@ -5085,7 +4807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
5085
4807
  template: '',
5086
4808
  changeDetection: ChangeDetectionStrategy.OnPush
5087
4809
  }]
5088
- }] });
4810
+ }], ctorParameters: () => [] });
5089
4811
 
5090
4812
  class AITableCellLink extends CoverCellBase {
5091
4813
  constructor() {
@@ -5112,13 +4834,12 @@ class AITableCellLink extends CoverCellBase {
5112
4834
  });
5113
4835
  return {
5114
4836
  x,
5115
- y,
4837
+ y: (rowHeight - DEFAULT_FONT_SIZE * AI_TABLE_TEXT_LINE_HEIGHT) / 2,
5116
4838
  text,
5117
4839
  wrap: 'none',
5118
4840
  width: textWidth,
5119
4841
  fillStyle: Colors.primary,
5120
4842
  fill: Colors.primary,
5121
- height: rowHeight + 2,
5122
4843
  lineHeight: AI_TABLE_TEXT_LINE_HEIGHT,
5123
4844
  listening: true,
5124
4845
  ellipsis: true,
@@ -8427,6 +8148,7 @@ class AITableScrollableGroup {
8427
8148
  return {
8428
8149
  x: 0,
8429
8150
  y: 0,
8151
+ fill: Colors.white,
8430
8152
  width,
8431
8153
  height,
8432
8154
  listening: true
@@ -8871,9 +8593,8 @@ class AITableFillHandle {
8871
8593
  const { aiTable, readonly } = this.config();
8872
8594
  const selection = aiTable.selection();
8873
8595
  const hasSelectedCells = selection.selectedCells.size > 0;
8874
- const isExpandCell = selection.expandCell;
8875
8596
  const isEditingCell = selection.editingCell;
8876
- return hasSelectedCells && !readonly && !isEditingCell && !isExpandCell;
8597
+ return hasSelectedCells && !readonly && !isEditingCell;
8877
8598
  });
8878
8599
  this.handleConfig = computed(() => {
8879
8600
  const { aiTable, coordinate } = this.config();
@@ -8887,9 +8608,10 @@ class AITableFillHandle {
8887
8608
  const rowOffset = coordinate.getRowOffset(rowIndex);
8888
8609
  const width = 6;
8889
8610
  const height = 6;
8611
+ const cellHeight = aiTable.selection().expandCellInfo?.height ?? AI_TABLE_ROW_HEIGHT;
8890
8612
  return {
8891
8613
  x: columnOffset + columnWidth - width / 2 + AI_TABLE_OFFSET,
8892
- 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,
8893
8615
  width,
8894
8616
  height,
8895
8617
  fill: Colors.primary,
@@ -10241,36 +9963,219 @@ class AITableCellCheckbox extends CoverCellBase {
10241
9963
  listening: true
10242
9964
  };
10243
9965
  }
10244
- return null;
9966
+ return null;
9967
+ });
9968
+ }
9969
+ static { this.fieldType = AITableFieldType.checkbox; }
9970
+ switchChecked() {
9971
+ const { actions } = this.config();
9972
+ actions.updateFieldValues([
9973
+ {
9974
+ value: !this.isChecked(),
9975
+ path: [this.config().recordId, this.config().field._id]
9976
+ }
9977
+ ]);
9978
+ }
9979
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
9980
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: AITableCellCheckbox, isStandalone: true, selector: "ai-table-checkbox", usesInheritance: true, ngImport: i0, template: `
9981
+ <ko-group>
9982
+ <ai-table-icon [config]="checkbox()" (koClick)="switchChecked()"></ai-table-icon>
9983
+ </ko-group>
9984
+ `, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"], outputs: ["koClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9985
+ }
9986
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellCheckbox, decorators: [{
9987
+ type: Component,
9988
+ args: [{
9989
+ selector: 'ai-table-checkbox',
9990
+ template: `
9991
+ <ko-group>
9992
+ <ai-table-icon [config]="checkbox()" (koClick)="switchChecked()"></ai-table-icon>
9993
+ </ko-group>
9994
+ `,
9995
+ imports: [KoContainer, AITableIcon],
9996
+ changeDetection: ChangeDetectionStrategy.OnPush
9997
+ }]
9998
+ }] });
9999
+
10000
+ class AITableCellText extends CoverCellBase {
10001
+ constructor() {
10002
+ super(...arguments);
10003
+ this.expandBorderConfig = computed(() => {
10004
+ const { render, field, recordId, readonly, isExpand } = this.config();
10005
+ const { columnWidth } = render;
10006
+ if (isExpand) {
10007
+ return {
10008
+ width: columnWidth - AI_TABLE_CELL_BORDER / 2,
10009
+ height: this.height(),
10010
+ stroke: Colors.primary,
10011
+ strokeWidth: 2,
10012
+ listening: false
10013
+ };
10014
+ }
10015
+ return null;
10016
+ });
10017
+ this.scrollConfig = computed(() => {
10018
+ const { render, field, recordId, readonly, isExpand, coordinate } = this.config();
10019
+ const { columnWidth } = render;
10020
+ const { height } = this.expandTextBounds();
10021
+ return {
10022
+ width: columnWidth,
10023
+ height: this.height(),
10024
+ contentWidth: columnWidth, // 内容宽度大于容器宽度,会显示横向滚动条
10025
+ contentHeight: height + this.startY() * 2 - AI_TABLE_CELL_LINE_BORDER, // 内容高度大于容器高度,会显示竖向滚动条
10026
+ scrollbarSize: 9,
10027
+ scrollbarColor: Colors.gray700,
10028
+ x: 0,
10029
+ y: 0,
10030
+ listening: true,
10031
+ verticalScrollbar: true,
10032
+ horizontalScrollbar: true,
10033
+ contentNotScrollbar: false
10034
+ };
10035
+ });
10036
+ this.expandTextBounds = computed(() => {
10037
+ const textRender = this.textString();
10038
+ const tmpText = new Konva.Text({
10039
+ text: textRender,
10040
+ fontSize: DEFAULT_FONT_SIZE,
10041
+ fontFamily: DEFAULT_FONT_FAMILY,
10042
+ lineHeight: AI_TABLE_TEXT_LINE_HEIGHT,
10043
+ wrap: 'char',
10044
+ width: this.textMaxWidth(),
10045
+ align: DEFAULT_TEXT_ALIGN_LEFT,
10046
+ verticalAlign: DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE,
10047
+ fontStyle: DEFAULT_FONT_STYLE,
10048
+ ellipsis: DEFAULT_TEXT_ELLIPSIS,
10049
+ transformsEnabled: DEFAULT_TEXT_TRANSFORMS_ENABLED,
10050
+ listening: false
10051
+ });
10052
+ return tmpText.getClientRect();
10053
+ });
10054
+ this.textMaxWidth = computed(() => {
10055
+ const { columnWidth } = this.config()?.render;
10056
+ return columnWidth - AI_TABLE_CELL_PADDING - AI_TABLE_CELL_PADDING;
10057
+ });
10058
+ this.textString = computed(() => {
10059
+ const { transformValue } = this.config()?.render;
10060
+ let textRender = transformValue;
10061
+ if (isUndefinedOrNull(textRender)) {
10062
+ return;
10063
+ }
10064
+ return textRender.replace(/\r|\n/g, ' ');
10065
+ });
10066
+ this.height = computed(() => {
10067
+ const { height } = this.expandTextBounds() || { height: 0 };
10068
+ return Math.min(Math.max(height, this.config().render.rowHeight - AI_TABLE_CELL_LINE_BORDER || AI_TABLE_ROW_BLANK_HEIGHT), 146);
10069
+ });
10070
+ this.startY = computed(() => {
10071
+ const { y, rowHeight } = this.config()?.render;
10072
+ return (y + (rowHeight - DEFAULT_FONT_SIZE) / 2 - (DEFAULT_FONT_SIZE * (AI_TABLE_TEXT_LINE_HEIGHT - 1)) / 2 + AI_TABLE_CELL_LINE_BORDER);
10073
+ });
10074
+ this.expandTextConfig = computed(() => {
10075
+ const render = this.config()?.render;
10076
+ if (render) {
10077
+ const { x, y, transformValue, field, columnWidth, rowHeight, style, zIndex, recordId } = render;
10078
+ let textRender = this.textString();
10079
+ if (isUndefinedOrNull(textRender)) {
10080
+ return;
10081
+ }
10082
+ return {
10083
+ x,
10084
+ y: this.startY(),
10085
+ name: generateTargetName({
10086
+ targetName: AI_TABLE_CELL,
10087
+ fieldId: field._id,
10088
+ recordId
10089
+ }),
10090
+ text: textRender,
10091
+ wrap: 'char',
10092
+ width: this.textMaxWidth(),
10093
+ fillStyle: Colors.primary,
10094
+ lineHeight: AI_TABLE_TEXT_LINE_HEIGHT,
10095
+ listening: true,
10096
+ ellipsis: true,
10097
+ zIndex
10098
+ };
10099
+ }
10100
+ return;
10101
+ });
10102
+ this.textConfig = computed(() => {
10103
+ const render = this.config()?.render;
10104
+ if (render) {
10105
+ const { x, y, transformValue, field, columnWidth, rowHeight, style, zIndex } = render;
10106
+ let textRender = this.textString();
10107
+ if (isUndefinedOrNull(textRender)) {
10108
+ return;
10109
+ }
10110
+ return {
10111
+ x,
10112
+ y,
10113
+ text: textRender,
10114
+ wrap: 'none',
10115
+ width: this.textMaxWidth(),
10116
+ fillStyle: Colors.primary,
10117
+ height: rowHeight + AI_TABLE_CELL_LINE_BORDER * 2,
10118
+ lineHeight: AI_TABLE_TEXT_LINE_HEIGHT,
10119
+ listening: false,
10120
+ ellipsis: true,
10121
+ zIndex
10122
+ };
10123
+ }
10124
+ return;
10245
10125
  });
10246
10126
  }
10247
- static { this.fieldType = AITableFieldType.checkbox; }
10248
- switchChecked() {
10249
- const { actions } = this.config();
10250
- actions.updateFieldValues([
10251
- {
10252
- value: !this.isChecked(),
10253
- path: [this.config().recordId, this.config().field._id]
10254
- }
10255
- ]);
10256
- }
10257
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
10258
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: AITableCellCheckbox, isStandalone: true, selector: "ai-table-checkbox", usesInheritance: true, ngImport: i0, template: `
10127
+ static { this.fieldType = AITableFieldType.text; }
10128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
10129
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellText, isStandalone: true, selector: "ai-table-single-text", usesInheritance: true, ngImport: i0, template: `
10259
10130
  <ko-group>
10260
- <ai-table-icon [config]="checkbox()" (koClick)="switchChecked()"></ai-table-icon>
10131
+ @if (isExpand()) {
10132
+ <ko-group>
10133
+ <ko-group #rootGroup>
10134
+ <ai-table-scrollable-group [config]="scrollConfig()" [contentTemplate]="contentGroup" [parentContainer]="rootGroup">
10135
+ <ko-group #contentGroup>
10136
+ <ai-table-text [config]="expandTextConfig()!"></ai-table-text>
10137
+ </ko-group>
10138
+ </ai-table-scrollable-group>
10139
+ </ko-group>
10140
+ <ko-group>
10141
+ <ko-rect [config]="expandBorderConfig()!"></ko-rect>
10142
+ </ko-group>
10143
+ </ko-group>
10144
+ } @else {
10145
+ @if (textConfig()) {
10146
+ <ai-table-text [config]="textConfig()!"></ai-table-text>
10147
+ }
10148
+ }
10261
10149
  </ko-group>
10262
- `, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"], outputs: ["koClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10150
+ `, isInline: true, dependencies: [{ kind: "component", type: AITableTextComponent, selector: "ai-table-text", inputs: ["config"], outputs: ["koClick", "koMouseMove"] }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: AITableScrollableGroup, selector: "ai-table-scrollable-group", inputs: ["config", "contentTemplate", "parentContainer"], outputs: ["scrollPosition"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10263
10151
  }
10264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellCheckbox, decorators: [{
10152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellText, decorators: [{
10265
10153
  type: Component,
10266
10154
  args: [{
10267
- selector: 'ai-table-checkbox',
10155
+ selector: 'ai-table-single-text',
10268
10156
  template: `
10269
10157
  <ko-group>
10270
- <ai-table-icon [config]="checkbox()" (koClick)="switchChecked()"></ai-table-icon>
10158
+ @if (isExpand()) {
10159
+ <ko-group>
10160
+ <ko-group #rootGroup>
10161
+ <ai-table-scrollable-group [config]="scrollConfig()" [contentTemplate]="contentGroup" [parentContainer]="rootGroup">
10162
+ <ko-group #contentGroup>
10163
+ <ai-table-text [config]="expandTextConfig()!"></ai-table-text>
10164
+ </ko-group>
10165
+ </ai-table-scrollable-group>
10166
+ </ko-group>
10167
+ <ko-group>
10168
+ <ko-rect [config]="expandBorderConfig()!"></ko-rect>
10169
+ </ko-group>
10170
+ </ko-group>
10171
+ } @else {
10172
+ @if (textConfig()) {
10173
+ <ai-table-text [config]="textConfig()!"></ai-table-text>
10174
+ }
10175
+ }
10271
10176
  </ko-group>
10272
10177
  `,
10273
- imports: [KoContainer, AITableIcon],
10178
+ imports: [AITableTextComponent, KoShape, KoContainer, AITableScrollableGroup],
10274
10179
  changeDetection: ChangeDetectionStrategy.OnPush
10275
10180
  }]
10276
10181
  }] });
@@ -10284,7 +10189,8 @@ var cellComponents = /*#__PURE__*/Object.freeze({
10284
10189
  AITableCellLink: AITableCellLink,
10285
10190
  AITableCellProgress: AITableCellProgress,
10286
10191
  AITableCellRate: AITableCellRate,
10287
- AITableCellRichText: AITableCellRichText
10192
+ AITableCellRichText: AITableCellRichText,
10193
+ AITableCellText: AITableCellText
10288
10194
  });
10289
10195
 
10290
10196
  const ComponentMap = {};
@@ -10458,101 +10364,398 @@ function getFillDirection(aiTable, sourceCells, mouseUpRecordId) {
10458
10364
  if (currentRowIndex < sourceStartRowIndex) {
10459
10365
  return 'upward';
10460
10366
  }
10461
- else if (currentRowIndex > sourceEndRowIndex) {
10462
- return 'downward';
10367
+ else if (currentRowIndex > sourceEndRowIndex) {
10368
+ return 'downward';
10369
+ }
10370
+ else {
10371
+ return undefined;
10372
+ }
10373
+ }
10374
+ function dragFillHighlightArea(aiTable, sourceCells, currentRecordId) {
10375
+ const { startCell: sourceStartCell, endCell: sourceEndCell } = getStartAndEndCell(sourceCells);
10376
+ const direction = getFillDirection(aiTable, sourceCells, currentRecordId);
10377
+ const sourceStartCellFieldId = sourceStartCell[1];
10378
+ const sourceEndCellFieldId = sourceEndCell[1];
10379
+ let highlightStartCell;
10380
+ let highlightEndCell;
10381
+ if (direction === 'downward') {
10382
+ highlightStartCell = sourceStartCell;
10383
+ highlightEndCell = [currentRecordId, sourceEndCellFieldId];
10384
+ }
10385
+ else if (direction === 'upward') {
10386
+ highlightStartCell = [currentRecordId, sourceStartCellFieldId];
10387
+ highlightEndCell = sourceEndCell;
10388
+ }
10389
+ else {
10390
+ highlightStartCell = sourceStartCell;
10391
+ highlightEndCell = sourceEndCell;
10392
+ }
10393
+ return { highlightStartCell, highlightEndCell };
10394
+ }
10395
+ function performFill(aiTable, sourceCells, mouseUpRecordId, actions) {
10396
+ const selectedCells = Array.from(aiTable.selection().selectedCells);
10397
+ if (sourceCells.size === 0 || selectedCells.length === 0) {
10398
+ return;
10399
+ }
10400
+ const { startCell: sourceStartCell, endCell: sourceEndCell } = getStartAndEndCell(sourceCells);
10401
+ const visibleRowsIndexMap = aiTable.context.visibleRowsIndexMap();
10402
+ const sourceStartRowIndex = visibleRowsIndexMap.get(sourceStartCell[0]);
10403
+ const sourceEndRowIndex = visibleRowsIndexMap.get(sourceEndCell[0]);
10404
+ const selectedEndCell = selectedCells[selectedCells.length - 1].split(':');
10405
+ const selectedEndRowIndex = visibleRowsIndexMap.get(selectedEndCell[0]);
10406
+ let targetStartRowIndex;
10407
+ let targetEndRowIndex;
10408
+ const direction = getFillDirection(aiTable, sourceCells, mouseUpRecordId);
10409
+ if (direction === 'downward') {
10410
+ targetStartRowIndex = sourceEndRowIndex + 1;
10411
+ targetEndRowIndex = selectedEndRowIndex;
10412
+ }
10413
+ else {
10414
+ const selectedFirstCell = selectedCells[0].split(':');
10415
+ const selectedFirstRowIndex = visibleRowsIndexMap.get(selectedFirstCell[0]);
10416
+ targetStartRowIndex = selectedFirstRowIndex;
10417
+ targetEndRowIndex = sourceStartRowIndex - 1;
10418
+ }
10419
+ const sourceRowCount = sourceEndRowIndex - sourceStartRowIndex + 1;
10420
+ const sourceRows = [];
10421
+ const linearRows = aiTable.context.linearRows();
10422
+ for (let i = sourceStartRowIndex; i <= sourceEndRowIndex; i++) {
10423
+ sourceRows.push(linearRows[i]._id);
10424
+ }
10425
+ const updateData = [];
10426
+ const fields = AITable.getVisibleFields(aiTable);
10427
+ const visibleColumnsIndexMap = aiTable.context.visibleColumnsIndexMap();
10428
+ const recordsMap = aiTable.recordsMap();
10429
+ const startFieldIndex = visibleColumnsIndexMap.get(sourceStartCell[1]);
10430
+ const endFieldIndex = visibleColumnsIndexMap.get(sourceEndCell[1]);
10431
+ for (let index = startFieldIndex; index <= endFieldIndex; index++) {
10432
+ const field = fields[index];
10433
+ const fieldId = field._id;
10434
+ if (isSystemField(field)) {
10435
+ continue;
10436
+ }
10437
+ for (let rowIndex = targetStartRowIndex; rowIndex <= targetEndRowIndex; rowIndex++) {
10438
+ const targetRecordId = linearRows[rowIndex]._id;
10439
+ const relativeRowIndex = direction === 'downward' ? rowIndex - targetStartRowIndex : targetEndRowIndex - rowIndex;
10440
+ const mod = relativeRowIndex % sourceRowCount;
10441
+ const sourceRowIndex = direction === 'downward' ? mod : sourceRowCount - 1 - mod;
10442
+ const sourceRecordId = sourceRows[sourceRowIndex];
10443
+ const sourceValue = recordsMap[sourceRecordId]?.values[fieldId];
10444
+ updateData.push({
10445
+ path: [targetRecordId, fieldId],
10446
+ value: sourceValue
10447
+ });
10448
+ }
10449
+ }
10450
+ if (updateData.length > 0) {
10451
+ actions.updateFieldValues(updateData);
10452
+ }
10453
+ }
10454
+ function getStartAndEndCell(selectedCells) {
10455
+ const selectedCellsArray = Array.from(selectedCells);
10456
+ const firstCell = selectedCellsArray[0].split(':');
10457
+ const lastCell = selectedCellsArray[selectedCellsArray.length - 1].split(':');
10458
+ const startCell = [firstCell[0], firstCell[1]];
10459
+ const endCell = [lastCell[0], lastCell[1]];
10460
+ return { startCell, endCell };
10461
+ }
10462
+
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);
10463
10595
  }
10464
- else {
10465
- return undefined;
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
+ }
10466
10606
  }
10467
- }
10468
- function dragFillHighlightArea(aiTable, sourceCells, currentRecordId) {
10469
- const { startCell: sourceStartCell, endCell: sourceEndCell } = getStartAndEndCell(sourceCells);
10470
- const direction = getFillDirection(aiTable, sourceCells, currentRecordId);
10471
- const sourceStartCellFieldId = sourceStartCell[1];
10472
- const sourceEndCellFieldId = sourceEndCell[1];
10473
- let highlightStartCell;
10474
- let highlightEndCell;
10475
- if (direction === 'downward') {
10476
- highlightStartCell = sourceStartCell;
10477
- highlightEndCell = [currentRecordId, sourceEndCellFieldId];
10607
+ handleSelectAll() {
10608
+ if (this.isSelectAll()) {
10609
+ const textarea = this.elementRef.nativeElement.querySelector('textarea');
10610
+ textarea.select();
10611
+ }
10478
10612
  }
10479
- else if (direction === 'upward') {
10480
- highlightStartCell = [currentRecordId, sourceStartCellFieldId];
10481
- highlightEndCell = sourceEndCell;
10613
+ valueChange() {
10614
+ this.updateStyle();
10482
10615
  }
10483
- else {
10484
- highlightStartCell = sourceStartCell;
10485
- highlightEndCell = sourceEndCell;
10616
+ updateValue() {
10617
+ super.update();
10618
+ this.closePopover();
10486
10619
  }
10487
- return { highlightStartCell, highlightEndCell };
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 }); }
10488
10634
  }
10489
- function performFill(aiTable, sourceCells, mouseUpRecordId, actions) {
10490
- const selectedCells = Array.from(aiTable.selection().selectedCells);
10491
- if (sourceCells.size === 0 || selectedCells.length === 0) {
10492
- return;
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);
10493
10663
  }
10494
- const { startCell: sourceStartCell, endCell: sourceEndCell } = getStartAndEndCell(sourceCells);
10495
- const visibleRowsIndexMap = aiTable.context.visibleRowsIndexMap();
10496
- const sourceStartRowIndex = visibleRowsIndexMap.get(sourceStartCell[0]);
10497
- const sourceEndRowIndex = visibleRowsIndexMap.get(sourceEndCell[0]);
10498
- const selectedEndCell = selectedCells[selectedCells.length - 1].split(':');
10499
- const selectedEndRowIndex = visibleRowsIndexMap.get(selectedEndCell[0]);
10500
- let targetStartRowIndex;
10501
- let targetEndRowIndex;
10502
- const direction = getFillDirection(aiTable, sourceCells, mouseUpRecordId);
10503
- if (direction === 'downward') {
10504
- targetStartRowIndex = sourceEndRowIndex + 1;
10505
- targetEndRowIndex = selectedEndRowIndex;
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
+ []);
10506
10680
  }
10507
- else {
10508
- const selectedFirstCell = selectedCells[0].split(':');
10509
- const selectedFirstRowIndex = visibleRowsIndexMap.get(selectedFirstCell[0]);
10510
- targetStartRowIndex = selectedFirstRowIndex;
10511
- targetEndRowIndex = sourceStartRowIndex - 1;
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);
10512
10693
  }
10513
- const sourceRowCount = sourceEndRowIndex - sourceStartRowIndex + 1;
10514
- const sourceRows = [];
10515
- const linearRows = aiTable.context.linearRows();
10516
- for (let i = sourceStartRowIndex; i <= sourceEndRowIndex; i++) {
10517
- sourceRows.push(linearRows[i]._id);
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
+ []);
10518
10710
  }
10519
- const updateData = [];
10520
- const fields = AITable.getVisibleFields(aiTable);
10521
- const visibleColumnsIndexMap = aiTable.context.visibleColumnsIndexMap();
10522
- const recordsMap = aiTable.recordsMap();
10523
- const startFieldIndex = visibleColumnsIndexMap.get(sourceStartCell[1]);
10524
- const endFieldIndex = visibleColumnsIndexMap.get(sourceEndCell[1]);
10525
- for (let index = startFieldIndex; index <= endFieldIndex; index++) {
10526
- const field = fields[index];
10527
- const fieldId = field._id;
10528
- if (isSystemField(field)) {
10529
- continue;
10530
- }
10531
- for (let rowIndex = targetStartRowIndex; rowIndex <= targetEndRowIndex; rowIndex++) {
10532
- const targetRecordId = linearRows[rowIndex]._id;
10533
- const relativeRowIndex = direction === 'downward' ? rowIndex - targetStartRowIndex : targetEndRowIndex - rowIndex;
10534
- const mod = relativeRowIndex % sourceRowCount;
10535
- const sourceRowIndex = direction === 'downward' ? mod : sourceRowCount - 1 - mod;
10536
- const sourceRecordId = sourceRows[sourceRowIndex];
10537
- const sourceValue = recordsMap[sourceRecordId]?.values[fieldId];
10538
- updateData.push({
10539
- path: [targetRecordId, fieldId],
10540
- value: sourceValue
10541
- });
10542
- }
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;
10543
10723
  }
10544
- if (updateData.length > 0) {
10545
- actions.updateFieldValues(updateData);
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;
10546
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" }); }
10547
10739
  }
10548
- function getStartAndEndCell(selectedCells) {
10549
- const selectedCellsArray = Array.from(selectedCells);
10550
- const firstCell = selectedCellsArray[0].split(':');
10551
- const lastCell = selectedCellsArray[selectedCellsArray.length - 1].split(':');
10552
- const startCell = [firstCell[0], firstCell[1]];
10553
- const endCell = [lastCell[0], lastCell[1]];
10554
- return { startCell, endCell };
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" }); }
10555
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
+ }] });
10556
10759
 
10557
10760
  class AITableFieldSetting {
10558
10761
  constructor() {
@@ -10722,7 +10925,8 @@ class AITableGridSelectionService {
10722
10925
  activeCell: null,
10723
10926
  expandCell: null,
10724
10927
  editingCell: null,
10725
- selectAllState: AITableSelectAllState.none
10928
+ selectAllState: AITableSelectAllState.none,
10929
+ expandCellInfo: null
10726
10930
  });
10727
10931
  }
10728
10932
  setActiveCell(activeCell) {
@@ -11240,6 +11444,7 @@ class AITableGridBase {
11240
11444
  this.aiBuildRenderDataFn = input();
11241
11445
  this.aiGetI18nTextByKey = input();
11242
11446
  this.aiKeywords = input();
11447
+ this.aiFrozenColumnCountFn = input();
11243
11448
  this.AITableFieldType = AITableFieldType;
11244
11449
  this.AITableSelectOptionStyle = AITableSelectOptionStyle;
11245
11450
  this.isSelectedAll = computed(() => {
@@ -11359,7 +11564,7 @@ class AITableGridBase {
11359
11564
  }
11360
11565
  }
11361
11566
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11362
- 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 }); }
11363
11568
  }
11364
11569
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGridBase, decorators: [{
11365
11570
  type: Component,
@@ -11700,9 +11905,16 @@ class AITableDragComponent {
11700
11905
  this.containerHeight = this.elementRef.nativeElement.offsetHeight;
11701
11906
  const moveX = e.x - (this.mouseStartPosition?.x || 0);
11702
11907
  const moveY = e.y - (this.mouseStartPosition?.y || 0);
11908
+ let direction = DragDirection.none;
11703
11909
  switch (drag.type) {
11704
11910
  case DragType.field:
11705
- 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);
11706
11918
  break;
11707
11919
  case DragType.record:
11708
11920
  this.movingRecord(drag, moveY);
@@ -11712,19 +11924,20 @@ class AITableDragComponent {
11712
11924
  break;
11713
11925
  }
11714
11926
  }
11715
- movingColumn(drag, moveX) {
11927
+ movingColumn(drag, moveX, direction) {
11716
11928
  const aiTable = this.aiTableGridSelectionService.aiTable;
11717
11929
  const scroll = { x: this.horizontalBarElement?.scrollLeft || 0, y: 0 };
11718
11930
  const coordinate = drag.coordinate;
11719
11931
  const fields = aiTable.gridData().fields;
11720
11932
  const width = this.calculateDragWidth(fields, coordinate, drag);
11721
11933
  const visibleColumnIndexMap = aiTable.context.visibleColumnsIndexMap();
11934
+ const rowHeadWidth = aiTable.context.rowHeadWidth();
11722
11935
  const sourceColumnIndex = visibleColumnIndexMap.get(drag.sourceIds.values().next().value) || 0;
11723
11936
  const sourceColumnStartX = coordinate.getColumnOffset(sourceColumnIndex);
11724
11937
  const sourceColumnWidth = coordinate.getColumnWidth(sourceColumnIndex);
11725
- // TODO: 目前默认第一列为冻结列,后期支持设置冻结列需要处理
11726
- const isSourceColumnFrozen = sourceColumnIndex === 0;
11727
- 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);
11728
11941
  const pointerX = moveX + sourceColumnStartX;
11729
11942
  // 拖拽中心点
11730
11943
  const dragCenter = sourceColumnWidth / 2;
@@ -11754,8 +11967,8 @@ class AITableDragComponent {
11754
11967
  if ((targetColumnIndex >= 0 && (targetColumnIndex - sourceColumnIndex > 1 || targetColumnIndex - sourceColumnIndex < 0)) ||
11755
11968
  isLastColumn) {
11756
11969
  let lineLeft = targetColumnStartX - scrollPosition.x;
11757
- const lineForFrozenX = lineLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
11758
- const rectDistanceFrozenX = rectLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
11970
+ const lineForFrozenX = lineLeft - frozenColumnWidth - rowHeadWidth;
11971
+ const rectDistanceFrozenX = rectLeft - frozenColumnWidth - rowHeadWidth;
11759
11972
  if (lineForFrozenX < 0) {
11760
11973
  if (Math.abs(rectDistanceFrozenX) < dragCenter) {
11761
11974
  // 滚动中保持上一个位置
@@ -11771,6 +11984,12 @@ class AITableDragComponent {
11771
11984
  };
11772
11985
  return;
11773
11986
  }
11987
+ if (isSourceColumnFrozen) {
11988
+ // 拖拽的列是冻结列,且目标列在冻结列左侧,不显示辅助线
11989
+ this.resetAuxiliaryLine();
11990
+ this.draggedData = null;
11991
+ return;
11992
+ }
11774
11993
  }
11775
11994
  this.setAuxiliaryLineStyles({
11776
11995
  width: '2px',
@@ -11795,6 +12014,12 @@ class AITableDragComponent {
11795
12014
  }
11796
12015
  };
11797
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
+ }
11798
12023
  this.scrollControllerService.scroll({
11799
12024
  container: {
11800
12025
  width: this.containerWidth,
@@ -11811,7 +12036,7 @@ class AITableDragComponent {
11811
12036
  horizontalElement: this.horizontalBarElement
11812
12037
  },
11813
12038
  frozenArea: {
11814
- left: frozenColumnWidth + aiTable.context.rowHeadWidth()
12039
+ left: frozenColumnWidth + rowHeadWidth
11815
12040
  },
11816
12041
  edgeThreshold: {
11817
12042
  left: AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD,
@@ -12036,7 +12261,14 @@ class AITableGrid extends AITableGridBase {
12036
12261
  this.isPopoverOpen = false;
12037
12262
  this.fieldHeadHeight = AI_TABLE_FIELD_HEAD_HEIGHT;
12038
12263
  this.containerRect = signal({ width: 0, height: 0 });
12039
- 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
+ });
12040
12272
  this.hasContainerRect = computed(() => {
12041
12273
  return this.containerRect().width > 0 && this.containerRect().height > 0;
12042
12274
  });
@@ -12243,6 +12475,7 @@ class AITableGrid extends AITableGridBase {
12243
12475
  }
12244
12476
  initContext() {
12245
12477
  this.aiTable.context = new RendererContext({
12478
+ containerRect: this.containerRect,
12246
12479
  rowHeadWidth: computed(() => {
12247
12480
  const aiFieldConfig = this.aiFieldConfig();
12248
12481
  let width = AI_TABLE_ROW_HEAD_WIDTH_AND_DRAG_ICON_WIDTH;
@@ -12376,7 +12609,14 @@ class AITableGrid extends AITableGridBase {
12376
12609
  this.updateDragSelectState(true, startCell);
12377
12610
  const [expandRecordId, expandFieldId] = this.aiTable.selection().expandCell || [null, null];
12378
12611
  if (expandRecordId !== recordId || expandFieldId !== fieldId) {
12379
- this.aiTableGridSelectionService.selectCells(startCell);
12612
+ const field = this.aiTable.fieldsMap()[fieldId];
12613
+ if (field.type === AITableFieldType.text) {
12614
+ this.aiTableGridSelectionService.clearSelection();
12615
+ expandCell(this.aiTable, [recordId, fieldId]);
12616
+ }
12617
+ else {
12618
+ this.aiTableGridSelectionService.selectCells(startCell);
12619
+ }
12380
12620
  }
12381
12621
  return;
12382
12622
  case AI_TABLE_FILL_HANDLE:
@@ -12883,5 +13123,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
12883
13123
  * Generated bundle index. Do not edit.
12884
13124
  */
12885
13125
 
12886
- export { AITable, AITableActionIcon, AITableAddField, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableBackground, AITableCellAttachment, AITableCellCheckbox, AITableCellLink, AITableCellProgress, AITableCellRate, AITableCellRichText, 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 };
12887
13127
  //# sourceMappingURL=ai-table-grid.mjs.map