@ai-table/grid 0.1.8 → 0.1.10
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.
- package/components/cell-editors/link/edit-link/edit-link.component.d.ts +0 -2
- package/components/cell-editors/link/edit-link/edit-link.component.d.ts.map +1 -1
- package/components/cell-editors/link/link-editor.component.d.ts.map +1 -1
- package/components/cell-editors/text/text-editor.component.d.ts +3 -1
- package/components/cell-editors/text/text-editor.component.d.ts.map +1 -1
- package/components/drag/drag.component.d.ts +11 -1
- package/components/drag/drag.component.d.ts.map +1 -1
- package/components/field-setting/field-setting.component.d.ts +6 -1
- package/components/field-setting/field-setting.component.d.ts.map +1 -1
- package/constants/editor.d.ts +1 -1
- package/constants/editor.d.ts.map +1 -1
- package/constants/icon.d.ts +1 -0
- package/constants/icon.d.ts.map +1 -1
- package/constants/table.d.ts +5 -0
- package/constants/table.d.ts.map +1 -1
- package/core/constants/field.d.ts +2 -0
- package/core/constants/field.d.ts.map +1 -1
- package/core/context.d.ts +3 -1
- package/core/context.d.ts.map +1 -1
- package/core/types/ai-table.d.ts +2 -1
- package/core/types/ai-table.d.ts.map +1 -1
- package/core/types/core.d.ts +0 -2
- package/core/types/core.d.ts.map +1 -1
- package/core/utils/common.d.ts.map +1 -1
- package/fesm2022/ai-table-grid.mjs +955 -347
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid-base.component.d.ts +1 -1
- package/grid-base.component.d.ts.map +1 -1
- package/grid.component.d.ts +21 -4
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/renderer/components/cells/attachment.component.d.ts +4 -5
- package/renderer/components/cells/attachment.component.d.ts.map +1 -1
- package/renderer/components/cells/cells.d.ts +2 -2
- package/renderer/components/cells/cells.d.ts.map +1 -1
- package/renderer/components/cells/hover-cell.d.ts +12 -0
- package/renderer/components/cells/hover-cell.d.ts.map +1 -0
- package/renderer/components/cells/link.component.d.ts +5 -6
- package/renderer/components/cells/link.component.d.ts.map +1 -1
- package/renderer/components/cells/progress.component.d.ts +3 -5
- package/renderer/components/cells/progress.component.d.ts.map +1 -1
- package/renderer/components/cells/rate.component.d.ts +3 -5
- package/renderer/components/cells/rate.component.d.ts.map +1 -1
- package/renderer/components/cells/rich-text.component.d.ts +4 -5
- package/renderer/components/cells/rich-text.component.d.ts.map +1 -1
- package/renderer/components/field-head.component.d.ts +1 -0
- package/renderer/components/field-head.component.d.ts.map +1 -1
- package/renderer/components/field-icon.component.d.ts +1 -1
- package/renderer/components/hover-cell.component.d.ts +5 -2
- package/renderer/components/hover-cell.component.d.ts.map +1 -1
- package/renderer/components/index.d.ts +2 -0
- package/renderer/components/index.d.ts.map +1 -1
- package/renderer/components/text.component.d.ts +3 -3
- package/renderer/components/text.component.d.ts.map +1 -1
- package/renderer/creations/create-active-cell-border.d.ts.map +1 -1
- package/renderer/creations/create-cells.d.ts.map +1 -1
- package/renderer/drawers/cell-drawer.d.ts +1 -1
- package/renderer/drawers/cell-drawer.d.ts.map +1 -1
- package/renderer/drawers/record-row-layout-drawer.d.ts.map +1 -1
- package/renderer/index.d.ts +3 -0
- package/renderer/index.d.ts.map +1 -1
- package/renderer/renderer.component.d.ts +4 -1
- package/renderer/renderer.component.d.ts.map +1 -1
- package/services/event.service.d.ts +1 -1
- package/services/event.service.d.ts.map +1 -1
- package/services/scroll-controller.service.d.ts +75 -0
- package/services/scroll-controller.service.d.ts.map +1 -0
- package/services/selection.service.d.ts +3 -5
- package/services/selection.service.d.ts.map +1 -1
- package/styles/styles.scss +30 -0
- package/types/canvas.d.ts +1 -1
- package/types/canvas.d.ts.map +1 -1
- package/types/cell.d.ts +8 -3
- package/types/cell.d.ts.map +1 -1
- package/types/component-config.d.ts +2 -0
- package/types/component-config.d.ts.map +1 -1
- package/types/grid.d.ts +22 -5
- package/types/grid.d.ts.map +1 -1
- package/utils/common.d.ts +1 -0
- package/utils/common.d.ts.map +1 -1
- package/utils/field/field.d.ts +1 -1
- package/utils/field/field.d.ts.map +1 -1
- package/utils/field/index.d.ts +1 -0
- package/utils/field/index.d.ts.map +1 -1
- package/utils/hover-cell.d.ts +2 -1
- package/utils/hover-cell.d.ts.map +1 -1
- package/utils/i18n.d.ts +4 -1
- package/utils/i18n.d.ts.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/utils/transform.d.ts +13 -0
- package/utils/transform.d.ts.map +1 -0
- package/renderer/interfaces/hover-cell.d.ts +0 -8
- package/renderer/interfaces/hover-cell.d.ts.map +0 -1
- package/renderer/interfaces/index.d.ts +0 -2
- package/renderer/interfaces/index.d.ts.map +0 -1
@@ -25,11 +25,11 @@ 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 { AITableFieldType, AITableRowColumnType, isUndefinedOrNull,
|
28
|
+
import { AITableFieldGroup, AITableFieldType, AITableRowColumnType, DragType, isUndefinedOrNull, isUrl, AITableSelectOptionStyle, isEmpty, AITableFilterOperation, AttachmentFieldBase, DateFieldBase, isDateValid, SelectFieldBase, LinkFieldBase, MemberFieldBase, NumberFieldBase, ProgressFieldBase, RateFieldBase, RichTextFieldBase, TextFieldBase, FieldModelBaseMap } from '@ai-table/utils';
|
29
29
|
import ObjectID from 'bson-objectid';
|
30
30
|
import { customAlphabet } from 'nanoid';
|
31
31
|
import * as _ from 'lodash';
|
32
|
-
import { isNumber, includes, values, isString } from 'lodash';
|
32
|
+
import { isNumber, includes, values, isString, isObject } from 'lodash';
|
33
33
|
import * as i1 from '@angular/forms';
|
34
34
|
import { FormsModule } from '@angular/forms';
|
35
35
|
import { ThyDatePicker, ThyDatePickerFormatPipe } from 'ngx-tethys/date-picker';
|
@@ -38,7 +38,7 @@ import { ThyStopPropagationDirective, ThyAutofocusDirective, ThyEnterDirective,
|
|
38
38
|
import * as i3 from 'ngx-tethys/input';
|
39
39
|
import { ThyInputDirective, ThyInputGroup, ThyInputModule, ThyInputCount } from 'ngx-tethys/input';
|
40
40
|
import * as i2$1 from 'ngx-tethys/tooltip';
|
41
|
-
import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
41
|
+
import { ThyTooltipModule, ThyTooltipDirective } from 'ngx-tethys/tooltip';
|
42
42
|
import { ThyAction } from 'ngx-tethys/action';
|
43
43
|
import { ThyFlexibleTextModule, ThyFlexibleText } from 'ngx-tethys/flexible-text';
|
44
44
|
import { ThyButton } from 'ngx-tethys/button';
|
@@ -53,9 +53,9 @@ import { ThySelect, ThySelectModule } from 'ngx-tethys/select';
|
|
53
53
|
import { ThyDot } from 'ngx-tethys/dot';
|
54
54
|
import { ThyIcon } from 'ngx-tethys/icon';
|
55
55
|
import { ThyTag } from 'ngx-tethys/tag';
|
56
|
-
import { ThyDropdownMenuComponent, ThyDropdownDirective, ThyDropdownMenuItemDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownAbstractMenu, ThyDropdownMenuItemMetaDirective } from 'ngx-tethys/dropdown';
|
56
|
+
import { ThyDropdownMenuComponent, ThyDropdownMenuGroup, ThyDropdownDirective, ThyDropdownMenuItemDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownAbstractMenu, ThyDropdownMenuItemMetaDirective } from 'ngx-tethys/dropdown';
|
57
57
|
import { ThySwitch } from 'ngx-tethys/switch';
|
58
|
-
import { of, Subject, fromEvent, debounceTime, mergeWith, filter } from 'rxjs';
|
58
|
+
import { of, Subject, fromEvent, debounceTime, mergeWith, animationFrames, filter } from 'rxjs';
|
59
59
|
import { ThyDivider } from 'ngx-tethys/divider';
|
60
60
|
import * as i4 from 'ngx-tethys/avatar';
|
61
61
|
import { ThyAvatarModule } from 'ngx-tethys/avatar';
|
@@ -67,8 +67,10 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
67
67
|
import { fromUnixTime, subDays } from 'date-fns';
|
68
68
|
import { isArray, TinyDate, helpers } from 'ngx-tethys/util';
|
69
69
|
import { DEFAULT_COLORS } from 'ngx-tethys/color-picker';
|
70
|
+
import { isKeyHotkey } from 'is-hotkey';
|
70
71
|
import { LRUCache } from 'lru-cache';
|
71
72
|
import GraphemeSplitter from 'grapheme-splitter';
|
73
|
+
import { takeWhile, map } from 'rxjs/operators';
|
72
74
|
|
73
75
|
const KO_CONTAINER_TOKEN = new InjectionToken('KO_CONTAINER_TOKEN');
|
74
76
|
|
@@ -529,6 +531,9 @@ var AITableGridI18nKey;
|
|
529
531
|
AITableGridI18nKey["fieldTypeCreatedAt"] = "fieldTypeCreatedAt";
|
530
532
|
AITableGridI18nKey["fieldTypeUpdatedBy"] = "fieldTypeUpdatedBy";
|
531
533
|
AITableGridI18nKey["fieldTypeUpdatedAt"] = "fieldTypeUpdatedAt";
|
534
|
+
AITableGridI18nKey["fieldGroupBase"] = "fieldGroupBase";
|
535
|
+
AITableGridI18nKey["fieldGroupAdvanced"] = "fieldGroupAdvanced";
|
536
|
+
AITableGridI18nKey["rowAddFilterTooltip"] = "rowAddFilterTooltip";
|
532
537
|
})(AITableGridI18nKey || (AITableGridI18nKey = {}));
|
533
538
|
const AITableI18nText = {
|
534
539
|
[AITableGridI18nKey.dataPickerPlaceholder]: '选择日期',
|
@@ -566,7 +571,10 @@ const AITableI18nText = {
|
|
566
571
|
[AITableGridI18nKey.fieldTypeCreatedBy]: '创建人',
|
567
572
|
[AITableGridI18nKey.fieldTypeCreatedAt]: '创建时间',
|
568
573
|
[AITableGridI18nKey.fieldTypeUpdatedBy]: '更新人',
|
569
|
-
[AITableGridI18nKey.fieldTypeUpdatedAt]: '更新时间'
|
574
|
+
[AITableGridI18nKey.fieldTypeUpdatedAt]: '更新时间',
|
575
|
+
[AITableGridI18nKey.fieldGroupBase]: '基础',
|
576
|
+
[AITableGridI18nKey.fieldGroupAdvanced]: '高级',
|
577
|
+
[AITableGridI18nKey.rowAddFilterTooltip]: '本记录已被筛选过滤,点击该记录以外位置将被隐藏'
|
570
578
|
};
|
571
579
|
const getDefaultI18nTextByKey = (key) => {
|
572
580
|
return AITableI18nText[key] || key;
|
@@ -586,105 +594,124 @@ const AI_TABLE_FIELD_MINI_WIDTH = 140;
|
|
586
594
|
const AI_TABLE_FIELD_MIN_WIDTH = 160;
|
587
595
|
const AI_TABLE_FIELD_MIDDLE_WIDTH = 200;
|
588
596
|
const AI_TABLE_FIELD_MAX_WIDTH = 300;
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
{
|
619
|
-
type: AITableFieldType.number,
|
620
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeNumber),
|
621
|
-
icon: 'hashtag',
|
622
|
-
width: AI_TABLE_FIELD_MINI_WIDTH
|
623
|
-
},
|
624
|
-
{
|
625
|
-
type: AITableFieldType.date,
|
626
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeDate),
|
627
|
-
icon: 'calendar',
|
628
|
-
width: AI_TABLE_FIELD_MIDDLE_WIDTH
|
629
|
-
},
|
630
|
-
{
|
631
|
-
type: AITableFieldType.member,
|
632
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeMember),
|
633
|
-
icon: 'user',
|
634
|
-
width: AI_TABLE_FIELD_MIN_WIDTH,
|
635
|
-
settings: {
|
636
|
-
is_multiple: false
|
637
|
-
}
|
638
|
-
},
|
639
|
-
{
|
640
|
-
type: AITableFieldType.progress,
|
641
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeProgress),
|
642
|
-
icon: 'progress',
|
643
|
-
width: AI_TABLE_FIELD_MIDDLE_WIDTH
|
644
|
-
},
|
645
|
-
{
|
646
|
-
type: AITableFieldType.rate,
|
647
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeRate),
|
648
|
-
icon: 'star-circle',
|
649
|
-
width: AI_TABLE_FIELD_MIN_WIDTH
|
650
|
-
},
|
651
|
-
{
|
652
|
-
type: AITableFieldType.link,
|
653
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeLink),
|
654
|
-
icon: 'link-insert',
|
655
|
-
width: AI_TABLE_FIELD_MIDDLE_WIDTH
|
656
|
-
},
|
657
|
-
{
|
658
|
-
type: AITableFieldType.attachment,
|
659
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeAttachment),
|
660
|
-
icon: 'attachment',
|
661
|
-
width: AI_TABLE_FIELD_MIDDLE_WIDTH
|
662
|
-
},
|
663
|
-
{
|
664
|
-
type: AITableFieldType.createdBy,
|
665
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeCreatedBy),
|
666
|
-
icon: 'user',
|
667
|
-
width: AI_TABLE_FIELD_MIN_WIDTH
|
668
|
-
},
|
669
|
-
{
|
670
|
-
type: AITableFieldType.createdAt,
|
671
|
-
name: getI18nTextByKey(aiTable, AITableGridI18nKey.fieldTypeCreatedAt),
|
672
|
-
icon: 'calendar',
|
673
|
-
width: AI_TABLE_FIELD_MIDDLE_WIDTH
|
597
|
+
const defaultFieldOptions = [
|
598
|
+
{
|
599
|
+
type: AITableFieldType.text,
|
600
|
+
name: AITableGridI18nKey.fieldTypeText,
|
601
|
+
icon: 'font',
|
602
|
+
width: AI_TABLE_FIELD_MAX_WIDTH,
|
603
|
+
group: AITableFieldGroup.base
|
604
|
+
},
|
605
|
+
{
|
606
|
+
type: AITableFieldType.richText,
|
607
|
+
name: AITableGridI18nKey.fieldTypeRichText,
|
608
|
+
icon: 'multiline-text',
|
609
|
+
width: AI_TABLE_FIELD_MAX_WIDTH,
|
610
|
+
group: AITableFieldGroup.base
|
611
|
+
},
|
612
|
+
{
|
613
|
+
type: AITableFieldType.select,
|
614
|
+
name: AITableGridI18nKey.fieldTypeSelect,
|
615
|
+
icon: 'check-circle',
|
616
|
+
width: AI_TABLE_FIELD_MIN_WIDTH,
|
617
|
+
group: AITableFieldGroup.base
|
618
|
+
},
|
619
|
+
{
|
620
|
+
type: AITableFieldType.select,
|
621
|
+
name: AITableGridI18nKey.fieldTypeMultiSelect,
|
622
|
+
icon: 'list-check',
|
623
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
624
|
+
settings: {
|
625
|
+
is_multiple: true
|
674
626
|
},
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
627
|
+
group: AITableFieldGroup.base
|
628
|
+
},
|
629
|
+
{
|
630
|
+
type: AITableFieldType.number,
|
631
|
+
name: AITableGridI18nKey.fieldTypeNumber,
|
632
|
+
icon: 'hashtag',
|
633
|
+
width: AI_TABLE_FIELD_MINI_WIDTH,
|
634
|
+
group: AITableFieldGroup.base
|
635
|
+
},
|
636
|
+
{
|
637
|
+
type: AITableFieldType.date,
|
638
|
+
name: AITableGridI18nKey.fieldTypeDate,
|
639
|
+
icon: 'calendar',
|
640
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
641
|
+
group: AITableFieldGroup.base
|
642
|
+
},
|
643
|
+
{
|
644
|
+
type: AITableFieldType.member,
|
645
|
+
name: AITableGridI18nKey.fieldTypeMember,
|
646
|
+
icon: 'user',
|
647
|
+
width: AI_TABLE_FIELD_MIN_WIDTH,
|
648
|
+
settings: {
|
649
|
+
is_multiple: false
|
680
650
|
},
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
651
|
+
group: AITableFieldGroup.base
|
652
|
+
},
|
653
|
+
{
|
654
|
+
type: AITableFieldType.progress,
|
655
|
+
name: AITableGridI18nKey.fieldTypeProgress,
|
656
|
+
icon: 'progress',
|
657
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
658
|
+
group: AITableFieldGroup.base
|
659
|
+
},
|
660
|
+
{
|
661
|
+
type: AITableFieldType.rate,
|
662
|
+
name: AITableGridI18nKey.fieldTypeRate,
|
663
|
+
icon: 'star-circle',
|
664
|
+
width: AI_TABLE_FIELD_MIN_WIDTH,
|
665
|
+
group: AITableFieldGroup.base
|
666
|
+
},
|
667
|
+
{
|
668
|
+
type: AITableFieldType.link,
|
669
|
+
name: AITableGridI18nKey.fieldTypeLink,
|
670
|
+
icon: 'link-insert',
|
671
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
672
|
+
group: AITableFieldGroup.base
|
673
|
+
},
|
674
|
+
{
|
675
|
+
type: AITableFieldType.attachment,
|
676
|
+
name: AITableGridI18nKey.fieldTypeAttachment,
|
677
|
+
icon: 'attachment',
|
678
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
679
|
+
group: AITableFieldGroup.base
|
680
|
+
},
|
681
|
+
{
|
682
|
+
type: AITableFieldType.createdBy,
|
683
|
+
name: AITableGridI18nKey.fieldTypeCreatedBy,
|
684
|
+
icon: 'user',
|
685
|
+
width: AI_TABLE_FIELD_MIN_WIDTH,
|
686
|
+
group: AITableFieldGroup.advanced
|
687
|
+
},
|
688
|
+
{
|
689
|
+
type: AITableFieldType.createdAt,
|
690
|
+
name: AITableGridI18nKey.fieldTypeCreatedAt,
|
691
|
+
icon: 'calendar',
|
692
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
693
|
+
group: AITableFieldGroup.advanced
|
694
|
+
},
|
695
|
+
{
|
696
|
+
type: AITableFieldType.updatedBy,
|
697
|
+
name: AITableGridI18nKey.fieldTypeUpdatedBy,
|
698
|
+
icon: 'user',
|
699
|
+
width: AI_TABLE_FIELD_MIN_WIDTH,
|
700
|
+
group: AITableFieldGroup.advanced
|
701
|
+
},
|
702
|
+
{
|
703
|
+
type: AITableFieldType.updatedAt,
|
704
|
+
name: AITableGridI18nKey.fieldTypeUpdatedAt,
|
705
|
+
icon: 'calendar',
|
706
|
+
width: AI_TABLE_FIELD_MIDDLE_WIDTH,
|
707
|
+
group: AITableFieldGroup.advanced
|
708
|
+
}
|
709
|
+
];
|
710
|
+
function getFieldOptions(aiTable) {
|
711
|
+
return aiTable.context?.fieldOptions();
|
712
|
+
}
|
713
|
+
function getFieldOptionMap(aiTable) {
|
714
|
+
return aiTable.context?.fieldOptionMap();
|
688
715
|
}
|
689
716
|
|
690
717
|
/**
|
@@ -980,6 +1007,9 @@ const AITable = {
|
|
980
1007
|
return true;
|
981
1008
|
}
|
982
1009
|
return false;
|
1010
|
+
},
|
1011
|
+
getDragState(aiTable) {
|
1012
|
+
return aiTable.dragState?.()?.type || DragType.none;
|
983
1013
|
}
|
984
1014
|
};
|
985
1015
|
|
@@ -1120,6 +1150,7 @@ function createAITable(records, fields, gridData) {
|
|
1120
1150
|
selectedFields: new Set(),
|
1121
1151
|
selectedCells: new Set(),
|
1122
1152
|
activeCell: null,
|
1153
|
+
expandCell: null,
|
1123
1154
|
selectAllState: AITableSelectAllState.none
|
1124
1155
|
}),
|
1125
1156
|
keywordsMatchedCells: signal(new Set()),
|
@@ -1136,7 +1167,11 @@ function createAITable(records, fields, gridData) {
|
|
1136
1167
|
}, {});
|
1137
1168
|
}),
|
1138
1169
|
recordsWillHidden: signal([]),
|
1139
|
-
recordsWillMove: signal([])
|
1170
|
+
recordsWillMove: signal([]),
|
1171
|
+
dragState: signal({
|
1172
|
+
type: DragType.none,
|
1173
|
+
sourceIds: new Set()
|
1174
|
+
})
|
1140
1175
|
};
|
1141
1176
|
return aiTable;
|
1142
1177
|
}
|
@@ -1292,7 +1327,7 @@ const AITableQueries = {
|
|
1292
1327
|
|
1293
1328
|
class RendererContext {
|
1294
1329
|
constructor(options) {
|
1295
|
-
const { rowHeadWidth, linearRows, pointPosition, scrollState, visibleColumnsIndexMap, visibleRowsIndexMap, frozenColumnCount, references, aiFieldConfig, scrollAction, maxFields, maxRecords } = options;
|
1330
|
+
const { rowHeadWidth, linearRows, pointPosition, scrollState, visibleColumnsIndexMap, visibleRowsIndexMap, frozenColumnCount, references, aiFieldConfig, scrollAction, maxFields, maxRecords, fieldOptions, fieldOptionMap } = options;
|
1296
1331
|
this.rowHeadWidth = rowHeadWidth;
|
1297
1332
|
this.linearRows = linearRows;
|
1298
1333
|
this.pointPosition = pointPosition;
|
@@ -1305,6 +1340,8 @@ class RendererContext {
|
|
1305
1340
|
this.aiFieldConfig = aiFieldConfig;
|
1306
1341
|
this.maxFields = maxFields;
|
1307
1342
|
this.maxRecords = maxRecords;
|
1343
|
+
this.fieldOptions = fieldOptions;
|
1344
|
+
this.fieldOptionMap = fieldOptionMap;
|
1308
1345
|
}
|
1309
1346
|
setPointPosition(position) {
|
1310
1347
|
const oldPosition = this.pointPosition();
|
@@ -1449,7 +1486,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
1449
1486
|
}]
|
1450
1487
|
}] });
|
1451
1488
|
|
1452
|
-
const LINK_URL_REGEX = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
|
1453
1489
|
/**
|
1454
1490
|
* @private
|
1455
1491
|
*/
|
@@ -1460,7 +1496,6 @@ class LinkEditComponent {
|
|
1460
1496
|
this.text = '';
|
1461
1497
|
this.aiTable = input();
|
1462
1498
|
this.confirm = new EventEmitter();
|
1463
|
-
this.URLRegex = LINK_URL_REGEX;
|
1464
1499
|
this.i18nTexts = computed(() => {
|
1465
1500
|
return {
|
1466
1501
|
linkText: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.linkText),
|
@@ -1490,6 +1525,10 @@ class LinkEditComponent {
|
|
1490
1525
|
form.validator.setElementErrorMessage('url', getI18nTextByKey(this.aiTable(), AITableGridI18nKey.linkRequired));
|
1491
1526
|
return;
|
1492
1527
|
}
|
1528
|
+
if (this.url && !isUrl(this.url)) {
|
1529
|
+
form.validator.setElementErrorMessage('url', getI18nTextByKey(this.aiTable(), AITableGridI18nKey.invalidLinkFormat));
|
1530
|
+
return;
|
1531
|
+
}
|
1493
1532
|
this.close();
|
1494
1533
|
const text = this.text.trim();
|
1495
1534
|
const url = this.url.trim();
|
@@ -1497,11 +1536,11 @@ class LinkEditComponent {
|
|
1497
1536
|
this.confirm.emit(link);
|
1498
1537
|
}
|
1499
1538
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: LinkEditComponent, deps: [{ token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
1500
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: LinkEditComponent, isStandalone: true, selector: "link-edit", inputs: { url: { classPropertyName: "url", publicName: "url", isSignal: false, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: false, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirm: "confirm" }, ngImport: i0, template: "<form\n thyLayout=\"vertical\"\n thyStopPropagation\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig()\"\n name=\"linkForm\"\n class=\"p-5\"\n>\n <thy-form-group [thyLabelText]=\"i18nTexts().linkText\">\n <input thyInput [placeholder]=\"i18nTexts().textPlaceholder\" name=\"text\" [(ngModel)]=\"text\" />\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().urlLabel\">\n <input name=\"url\" thyInput [placeholder]=\"i18nTexts().urlPlaceholder\"
|
1539
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: LinkEditComponent, isStandalone: true, selector: "link-edit", inputs: { url: { classPropertyName: "url", publicName: "url", isSignal: false, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: false, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirm: "confirm" }, ngImport: i0, template: "<form\n thyLayout=\"vertical\"\n thyStopPropagation\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig()\"\n name=\"linkForm\"\n class=\"p-5\"\n>\n <thy-form-group [thyLabelText]=\"i18nTexts().linkText\">\n <input thyInput [placeholder]=\"i18nTexts().textPlaceholder\" name=\"text\" [(ngModel)]=\"text\" />\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().urlLabel\">\n <input name=\"url\" thyInput [placeholder]=\"i18nTexts().urlPlaceholder\" type=\"text\" [(ngModel)]=\"url\" />\n </thy-form-group>\n <thy-form-group-footer thyAlign=\"right\">\n <div class=\"btn-pair\">\n <button thyStopPropagation thyButton=\"link-secondary\" thySize=\"sm\" (click)=\"close()\">{{ i18nTexts().cancel }}</button>\n <button thyStopPropagation thyButton=\"primary\" thySize=\"sm\" (thyFormSubmit)=\"apply(linkForm)\">{{ i18nTexts().apply }}</button>\n </div>\n </thy-form-group-footer>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: ThyStopPropagationDirective, selector: "[thyStopPropagation]", inputs: ["thyStopPropagation"] }, { kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }, { kind: "directive", type: ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }, { kind: "ngmodule", type: ThyFormModule }, { kind: "directive", type: i2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { kind: "component", type: i2.ThyFormGroup, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { kind: "component", type: i2.ThyFormGroupFooter, selector: "thy-form-group-footer", inputs: ["thyAlign"] }] }); }
|
1501
1540
|
}
|
1502
1541
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: LinkEditComponent, decorators: [{
|
1503
1542
|
type: Component,
|
1504
|
-
args: [{ selector: 'link-edit', imports: [FormsModule, ThyStopPropagationDirective, ThyInputDirective, ThyButton, ThyFormSubmitDirective, ThyFormModule], template: "<form\n thyLayout=\"vertical\"\n thyStopPropagation\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig()\"\n name=\"linkForm\"\n class=\"p-5\"\n>\n <thy-form-group [thyLabelText]=\"i18nTexts().linkText\">\n <input thyInput [placeholder]=\"i18nTexts().textPlaceholder\" name=\"text\" [(ngModel)]=\"text\" />\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().urlLabel\">\n <input name=\"url\" thyInput [placeholder]=\"i18nTexts().urlPlaceholder\"
|
1543
|
+
args: [{ selector: 'link-edit', imports: [FormsModule, ThyStopPropagationDirective, ThyInputDirective, ThyButton, ThyFormSubmitDirective, ThyFormModule], template: "<form\n thyLayout=\"vertical\"\n thyStopPropagation\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig()\"\n name=\"linkForm\"\n class=\"p-5\"\n>\n <thy-form-group [thyLabelText]=\"i18nTexts().linkText\">\n <input thyInput [placeholder]=\"i18nTexts().textPlaceholder\" name=\"text\" [(ngModel)]=\"text\" />\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().urlLabel\">\n <input name=\"url\" thyInput [placeholder]=\"i18nTexts().urlPlaceholder\" type=\"text\" [(ngModel)]=\"url\" />\n </thy-form-group>\n <thy-form-group-footer thyAlign=\"right\">\n <div class=\"btn-pair\">\n <button thyStopPropagation thyButton=\"link-secondary\" thySize=\"sm\" (click)=\"close()\">{{ i18nTexts().cancel }}</button>\n <button thyStopPropagation thyButton=\"primary\" thySize=\"sm\" (thyFormSubmit)=\"apply(linkForm)\">{{ i18nTexts().apply }}</button>\n </div>\n </thy-form-group-footer>\n</form>\n" }]
|
1505
1544
|
}], ctorParameters: () => [{ type: i1$1.ThyPopoverRef }], propDecorators: { url: [{
|
1506
1545
|
type: Input
|
1507
1546
|
}], text: [{
|
@@ -1525,13 +1564,10 @@ class LinkCellEditorComponent extends AbstractEditCellEditor {
|
|
1525
1564
|
});
|
1526
1565
|
}
|
1527
1566
|
isValidLink(link) {
|
1528
|
-
if (!link
|
1567
|
+
if (!link.text) {
|
1529
1568
|
return true;
|
1530
1569
|
}
|
1531
|
-
|
1532
|
-
return LINK_URL_REGEX.test(link.text);
|
1533
|
-
}
|
1534
|
-
return true;
|
1570
|
+
return isUrl(link.text);
|
1535
1571
|
}
|
1536
1572
|
createLinkValue(link) {
|
1537
1573
|
const text = link?.text?.trim();
|
@@ -1557,11 +1593,12 @@ class LinkCellEditorComponent extends AbstractEditCellEditor {
|
|
1557
1593
|
this.url = this.modelValue?.url ?? '';
|
1558
1594
|
}
|
1559
1595
|
updateValue() {
|
1560
|
-
|
1596
|
+
const linkValue = this.createLinkValue({ text: this.text, url: this.url ?? '' });
|
1597
|
+
if (!this.isValidLink(linkValue)) {
|
1561
1598
|
this.notifyService.error(getI18nTextByKey(this.aiTable, AITableGridI18nKey.invalidLinkFormat));
|
1562
1599
|
return;
|
1563
1600
|
}
|
1564
|
-
this.modelValue =
|
1601
|
+
this.modelValue = linkValue;
|
1565
1602
|
if (!_.isEqual(this.originValue, this.modelValue)) {
|
1566
1603
|
super.update();
|
1567
1604
|
this.originValue = this.modelValue;
|
@@ -1734,11 +1771,13 @@ class TextCellEditorComponent extends AbstractEditCellEditor {
|
|
1734
1771
|
this.render2 = inject(Renderer2);
|
1735
1772
|
this.maxHeight = 148;
|
1736
1773
|
this.minHeight = 24;
|
1774
|
+
this.isSelectAll = input(false);
|
1737
1775
|
}
|
1738
1776
|
ngAfterViewInit() {
|
1739
1777
|
setTimeout(() => {
|
1740
1778
|
this.updateStyle();
|
1741
|
-
|
1779
|
+
this.handleSelectAll();
|
1780
|
+
}, 0);
|
1742
1781
|
}
|
1743
1782
|
updateStyle() {
|
1744
1783
|
const textarea = this.elementRef.nativeElement.querySelector('textarea');
|
@@ -1751,6 +1790,12 @@ class TextCellEditorComponent extends AbstractEditCellEditor {
|
|
1751
1790
|
this.render2.setStyle(textarea, 'resize', 'none');
|
1752
1791
|
}
|
1753
1792
|
}
|
1793
|
+
handleSelectAll() {
|
1794
|
+
if (this.isSelectAll()) {
|
1795
|
+
const textarea = this.elementRef.nativeElement.querySelector('textarea');
|
1796
|
+
textarea.select();
|
1797
|
+
}
|
1798
|
+
}
|
1754
1799
|
valueChange() {
|
1755
1800
|
this.updateStyle();
|
1756
1801
|
}
|
@@ -1759,8 +1804,9 @@ class TextCellEditorComponent extends AbstractEditCellEditor {
|
|
1759
1804
|
this.closePopover();
|
1760
1805
|
}
|
1761
1806
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: TextCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1762
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
1807
|
+
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: `
|
1763
1808
|
<textarea
|
1809
|
+
#textarea
|
1764
1810
|
placeholder=""
|
1765
1811
|
rows="1"
|
1766
1812
|
thyInput
|
@@ -1778,6 +1824,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
1778
1824
|
selector: 'text-cell-editor',
|
1779
1825
|
template: `
|
1780
1826
|
<textarea
|
1827
|
+
#textarea
|
1781
1828
|
placeholder=""
|
1782
1829
|
rows="1"
|
1783
1830
|
thyInput
|
@@ -1919,7 +1966,8 @@ class AITableFieldSetting {
|
|
1919
1966
|
};
|
1920
1967
|
});
|
1921
1968
|
this.fieldOptions = computed(() => {
|
1922
|
-
|
1969
|
+
const fieldOptions = getFieldOptions(this.aiTable());
|
1970
|
+
return _.groupBy(fieldOptions, 'group');
|
1923
1971
|
});
|
1924
1972
|
this.aITableFieldType = AITableFieldType;
|
1925
1973
|
this.isMultipleMember = false;
|
@@ -1938,7 +1986,9 @@ class AITableFieldSetting {
|
|
1938
1986
|
fieldType: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldType),
|
1939
1987
|
allowMultipleMembers: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.allowMultipleMembers),
|
1940
1988
|
cancel: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.cancel),
|
1941
|
-
confirm: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.confirm)
|
1989
|
+
confirm: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.confirm),
|
1990
|
+
base: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldGroupBase),
|
1991
|
+
advanced: getI18nTextByKey(this.aiTable(), AITableGridI18nKey.fieldGroupAdvanced)
|
1942
1992
|
};
|
1943
1993
|
});
|
1944
1994
|
}
|
@@ -1990,7 +2040,7 @@ class AITableFieldSetting {
|
|
1990
2040
|
this.thyPopoverRef.close();
|
1991
2041
|
}
|
1992
2042
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldSetting, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1993
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFieldSetting, isStandalone: true, selector: "ai-table-field-setting", inputs: { aiEditField: { classPropertyName: "aiEditField", publicName: "aiEditField", isSignal: true, isRequired: true, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: true, transformFunction: null }, aiExternalTemplate: { classPropertyName: "aiExternalTemplate", publicName: "aiExternalTemplate", isSignal: true, isRequired: false, transformFunction: null }, isUpdate: { classPropertyName: "isUpdate", publicName: "isUpdate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiEditField: "aiEditFieldChange", addField: "addField", setField: "setField" }, host: { classAttribute: "field-setting d-block pl-5 pr-5 pb-5 pt-4" }, ngImport: i0, template: "<form thyForm name=\"createPropertyForm\" [thyFormValidatorConfig]=\"validatorConfig()\" thyLayout=\"vertical\">\n <thy-form-group thyLabelRequired [thyLabelText]=\"i18nTexts().columnName\">\n <thy-input-group>\n <input\n thyInput\n [thyAutofocus]=\"true\"\n name=\"fieldName\"\n [maxlength]=\"fieldMaxLength\"\n [(ngModel)]=\"aiEditField().name\"\n (ngModelChange)=\"nameChange($event)\"\n required\n [placeholder]=\"i18nTexts().columnNamePlaceholder\"\n [thyUniqueCheck]=\"checkUniqueName\"\n />\n <ng-template #suffix>\n <thy-input-count></thy-input-count>\n </ng-template>\n </thy-input-group>\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().fieldType\">\n <div class=\"thy-dropdown-menu py-0\">\n <div class=\"ml-n5 mr-n5\">\n <span\n thyDropdownMenuItem\n [thyDropdown]=\"menu\"\n [thyDisabled]=\"isUpdate()\"\n thyTrigger=\"hover\"\n thyPlacement=\"right\"\n (click)=\"fieldTypeClick($event)\"\n >\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"selectedFieldOption().icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ selectedFieldOption().name }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\" class=\"text-desc\"></thy-icon>\n </span>\n </div>\n </div>\n\n @if (selectedFieldOption().type === aITableFieldType.member) {\n <div class=\"d-flex justify-content-between mt-3\">\n {{ i18nTexts().allowMultipleMembers }}\n <thy-switch\n name=\"isMultipleMember\"\n [thyDisabled]=\"isUpdate()\"\n [(ngModel)]=\"isMultipleMember\"\n (ngModelChange)=\"multipleMemberChange()\"\n thySize=\"sm\"\n ></thy-switch>\n </div>\n }\n </thy-form-group>\n @if (aiExternalTemplate()) {\n <ng-container *ngTemplateOutlet=\"aiExternalTemplate()\"></ng-container>\n }\n <thy-form-group-footer thyAlign=\"right\">\n <button thyButton=\"link-secondary\" (click)=\"cancel()\" thySize=\"sm\">{{ i18nTexts().cancel }}</button>\n <button thyButton=\"primary\" (thyFormSubmit)=\"editFieldProperty()\" thySize=\"sm\">{{ i18nTexts().confirm }}</button>\n </thy-form-group-footer>\n</form>\n\n<thy-dropdown-menu #menu>\n @for (item of fieldOptions(); track $index) {\n
|
2043
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFieldSetting, isStandalone: true, selector: "ai-table-field-setting", inputs: { aiEditField: { classPropertyName: "aiEditField", publicName: "aiEditField", isSignal: true, isRequired: true, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: true, transformFunction: null }, aiExternalTemplate: { classPropertyName: "aiExternalTemplate", publicName: "aiExternalTemplate", isSignal: true, isRequired: false, transformFunction: null }, isUpdate: { classPropertyName: "isUpdate", publicName: "isUpdate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiEditField: "aiEditFieldChange", addField: "addField", setField: "setField" }, host: { classAttribute: "field-setting d-block pl-5 pr-5 pb-5 pt-4" }, ngImport: i0, template: "<form thyForm name=\"createPropertyForm\" [thyFormValidatorConfig]=\"validatorConfig()\" thyLayout=\"vertical\">\n <thy-form-group thyLabelRequired [thyLabelText]=\"i18nTexts().columnName\">\n <thy-input-group>\n <input\n thyInput\n [thyAutofocus]=\"true\"\n name=\"fieldName\"\n [maxlength]=\"fieldMaxLength\"\n [(ngModel)]=\"aiEditField().name\"\n (ngModelChange)=\"nameChange($event)\"\n required\n [placeholder]=\"i18nTexts().columnNamePlaceholder\"\n [thyUniqueCheck]=\"checkUniqueName\"\n />\n <ng-template #suffix>\n <thy-input-count></thy-input-count>\n </ng-template>\n </thy-input-group>\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().fieldType\">\n <div class=\"thy-dropdown-menu py-0\">\n <div class=\"ml-n5 mr-n5\">\n <span\n thyDropdownMenuItem\n [thyDropdown]=\"menu\"\n [thyDisabled]=\"isUpdate()\"\n thyTrigger=\"hover\"\n thyPlacement=\"right\"\n (click)=\"fieldTypeClick($event)\"\n >\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"selectedFieldOption().icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ selectedFieldOption().name }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\" class=\"text-desc\"></thy-icon>\n </span>\n </div>\n </div>\n\n @if (selectedFieldOption().type === aITableFieldType.member) {\n <div class=\"d-flex justify-content-between mt-3\">\n {{ i18nTexts().allowMultipleMembers }}\n <thy-switch\n name=\"isMultipleMember\"\n [thyDisabled]=\"isUpdate()\"\n [(ngModel)]=\"isMultipleMember\"\n (ngModelChange)=\"multipleMemberChange()\"\n thySize=\"sm\"\n ></thy-switch>\n </div>\n }\n </thy-form-group>\n @if (aiExternalTemplate()) {\n <ng-container *ngTemplateOutlet=\"aiExternalTemplate()\"></ng-container>\n }\n <thy-form-group-footer thyAlign=\"right\">\n <button thyButton=\"link-secondary\" (click)=\"cancel()\" thySize=\"sm\">{{ i18nTexts().cancel }}</button>\n <button thyButton=\"primary\" (thyFormSubmit)=\"editFieldProperty()\" thySize=\"sm\">{{ i18nTexts().confirm }}</button>\n </thy-form-group-footer>\n</form>\n\n<thy-dropdown-menu #menu>\n <thy-dropdown-menu-group [thyTitle]=\"i18nTexts().base\">\n @for (item of fieldOptions().base; track $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: (item | fieldIsSameOption: aiEditField())\n }\"\n (click)=\"selectFieldType(item)\"\n >\n <thy-icon [thyIconName]=\"item.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ item.name }}</span>\n </a>\n }\n </thy-dropdown-menu-group>\n\n <thy-dropdown-menu-group [thyTitle]=\"i18nTexts().advanced\">\n @for (item of fieldOptions().advanced; track $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: (item | fieldIsSameOption: aiEditField())\n }\"\n (click)=\"selectFieldType(item)\"\n >\n <thy-icon [thyIconName]=\"item.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ item.name }}</span>\n </a>\n }\n </thy-dropdown-menu-group>\n</thy-dropdown-menu>\n", styles: [":host{width:350px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: ThyInputGroup, selector: "thy-input-group", inputs: ["thyAppendText", "thyAppendTextTranslateKey", "thyPrependText", "thyPrependTextTranslateKey", "thySize"] }, { kind: "component", type: ThyInputCount, selector: "thy-input-count", inputs: ["thyInput"] }, { kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "directive", type: ThyUniqueCheckValidator, selector: "[thyUniqueCheck]", inputs: ["thyUniqueCheck"] }, { kind: "component", type: ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }, { kind: "component", type: ThyDropdownMenuGroup, selector: "thy-dropdown-menu-group", inputs: ["thyTitle"] }, { kind: "directive", type: ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyShowDelay", "thyHideDelay", "thyActiveClass", "thyPopoverOptions", "thyPlacement", "thyMenuInsideClosable", "thyPanelClass"], outputs: ["thyActiveChange"] }, { kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: ThyDropdownMenuItemExtendIconDirective, selector: "[thyDropdownMenuItemExtendIcon]" }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "ngmodule", type: ThyFormModule }, { kind: "directive", type: i2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { kind: "component", type: i2.ThyFormGroup, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { kind: "directive", type: i2.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }, { kind: "component", type: i2.ThyFormGroupFooter, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutofocus", "thyAutoSelect"] }, { kind: "pipe", type: AITableFieldIsSameOptionPipe, name: "fieldIsSameOption" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1994
2044
|
}
|
1995
2045
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldSetting, decorators: [{
|
1996
2046
|
type: Component,
|
@@ -2003,6 +2053,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
2003
2053
|
ThyInputDirective,
|
2004
2054
|
ThyUniqueCheckValidator,
|
2005
2055
|
ThyDropdownMenuComponent,
|
2056
|
+
ThyDropdownMenuGroup,
|
2006
2057
|
ThyDropdownDirective,
|
2007
2058
|
ThyDropdownMenuItemDirective,
|
2008
2059
|
ThyDropdownMenuItemIconDirective,
|
@@ -2016,7 +2067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
2016
2067
|
AITableFieldIsSameOptionPipe
|
2017
2068
|
], host: {
|
2018
2069
|
class: 'field-setting d-block pl-5 pr-5 pb-5 pt-4'
|
2019
|
-
}, template: "<form thyForm name=\"createPropertyForm\" [thyFormValidatorConfig]=\"validatorConfig()\" thyLayout=\"vertical\">\n <thy-form-group thyLabelRequired [thyLabelText]=\"i18nTexts().columnName\">\n <thy-input-group>\n <input\n thyInput\n [thyAutofocus]=\"true\"\n name=\"fieldName\"\n [maxlength]=\"fieldMaxLength\"\n [(ngModel)]=\"aiEditField().name\"\n (ngModelChange)=\"nameChange($event)\"\n required\n [placeholder]=\"i18nTexts().columnNamePlaceholder\"\n [thyUniqueCheck]=\"checkUniqueName\"\n />\n <ng-template #suffix>\n <thy-input-count></thy-input-count>\n </ng-template>\n </thy-input-group>\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().fieldType\">\n <div class=\"thy-dropdown-menu py-0\">\n <div class=\"ml-n5 mr-n5\">\n <span\n thyDropdownMenuItem\n [thyDropdown]=\"menu\"\n [thyDisabled]=\"isUpdate()\"\n thyTrigger=\"hover\"\n thyPlacement=\"right\"\n (click)=\"fieldTypeClick($event)\"\n >\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"selectedFieldOption().icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ selectedFieldOption().name }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\" class=\"text-desc\"></thy-icon>\n </span>\n </div>\n </div>\n\n @if (selectedFieldOption().type === aITableFieldType.member) {\n <div class=\"d-flex justify-content-between mt-3\">\n {{ i18nTexts().allowMultipleMembers }}\n <thy-switch\n name=\"isMultipleMember\"\n [thyDisabled]=\"isUpdate()\"\n [(ngModel)]=\"isMultipleMember\"\n (ngModelChange)=\"multipleMemberChange()\"\n thySize=\"sm\"\n ></thy-switch>\n </div>\n }\n </thy-form-group>\n @if (aiExternalTemplate()) {\n <ng-container *ngTemplateOutlet=\"aiExternalTemplate()\"></ng-container>\n }\n <thy-form-group-footer thyAlign=\"right\">\n <button thyButton=\"link-secondary\" (click)=\"cancel()\" thySize=\"sm\">{{ i18nTexts().cancel }}</button>\n <button thyButton=\"primary\" (thyFormSubmit)=\"editFieldProperty()\" thySize=\"sm\">{{ i18nTexts().confirm }}</button>\n </thy-form-group-footer>\n</form>\n\n<thy-dropdown-menu #menu>\n @for (item of fieldOptions(); track $index) {\n
|
2070
|
+
}, template: "<form thyForm name=\"createPropertyForm\" [thyFormValidatorConfig]=\"validatorConfig()\" thyLayout=\"vertical\">\n <thy-form-group thyLabelRequired [thyLabelText]=\"i18nTexts().columnName\">\n <thy-input-group>\n <input\n thyInput\n [thyAutofocus]=\"true\"\n name=\"fieldName\"\n [maxlength]=\"fieldMaxLength\"\n [(ngModel)]=\"aiEditField().name\"\n (ngModelChange)=\"nameChange($event)\"\n required\n [placeholder]=\"i18nTexts().columnNamePlaceholder\"\n [thyUniqueCheck]=\"checkUniqueName\"\n />\n <ng-template #suffix>\n <thy-input-count></thy-input-count>\n </ng-template>\n </thy-input-group>\n </thy-form-group>\n <thy-form-group [thyLabelText]=\"i18nTexts().fieldType\">\n <div class=\"thy-dropdown-menu py-0\">\n <div class=\"ml-n5 mr-n5\">\n <span\n thyDropdownMenuItem\n [thyDropdown]=\"menu\"\n [thyDisabled]=\"isUpdate()\"\n thyTrigger=\"hover\"\n thyPlacement=\"right\"\n (click)=\"fieldTypeClick($event)\"\n >\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"selectedFieldOption().icon\"></thy-icon>\n <span thyDropdownMenuItemName>{{ selectedFieldOption().name }}</span>\n <thy-icon thyDropdownMenuItemExtendIcon thyIconName=\"angle-right\" class=\"text-desc\"></thy-icon>\n </span>\n </div>\n </div>\n\n @if (selectedFieldOption().type === aITableFieldType.member) {\n <div class=\"d-flex justify-content-between mt-3\">\n {{ i18nTexts().allowMultipleMembers }}\n <thy-switch\n name=\"isMultipleMember\"\n [thyDisabled]=\"isUpdate()\"\n [(ngModel)]=\"isMultipleMember\"\n (ngModelChange)=\"multipleMemberChange()\"\n thySize=\"sm\"\n ></thy-switch>\n </div>\n }\n </thy-form-group>\n @if (aiExternalTemplate()) {\n <ng-container *ngTemplateOutlet=\"aiExternalTemplate()\"></ng-container>\n }\n <thy-form-group-footer thyAlign=\"right\">\n <button thyButton=\"link-secondary\" (click)=\"cancel()\" thySize=\"sm\">{{ i18nTexts().cancel }}</button>\n <button thyButton=\"primary\" (thyFormSubmit)=\"editFieldProperty()\" thySize=\"sm\">{{ i18nTexts().confirm }}</button>\n </thy-form-group-footer>\n</form>\n\n<thy-dropdown-menu #menu>\n <thy-dropdown-menu-group [thyTitle]=\"i18nTexts().base\">\n @for (item of fieldOptions().base; track $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: (item | fieldIsSameOption: aiEditField())\n }\"\n (click)=\"selectFieldType(item)\"\n >\n <thy-icon [thyIconName]=\"item.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ item.name }}</span>\n </a>\n }\n </thy-dropdown-menu-group>\n\n <thy-dropdown-menu-group [thyTitle]=\"i18nTexts().advanced\">\n @for (item of fieldOptions().advanced; track $index) {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n active: (item | fieldIsSameOption: aiEditField())\n }\"\n (click)=\"selectFieldType(item)\"\n >\n <thy-icon [thyIconName]=\"item.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ item.name }}</span>\n </a>\n }\n </thy-dropdown-menu-group>\n</thy-dropdown-menu>\n", styles: [":host{width:350px}\n"] }]
|
2020
2071
|
}] });
|
2021
2072
|
|
2022
2073
|
class AITableGridSelectionService {
|
@@ -2032,10 +2083,6 @@ class AITableGridSelectionService {
|
|
2032
2083
|
}
|
2033
2084
|
initialize(aiTable) {
|
2034
2085
|
this.aiTable = aiTable;
|
2035
|
-
this.aiTable.dragState = signal({
|
2036
|
-
type: DragType.none,
|
2037
|
-
sourceIds: new Set()
|
2038
|
-
});
|
2039
2086
|
}
|
2040
2087
|
clearSelection() {
|
2041
2088
|
this.aiTable.selection.set({
|
@@ -2043,12 +2090,19 @@ class AITableGridSelectionService {
|
|
2043
2090
|
selectedFields: new Set(),
|
2044
2091
|
selectedCells: new Set(),
|
2045
2092
|
activeCell: null,
|
2093
|
+
expandCell: null,
|
2046
2094
|
selectAllState: AITableSelectAllState.none
|
2047
2095
|
});
|
2048
2096
|
}
|
2049
2097
|
setActiveCell(activeCell) {
|
2050
2098
|
this.aiTable.selection().activeCell = activeCell;
|
2051
2099
|
}
|
2100
|
+
setExpandCell(expandCell) {
|
2101
|
+
this.aiTable.selection.set({
|
2102
|
+
...this.aiTable.selection(),
|
2103
|
+
expandCell: expandCell
|
2104
|
+
});
|
2105
|
+
}
|
2052
2106
|
selectField(fieldId) {
|
2053
2107
|
if (this.aiTable.selection().selectedFields.has(fieldId)) {
|
2054
2108
|
return;
|
@@ -2062,18 +2116,6 @@ class AITableGridSelectionService {
|
|
2062
2116
|
get selectedRecords() {
|
2063
2117
|
return this.aiTable.selection().selectedRecords;
|
2064
2118
|
}
|
2065
|
-
drag(config) {
|
2066
|
-
this.aiTable.dragState.set(config);
|
2067
|
-
}
|
2068
|
-
getDragStateType() {
|
2069
|
-
return this.aiTable.dragState?.()?.type;
|
2070
|
-
}
|
2071
|
-
clearDrag() {
|
2072
|
-
this.aiTable.dragState.set({
|
2073
|
-
type: DragType.none,
|
2074
|
-
sourceIds: new Set()
|
2075
|
-
});
|
2076
|
-
}
|
2077
2119
|
selectRecord(recordId) {
|
2078
2120
|
if (this.aiTable.selection().selectedRecords.has(recordId)) {
|
2079
2121
|
this.aiTable.selection().selectedRecords.delete(recordId);
|
@@ -2087,6 +2129,7 @@ class AITableGridSelectionService {
|
|
2087
2129
|
selectedFields: new Set(),
|
2088
2130
|
selectedCells: new Set(),
|
2089
2131
|
activeCell: null,
|
2132
|
+
expandCell: null,
|
2090
2133
|
selectAllState: this.selectAllState()
|
2091
2134
|
});
|
2092
2135
|
}
|
@@ -2298,6 +2341,11 @@ const AI_TABLE_PROGRESS_BAR_POINTER_WIDTH = 8;
|
|
2298
2341
|
const AI_TABLE_PROGRESS_TEXT_WIDTH = 46;
|
2299
2342
|
const AI_TABLE_POPOVER_LEFT_OFFSET = 4;
|
2300
2343
|
const AI_TABLE_RATE_MAX = 5;
|
2344
|
+
const AI_TABLE_SCROLL_BAR_SIZE = 18;
|
2345
|
+
const AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD = 40;
|
2346
|
+
const AI_TABLE_AUTO_SCROLL_RIGHT_THRESHOLD = 40;
|
2347
|
+
const AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD = AI_TABLE_FIELD_HEAD_HEIGHT / 2;
|
2348
|
+
const AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD = AI_TABLE_FIELD_HEAD_HEIGHT / 2;
|
2301
2349
|
|
2302
2350
|
const MIN_COLUMN_WIDTH = 80;
|
2303
2351
|
const DBL_CLICK_EDIT_TYPE = [
|
@@ -2360,6 +2408,7 @@ const DepartmentOutlinedPath = `M3 5.5C3 3.567 4.567 2 6.5 2C8.433 2 10 3.567 10
|
|
2360
2408
|
const AttachmentPath = `M9.1773124,11.8057395 C7.96668709,13.0163648 6.00387566,13.0163648 4.79325035,11.8057395 C3.58262505,10.5951142 3.58262505,8.63230278 4.78926443,7.4257012 L8.27628904,3.87217601 C8.50840068,3.63567937 8.88828274,3.63209333 9.12479868,3.86418566 C9.36131462,4.096278 9.36490066,4.47616006 9.13280833,4.712676 L5.64177849,8.27020561 C4.89978234,9.01220177 4.89978234,10.2152152 5.64177849,10.9572114 C6.38377464,11.6992075 7.5867881,11.6992075 8.32878426,10.9572114 L12.2321177,7.05387799 C13.3493901,5.93660552 13.2780395,4.02707269 12.0410949,2.79012806 C10.8041502,1.55318343 8.8946174,1.4818328 7.77734493,2.59910526 L3.72686067,6.64958953 C2.02034367,8.35610653 2.02835883,11.1329242 3.74721224,12.8517776 C5.46606565,14.570631 8.24288334,14.5786462 9.94940034,12.8721292 L13.5980637,9.22346588 C13.8323782,8.98915131 14.2122772,8.98915131 14.4465918,9.22346588 C14.6809064,9.45778046 14.6809064,9.83767945 14.4465918,10.071994 L10.7979285,13.7206573 C8.62168228,15.8969035 5.08507361,15.8866953 2.8986841,13.7003058 C0.712294592,11.5139163 0.702086332,7.97730759 2.87833253,5.8010614 L6.9288168,1.75057713 C8.52947856,0.149915361 11.1976354,0.249612361 12.889623,1.94159992 C14.5816106,3.63358749 14.6813076,6.30174436 13.0806458,7.90240612 L9.1773124,11.8057395 Z`;
|
2361
2409
|
const EditPath = `M2,8.33918294 L10.7095952,0 L15,4.17020474 L6.53816398,13 L2,13 L2,8.33918294 Z M3.2,8.85157902 L3.2,11.8 L6.02608482,11.8 L13.3091776,4.20020516 L10.7033283,1.66736141 L3.2,8.85157902 Z M0,16 L0,14.8 L16,14.8 L16,16 L0,16 Z`;
|
2362
2410
|
const RowDragPath = `M6,3 C6.55228475,3 7,2.55228475 7,2 C7,1.44771525 6.55228475,1 6,1 C5.44771525,1 5,1.44771525 5,2 C5,2.55228475 5.44771525,3 6,3 Z M10,3 C10.5522847,3 11,2.55228475 11,2 C11,1.44771525 10.5522847,1 10,1 C9.44771525,1 9,1.44771525 9,2 C9,2.55228475 9.44771525,3 10,3 Z M6,7 C6.55228475,7 7,6.55228475 7,6 C7,5.44771525 6.55228475,5 6,5 C5.44771525,5 5,5.44771525 5,6 C5,6.55228475 5.44771525,7 6,7 Z M10,7 C10.5522847,7 11,6.55228475 11,6 C11,5.44771525 10.5522847,5 10,5 C9.44771525,5 9,5.44771525 9,6 C9,6.55228475 9.44771525,7 10,7 Z M6,11 C6.55228475,11 7,10.5522847 7,10 C7,9.44771525 6.55228475,9 6,9 C5.44771525,9 5,9.44771525 5,10 C5,10.5522847 5.44771525,11 6,11 Z M10,11 C10.5522847,11 11,10.5522847 11,10 C11,9.44771525 10.5522847,9 10,9 C9.44771525,9 9,9.44771525 9,10 C9,10.5522847 9.44771525,11 10,11 Z M6,15 C6.55228475,15 7,14.5522847 7,14 C7,13.4477153 6.55228475,13 6,13 C5.44771525,13 5,13.4477153 5,14 C5,14.5522847 5.44771525,15 6,15 Z M10,15 C10.5522847,15 11,14.5522847 11,14 C11,13.4477153 10.5522847,13 10,13 C9.44771525,13 9,13.4477153 9,14 C9,14.5522847 9.44771525,15 10,15 Z`;
|
2411
|
+
const IconPathMap = {};
|
2363
2412
|
|
2364
2413
|
const DEFAULT_FONT_SIZE = 14;
|
2365
2414
|
const DEFAULT_FONT_FAMILY = '-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,Helvetica Neue,Noto Sans,Noto Sans CJK SC,Microsoft Yahei,Arial,Hiragino Sans GB,sans-serif';
|
@@ -3859,6 +3908,18 @@ const castToString = (value) => {
|
|
3859
3908
|
}
|
3860
3909
|
return typeof value !== 'string' ? String(value) : value;
|
3861
3910
|
};
|
3911
|
+
// copy from plait
|
3912
|
+
function isVirtualKey(e) {
|
3913
|
+
const isMod = e.ctrlKey || e.metaKey;
|
3914
|
+
const isAlt = isKeyHotkey('alt', e);
|
3915
|
+
const isShift = isKeyHotkey('shift', e);
|
3916
|
+
const isCapsLock = e.key.includes('CapsLock');
|
3917
|
+
const isTab = e.key.includes('Tab');
|
3918
|
+
const isEsc = e.key.includes('Escape');
|
3919
|
+
const isF = e.key.startsWith('F');
|
3920
|
+
const isArrow = e.key.includes('Arrow') ? true : false;
|
3921
|
+
return isCapsLock || isMod || isAlt || isArrow || isShift || isTab || isEsc || isF;
|
3922
|
+
}
|
3862
3923
|
|
3863
3924
|
function getPlaceHolderCellsConfigs(options) {
|
3864
3925
|
const { aiTable, coordinate, columnStartIndex, columnStopIndex, rowStartIndex, rowStopIndex } = options;
|
@@ -4273,7 +4334,7 @@ const isCellMatchKeywords = (aiTable, field, recordId, keywords, references) =>
|
|
4273
4334
|
}
|
4274
4335
|
};
|
4275
4336
|
|
4276
|
-
class
|
4337
|
+
class AITableTextComponent {
|
4277
4338
|
constructor() {
|
4278
4339
|
this.config = input.required();
|
4279
4340
|
// @Output() koClick = new EventEmitter<KoEventObject<MouseEvent>>();
|
@@ -4321,10 +4382,10 @@ class AITableText {
|
|
4321
4382
|
onMousemove(e) {
|
4322
4383
|
this.koMouseMove.emit(e);
|
4323
4384
|
}
|
4324
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
4325
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type:
|
4385
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4386
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: AITableTextComponent, isStandalone: true, selector: "ai-table-text", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koClick: "koClick", koMouseMove: "koMouseMove" }, ngImport: i0, template: ` <ko-text [config]="textConfig()" (koClick)="onClick($event)" (koMousemove)="onMousemove($event)"></ko-text> `, isInline: true, dependencies: [{ kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
4326
4387
|
}
|
4327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
4388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableTextComponent, decorators: [{
|
4328
4389
|
type: Component,
|
4329
4390
|
args: [{
|
4330
4391
|
selector: 'ai-table-text',
|
@@ -5276,9 +5337,27 @@ class Drawer {
|
|
5276
5337
|
}
|
5277
5338
|
const drawer = new Drawer();
|
5278
5339
|
|
5279
|
-
class
|
5340
|
+
class HoverCellComponent extends Component {
|
5280
5341
|
constructor() {
|
5342
|
+
super(...arguments);
|
5281
5343
|
this.config = input();
|
5344
|
+
this.onlyDisplayBorder = input(false);
|
5345
|
+
}
|
5346
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: HoverCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
5347
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: HoverCellComponent, isStandalone: true, selector: "ai-table-hover-cell", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, onlyDisplayBorder: { classPropertyName: "onlyDisplayBorder", publicName: "onlyDisplayBorder", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
5348
|
+
}
|
5349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: HoverCellComponent, decorators: [{
|
5350
|
+
type: Component,
|
5351
|
+
args: [{
|
5352
|
+
selector: 'ai-table-hover-cell',
|
5353
|
+
template: '',
|
5354
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
5355
|
+
}]
|
5356
|
+
}] });
|
5357
|
+
|
5358
|
+
class AITableCellLink extends HoverCellComponent {
|
5359
|
+
constructor() {
|
5360
|
+
super(...arguments);
|
5282
5361
|
this.textOffset = AI_TABLE_CELL_PADDING + AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
5283
5362
|
this.render = computed(() => this.config()?.render);
|
5284
5363
|
this.transformValue = computed(() => this.render()?.transformValue);
|
@@ -5336,12 +5415,12 @@ class AITableCellLink {
|
|
5336
5415
|
const curMousePosition = getMousePosition(aiTable, x, y, coordinate, AITable.getVisibleFields(aiTable), context, targetName);
|
5337
5416
|
handleMouseStyle(AI_TABLE_FIELD_HEAD_MORE, curMousePosition.areaType, coordinate.container);
|
5338
5417
|
}
|
5339
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellLink, deps:
|
5340
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellLink, isStandalone: true, selector: "ai-table-link",
|
5418
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellLink, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
5419
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellLink, isStandalone: true, selector: "ai-table-link", usesInheritance: true, ngImport: i0, template: `
|
5341
5420
|
@if (showLink()) {
|
5342
5421
|
<ai-table-text [config]="textConfig()!" (koClick)="linkClick($event)" (koMouseMove)="linkMouseMove($event)"></ai-table-text>
|
5343
5422
|
}
|
5344
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
5423
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AITableTextComponent, selector: "ai-table-text", inputs: ["config"], outputs: ["koClick", "koMouseMove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
5345
5424
|
}
|
5346
5425
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellLink, decorators: [{
|
5347
5426
|
type: Component,
|
@@ -5352,7 +5431,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5352
5431
|
<ai-table-text [config]="textConfig()!" (koClick)="linkClick($event)" (koMouseMove)="linkMouseMove($event)"></ai-table-text>
|
5353
5432
|
}
|
5354
5433
|
`,
|
5355
|
-
imports: [
|
5434
|
+
imports: [AITableTextComponent],
|
5356
5435
|
changeDetection: ChangeDetectionStrategy.OnPush
|
5357
5436
|
}]
|
5358
5437
|
}] });
|
@@ -5466,9 +5545,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5466
5545
|
}]
|
5467
5546
|
}] });
|
5468
5547
|
|
5469
|
-
class AITableCellAttachment {
|
5548
|
+
class AITableCellAttachment extends HoverCellComponent {
|
5470
5549
|
constructor() {
|
5471
|
-
|
5550
|
+
super(...arguments);
|
5472
5551
|
this.attachments = computed(() => {
|
5473
5552
|
const { render, aiTable, field, recordId, readonly } = this.config();
|
5474
5553
|
if (render) {
|
@@ -5542,8 +5621,8 @@ class AITableCellAttachment {
|
|
5542
5621
|
});
|
5543
5622
|
}
|
5544
5623
|
static { this.fieldType = AITableFieldType.attachment; }
|
5545
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellAttachment, deps:
|
5546
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellAttachment, isStandalone: true, selector: "ai-table-attachments",
|
5624
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellAttachment, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
5625
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellAttachment, isStandalone: true, selector: "ai-table-attachments", usesInheritance: true, ngImport: i0, template: `
|
5547
5626
|
@for (attachment of attachments(); track attachment.attachmentInfo._id) {
|
5548
5627
|
<ko-image [config]="attachment"></ko-image>
|
5549
5628
|
}
|
@@ -5565,9 +5644,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5565
5644
|
}]
|
5566
5645
|
}] });
|
5567
5646
|
|
5568
|
-
class AITableCellRichText {
|
5647
|
+
class AITableCellRichText extends HoverCellComponent {
|
5569
5648
|
constructor() {
|
5570
|
-
|
5649
|
+
super(...arguments);
|
5571
5650
|
this.textConfig = computed(() => {
|
5572
5651
|
const render = this.config()?.render;
|
5573
5652
|
if (render) {
|
@@ -5627,13 +5706,13 @@ class AITableCellRichText {
|
|
5627
5706
|
});
|
5628
5707
|
}
|
5629
5708
|
static { this.fieldType = AITableFieldType.richText; }
|
5630
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellRichText, deps:
|
5631
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellRichText, isStandalone: true, selector: "ai-table-rich-text",
|
5709
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellRichText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
5710
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellRichText, isStandalone: true, selector: "ai-table-rich-text", usesInheritance: true, ngImport: i0, template: `
|
5632
5711
|
@if (textConfig()) {
|
5633
5712
|
<ai-table-text [config]="textConfig()!"></ai-table-text>
|
5634
5713
|
}
|
5635
5714
|
<ai-table-action-icon [config]="iconConfig()"></ai-table-action-icon>
|
5636
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
5715
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AITableTextComponent, selector: "ai-table-text", inputs: ["config"], outputs: ["koClick", "koMouseMove"] }, { kind: "component", type: AITableActionIcon, selector: "ai-table-action-icon", inputs: ["config"], outputs: ["onClick", "onMousemove", "onMouseenter", "onMouseleave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
5637
5716
|
}
|
5638
5717
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellRichText, decorators: [{
|
5639
5718
|
type: Component,
|
@@ -5645,7 +5724,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5645
5724
|
}
|
5646
5725
|
<ai-table-action-icon [config]="iconConfig()"></ai-table-action-icon>
|
5647
5726
|
`,
|
5648
|
-
imports: [
|
5727
|
+
imports: [AITableTextComponent, AITableActionIcon],
|
5649
5728
|
changeDetection: ChangeDetectionStrategy.OnPush
|
5650
5729
|
}]
|
5651
5730
|
}] });
|
@@ -5663,7 +5742,8 @@ const createActiveCellBorder = (config) => {
|
|
5663
5742
|
if (Array.isArray(activeCell) &&
|
5664
5743
|
!!activeCell.length &&
|
5665
5744
|
aiTable.context.visibleRowsIndexMap().has(activeCell[0]) &&
|
5666
|
-
aiTable.context.visibleColumnsIndexMap().has(activeCell[1])
|
5745
|
+
aiTable.context.visibleColumnsIndexMap().has(activeCell[1]) &&
|
5746
|
+
!aiTable.selection().expandCell) {
|
5667
5747
|
const fieldId = activeCell[1];
|
5668
5748
|
const { rowIndex, columnIndex } = AITable.getCellIndex(aiTable, activeCell);
|
5669
5749
|
const checkIsVisible = (rowIndex, columnIndex) => {
|
@@ -6357,12 +6437,16 @@ class CellDrawer extends Drawer {
|
|
6357
6437
|
}
|
6358
6438
|
// 单元格渲染
|
6359
6439
|
renderCell(render, ctx, columnWidth) {
|
6360
|
-
const { field, cellValue } = render;
|
6440
|
+
const { field, cellValue, aiTable } = render;
|
6361
6441
|
const fieldType = field.type;
|
6362
6442
|
const fieldMethod = FieldModelMap[fieldType];
|
6363
6443
|
if (!fieldMethod.isValid(cellValue)) {
|
6364
6444
|
return;
|
6365
6445
|
}
|
6446
|
+
const customFieldRender = aiTable.context?.aiFieldConfig()?.customFields?.[fieldType]?.render;
|
6447
|
+
if (customFieldRender) {
|
6448
|
+
return customFieldRender(render, this);
|
6449
|
+
}
|
6366
6450
|
switch (fieldType) {
|
6367
6451
|
case AITableFieldType.text:
|
6368
6452
|
case AITableFieldType.richText:
|
@@ -7014,29 +7098,22 @@ class RecordRowLayout extends Layout {
|
|
7014
7098
|
});
|
7015
7099
|
}
|
7016
7100
|
// 首列
|
7017
|
-
renderFirstCell({ row, style, isHoverRow, isCheckedRow }) {
|
7101
|
+
renderFirstCell({ row, style, indexStyle, isHoverRow, isCheckedRow }) {
|
7018
7102
|
if (!this.isFirst)
|
7019
7103
|
return;
|
7020
|
-
const { fill } = style;
|
7104
|
+
const { fill } = style || {};
|
7105
|
+
const { fill: indexFill } = indexStyle || {};
|
7021
7106
|
const y = this.y;
|
7022
7107
|
const rowHeight = this.rowHeight;
|
7023
7108
|
const columnWidth = this.columnWidth;
|
7024
7109
|
const colors = AITable.getColors();
|
7025
|
-
// 编号的上下边框
|
7026
|
-
let fillBg = colors.transparent;
|
7027
|
-
if (isCheckedRow) {
|
7028
|
-
fillBg = colors.itemActiveBgColor;
|
7029
|
-
}
|
7030
|
-
else if (isHoverRow) {
|
7031
|
-
fillBg = colors.gray80;
|
7032
|
-
}
|
7033
7110
|
if (!this.hiddenIndexColumn) {
|
7034
7111
|
this.customRect({
|
7035
7112
|
x: AI_TABLE_OFFSET + AI_TABLE_ROW_DRAG_ICON_WIDTH,
|
7036
7113
|
y,
|
7037
7114
|
width: this.rowHeadWidth - AI_TABLE_OFFSET - AI_TABLE_ROW_DRAG_ICON_WIDTH,
|
7038
7115
|
height: rowHeight,
|
7039
|
-
fill:
|
7116
|
+
fill: indexFill,
|
7040
7117
|
strokes: {
|
7041
7118
|
right: colors.gray200,
|
7042
7119
|
bottom: colors.gray200
|
@@ -7085,7 +7162,7 @@ class RecordRowLayout extends Layout {
|
|
7085
7162
|
renderLastCell({ style, isHoverRow, isCheckedRow }) {
|
7086
7163
|
if (!this.isLast || this.isFirst)
|
7087
7164
|
return;
|
7088
|
-
const { fill, stroke } = style;
|
7165
|
+
const { fill, stroke } = style || {};
|
7089
7166
|
const colors = AITable.getColors();
|
7090
7167
|
// 背景、边框
|
7091
7168
|
this.rect({
|
@@ -7102,7 +7179,7 @@ class RecordRowLayout extends Layout {
|
|
7102
7179
|
renderCommonCell({ style }) {
|
7103
7180
|
if (this.isFirst || this.isLast)
|
7104
7181
|
return;
|
7105
|
-
const { fill, stroke } = style;
|
7182
|
+
const { fill, stroke } = style || {};
|
7106
7183
|
const colors = AITable.getColors();
|
7107
7184
|
// 背景、边框
|
7108
7185
|
this.rect({
|
@@ -7115,8 +7192,8 @@ class RecordRowLayout extends Layout {
|
|
7115
7192
|
});
|
7116
7193
|
}
|
7117
7194
|
render(config) {
|
7118
|
-
const { row, style, isCheckedRow, isHoverRow } = config;
|
7119
|
-
this.renderFirstCell({ row, style, isCheckedRow, isHoverRow });
|
7195
|
+
const { row, style, indexStyle, isCheckedRow, isHoverRow } = config;
|
7196
|
+
this.renderFirstCell({ row, style, indexStyle, isCheckedRow, isHoverRow });
|
7120
7197
|
this.renderCommonCell({ style });
|
7121
7198
|
this.renderLastCell({ style, isCheckedRow, isHoverRow });
|
7122
7199
|
}
|
@@ -7190,6 +7267,7 @@ const createCells = (config) => {
|
|
7190
7267
|
const fieldId = field._id;
|
7191
7268
|
const cell = [recordId, fieldId];
|
7192
7269
|
let background = getCellBackground(cell, isHover, targetName, aiTable);
|
7270
|
+
let indexBackground = getIndexCellBackground(cell, isHover, targetName, aiTable);
|
7193
7271
|
recordRowLayout.init({
|
7194
7272
|
x,
|
7195
7273
|
y,
|
@@ -7205,6 +7283,7 @@ const createCells = (config) => {
|
|
7205
7283
|
recordRowLayout.render({
|
7206
7284
|
row,
|
7207
7285
|
style: { fill: background },
|
7286
|
+
indexStyle: { fill: indexBackground },
|
7208
7287
|
isHoverRow: isHoverRecord(isHover, targetName),
|
7209
7288
|
isCheckedRow: isSelectedRecord(recordId, aiTable)
|
7210
7289
|
});
|
@@ -7257,27 +7336,37 @@ const createCells = (config) => {
|
|
7257
7336
|
}
|
7258
7337
|
}
|
7259
7338
|
};
|
7339
|
+
const getRowBackground = (cell, isHover, targetName, aiTable) => {
|
7340
|
+
const colors = AITable.getColors();
|
7341
|
+
const [recordId, fieldId] = cell;
|
7342
|
+
if (isWillHiddenCell(cell, aiTable)) {
|
7343
|
+
return colors.itemMatchBgColor;
|
7344
|
+
}
|
7345
|
+
if (isSelectedRecord(recordId, aiTable) || isSiblingCell(cell, aiTable)) {
|
7346
|
+
return colors.itemActiveBgColor;
|
7347
|
+
}
|
7348
|
+
if (isHoverRecord(isHover, targetName)) {
|
7349
|
+
return colors.gray80;
|
7350
|
+
}
|
7351
|
+
return colors.white;
|
7352
|
+
};
|
7260
7353
|
const getCellBackground = (cell, isHover, targetName, aiTable) => {
|
7261
7354
|
const colors = AITable.getColors();
|
7262
7355
|
const [recordId, fieldId] = cell;
|
7263
|
-
|
7264
|
-
|
7265
|
-
|
7266
|
-
|
7267
|
-
|
7268
|
-
|
7269
|
-
|
7270
|
-
|
7271
|
-
|
7272
|
-
|
7273
|
-
|
7274
|
-
|
7275
|
-
|
7276
|
-
|
7277
|
-
else if (_isHoverRecord && !_isActiveCell) {
|
7278
|
-
background = colors.gray80;
|
7279
|
-
}
|
7280
|
-
return background;
|
7356
|
+
if (isActiveCell(cell, aiTable)) {
|
7357
|
+
return colors.white;
|
7358
|
+
}
|
7359
|
+
if (isSelectedField(fieldId, aiTable) || isSelectedCell(cell, aiTable)) {
|
7360
|
+
return colors.itemActiveBgColor;
|
7361
|
+
}
|
7362
|
+
if (isKeywordsMatchedCell(cell, aiTable)) {
|
7363
|
+
return colors.itemMatchBgColor;
|
7364
|
+
}
|
7365
|
+
return getRowBackground(cell, isHover, targetName, aiTable);
|
7366
|
+
};
|
7367
|
+
const getIndexCellBackground = (cell, isHover, targetName, aiTable) => {
|
7368
|
+
const [recordId, fieldId] = cell;
|
7369
|
+
return getRowBackground([recordId, ''], isHover, targetName, aiTable);
|
7281
7370
|
};
|
7282
7371
|
const isActiveCell = (cell, aiTable) => {
|
7283
7372
|
const [recordId, fieldId] = cell;
|
@@ -7293,6 +7382,10 @@ const isKeywordsMatchedCell = (cell, aiTable) => {
|
|
7293
7382
|
const [recordId, fieldId] = cell;
|
7294
7383
|
return aiTable.keywordsMatchedCells().has(`${recordId}:${fieldId}`);
|
7295
7384
|
};
|
7385
|
+
const isWillHiddenCell = (cell, aiTable) => {
|
7386
|
+
const [recordId, fieldId] = cell;
|
7387
|
+
return aiTable.recordsWillHidden().includes(recordId);
|
7388
|
+
};
|
7296
7389
|
const isSelectedCell = (cell, aiTable) => {
|
7297
7390
|
const [recordId, fieldId] = cell;
|
7298
7391
|
return aiTable.selection().selectedCells.has(`${recordId}:${fieldId}`);
|
@@ -7500,8 +7593,8 @@ class AITableFieldIcon {
|
|
7500
7593
|
constructor() {
|
7501
7594
|
this.config = input.required();
|
7502
7595
|
this.iconConfig = computed(() => {
|
7503
|
-
const { field, x, y, width, height, fill } = this.config();
|
7504
|
-
let data =
|
7596
|
+
const { field, x, y, width, height, fill, path } = this.config();
|
7597
|
+
let data = path;
|
7505
7598
|
switch (field.type) {
|
7506
7599
|
case AITableFieldType.text:
|
7507
7600
|
data = ColumnTextFilledPath;
|
@@ -7615,7 +7708,8 @@ class AITableFieldHead {
|
|
7615
7708
|
y: (height - AI_TABLE_ICON_COMMON_SIZE) / 2,
|
7616
7709
|
width: AI_TABLE_ICON_COMMON_SIZE,
|
7617
7710
|
height: AI_TABLE_ICON_COMMON_SIZE,
|
7618
|
-
fill: Colors.gray600
|
7711
|
+
fill: Colors.gray600,
|
7712
|
+
path: IconPathMap[field.icon]
|
7619
7713
|
};
|
7620
7714
|
});
|
7621
7715
|
this.textConfig = computed(() => {
|
@@ -7675,7 +7769,7 @@ class AITableFieldHead {
|
|
7675
7769
|
</ko-group>
|
7676
7770
|
<ko-line [config]="fieldOpacityLineConfig()"></ko-line>
|
7677
7771
|
</ko-group>
|
7678
|
-
`, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: AITableFieldIcon, selector: "ai-table-field-icon", inputs: ["config"] }, { kind: "component", type:
|
7772
|
+
`, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: AITableFieldIcon, selector: "ai-table-field-icon", inputs: ["config"] }, { kind: "component", type: AITableTextComponent, selector: "ai-table-text", inputs: ["config"], outputs: ["koClick", "koMouseMove"] }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
7679
7773
|
}
|
7680
7774
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldHead, decorators: [{
|
7681
7775
|
type: Component,
|
@@ -7694,7 +7788,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
7694
7788
|
<ko-line [config]="fieldOpacityLineConfig()"></ko-line>
|
7695
7789
|
</ko-group>
|
7696
7790
|
`,
|
7697
|
-
imports: [KoContainer, KoShape, AITableFieldIcon,
|
7791
|
+
imports: [KoContainer, KoShape, AITableFieldIcon, AITableTextComponent, AITableIcon],
|
7698
7792
|
changeDetection: ChangeDetectionStrategy.OnPush
|
7699
7793
|
}]
|
7700
7794
|
}] });
|
@@ -8269,27 +8363,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8269
8363
|
class AITableHoverCells {
|
8270
8364
|
constructor() {
|
8271
8365
|
this.config = input.required();
|
8366
|
+
this.onlyDisplayBorder = input(false);
|
8272
8367
|
this.componentMap = {};
|
8273
8368
|
this.groupConfig = computed(() => {
|
8274
8369
|
return {
|
8275
8370
|
x: this.hoverCellConfig()?.x,
|
8276
|
-
y: this.hoverCellConfig()?.y
|
8371
|
+
y: this.hoverCellConfig()?.y,
|
8372
|
+
listening: true
|
8277
8373
|
};
|
8278
8374
|
});
|
8279
8375
|
this.hoverCellConfig = computed(() => {
|
8280
8376
|
const { aiTable, coordinate, references, readonly, actions } = this.config();
|
8281
|
-
const pointPosition = aiTable.context.pointPosition();
|
8282
8377
|
const hoverCell = this.hoverCell();
|
8283
8378
|
if (!hoverCell) {
|
8284
8379
|
return;
|
8285
8380
|
}
|
8286
|
-
const { field, recordId } = hoverCell;
|
8381
|
+
const { field, recordId, isExpand } = hoverCell;
|
8287
8382
|
const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
|
8288
8383
|
const fieldModel = FieldModelMap[field.type];
|
8289
8384
|
const transformValue = fieldModel.transformCellValue(cellValue, { aiTable, field });
|
8290
8385
|
const { rowHeight, columnCount, rowCount } = coordinate;
|
8291
|
-
const columnIndex =
|
8292
|
-
const rowIndex =
|
8386
|
+
const columnIndex = aiTable.context?.visibleColumnsIndexMap().get(field._id) ?? 0;
|
8387
|
+
const rowIndex = aiTable.context?.visibleRowsIndexMap().get(recordId) ?? 0;
|
8293
8388
|
const x = coordinate.getColumnOffset(columnIndex) + AI_TABLE_OFFSET;
|
8294
8389
|
const columnWidth = coordinate.getColumnWidth(columnIndex);
|
8295
8390
|
const y = coordinate.getRowOffset(rowIndex) + AI_TABLE_OFFSET;
|
@@ -8315,6 +8410,7 @@ class AITableHoverCells {
|
|
8315
8410
|
y,
|
8316
8411
|
readonly,
|
8317
8412
|
actions,
|
8413
|
+
isExpand,
|
8318
8414
|
render: {
|
8319
8415
|
aiTable,
|
8320
8416
|
recordId,
|
@@ -8335,10 +8431,15 @@ class AITableHoverCells {
|
|
8335
8431
|
this.hoverCell = computed(() => getHoverCell(this.config().aiTable));
|
8336
8432
|
}
|
8337
8433
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableHoverCells, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
8338
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableHoverCells, isStandalone: true, selector: "ai-table-hover-cell", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
8434
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableHoverCells, isStandalone: true, selector: "ai-table-hover-cell", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, onlyDisplayBorder: { classPropertyName: "onlyDisplayBorder", publicName: "onlyDisplayBorder", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
8339
8435
|
@if (hoverCell()) {
|
8340
8436
|
<ko-group [config]="groupConfig()">
|
8341
|
-
<ng-container
|
8437
|
+
<ng-container
|
8438
|
+
*ngComponentOutlet="
|
8439
|
+
hoverCell()!.renderComponentDefinition;
|
8440
|
+
inputs: { config: hoverCellConfig(), onlyDisplayBorder: onlyDisplayBorder() }
|
8441
|
+
"
|
8442
|
+
>
|
8342
8443
|
</ng-container>
|
8343
8444
|
</ko-group>
|
8344
8445
|
}
|
@@ -8351,7 +8452,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8351
8452
|
template: `
|
8352
8453
|
@if (hoverCell()) {
|
8353
8454
|
<ko-group [config]="groupConfig()">
|
8354
|
-
<ng-container
|
8455
|
+
<ng-container
|
8456
|
+
*ngComponentOutlet="
|
8457
|
+
hoverCell()!.renderComponentDefinition;
|
8458
|
+
inputs: { config: hoverCellConfig(), onlyDisplayBorder: onlyDisplayBorder() }
|
8459
|
+
"
|
8460
|
+
>
|
8355
8461
|
</ng-container>
|
8356
8462
|
</ko-group>
|
8357
8463
|
}
|
@@ -8444,19 +8550,11 @@ class AITableRenderer {
|
|
8444
8550
|
clipHeight: this.containerHeight() - this.coordinate().rowInitSize
|
8445
8551
|
};
|
8446
8552
|
});
|
8447
|
-
this.hoverAttachGroupConfig = computed(() => {
|
8448
|
-
return {
|
8449
|
-
clipX: this.frozenAreaWidth() + 1,
|
8450
|
-
clipY: this.coordinate().rowInitSize + 1,
|
8451
|
-
clipWidth: this.containerWidth() - this.frozenAreaWidth(),
|
8452
|
-
clipHeight: this.containerHeight() - this.coordinate().rowInitSize
|
8453
|
-
};
|
8454
|
-
});
|
8455
8553
|
this.frozenAttachGroupConfig = computed(() => {
|
8456
8554
|
return {
|
8457
8555
|
clipX: 0,
|
8458
8556
|
clipY: this.coordinate().rowInitSize - 1,
|
8459
|
-
clipWidth: this.frozenAreaWidth()
|
8557
|
+
clipWidth: this.frozenAreaWidth(),
|
8460
8558
|
clipHeight: this.containerHeight() - this.coordinate().rowInitSize
|
8461
8559
|
};
|
8462
8560
|
});
|
@@ -8464,7 +8562,7 @@ class AITableRenderer {
|
|
8464
8562
|
return {
|
8465
8563
|
clipX: 0,
|
8466
8564
|
clipY: this.coordinate().rowInitSize + 1,
|
8467
|
-
clipWidth: this.frozenAreaWidth()
|
8565
|
+
clipWidth: this.frozenAreaWidth(),
|
8468
8566
|
clipHeight: this.containerHeight() - this.coordinate().rowInitSize
|
8469
8567
|
};
|
8470
8568
|
});
|
@@ -8523,6 +8621,26 @@ class AITableRenderer {
|
|
8523
8621
|
this.activeCellBorderConfig = computed(() => {
|
8524
8622
|
return createActiveCellBorder(this.cellsConfig());
|
8525
8623
|
});
|
8624
|
+
this.showExpandCellBorder = computed(() => {
|
8625
|
+
let expandCellBorder = false;
|
8626
|
+
let frozenExpandCellBorder = false;
|
8627
|
+
const { aiTable } = this.config();
|
8628
|
+
const expandCellPath = aiTable.selection().expandCell;
|
8629
|
+
if (expandCellPath) {
|
8630
|
+
const { rowIndex, columnIndex } = AITable.getCellIndex(aiTable, expandCellPath);
|
8631
|
+
const isFrozenColumn = columnIndex < aiTable.context.frozenColumnCount();
|
8632
|
+
if (isFrozenColumn) {
|
8633
|
+
frozenExpandCellBorder = true;
|
8634
|
+
}
|
8635
|
+
else {
|
8636
|
+
expandCellBorder = true;
|
8637
|
+
}
|
8638
|
+
}
|
8639
|
+
return {
|
8640
|
+
expandCellBorder,
|
8641
|
+
frozenExpandCellBorder
|
8642
|
+
};
|
8643
|
+
});
|
8526
8644
|
}
|
8527
8645
|
stageMousemove(e) {
|
8528
8646
|
this.koMousemove.emit(e);
|
@@ -8546,7 +8664,7 @@ class AITableRenderer {
|
|
8546
8664
|
this.koMouseleave.emit(e);
|
8547
8665
|
}
|
8548
8666
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
8549
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableRenderer, isStandalone: true, selector: "ai-table-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koMousemove: "koMousemove", koMousedown: "koMousedown", koMouseup: "koMouseup", koContextmenu: "koContextmenu", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick", koMouseleave: "koMouseleave" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n @if (!hiddenIndexColumn()) {\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n }\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <
|
8667
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableRenderer, isStandalone: true, selector: "ai-table-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koMousemove: "koMousemove", koMousedown: "koMousedown", koMouseup: "koMouseup", koContextmenu: "koContextmenu", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick", koMouseleave: "koMouseleave" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n @if (!hiddenIndexColumn()) {\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n }\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().expandCellBorder) {\n <ai-table-hover-cell [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-hover-cell>\n }\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenHoverAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().frozenExpandCellBorder) {\n <ai-table-hover-cell [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-hover-cell>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: KoStage, selector: "ko-stage", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: AITableColumnHeads, selector: "ai-table-column-heads", inputs: ["config"] }, { kind: "component", type: AITableFrozenColumnHeads, selector: "ai-table-frozen-column-heads", inputs: ["config"] }, { kind: "component", type: AITableCells, selector: "ai-table-cells", inputs: ["config"] }, { kind: "component", type: AITableFrozenCells, selector: "ai-table-frozen-cells", inputs: ["config"] }, { kind: "component", type: AITableFrozenPlaceholderCells, selector: "ai-table-frozen-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITableHoverCells, selector: "ai-table-hover-cell", inputs: ["config", "onlyDisplayBorder"] }, { kind: "component", type: AITablePlaceholderCells, selector: "ai-table-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITableAddField, selector: "ai-table-add-field", inputs: ["config"] }, { kind: "component", type: AITableHoverRowHeads, selector: "ai-table-hover-row-heads", inputs: ["config"] }, { kind: "component", type: AITableOtherRows, selector: "ai-table-other-rows", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
8550
8668
|
}
|
8551
8669
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableRenderer, decorators: [{
|
8552
8670
|
type: Component,
|
@@ -8564,15 +8682,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8564
8682
|
AITableAddField,
|
8565
8683
|
AITableHoverRowHeads,
|
8566
8684
|
AITableOtherRows
|
8567
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n @if (!hiddenIndexColumn()) {\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n }\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <
|
8685
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n @if (!hiddenIndexColumn()) {\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n }\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().expandCellBorder) {\n <ai-table-hover-cell [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-hover-cell>\n }\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenHoverAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n @if (showExpandCellBorder().frozenExpandCellBorder) {\n <ai-table-hover-cell [config]=\"cellsConfig()\" [onlyDisplayBorder]=\"true\"></ai-table-hover-cell>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
|
8568
8686
|
}] });
|
8569
8687
|
|
8570
|
-
class AITableCellRate {
|
8688
|
+
class AITableCellRate extends HoverCellComponent {
|
8571
8689
|
constructor() {
|
8690
|
+
super(...arguments);
|
8572
8691
|
this.pointerX = signal(0);
|
8573
8692
|
this.pointerY = signal(0);
|
8574
8693
|
this.resetStatus = signal(false);
|
8575
|
-
this.config = input();
|
8576
8694
|
this.readonly = computed(() => {
|
8577
8695
|
return this.config()?.readonly;
|
8578
8696
|
});
|
@@ -8684,8 +8802,8 @@ class AITableCellRate {
|
|
8684
8802
|
});
|
8685
8803
|
}
|
8686
8804
|
}
|
8687
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellRate, deps:
|
8688
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellRate, isStandalone: true, selector: "ai-table-rate",
|
8805
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellRate, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
8806
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellRate, isStandalone: true, selector: "ai-table-rate", usesInheritance: true, ngImport: i0, template: `
|
8689
8807
|
@if (!readonly()) {
|
8690
8808
|
<ko-rect [config]="whiteBgConfig()" (koMousemove)="koMousemove($event)"></ko-rect>
|
8691
8809
|
}
|
@@ -8711,9 +8829,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
8711
8829
|
}]
|
8712
8830
|
}] });
|
8713
8831
|
|
8714
|
-
class AITableCellProgress {
|
8832
|
+
class AITableCellProgress extends HoverCellComponent {
|
8715
8833
|
constructor() {
|
8716
|
-
|
8834
|
+
super(...arguments);
|
8717
8835
|
this.readonly = computed(() => {
|
8718
8836
|
return this.config()?.readonly;
|
8719
8837
|
});
|
@@ -8930,8 +9048,8 @@ class AITableCellProgress {
|
|
8930
9048
|
});
|
8931
9049
|
}
|
8932
9050
|
}
|
8933
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellProgress, deps:
|
8934
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellProgress, isStandalone: true, selector: "ai-table-progress",
|
9051
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableCellProgress, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
9052
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableCellProgress, isStandalone: true, selector: "ai-table-progress", usesInheritance: true, ngImport: i0, template: `
|
8935
9053
|
@if (!readonly()) {
|
8936
9054
|
<ko-rect [config]="whiteBgConfig()"></ko-rect>
|
8937
9055
|
}
|
@@ -8980,14 +9098,29 @@ var cellComponents = /*#__PURE__*/Object.freeze({
|
|
8980
9098
|
AITableCellRichText: AITableCellRichText
|
8981
9099
|
});
|
8982
9100
|
|
8983
|
-
const
|
9101
|
+
const ComponentMap = {};
|
8984
9102
|
Object.values(cellComponents).forEach((cellComponent) => {
|
8985
|
-
|
9103
|
+
ComponentMap[cellComponent.fieldType] = cellComponent;
|
8986
9104
|
});
|
8987
9105
|
|
8988
9106
|
function getHoverCell(aiTable) {
|
8989
9107
|
const pointPosition = aiTable.context.pointPosition();
|
8990
|
-
|
9108
|
+
let fieldId;
|
9109
|
+
let recordId;
|
9110
|
+
const expandCell = aiTable.selection().expandCell;
|
9111
|
+
if (expandCell) {
|
9112
|
+
fieldId = expandCell[1];
|
9113
|
+
recordId = expandCell[0];
|
9114
|
+
}
|
9115
|
+
else {
|
9116
|
+
const { fieldId: fieldIdDetail, recordId: recordIdDetail } = getDetailByTargetName(pointPosition.realTargetName) ?? {};
|
9117
|
+
if (fieldIdDetail) {
|
9118
|
+
fieldId = fieldIdDetail;
|
9119
|
+
}
|
9120
|
+
if (recordIdDetail) {
|
9121
|
+
recordId = recordIdDetail;
|
9122
|
+
}
|
9123
|
+
}
|
8991
9124
|
if (!recordId || !fieldId) {
|
8992
9125
|
return;
|
8993
9126
|
}
|
@@ -8996,7 +9129,7 @@ function getHoverCell(aiTable) {
|
|
8996
9129
|
if (!record || !field || !recordId || !fieldId) {
|
8997
9130
|
return;
|
8998
9131
|
}
|
8999
|
-
const renderComponentDefinition =
|
9132
|
+
const renderComponentDefinition = ComponentMap[field?.type];
|
9000
9133
|
if (!renderComponentDefinition) {
|
9001
9134
|
return;
|
9002
9135
|
}
|
@@ -9004,6 +9137,7 @@ function getHoverCell(aiTable) {
|
|
9004
9137
|
field,
|
9005
9138
|
recordId,
|
9006
9139
|
fieldId,
|
9140
|
+
isExpand: !!expandCell,
|
9007
9141
|
renderComponentDefinition
|
9008
9142
|
};
|
9009
9143
|
}
|
@@ -9030,6 +9164,45 @@ function clearCells(aiTable, actions) {
|
|
9030
9164
|
}
|
9031
9165
|
}
|
9032
9166
|
|
9167
|
+
function aiTableTextConfigToKonvaConfig(textConfig, rowHeight) {
|
9168
|
+
const result = {
|
9169
|
+
x: textConfig.x,
|
9170
|
+
y: textConfig.y,
|
9171
|
+
text: textConfig.text,
|
9172
|
+
fill: textConfig.fillStyle,
|
9173
|
+
fontStyle: textConfig.fontWeight,
|
9174
|
+
fontSize: textConfig.fontSize,
|
9175
|
+
align: textConfig.textAlign,
|
9176
|
+
height: 0,
|
9177
|
+
verticalAlign: textConfig.verticalAlign,
|
9178
|
+
textDecoration: textConfig.textDecoration
|
9179
|
+
};
|
9180
|
+
return result;
|
9181
|
+
}
|
9182
|
+
function aiTableImageConfigToKonvaConfig(imageConfig, options) {
|
9183
|
+
let image = imageCache.getImage(imageConfig.url);
|
9184
|
+
if (!image) {
|
9185
|
+
const img = new Image();
|
9186
|
+
img.src = imageConfig.url;
|
9187
|
+
image = img;
|
9188
|
+
}
|
9189
|
+
const result = {
|
9190
|
+
...imageConfig,
|
9191
|
+
listening: options?.listening,
|
9192
|
+
image: image
|
9193
|
+
};
|
9194
|
+
return result;
|
9195
|
+
}
|
9196
|
+
function aiTableRectConfigToKonvaConfig(rectConfig, options) {
|
9197
|
+
const result = {
|
9198
|
+
name: options?.name,
|
9199
|
+
...rectConfig,
|
9200
|
+
cornerRadius: rectConfig.radius,
|
9201
|
+
listening: options?.listening ?? false
|
9202
|
+
};
|
9203
|
+
return result;
|
9204
|
+
}
|
9205
|
+
|
9033
9206
|
class AITableGridEventService {
|
9034
9207
|
constructor() {
|
9035
9208
|
this.dblClickEvent$ = new Subject();
|
@@ -9117,7 +9290,7 @@ class AITableGridEventService {
|
|
9117
9290
|
return ref;
|
9118
9291
|
}
|
9119
9292
|
getOriginPosition(aiTable, options) {
|
9120
|
-
const { container, coordinate, recordId, fieldId
|
9293
|
+
const { container, coordinate, recordId, fieldId } = options;
|
9121
9294
|
const { scrollState } = aiTable.context;
|
9122
9295
|
const { rowHeight, columnCount } = coordinate;
|
9123
9296
|
const cell = [recordId, fieldId];
|
@@ -9144,13 +9317,6 @@ class AITableGridEventService {
|
|
9144
9317
|
let y = originPosition.y + getEditorBoxOffset();
|
9145
9318
|
let width = getEditorSpace(originPosition.width);
|
9146
9319
|
let height = getEditorSpace(originPosition.height);
|
9147
|
-
// hover 编辑组件无边框
|
9148
|
-
if (isHoverEdit) {
|
9149
|
-
x = originPosition.x + getHoverEditorBoxOffset();
|
9150
|
-
y = originPosition.y + getHoverEditorBoxOffset();
|
9151
|
-
width = getHoverEditorSpace(originPosition.width);
|
9152
|
-
height = getHoverEditorSpace(originPosition.height);
|
9153
|
-
}
|
9154
9320
|
return {
|
9155
9321
|
...originPosition,
|
9156
9322
|
x: x,
|
@@ -9160,7 +9326,7 @@ class AITableGridEventService {
|
|
9160
9326
|
};
|
9161
9327
|
}
|
9162
9328
|
openCellEditor(aiTable, options) {
|
9163
|
-
const { container, recordId, fieldId,
|
9329
|
+
const { container, recordId, fieldId, references } = options;
|
9164
9330
|
const fieldType = this.aiTable.fieldsMap()[fieldId].type;
|
9165
9331
|
const { component, isInternalComponent } = this.getEditorComponent(fieldType);
|
9166
9332
|
const offsetOriginPosition = this.getOriginPosition(aiTable, options);
|
@@ -9177,7 +9343,8 @@ class AITableGridEventService {
|
|
9177
9343
|
fieldId: fieldId,
|
9178
9344
|
recordId: recordId,
|
9179
9345
|
references,
|
9180
|
-
aiTable: aiTable
|
9346
|
+
aiTable: aiTable,
|
9347
|
+
isSelectAll: options.isSelectAll,
|
9181
9348
|
},
|
9182
9349
|
panelClass: 'grid-cell-editor',
|
9183
9350
|
outsideClosable: fieldType === AITableFieldType.link ? true : false,
|
@@ -9451,17 +9618,219 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9451
9618
|
], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], template: "<div class=\"grid-header d-flex\">\n <div class=\"grid-column-checkbox grid-cell grid-checkbox\">\n <label thyCheckbox thyLabelText=\"\" [ngModel]=\"isSelectedAll()\" (ngModelChange)=\"toggleSelectAll($event)\"></label>\n </div>\n @for (field of gridData().fields; track field._id) {\n <div\n class=\"grid-cell grid-field\"\n #fieldAction\n [attr.fieldId]=\"field._id\"\n [ngClass]=\"{ highlight: aiTable.selection().selectedFields.has(field._id) }\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n <span class=\"text-truncate\">\n <thy-icon [thyIconName]=\"field.icon!\" class=\"mr-2 text-muted\"></thy-icon>\n <span>{{ field.name }}</span>\n </span>\n <a\n href=\"javascript:;\"\n class=\"grid-field-action\"\n thyAction\n thyIcon=\"more-vertical\"\n (click)=\"openFieldMenu($event, field, fieldAction)\"\n >\n </a>\n </div>\n }\n <div class=\"grid-column-blank cursor-pointer\" #gridColumnBlank (click)=\"addField(gridColumnBlank)\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n<div class=\"grid-body d-flex\">\n @for (record of gridData().records; track record._id; let index = $index) {\n <div class=\"grid-row d-flex\" [ngClass]=\"{ highlight: (record._id | isSelectRecord: aiTable.selection()) }\">\n <div class=\"grid-row-index grid-checkbox\">\n <label\n [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'checked-box' : 'unchecked-box'\"\n thyCheckbox\n thyLabelText=\"\"\n [ngModel]=\"record._id | isSelectRecord: aiTable.selection()\"\n (ngModelChange)=\"selectRecord(record._id)\"\n ></label>\n <span [ngClass]=\"(record._id | isSelectRecord: aiTable.selection()) ? 'grid-row-no-number' : 'grid-row-number'\">\n {{ index + 1 }}\n </span>\n </div>\n @for (field of gridData().fields; track field._id) {\n <!-- [ngClass]=\"{\n highlight: aiTable.selection().selectedCells.has(record._id) || aiTable.selection().selectedFields.has(field._id),\n selected: aiTable.selection().selectedCells.get(record._id)?.hasOwnProperty(field._id)\n }\" -->\n <div\n #cell\n class=\"grid-cell\"\n [attr.type]=\"[field.type]\"\n [attr.fieldId]=\"[field._id]\"\n [attr.recordId]=\"[record._id]\"\n [ngStyle]=\"{ width: gridData().fieldsSizeMap[field._id] + 'px' }\"\n >\n @switch (field.type) {\n @case (AITableFieldType.select) {\n @let fieldValue = record.values[field._id];\n @let settings = field.settings! | selectSetting;\n @let options = settings['options'];\n @let optionStyle = settings['option_style'] || AITableSelectOptionStyle.tag;\n @let isTagStyle = optionStyle === AITableSelectOptionStyle.tag;\n\n @if (!settings['is_multiple'] && fieldValue | selectOption: options; as selectedOption) {\n @if (isTagStyle) {\n <select-option class=\"mb-1 mr-1\" [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"selectedOption\"></select-option>\n </div>\n }\n } @else {\n @let maxShowCount = 2;\n\n <div class=\"d-flex\">\n @if (fieldValue | selectOptions: options; as selectedOptions) {\n @for (option of selectedOptions; track option!._id; let i = $index) {\n @if (i + 1 <= maxShowCount) {\n @if (isTagStyle) {\n <select-option\n class=\"mb-1 mr-1\"\n [field]=\"field\"\n [displayOption]=\"option!\"\n ></select-option>\n } @else {\n <div thyTag class=\"mb-1 mr-1\">\n <select-option [field]=\"field\" [displayOption]=\"option!\"></select-option>\n </div>\n }\n }\n }\n\n @let selectedLength = selectedOptions.length || 0;\n @if (selectedOptions && maxShowCount < selectedLength) {\n @let shape = isTagStyle ? 'pill' : 'rectangle';\n @let isHidden = maxShowCount >= selectedLength;\n\n <thy-tag\n class=\"cursor-pointer\"\n [class.multi-property-value-hidden]=\"isHidden\"\n [thyShape]=\"shape\"\n >\n <span class=\"text-truncate\"> +{{ selectedLength - maxShowCount }} </span>\n </thy-tag>\n }\n }\n </div>\n }\n }\n @case (AITableFieldType.date) {\n {{ record.values[field._id].timestamp | thyDatePickerFormat }}\n }\n @case (AITableFieldType.updatedAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.createdAt) {\n <div class=\"d-block user-select-none\">\n <span class=\"text-truncate\">\n {{ record.values[field._id] | thyDatePickerFormat: 'yyyy-MM-dd HH:mm' }}\n </span>\n </div>\n }\n @case (AITableFieldType.rate) {\n <thy-rate [ngModel]=\"record.values[field._id]\"></thy-rate>\n }\n @case (AITableFieldType.link) {\n <a\n class=\"d-block\"\n target=\"_blank\"\n [href]=\"record.values[field._id]?.url\"\n thyStopPropagation\n thyFlexibleText\n [thyTooltipContent]=\"record.values[field._id]?.text\"\n >\n {{ record.values[field._id]?.text }}\n </a>\n }\n @case (AITableFieldType.progress) {\n <thy-progress\n class=\"w-100\"\n [thyValue]=\"record.values[field._id] || 0\"\n [thySize]=\"record.values[field._id]?.config?.size || 'md'\"\n [thyMax]=\"record.values[field._id]?.config?.max || 100\"\n [thyType]=\"record.values[field._id]?.config?.progressType || 'success'\"\n >\n <span> {{ record.values[field._id] || 0 }}{{ record.values[field._id]?.config?.suffix || '%' }} </span>\n </thy-progress>\n }\n @case (AITableFieldType.member) {\n @let settings = field.settings! | memberSetting;\n\n @if (!settings!['is_multiple']) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n } @else {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n <thy-avatar-list thyAvatarSize=\"xs\">\n @for (item of recordValues; track $index) {\n <thy-avatar [thyName]=\"item.display_name!\" [thySrc]=\"item.avatar!\"></thy-avatar>\n }\n </thy-avatar-list>\n }\n }\n @case (AITableFieldType.createdBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @case (AITableFieldType.updatedBy) {\n @let recordValues = record.values[field._id] | user: aiReferences()!;\n\n @if (recordValues && recordValues.length) {\n <thy-avatar\n [thyName]=\"recordValues[0].display_name!\"\n [thySrc]=\"recordValues[0].avatar!\"\n thySize=\"xs\"\n thyShowName=\"true\"\n ></thy-avatar>\n }\n }\n @default {\n <span class=\"text-truncate\"> {{ record.values[field._id] }}</span>\n }\n }\n <div class=\"autofill-container\"></div>\n </div>\n }\n <div class=\"grid-column-blank\"></div>\n </div>\n }\n <div class=\"grid-row-insert grid-row cursor-pointer\" (click)=\"addRecord()\">\n <thy-icon thyIconName=\"plus\"></thy-icon>\n </div>\n</div>\n\n<div #activeBorder class=\"active-border\"></div>\n" }]
|
9452
9619
|
}] });
|
9453
9620
|
|
9621
|
+
class AITableScrollControllerService {
|
9622
|
+
constructor(ngZone) {
|
9623
|
+
this.ngZone = ngZone;
|
9624
|
+
this.animationFrame = null;
|
9625
|
+
this.mouseUpSubscription = null;
|
9626
|
+
this.isAutoScrolling = false;
|
9627
|
+
this.autoScrollSub = null;
|
9628
|
+
this.edgeDistanceX = 0;
|
9629
|
+
this.edgeDistanceY = 0;
|
9630
|
+
this.lastAutoScrollOptions = null;
|
9631
|
+
this.ngZone.runOutsideAngular(() => {
|
9632
|
+
this.mouseUpSubscription = fromEvent(document, 'mouseup').subscribe(() => {
|
9633
|
+
this.handleMouseUp();
|
9634
|
+
});
|
9635
|
+
});
|
9636
|
+
}
|
9637
|
+
scroll(options) {
|
9638
|
+
const { needScroll } = this.calculateScrollDistance(options);
|
9639
|
+
if (!needScroll) {
|
9640
|
+
this.isAutoScrolling = false;
|
9641
|
+
return;
|
9642
|
+
}
|
9643
|
+
this.lastAutoScrollOptions = options;
|
9644
|
+
if (!this.isAutoScrolling) {
|
9645
|
+
this.startAutoScroll(options);
|
9646
|
+
}
|
9647
|
+
}
|
9648
|
+
handleMouseUp() {
|
9649
|
+
this.isAutoScrolling = false;
|
9650
|
+
if (this.autoScrollSub) {
|
9651
|
+
this.autoScrollSub.unsubscribe();
|
9652
|
+
this.autoScrollSub = null;
|
9653
|
+
}
|
9654
|
+
this.isAutoScrolling = false;
|
9655
|
+
}
|
9656
|
+
startAutoScroll(options) {
|
9657
|
+
if (this.autoScrollSub) {
|
9658
|
+
this.autoScrollSub.unsubscribe();
|
9659
|
+
this.autoScrollSub = null;
|
9660
|
+
}
|
9661
|
+
this.isAutoScrolling = true;
|
9662
|
+
this.ngZone.runOutsideAngular(() => {
|
9663
|
+
this.autoScrollSub = animationFrames()
|
9664
|
+
.pipe(takeWhile(() => this.isAutoScrolling), map(() => {
|
9665
|
+
const currentOptions = this.lastAutoScrollOptions || options;
|
9666
|
+
let currentScrollX = 0;
|
9667
|
+
let currentScrollY = 0;
|
9668
|
+
const { horizontalElement, verticalElement } = currentOptions.scrollableElement;
|
9669
|
+
if (horizontalElement) {
|
9670
|
+
currentScrollX = horizontalElement.scrollLeft;
|
9671
|
+
}
|
9672
|
+
if (verticalElement) {
|
9673
|
+
currentScrollY = verticalElement.scrollTop;
|
9674
|
+
}
|
9675
|
+
// 计算最新滚动距离和速度
|
9676
|
+
const { scrollResult } = this.calculateScrollDistance(currentOptions);
|
9677
|
+
let left = 0;
|
9678
|
+
let top = 0;
|
9679
|
+
if (horizontalElement && scrollResult.speedX !== undefined && scrollResult.speedX !== 0) {
|
9680
|
+
left = Math.max(0, currentScrollX + scrollResult.speedX);
|
9681
|
+
horizontalElement.scrollLeft = left;
|
9682
|
+
}
|
9683
|
+
if (verticalElement && scrollResult.speedY !== undefined && scrollResult.speedY !== 0) {
|
9684
|
+
top = Math.max(0, currentScrollY + scrollResult.speedY);
|
9685
|
+
verticalElement.scrollTop = top;
|
9686
|
+
}
|
9687
|
+
this.isAutoScrolling = left !== 0 || top !== 0;
|
9688
|
+
return {
|
9689
|
+
x: horizontalElement?.scrollLeft || 0,
|
9690
|
+
y: verticalElement?.scrollTop || 0
|
9691
|
+
};
|
9692
|
+
}))
|
9693
|
+
.subscribe((position) => {
|
9694
|
+
options.onScrollChange?.({ x: position.x, y: position.y }, this.isAutoScrolling);
|
9695
|
+
});
|
9696
|
+
});
|
9697
|
+
}
|
9698
|
+
getEdgeThreshold(threshold, direction) {
|
9699
|
+
const defaultThreshold = 10; // 默认阈值
|
9700
|
+
if (isObject(threshold)) {
|
9701
|
+
return threshold[direction] || defaultThreshold;
|
9702
|
+
}
|
9703
|
+
return threshold || defaultThreshold;
|
9704
|
+
}
|
9705
|
+
// 计算距离和滚动速度
|
9706
|
+
calculateScrollDistance(options) {
|
9707
|
+
const { container, target, direction = 'both', scrollableElement, frozenArea = {}, edgeThreshold = 0, minScrollSpeed = 1, maxScrollSpeed = 20, scrollSpeedFactor = 1 } = options;
|
9708
|
+
const { horizontalElement, verticalElement } = scrollableElement;
|
9709
|
+
// 初始化滚动结果
|
9710
|
+
const scrollResult = {
|
9711
|
+
x: 0,
|
9712
|
+
y: 0,
|
9713
|
+
speedX: 0,
|
9714
|
+
speedY: 0
|
9715
|
+
};
|
9716
|
+
let needScroll = false;
|
9717
|
+
// 水平滚动计算
|
9718
|
+
if ((direction === 'horizontal' || direction === 'both') && horizontalElement) {
|
9719
|
+
const minLeft = frozenArea.left || 0;
|
9720
|
+
const maxLeft = frozenArea.right || container.width;
|
9721
|
+
const leftEdgeThreshold = this.getEdgeThreshold(edgeThreshold, 'left');
|
9722
|
+
const rightEdgeThreshold = this.getEdgeThreshold(edgeThreshold, 'right');
|
9723
|
+
if (target.x < minLeft + leftEdgeThreshold) {
|
9724
|
+
this.edgeDistanceX = Math.abs(minLeft + leftEdgeThreshold - target.x);
|
9725
|
+
// point点位离左边界阈值越远,速度越快
|
9726
|
+
const distanceFactor = Math.min(1.0, this.edgeDistanceX / leftEdgeThreshold);
|
9727
|
+
const speed = this.calculateSpeed(distanceFactor, minScrollSpeed, maxScrollSpeed, scrollSpeedFactor);
|
9728
|
+
scrollResult.x = this.edgeDistanceX;
|
9729
|
+
scrollResult.speedX = -speed; // 向左滚动
|
9730
|
+
needScroll = this.edgeDistanceX > 0;
|
9731
|
+
}
|
9732
|
+
else if (target.x + (target.width || 0) > maxLeft - rightEdgeThreshold) {
|
9733
|
+
const rightEdge = target.x + (target.width || 0);
|
9734
|
+
this.edgeDistanceX = Math.abs(rightEdge - maxLeft + rightEdgeThreshold);
|
9735
|
+
const distanceFactor = Math.min(1.0, this.edgeDistanceX / rightEdgeThreshold);
|
9736
|
+
const speed = this.calculateSpeed(distanceFactor, minScrollSpeed, maxScrollSpeed, scrollSpeedFactor);
|
9737
|
+
scrollResult.x = this.edgeDistanceX;
|
9738
|
+
scrollResult.speedX = speed;
|
9739
|
+
needScroll = this.edgeDistanceX > 0;
|
9740
|
+
}
|
9741
|
+
else {
|
9742
|
+
this.edgeDistanceX = 0;
|
9743
|
+
scrollResult.speedX = 0;
|
9744
|
+
}
|
9745
|
+
}
|
9746
|
+
// 垂直滚动计算
|
9747
|
+
if ((direction === 'vertical' || direction === 'both') && verticalElement) {
|
9748
|
+
const minTop = frozenArea.top || 0;
|
9749
|
+
const maxTop = frozenArea.bottom || container.height;
|
9750
|
+
const topEdgeThreshold = this.getEdgeThreshold(edgeThreshold, 'top');
|
9751
|
+
const bottomEdgeThreshold = this.getEdgeThreshold(edgeThreshold, 'bottom');
|
9752
|
+
if (target.y < minTop + topEdgeThreshold) {
|
9753
|
+
// 滚动距离
|
9754
|
+
this.edgeDistanceY = Math.abs(minTop + topEdgeThreshold - target.y);
|
9755
|
+
const distanceFactor = Math.min(1.0, this.edgeDistanceY / topEdgeThreshold);
|
9756
|
+
const speed = this.calculateSpeed(distanceFactor, minScrollSpeed, maxScrollSpeed, scrollSpeedFactor);
|
9757
|
+
scrollResult.y = this.edgeDistanceY;
|
9758
|
+
scrollResult.speedY = -speed; // 负值表示向上滚动
|
9759
|
+
needScroll = this.edgeDistanceY > 0;
|
9760
|
+
}
|
9761
|
+
else if (target.y + (target.height || 0) > maxTop - bottomEdgeThreshold) {
|
9762
|
+
// 向下滚动
|
9763
|
+
this.edgeDistanceY = Math.abs(target.y + (target.height || 0) - maxTop + bottomEdgeThreshold);
|
9764
|
+
const distanceFactor = Math.min(1.0, this.edgeDistanceY / bottomEdgeThreshold);
|
9765
|
+
const speed = this.calculateSpeed(distanceFactor, minScrollSpeed, maxScrollSpeed, scrollSpeedFactor);
|
9766
|
+
scrollResult.y = this.edgeDistanceY;
|
9767
|
+
scrollResult.speedY = speed;
|
9768
|
+
needScroll = this.edgeDistanceY > 0;
|
9769
|
+
}
|
9770
|
+
else {
|
9771
|
+
// 不在边缘区域,重置边缘距离
|
9772
|
+
this.edgeDistanceY = 0;
|
9773
|
+
scrollResult.speedY = 0;
|
9774
|
+
}
|
9775
|
+
}
|
9776
|
+
return { scrollResult, needScroll };
|
9777
|
+
}
|
9778
|
+
/**
|
9779
|
+
* 计算滚动速度
|
9780
|
+
* @param distanceFactor 距离因子(0-1)
|
9781
|
+
* @param minSpeed 最小速度
|
9782
|
+
* @param maxSpeed 最大速度
|
9783
|
+
* @param speedFactor 速度因子
|
9784
|
+
* @returns 计算后的滚动速度
|
9785
|
+
*/
|
9786
|
+
calculateSpeed(distanceFactor, minSpeed, maxSpeed, speedFactor) {
|
9787
|
+
// 二次曲线计算,距离因子越大速度增长越快
|
9788
|
+
const easedFactor = distanceFactor * distanceFactor;
|
9789
|
+
// 计算最终速度,范围为 minSpeed 到 maxSpeed 之间
|
9790
|
+
const speed = minSpeed + (maxSpeed - minSpeed) * easedFactor;
|
9791
|
+
// 应用全局速度因子
|
9792
|
+
return speed * speedFactor;
|
9793
|
+
}
|
9794
|
+
destroy() {
|
9795
|
+
if (this.animationFrame) {
|
9796
|
+
cancelAnimationFrame(this.animationFrame);
|
9797
|
+
this.animationFrame = null;
|
9798
|
+
}
|
9799
|
+
if (this.autoScrollSub) {
|
9800
|
+
this.autoScrollSub.unsubscribe();
|
9801
|
+
this.autoScrollSub = null;
|
9802
|
+
}
|
9803
|
+
if (this.mouseUpSubscription) {
|
9804
|
+
this.mouseUpSubscription.unsubscribe();
|
9805
|
+
this.mouseUpSubscription = null;
|
9806
|
+
}
|
9807
|
+
}
|
9808
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableScrollControllerService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
9809
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableScrollControllerService }); }
|
9810
|
+
}
|
9811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableScrollControllerService, decorators: [{
|
9812
|
+
type: Injectable
|
9813
|
+
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
9814
|
+
|
9454
9815
|
class AITableDragComponent {
|
9455
9816
|
constructor() {
|
9817
|
+
this.horizontalBar = input();
|
9818
|
+
this.verticalBar = input();
|
9456
9819
|
this.dragEnd = output();
|
9457
9820
|
this.aiTableGridSelectionService = inject(AITableGridSelectionService);
|
9458
9821
|
this.render2 = inject(Renderer2);
|
9822
|
+
this.scrollControllerService = inject(AITableScrollControllerService);
|
9459
9823
|
this.elementRef = inject((ElementRef));
|
9460
9824
|
this.draggedData = null;
|
9825
|
+
this.scrollBarStartPosition = { x: 0, y: 0 };
|
9461
9826
|
this.mouseStartPosition = null;
|
9462
9827
|
this.aiTableDrag = null;
|
9463
9828
|
this.mouseDownTimeout = null;
|
9464
9829
|
this.isDraggingEnabled = false;
|
9830
|
+
this.containerWidth = 0;
|
9831
|
+
this.containerHeight = 0;
|
9832
|
+
this.horizontalBarMaxScroll = 0;
|
9833
|
+
this.verticalBarMaxScroll = 0;
|
9465
9834
|
effect(() => this.handleDragStateChange());
|
9466
9835
|
}
|
9467
9836
|
ngOnInit() {
|
@@ -9479,6 +9848,11 @@ class AITableDragComponent {
|
|
9479
9848
|
clearTimeout(this.mouseDownTimeout);
|
9480
9849
|
}
|
9481
9850
|
this.isDraggingEnabled = false;
|
9851
|
+
this.horizontalBarElement = this.horizontalBar()?.nativeElement;
|
9852
|
+
this.horizontalBarMaxScroll = (this.horizontalBarElement?.scrollWidth || 0) - (this.horizontalBarElement?.clientWidth || 0);
|
9853
|
+
this.verticalBarElement = this.verticalBar()?.nativeElement;
|
9854
|
+
this.verticalBarMaxScroll = (this.verticalBarElement?.scrollHeight || 0) - (this.verticalBarElement?.clientHeight || 0);
|
9855
|
+
this.scrollBarStartPosition = { x: this.horizontalBarElement?.scrollLeft || 0, y: this.verticalBarElement?.scrollTop || 0 };
|
9482
9856
|
this.mouseDownTimeout = setTimeout(() => {
|
9483
9857
|
this.isDraggingEnabled = true;
|
9484
9858
|
}, 200);
|
@@ -9523,6 +9897,8 @@ class AITableDragComponent {
|
|
9523
9897
|
return;
|
9524
9898
|
}
|
9525
9899
|
this.setDisplayStyle('block');
|
9900
|
+
this.containerWidth = this.elementRef.nativeElement.offsetWidth;
|
9901
|
+
this.containerHeight = this.elementRef.nativeElement.offsetHeight;
|
9526
9902
|
const moveX = e.x - (this.mouseStartPosition?.x || 0);
|
9527
9903
|
const moveY = e.y - (this.mouseStartPosition?.y || 0);
|
9528
9904
|
switch (drag.type) {
|
@@ -9539,7 +9915,7 @@ class AITableDragComponent {
|
|
9539
9915
|
}
|
9540
9916
|
movingColumn(drag, moveX) {
|
9541
9917
|
const aiTable = this.aiTableGridSelectionService.aiTable;
|
9542
|
-
const scroll =
|
9918
|
+
const scroll = { x: this.horizontalBarElement?.scrollLeft || 0, y: 0 };
|
9543
9919
|
const coordinate = drag.coordinate;
|
9544
9920
|
const fields = aiTable.gridData().fields;
|
9545
9921
|
const width = this.calculateDragWidth(fields, coordinate, drag);
|
@@ -9553,60 +9929,102 @@ class AITableDragComponent {
|
|
9553
9929
|
const pointerX = moveX + sourceColumnStartX;
|
9554
9930
|
// 拖拽中心点
|
9555
9931
|
const dragCenter = sourceColumnWidth / 2;
|
9556
|
-
const
|
9932
|
+
const currentRectLeft = pointerX - (isSourceColumnFrozen ? 0 : this.scrollBarStartPosition.x);
|
9933
|
+
let newScrollPosition = { x: scroll.x, y: scroll.y };
|
9557
9934
|
this.setRectStyles({
|
9558
9935
|
cursor: 'move',
|
9559
9936
|
width: `${width}px`,
|
9560
9937
|
height: '100%',
|
9561
9938
|
top: '0',
|
9562
|
-
left: `${
|
9563
|
-
});
|
9564
|
-
|
9565
|
-
const
|
9566
|
-
|
9567
|
-
|
9568
|
-
|
9569
|
-
|
9570
|
-
|
9571
|
-
|
9572
|
-
|
9573
|
-
|
9574
|
-
|
9575
|
-
|
9576
|
-
|
9577
|
-
|
9578
|
-
|
9579
|
-
|
9580
|
-
|
9581
|
-
|
9582
|
-
|
9583
|
-
|
9939
|
+
left: `${currentRectLeft}px`
|
9940
|
+
});
|
9941
|
+
// 计算目标列和辅助线
|
9942
|
+
const updateTargetAndLine = (rectLeft, scrollPosition) => {
|
9943
|
+
let targetColumnIndex = coordinate.getColumnStartIndex(rectLeft + scrollPosition.x + dragCenter);
|
9944
|
+
const lastColumnOffset = coordinate.getColumnOffset(coordinate.columnCount - 1);
|
9945
|
+
const lastColumnWidth = coordinate.getColumnWidth(coordinate.columnCount - 1);
|
9946
|
+
const lastColumnEndX = lastColumnOffset + lastColumnWidth;
|
9947
|
+
let targetColumnStartX = coordinate.getColumnOffset(targetColumnIndex);
|
9948
|
+
let isLastColumn = false;
|
9949
|
+
// 处理最后一列
|
9950
|
+
if (rectLeft + dragCenter + scrollPosition.x > lastColumnEndX) {
|
9951
|
+
targetColumnIndex = coordinate.columnCount;
|
9952
|
+
targetColumnStartX = lastColumnOffset + lastColumnWidth;
|
9953
|
+
isLastColumn = true;
|
9954
|
+
}
|
9955
|
+
if ((targetColumnIndex >= 0 && (targetColumnIndex - sourceColumnIndex > 1 || targetColumnIndex - sourceColumnIndex < 0)) ||
|
9956
|
+
isLastColumn) {
|
9957
|
+
let lineLeft = targetColumnStartX - scrollPosition.x;
|
9958
|
+
const lineForFrozenX = lineLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
|
9959
|
+
const rectDistanceFrozenX = rectLeft - frozenColumnWidth - aiTable.context.rowHeadWidth();
|
9960
|
+
if (lineForFrozenX < 0) {
|
9961
|
+
if (Math.abs(rectDistanceFrozenX) < dragCenter) {
|
9962
|
+
// 滚动中保持上一个位置
|
9963
|
+
const nextColumnStartX = coordinate.getColumnOffset(targetColumnIndex + 1);
|
9964
|
+
this.setAuxiliaryLineStyles({
|
9965
|
+
left: `${nextColumnStartX - scrollPosition.x}px`
|
9966
|
+
});
|
9967
|
+
this.draggedData = {
|
9968
|
+
type: DragType.field,
|
9969
|
+
targetIndex: targetColumnIndex + 1,
|
9970
|
+
fieldIds: drag.sourceIds,
|
9971
|
+
fieldsIndex: Array.from(drag.sourceIds).map((id) => visibleColumnIndexMap.get(id) || 0)
|
9972
|
+
};
|
9973
|
+
return;
|
9974
|
+
}
|
9584
9975
|
}
|
9585
|
-
|
9586
|
-
|
9976
|
+
this.setAuxiliaryLineStyles({
|
9977
|
+
width: '2px',
|
9978
|
+
height: '100%',
|
9979
|
+
top: 0,
|
9980
|
+
left: `${lineLeft}px`
|
9981
|
+
});
|
9982
|
+
// 向右移动目标在目标列的前一列
|
9983
|
+
if (targetColumnIndex > sourceColumnIndex) {
|
9984
|
+
targetColumnIndex -= 1;
|
9587
9985
|
}
|
9986
|
+
this.draggedData = {
|
9987
|
+
type: DragType.field,
|
9988
|
+
targetIndex: targetColumnIndex,
|
9989
|
+
fieldIds: drag.sourceIds,
|
9990
|
+
fieldsIndex: Array.from(drag.sourceIds).map((id) => visibleColumnIndexMap.get(id) || 0)
|
9991
|
+
};
|
9588
9992
|
}
|
9589
|
-
|
9590
|
-
|
9591
|
-
|
9592
|
-
top: 0,
|
9593
|
-
left: `${lineLeft}px`
|
9594
|
-
});
|
9595
|
-
// 向右移动目标在目标列的前一列
|
9596
|
-
if (targetColumnIndex > sourceColumnIndex) {
|
9597
|
-
targetColumnIndex -= 1;
|
9993
|
+
else {
|
9994
|
+
this.resetAuxiliaryLine();
|
9995
|
+
this.draggedData = null;
|
9598
9996
|
}
|
9599
|
-
|
9600
|
-
|
9601
|
-
|
9602
|
-
|
9603
|
-
|
9604
|
-
|
9605
|
-
|
9606
|
-
|
9607
|
-
|
9608
|
-
|
9609
|
-
|
9997
|
+
};
|
9998
|
+
updateTargetAndLine(currentRectLeft, newScrollPosition);
|
9999
|
+
this.scrollControllerService.scroll({
|
10000
|
+
container: {
|
10001
|
+
width: this.containerWidth,
|
10002
|
+
height: this.containerHeight
|
10003
|
+
},
|
10004
|
+
target: {
|
10005
|
+
x: currentRectLeft,
|
10006
|
+
y: 0,
|
10007
|
+
width: sourceColumnWidth,
|
10008
|
+
height: this.containerHeight
|
10009
|
+
},
|
10010
|
+
direction: 'horizontal',
|
10011
|
+
scrollableElement: {
|
10012
|
+
horizontalElement: this.horizontalBarElement
|
10013
|
+
},
|
10014
|
+
frozenArea: {
|
10015
|
+
left: frozenColumnWidth + aiTable.context.rowHeadWidth()
|
10016
|
+
},
|
10017
|
+
edgeThreshold: {
|
10018
|
+
left: AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD,
|
10019
|
+
right: AI_TABLE_SCROLL_BAR_SIZE + AI_TABLE_AUTO_SCROLL_RIGHT_THRESHOLD
|
10020
|
+
},
|
10021
|
+
onScrollChange: (position, isAutoScrolling) => {
|
10022
|
+
newScrollPosition = position;
|
10023
|
+
if (isAutoScrolling && position.x > 0 && Math.round(position.x) < this.horizontalBarMaxScroll) {
|
10024
|
+
updateTargetAndLine(currentRectLeft, position);
|
10025
|
+
}
|
10026
|
+
}
|
10027
|
+
});
|
9610
10028
|
}
|
9611
10029
|
movingColumnWidth(drag, moveX) {
|
9612
10030
|
this.setCursorStyle('col-resize');
|
@@ -9615,7 +10033,7 @@ class AITableDragComponent {
|
|
9615
10033
|
const sourceColumnIndex = visibleColumnIndexMap.get(drag.sourceIds.values().next().value) || 0;
|
9616
10034
|
const sourceColumnStartX = drag.coordinate.getColumnOffset(sourceColumnIndex);
|
9617
10035
|
const sourceColumnWidth = drag.coordinate.getColumnWidth(sourceColumnIndex);
|
9618
|
-
const scroll =
|
10036
|
+
const scroll = { x: this.horizontalBarElement?.scrollLeft || 0, y: this.verticalBarElement?.scrollTop || 0 };
|
9619
10037
|
const pointerX = moveX + sourceColumnStartX;
|
9620
10038
|
const colResizeX = pointerX - (sourceColumnIndex === 0 ? 0 : scroll.x);
|
9621
10039
|
const left = `${colResizeX + sourceColumnWidth}px`;
|
@@ -9625,15 +10043,23 @@ class AITableDragComponent {
|
|
9625
10043
|
top: '0',
|
9626
10044
|
left
|
9627
10045
|
});
|
10046
|
+
let minWidth = MIN_COLUMN_WIDTH;
|
10047
|
+
drag.sourceIds.forEach((id) => {
|
10048
|
+
const field = aiTable.fieldsMap()[id];
|
10049
|
+
const fieldOption = aiTable.context.fieldOptionMap().get(field.type);
|
10050
|
+
if (fieldOption && fieldOption.minWidth) {
|
10051
|
+
minWidth = Math.max(minWidth, fieldOption.minWidth);
|
10052
|
+
}
|
10053
|
+
});
|
9628
10054
|
this.draggedData = {
|
9629
10055
|
type: DragType.columnWidth,
|
9630
10056
|
fieldIds: drag.sourceIds,
|
9631
|
-
width: Math.max(
|
10057
|
+
width: Math.max(minWidth, sourceColumnWidth + moveX)
|
9632
10058
|
};
|
9633
10059
|
}
|
9634
10060
|
movingRecord(drag, moveY) {
|
9635
10061
|
const aiTable = this.aiTableGridSelectionService.aiTable;
|
9636
|
-
const scroll =
|
10062
|
+
const scroll = { x: 0, y: this.verticalBarElement?.scrollTop || 0 };
|
9637
10063
|
const coordinate = drag.coordinate;
|
9638
10064
|
const visibleRowIndexMap = aiTable.context.visibleRowsIndexMap();
|
9639
10065
|
const sourceRowId = drag.sourceIds.values().next().value;
|
@@ -9641,37 +10067,82 @@ class AITableDragComponent {
|
|
9641
10067
|
const sourceRowStartY = coordinate.getRowOffset(sourceRowIndex);
|
9642
10068
|
const sourceRowHeight = coordinate.getRowHeight(sourceRowIndex);
|
9643
10069
|
const pointerY = sourceRowStartY + moveY;
|
10070
|
+
const rectTop = pointerY - this.scrollBarStartPosition.y;
|
9644
10071
|
this.setRectStyles({
|
9645
10072
|
width: '100%',
|
9646
10073
|
height: `${sourceRowHeight}px`,
|
9647
|
-
top: `${
|
10074
|
+
top: `${rectTop}px`,
|
9648
10075
|
left: '0'
|
9649
10076
|
});
|
9650
|
-
|
9651
|
-
const
|
9652
|
-
|
9653
|
-
|
9654
|
-
|
9655
|
-
|
9656
|
-
(sourceRowIndex
|
9657
|
-
|
9658
|
-
|
9659
|
-
|
9660
|
-
|
9661
|
-
|
9662
|
-
|
9663
|
-
|
9664
|
-
|
9665
|
-
|
9666
|
-
|
9667
|
-
|
9668
|
-
|
9669
|
-
|
9670
|
-
|
9671
|
-
|
9672
|
-
|
9673
|
-
|
9674
|
-
|
10077
|
+
let newScrollPosition = { x: scroll.x, y: scroll.y };
|
10078
|
+
const updateTargetAndLine = (rectTop, scrollPosition) => {
|
10079
|
+
const dragCenter = sourceRowHeight / 2;
|
10080
|
+
const targetRowIndex = coordinate.getRowStartIndex(rectTop + scrollPosition.y + dragCenter);
|
10081
|
+
const targetRowStartY = coordinate.getRowOffset(targetRowIndex);
|
10082
|
+
const lineHeight = 2;
|
10083
|
+
if ((targetRowIndex >= 0 && sourceRowIndex > targetRowIndex && sourceRowIndex - targetRowIndex > 0) ||
|
10084
|
+
(sourceRowIndex < targetRowIndex && targetRowIndex - sourceRowIndex > 1)) {
|
10085
|
+
let lineTop = targetRowStartY - scrollPosition.y;
|
10086
|
+
if (lineTop < AI_TABLE_FIELD_HEAD_HEIGHT) {
|
10087
|
+
// 滚动中保持上一个位置
|
10088
|
+
const nextColumnStartY = coordinate.getRowOffset(targetRowIndex + 1);
|
10089
|
+
this.setAuxiliaryLineStyles({
|
10090
|
+
top: `${nextColumnStartY - scrollPosition.y}px`
|
10091
|
+
});
|
10092
|
+
this.draggedData = {
|
10093
|
+
type: DragType.record,
|
10094
|
+
recordIds: drag.sourceIds,
|
10095
|
+
targetIndex: targetRowIndex + 1
|
10096
|
+
};
|
10097
|
+
return;
|
10098
|
+
}
|
10099
|
+
this.setAuxiliaryLineStyles({
|
10100
|
+
width: `calc(100% - ${AI_TABLE_ROW_DRAG_ICON_WIDTH}px)`,
|
10101
|
+
height: `${lineHeight}px`,
|
10102
|
+
top: `${lineTop}px`,
|
10103
|
+
left: `${AI_TABLE_ROW_DRAG_ICON_WIDTH}px`
|
10104
|
+
});
|
10105
|
+
this.draggedData = {
|
10106
|
+
type: DragType.record,
|
10107
|
+
recordIds: drag.sourceIds,
|
10108
|
+
targetIndex: targetRowIndex
|
10109
|
+
};
|
10110
|
+
}
|
10111
|
+
else {
|
10112
|
+
this.resetAuxiliaryLine();
|
10113
|
+
this.draggedData = null;
|
10114
|
+
}
|
10115
|
+
};
|
10116
|
+
updateTargetAndLine(rectTop, newScrollPosition);
|
10117
|
+
this.scrollControllerService.scroll({
|
10118
|
+
container: {
|
10119
|
+
width: this.containerWidth,
|
10120
|
+
height: this.containerHeight
|
10121
|
+
},
|
10122
|
+
target: {
|
10123
|
+
x: 0,
|
10124
|
+
y: rectTop,
|
10125
|
+
width: this.containerWidth,
|
10126
|
+
height: sourceRowHeight
|
10127
|
+
},
|
10128
|
+
direction: 'vertical',
|
10129
|
+
scrollableElement: {
|
10130
|
+
verticalElement: this.verticalBarElement
|
10131
|
+
},
|
10132
|
+
frozenArea: {
|
10133
|
+
top: AI_TABLE_FIELD_HEAD_HEIGHT
|
10134
|
+
},
|
10135
|
+
edgeThreshold: {
|
10136
|
+
top: AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD,
|
10137
|
+
bottom: AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD
|
10138
|
+
},
|
10139
|
+
onScrollChange: (position, isAutoScrolling) => {
|
10140
|
+
newScrollPosition = position;
|
10141
|
+
if (isAutoScrolling && position.y > 0 && position.y < this.verticalBarMaxScroll) {
|
10142
|
+
updateTargetAndLine(rectTop, newScrollPosition);
|
10143
|
+
}
|
10144
|
+
}
|
10145
|
+
});
|
9675
10146
|
}
|
9676
10147
|
handleDragEnd() {
|
9677
10148
|
if (this.draggedData) {
|
@@ -9734,9 +10205,10 @@ class AITableDragComponent {
|
|
9734
10205
|
cancelAnimationFrame(this.timer);
|
9735
10206
|
this.timer = null;
|
9736
10207
|
}
|
10208
|
+
this.scrollControllerService.destroy();
|
9737
10209
|
}
|
9738
10210
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableDragComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9739
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
10211
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.10", type: AITableDragComponent, isStandalone: true, selector: "ai-table-drag", inputs: { horizontalBar: { classPropertyName: "horizontalBar", publicName: "horizontalBar", isSignal: true, isRequired: false, transformFunction: null }, verticalBar: { classPropertyName: "verticalBar", publicName: "verticalBar", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dragEnd: "dragEnd" }, host: { classAttribute: "ai-table-drag-container" }, ngImport: i0, template: "<div class=\"rect\"></div>\n<div class=\"auxiliary-line\"></div>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
9740
10212
|
}
|
9741
10213
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableDragComponent, decorators: [{
|
9742
10214
|
type: Component,
|
@@ -9752,6 +10224,7 @@ class AITableGrid extends AITableGridBase {
|
|
9752
10224
|
this.isDragSelecting = false;
|
9753
10225
|
this.dragSelectionStart = null;
|
9754
10226
|
this.notifyService = inject(ThyNotifyService);
|
10227
|
+
this.scrollControllerService = inject(AITableScrollControllerService);
|
9755
10228
|
this.isPopoverOpen = false;
|
9756
10229
|
this.fieldHeadHeight = AI_TABLE_FIELD_HEAD_HEIGHT;
|
9757
10230
|
this.containerRect = signal({ width: 0, height: 0 });
|
@@ -9765,16 +10238,56 @@ class AITableGrid extends AITableGridBase {
|
|
9765
10238
|
this.linearRows = computed(() => {
|
9766
10239
|
return buildGridLinearRows(this.gridData().records, !this.aiReadonly());
|
9767
10240
|
});
|
10241
|
+
this.domToolTips = computed(() => {
|
10242
|
+
const scrollTop = this.aiTable.context.scrollState().scrollTop;
|
10243
|
+
const rowIndices = this.toolTipRowIndices();
|
10244
|
+
return rowIndices.map((rowIndex) => {
|
10245
|
+
return {
|
10246
|
+
top: rowIndex * AI_TABLE_ROW_HEIGHT - scrollTop,
|
10247
|
+
left: 0
|
10248
|
+
};
|
10249
|
+
});
|
10250
|
+
});
|
10251
|
+
this.toolTipRowIndices = computed(() => {
|
10252
|
+
const hiddenRows = this.aiTable.recordsWillHidden() || [];
|
10253
|
+
const toolTipRowIndices = hiddenRows.map((rowId) => {
|
10254
|
+
return this.aiTable.context?.visibleRowsIndexMap().get(rowId) || 0;
|
10255
|
+
});
|
10256
|
+
return toolTipRowIndices;
|
10257
|
+
});
|
9768
10258
|
this.visibleColumnsIndexMap = computed(() => {
|
9769
10259
|
const columns = AITable.getVisibleFields(this.aiTable);
|
9770
10260
|
return new Map(columns?.map((item, index) => [item._id, index]));
|
9771
10261
|
});
|
10262
|
+
this.fieldOptions = computed(() => {
|
10263
|
+
let allFieldOptions = defaultFieldOptions.map((fieldOption) => {
|
10264
|
+
fieldOption.name = getI18nTextByKey(this.aiTable, fieldOption.name);
|
10265
|
+
return fieldOption;
|
10266
|
+
});
|
10267
|
+
Object.entries(this.aiTable.context?.aiFieldConfig()?.customFields || {}).forEach(([fieldType, fieldConfig]) => {
|
10268
|
+
if (fieldConfig?.fieldOption) {
|
10269
|
+
allFieldOptions.push(fieldConfig.fieldOption);
|
10270
|
+
}
|
10271
|
+
});
|
10272
|
+
const fieldOptionMap = new Map(allFieldOptions.map((fieldOption) => [fieldOption.type, fieldOption]));
|
10273
|
+
const fieldOptionKeys = this.aiTable.context?.aiFieldConfig()?.fieldOptionKeys || [];
|
10274
|
+
if (fieldOptionKeys.length > 0) {
|
10275
|
+
allFieldOptions = fieldOptionKeys.map((fieldOptionKey) => fieldOptionMap.get(fieldOptionKey));
|
10276
|
+
}
|
10277
|
+
return allFieldOptions;
|
10278
|
+
});
|
10279
|
+
this.fieldOptionMap = computed(() => {
|
10280
|
+
return new Map(this.fieldOptions().map((fieldOption) => [fieldOption.type, fieldOption]));
|
10281
|
+
});
|
9772
10282
|
this.visibleRowsIndexMap = computed(() => {
|
9773
10283
|
return new Map(this.linearRows().map((row, index) => [row._id, index]));
|
9774
10284
|
});
|
9775
10285
|
this.containerElement = computed(() => {
|
9776
10286
|
return this.container().nativeElement;
|
9777
10287
|
});
|
10288
|
+
this.trackBy = (index, item) => {
|
10289
|
+
return item.sort_by ?? index;
|
10290
|
+
};
|
9778
10291
|
this.rendererConfig = computed(() => {
|
9779
10292
|
const fields = AITable.getVisibleFields(this.aiTable);
|
9780
10293
|
const coordinate = new Coordinate({
|
@@ -9812,6 +10325,13 @@ class AITableGrid extends AITableGridBase {
|
|
9812
10325
|
this.scrollbarWidth = computed(() => {
|
9813
10326
|
return this.coordinate().totalWidth + AI_TABLE_FIELD_ADD_BUTTON_WIDTH;
|
9814
10327
|
});
|
10328
|
+
this.i18nTexts = computed(() => {
|
10329
|
+
this.aiGetI18nTextByKey();
|
10330
|
+
return {
|
10331
|
+
rowAddFilterTooltip: getI18nTextByKey(this.aiTable, AITableGridI18nKey.rowAddFilterTooltip)
|
10332
|
+
};
|
10333
|
+
});
|
10334
|
+
// rowAddFilterTooltip = getI18nTextByKey(this.aiTable, AITableGridI18nKey.rowAddFilterTooltip);
|
9815
10335
|
this.actions = {
|
9816
10336
|
updateFieldValue: (data) => {
|
9817
10337
|
this.aiUpdateFieldValue.emit(data);
|
@@ -9864,7 +10384,7 @@ class AITableGrid extends AITableGridBase {
|
|
9864
10384
|
this.bindGlobalMousedown();
|
9865
10385
|
this.containerResizeListener();
|
9866
10386
|
this.bindWheel();
|
9867
|
-
this.
|
10387
|
+
this.bindShortcuts();
|
9868
10388
|
});
|
9869
10389
|
effect(() => {
|
9870
10390
|
if (this.hasContainerRect() && this.horizontalBarRef() && this.verticalBarRef()) {
|
@@ -9907,6 +10427,7 @@ class AITableGrid extends AITableGridBase {
|
|
9907
10427
|
ngOnInit() {
|
9908
10428
|
super.ngOnInit();
|
9909
10429
|
this.initContext();
|
10430
|
+
this.initCustomField();
|
9910
10431
|
}
|
9911
10432
|
ngOnDestroy() {
|
9912
10433
|
this.resizeObserver?.disconnect();
|
@@ -9924,9 +10445,27 @@ class AITableGrid extends AITableGridBase {
|
|
9924
10445
|
aiFieldConfig: this.aiFieldConfig,
|
9925
10446
|
scrollAction: this.scrollAction,
|
9926
10447
|
maxFields: this.aiMaxFields,
|
9927
|
-
maxRecords: this.aiMaxRecords
|
10448
|
+
maxRecords: this.aiMaxRecords,
|
10449
|
+
fieldOptions: this.fieldOptions,
|
10450
|
+
fieldOptionMap: this.fieldOptionMap
|
9928
10451
|
});
|
9929
10452
|
}
|
10453
|
+
initCustomField() {
|
10454
|
+
const customFields = this.aiFieldConfig()?.customFields;
|
10455
|
+
if (customFields) {
|
10456
|
+
Object.entries(customFields).forEach(([key, customField]) => {
|
10457
|
+
if (customField?.hoverRender) {
|
10458
|
+
ComponentMap[key] = customField.hoverRender;
|
10459
|
+
}
|
10460
|
+
if (customField?.fieldModel) {
|
10461
|
+
FieldModelMap[key] = customField.fieldModel;
|
10462
|
+
}
|
10463
|
+
if (customField?.fieldOption?.path) {
|
10464
|
+
IconPathMap[customField?.fieldOption.icon] = customField.fieldOption.path;
|
10465
|
+
}
|
10466
|
+
});
|
10467
|
+
}
|
10468
|
+
}
|
9930
10469
|
setKeywordsMatchedCells() {
|
9931
10470
|
const keywords = this.aiKeywords();
|
9932
10471
|
let matchedCells = new Set();
|
@@ -9970,6 +10509,7 @@ class AITableGrid extends AITableGridBase {
|
|
9970
10509
|
const endCell = [recordId, fieldId];
|
9971
10510
|
if (startCell && !!startCell.length) {
|
9972
10511
|
this.aiTableGridSelectionService.selectCells(startCell, endCell);
|
10512
|
+
this.scrollViewToCell(pos, startCell, endCell, this.coordinate(), this.horizontalBarRef(), this.verticalBarRef());
|
9973
10513
|
}
|
9974
10514
|
}
|
9975
10515
|
}
|
@@ -10004,7 +10544,10 @@ class AITableGrid extends AITableGridBase {
|
|
10004
10544
|
return;
|
10005
10545
|
const dragSelectionStart = [recordId, fieldId];
|
10006
10546
|
this.updateDragSelectionState(true, dragSelectionStart);
|
10007
|
-
this.
|
10547
|
+
const [expandRecordId, expandFieldId] = this.aiTable.selection().expandCell || [null, null];
|
10548
|
+
if (expandRecordId !== recordId || expandFieldId !== fieldId) {
|
10549
|
+
this.aiTableGridSelectionService.selectCells(dragSelectionStart);
|
10550
|
+
}
|
10008
10551
|
return;
|
10009
10552
|
case AI_TABLE_ROW_DRAG:
|
10010
10553
|
if (!recordId)
|
@@ -10092,8 +10635,6 @@ class AITableGrid extends AITableGridBase {
|
|
10092
10635
|
case AI_TABLE_ROW_ADD_BUTTON: {
|
10093
10636
|
this.aiTableGridSelectionService.clearSelection();
|
10094
10637
|
this.addRecord();
|
10095
|
-
const { records, fields } = this.gridData();
|
10096
|
-
this.aiTableGridSelectionService.setActiveCell([records[records.length - 1]._id, fields[0]._id]);
|
10097
10638
|
break;
|
10098
10639
|
}
|
10099
10640
|
case AI_TABLE_ROW_SELECT_CHECKBOX: {
|
@@ -10251,11 +10792,9 @@ class AITableGrid extends AITableGridBase {
|
|
10251
10792
|
});
|
10252
10793
|
this.resizeObserver.observe(this.containerElement());
|
10253
10794
|
}
|
10254
|
-
|
10795
|
+
bindShortcuts() {
|
10255
10796
|
fromEvent(document, 'keydown')
|
10256
|
-
.pipe(
|
10257
|
-
event.key === 'Backspace' ||
|
10258
|
-
event.key === 'Delete'), takeUntilDestroyed(this.destroyRef))
|
10797
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
10259
10798
|
.subscribe(async (event) => {
|
10260
10799
|
if (this.aiReadonly()) {
|
10261
10800
|
return;
|
@@ -10274,14 +10813,39 @@ class AITableGrid extends AITableGridBase {
|
|
10274
10813
|
return;
|
10275
10814
|
}
|
10276
10815
|
event.preventDefault();
|
10277
|
-
|
10278
|
-
|
10279
|
-
|
10280
|
-
|
10281
|
-
|
10816
|
+
const isCopyOrPaste = (event.ctrlKey || event.metaKey) && (event.key === 'c' || event.key === 'v');
|
10817
|
+
const isDeleteOrBackspace = event.key === 'Backspace' || event.key === 'Delete';
|
10818
|
+
if (isCopyOrPaste) {
|
10819
|
+
if (event.key === 'c') {
|
10820
|
+
this.copyCells();
|
10821
|
+
}
|
10822
|
+
else if (event.key === 'v') {
|
10823
|
+
this.pasteCells();
|
10824
|
+
}
|
10825
|
+
return;
|
10282
10826
|
}
|
10283
|
-
|
10827
|
+
if (isDeleteOrBackspace) {
|
10284
10828
|
clearCells(this.aiTable, this.actions);
|
10829
|
+
return;
|
10830
|
+
}
|
10831
|
+
// quick enter cell editor
|
10832
|
+
const isKeyForInput = !isVirtualKey(event);
|
10833
|
+
const activeCell = this.aiTable.selection().activeCell;
|
10834
|
+
const field = activeCell && this.aiTable.fieldsMap()[activeCell[1]];
|
10835
|
+
if (isKeyForInput && activeCell && field && field.type === AITableFieldType.text) {
|
10836
|
+
const [recordId, fieldId] = activeCell;
|
10837
|
+
this.aiTableGridEventService.openCellEditor(this.aiTable, {
|
10838
|
+
viewContainerRef: this.viewContainerRef,
|
10839
|
+
container: this.containerElement(),
|
10840
|
+
coordinate: this.coordinate(),
|
10841
|
+
fieldId,
|
10842
|
+
recordId,
|
10843
|
+
isSelectAll: true,
|
10844
|
+
references: this.aiReferences(),
|
10845
|
+
updateFieldValue: (value) => {
|
10846
|
+
this.aiUpdateFieldValue.emit(value);
|
10847
|
+
}
|
10848
|
+
});
|
10285
10849
|
}
|
10286
10850
|
});
|
10287
10851
|
}
|
@@ -10311,41 +10875,31 @@ class AITableGrid extends AITableGridBase {
|
|
10311
10875
|
}
|
10312
10876
|
handleFieldDragStart() {
|
10313
10877
|
if (!this.aiReadonly() && this.aiTableGridSelectionService.selectedFields.size > 0) {
|
10314
|
-
this.
|
10878
|
+
this.setDragState({
|
10315
10879
|
type: DragType.field,
|
10316
10880
|
sourceIds: this.aiTableGridSelectionService.selectedFields,
|
10317
|
-
scroll: this.getScrollPosition(),
|
10318
10881
|
coordinate: this.coordinate()
|
10319
10882
|
});
|
10320
10883
|
}
|
10321
10884
|
}
|
10322
10885
|
handleFieldWidthDragStart(fieldId) {
|
10323
10886
|
if (!this.aiReadonly() && fieldId) {
|
10324
|
-
this.
|
10887
|
+
this.setDragState({
|
10325
10888
|
type: DragType.columnWidth,
|
10326
10889
|
sourceIds: new Set([fieldId]),
|
10327
|
-
scroll: this.getScrollPosition(),
|
10328
10890
|
coordinate: this.coordinate()
|
10329
10891
|
});
|
10330
10892
|
}
|
10331
10893
|
}
|
10332
10894
|
handleRowDragStart(recordIds) {
|
10333
10895
|
if (!this.aiReadonly() && !this.aiRowDragDisabled() && recordIds.length > 0) {
|
10334
|
-
this.
|
10896
|
+
this.setDragState({
|
10335
10897
|
type: DragType.record,
|
10336
10898
|
sourceIds: new Set(recordIds),
|
10337
|
-
scroll: this.getScrollPosition(),
|
10338
10899
|
coordinate: this.coordinate()
|
10339
10900
|
});
|
10340
10901
|
}
|
10341
10902
|
}
|
10342
|
-
getScrollPosition() {
|
10343
|
-
const horizontalBar = this.horizontalBarRef()?.nativeElement;
|
10344
|
-
const verticalBar = this.verticalBarRef()?.nativeElement;
|
10345
|
-
let scrollLeft = horizontalBar?.scrollLeft || 0;
|
10346
|
-
let scrollTop = verticalBar?.scrollTop || 0;
|
10347
|
-
return { x: scrollLeft, y: scrollTop };
|
10348
|
-
}
|
10349
10903
|
dragEnd(data) {
|
10350
10904
|
switch (data.type) {
|
10351
10905
|
case DragType.field:
|
@@ -10376,21 +10930,75 @@ class AITableGrid extends AITableGridBase {
|
|
10376
10930
|
}
|
10377
10931
|
return;
|
10378
10932
|
}
|
10379
|
-
this.
|
10933
|
+
this.setDragState({
|
10934
|
+
type: DragType.none,
|
10935
|
+
sourceIds: new Set()
|
10936
|
+
});
|
10937
|
+
}
|
10938
|
+
setDragState(config) {
|
10939
|
+
this.aiTable.dragState.set(config);
|
10940
|
+
}
|
10941
|
+
scrollViewToCell(position, startCell, endCell, coordinate, horizontalBarRef, verticalBarRef) {
|
10942
|
+
const [, startFieldId] = startCell;
|
10943
|
+
const [endRecordId, endFieldId] = endCell;
|
10944
|
+
const startColIndex = this.aiTable.context.visibleColumnsIndexMap().get(startFieldId);
|
10945
|
+
const endRowIndex = this.aiTable.context.visibleRowsIndexMap().get(endRecordId);
|
10946
|
+
const endColIndex = this.aiTable.context.visibleColumnsIndexMap().get(endFieldId);
|
10947
|
+
const isSelectionOnlyOnFrozenColumn = startColIndex === 0 && endColIndex === 0;
|
10948
|
+
const endCellTop = coordinate.getRowOffset(endRowIndex);
|
10949
|
+
const endCellLeft = coordinate.getColumnOffset(endColIndex);
|
10950
|
+
const scrollState = this.aiTable.context.scrollState();
|
10951
|
+
const gridData = this.aiTable.gridData();
|
10952
|
+
const containerRect = coordinate.container.getBoundingClientRect();
|
10953
|
+
this.scrollControllerService.scroll({
|
10954
|
+
container: containerRect,
|
10955
|
+
target: position,
|
10956
|
+
direction: isSelectionOnlyOnFrozenColumn ? 'vertical' : 'both',
|
10957
|
+
scrollableElement: {
|
10958
|
+
horizontalElement: horizontalBarRef?.nativeElement,
|
10959
|
+
verticalElement: verticalBarRef?.nativeElement
|
10960
|
+
},
|
10961
|
+
frozenArea: {
|
10962
|
+
top: AI_TABLE_FIELD_HEAD_HEIGHT,
|
10963
|
+
left: coordinate.getColumnWidth(0) + this.aiTable.context.rowHeadWidth(),
|
10964
|
+
bottom: containerRect.height - AI_TABLE_SCROLL_BAR_SIZE,
|
10965
|
+
right: containerRect.width - AI_TABLE_SCROLL_BAR_SIZE
|
10966
|
+
},
|
10967
|
+
edgeThreshold: {
|
10968
|
+
left: AI_TABLE_AUTO_SCROLL_LEFT_THRESHOLD,
|
10969
|
+
top: AI_TABLE_AUTO_SCROLL_TOP_THRESHOLD,
|
10970
|
+
right: AI_TABLE_SCROLL_BAR_SIZE + AI_TABLE_AUTO_SCROLL_RIGHT_THRESHOLD,
|
10971
|
+
bottom: AI_TABLE_AUTO_SCROLL_BOTTOM_THRESHOLD
|
10972
|
+
},
|
10973
|
+
onScrollChange: (position, isAutoScrolling) => {
|
10974
|
+
if (isAutoScrolling) {
|
10975
|
+
const scrollLeft = position.x - scrollState.scrollLeft;
|
10976
|
+
const scrollTop = position.y - scrollState.scrollTop;
|
10977
|
+
const nextCellIndex = coordinate.getColumnStartIndex(endCellLeft + scrollLeft);
|
10978
|
+
const nextRowIndex = coordinate.getRowStartIndex(endCellTop + scrollTop);
|
10979
|
+
// 向左滚动,单元格向后退一格,防止选区进入冻结列
|
10980
|
+
const nextField = gridData.fields[isSelectionOnlyOnFrozenColumn || scrollLeft > 0 ? nextCellIndex : nextCellIndex + 1];
|
10981
|
+
const nextRecord = gridData.records[nextRowIndex];
|
10982
|
+
if (nextField && nextRecord) {
|
10983
|
+
this.aiTableGridSelectionService.selectCells([startCell[0], nextField._id], [nextRecord._id, startCell[1]]);
|
10984
|
+
}
|
10985
|
+
}
|
10986
|
+
}
|
10987
|
+
});
|
10380
10988
|
}
|
10381
10989
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
10382
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableGrid, isStandalone: true, selector: "ai-table-grid", host: { classAttribute: "ai-table-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "verticalBarRef", first: true, predicate: ["verticalBar"], descendants: true, isSignal: true }, { propertyName: "horizontalBarRef", first: true, predicate: ["horizontalBar"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n >\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n <ai-table-drag (dragEnd)=\"dragEnd($event)\"></ai-table-drag>\n</div>\n", dependencies: [{ kind: "component", type: AITableRenderer, selector: "ai-table-renderer", inputs: ["config"], outputs: ["koMousemove", "koMousedown", "koMouseup", "koContextmenu", "koWheel", "koClick", "koDblclick", "koMouseleave"] }, { kind: "component", type: AITableDragComponent, selector: "ai-table-drag", outputs: ["dragEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
10990
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableGrid, isStandalone: true, selector: "ai-table-grid", host: { classAttribute: "ai-table-grid" }, providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService, AITableScrollControllerService], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "verticalBarRef", first: true, predicate: ["verticalBar"], descendants: true, isSignal: true }, { propertyName: "horizontalBarRef", first: true, predicate: ["horizontalBar"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n >\n @if (domToolTips().length > 0) {\n <div\n class=\"ai-table-left-background-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n @for (domToolTip of domToolTips(); track trackBy(idx, domToolTip); let idx = $index) {\n <div\n class=\"ai-table-left-background\"\n [thyTooltip]=\"i18nTexts().rowAddFilterTooltip\"\n [style.--scroll-top.px]=\"domToolTip.top\"\n >\n <thy-icon class=\"text-white\" thyIconName=\"filter-line\"></thy-icon>\n </div>\n }\n </div>\n }\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n <ai-table-drag [horizontalBar]=\"horizontalBarRef()\" [verticalBar]=\"verticalBarRef()\" (dragEnd)=\"dragEnd($event)\"></ai-table-drag>\n</div>\n", dependencies: [{ kind: "component", type: AITableRenderer, selector: "ai-table-renderer", inputs: ["config"], outputs: ["koMousemove", "koMousedown", "koMouseup", "koContextmenu", "koWheel", "koClick", "koDblclick", "koMouseleave"] }, { kind: "component", type: AITableDragComponent, selector: "ai-table-drag", inputs: ["horizontalBar", "verticalBar"], outputs: ["dragEnd"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
10383
10991
|
}
|
10384
10992
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGrid, decorators: [{
|
10385
10993
|
type: Component,
|
10386
10994
|
args: [{ selector: 'ai-table-grid', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
10387
10995
|
class: 'ai-table-grid'
|
10388
|
-
}, imports: [AITableRenderer, AITableDragComponent], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService], template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n >\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n <ai-table-drag (dragEnd)=\"dragEnd($event)\"></ai-table-drag>\n</div>\n" }]
|
10996
|
+
}, imports: [AITableRenderer, AITableDragComponent, ThyTooltipDirective, ThyIcon], providers: [AITableGridEventService, AITableGridFieldService, AITableGridSelectionService, AITableScrollControllerService], template: "<div #container class=\"ai-table-grid-view\">\n @if (hasContainerRect()) {\n <ai-table-renderer\n [config]=\"rendererConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n (koMouseleave)=\"stageMouseleave($event)\"\n >\n @if (domToolTips().length > 0) {\n <div\n class=\"ai-table-left-background-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n @for (domToolTip of domToolTips(); track trackBy(idx, domToolTip); let idx = $index) {\n <div\n class=\"ai-table-left-background\"\n [thyTooltip]=\"i18nTexts().rowAddFilterTooltip\"\n [style.--scroll-top.px]=\"domToolTip.top\"\n >\n <thy-icon class=\"text-white\" thyIconName=\"filter-line\"></thy-icon>\n </div>\n }\n </div>\n }\n <div #horizontalBar class=\"ai-table-horizontal-scroll-bar-wrapper\" [style.width.px]=\"containerRect().width\">\n <div class=\"ai-table-scroll-bar-inner\" [style.width.px]=\"scrollbarWidth()\"></div>\n </div>\n <div\n #verticalBar\n class=\"ai-table-vertical-scroll-bar-wrapper\"\n [style.height.px]=\"containerRect().height - fieldHeadHeight\"\n [style.top.px]=\"fieldHeadHeight\"\n >\n <div class=\"ai-table-scroll-bar-inner\" [style.height.px]=\"scrollTotalHeight()\"></div>\n </div>\n </ai-table-renderer>\n }\n <ai-table-drag [horizontalBar]=\"horizontalBarRef()\" [verticalBar]=\"verticalBarRef()\" (dragEnd)=\"dragEnd($event)\"></ai-table-drag>\n</div>\n" }]
|
10389
10997
|
}], ctorParameters: () => [] });
|
10390
10998
|
|
10391
10999
|
/**
|
10392
11000
|
* Generated bundle index. Do not edit.
|
10393
11001
|
*/
|
10394
11002
|
|
10395
|
-
export { AITable, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableCheckType, AITableContextMenu, AITableDomGrid, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridSelectionService, AITableMemberType, AITableMouseDownType, AITableQueries, AITableRenderer, AITableRowType, AITableSelectAllState, AI_TABLE_ACTION_COMMON_RADIUS, AI_TABLE_ACTION_COMMON_RIGHT_PADDING, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_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_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_FILE_ICON_ITEM_HEIGHT, AI_TABLE_FILE_ICON_SIZE, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, AI_TABLE_MEMBER_AVATAR_SIZE, AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT, AI_TABLE_MEMBER_ITEM_PADDING_RIGHT, AI_TABLE_MIN_TEXT_WIDTH, AI_TABLE_OFFSET, AI_TABLE_OPTION_ITEM_FONT_SIZE, AI_TABLE_OPTION_ITEM_HEIGHT, AI_TABLE_OPTION_ITEM_PADDING, AI_TABLE_OPTION_ITEM_RADIUS, AI_TABLE_PIECE_RADIUS, AI_TABLE_PIECE_WIDTH, AI_TABLE_POPOVER_LEFT_OFFSET, AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS, AI_TABLE_PROGRESS_BAR_HEIGHT, AI_TABLE_PROGRESS_BAR_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_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AbstractEditCellEditor, AddOutlinedPath, AttachmentField, AttachmentPath, Check, Colors, ColumnCalendarFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnRichTextFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DateField, DepartmentOutlinedPath, EditPath, FONT_SIZE_SM, FieldModelMap, GRID_CELL_EDITOR_MAP, 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, applyNodeProps, buildClipboardData, buildGridData, buildGridLinearRows, castToString, clearCells, compareNumber, compareOption, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, createListener, extractLinkUrl, extractText, generateNewName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getDefaultFieldValue, getDefaultI18nTextByKey, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getFieldOptions, getFieldValue, getFileThumbnailSvgString, getHoverCell, getHoverEditorBoxOffset, getHoverEditorSpace, getI18nTextByKey, getMousePosition, getName, getPlaceHolderCellsConfigs, getSystemFieldValue, getTargetName, getTextWidth, getVisibleRangeInfo, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isActiveCell, isArrayField, isCellMatchKeywords, isClipboardReadSupported, isClipboardReadTextSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isDateFiled, isEmptyOrNot, isMac, isMeetFilter, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, processPastedValueForSelect, readFromClipboard, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, stringInclude, textDataCache, toAttachmentFieldValue, toDateFieldValue, toLinkFieldValue, toMemberFieldValue, toNumberFieldValue, toProgressFieldValue, toRateFieldValue, toRichTextFieldValue, toSelectFieldValue, toTextFieldValue, transformCellValue, updatePicture, writeToAITable, writeToClipboard, zhIntlCollator };
|
11003
|
+
export { AITable, AITableActionIcon, AITableAddField, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableCellAttachment, AITableCellLink, AITableCellProgress, AITableCellRate, AITableCellRichText, AITableCells, AITableCheckType, AITableColumnHeads, AITableContextMenu, AITableDomGrid, AITableFieldHead, AITableFieldIcon, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFrozenCells, AITableFrozenColumnHeads, AITableFrozenPlaceholderCells, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridI18nKey, AITableGridSelectionService, AITableHoverRowHeads, AITableIcon, AITableMemberType, AITableMouseDownType, AITableOtherRows, AITablePlaceholderCells, AITableQueries, AITableRenderer, AITableRowType, 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_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_FILE_ICON_ITEM_HEIGHT, AI_TABLE_FILE_ICON_SIZE, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, AI_TABLE_MEMBER_AVATAR_SIZE, AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT, AI_TABLE_MEMBER_ITEM_PADDING_RIGHT, AI_TABLE_MIN_TEXT_WIDTH, AI_TABLE_OFFSET, AI_TABLE_OPTION_ITEM_FONT_SIZE, AI_TABLE_OPTION_ITEM_HEIGHT, AI_TABLE_OPTION_ITEM_PADDING, AI_TABLE_OPTION_ITEM_RADIUS, AI_TABLE_PIECE_RADIUS, AI_TABLE_PIECE_WIDTH, AI_TABLE_POPOVER_LEFT_OFFSET, AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS, AI_TABLE_PROGRESS_BAR_HEIGHT, AI_TABLE_PROGRESS_BAR_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_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, AbstractEditCellEditor, AddOutlinedPath, AttachmentField, AttachmentPath, CellDrawer, Check, Colors, ColumnCalendarFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnRichTextFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DateField, DepartmentOutlinedPath, Drawer, EditPath, FONT_SIZE_SM, FieldModelMap, GRID_CELL_EDITOR_MAP, HoverCellComponent, 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, defaultFieldOptions, drawer, extractLinkUrl, extractText, generateNewName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getDefaultFieldValue, getDefaultI18nTextByKey, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getFieldOptionMap, getFieldOptions, getFieldValue, getFileThumbnailSvgString, getHoverCell, getHoverEditorBoxOffset, getHoverEditorSpace, getI18nTextByKey, getMousePosition, getName, getPlaceHolderCellsConfigs, 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, processPastedValueForSelect, readFromClipboard, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, stringInclude, textDataCache, toAttachmentFieldValue, toDateFieldValue, toLinkFieldValue, toMemberFieldValue, toNumberFieldValue, toProgressFieldValue, toRateFieldValue, toRichTextFieldValue, toSelectFieldValue, toTextFieldValue, transformCellValue, updatePicture, writeToAITable, writeToClipboard, zhIntlCollator };
|
10396
11004
|
//# sourceMappingURL=ai-table-grid.mjs.map
|