@ai-table/grid 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/components/cell-editors/select/select-editor.component.d.ts +3 -1
  2. package/components/cell-editors/select/select-editor.component.d.ts.map +1 -1
  3. package/components/context-menu/context-menu.component.d.ts +4 -1
  4. package/components/context-menu/context-menu.component.d.ts.map +1 -1
  5. package/components/drag/drag.component.d.ts +26 -0
  6. package/components/drag/drag.component.d.ts.map +1 -0
  7. package/components/drag/drag.component.scss +19 -0
  8. package/constants/file-icon.d.ts +32 -0
  9. package/constants/file-icon.d.ts.map +1 -0
  10. package/constants/grid.d.ts.map +1 -1
  11. package/constants/icon.d.ts +1 -0
  12. package/constants/icon.d.ts.map +1 -1
  13. package/constants/table.d.ts +4 -0
  14. package/constants/table.d.ts.map +1 -1
  15. package/core/constants/field.d.ts.map +1 -1
  16. package/core/types/ai-table.d.ts +3 -1
  17. package/core/types/ai-table.d.ts.map +1 -1
  18. package/core/types/core.d.ts +33 -2
  19. package/core/types/core.d.ts.map +1 -1
  20. package/core/utils/common.d.ts +3 -3
  21. package/core/utils/common.d.ts.map +1 -1
  22. package/core/utils/field.d.ts.map +1 -1
  23. package/core/utils/queries.d.ts +3 -1
  24. package/core/utils/queries.d.ts.map +1 -1
  25. package/esm2022/components/cell-editors/select/select-editor.component.mjs +22 -21
  26. package/esm2022/components/context-menu/context-menu.component.mjs +17 -5
  27. package/esm2022/components/drag/drag.component.mjs +150 -0
  28. package/esm2022/constants/file-icon.mjs +342 -0
  29. package/esm2022/constants/grid.mjs +2 -1
  30. package/esm2022/constants/icon.mjs +2 -1
  31. package/esm2022/constants/table.mjs +6 -2
  32. package/esm2022/core/constants/field.mjs +7 -1
  33. package/esm2022/core/types/ai-table.mjs +2 -2
  34. package/esm2022/core/types/core.mjs +9 -1
  35. package/esm2022/core/utils/common.mjs +3 -2
  36. package/esm2022/core/utils/field.mjs +8 -3
  37. package/esm2022/core/utils/queries.mjs +19 -13
  38. package/esm2022/grid-base.component.mjs +5 -3
  39. package/esm2022/grid.component.mjs +91 -4
  40. package/esm2022/renderer/components/field-icon.component.mjs +5 -2
  41. package/esm2022/renderer/creations/create-heads.mjs +5 -5
  42. package/esm2022/renderer/drawers/cell-drawer.mjs +74 -2
  43. package/esm2022/renderer/drawers/drawer.mjs +11 -2
  44. package/esm2022/services/event.service.mjs +12 -5
  45. package/esm2022/services/selection.service.mjs +22 -3
  46. package/esm2022/types/clipboard.mjs +2 -0
  47. package/esm2022/types/grid.mjs +1 -1
  48. package/esm2022/types/index.mjs +2 -1
  49. package/esm2022/types/row.mjs +1 -1
  50. package/esm2022/utils/clipboard/clipboard.mjs +88 -0
  51. package/esm2022/utils/clipboard/copy.mjs +92 -0
  52. package/esm2022/utils/clipboard/extract.mjs +19 -0
  53. package/esm2022/utils/clipboard/index.mjs +5 -0
  54. package/esm2022/utils/clipboard/paste.mjs +184 -0
  55. package/esm2022/utils/field/model/attachment.mjs +63 -0
  56. package/esm2022/utils/field/model/date.mjs +45 -2
  57. package/esm2022/utils/field/model/field.mjs +1 -1
  58. package/esm2022/utils/field/model/index.mjs +5 -3
  59. package/esm2022/utils/field/model/link.mjs +25 -1
  60. package/esm2022/utils/field/model/member.mjs +40 -1
  61. package/esm2022/utils/field/model/number.mjs +31 -1
  62. package/esm2022/utils/field/model/progress.mjs +34 -1
  63. package/esm2022/utils/field/model/rate.mjs +35 -1
  64. package/esm2022/utils/field/model/select.mjs +64 -1
  65. package/esm2022/utils/field/model/text.mjs +7 -1
  66. package/esm2022/utils/file.mjs +208 -0
  67. package/esm2022/utils/icon.mjs +48 -0
  68. package/esm2022/utils/index.mjs +2 -1
  69. package/esm2022/utils/match-keywords.mjs +3 -3
  70. package/fesm2022/ai-table-grid.mjs +2146 -433
  71. package/fesm2022/ai-table-grid.mjs.map +1 -1
  72. package/grid-base.component.d.ts +4 -2
  73. package/grid-base.component.d.ts.map +1 -1
  74. package/grid.component.d.ts +6 -1
  75. package/grid.component.d.ts.map +1 -1
  76. package/package.json +1 -1
  77. package/renderer/components/field-icon.component.d.ts.map +1 -1
  78. package/renderer/drawers/cell-drawer.d.ts +1 -0
  79. package/renderer/drawers/cell-drawer.d.ts.map +1 -1
  80. package/renderer/drawers/drawer.d.ts.map +1 -1
  81. package/services/event.service.d.ts.map +1 -1
  82. package/services/selection.service.d.ts +5 -1
  83. package/services/selection.service.d.ts.map +1 -1
  84. package/styles/styles.scss +2 -0
  85. package/types/clipboard.d.ts +5 -0
  86. package/types/clipboard.d.ts.map +1 -0
  87. package/types/grid.d.ts +22 -5
  88. package/types/grid.d.ts.map +1 -1
  89. package/types/index.d.ts +1 -0
  90. package/types/index.d.ts.map +1 -1
  91. package/types/row.d.ts +3 -1
  92. package/types/row.d.ts.map +1 -1
  93. package/utils/clipboard/clipboard.d.ts +8 -0
  94. package/utils/clipboard/clipboard.d.ts.map +1 -0
  95. package/utils/clipboard/copy.d.ts +5 -0
  96. package/utils/clipboard/copy.d.ts.map +1 -0
  97. package/utils/clipboard/extract.d.ts +3 -0
  98. package/utils/clipboard/extract.d.ts.map +1 -0
  99. package/utils/clipboard/index.d.ts +5 -0
  100. package/utils/clipboard/index.d.ts.map +1 -0
  101. package/utils/clipboard/paste.d.ts +10 -0
  102. package/utils/clipboard/paste.d.ts.map +1 -0
  103. package/utils/field/model/attachment.d.ts +17 -0
  104. package/utils/field/model/attachment.d.ts.map +1 -0
  105. package/utils/field/model/date.d.ts +9 -1
  106. package/utils/field/model/date.d.ts.map +1 -1
  107. package/utils/field/model/field.d.ts +4 -0
  108. package/utils/field/model/field.d.ts.map +1 -1
  109. package/utils/field/model/index.d.ts +1 -1
  110. package/utils/field/model/index.d.ts.map +1 -1
  111. package/utils/field/model/link.d.ts +9 -1
  112. package/utils/field/model/link.d.ts.map +1 -1
  113. package/utils/field/model/member.d.ts +8 -0
  114. package/utils/field/model/member.d.ts.map +1 -1
  115. package/utils/field/model/number.d.ts +9 -1
  116. package/utils/field/model/number.d.ts.map +1 -1
  117. package/utils/field/model/progress.d.ts +9 -1
  118. package/utils/field/model/progress.d.ts.map +1 -1
  119. package/utils/field/model/rate.d.ts +9 -1
  120. package/utils/field/model/rate.d.ts.map +1 -1
  121. package/utils/field/model/select.d.ts +16 -1
  122. package/utils/field/model/select.d.ts.map +1 -1
  123. package/utils/field/model/text.d.ts +2 -0
  124. package/utils/field/model/text.d.ts.map +1 -1
  125. package/utils/file.d.ts +11 -0
  126. package/utils/file.d.ts.map +1 -0
  127. package/utils/icon.d.ts +19 -0
  128. package/utils/icon.d.ts.map +1 -0
  129. package/utils/index.d.ts +1 -0
  130. package/utils/index.d.ts.map +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, output, inject, ElementRef, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, ChangeDetectorRef, ViewChild, HostListener, Pipe, input, Renderer2, model, booleanAttribute, Injectable, InjectionToken, effect, DestroyRef, NgZone, ViewContainerRef, viewChild, afterNextRender, untracked } from '@angular/core';
2
+ import { signal, computed, output, inject, ElementRef, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, ChangeDetectorRef, ViewChild, HostListener, input, Renderer2, Pipe, model, booleanAttribute, Injectable, InjectionToken, effect, DestroyRef, NgZone, ViewContainerRef, viewChild, afterNextRender, untracked } from '@angular/core';
3
3
  import * as i1$1 from 'ngx-tethys/popover';
4
4
  import { ThyPopoverRef, ThyPopover, ThyPopoverModule } from 'ngx-tethys/popover';
5
5
  import ObjectID from 'bson-objectid';
@@ -26,21 +26,21 @@ import { ThyInputNumber } from 'ngx-tethys/input-number';
26
26
  import { ThySlider } from 'ngx-tethys/slider';
27
27
  import { ThyRate } from 'ngx-tethys/rate';
28
28
  import * as i1$2 from '@angular/common';
29
- import { NgTemplateOutlet, NgClass, CommonModule, NgComponentOutlet } from '@angular/common';
30
- import { ThyDot } from 'ngx-tethys/dot';
29
+ import { CommonModule, NgClass, NgTemplateOutlet, NgComponentOutlet } from '@angular/common';
31
30
  import { ThyEmptyModule } from 'ngx-tethys/empty';
31
+ import { ThySelect, ThySelectModule } from 'ngx-tethys/select';
32
+ import { ThyDot } from 'ngx-tethys/dot';
32
33
  import { ThyIcon } from 'ngx-tethys/icon';
33
- import { ThySelect } from 'ngx-tethys/select';
34
34
  import { ThyTag } from 'ngx-tethys/tag';
35
- import { ThyDropdownMenuComponent, ThyDropdownDirective, ThyDropdownMenuItemDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownAbstractMenu } from 'ngx-tethys/dropdown';
35
+ import { ThyDropdownMenuComponent, ThyDropdownDirective, ThyDropdownMenuItemDirective, ThyDropdownMenuItemIconDirective, ThyDropdownMenuItemNameDirective, ThyDropdownMenuItemExtendIconDirective, ThyDropdownAbstractMenu, ThyDropdownMenuItemMetaDirective } from 'ngx-tethys/dropdown';
36
36
  import { ThySwitch } from 'ngx-tethys/switch';
37
37
  import { of, Subject, fromEvent, debounceTime, mergeWith, filter } from 'rxjs';
38
+ import { ThyDivider } from 'ngx-tethys/divider';
38
39
  import * as i4 from 'ngx-tethys/avatar';
39
40
  import { ThyAvatarModule } from 'ngx-tethys/avatar';
40
41
  import * as i3$1 from 'ngx-tethys/checkbox';
41
42
  import { ThyCheckboxModule } from 'ngx-tethys/checkbox';
42
43
  import { ThyProgress } from 'ngx-tethys/progress';
43
- import { ThyDivider } from 'ngx-tethys/divider';
44
44
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
45
45
  import { LRUCache } from 'lru-cache';
46
46
  import { fromUnixTime, subDays } from 'date-fns';
@@ -93,7 +93,7 @@ const AITable = {
93
93
  return Colors;
94
94
  },
95
95
  getVisibleFields(aiTable) {
96
- return aiTable.fields().filter((field) => !field.hidden);
96
+ return aiTable.gridData().fields.filter((field) => !field.hidden);
97
97
  },
98
98
  getVisibleRows(aiTable) {
99
99
  return aiTable.records();
@@ -156,6 +156,7 @@ var AITableFieldType;
156
156
  AITableFieldType["progress"] = "progress";
157
157
  AITableFieldType["rate"] = "rate";
158
158
  AITableFieldType["link"] = "link";
159
+ AITableFieldType["attachment"] = "attachment";
159
160
  AITableFieldType["createdAt"] = "created_at";
160
161
  AITableFieldType["updatedAt"] = "updated_at";
161
162
  AITableFieldType["createdBy"] = "created_by";
@@ -194,6 +195,13 @@ var Direction;
194
195
  Direction["before"] = "before";
195
196
  Direction["after"] = "after";
196
197
  })(Direction || (Direction = {}));
198
+ var DragType;
199
+ (function (DragType) {
200
+ DragType["record"] = "record";
201
+ DragType["field"] = "field";
202
+ DragType["columnWidth"] = "columnWidth";
203
+ DragType["none"] = "none";
204
+ })(DragType || (DragType = {}));
197
205
 
198
206
  const AI_TABLE_FIELD_MINI_WIDTH = 140;
199
207
  const AI_TABLE_FIELD_MIN_WIDTH = 160;
@@ -263,6 +271,12 @@ const FieldOptions = [
263
271
  icon: 'link-insert',
264
272
  width: AI_TABLE_FIELD_MIDDLE_WIDTH
265
273
  },
274
+ {
275
+ type: AITableFieldType.attachment,
276
+ name: '附件',
277
+ icon: 'attachment',
278
+ width: AI_TABLE_FIELD_MIDDLE_WIDTH
279
+ },
266
280
  {
267
281
  type: AITableFieldType.createdBy,
268
282
  name: '创建人',
@@ -661,8 +675,13 @@ function shortIdsCreator(count) {
661
675
  }
662
676
 
663
677
  const isArrayField = (field) => {
664
- return ([AITableFieldType.member, AITableFieldType.createdBy, AITableFieldType.updatedBy].includes(field.type) ||
665
- AITableFieldType.select === field.type);
678
+ return [
679
+ AITableFieldType.member,
680
+ AITableFieldType.createdBy,
681
+ AITableFieldType.updatedBy,
682
+ AITableFieldType.select,
683
+ AITableFieldType.attachment
684
+ ].includes(field.type);
666
685
  };
667
686
  const isSystemField = (field) => {
668
687
  return [AITableFieldType.createdAt, AITableFieldType.createdBy, AITableFieldType.updatedAt, AITableFieldType.updatedBy].includes(field.type);
@@ -707,10 +726,11 @@ function createDefaultField(aiTable, type = AITableFieldType.text) {
707
726
  return { _id: idCreator(), type, name: createDefaultFieldName(aiTable, fieldOption) };
708
727
  }
709
728
 
710
- function createAITable(records, fields) {
729
+ function createAITable(records, fields, gridData) {
711
730
  const aiTable = {
712
731
  records,
713
732
  fields,
733
+ gridData,
714
734
  selection: signal({
715
735
  selectedRecords: new Set(),
716
736
  selectedFields: new Set(),
@@ -737,6 +757,22 @@ function createAITable(records, fields) {
737
757
  return aiTable;
738
758
  }
739
759
 
760
+ function getFieldValue(record, field) {
761
+ if (isSystemField(field)) {
762
+ return getSystemFieldValue(record, field.type);
763
+ }
764
+ return record.values?.[field._id];
765
+ }
766
+ function getSystemFieldValue(record, type) {
767
+ const value = record[type];
768
+ if (type === AITableFieldType.createdAt || type === AITableFieldType.updatedAt) {
769
+ return { timestamp: value };
770
+ }
771
+ if (type === AITableFieldType.createdBy || type === AITableFieldType.updatedBy) {
772
+ return [value];
773
+ }
774
+ throw new Error(`unexpected ${type}`);
775
+ }
740
776
  const AITableQueries = {
741
777
  findRecordPath(aiTable, record) {
742
778
  const recordIndex = record && aiTable.records().indexOf(record);
@@ -773,20 +809,10 @@ const AITableQueries = {
773
809
  if (!field) {
774
810
  throw new Error(`can not find field at path [${path}]`);
775
811
  }
776
- if (isSystemField(field)) {
777
- return AITableQueries.getSystemFieldValue(record, field.type);
778
- }
779
- return record.values[path[1]];
812
+ return getFieldValue(record, field);
780
813
  },
781
814
  getSystemFieldValue(record, type) {
782
- const value = record[type];
783
- if (type === AITableFieldType.createdAt || type === AITableFieldType.updatedAt) {
784
- return { timestamp: value };
785
- }
786
- if (type === AITableFieldType.createdBy || type === AITableFieldType.updatedBy) {
787
- return [value];
788
- }
789
- throw new Error(`unexpected ${type}`);
815
+ return getSystemFieldValue(record, type);
790
816
  },
791
817
  getField(aiTable, path) {
792
818
  if (!aiTable) {
@@ -1238,113 +1264,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1238
1264
  }]
1239
1265
  }] });
1240
1266
 
1241
- class SelectOptionPipe {
1242
- transform(_id, options) {
1243
- return options?.length && options.find((item) => item._id === _id);
1244
- }
1245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1246
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" }); }
1247
- }
1248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionPipe, decorators: [{
1249
- type: Pipe,
1250
- args: [{
1251
- name: 'selectOption',
1252
- standalone: true
1253
- }]
1254
- }] });
1255
- class SelectOptionsPipe {
1256
- transform(ids, options = []) {
1257
- return ((ids?.length &&
1258
- ids.map((id) => {
1259
- return options.find((item) => item._id === id);
1260
- })) ||
1261
- []);
1262
- }
1263
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1264
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionsPipe, isStandalone: true, name: "selectOptions" }); }
1265
- }
1266
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionsPipe, decorators: [{
1267
- type: Pipe,
1268
- args: [{
1269
- name: 'selectOptions',
1270
- standalone: true
1271
- }]
1272
- }] });
1273
- class IsSelectRecordPipe {
1274
- transform(recordId, selection) {
1275
- return selection.selectedRecords.has(recordId);
1276
- }
1277
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsSelectRecordPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1278
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: IsSelectRecordPipe, isStandalone: true, name: "isSelectRecord" }); }
1279
- }
1280
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsSelectRecordPipe, decorators: [{
1281
- type: Pipe,
1282
- args: [{
1283
- name: 'isSelectRecord',
1284
- standalone: true
1285
- }]
1286
- }] });
1287
- class UserPipe {
1288
- transform(values, references) {
1289
- return ((values.length &&
1290
- values.map((item) => {
1291
- return references.members[item] || {};
1292
- })) ||
1293
- []);
1294
- }
1295
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UserPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1296
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: UserPipe, isStandalone: true, name: "user" }); }
1297
- }
1298
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UserPipe, decorators: [{
1299
- type: Pipe,
1300
- args: [{
1301
- name: 'user',
1302
- standalone: true
1303
- }]
1304
- }] });
1305
- class SelectSettingPipe {
1306
- transform(settings) {
1307
- return settings;
1308
- }
1309
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1310
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SelectSettingPipe, isStandalone: true, name: "selectSetting" }); }
1311
- }
1312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectSettingPipe, decorators: [{
1313
- type: Pipe,
1314
- args: [{
1315
- name: 'selectSetting',
1316
- standalone: true
1317
- }]
1318
- }] });
1319
- class MemberSettingPipe {
1320
- transform(settings) {
1321
- return settings;
1322
- }
1323
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MemberSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1324
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MemberSettingPipe, isStandalone: true, name: "memberSetting" }); }
1325
- }
1326
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MemberSettingPipe, decorators: [{
1327
- type: Pipe,
1328
- args: [{
1329
- name: 'memberSetting',
1330
- standalone: true
1331
- }]
1332
- }] });
1333
- class AITableFieldIsSameOptionPipe {
1334
- transform(fieldOption, field) {
1335
- return isSameFieldOption(fieldOption, field);
1336
- }
1337
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldIsSameOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1338
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldIsSameOptionPipe, isStandalone: true, name: "fieldIsSameOption" }); }
1339
- }
1340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldIsSameOptionPipe, decorators: [{
1341
- type: Pipe,
1342
- args: [{
1343
- name: 'fieldIsSameOption',
1344
- standalone: true
1345
- }]
1346
- }] });
1347
-
1348
1267
  class SelectOptionComponent {
1349
1268
  constructor() {
1350
1269
  this.field = input.required();
@@ -1387,37 +1306,42 @@ class SelectCellEditorComponent extends AbstractEditCellEditor {
1387
1306
  return value || [];
1388
1307
  })();
1389
1308
  }
1390
- updateValue(value) {
1309
+ onOpenChange(value) {
1391
1310
  if (!value) {
1392
- const value = this.isMultiple ? this.modelValue : (this.modelValue && [this.modelValue]) || [];
1311
+ this.closePopover();
1312
+ }
1313
+ }
1314
+ onModelChange(event) {
1315
+ this.updateValueFn();
1316
+ }
1317
+ updateValueFn() {
1318
+ const value = (this.isMultiple ? this.modelValue : (this.modelValue && [this.modelValue]) || []);
1319
+ const originValue = AITableQueries.getFieldValue(this.aiTable, [this.record()._id, this.field()._id]);
1320
+ if (!value.every((v, i) => v === originValue[i]) || value.length !== originValue.length) {
1393
1321
  this.updateFieldValue.emit({
1394
1322
  value: value,
1395
1323
  path: [this.record()._id, this.field()._id]
1396
1324
  });
1397
- this.closePopover();
1398
1325
  }
1399
1326
  }
1400
1327
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1401
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SelectCellEditorComponent, isStandalone: true, selector: "select-cell-editor", host: { classAttribute: "d-block h-100 select-cell-editor" }, usesInheritance: true, ngImport: i0, template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (thyOnExpandStatusChange)=\"updateValue($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option [thyValue]=\"option._id\" [thyRawValue]=\"option\" [thyShowOptionCustom]=\"true\" [thyLabelText]=\"option.text\">\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange", "visibleChange"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "ngmodule", type: ThyEmptyModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1328
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SelectCellEditorComponent, isStandalone: true, selector: "select-cell-editor", host: { classAttribute: "d-block h-100 select-cell-editor" }, usesInheritance: true, ngImport: i0, template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option [thyValue]=\"option._id\" [thyRawValue]=\"option\" [thyShowOptionCustom]=\"true\" [thyLabelText]=\"option.text\">\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n", dependencies: [{ kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange", "visibleChange"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ThyEmptyModule }, { kind: "ngmodule", type: ThyFormModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ThySelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1402
1329
  }
1403
1330
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectCellEditorComponent, decorators: [{
1404
1331
  type: Component,
1405
1332
  args: [{ selector: 'select-cell-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
1406
1333
  class: 'd-block h-100 select-cell-editor'
1407
1334
  }, imports: [
1408
- FormsModule,
1409
- NgTemplateOutlet,
1410
1335
  ThySelect,
1411
1336
  ThyOption,
1412
- ThyTag,
1413
- ThyIcon,
1414
1337
  ThyTooltipModule,
1415
- ThyDot,
1416
- ThyFlexibleText,
1417
- SelectOptionPipe,
1418
1338
  SelectOptionComponent,
1419
- ThyEmptyModule
1420
- ], template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (thyOnExpandStatusChange)=\"updateValue($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option [thyValue]=\"option._id\" [thyRawValue]=\"option\" [thyShowOptionCustom]=\"true\" [thyLabelText]=\"option.text\">\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n" }]
1339
+ CommonModule,
1340
+ ThyEmptyModule,
1341
+ ThyFormModule,
1342
+ FormsModule,
1343
+ ThySelectModule
1344
+ ], template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"true\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option [thyValue]=\"option._id\" [thyRawValue]=\"option\" [thyShowOptionCustom]=\"true\" [thyLabelText]=\"option.text\">\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n" }]
1421
1345
  }], ctorParameters: () => [] });
1422
1346
 
1423
1347
  class TextCellEditorComponent extends AbstractEditCellEditor {
@@ -1489,6 +1413,113 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1489
1413
  }]
1490
1414
  }], ctorParameters: () => [] });
1491
1415
 
1416
+ class SelectOptionPipe {
1417
+ transform(_id, options) {
1418
+ return options?.length && options.find((item) => item._id === _id);
1419
+ }
1420
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1421
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" }); }
1422
+ }
1423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionPipe, decorators: [{
1424
+ type: Pipe,
1425
+ args: [{
1426
+ name: 'selectOption',
1427
+ standalone: true
1428
+ }]
1429
+ }] });
1430
+ class SelectOptionsPipe {
1431
+ transform(ids, options = []) {
1432
+ return ((ids?.length &&
1433
+ ids.map((id) => {
1434
+ return options.find((item) => item._id === id);
1435
+ })) ||
1436
+ []);
1437
+ }
1438
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1439
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionsPipe, isStandalone: true, name: "selectOptions" }); }
1440
+ }
1441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectOptionsPipe, decorators: [{
1442
+ type: Pipe,
1443
+ args: [{
1444
+ name: 'selectOptions',
1445
+ standalone: true
1446
+ }]
1447
+ }] });
1448
+ class IsSelectRecordPipe {
1449
+ transform(recordId, selection) {
1450
+ return selection.selectedRecords.has(recordId);
1451
+ }
1452
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsSelectRecordPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1453
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: IsSelectRecordPipe, isStandalone: true, name: "isSelectRecord" }); }
1454
+ }
1455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsSelectRecordPipe, decorators: [{
1456
+ type: Pipe,
1457
+ args: [{
1458
+ name: 'isSelectRecord',
1459
+ standalone: true
1460
+ }]
1461
+ }] });
1462
+ class UserPipe {
1463
+ transform(values, references) {
1464
+ return ((values.length &&
1465
+ values.map((item) => {
1466
+ return references.members[item] || {};
1467
+ })) ||
1468
+ []);
1469
+ }
1470
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UserPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1471
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: UserPipe, isStandalone: true, name: "user" }); }
1472
+ }
1473
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UserPipe, decorators: [{
1474
+ type: Pipe,
1475
+ args: [{
1476
+ name: 'user',
1477
+ standalone: true
1478
+ }]
1479
+ }] });
1480
+ class SelectSettingPipe {
1481
+ transform(settings) {
1482
+ return settings;
1483
+ }
1484
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1485
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: SelectSettingPipe, isStandalone: true, name: "selectSetting" }); }
1486
+ }
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectSettingPipe, decorators: [{
1488
+ type: Pipe,
1489
+ args: [{
1490
+ name: 'selectSetting',
1491
+ standalone: true
1492
+ }]
1493
+ }] });
1494
+ class MemberSettingPipe {
1495
+ transform(settings) {
1496
+ return settings;
1497
+ }
1498
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MemberSettingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1499
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MemberSettingPipe, isStandalone: true, name: "memberSetting" }); }
1500
+ }
1501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MemberSettingPipe, decorators: [{
1502
+ type: Pipe,
1503
+ args: [{
1504
+ name: 'memberSetting',
1505
+ standalone: true
1506
+ }]
1507
+ }] });
1508
+ class AITableFieldIsSameOptionPipe {
1509
+ transform(fieldOption, field) {
1510
+ return isSameFieldOption(fieldOption, field);
1511
+ }
1512
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldIsSameOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1513
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldIsSameOptionPipe, isStandalone: true, name: "fieldIsSameOption" }); }
1514
+ }
1515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableFieldIsSameOptionPipe, decorators: [{
1516
+ type: Pipe,
1517
+ args: [{
1518
+ name: 'fieldIsSameOption',
1519
+ standalone: true
1520
+ }]
1521
+ }] });
1522
+
1492
1523
  class AITableFieldSetting {
1493
1524
  constructor() {
1494
1525
  this.aiEditField = model.required();
@@ -1606,6 +1637,10 @@ class AITableGridSelectionService {
1606
1637
  }
1607
1638
  initialize(aiTable) {
1608
1639
  this.aiTable = aiTable;
1640
+ this.aiTable.dragState = signal({
1641
+ type: DragType.none,
1642
+ sourceIds: new Set()
1643
+ });
1609
1644
  }
1610
1645
  clearSelection() {
1611
1646
  this.aiTable.selection.set({
@@ -1626,6 +1661,21 @@ class AITableGridSelectionService {
1626
1661
  this.clearSelection();
1627
1662
  this.aiTable.selection().selectedFields.add(fieldId);
1628
1663
  }
1664
+ get selectedFields() {
1665
+ return this.aiTable.selection().selectedFields;
1666
+ }
1667
+ get selectedRecords() {
1668
+ return this.aiTable.selection().selectedRecords;
1669
+ }
1670
+ drag(config) {
1671
+ this.aiTable.dragState.set(config);
1672
+ }
1673
+ clearDrag() {
1674
+ this.aiTable.dragState.set({
1675
+ type: DragType.none,
1676
+ sourceIds: new Set()
1677
+ });
1678
+ }
1629
1679
  selectRecord(recordId) {
1630
1680
  if (this.aiTable.selection().selectedRecords.has(recordId)) {
1631
1681
  this.aiTable.selection().selectedRecords.delete(recordId);
@@ -1721,6 +1771,7 @@ class AITableContextMenu extends ThyDropdownAbstractMenu {
1721
1771
  constructor() {
1722
1772
  super(...arguments);
1723
1773
  this.aiTableGridSelectionService = inject(AITableGridSelectionService);
1774
+ this.notifyService = inject(ThyNotifyService);
1724
1775
  this.aiTable = input.required();
1725
1776
  this.menuItems = input.required();
1726
1777
  this.targetName = input.required();
@@ -1728,22 +1779,31 @@ class AITableContextMenu extends ThyDropdownAbstractMenu {
1728
1779
  }
1729
1780
  execute(menu) {
1730
1781
  if ((menu.disabled && !menu.disabled(this.aiTable(), this.targetName(), this.position())) || !menu.disabled) {
1731
- menu.exec && menu.exec(this.aiTable(), this.targetName(), this.position(), this.aiTableGridSelectionService);
1782
+ menu.exec &&
1783
+ menu.exec(this.aiTable(), this.targetName(), this.position(), this.aiTableGridSelectionService, this.notifyService);
1732
1784
  }
1733
1785
  }
1734
1786
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableContextMenu, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1735
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableContextMenu, isStandalone: true, selector: "ai-table-context-menu", inputs: { aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: true, transformFunction: null }, menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: true, transformFunction: null }, targetName: { classPropertyName: "targetName", publicName: "targetName", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "context-menu" }, usesInheritance: true, ngImport: i0, template: "@for (menu of menuItems(); track $index) {\n @if ((menu.hidden && !menu.hidden(aiTable(), targetName(), position())) || !menu.hidden) {\n @let disabled = !!(menu.disabled && menu.disabled(aiTable(), targetName(), position()));\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{ 'ai-table-prevent-clear-selection remove-record': !disabled }\"\n (click)=\"execute(menu)\"\n [thyDisabled]=\"disabled\"\n >\n <thy-icon [thyIconName]=\"menu.icon!\"></thy-icon>\n <span>{{ menu.name }}</span>\n </a>\n }\n}\n", dependencies: [{ kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1787
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AITableContextMenu, isStandalone: true, selector: "ai-table-context-menu", inputs: { aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: true, isRequired: true, transformFunction: null }, menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: true, transformFunction: null }, targetName: { classPropertyName: "targetName", publicName: "targetName", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "context-menu" }, usesInheritance: true, ngImport: i0, template: "@for (menu of menuItems(); track $index) {\n @if ((menu.hidden && !menu.hidden(aiTable(), targetName(), position())) || !menu.hidden) {\n @if (menu.type === 'divider') {\n <thy-divider thyStyle=\"solid\"></thy-divider>\n } @else {\n @let disabled = !!(menu.disabled && menu.disabled(aiTable(), targetName(), position()));\n @let isRemoveRecords = menu.type === 'removeRecords';\n @let isPreventClearSelection = menu.type === 'copyCells' || menu.type === 'pasteCells' || menu.type === 'removeRecords';\n\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n 'remove-record': isRemoveRecords && !disabled,\n 'ai-table-prevent-clear-selection': isPreventClearSelection && !disabled\n }\"\n (click)=\"execute(menu)\"\n [thyDisabled]=\"disabled\"\n >\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"menu.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ menu.name }}</span>\n <span thyDropdownMenuItemMeta class=\"text-desc\">{{ menu.shortcutKey }}</span>\n </a>\n }\n }\n}\n", dependencies: [{ kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: ThyDropdownMenuItemNameDirective, selector: "[thyDropdownMenuItemName]" }, { kind: "directive", type: ThyDropdownMenuItemIconDirective, selector: "[thyDropdownMenuItemIcon]" }, { kind: "directive", type: ThyDropdownMenuItemMetaDirective, selector: "[thyDropdownMenuItemMeta]" }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThyDivider, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1736
1788
  }
1737
1789
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableContextMenu, decorators: [{
1738
1790
  type: Component,
1739
1791
  args: [{ selector: 'ai-table-context-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
1740
1792
  class: 'context-menu'
1741
- }, imports: [ThyDropdownMenuItemDirective, ThyIcon, NgClass], template: "@for (menu of menuItems(); track $index) {\n @if ((menu.hidden && !menu.hidden(aiTable(), targetName(), position())) || !menu.hidden) {\n @let disabled = !!(menu.disabled && menu.disabled(aiTable(), targetName(), position()));\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{ 'ai-table-prevent-clear-selection remove-record': !disabled }\"\n (click)=\"execute(menu)\"\n [thyDisabled]=\"disabled\"\n >\n <thy-icon [thyIconName]=\"menu.icon!\"></thy-icon>\n <span>{{ menu.name }}</span>\n </a>\n }\n}\n" }]
1742
- }] });
1743
-
1744
- const GRID_CELL_EDITOR_MAP = {
1745
- [AITableFieldType.text]: TextCellEditorComponent,
1746
- [AITableFieldType.richText]: TextCellEditorComponent,
1793
+ }, imports: [
1794
+ ThyDropdownMenuItemDirective,
1795
+ ThyDropdownMenuItemNameDirective,
1796
+ ThyDropdownMenuItemIconDirective,
1797
+ ThyDropdownMenuItemMetaDirective,
1798
+ ThyIcon,
1799
+ NgClass,
1800
+ ThyDivider
1801
+ ], template: "@for (menu of menuItems(); track $index) {\n @if ((menu.hidden && !menu.hidden(aiTable(), targetName(), position())) || !menu.hidden) {\n @if (menu.type === 'divider') {\n <thy-divider thyStyle=\"solid\"></thy-divider>\n } @else {\n @let disabled = !!(menu.disabled && menu.disabled(aiTable(), targetName(), position()));\n @let isRemoveRecords = menu.type === 'removeRecords';\n @let isPreventClearSelection = menu.type === 'copyCells' || menu.type === 'pasteCells' || menu.type === 'removeRecords';\n\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n [ngClass]=\"{\n 'remove-record': isRemoveRecords && !disabled,\n 'ai-table-prevent-clear-selection': isPreventClearSelection && !disabled\n }\"\n (click)=\"execute(menu)\"\n [thyDisabled]=\"disabled\"\n >\n <thy-icon thyDropdownMenuItemIcon [thyIconName]=\"menu.icon!\"></thy-icon>\n <span thyDropdownMenuItemName>{{ menu.name }}</span>\n <span thyDropdownMenuItemMeta class=\"text-desc\">{{ menu.shortcutKey }}</span>\n </a>\n }\n }\n}\n" }]
1802
+ }] });
1803
+
1804
+ const GRID_CELL_EDITOR_MAP = {
1805
+ [AITableFieldType.text]: TextCellEditorComponent,
1806
+ [AITableFieldType.richText]: TextCellEditorComponent,
1747
1807
  [AITableFieldType.select]: SelectCellEditorComponent,
1748
1808
  [AITableFieldType.number]: NumberCellEditorComponent,
1749
1809
  [AITableFieldType.date]: DateCellEditorComponent,
@@ -1796,10 +1856,14 @@ const AI_TABLE_CELL_EMOJI_PADDING = 8;
1796
1856
  const AI_TABLE_CELL_MEMBER_MAX_HEIGHT = 130; // 成员字段项最大高度
1797
1857
  const AI_TABLE_CELL_MEMBER_ITEM_HEIGHT = 24; // 成员字段项高度
1798
1858
  const AI_TABLE_CELL_MEMBER_ITEM_PADDING = 4; // 多个成员头像间距
1799
- const AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE = 22; // 成员/选项/链接字段的新按钮大小
1859
+ const AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE = 22; // 成员/选项/链接/附件字段的新按钮大小
1800
1860
  const AI_TABLE_MEMBER_AVATAR_SIZE = 24; // 成员头像大小
1801
1861
  const AI_TABLE_MEMBER_ITEM_PADDING_RIGHT = 8; // 成员字段项右边距
1802
1862
  const AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT = 8; // 成员头像与成员名之间的间距
1863
+ const AI_TABLE_FILE_ICON_ITEM_HEIGHT = 20; // 文件字段项高度
1864
+ const AI_TABLE_FILE_ICON_SIZE = 20; // 文件图标大小
1865
+ const AI_TABLE_CELL_FIELD_ITEM_HEIGHT = 8; // 文件字段项右边距
1866
+ const AI_TABLE_FIELD_ITEM_MARGIN_RIGHT = 4; // 文件图标之间的间距
1803
1867
  const AI_TABLE_OPTION_ITEM_PADDING = 10; // 选项按钮间距
1804
1868
  const AI_TABLE_OPTION_ITEM_HEIGHT = 24;
1805
1869
  const AI_TABLE_OPTION_ITEM_FONT_SIZE = 14;
@@ -1822,6 +1886,7 @@ const DBL_CLICK_EDIT_TYPE = [
1822
1886
  AITableFieldType.select,
1823
1887
  AITableFieldType.date,
1824
1888
  AITableFieldType.member,
1889
+ AITableFieldType.attachment,
1825
1890
  AITableFieldType.link
1826
1891
  ];
1827
1892
  const MOUSEOVER_EDIT_TYPE = [AITableFieldType.progress, AITableFieldType.rate];
@@ -1873,6 +1938,7 @@ const MoreStandOutlinedPath = `M8 4.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2
1873
1938
  const StarFill = `M9.186 2.12l1.02 2.769c.073.292.365.437.656.437l2.915.146c1.166.073 1.676 1.53.73 2.26l-2.26 1.821c-.219.146-.291.51-.219.729l.73 2.842c.29 1.093-.948 2.04-1.896 1.384l-2.477-1.603a.79.79 0 0 0-.802 0l-2.478 1.676c-.947.583-2.186-.291-1.894-1.457l.728-2.842c.073-.292 0-.583-.218-.729L1.46 7.731c-.874-.729-.437-2.186.73-2.259l2.914-.146c.292 0 .51-.218.656-.437l1.093-2.77c.365-1.092 1.895-1.092 2.332 0z`;
1874
1939
  const WebOutlinedPath = `M1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8ZM6.04798 2.85646C4.19852 3.55874 2.82616 5.22986 2.55071 7.25H5.26373C5.31861 5.76009 5.53564 4.40148 5.87147 3.352C5.92605 3.18143 5.98481 3.0157 6.04798 2.85646ZM5.87147 12.648C5.53564 11.5985 5.31861 10.2399 5.26373 8.75H2.55071C2.82616 10.7701 4.19852 12.4413 6.04798 13.1435C5.98481 12.9843 5.92605 12.8186 5.87147 12.648ZM10.1285 12.648C10.0739 12.8186 10.0152 12.9843 9.95202 13.1435C11.8015 12.4413 13.1738 10.7701 13.4493 8.75H10.7363C10.6814 10.2399 10.4644 11.5985 10.1285 12.648ZM8.6999 12.1908C8.98163 11.3104 9.18095 10.1118 9.23518 8.75H6.76482C6.81905 10.1118 7.01837 11.3104 7.3001 12.1908C7.46768 12.7145 7.65131 13.0839 7.81962 13.3063C7.90746 13.4224 7.9686 13.4711 8 13.4906C8.0314 13.4711 8.09254 13.4224 8.18038 13.3063C8.34869 13.0839 8.53232 12.7145 8.6999 12.1908ZM7.3001 3.80916C7.01837 4.68959 6.81905 5.88818 6.76482 7.25H9.23518C9.18095 5.88818 8.98163 4.68959 8.6999 3.80916C8.53232 3.28548 8.34869 2.91612 8.18038 2.69367C8.09254 2.57756 8.0314 2.52893 8 2.50944C7.9686 2.52893 7.90746 2.57756 7.81962 2.69367C7.65131 2.91612 7.46768 3.28548 7.3001 3.80916ZM10.1285 3.352C10.4644 4.40148 10.6814 5.76009 10.7363 7.25H13.4493C13.1738 5.22986 11.8015 3.55874 9.95203 2.85646C10.0152 3.0157 10.0739 3.18143 10.1285 3.352Z`;
1875
1940
  const DepartmentOutlinedPath = `M3 5.5C3 3.567 4.567 2 6.5 2C8.433 2 10 3.567 10 5.5C10 6.49548 9.5844 7.3939 8.91724 8.0312C10.7204 8.86779 12.017 10.6115 12.2217 12.6767C12.2976 13.4424 11.6682 14 11 14H2C1.33185 14 0.702358 13.4424 0.778277 12.6767C0.983033 10.6115 2.27961 8.86779 4.08276 8.0312C3.4156 7.3939 3 6.49548 3 5.5ZM8.5 5.5C8.5 4.39543 7.60457 3.5 6.5 3.5C5.39543 3.5 4.5 4.39543 4.5 5.5C4.5 6.60457 5.39543 7.5 6.5 7.5C7.60457 7.5 8.5 6.60457 8.5 5.5ZM2.31585 12.5H10.6841C10.3303 10.5108 8.59114 9 6.5 9C4.40886 9 2.66975 10.5108 2.31585 12.5Z', 'M11 3C10.5858 3 10.25 3.33579 10.25 3.75C10.25 4.16421 10.5858 4.5 11 4.5C11.6904 4.5 12.25 5.05964 12.25 5.75C12.25 6.44036 11.6904 7 11 7C10.5858 7 10.25 7.33579 10.25 7.75C10.25 8.16421 10.5858 8.5 11 8.5C12.6569 8.5 14 9.84315 14 11.5C14 11.9142 14.3358 12.25 14.75 12.25C15.1642 12.25 15.5 11.9142 15.5 11.5C15.5 9.77473 14.5291 8.27622 13.1038 7.52106C13.507 7.0426 13.75 6.42467 13.75 5.75C13.75 4.23122 12.5188 3 11 3Z`;
1941
+ const AttachmentPath = `M9.1 6.5V10a3.1 3.1 0 0 1-6.2.006l-.047-4.979a.6.6 0 0 1 1.2-.011L4.1 10a1.9 1.9 0 0 0 3.8 0V4.48C7.9 2.9 6.5 1.6 4.75 1.6S1.6 2.9 1.6 4.48v5.728c0 2.413 1.97 4.371 4.4 4.371 2.43 0 4.4-1.958 4.4-4.37v-5.16a.6.6 0 0 1 1.2 0v5.16c0 3.077-2.508 5.57-5.6 5.57-3.092 0-5.6-2.493-5.6-5.57V4.48C.4 2.216 2.357.4 4.75.4S9.1 2.216 9.1 4.48V6.5z`;
1876
1942
 
1877
1943
  const DEFAULT_FONT_SIZE = 14;
1878
1944
  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';
@@ -2307,262 +2373,111 @@ const isMac = () => {
2307
2373
  return /macintosh/i.test(agent);
2308
2374
  };
2309
2375
 
2310
- const getVisibleRangeInfo = (coordinate, scrollState) => {
2311
- const { scrollTop, scrollLeft } = scrollState;
2312
- const { rowCount, columnCount, frozenColumnCount } = coordinate;
2313
- // 获取要渲染的垂直可见区域
2314
- const getVerticalRangeInfo = () => {
2315
- const startIndex = coordinate.getRowStartIndex(scrollTop);
2316
- const stopIndex = coordinate.getRowStopIndex(startIndex, scrollTop);
2317
- return {
2318
- rowStartIndex: Math.max(0, startIndex - 1),
2319
- rowStopIndex: Math.max(0, Math.min(rowCount - 1, stopIndex + 1))
2320
- };
2321
- };
2322
- // 获取要渲染的水平可见区域
2323
- const getHorizontalRangeInfo = () => {
2324
- const startIndex = coordinate.getColumnStartIndex(scrollLeft);
2325
- const stopIndex = coordinate.getColumnStopIndex(startIndex, scrollLeft);
2326
- return {
2327
- columnStartIndex: Math.max(frozenColumnCount - 1, startIndex),
2328
- columnStopIndex: Math.max(frozenColumnCount - 1, Math.min(columnCount - 1, stopIndex))
2329
- };
2330
- };
2331
- const { rowStartIndex, rowStopIndex } = getVerticalRangeInfo();
2332
- const { columnStartIndex, columnStopIndex } = getHorizontalRangeInfo();
2333
- return {
2334
- rowStartIndex,
2335
- rowStopIndex,
2336
- columnStartIndex,
2337
- columnStopIndex
2338
- };
2339
- };
2340
- const scrollMax = (coordinate, visibleColumns) => {
2341
- const scrollMaxWidth = visibleColumns.reduce((pre, cur) => pre + getFieldOptionByField(cur)?.width, AI_TABLE_ROW_HEAD_WIDTH);
2342
- const scrollMaxHeight = coordinate.getRowOffset(coordinate.rowCount - 1) + 32;
2343
- return { scrollMaxWidth, scrollMaxHeight };
2344
- };
2345
-
2346
- const getMousePosition = (x, y, coordinate, fields, context, _targetName) => {
2347
- const { scrollTop, scrollLeft } = context.scrollState();
2348
- const { scrollMaxWidth, scrollMaxHeight } = scrollMax(coordinate, fields);
2349
- const offsetTop = scrollTop + y;
2350
- const rowIndex = coordinate.getRowStartIndex(offsetTop);
2351
- const offsetLeft = isWithinFrozenColumnBoundary(x, coordinate.frozenColumnWidth) ? x : scrollLeft + x;
2352
- const columnIndex = coordinate.getColumnStartIndex(offsetLeft);
2353
- const areaType = offsetLeft <= scrollMaxWidth && offsetTop <= scrollMaxHeight ? AITableAreaType.grid : AITableAreaType.none;
2354
- const targetName = getTargetName(_targetName);
2355
- return {
2356
- areaType,
2357
- targetName, // As a simple operational identifier, with prefix name only
2358
- realTargetName: _targetName || AI_TABLE_BLANK, // Real name
2359
- rowIndex,
2360
- columnIndex,
2361
- offsetTop,
2362
- offsetLeft,
2363
- x,
2364
- y
2365
- };
2366
- };
2367
- const isWithinFrozenColumnBoundary = (x, frozenColumnWidth) => {
2368
- const max = AI_TABLE_ROW_HEAD_WIDTH + frozenColumnWidth;
2369
- const min = AI_TABLE_ROW_HEAD_WIDTH;
2370
- return x > min && x < max;
2371
- };
2372
- const getEditorSpace = (widthOrHeight) => {
2373
- return widthOrHeight + AI_TABLE_OFFSET * 2;
2374
- };
2375
- const getEditorBoxOffset = () => {
2376
- return -AI_TABLE_OFFSET;
2377
- };
2378
- const getCellEditorBorderSpace = () => {
2379
- return AI_TABLE_CELL_ACTIVE_BORDER_WIDTH * 2 - AI_TABLE_OFFSET * 2;
2380
- };
2381
- const getHoverEditorSpace = (widthOrHeight) => {
2382
- const borderSpace = getCellEditorBorderSpace();
2383
- return widthOrHeight - borderSpace;
2376
+ const isClipboardWriteSupported = () => {
2377
+ return 'clipboard' in navigator && 'write' in navigator.clipboard;
2384
2378
  };
2385
- const getHoverEditorBoxOffset = () => {
2386
- const borderSpace = getCellEditorBorderSpace();
2387
- return borderSpace / 2;
2379
+ const isClipboardWriteTextSupported = () => {
2380
+ return 'clipboard' in navigator && 'writeText' in navigator.clipboard;
2388
2381
  };
2389
-
2390
- const handleMouseStyle = (realTargetName, areaType = AITableAreaType.grid, container) => {
2391
- const { targetName, mouseStyle } = getDetailByTargetName(realTargetName);
2392
- if (mouseStyle)
2393
- return setMouseStyle(mouseStyle, container);
2394
- if (areaType === AITableAreaType.none)
2395
- return setMouseStyle('default', container);
2396
- switch (targetName) {
2397
- case AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX:
2398
- case AI_TABLE_FIELD_HEAD_MORE:
2399
- case AI_TABLE_ROW_SELECT_CHECKBOX:
2400
- case AI_TABLE_ROW_ADD_BUTTON:
2401
- case AI_TABLE_FIELD_ADD_BUTTON: {
2402
- return setMouseStyle('pointer', container);
2403
- }
2404
- default:
2405
- return setMouseStyle('default', container);
2406
- }
2382
+ const isClipboardReadSupported = () => {
2383
+ return 'clipboard' in navigator && 'read' in navigator.clipboard;
2407
2384
  };
2408
- const setMouseStyle = (mouseStyle, container) => {
2409
- container.style.cursor = mouseStyle;
2385
+ const isClipboardReadTextSupported = () => {
2386
+ return 'clipboard' in navigator && 'readText' in navigator.clipboard;
2410
2387
  };
2411
-
2412
- /**
2413
- * Canvas 上测量文本的宽度和高度,以便在显示文本时能够动态调整布局或限制文本的显示区域
2414
- * @param defaults
2415
- * @returns
2416
- */
2417
- const TextMeasure = (defaults = {}) => {
2418
- const { fontFamily = DEFAULT_FONT_FAMILY, fontSize = DEFAULT_FONT_SIZE, fontWeight = DEFAULT_FONT_WEIGHT, fontStyle = DEFAULT_FONT_STYLE, lineHeight = DEFAULT_TEXT_LINE_HEIGHT, scale = DEFAULT_TEXT_SCALE } = defaults;
2419
- const o = {
2420
- fontFamily,
2421
- fontSize,
2422
- fontWeight,
2423
- fontStyle,
2424
- lineHeight,
2425
- scale
2426
- };
2427
- const canvas = document.createElement('canvas');
2428
- const context = canvas ? canvas.getContext('2d') : null;
2429
- const normalizeFontFamily = (fontFamily) => {
2430
- return fontFamily
2431
- .split(',')
2432
- .map((family) => {
2433
- family = family.trim();
2434
- const hasSpace = family.indexOf(' ') >= 0;
2435
- const hasQuotes = family.indexOf('"') >= 0 || family.indexOf("'") >= 0;
2436
- if (hasSpace && !hasQuotes) {
2437
- family = `"${family}"`;
2438
- }
2439
- return family;
2440
- })
2441
- .join(', ');
2442
- };
2443
- // 可以在运行时动态调整字体样式,从而影响后续的文本测量
2444
- const setFont = (options = {}) => {
2445
- for (const key in options) {
2446
- o[key] = options[key] ?? o[key];
2447
- }
2448
- if (context) {
2449
- context.font = `${o.fontWeight} ${o.fontSize * o.scale}px ${normalizeFontFamily(o.fontFamily)}`;
2450
- }
2451
- };
2452
- // 根据指定的最大宽度和行数来计算文本的显示方式。如果文本太长,它会自动换行或截断,并返回是否发生溢出的信息
2453
- const getWidthOfLongestText = (text, maxWidth, maxLineCount) => {
2454
- let width = 0;
2455
- let height = 0;
2456
- let lineCount = 0;
2457
- if (text == null) {
2458
- return { width, height, lastLineWidth: 0 };
2388
+ const writeToClipboard = async (data) => {
2389
+ try {
2390
+ const { text, html } = data;
2391
+ if (isClipboardWriteSupported()) {
2392
+ const clipboardItem = new ClipboardItem({
2393
+ 'text/plain': new Blob([text], { type: 'text/plain' }),
2394
+ 'text/html': new Blob([html], { type: 'text/html' })
2395
+ });
2396
+ await navigator.clipboard.write([clipboardItem]);
2459
2397
  }
2460
- const lines = text.split('\n');
2461
- for (let i = 0; i < lines.length; i++) {
2462
- const line = lines[i];
2463
- const lineWidth = context?.measureText(line).width ?? 0;
2464
- width = Math.max(width, lineWidth);
2465
- lineCount = maxWidth != null ? Math.ceil(lineWidth / maxWidth) || 1 : 1;
2466
- height += o.lineHeight * lineCount;
2398
+ else if (isClipboardWriteTextSupported()) {
2399
+ await navigator.clipboard.writeText(text);
2467
2400
  }
2468
- if (maxWidth == null || maxLineCount === 1 || (maxLineCount && lineCount <= maxLineCount)) {
2469
- return {
2470
- width: Math.ceil(width),
2471
- height: Math.ceil(height),
2472
- text,
2473
- isOverflow: Boolean(maxLineCount && lineCount > maxLineCount),
2474
- lastLineWidth: Math.ceil(width)
2475
- };
2401
+ else {
2402
+ const textarea = document.createElement('textarea');
2403
+ textarea.value = text;
2404
+ document.body.appendChild(textarea);
2405
+ textarea.select();
2406
+ document.execCommand('copy');
2407
+ document.body.removeChild(textarea);
2476
2408
  }
2477
- const arrText = text.split('');
2478
- let rowCount = 0; // 总行数
2479
- let textHeight = 0; // 文本最终占用的高度
2480
- let showText = ''; // 每行展示的文本
2481
- let totalText = '';
2482
- let isLimitRow = false;
2483
- const textLength = arrText.length;
2484
- for (let n = 0; n < textLength; n++) {
2485
- const singleText = arrText[n];
2486
- const composeText = showText + singleText;
2487
- // 如果没有超过 maxLineCount,就会继续换行
2488
- isLimitRow = maxLineCount ? rowCount === maxLineCount - 1 : false;
2489
- const measureText = isLimitRow ? composeText + '' : composeText;
2490
- totalText += singleText;
2491
- const textWidth = context?.measureText(measureText).width ?? 0;
2492
- const isLineBreak = ['\n', '\r'].includes(singleText);
2493
- if (((maxWidth && textWidth > maxWidth) || isLineBreak) && (maxLineCount == null || rowCount < maxLineCount)) {
2494
- showText = isLineBreak ? '' : singleText;
2495
- textHeight += lineHeight;
2496
- rowCount++;
2497
- if (isLimitRow) {
2498
- if (n < textLength - 1) {
2499
- totalText = totalText.substring(0, totalText.length - 1) + '…';
2409
+ }
2410
+ catch (error) {
2411
+ console.warn('Failed to write clipboard:', error);
2412
+ }
2413
+ };
2414
+ const readFromClipboard = async () => {
2415
+ try {
2416
+ let clipboardData = {};
2417
+ if (isClipboardReadSupported()) {
2418
+ const clipboardItems = await navigator.clipboard.read();
2419
+ if (Array.isArray(clipboardItems) && clipboardItems[0] instanceof ClipboardItem) {
2420
+ for (const item of clipboardItems) {
2421
+ if (item.types.includes('text/html')) {
2422
+ const blob = await item.getType('text/html');
2423
+ clipboardData.html = await blob.text();
2424
+ }
2425
+ if (item.types.includes('text/plain')) {
2426
+ const blob = await item.getType('text/plain');
2427
+ clipboardData.text = await blob.text();
2500
2428
  }
2501
- break;
2502
2429
  }
2503
2430
  }
2504
- else {
2505
- showText = composeText;
2506
- }
2507
2431
  }
2508
- return {
2509
- width: Math.ceil(width),
2510
- height: Math.ceil(maxLineCount == null || rowCount < maxLineCount ? textHeight + lineHeight : textHeight),
2511
- text: totalText,
2512
- isOverflow: isLimitRow,
2513
- lastLineWidth: context?.measureText(showText).width ?? 0
2514
- };
2515
- };
2516
- // 测量给定文本的宽度和高度。
2517
- // 支持指定最大宽度 (maxWidth) 和最大行数 (maxLineCount),从而能够处理多行文本的自动换行和截断(例如在文本超过行数限制时添加省略号 "…")
2518
- const measureText = (text, maxWidth, maxLineCount) => {
2519
- return getWidthOfLongestText(castToString(text), maxWidth, maxLineCount);
2520
- };
2521
- // 可以将字体样式重置为初始默认配置
2522
- const reset = () => setFont(defaults);
2523
- setFont(o);
2524
- return {
2525
- context,
2526
- measureText,
2527
- setFont,
2528
- reset
2529
- };
2432
+ else if (isClipboardReadTextSupported()) {
2433
+ const clipboardText = await navigator.clipboard.readText();
2434
+ clipboardData.text = clipboardText;
2435
+ }
2436
+ else {
2437
+ const pastePromise = new Promise((resolve) => {
2438
+ const textarea = document.createElement('textarea');
2439
+ document.body.appendChild(textarea);
2440
+ const handlePaste = (e) => {
2441
+ const text = e.clipboardData?.getData('text') || '';
2442
+ const html = e.clipboardData?.getData('text/html') || '';
2443
+ resolve({
2444
+ text,
2445
+ html: html || undefined
2446
+ });
2447
+ textarea.removeEventListener('paste', handlePaste);
2448
+ };
2449
+ textarea.addEventListener('paste', handlePaste);
2450
+ textarea.focus();
2451
+ document.execCommand('paste');
2452
+ document.body.removeChild(textarea);
2453
+ });
2454
+ clipboardData = await pastePromise;
2455
+ }
2456
+ return clipboardData;
2457
+ }
2458
+ catch (error) {
2459
+ console.warn('Failed to read clipboard:', error);
2460
+ return null;
2461
+ }
2530
2462
  };
2531
2463
 
2532
- class Field {
2533
- // 筛选
2534
- isMeetFilter(condition, cellValue) {
2535
- switch (condition.operation) {
2536
- case AITableFilterOperation.empty:
2537
- case AITableFilterOperation.exists: {
2538
- return this.isEmptyOrNot(condition.operation, cellValue);
2539
- }
2540
- default: {
2541
- return true;
2542
- }
2464
+ function extractText(text) {
2465
+ let plainText = text;
2466
+ if (text.includes('<a')) {
2467
+ const aTagMatch = text.match(/<a[^>]*>(.*?)<\/a>/i);
2468
+ if (aTagMatch && aTagMatch[1] && aTagMatch[1].trim()) {
2469
+ plainText = aTagMatch[1];
2543
2470
  }
2544
2471
  }
2545
- // 查找
2546
- cellFullText(transformValue, field, references) {
2547
- let fullText = [];
2548
- if (!isEmpty(transformValue)) {
2549
- fullText.push(String(transformValue));
2550
- }
2551
- return fullText;
2552
- }
2553
- isEmptyOrNot(operation, cellValue) {
2554
- switch (operation) {
2555
- case AITableFilterOperation.empty: {
2556
- return isEmpty(cellValue);
2557
- }
2558
- case AITableFilterOperation.exists: {
2559
- return !isEmpty(cellValue);
2560
- }
2561
- default: {
2562
- throw new Error('compare operator type error');
2563
- }
2564
- }
2472
+ return plainText;
2473
+ }
2474
+ function extractLinkHref(text) {
2475
+ let href = null;
2476
+ const hrefMatch = text.match(/href="([^"]+)"/);
2477
+ if (hrefMatch && hrefMatch[1] && hrefMatch[1].trim()) {
2478
+ href = hrefMatch[1];
2565
2479
  }
2480
+ return href;
2566
2481
  }
2567
2482
 
2568
2483
  const zhIntlCollator = typeof Intl !== 'undefined' ? new Intl.Collator('zh-CN') : undefined;
@@ -2611,14 +2526,109 @@ function hasIntersect(array1, array2) {
2611
2526
  return false;
2612
2527
  }
2613
2528
 
2529
+ class Field {
2530
+ // 筛选
2531
+ isMeetFilter(condition, cellValue) {
2532
+ switch (condition.operation) {
2533
+ case AITableFilterOperation.empty:
2534
+ case AITableFilterOperation.exists: {
2535
+ return this.isEmptyOrNot(condition.operation, cellValue);
2536
+ }
2537
+ default: {
2538
+ return true;
2539
+ }
2540
+ }
2541
+ }
2542
+ // 查找
2543
+ cellFullText(transformValue, field, references) {
2544
+ let fullText = [];
2545
+ if (!isEmpty(transformValue)) {
2546
+ fullText.push(String(transformValue));
2547
+ }
2548
+ return fullText;
2549
+ }
2550
+ isEmptyOrNot(operation, cellValue) {
2551
+ switch (operation) {
2552
+ case AITableFilterOperation.empty: {
2553
+ return isEmpty(cellValue);
2554
+ }
2555
+ case AITableFilterOperation.exists: {
2556
+ return !isEmpty(cellValue);
2557
+ }
2558
+ default: {
2559
+ throw new Error('compare operator type error');
2560
+ }
2561
+ }
2562
+ }
2563
+ }
2564
+
2565
+ class AttachmentField extends Field {
2566
+ isMeetFilter(condition, cellValue) {
2567
+ switch (condition.operation) {
2568
+ case AITableFilterOperation.empty:
2569
+ return isEmpty(cellValue);
2570
+ case AITableFilterOperation.exists:
2571
+ return !isEmpty(cellValue);
2572
+ case AITableFilterOperation.in:
2573
+ return Array.isArray(condition.value) && hasIntersect(cellValue, condition.value);
2574
+ case AITableFilterOperation.nin:
2575
+ return Array.isArray(condition.value) && !hasIntersect(cellValue, condition.value);
2576
+ default:
2577
+ return super.isMeetFilter(condition, cellValue);
2578
+ }
2579
+ }
2580
+ compare(cellValue1, cellValue2, field, references, sortKey) {
2581
+ const value1 = cellValueToSortValue$5(cellValue1, field, references, sortKey);
2582
+ const value2 = cellValueToSortValue$5(cellValue2, field, references, sortKey);
2583
+ return compareString(value1, value2);
2584
+ }
2585
+ cellFullText(transformValue, field, references) {
2586
+ let fullText = [];
2587
+ if (transformValue?.length && references) {
2588
+ for (let index = 0; index < transformValue.length; index++) {
2589
+ const attachmentInfo = references?.attachments[transformValue[index]];
2590
+ if (!attachmentInfo) {
2591
+ continue;
2592
+ }
2593
+ if (attachmentInfo.title) {
2594
+ fullText.push(attachmentInfo.title);
2595
+ }
2596
+ }
2597
+ }
2598
+ return fullText;
2599
+ }
2600
+ toFieldValue(plainText, targetField, originData, references) {
2601
+ return toAttachmentFieldValue(plainText, targetField, originData, references);
2602
+ }
2603
+ }
2604
+ function toAttachmentFieldValue(plainText, targetField, originData, references) {
2605
+ return null;
2606
+ }
2607
+ function cellValueToSortValue$5(cellValue, field, references, sortKey = 'title') {
2608
+ let values = [];
2609
+ if (cellValue?.length && references) {
2610
+ for (let index = 0; index < cellValue.length; index++) {
2611
+ const attachmentInfo = references?.attachments[cellValue[index]];
2612
+ if (!attachmentInfo) {
2613
+ continue;
2614
+ }
2615
+ const value = attachmentInfo[sortKey];
2616
+ if (value) {
2617
+ values.push(value);
2618
+ }
2619
+ }
2620
+ }
2621
+ return values && values.length ? values.join(', ') : null;
2622
+ }
2623
+
2614
2624
  class DateField extends Field {
2615
2625
  isMeetFilter(condition, cellValue) {
2616
2626
  const [left, right] = this.getTimeRange(condition.value);
2617
2627
  switch (condition.operation) {
2618
2628
  case AITableFilterOperation.empty:
2619
- return isEmpty$1(cellValue.timestamp) || cellValue.timestamp === 0;
2629
+ return isEmpty(cellValue.timestamp) || cellValue.timestamp === 0;
2620
2630
  case AITableFilterOperation.exists:
2621
- return !isEmpty$1(cellValue.timestamp) && cellValue.timestamp !== 0;
2631
+ return !isEmpty(cellValue.timestamp) && cellValue.timestamp !== 0;
2622
2632
  case AITableFilterOperation.eq:
2623
2633
  return left <= cellValue.timestamp && cellValue.timestamp < right;
2624
2634
  case AITableFilterOperation.gt:
@@ -2636,6 +2646,9 @@ class DateField extends Field {
2636
2646
  const value2 = cellValueToSortValue$4(cellValue2);
2637
2647
  return compareNumber(value1, value2);
2638
2648
  }
2649
+ toFieldValue(plainText, targetField, originData) {
2650
+ return toDateFieldValue(plainText, targetField, originData);
2651
+ }
2639
2652
  getTimeRange(value) {
2640
2653
  switch (value) {
2641
2654
  case 'today':
@@ -2666,9 +2679,47 @@ class DateField extends Field {
2666
2679
  }
2667
2680
  }
2668
2681
  }
2682
+ function toDateFieldValue(plainText, targetField, originData) {
2683
+ if (targetField.type === AITableFieldType.createdAt || targetField.type === AITableFieldType.updatedAt) {
2684
+ return null;
2685
+ }
2686
+ if (originData) {
2687
+ const { field, cellValue } = originData;
2688
+ switch (field.type) {
2689
+ case AITableFieldType.date:
2690
+ return cellValue;
2691
+ case AITableFieldType.text:
2692
+ const dateValue = transformDateValue(cellValue);
2693
+ if (dateValue) {
2694
+ return dateValue;
2695
+ }
2696
+ break;
2697
+ default:
2698
+ break;
2699
+ }
2700
+ }
2701
+ else {
2702
+ const dateValue = transformDateValue(plainText);
2703
+ if (dateValue) {
2704
+ return dateValue;
2705
+ }
2706
+ }
2707
+ return null;
2708
+ }
2669
2709
  function cellValueToSortValue$4(cellValue) {
2670
2710
  return cellValue?.timestamp;
2671
2711
  }
2712
+ function transformDateValue(text) {
2713
+ const value = text.trim();
2714
+ const pattern = /^\d{4}-\d{1,2}-\d{1,2}$/;
2715
+ if (value && !isEmpty(value) && pattern.test(value)) {
2716
+ const dateValue = {
2717
+ timestamp: new TinyDate(value).getUnixTime()
2718
+ };
2719
+ return dateValue;
2720
+ }
2721
+ return null;
2722
+ }
2672
2723
 
2673
2724
  class LinkField extends Field {
2674
2725
  isMeetFilter(condition, cellValue) {
@@ -2694,6 +2745,28 @@ class LinkField extends Field {
2694
2745
  }
2695
2746
  return texts;
2696
2747
  }
2748
+ toFieldValue(plainText, targetField, originData) {
2749
+ return toLinkFieldValue(plainText, targetField, originData);
2750
+ }
2751
+ }
2752
+ function toLinkFieldValue(plainText, targetField, originData) {
2753
+ if (originData) {
2754
+ const { field, cellValue } = originData;
2755
+ if (field.type === AITableFieldType.link) {
2756
+ return cellValue;
2757
+ }
2758
+ }
2759
+ else {
2760
+ const url = extractLinkHref(plainText);
2761
+ const text = extractText(plainText);
2762
+ if (url && text) {
2763
+ return {
2764
+ url,
2765
+ text
2766
+ };
2767
+ }
2768
+ }
2769
+ return null;
2697
2770
  }
2698
2771
  function cellValueToSortValue$3(cellValue) {
2699
2772
  return (cellValue && cellValue.text && cellValue.text.trim()) || null;
@@ -2734,6 +2807,44 @@ class MemberField extends Field {
2734
2807
  }
2735
2808
  return fullText;
2736
2809
  }
2810
+ toFieldValue(plainText, targetField, originData, references) {
2811
+ return toMemberFieldValue(plainText, targetField, originData, references);
2812
+ }
2813
+ }
2814
+ function toMemberFieldValue(plainText, targetField, originData, references) {
2815
+ if (targetField.type == AITableFieldType.createdBy || targetField.type == AITableFieldType.updatedBy) {
2816
+ return null;
2817
+ }
2818
+ const isMultiple = targetField.settings?.is_multiple;
2819
+ if (originData) {
2820
+ const { field, cellValue } = originData;
2821
+ switch (field.type) {
2822
+ case AITableFieldType.member:
2823
+ if (Array.isArray(cellValue) && cellValue.length) {
2824
+ return isMultiple ? cellValue : [cellValue[0]];
2825
+ }
2826
+ break;
2827
+ default:
2828
+ break;
2829
+ }
2830
+ }
2831
+ plainText = plainText.trim();
2832
+ const hasMemberInfo = references && references.members && Object.keys(references.members).length;
2833
+ if (plainText && hasMemberInfo) {
2834
+ const memberNames = plainText.split(',').map((id) => id.trim());
2835
+ const memberInfos = Object.values(references.members);
2836
+ let validMemberIds = [];
2837
+ memberNames.forEach((memberName) => {
2838
+ const memberInfo = memberInfos.find((member) => member.display_name === memberName);
2839
+ if (memberInfo) {
2840
+ validMemberIds.push(memberInfo.uid);
2841
+ }
2842
+ });
2843
+ if (validMemberIds.length) {
2844
+ return isMultiple ? validMemberIds : [validMemberIds[0]];
2845
+ }
2846
+ }
2847
+ return null;
2737
2848
  }
2738
2849
  function cellValueToSortValue$2(cellValue, field, references, sortKey = 'display_name') {
2739
2850
  let values = [];
@@ -2778,6 +2889,34 @@ class NumberField extends Field {
2778
2889
  compare(cellValue1, cellValue2) {
2779
2890
  return compareNumber(cellValue1, cellValue2);
2780
2891
  }
2892
+ toFieldValue(plainText, targetField, originData) {
2893
+ return toNumberFieldValue(plainText, targetField, originData);
2894
+ }
2895
+ }
2896
+ function toNumberFieldValue(plainText, targetField, originData) {
2897
+ let text = plainText.trim();
2898
+ if (originData) {
2899
+ const { field, cellValue } = originData;
2900
+ const fieldType = field.type;
2901
+ switch (fieldType) {
2902
+ case AITableFieldType.number:
2903
+ case AITableFieldType.rate:
2904
+ case AITableFieldType.progress:
2905
+ return cellValue;
2906
+ case AITableFieldType.select:
2907
+ if (cellValue && Array.isArray(cellValue) && cellValue.length) {
2908
+ const optionsMap = helpers.keyBy(field.settings.options || [], '_id');
2909
+ text = optionsMap[cellValue[0]]?.text;
2910
+ }
2911
+ break;
2912
+ default:
2913
+ break;
2914
+ }
2915
+ }
2916
+ if (text && !isEmpty(text) && !Number.isNaN(Number(text))) {
2917
+ return Number(text);
2918
+ }
2919
+ return null;
2781
2920
  }
2782
2921
 
2783
2922
  class ProgressField extends Field {
@@ -2813,6 +2952,37 @@ class ProgressField extends Field {
2813
2952
  }
2814
2953
  return fullText;
2815
2954
  }
2955
+ toFieldValue(plainText, targetField, originData) {
2956
+ return toProgressFieldValue(plainText, targetField, originData);
2957
+ }
2958
+ }
2959
+ function toProgressFieldValue(plainText, targetField, originData) {
2960
+ let value = plainText.trim();
2961
+ if (originData) {
2962
+ const { field, cellValue } = originData;
2963
+ switch (field.type) {
2964
+ case AITableFieldType.progress:
2965
+ case AITableFieldType.rate:
2966
+ case AITableFieldType.number:
2967
+ value = cellValue;
2968
+ break;
2969
+ case AITableFieldType.select:
2970
+ if (cellValue && Array.isArray(cellValue) && cellValue.length) {
2971
+ const optionsMap = helpers.keyBy(field.settings.options || [], '_id');
2972
+ value = optionsMap[cellValue[0]]?.text;
2973
+ }
2974
+ break;
2975
+ default:
2976
+ break;
2977
+ }
2978
+ }
2979
+ if (!isEmpty(value)) {
2980
+ const progressValue = Number(value);
2981
+ if (!Number.isNaN(progressValue) && progressValue >= 0 && progressValue <= 100) {
2982
+ return progressValue;
2983
+ }
2984
+ }
2985
+ return null;
2816
2986
  }
2817
2987
 
2818
2988
  class RateField extends Field {
@@ -2835,6 +3005,38 @@ class RateField extends Field {
2835
3005
  compare(cellValue1, cellValue2) {
2836
3006
  return compareNumber(cellValue1, cellValue2);
2837
3007
  }
3008
+ toFieldValue(plainText, targetField, originData) {
3009
+ return toRateFieldValue(plainText, targetField, originData);
3010
+ }
3011
+ }
3012
+ function toRateFieldValue(plainText, targetField, originData) {
3013
+ let value = plainText.trim();
3014
+ if (originData) {
3015
+ const { field, cellValue } = originData;
3016
+ switch (field.type) {
3017
+ case AITableFieldType.rate:
3018
+ case AITableFieldType.number:
3019
+ case AITableFieldType.progress:
3020
+ value = cellValue;
3021
+ break;
3022
+ case AITableFieldType.select:
3023
+ if (cellValue && Array.isArray(cellValue) && cellValue.length) {
3024
+ const optionsMap = helpers.keyBy(field.settings.options || [], '_id');
3025
+ value = optionsMap[cellValue[0]]?.text;
3026
+ }
3027
+ break;
3028
+ default:
3029
+ break;
3030
+ }
3031
+ }
3032
+ if (!isEmpty(value)) {
3033
+ const rateValue = Number(value);
3034
+ if (!Number.isNaN(rateValue) && rateValue > 0 && rateValue < 5) {
3035
+ return Math.round(rateValue);
3036
+ }
3037
+ return 5;
3038
+ }
3039
+ return null;
2838
3040
  }
2839
3041
 
2840
3042
  class SelectField extends Field {
@@ -2870,6 +3072,68 @@ class SelectField extends Field {
2870
3072
  }
2871
3073
  return fullText;
2872
3074
  }
3075
+ toFieldValue(plainText, targetField, originData) {
3076
+ return toSelectFieldValue(plainText, targetField, originData);
3077
+ }
3078
+ }
3079
+ function toSelectFieldValue(plainText, targetField, originData) {
3080
+ return null;
3081
+ }
3082
+ function processPastedValueForSelect(plainText, targetField, originData) {
3083
+ const targetFieldOptions = targetField.settings?.options || [];
3084
+ let existOptionIds = [];
3085
+ let newOptions = [];
3086
+ let cellFullTexts = plainText.split(',').map((text) => text.trim());
3087
+ const { field, cellValue } = originData || {};
3088
+ if (field && field.type === AITableFieldType.select) {
3089
+ if (cellValue && Array.isArray(cellValue) && cellValue.length) {
3090
+ const targetOptionIds = targetFieldOptions.map((option) => option._id);
3091
+ const originOptionsMap = helpers.keyBy(field.settings?.options || [], '_id');
3092
+ cellValue.forEach((id) => {
3093
+ if (targetOptionIds.includes(id)) {
3094
+ existOptionIds.push(id);
3095
+ }
3096
+ else if (targetFieldOptions.some((option) => option.text === originOptionsMap[id]?.text)) {
3097
+ const option = targetFieldOptions.find((option) => option.text === originOptionsMap[id].text);
3098
+ existOptionIds.push(option._id);
3099
+ }
3100
+ else {
3101
+ const originOption = originOptionsMap[id];
3102
+ if (originOption) {
3103
+ newOptions.push({
3104
+ text: originOption.text,
3105
+ icon: originOption.icon,
3106
+ color: originOption.color,
3107
+ bg_color: originOption.bg_color
3108
+ });
3109
+ }
3110
+ }
3111
+ });
3112
+ }
3113
+ }
3114
+ else {
3115
+ cellFullTexts.forEach((text) => {
3116
+ const option = targetFieldOptions.find((option) => option.text === text);
3117
+ option ? existOptionIds.push(option._id) : newOptions.push({ text });
3118
+ });
3119
+ }
3120
+ const isMultiple = targetField.settings?.is_multiple;
3121
+ if (isMultiple) {
3122
+ return { existOptionIds, newOptions };
3123
+ }
3124
+ else {
3125
+ if (existOptionIds.length) {
3126
+ return { existOptionIds: [existOptionIds[0]], newOptions: [] };
3127
+ }
3128
+ else {
3129
+ if (newOptions.length) {
3130
+ return { existOptionIds: [], newOptions: [newOptions[0]] };
3131
+ }
3132
+ else {
3133
+ return { existOptionIds: [], newOptions: [] };
3134
+ }
3135
+ }
3136
+ }
2873
3137
  }
2874
3138
  function cellValueToSortValue$1(cellValue, field) {
2875
3139
  if (!cellValue) {
@@ -2900,37 +3164,535 @@ class TextField extends Field {
2900
3164
  default:
2901
3165
  return super.isMeetFilter(condition, cellValue);
2902
3166
  }
2903
- }
2904
- compare(cellValue1, cellValue2) {
2905
- const value1 = cellValueToSortValue(cellValue1);
2906
- const value2 = cellValueToSortValue(cellValue2);
2907
- return compareString(value1, value2);
2908
- }
2909
- }
2910
- function cellValueToSortValue(cellValue) {
2911
- return (cellValue && cellValue.trim()) || null;
2912
- }
2913
-
2914
- const ViewOperationMap = {
2915
- [AITableFieldType.text]: new TextField(),
2916
- [AITableFieldType.richText]: new TextField(),
2917
- [AITableFieldType.select]: new SelectField(),
2918
- [AITableFieldType.date]: new DateField(),
2919
- [AITableFieldType.createdAt]: new DateField(),
2920
- [AITableFieldType.updatedAt]: new DateField(),
2921
- [AITableFieldType.number]: new NumberField(),
2922
- [AITableFieldType.rate]: new RateField(),
2923
- [AITableFieldType.link]: new LinkField(),
2924
- [AITableFieldType.member]: new MemberField(),
2925
- [AITableFieldType.progress]: new ProgressField(),
2926
- [AITableFieldType.createdBy]: new MemberField(),
2927
- [AITableFieldType.updatedBy]: new MemberField()
3167
+ }
3168
+ compare(cellValue1, cellValue2) {
3169
+ const value1 = cellValueToSortValue(cellValue1);
3170
+ const value2 = cellValueToSortValue(cellValue2);
3171
+ return compareString(value1, value2);
3172
+ }
3173
+ toFieldValue(plainText) {
3174
+ return toTextFieldValue(plainText);
3175
+ }
3176
+ }
3177
+ function toTextFieldValue(plainText) {
3178
+ return plainText.trim();
3179
+ }
3180
+ function cellValueToSortValue(cellValue) {
3181
+ return (cellValue && cellValue.trim()) || null;
3182
+ }
3183
+
3184
+ const FieldModelMap = {
3185
+ [AITableFieldType.text]: new TextField(),
3186
+ [AITableFieldType.richText]: new TextField(),
3187
+ [AITableFieldType.select]: new SelectField(),
3188
+ [AITableFieldType.date]: new DateField(),
3189
+ [AITableFieldType.createdAt]: new DateField(),
3190
+ [AITableFieldType.updatedAt]: new DateField(),
3191
+ [AITableFieldType.number]: new NumberField(),
3192
+ [AITableFieldType.rate]: new RateField(),
3193
+ [AITableFieldType.link]: new LinkField(),
3194
+ [AITableFieldType.member]: new MemberField(),
3195
+ [AITableFieldType.progress]: new ProgressField(),
3196
+ [AITableFieldType.createdBy]: new MemberField(),
3197
+ [AITableFieldType.updatedBy]: new MemberField(),
3198
+ [AITableFieldType.attachment]: new AttachmentField()
3199
+ };
3200
+
3201
+ const aiTableFragmentAttribute = 'ai-table-fragment';
3202
+ const buildClipboardData = (aiTable) => {
3203
+ const copiedCells = Array.from(aiTable.selection().selectedCells);
3204
+ if (!copiedCells.length) {
3205
+ return null;
3206
+ }
3207
+ let copiedFieldIds = new Set();
3208
+ let copiedRecordIds = new Set();
3209
+ copiedCells.forEach((cellPath) => {
3210
+ const [recordId, fieldId] = cellPath.split(':');
3211
+ copiedFieldIds.add(fieldId);
3212
+ copiedRecordIds.add(recordId);
3213
+ });
3214
+ const fieldIds = Array.from(copiedFieldIds);
3215
+ const recordIds = Array.from(copiedRecordIds);
3216
+ const aiTableContent = buildAITableContent(aiTable, fieldIds, recordIds);
3217
+ const clipboardContent = buildClipboardContent(aiTable, fieldIds, recordIds);
3218
+ return mergeClipboardContent(clipboardContent, aiTableContent);
3219
+ };
3220
+ const encodeAITableContent = (aiTableContent) => {
3221
+ const stringifiedData = JSON.stringify(aiTableContent);
3222
+ return window.btoa(encodeURIComponent(stringifiedData));
3223
+ };
3224
+ function mergeClipboardContent(clipboardContent, aiTableContent) {
3225
+ const encodedAITableContent = encodeAITableContent(aiTableContent);
3226
+ const formattedContent = {
3227
+ text: clipboardContent.map((row) => row.map((column) => column.text).join('\t')).join('\n'),
3228
+ html: `<table ${aiTableFragmentAttribute}="${encodedAITableContent}">${clipboardContent.map((row) => `<tr>${row.map((column) => `<td>${column.html}</td>`).join('')}</tr>`).join('')}</table>`
3229
+ };
3230
+ return formattedContent;
3231
+ }
3232
+ function buildAITableContent(aiTable, fieldIds, recordIds) {
3233
+ const fields = fieldIds.map((fieldId) => {
3234
+ return aiTable.fieldsMap()[fieldId];
3235
+ });
3236
+ const records = recordIds.map((recordId) => {
3237
+ const record = aiTable.recordsMap()[recordId];
3238
+ let newRecord = {
3239
+ _id: record._id,
3240
+ values: {}
3241
+ };
3242
+ fieldIds.forEach((fieldId) => {
3243
+ const field = aiTable.fieldsMap()[fieldId];
3244
+ if (isSystemField(field)) {
3245
+ const fieldType = field.type;
3246
+ newRecord = {
3247
+ ...newRecord,
3248
+ [fieldType]: getSystemFieldValue(record, fieldType)
3249
+ };
3250
+ }
3251
+ else {
3252
+ newRecord.values = {
3253
+ ...newRecord.values,
3254
+ [fieldId]: getFieldValue(record, field)
3255
+ };
3256
+ }
3257
+ });
3258
+ return newRecord;
3259
+ });
3260
+ return {
3261
+ fields,
3262
+ records
3263
+ };
3264
+ }
3265
+ function buildClipboardContent(aiTable, fieldIds, recordIds) {
3266
+ const clipboardContent = [];
3267
+ const references = aiTable.context.references();
3268
+ recordIds.forEach((recordId) => {
3269
+ const record = aiTable.recordsMap()[recordId];
3270
+ const row = [];
3271
+ fieldIds.forEach((fieldId) => {
3272
+ const field = aiTable.fieldsMap()[fieldId];
3273
+ const cellValue = getFieldValue(record, field);
3274
+ const transformValue = transformCellValue(aiTable, field, cellValue);
3275
+ const cellTexts = FieldModelMap[field.type].cellFullText(transformValue, field, references);
3276
+ let cellContent = {
3277
+ text: cellTexts.join(','),
3278
+ html: cellTexts.join(',')
3279
+ };
3280
+ if (field.type === AITableFieldType.link && cellValue && cellValue.url) {
3281
+ cellContent.html = `<a href="${cellValue.url}" target="_blank">${cellValue.text}</a>`;
3282
+ }
3283
+ row.push(cellContent);
3284
+ });
3285
+ clipboardContent.push(row);
3286
+ });
3287
+ return clipboardContent;
3288
+ }
3289
+
3290
+ const aiTableAttributePattern = new RegExp(`${aiTableFragmentAttribute}="(.+?)"`, 'm');
3291
+ const decodeClipboardJsonData = (encoded) => {
3292
+ const decoded = decodeURIComponent(window.atob(encoded));
3293
+ return JSON.parse(decoded);
3294
+ };
3295
+ function extractContentFromClipboardText(clipboardText) {
3296
+ const contents = clipboardText
3297
+ .split('\n')
3298
+ .map((row) => row.split('\t'))
3299
+ .filter((row) => row.length > 0 && row.some((cell) => cell.trim().length > 0));
3300
+ return contents;
3301
+ }
3302
+ function extractContentFromClipboardHtml(clipboardHtml) {
3303
+ const tablePattern = /<table[^>]*>([\s\S]*?)<\/table>/i;
3304
+ const trPattern = /<tr[^>]*>([\s\S]*?)<\/tr>/gi;
3305
+ const cellPattern = /<td[^>]*>([\s\S]*?)<\/td>/gi;
3306
+ const contents = [];
3307
+ try {
3308
+ const tableMatch = clipboardHtml.match(tablePattern);
3309
+ const tableContent = tableMatch ? tableMatch[1] : clipboardHtml;
3310
+ const rows = tableContent.match(trPattern) || [];
3311
+ rows.forEach((row) => {
3312
+ const rowContent = [];
3313
+ const cells = row.match(cellPattern) || [];
3314
+ cells.forEach((cell) => {
3315
+ const content = cell.replace(/<td>|<\/td>/g, '').trim();
3316
+ rowContent.push(content);
3317
+ });
3318
+ contents.push(rowContent);
3319
+ });
3320
+ return contents;
3321
+ }
3322
+ catch (error) {
3323
+ return [];
3324
+ }
3325
+ }
3326
+ function extractAITableContentFromClipboardHtml(clipboardHtml) {
3327
+ const aiTableFragment = clipboardHtml.match(aiTableAttributePattern);
3328
+ if (aiTableFragment && !!aiTableFragment.length) {
3329
+ return decodeClipboardJsonData(aiTableFragment[1]);
3330
+ }
3331
+ return null;
3332
+ }
3333
+ const readClipboardData = async () => {
3334
+ const clipboardData = await readFromClipboard();
3335
+ let clipboardContent = [];
3336
+ let aiTableContent = null;
3337
+ if (clipboardData) {
3338
+ const clipboardHtml = clipboardData.html;
3339
+ const clipboardText = clipboardData.text;
3340
+ if (clipboardHtml) {
3341
+ aiTableContent = extractAITableContentFromClipboardHtml(clipboardHtml);
3342
+ clipboardContent = extractContentFromClipboardHtml(clipboardHtml);
3343
+ }
3344
+ if (!clipboardContent.length && clipboardText) {
3345
+ clipboardContent = extractContentFromClipboardText(clipboardText);
3346
+ }
3347
+ }
3348
+ return {
3349
+ clipboardContent,
3350
+ aiTableContent
3351
+ };
3352
+ };
3353
+ function getPasteValue(plainText, aiTableContent, recordIndex, fieldIndex, targetField, references) {
3354
+ let field = null;
3355
+ let record = null;
3356
+ if (aiTableContent) {
3357
+ const { fields, records } = aiTableContent;
3358
+ field = fields[fieldIndex];
3359
+ record = records[recordIndex];
3360
+ }
3361
+ if (targetField.type === AITableFieldType.attachment || (field && field.type === AITableFieldType.attachment)) {
3362
+ return { value: null, newField: null };
3363
+ }
3364
+ if (targetField.type !== AITableFieldType.link) {
3365
+ plainText = extractText(plainText);
3366
+ }
3367
+ let originData = field && record ? { field, cellValue: getFieldValue(record, field) } : null;
3368
+ if (targetField.type === AITableFieldType.select) {
3369
+ let { existOptionIds, newOptions } = processPastedValueForSelect(plainText, targetField, originData);
3370
+ let newField = null;
3371
+ let newOptionIds = [];
3372
+ if (newOptions.length) {
3373
+ newOptions = newOptions.map((option) => {
3374
+ return {
3375
+ ...option,
3376
+ _id: idCreator()
3377
+ };
3378
+ });
3379
+ newField = {
3380
+ ...targetField,
3381
+ settings: {
3382
+ ...targetField.settings,
3383
+ options: [...(targetField.settings?.options || []), ...newOptions]
3384
+ }
3385
+ };
3386
+ newOptionIds = newOptions.map((option) => option._id).filter((id) => !!id);
3387
+ }
3388
+ const selectFieldValue = newOptionIds?.length ? [...existOptionIds, ...newOptionIds] : existOptionIds;
3389
+ return {
3390
+ value: selectFieldValue,
3391
+ newField
3392
+ };
3393
+ }
3394
+ return { value: FieldModelMap[targetField.type].toFieldValue(plainText, targetField, originData, references), newField: null };
3395
+ }
3396
+ function appendRecord(aiTable, actions) {
3397
+ const allRecords = aiTable.records();
3398
+ const lastRecordId = allRecords.length > 0 ? allRecords[allRecords.length - 1]._id : '';
3399
+ actions.addRecord({
3400
+ originId: lastRecordId
3401
+ });
3402
+ }
3403
+ function appendField(aiTable, originField, actions) {
3404
+ const lastFieldId = aiTable.fields().length > 0 ? aiTable.fields()[aiTable.fields().length - 1]._id : '';
3405
+ let defaultFieldValue;
3406
+ if (originField) {
3407
+ defaultFieldValue = {
3408
+ ...originField,
3409
+ name: createDefaultFieldName(aiTable, FieldOptions.find((item) => item.type === originField.type)),
3410
+ _id: idCreator()
3411
+ };
3412
+ }
3413
+ else {
3414
+ defaultFieldValue = createDefaultField(aiTable, AITableFieldType.text);
3415
+ }
3416
+ actions.addField({
3417
+ originId: lastFieldId,
3418
+ defaultValue: defaultFieldValue
3419
+ });
3420
+ }
3421
+ const writeToAITable = async (aiTable, actions) => {
3422
+ const selectedCells = Array.from(aiTable.selection().selectedCells);
3423
+ if (!selectedCells.length) {
3424
+ return;
3425
+ }
3426
+ const { clipboardContent, aiTableContent } = await readClipboardData();
3427
+ if (!clipboardContent.length) {
3428
+ return;
3429
+ }
3430
+ const [firstCell] = selectedCells;
3431
+ const [startRecordId, startFieldId] = firstCell.split(':');
3432
+ const startRowIndex = aiTable.context.visibleRowsIndexMap().get(startRecordId) ?? 0;
3433
+ const startColIndex = aiTable.context.visibleColumnsIndexMap().get(startFieldId) ?? 0;
3434
+ const references = aiTable.context.references();
3435
+ let isPasteSuccess = false;
3436
+ clipboardContent.forEach((row, i) => {
3437
+ const targetRowIndex = startRowIndex + i;
3438
+ if (targetRowIndex >= aiTable.context.linearRows().length - 1) {
3439
+ appendRecord(aiTable, actions);
3440
+ }
3441
+ row.forEach((plainText, j) => {
3442
+ const targetColIndex = startColIndex + j;
3443
+ if (targetColIndex >= AITable.getVisibleFields(aiTable).length) {
3444
+ const originField = aiTableContent?.fields[j] || null;
3445
+ appendField(aiTable, originField, actions);
3446
+ }
3447
+ const targetRecord = aiTable.context.linearRows()[targetRowIndex];
3448
+ const targetField = AITable.getVisibleFields(aiTable)[targetColIndex];
3449
+ const recordIndex = i;
3450
+ const fieldIndex = j;
3451
+ const { value, newField } = getPasteValue(plainText, aiTableContent, recordIndex, fieldIndex, targetField, references);
3452
+ if (newField) {
3453
+ actions.setField(newField);
3454
+ }
3455
+ if (value !== null) {
3456
+ try {
3457
+ actions.updateFieldValue({
3458
+ value,
3459
+ path: [targetRecord._id, targetField._id]
3460
+ });
3461
+ isPasteSuccess = true;
3462
+ }
3463
+ catch (error) { }
3464
+ }
3465
+ });
3466
+ });
3467
+ return isPasteSuccess;
3468
+ };
3469
+
3470
+ const getVisibleRangeInfo = (coordinate, scrollState) => {
3471
+ const { scrollTop, scrollLeft } = scrollState;
3472
+ const { rowCount, columnCount, frozenColumnCount } = coordinate;
3473
+ // 获取要渲染的垂直可见区域
3474
+ const getVerticalRangeInfo = () => {
3475
+ const startIndex = coordinate.getRowStartIndex(scrollTop);
3476
+ const stopIndex = coordinate.getRowStopIndex(startIndex, scrollTop);
3477
+ return {
3478
+ rowStartIndex: Math.max(0, startIndex - 1),
3479
+ rowStopIndex: Math.max(0, Math.min(rowCount - 1, stopIndex + 1))
3480
+ };
3481
+ };
3482
+ // 获取要渲染的水平可见区域
3483
+ const getHorizontalRangeInfo = () => {
3484
+ const startIndex = coordinate.getColumnStartIndex(scrollLeft);
3485
+ const stopIndex = coordinate.getColumnStopIndex(startIndex, scrollLeft);
3486
+ return {
3487
+ columnStartIndex: Math.max(frozenColumnCount - 1, startIndex),
3488
+ columnStopIndex: Math.max(frozenColumnCount - 1, Math.min(columnCount - 1, stopIndex))
3489
+ };
3490
+ };
3491
+ const { rowStartIndex, rowStopIndex } = getVerticalRangeInfo();
3492
+ const { columnStartIndex, columnStopIndex } = getHorizontalRangeInfo();
3493
+ return {
3494
+ rowStartIndex,
3495
+ rowStopIndex,
3496
+ columnStartIndex,
3497
+ columnStopIndex
3498
+ };
3499
+ };
3500
+ const scrollMax = (coordinate, visibleColumns) => {
3501
+ const scrollMaxWidth = visibleColumns.reduce((pre, cur) => pre + getFieldOptionByField(cur)?.width, AI_TABLE_ROW_HEAD_WIDTH);
3502
+ const scrollMaxHeight = coordinate.getRowOffset(coordinate.rowCount - 1) + 32;
3503
+ return { scrollMaxWidth, scrollMaxHeight };
3504
+ };
3505
+
3506
+ const getMousePosition = (x, y, coordinate, fields, context, _targetName) => {
3507
+ const { scrollTop, scrollLeft } = context.scrollState();
3508
+ const { scrollMaxWidth, scrollMaxHeight } = scrollMax(coordinate, fields);
3509
+ const offsetTop = scrollTop + y;
3510
+ const rowIndex = coordinate.getRowStartIndex(offsetTop);
3511
+ const offsetLeft = isWithinFrozenColumnBoundary(x, coordinate.frozenColumnWidth) ? x : scrollLeft + x;
3512
+ const columnIndex = coordinate.getColumnStartIndex(offsetLeft);
3513
+ const areaType = offsetLeft <= scrollMaxWidth && offsetTop <= scrollMaxHeight ? AITableAreaType.grid : AITableAreaType.none;
3514
+ const targetName = getTargetName(_targetName);
3515
+ return {
3516
+ areaType,
3517
+ targetName, // As a simple operational identifier, with prefix name only
3518
+ realTargetName: _targetName || AI_TABLE_BLANK, // Real name
3519
+ rowIndex,
3520
+ columnIndex,
3521
+ offsetTop,
3522
+ offsetLeft,
3523
+ x,
3524
+ y
3525
+ };
3526
+ };
3527
+ const isWithinFrozenColumnBoundary = (x, frozenColumnWidth) => {
3528
+ const max = AI_TABLE_ROW_HEAD_WIDTH + frozenColumnWidth;
3529
+ const min = AI_TABLE_ROW_HEAD_WIDTH;
3530
+ return x > min && x < max;
3531
+ };
3532
+ const getEditorSpace = (widthOrHeight) => {
3533
+ return widthOrHeight + AI_TABLE_OFFSET * 2;
3534
+ };
3535
+ const getEditorBoxOffset = () => {
3536
+ return -AI_TABLE_OFFSET;
3537
+ };
3538
+ const getCellEditorBorderSpace = () => {
3539
+ return AI_TABLE_CELL_ACTIVE_BORDER_WIDTH * 2 - AI_TABLE_OFFSET * 2;
3540
+ };
3541
+ const getHoverEditorSpace = (widthOrHeight) => {
3542
+ const borderSpace = getCellEditorBorderSpace();
3543
+ return widthOrHeight - borderSpace;
3544
+ };
3545
+ const getHoverEditorBoxOffset = () => {
3546
+ const borderSpace = getCellEditorBorderSpace();
3547
+ return borderSpace / 2;
3548
+ };
3549
+
3550
+ const handleMouseStyle = (realTargetName, areaType = AITableAreaType.grid, container) => {
3551
+ const { targetName, mouseStyle } = getDetailByTargetName(realTargetName);
3552
+ if (mouseStyle)
3553
+ return setMouseStyle(mouseStyle, container);
3554
+ if (areaType === AITableAreaType.none)
3555
+ return setMouseStyle('default', container);
3556
+ switch (targetName) {
3557
+ case AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX:
3558
+ case AI_TABLE_FIELD_HEAD_MORE:
3559
+ case AI_TABLE_ROW_SELECT_CHECKBOX:
3560
+ case AI_TABLE_ROW_ADD_BUTTON:
3561
+ case AI_TABLE_FIELD_ADD_BUTTON: {
3562
+ return setMouseStyle('pointer', container);
3563
+ }
3564
+ default:
3565
+ return setMouseStyle('default', container);
3566
+ }
3567
+ };
3568
+ const setMouseStyle = (mouseStyle, container) => {
3569
+ container.style.cursor = mouseStyle;
3570
+ };
3571
+
3572
+ /**
3573
+ * 在 Canvas 上测量文本的宽度和高度,以便在显示文本时能够动态调整布局或限制文本的显示区域
3574
+ * @param defaults
3575
+ * @returns
3576
+ */
3577
+ const TextMeasure = (defaults = {}) => {
3578
+ const { fontFamily = DEFAULT_FONT_FAMILY, fontSize = DEFAULT_FONT_SIZE, fontWeight = DEFAULT_FONT_WEIGHT, fontStyle = DEFAULT_FONT_STYLE, lineHeight = DEFAULT_TEXT_LINE_HEIGHT, scale = DEFAULT_TEXT_SCALE } = defaults;
3579
+ const o = {
3580
+ fontFamily,
3581
+ fontSize,
3582
+ fontWeight,
3583
+ fontStyle,
3584
+ lineHeight,
3585
+ scale
3586
+ };
3587
+ const canvas = document.createElement('canvas');
3588
+ const context = canvas ? canvas.getContext('2d') : null;
3589
+ const normalizeFontFamily = (fontFamily) => {
3590
+ return fontFamily
3591
+ .split(',')
3592
+ .map((family) => {
3593
+ family = family.trim();
3594
+ const hasSpace = family.indexOf(' ') >= 0;
3595
+ const hasQuotes = family.indexOf('"') >= 0 || family.indexOf("'") >= 0;
3596
+ if (hasSpace && !hasQuotes) {
3597
+ family = `"${family}"`;
3598
+ }
3599
+ return family;
3600
+ })
3601
+ .join(', ');
3602
+ };
3603
+ // 可以在运行时动态调整字体样式,从而影响后续的文本测量
3604
+ const setFont = (options = {}) => {
3605
+ for (const key in options) {
3606
+ o[key] = options[key] ?? o[key];
3607
+ }
3608
+ if (context) {
3609
+ context.font = `${o.fontWeight} ${o.fontSize * o.scale}px ${normalizeFontFamily(o.fontFamily)}`;
3610
+ }
3611
+ };
3612
+ // 根据指定的最大宽度和行数来计算文本的显示方式。如果文本太长,它会自动换行或截断,并返回是否发生溢出的信息
3613
+ const getWidthOfLongestText = (text, maxWidth, maxLineCount) => {
3614
+ let width = 0;
3615
+ let height = 0;
3616
+ let lineCount = 0;
3617
+ if (text == null) {
3618
+ return { width, height, lastLineWidth: 0 };
3619
+ }
3620
+ const lines = text.split('\n');
3621
+ for (let i = 0; i < lines.length; i++) {
3622
+ const line = lines[i];
3623
+ const lineWidth = context?.measureText(line).width ?? 0;
3624
+ width = Math.max(width, lineWidth);
3625
+ lineCount = maxWidth != null ? Math.ceil(lineWidth / maxWidth) || 1 : 1;
3626
+ height += o.lineHeight * lineCount;
3627
+ }
3628
+ if (maxWidth == null || maxLineCount === 1 || (maxLineCount && lineCount <= maxLineCount)) {
3629
+ return {
3630
+ width: Math.ceil(width),
3631
+ height: Math.ceil(height),
3632
+ text,
3633
+ isOverflow: Boolean(maxLineCount && lineCount > maxLineCount),
3634
+ lastLineWidth: Math.ceil(width)
3635
+ };
3636
+ }
3637
+ const arrText = text.split('');
3638
+ let rowCount = 0; // 总行数
3639
+ let textHeight = 0; // 文本最终占用的高度
3640
+ let showText = ''; // 每行展示的文本
3641
+ let totalText = '';
3642
+ let isLimitRow = false;
3643
+ const textLength = arrText.length;
3644
+ for (let n = 0; n < textLength; n++) {
3645
+ const singleText = arrText[n];
3646
+ const composeText = showText + singleText;
3647
+ // 如果没有超过 maxLineCount,就会继续换行
3648
+ isLimitRow = maxLineCount ? rowCount === maxLineCount - 1 : false;
3649
+ const measureText = isLimitRow ? composeText + '…' : composeText;
3650
+ totalText += singleText;
3651
+ const textWidth = context?.measureText(measureText).width ?? 0;
3652
+ const isLineBreak = ['\n', '\r'].includes(singleText);
3653
+ if (((maxWidth && textWidth > maxWidth) || isLineBreak) && (maxLineCount == null || rowCount < maxLineCount)) {
3654
+ showText = isLineBreak ? '' : singleText;
3655
+ textHeight += lineHeight;
3656
+ rowCount++;
3657
+ if (isLimitRow) {
3658
+ if (n < textLength - 1) {
3659
+ totalText = totalText.substring(0, totalText.length - 1) + '…';
3660
+ }
3661
+ break;
3662
+ }
3663
+ }
3664
+ else {
3665
+ showText = composeText;
3666
+ }
3667
+ }
3668
+ return {
3669
+ width: Math.ceil(width),
3670
+ height: Math.ceil(maxLineCount == null || rowCount < maxLineCount ? textHeight + lineHeight : textHeight),
3671
+ text: totalText,
3672
+ isOverflow: isLimitRow,
3673
+ lastLineWidth: context?.measureText(showText).width ?? 0
3674
+ };
3675
+ };
3676
+ // 测量给定文本的宽度和高度。
3677
+ // 支持指定最大宽度 (maxWidth) 和最大行数 (maxLineCount),从而能够处理多行文本的自动换行和截断(例如在文本超过行数限制时添加省略号 "…")
3678
+ const measureText = (text, maxWidth, maxLineCount) => {
3679
+ return getWidthOfLongestText(castToString(text), maxWidth, maxLineCount);
3680
+ };
3681
+ // 可以将字体样式重置为初始默认配置
3682
+ const reset = () => setFont(defaults);
3683
+ setFont(o);
3684
+ return {
3685
+ context,
3686
+ measureText,
3687
+ setFont,
3688
+ reset
3689
+ };
2928
3690
  };
2929
3691
 
2930
3692
  const isCellMatchKeywords = (aiTable, field, recordId, keywords, references) => {
2931
3693
  const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
2932
3694
  const transformValue = transformCellValue(aiTable, field, cellValue);
2933
- const fieldMethod = ViewOperationMap[field.type];
3695
+ const fieldMethod = FieldModelMap[field.type];
2934
3696
  let cellFullText = fieldMethod.cellFullText(transformValue, field, references);
2935
3697
  return keywords && cellFullText.length && cellFullText.some((text) => text.toLowerCase().includes(keywords.toLowerCase()));
2936
3698
  };
@@ -3629,11 +4391,20 @@ class Drawer {
3629
4391
  fill: colors.gray600
3630
4392
  });
3631
4393
  }
4394
+ else {
4395
+ imageCache.imageMapOnload(() => {
4396
+ this.image(options, crossOrigin, allowDefault);
4397
+ });
4398
+ }
3632
4399
  return;
3633
4400
  }
3634
4401
  // Unloaded
3635
4402
  if (image == null) {
3636
- return imageCache.loadImage(url, url, { crossOrigin });
4403
+ imageCache.loadImage(url, url, { crossOrigin });
4404
+ imageCache.imageMapOnload(() => {
4405
+ this.image(options, crossOrigin, allowDefault);
4406
+ });
4407
+ return;
3637
4408
  }
3638
4409
  const isOrigin = opacity === 1;
3639
4410
  if (!clipFunc && isOrigin) {
@@ -4374,15 +5145,21 @@ class AITableGridEventService {
4374
5145
  getEditorComponent(type) {
4375
5146
  const filedRenderSchema = this.aiFieldRenderers && this.aiFieldRenderers[type];
4376
5147
  if (filedRenderSchema && filedRenderSchema.editor) {
4377
- return filedRenderSchema.editor;
5148
+ return {
5149
+ component: filedRenderSchema.editor,
5150
+ isInternalComponent: false
5151
+ };
4378
5152
  }
4379
- return GRID_CELL_EDITOR_MAP[type];
5153
+ return {
5154
+ component: GRID_CELL_EDITOR_MAP[type],
5155
+ isInternalComponent: true
5156
+ };
4380
5157
  }
4381
5158
  openEdit(cellDom) {
4382
5159
  const { x, y, width, height } = cellDom.getBoundingClientRect();
4383
5160
  const fieldId = cellDom.getAttribute('fieldId');
4384
5161
  const recordId = cellDom.getAttribute('recordId');
4385
- const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
5162
+ const { component } = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
4386
5163
  const ref = this.thyPopover.open(component, {
4387
5164
  origin: cellDom,
4388
5165
  originPosition: {
@@ -4455,9 +5232,10 @@ class AITableGridEventService {
4455
5232
  }
4456
5233
  openCellEditor(aiTable, options) {
4457
5234
  const { container, recordId, fieldId, isHoverEdit, references } = options;
4458
- const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
5235
+ const { component, isInternalComponent } = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
4459
5236
  const offsetOriginPosition = this.getOriginPosition(aiTable, options);
4460
5237
  this.cellEditorPopoverRef = this.thyPopover.open(component, {
5238
+ viewContainerRef: isInternalComponent ? undefined : options?.viewContainerRef,
4461
5239
  origin: container,
4462
5240
  originPosition: offsetOriginPosition,
4463
5241
  width: offsetOriginPosition.width + 'px',
@@ -4572,7 +5350,9 @@ class AITableGridBase {
4572
5350
  this.aiTableInitialized = output();
4573
5351
  this.aiAddRecord = output();
4574
5352
  this.aiAddField = output();
5353
+ this.aiMoveField = output();
4575
5354
  this.aiUpdateFieldValue = output();
5355
+ this.aiSetField = output();
4576
5356
  this.fieldMenus = computed(() => {
4577
5357
  return this.aiFieldConfig()?.fieldMenus || [];
4578
5358
  });
@@ -4597,7 +5377,7 @@ class AITableGridBase {
4597
5377
  this.initService();
4598
5378
  }
4599
5379
  initAITable() {
4600
- this.aiTable = createAITable(this.aiRecords, this.aiFields);
5380
+ this.aiTable = createAITable(this.aiRecords, this.aiFields, this.gridData);
4601
5381
  this.aiPlugins()?.forEach((plugin) => {
4602
5382
  this.aiTable = plugin(this.aiTable);
4603
5383
  });
@@ -4687,7 +5467,7 @@ class AITableGridBase {
4687
5467
  }
4688
5468
  }
4689
5469
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4690
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableGridBase, isStandalone: true, selector: "ai-table-grid-base", inputs: { aiRecords: { classPropertyName: "aiRecords", publicName: "aiRecords", isSignal: true, isRequired: true, transformFunction: null }, aiFields: { classPropertyName: "aiFields", publicName: "aiFields", isSignal: true, isRequired: true, transformFunction: null }, aiContextMenuItems: { classPropertyName: "aiContextMenuItems", publicName: "aiContextMenuItems", isSignal: true, isRequired: false, transformFunction: null }, aiFieldConfig: { classPropertyName: "aiFieldConfig", publicName: "aiFieldConfig", isSignal: true, isRequired: false, transformFunction: null }, aiReadonly: { classPropertyName: "aiReadonly", publicName: "aiReadonly", isSignal: true, isRequired: false, transformFunction: null }, aiPlugins: { classPropertyName: "aiPlugins", publicName: "aiPlugins", isSignal: true, isRequired: false, transformFunction: null }, aiReferences: { classPropertyName: "aiReferences", publicName: "aiReferences", isSignal: true, isRequired: true, transformFunction: null }, aiBuildRenderDataFn: { classPropertyName: "aiBuildRenderDataFn", publicName: "aiBuildRenderDataFn", isSignal: true, isRequired: false, transformFunction: null }, aiKeywords: { classPropertyName: "aiKeywords", publicName: "aiKeywords", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiRecords: "aiRecordsChange", aiFields: "aiFieldsChange", aiTableInitialized: "aiTableInitialized", aiAddRecord: "aiAddRecord", aiAddField: "aiAddField", aiUpdateFieldValue: "aiUpdateFieldValue" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5470
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AITableGridBase, isStandalone: true, selector: "ai-table-grid-base", inputs: { aiRecords: { classPropertyName: "aiRecords", publicName: "aiRecords", isSignal: true, isRequired: true, transformFunction: null }, aiFields: { classPropertyName: "aiFields", publicName: "aiFields", isSignal: true, isRequired: true, transformFunction: null }, aiContextMenuItems: { classPropertyName: "aiContextMenuItems", publicName: "aiContextMenuItems", isSignal: true, isRequired: false, transformFunction: null }, aiFieldConfig: { classPropertyName: "aiFieldConfig", publicName: "aiFieldConfig", isSignal: true, isRequired: false, transformFunction: null }, aiReadonly: { classPropertyName: "aiReadonly", publicName: "aiReadonly", isSignal: true, isRequired: false, transformFunction: null }, aiPlugins: { classPropertyName: "aiPlugins", publicName: "aiPlugins", isSignal: true, isRequired: false, transformFunction: null }, aiReferences: { classPropertyName: "aiReferences", publicName: "aiReferences", isSignal: true, isRequired: true, transformFunction: null }, aiBuildRenderDataFn: { classPropertyName: "aiBuildRenderDataFn", publicName: "aiBuildRenderDataFn", isSignal: true, isRequired: false, transformFunction: null }, aiKeywords: { classPropertyName: "aiKeywords", publicName: "aiKeywords", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aiRecords: "aiRecordsChange", aiFields: "aiFieldsChange", aiTableInitialized: "aiTableInitialized", aiAddRecord: "aiAddRecord", aiAddField: "aiAddField", aiMoveField: "aiMoveField", aiUpdateFieldValue: "aiUpdateFieldValue", aiSetField: "aiSetField" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4691
5471
  }
4692
5472
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, decorators: [{
4693
5473
  type: Component,
@@ -5204,6 +5984,636 @@ class AddRowLayout extends Layout {
5204
5984
  }
5205
5985
  const addRowLayout = new AddRowLayout();
5206
5986
 
5987
+ // 自动生成的图标常量文件
5988
+ const apk = `<?xml version="1.0" encoding="UTF-8"?>
5989
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
5990
+ <title>1.Base基础/1.icon图标/12.文件类型/APK</title>
5991
+ <g id="1.Base基础/1.icon图标/12.文件类型/APK" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5992
+ <g id="APK" transform="translate(2.000000, 0.000000)">
5993
+ <path d="M14.1176471,0 L2.74128887,0 C1.22731689,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.22731689,24 2.74128887,24 L17.2587111,24 C18.7726831,24 20,22.765548 20,21.2427744 L20,6 C20,6 14.1176471,0 14.1176471,0 Z" id="路径" fill="#78B354"></path>
5994
+ <path d="M12.4981525,12.5063279 L13.3031073,11.0370821 C13.3468152,10.9603305 13.3176766,10.8616498 13.2393665,10.8196191 C13.1628776,10.7775885 13.0645347,10.8049998 13.0226479,10.8835788 L12.2085874,12.367444 C11.5256507,12.0640922 10.7607616,11.8941421 9.95216453,11.8941421 C9.14356748,11.8941421 8.37867837,12.0640922 7.69574167,12.3656165 L6.88168113,10.8835788 C6.83979434,10.8049998 6.74145146,10.7775885 6.66496255,10.8196191 C6.58665247,10.8616498 6.55751384,10.9603305 6.60122179,11.0370821 L7.40617651,12.5063279 C5.8254057,13.3250121 4.75638212,14.881974 4.75638212,16.6673635 L15.1461281,16.6673635 C15.1479469,14.8801466 14.0789234,13.3250121 12.4981525,12.5063279 Z M7.58829297,14.7832933 C7.34789925,14.7832933 7.15303464,14.5877594 7.15303464,14.3465399 C7.15303464,14.1053205 7.34789925,13.9097865 7.58829297,13.9097865 C7.82868668,13.9097865 8.02355129,14.1053205 8.02355129,14.3465399 C8.02173013,14.5877594 7.82686552,14.7832933 7.58829297,14.7832933 Z M12.3178573,14.7832933 C12.0774635,14.7832933 11.8825989,14.5877594 11.8825989,14.3465399 C11.8825989,14.1053205 12.0774635,13.9097865 12.3178573,13.9097865 C12.558251,13.9097865 12.7531156,14.1053205 12.7531156,14.3465399 C12.7512944,14.5877594 12.5564298,14.7832933 12.3178573,14.7832933 Z" id="形状" fill="#FFFFFF" fill-rule="nonzero"></path>
5995
+ <path d="M14.1176471,0 L20,6 L15.3176471,6 C14.6549054,6 14.1176471,5.4627417 14.1176471,4.8 L14.1176471,0 L14.1176471,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
5996
+ </g>
5997
+ </g>
5998
+ </svg>`;
5999
+ const bak = `<?xml version="1.0" encoding="UTF-8"?>
6000
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6001
+ <title>1.Base基础/1.icon图标/12.文件类型/BAK </title>
6002
+ <g id="1.Base基础/1.icon图标/12.文件类型/BAK-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6003
+ <g id="BAK" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6004
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#E75A71"></path>
6005
+ <path d="M5.75267634,16.8 C6.25452726,16.8 6.64412206,16.6941176 6.92146073,16.4823529 C7.24502251,16.2252101 7.41010505,15.8319328 7.41010505,15.287395 C7.41010505,14.9243697 7.33086543,14.6294118 7.17238619,14.410084 C7.01390695,14.1907563 6.77618809,14.0470588 6.46583292,13.9789916 C6.70355178,13.8806723 6.88184092,13.7294118 7.01390695,13.5327731 C7.14597299,13.3210084 7.212006,13.0638655 7.212006,12.7613445 C7.212006,12.3453782 7.08654327,12.0201681 6.83561781,11.7781513 C6.57148574,11.5210084 6.21490745,11.4 5.75267634,11.4 L3.6,11.4 L3.6,16.8 L5.75267634,16.8 Z M5.56118059,13.6915966 L4.31975988,13.6915966 L4.31975988,12.0806723 L5.57438719,12.0806723 C5.89134567,12.0806723 6.12906453,12.1411765 6.27433717,12.2697479 C6.4196098,12.3907563 6.49224612,12.587395 6.49224612,12.8596639 C6.49224612,13.1470588 6.4196098,13.3588235 6.27433717,13.494958 C6.12906453,13.6235294 5.89134567,13.6915966 5.56118059,13.6915966 Z M5.65362681,16.1193277 L4.31975988,16.1193277 L4.31975988,14.3647059 L5.67343672,14.3647059 C6.0168084,14.3647059 6.27433717,14.4327731 6.43941971,14.5764706 C6.60450225,14.7201681 6.69034517,14.9546218 6.69034517,15.2722689 C6.69034517,15.5823529 6.57808904,15.8092437 6.36678339,15.9529412 C6.19509755,16.0588235 5.95737869,16.1193277 5.65362681,16.1193277 Z M8.44022011,16.8 L8.88264132,15.4084034 L10.9098549,15.4084034 L11.3522761,16.8 L12.1248624,16.8 L10.3089545,11.4 L9.49014507,11.4 L7.67423712,16.8 L8.44022011,16.8 Z M10.691946,14.7277311 L9.10055028,14.7277311 L9.88634317,12.2848739 L9.91275638,12.2848739 L10.691946,14.7277311 Z M13.3068534,16.8 L13.3068534,14.9319328 L13.9209605,14.2588235 L15.835918,16.8 L16.8,16.8 L14.4096048,13.7218487 L16.4962481,11.4 L15.5849925,11.4 L13.3068534,14.0092437 L13.3068534,11.4 L12.5870935,11.4 L12.5870935,16.8 L13.3068534,16.8 Z" fill="#FFFFFF"></path>
6006
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6007
+ </g>
6008
+ </g>
6009
+ </svg>`;
6010
+ const bat = `<?xml version="1.0" encoding="UTF-8"?>
6011
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6012
+ <title>1.Base基础/1.icon图标/12.文件类型/BAT</title>
6013
+ <g id="1.Base基础/1.icon图标/12.文件类型/BAT" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6014
+ <g id="bat" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6015
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#378FE8"></path>
6016
+ <path d="M5.87562136,16.8 C6.40613432,16.8 6.8179799,16.6941176 7.11115812,16.4823529 C7.45319937,16.2252101 7.62771021,15.8319328 7.62771021,15.287395 C7.62771021,14.9243697 7.543945,14.6294118 7.3764146,14.410084 C7.20888419,14.1907563 6.95758858,14.0470588 6.6295082,13.9789916 C6.88080381,13.8806723 7.06927552,13.7294118 7.20888419,13.5327731 C7.34849286,13.3210084 7.4182972,13.0638655 7.4182972,12.7613445 C7.4182972,12.3453782 7.28566896,12.0201681 7.02041248,11.7781513 C6.74119513,11.5210084 6.36425172,11.4 5.87562136,11.4 L3.6,11.4 L3.6,16.8 L5.87562136,16.8 Z M5.67318879,13.6915966 L4.36086727,13.6915966 L4.36086727,12.0806723 L5.68714966,12.0806723 C6.02221047,12.0806723 6.27350608,12.1411765 6.42707562,12.2697479 C6.58064516,12.3907563 6.65742993,12.587395 6.65742993,12.8596639 C6.65742993,13.1470588 6.58064516,13.3588235 6.42707562,13.494958 C6.27350608,13.6235294 6.02221047,13.6915966 5.67318879,13.6915966 Z M5.77091486,16.1193277 L4.36086727,16.1193277 L4.36086727,14.3647059 L5.79185616,14.3647059 C6.15483871,14.3647059 6.42707562,14.4327731 6.60158646,14.5764706 C6.7760973,14.7201681 6.86684294,14.9546218 6.86684294,15.2722689 C6.86684294,15.5823529 6.74817557,15.8092437 6.52480169,15.9529412 C6.34331042,16.0588235 6.09201481,16.1193277 5.77091486,16.1193277 Z M8.71665785,16.8 L9.18434691,15.4084034 L11.32734,15.4084034 L11.7950291,16.8 L12.6117398,16.8 L10.6921206,11.4 L9.8265468,11.4 L7.90692755,16.8 L8.71665785,16.8 Z M11.0969857,14.7277311 L9.41470122,14.7277311 L10.2453728,12.2848739 L10.2732946,12.2848739 L11.0969857,14.7277311 Z M15.1386568,16.8 L15.1386568,12.1033613 L16.8,12.1033613 L16.8,11.4 L12.7164463,11.4 L12.7164463,12.1033613 L14.38477,12.1033613 L14.38477,16.8 L15.1386568,16.8 Z" id="BAT" fill="#FFFFFF"></path>
6017
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6018
+ </g>
6019
+ </g>
6020
+ </svg>`;
6021
+ const cs = `<?xml version="1.0" encoding="UTF-8"?>
6022
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6023
+ <title>1.Base基础/1.icon图标/12.文件类型/C#</title>
6024
+ <g id="1.Base基础/1.icon图标/12.文件类型/C#" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6025
+ <g id="c#" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6026
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#78B354"></path>
6027
+ <path d="M9.92568659,18 C10.3457189,17.993617 10.7592892,17.9425532 11.1663974,17.8468085 C11.4894992,17.7702128 11.7996769,17.6585106 12.0969305,17.5117021 L11.6122779,16.037234 C11.3731826,16.1585106 11.1211632,16.2446809 10.8562197,16.2957447 C10.5912763,16.3468085 10.3231018,16.3723404 10.0516963,16.3723404 C9.76736672,16.3723404 9.49596123,16.3117021 9.23747981,16.1904255 C8.96607431,16.056383 8.73021002,15.8776596 8.52988691,15.6542553 C8.12924071,15.1819149 7.93214863,14.6361702 7.93861066,14.0170213 C7.93861066,13.7234043 7.97415186,13.4329787 8.04523425,13.1457447 C8.12924071,12.8329787 8.27786753,12.5489362 8.4911147,12.293617 C8.6914378,12.0765957 8.93053312,11.9106383 9.20840065,11.7957447 C9.49919225,11.693617 9.80290792,11.6393617 10.1195477,11.6329787 C10.6558966,11.6265957 11.1793215,11.7191489 11.6898223,11.9106383 L11.7576737,10.3882979 C11.1567044,10.1393617 10.5298869,10.0117021 9.87722132,10.0053191 C9.57996769,10.0117021 9.28917609,10.0404255 9.00484653,10.0914894 C8.73344103,10.1489362 8.47172859,10.2287234 8.21970921,10.3308511 C7.72859451,10.5414894 7.30533118,10.8446809 6.94991922,11.2404255 C6.59450727,11.6617021 6.33925687,12.1340426 6.18416801,12.6574468 C6.06785137,13.1042553 6.00646204,13.5574468 6,14.0170213 C6,14.4893617 6.06138934,14.9489362 6.18416801,15.3957447 C6.26817447,15.6638298 6.37802908,15.9223404 6.51373183,16.1712766 C6.64297254,16.4010638 6.79483037,16.6148936 6.96930533,16.812766 C7.33117932,17.1957447 7.76090468,17.4893617 8.25848142,17.693617 C8.79483037,17.8978723 9.35056543,18 9.92568659,18 Z M13.1728595,12.4659574 L13.3231018,11.3601064 L14.0306947,11.3601064 L13.8707593,12.4659574 L14.1470113,12.4659574 L14.3069467,11.3601064 L14.8594507,11.3601064 L14.8594507,11.1111702 L14.3408724,11.1111702 L14.447496,10.3547872 L15,10.3547872 L15,10.1058511 L14.4814216,10.1058511 L14.641357,9 L14.365105,9 L14.2051696,10.1058511 L13.4975767,10.1058511 L13.6672052,9 L13.3909532,9 L13.2310178,10.1058511 L12.6785137,10.1058511 L12.6785137,10.3547872 L13.1970921,10.3547872 L13.0904685,11.1111702 L12.5379645,11.1111702 L12.5379645,11.3601064 L13.0565428,11.3601064 L12.8966074,12.4659574 L13.1728595,12.4659574 Z M14.0646204,11.1111702 L13.3570275,11.1111702 L13.4636511,10.3547872 L14.1712439,10.3547872 L14.0646204,11.1111702 Z" id="形状结合" fill="#FFFFFF"></path>
6028
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6029
+ </g>
6030
+ </g>
6031
+ </svg>`;
6032
+ const css = `<?xml version="1.0" encoding="UTF-8"?>
6033
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6034
+ <title>1.Base基础/1.icon图标/12.文件类型/CSS</title>
6035
+ <g id="1.Base基础/1.icon图标/12.文件类型/CSS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6036
+ <g id="css" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6037
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#53ADEF"></path>
6038
+ <polygon id="路径" fill="#FFFFFF" points="13.6581388 11.660821 10.231646 13.1830211 10.2234617 13.1863691 13.5370112 13.1863691 13.1578054 17.7139099 10.2371022 18.6 10.231646 18.598326 10.231646 18.6 7.29511973 17.6971702 7.10524401 15.41666 8.56368596 15.41666 8.6580782 16.5979275 10.2185511 17.007493 10.231646 17.0035871 10.231646 17.0052611 11.8472264 16.5326425 11.9579873 14.6298924 10.231646 14.6243125 7.01085177 14.6131527 6.90009093 13.1858111 10.231646 11.7445197 10.4258866 11.660821 6.77405273 11.660821 6.6 10.2 13.8 10.2 13.6581388 11.6602631"></polygon>
6039
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6040
+ </g>
6041
+ </g>
6042
+ </svg>`;
6043
+ const csv = `<?xml version="1.0" encoding="UTF-8"?>
6044
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6045
+ <title>1.Base基础/1.icon图标/12.文件类型/CSV</title>
6046
+ <g id="1.Base基础/1.icon图标/12.文件类型/CSV" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6047
+ <g id="csv" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6048
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#14BC64"></path>
6049
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6050
+ <path d="M5.86532461,16.8 C6.37684952,16.8 6.81529945,16.6398922 7.18067438,16.3196765 C7.57262204,15.977628 7.81841973,15.5045822 7.92471062,14.9005391 L7.22053347,14.9005391 C7.12752894,15.3080863 6.96144942,15.6137466 6.72229492,15.8175202 C6.49642677,16.0067385 6.20412682,16.1013477 5.85868143,16.1013477 C5.32722698,16.1013477 4.93527932,15.919407 4.68283845,15.5555256 C4.44368395,15.2134771 4.32410669,14.7331536 4.32410669,14.1072776 C4.32410669,13.5032345 4.44368395,13.0229111 4.68948163,12.6735849 C4.94856568,12.2878706 5.33387016,12.0986523 5.84539507,12.0986523 C6.19084046,12.0986523 6.46985405,12.1787062 6.69572219,12.3460916 C6.92159034,12.5134771 7.07438349,12.7754717 7.15410166,13.1247978 L7.85827881,13.1247978 C7.78520382,12.6008086 7.57262204,12.1787062 7.22717665,11.8730458 C6.86844489,11.5528302 6.41006543,11.4 5.85868143,11.4 C5.10135883,11.4 4.53004529,11.6692722 4.13145445,12.222372 C3.7727227,12.709973 3.6,13.3358491 3.6,14.1072776 C3.6,14.8932615 3.76607952,15.5191375 4.11152491,15.9849057 C4.50347257,16.5234501 5.08807247,16.8 5.86532461,16.8 Z M10.3893306,16.8 C10.9872169,16.8 11.4522396,16.6690027 11.7843986,16.4070081 C12.1165576,16.1377358 12.2826371,15.7738544 12.2826371,15.3080863 C12.2826371,14.8277628 12.0766985,14.4566038 11.6714645,14.1873315 C11.4854555,14.0636119 11.0669351,13.8962264 10.4291897,13.6778976 C9.98409663,13.532345 9.71172622,13.4231806 9.60543533,13.3576819 C9.36628083,13.219407 9.25334675,13.0374663 9.25334675,12.8045822 C9.25334675,12.5425876 9.35299446,12.3533693 9.55893306,12.2369272 C9.72501258,12.1350404 9.96416709,12.084097 10.2763966,12.084097 C10.6351283,12.084097 10.9008556,12.1568733 11.0868646,12.3097035 C11.2728737,12.4552561 11.3924509,12.7026954 11.4588827,13.0374663 L12.1763463,13.0374663 C12.129844,12.4698113 11.9438349,12.0549865 11.6116759,11.7857143 C11.2994464,11.5237197 10.8676397,11.4 10.3162557,11.4 C9.81137393,11.4 9.39285355,11.5237197 9.06069451,11.771159 C8.70860594,12.0331536 8.53588324,12.3897574 8.53588324,12.848248 C8.53588324,13.2994609 8.71524912,13.6487871 9.08062406,13.8889488 C9.22677403,13.9762803 9.58550579,14.1145553 10.1701057,14.3183288 C10.694917,14.4929919 11.0071465,14.609434 11.1134373,14.667655 C11.4123805,14.8350404 11.5651736,15.0606469 11.5651736,15.351752 C11.5651736,15.5846361 11.4588827,15.7665768 11.246301,15.8975741 C11.0337192,16.0285714 10.7480624,16.1013477 10.3893306,16.1013477 C9.99073981,16.1013477 9.69843986,16.0212938 9.50578762,15.861186 C9.29320584,15.6865229 9.16034222,15.3881402 9.10719678,14.980593 L8.38973327,14.980593 C8.42959235,15.6355795 8.64217413,16.115903 9.03412179,16.4215633 C9.35963764,16.6690027 9.81137393,16.8 10.3893306,16.8 Z M15.0993457,16.6981132 L16.8,11.5018868 L16.0161047,11.5018868 L14.6741822,15.8102426 L14.6542526,15.8102426 L13.305687,11.5018868 L12.5217916,11.5018868 L14.2224459,16.6981132 L15.0993457,16.6981132 Z" id="CSV" fill="#FFFFFF"></path>
6051
+ </g>
6052
+ </g>
6053
+ </svg>`;
6054
+ const defaultFile = `<?xml version="1.0" encoding="UTF-8"?>
6055
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6056
+ <title>1.Base基础/1.icon图标/12.文件类型/文件</title>
6057
+ <g id="1.Base基础/1.icon图标/12.文件类型/文件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6058
+ <g id="pdf" transform="translate(2.000000, 0.000000)">
6059
+ <path d="M14.1176471,0 L2.74128887,0 C1.22731689,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.22731689,24 2.74128887,24 L17.2587111,24 C18.7726831,24 20,22.765548 20,21.2427744 L20,6 C20,6 14.1176471,0 14.1176471,0 Z" id="路径" fill="#378FE8"></path>
6060
+ <path d="M14.1176471,0 L20,6 L15.3176471,6 C14.6549054,6 14.1176471,5.4627417 14.1176471,4.8 L14.1176471,0 L14.1176471,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
6061
+ <path d="M14.5880967,13.1173301 C14.8152676,13.1173301 15,13.3453703 15,13.6274691 L15,13.6274691 L14.0557428,17.489861 C14.0557428,17.7719598 13.8716345,18 13.6438394,18 L13.6438394,18 L5.9674589,18 C5.74028797,18 5.55555556,17.7719598 5.55555556,17.489861 L5.55555556,17.489861 L6.49981277,13.6274691 C6.49981277,13.3453703 6.68454518,13.1173301 6.91171612,13.1173301 L6.91171612,13.1173301 Z M8.54763993,10 C8.74912861,10 9.00458747,10.1412782 9.17909105,10.4590101 C9.3284104,10.7759998 9.5345565,10.9507235 9.79752937,10.9831811 L9.79752937,10.9831811 L9.89693802,10.9920475 C10.2885983,11.0188347 11.410488,11.0333709 13.2626071,11.0356559 C13.712505,11.0318676 13.8888889,11.3623841 13.8888889,11.6829992 L13.8888889,11.6829992 L13.8888889,12.2278307 L6.32346878,12.2278307 C6.07820429,12.2278307 5.88031363,12.4654087 5.88031363,12.7566149 L5.88031363,12.7566149 L5,15.9677076 L5,15.9677076 L5,10.8633729 C5,10.0518557 5.7639779,10 5.96546658,10 Z" id="形状结合" fill="#FFFFFF"></path>
6062
+ </g>
6063
+ </g>
6064
+ </svg>`;
6065
+ const doc = `<?xml version="1.0" encoding="UTF-8"?>
6066
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6067
+ <title>1.Base基础/1.icon图标/12.文件类型/DOC</title>
6068
+ <g id="1.Base基础/1.icon图标/12.文件类型/DOC" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6069
+ <g id="word" transform="translate(1.800000, 0.000000)">
6070
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#378FE8"></path>
6071
+ <polygon id="W" fill="#FFFFFF" fill-rule="nonzero" points="8.75949099 18 10.1847296 12.5848739 10.2254507 12.5848739 11.640509 18 12.9028632 18 15 10.8 13.6562036 10.8 12.2920467 16.2756303 12.2513256 16.2756303 10.8159067 10.8 9.58409332 10.8 8.14867444 16.2756303 8.10795334 16.2756303 6.74379639 10.8 5.4 10.8 7.48695652 18"></polygon>
6072
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
6073
+ </g>
6074
+ </g>
6075
+ </svg>`;
6076
+ const exe = `<?xml version="1.0" encoding="UTF-8"?>
6077
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6078
+ <title>1.Base基础/1.icon图标/12.文件类型/EXE</title>
6079
+ <g id="1.Base基础/1.icon图标/12.文件类型/EXE" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6080
+ <g id="EXE" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6081
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z M8.15340312,5.27127736 L6.60000001,5.27127736 L6.60000001,6.80307537 L8.15340312,6.80307537 L8.15340312,8.33487339 L6.60000001,8.33487339 L6.60000001,9.8666714 L8.15340312,9.8666714 L8.15340312,11.3984694 L6.59997259,11.3984694 L6.59997259,9.8666714 L5.04656949,9.8666714 L5.04656949,8.33487339 L6.59997259,8.33487339 L6.59997259,6.80307537 L5.04656949,6.80307537 L5.04656949,5.27127736 L6.59997259,5.27127736 L6.59997259,3.73947935 L5.04656949,3.73947935 L5.04656949,2.20768134 L6.60000001,2.20768134 L6.60000001,3.73947935 L8.15340312,3.73947935 L8.15340312,5.27127736 Z" id="形状" fill="#667580"></path>
6082
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6083
+ <path d="M8.181848,19.8 L8.181848,19.3310924 L5.97211591,19.3310924 L5.97211591,18.1865546 L7.96664844,18.1865546 L7.96664844,17.7176471 L5.97211591,17.7176471 L5.97211591,16.6689076 L8.09261892,16.6689076 L8.09261892,16.2 L5.4,16.2 L5.4,19.8 L8.181848,19.8 Z M9.1213778,19.8 L10.1238928,18.3731092 L11.1264079,19.8 L11.8244943,19.8 L10.4650629,17.9394958 L11.7352652,16.2 L11.0371788,16.2 L10.1238928,17.5008403 L9.21060689,16.2 L8.5125205,16.2 L9.77222526,17.9394958 L8.42329142,19.8 L9.1213778,19.8 Z M15,19.8 L15,19.3310924 L12.7902679,19.3310924 L12.7902679,18.1865546 L14.7848004,18.1865546 L14.7848004,17.7176471 L12.7902679,17.7176471 L12.7902679,16.6689076 L14.9107709,16.6689076 L14.9107709,16.2 L12.218152,16.2 L12.218152,19.8 L15,19.8 Z" fill="#FFFFFF"></path>
6084
+ </g>
6085
+ </g>
6086
+ </svg>`;
6087
+ const fla = `<?xml version="1.0" encoding="UTF-8"?>
6088
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6089
+ <title>1.Base基础/1.icon图标/12.文件类型/FLA</title>
6090
+ <g id="1.Base基础/1.icon图标/12.文件类型/FLA" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6091
+ <g id="FLA" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6092
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#F26225"></path>
6093
+ <path d="M4.41013514,16.8 L4.41013514,14.3798319 L7.04864865,14.3798319 L7.04864865,13.6764706 L4.41013514,13.6764706 L4.41013514,12.1033613 L7.20472973,12.1033613 L7.20472973,11.4 L3.6,11.4 L3.6,16.8 L4.41013514,16.8 Z M11.6418919,16.8 L11.6418919,16.0966387 L8.72094595,16.0966387 L8.72094595,11.4 L7.91824324,11.4 L7.91824324,16.8 L11.6418919,16.8 Z M12.6527027,16.8 L13.1506757,15.4084034 L15.4324324,15.4084034 L15.9304054,16.8 L16.8,16.8 L14.7560811,11.4 L13.8344595,11.4 L11.7905405,16.8 L12.6527027,16.8 Z M15.1871622,14.7277311 L13.3959459,14.7277311 L14.2804054,12.2848739 L14.3101351,12.2848739 L15.1871622,14.7277311 Z" fill="#FFFFFF"></path>
6094
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6095
+ </g>
6096
+ </g>
6097
+ </svg>`;
6098
+ const html = `<?xml version="1.0" encoding="UTF-8"?>
6099
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6100
+ <title>1.Base基础/1.icon图标/12.文件类型/HTML</title>
6101
+ <g id="1.Base基础/1.icon图标/12.文件类型/HTML" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6102
+ <g id="HTML" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6103
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#F26225"></path>
6104
+ <polygon id="路径" fill="#FFFFFF" points="13.72 11.6913838 8.24 11.6913838 8.34 13.1169713 13.54 13.1169713 13.18 17.7446475 10.16 18.6 7.24 17.7446475 7.04 15.3759791 8.5 15.3759791 8.6 16.5164491 10.16 16.9770235 11.8 16.5164491 11.9 14.6302872 6.96 14.6302872 6.6 10.2 13.8 10.2 13.72 11.6913838"></polygon>
6105
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6106
+ </g>
6107
+ </g>
6108
+ </svg>`;
6109
+ const img = `<?xml version="1.0" encoding="UTF-8"?>
6110
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6111
+ <title>1.Base基础/1.icon图标/12.文件类型/图片</title>
6112
+ <g id="1.Base基础/1.icon图标/12.文件类型/图片" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6113
+ <g id="excel" transform="translate(1.800000, 0.000000)">
6114
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#53ADEF"></path>
6115
+ <path d="M13.824,10.32 C14.4072127,10.32 14.88,10.7927873 14.88,11.376 L14.88,16.344 C14.88,16.9272127 14.4072127,17.4 13.824,17.4 L6.696,17.4 C6.1127873,17.4 5.64,16.9272127 5.64,16.344 L5.64,11.376 C5.64,10.7927873 6.1127873,10.32 6.696,10.32 L13.824,10.32 Z M11.32246,13.5878637 L9.69467725,15.2453409 C9.55321852,15.4095412 9.31061521,15.4382669 9.13500743,15.3157947 L9.11341755,15.299697 L8.30168,14.6534455 L6.34,16.0480344 L6.34,16.7548593 C6.34,16.7645794 6.34633183,16.7728232 6.35511699,16.7757318 L6.36210526,16.7768528 L14.1578947,16.7768528 C14.1676669,16.7768528 14.175951,16.7705551 14.1788737,16.7618135 L14.18,16.7548593 L14.18,16.0816037 L11.32246,13.5878637 Z M8.24842105,11.5809568 C7.70719972,11.5809568 7.26842105,12.0175157 7.26842105,12.5559989 C7.26842105,13.0944822 7.70719972,13.5310411 8.24842105,13.5310411 C8.78964239,13.5310411 9.22842105,13.0944822 9.22842105,12.5559989 C9.22842105,12.0175157 8.78964239,11.5809568 8.24842105,11.5809568 Z" id="形状结合" fill="#FFFFFF"></path>
6116
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
6117
+ </g>
6118
+ </g>
6119
+ </svg>`;
6120
+ const ipa = `<?xml version="1.0" encoding="UTF-8"?>
6121
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6122
+ <title>1.Base基础/1.icon图标/12.文件类型/IPA</title>
6123
+ <g id="1.Base基础/1.icon图标/12.文件类型/IPA" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6124
+ <g id="IPA" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6125
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#53ADEF"></path>
6126
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6127
+ <path d="M5.43226366,16.8 L5.43226366,11.4 L4.8,11.4 L4.8,16.8 L5.43226366,16.8 Z M7.86244579,16.8 L7.86244579,14.5915966 L9.49384215,14.5915966 C10.7739809,14.5915966 11.421856,14.0546218 11.421856,12.9882353 C11.421856,11.9294118 10.7817866,11.4 9.50164788,11.4 L7.22237641,11.4 L7.22237641,16.8 L7.86244579,16.8 Z M9.46261925,14.0546218 L7.86244579,14.0546218 L7.86244579,11.9369748 L9.46261925,11.9369748 C9.90754553,11.9369748 10.2353859,12.0201681 10.4539462,12.2016807 C10.6725065,12.3605042 10.7817866,12.6252101 10.7817866,12.9882353 C10.7817866,13.3512605 10.6725065,13.6159664 10.461752,13.789916 C10.2431917,13.9638655 9.91535126,14.0546218 9.46261925,14.0546218 Z M12.3585429,16.8 L12.951778,15.287395 L15.5120555,15.287395 L16.1052905,16.8 L16.8,16.8 L14.6065915,11.4 L13.8650477,11.4 L11.6716392,16.8 L12.3585429,16.8 Z M15.3091067,14.7655462 L13.1547268,14.7655462 L14.224111,12.0655462 L14.2553339,12.0655462 L15.3091067,14.7655462 Z" fill="#FFFFFF"></path>
6128
+ </g>
6129
+ </g>
6130
+ </svg>`;
6131
+ const java = `<?xml version="1.0" encoding="UTF-8"?>
6132
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6133
+ <title>1.Base基础/1.icon图标/12.文件类型/JAVA</title>
6134
+ <g id="1.Base基础/1.icon图标/12.文件类型/JAVA" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6135
+ <g id="java" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6136
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#F59203"></path>
6137
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6138
+ <path d="M12.6345082,9.54776364 C12.3269346,9.75591328 12.0273145,9.93314034 11.6981721,10.1903736 C11.449332,10.3857816 11.0000782,10.6528974 10.9758547,11.0127809 C10.9383581,11.5600927 11.8159607,12.0662807 11.3504576,12.7602158 C11.1739354,13.0247912 10.8743257,13.1379515 10.4944135,13.2998766 C10.4489634,13.2201892 10.5932879,13.1532534 10.655008,13.0684554 C11.2382997,12.2562593 10.0478143,11.9865933 10.200113,10.9869589 C10.3471026,10.0207975 11.5322787,9.68386685 12.6345082,9.54776364 L12.6345082,9.54776364 Z M8.91639428,12.8883592 C8.64099764,13.0117208 8.18079344,13.0349924 7.98005813,13.2995579 C8.18344807,13.4461911 8.48041354,13.4407717 8.75581018,13.453842 C9.88457556,13.5026069 11.2970333,13.4101679 12.2599157,13.2482427 C12.2920926,13.3151885 12.1261993,13.4305704 12.0190292,13.5051671 C11.4118355,13.9316577 9.52324579,14.052469 8.22061282,13.967681 C7.78463208,13.9393087 6.78690772,13.8290175 6.77596776,13.4538321 C6.76269464,12.9989692 7.98503556,12.9502044 8.48803522,12.9141812 C8.58692001,12.9065302 8.77172757,12.8679567 8.91606245,12.8883592 L8.91639428,12.8883592 Z M8.35466103,14.044828 C8.48041354,14.0601299 8.26639474,14.1321664 8.3012367,14.2246154 C8.76144089,14.661626 10.192481,14.5382744 10.8958945,14.4043927 C11.0428736,14.3760205 11.190195,14.2912224 11.2970333,14.3014337 C11.5644661,14.3247053 11.7356686,14.6227436 11.9659367,14.6613072 C11.1526984,15.0135398 9.58264303,15.1805755 8.43495308,14.9695568 C8.13799798,14.9156813 7.62171482,14.7613972 7.60579743,14.5325362 C7.58157398,14.2214175 8.11676097,14.0904149 8.35466103,14.0441904 L8.35466103,14.044828 Z M8.70238585,15.0986466 C8.78533252,15.1244686 8.67285314,15.1681427 8.67550777,15.2016057 C8.9190489,15.6077137 10.1227971,15.4636307 10.7353,15.3300679 C10.8583979,15.3016956 10.9814958,15.2194579 11.0830249,15.2271088 C11.3932531,15.2475114 11.5110417,15.5586201 11.7784745,15.6124855 C10.925085,16.1135828 8.85732886,16.3166318 8.00660439,15.6896326 C7.96645318,15.2322095 8.34900958,15.1808943 8.70205402,15.0986466 L8.70238585,15.0986466 Z M7.9266338,15.8697288 C7.67247416,15.931564 7.01452111,15.8439068 6.99030802,16.1779684 C6.98234415,16.3064306 7.21493496,16.4581644 7.36491092,16.5120299 C8.2368724,16.8282392 9.98909106,16.877014 11.4307393,16.7176292 C12.099653,16.6430424 13.3568256,16.4272319 13.1962415,15.7667697 C13.3969768,15.7900413 13.5761432,15.9134029 13.5973802,16.1008313 C13.6776827,16.8100682 11.9815326,17.1081066 11.2970333,17.180153 C9.80693814,17.3369775 7.94521618,17.3060649 6.80317767,16.9232286 C6.4312294,16.799867 5.98197554,16.570996 6.00055791,16.2292935 C6.03274525,15.6536094 7.47705847,15.4942345 7.92664417,15.86941 L7.9266338,15.8697288 Z M10.2004449,18 C9.19742163,17.8944906 8.23156315,17.7532768 7.41832489,17.409024 C9.54481462,17.89991 12.6451267,17.8638968 14.1325672,16.818038 C14.2128697,16.7616222 14.2878524,16.6510122 14.4,16.6637638 C14.0253971,17.7430756 12.5863931,17.8176723 11.3504576,18 L10.200113,18 L10.2004449,18 Z M10.8958945,7.8 C11.0830249,7.96957611 11.2167309,8.28578544 11.2167309,8.62239731 C11.2167309,9.61692104 10.1201425,10.1926051 9.58496583,10.8581779 C9.46716683,11.0073615 9.31487844,11.2359136 9.31753306,11.4749759 C9.32284231,12.0171871 9.90614439,12.6237938 10.1201425,13.0684554 C9.74554992,12.8319434 9.29098681,12.5160529 8.96980825,12.1434178 C8.64896151,11.773343 8.32778295,11.1721557 8.62208343,10.6528974 C9.06337342,9.87161396 10.3769567,9.40654984 10.8424702,8.57140095 C10.9549495,8.36835193 11.0432055,8.05755206 10.8958945,7.80031879 L10.8958945,7.8 Z M12.4742559,13.1456024 C13.0253603,12.6932799 13.95871,12.870507 13.9988612,13.6339482 C14.0443113,14.5283819 13.0250285,15.0294693 12.2867834,15.0731434 C12.629199,14.7594745 13.5333478,14.2558468 13.3568256,13.5312979 C13.2844974,13.2383602 12.9045956,13.0611232 12.4742456,13.1459212 L12.4742559,13.1456024 Z" id="形状" fill="#FFFFFF"></path>
6139
+ </g>
6140
+ </g>
6141
+ </svg>`;
6142
+ const js = `<?xml version="1.0" encoding="UTF-8"?>
6143
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6144
+ <title>1.Base基础/1.icon图标/12.文件类型/JS</title>
6145
+ <g id="1.Base基础/1.icon图标/12.文件类型/JS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6146
+ <g id="js" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6147
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#FBC100"></path>
6148
+ <path d="M9.16868571,9.76744186 L7.45714286,9.76744186 L7.45714286,14.1104651 C7.45714286,15.1831395 7.07314286,15.4866279 6.3984,15.4866279 C6.08571429,15.4866279 5.80045714,15.4343023 5.58102857,15.3610465 L5.4,16.6325581 C5.71268571,16.7372093 6.20091429,16.8 6.57394286,16.8 C8.11542857,16.8 9.16868571,16.1093023 9.16868571,14.1209302 L9.16868571,9.76744186 Z M12.9099429,9.6 C11.2477714,9.6 10.2,10.5 10.2,11.6877907 C10.2,12.7133721 11.0064,13.3517442 12.1858286,13.7651163 C13.0361143,14.052907 13.3707429,14.3145349 13.3707429,14.7383721 C13.3707429,15.2040698 12.9812571,15.5023256 12.2461714,15.5023256 C11.5659429,15.5023256 10.9460571,15.2825581 10.5236571,15.0680233 L10.2,16.3604651 C10.6004571,16.5802326 11.3465143,16.7947674 12.1529143,16.7947674 C14.0948571,16.7947674 15,15.8005814 15,14.6337209 C15,13.6395349 14.424,13.0011628 13.1732571,12.5459302 C12.2461714,12.1953488 11.8621714,11.9965116 11.8621714,11.5517442 C11.8621714,11.2011628 12.1968,10.8819767 12.8934857,10.8819767 C13.5737143,10.8819767 14.0454857,11.1017442 14.3197714,11.2377907 L14.7312,9.92965116 C14.2978286,9.75174419 13.7163429,9.6 12.9099429,9.6 L12.9099429,9.6 Z" id="形状" fill="#FFFFFF"></path>
6149
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6150
+ </g>
6151
+ </g>
6152
+ </svg>`;
6153
+ const key = `<?xml version="1.0" encoding="UTF-8"?>
6154
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6155
+ <title>1.Base基础/1.icon图标/12.文件类型/KEY</title>
6156
+ <g id="1.Base基础/1.icon图标/12.文件类型/KEY" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6157
+ <g id="keynote" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6158
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#378FE8"></path>
6159
+ <path d="M14.9911156,14.5898439 L14.9911156,15.1248048 L10.4736066,15.1248048 L10.4736066,17.8869141 L11.6598352,17.8869141 C11.8614793,17.8869141 12.024944,18.0465438 12.024944,18.243457 C12.024944,18.4403703 11.8614793,18.6 11.6598352,18.6 L8.74016477,18.6 C8.53852074,18.6 8.37505596,18.4403703 8.37505596,18.243457 C8.37505596,18.0465438 8.53852074,17.8869141 8.74016477,17.8869141 L9.9263934,17.8869141 L9.9263934,15.1253907 L5.40948438,15.1253907 L5.40948438,14.5904298 L14.9911156,14.5904298 L14.9911156,14.5898439 Z M13.6638836,9.60000011 C13.9224898,9.60000011 14.1462952,9.77695335 14.1996965,10.024219 L14.9881156,13.6775392 C15.0223332,13.8352785 14.9817865,13.9996722 14.8777768,14.1248996 C14.7737671,14.2501269 14.6174161,14.3227976 14.4523026,14.3226566 L5.94769737,14.3226566 C5.78258395,14.3227976 5.62623288,14.2501269 5.5222232,14.1248996 C5.41821351,13.9996722 5.37766679,13.8352785 5.41188445,13.6775392 L6.20030346,10.024219 C6.25366803,9.77684681 6.47724125,9.59983737 6.73611641,9.60000011 L13.6638836,9.60000011 L13.6638836,9.60000011 Z M12.9612666,10.5662111 L12.9120655,10.5703127 L11.9358419,10.7841799 C11.8708856,10.7984107 11.819027,10.8460683 11.8005407,10.9085205 C11.7820544,10.9709728 11.7998766,11.0382999 11.8470397,11.0841799 L12.0114437,11.2441408 L11.317227,11.9226564 C11.2323411,12.04108 11.0938739,12.1118994 10.9458497,12.1125982 C10.7978254,12.1132971 10.6586634,12.0437885 10.572609,11.926172 L10.3470035,11.6718752 L10.1921998,11.4996096 C10.0024563,11.253348 9.70373817,11.1103231 9.3881804,11.1146486 C9.11037369,11.1146486 8.85956764,11.2248049 8.67836328,11.401758 L8.66576298,11.4140627 L7.53653571,12.536133 C7.41893287,12.6708986 7.41893287,12.7957033 7.53653571,12.9146486 C7.65353854,13.0318361 7.78194165,13.0318361 7.92354507,12.9146486 L9.02457163,11.8382814 C9.10958742,11.7201665 9.24796462,11.6496296 9.39580529,11.6490475 C9.54364595,11.6484653 9.68260115,11.7179102 9.76858958,11.8353517 L9.99419502,12.0896486 L10.1483988,12.2619142 C10.3380033,12.508008 10.6374105,12.6515626 10.9524182,12.6468752 C11.2302249,12.6468752 11.4810309,12.5367189 11.6622353,12.3597658 L11.6754356,12.3474611 L12.4014531,11.6255861 L12.603658,11.8230471 C12.6506402,11.8691037 12.7195849,11.8865078 12.7835375,11.8684552 C12.8474902,11.8504026 12.8962927,11.7997607 12.9108654,11.7363283 L13.1298707,10.783008 C13.1434944,10.7234958 13.1249957,10.6613137 13.0808396,10.6181935 C13.0366834,10.5750733 12.9730075,10.5570086 12.9120655,10.5703127 L12.9612666,10.5662111 L12.9612666,10.5662111 Z" id="形状" fill="#FFFFFF"></path>
6160
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6161
+ </g>
6162
+ </g>
6163
+ </svg>`;
6164
+ const mp3 = `<?xml version="1.0" encoding="UTF-8"?>
6165
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6166
+ <title>1.Base基础/1.icon图标/12.文件类型/MP3</title>
6167
+ <g id="1.Base基础/1.icon图标/12.文件类型/MP3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6168
+ <g id="MP3" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6169
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#14BC64"></path>
6170
+ <path d="M14.3998147,10.9584359 L14.3998147,9.80061073 C14.3998147,9.73573225 14.365358,9.67500695 14.3073452,9.63722297 C14.2490817,9.59963677 14.1742711,9.58982737 14.1071891,9.61093933 L8.22903883,11.4501715 C8.13751771,11.4786009 8.0773139,11.5575705 8.07973383,11.6451233 L8.1083369,12.6102117 L8.1083369,16.7193896 C7.77229436,16.679529 7.3953856,16.7339158 7.05961556,16.872434 C6.66888489,17.0340022 6.35183113,17.2932788 6.1673609,17.602789 C5.97248064,17.9307116 5.94675531,18.2751183 6.0956352,18.5727029 C6.21928028,18.8205583 6.44682953,19.0064721 6.75383298,19.1109441 C6.92647609,19.1700576 7.11490322,19.2 7.31322806,19.2 C7.58703929,19.2 7.87219801,19.1414897 8.1392836,19.0314406 C8.64383795,18.8232282 9.02443109,18.4467135 9.15185867,18.0358462 C9.19777184,17.9667057 9.19777184,17.871519 9.19777184,17.8186649 L9.19777184,17.7787055 C9.1988837,17.7512154 9.1988837,17.7185735 9.19769554,17.6866831 L9.19570074,17.6866831 C9.19801166,17.5156317 9.19801166,16.7122797 9.19801166,12.6933345 L13.2973972,11.4398973 L13.2973972,14.9378371 C12.9612674,14.8979864 12.5845331,14.9523633 12.2486758,15.09101 C11.4194046,15.4335972 10.9863689,16.19608 11.2846846,16.7913482 C11.4775264,17.1770988 11.9453132,17.4165489 12.5052424,17.4165489 C12.7794024,17.4165489 13.0638635,17.359067 13.3275045,17.2500858 C13.8620136,17.0294634 14.2504552,16.629068 14.3574551,16.1951307 C14.3868103,16.1330507 14.3868103,16.0577794 14.3868103,16.007971 C14.388162,15.9688422 14.3878677,15.936576 14.3867449,15.9047944 L14.3806188,15.90518 C14.3870937,15.6899567 14.3870937,14.8190761 14.3870937,11.0271907 C14.3952801,11.0055349 14.4,10.9825243 14.4,10.9585744 L14.3998147,10.9584359 Z" id="路径" fill="#FFFFFF"></path>
6171
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6172
+ </g>
6173
+ </g>
6174
+ </svg>`;
6175
+ const page = `<?xml version="1.0" encoding="UTF-8"?>
6176
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6177
+ <title>1.Base基础/1.icon图标/12.文件类型/文档</title>
6178
+ <g id="1.Base基础/1.icon图标/12.文件类型/文档" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6179
+ <g id="pages" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6180
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#9466CD"></path>
6181
+ <path d="M14.0506888,10.580838 L13.1550425,11.3323745 L12.1459551,10.1297794 L13.0412113,9.37820876 C13.3451781,9.12313077 13.6002437,9.42711776 13.6002437,9.42711776 L14.0995997,10.0217845 C14.0995987,10.0217951 14.3546653,10.3257715 14.0506888,10.580838 Z M5.66861701,16.5899183 L7.68476284,15.9221129 L6.67171032,14.7148039 L5.66861701,16.5899183 Z M7.97860307,15.6762747 L12.8292113,11.6061311 L11.8198728,10.4032484 L6.96925313,14.4734016 L7.97860307,15.6762747 Z M5.7,17.4 L14.7,17.4 C14.8656854,17.4 15,17.5343146 15,17.7 C15,17.8656854 14.8656854,18 14.7,18 L5.7,18 C5.53431458,18 5.4,17.8656854 5.4,17.7 C5.4,17.5343146 5.53431458,17.4 5.7,17.4 Z" id="形状结合" fill="#FFFFFF"></path>
6182
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6183
+ </g>
6184
+ </g>
6185
+ </svg>`;
6186
+ const pdf = `<?xml version="1.0" encoding="UTF-8"?>
6187
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6188
+ <title>1.Base基础/1.icon图标/12.文件类型/PDF</title>
6189
+ <g id="1.Base基础/1.icon图标/12.文件类型/PDF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6190
+ <g id="pdf" transform="translate(2.000000, 0.000000)">
6191
+ <path d="M14.1176471,0 L2.74128887,0 C1.22731689,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.22731689,24 2.74128887,24 L17.2587111,24 C18.7726831,24 20,22.765548 20,21.2427744 L20,6 C20,6 14.1176471,0 14.1176471,0 Z" id="形状" fill="#DD2A42"></path>
6192
+ <path d="M13.465286,16.1960788 C12.7331102,16.140608 12.0280521,15.863254 11.458582,15.3640169 C10.3467596,15.6136354 9.28917236,15.9741956 8.23158516,16.417962 C7.39093891,17.9434089 6.60452791,18.72 5.92658739,18.72 C5.79099929,18.72 5.62829356,18.6922646 5.51982309,18.6090584 C5.22152926,18.4703814 5.05882353,18.165292 5.05882353,17.8602027 C5.05882353,17.6105841 5.11305877,16.9171991 7.68923274,15.7800478 C8.2858204,14.6706319 8.74681995,13.5334806 9.12646664,12.3408585 C8.8010552,11.675209 8.09599706,10.0388205 8.58411423,9.20675855 C8.74681995,8.90166918 9.0722314,8.73525679 9.42476047,8.76299218 C9.69593668,8.76299218 9.96711289,8.90166917 10.1298186,9.12355235 C10.4823477,9.62278951 10.4552301,10.6767346 9.99423051,12.2299169 C10.4281124,13.0619788 10.9975825,13.8108346 11.675523,14.4487487 C12.244993,14.3378071 12.8144631,14.254601 13.3839331,14.2546009 C14.6584613,14.2823363 14.8482846,14.8925151 14.821167,15.2530753 C14.821167,16.1960788 13.9262855,16.1960788 13.465286,16.1960788 L13.465286,16.1960788 Z M5.76470588,17.76 L5.85294118,17.7351724 C6.26470588,17.6110345 6.5882353,17.3627586 6.82352941,17.04 C6.38235294,17.1889655 6.02941176,17.4372414 5.76470588,17.76 Z M9.42619971,9.48 L9.34098347,9.48 C9.31257806,9.48 9.25576723,9.48 9.22736181,9.51 C9.11374016,10.02 9.1989564,10.56 9.3977943,11.04 C9.56822678,10.53 9.56822678,9.98999999 9.42619971,9.48 L9.42619971,9.48 Z M9.66013073,13.56 L9.63398693,13.6148571 L9.60784314,13.5874286 C9.37254903,14.2182857 9.11111112,14.8491429 8.82352941,15.4525714 L8.87581699,15.4251429 L8.87581699,15.48 C9.4509804,15.2605714 10.0784314,15.0685714 10.6535948,14.9314286 L10.627451,14.904 L10.7058824,14.904 C10.3137255,14.4925714 9.94771242,14.0262857 9.66013073,13.56 L9.66013073,13.56 Z M13.4964706,15.12 C13.2635294,15.12 13.0564706,15.12 12.8235294,15.189282 C13.0823529,15.3624871 13.3411765,15.4317692 13.6,15.4664102 C13.7811765,15.5010512 13.9623529,15.4664102 14.1176471,15.3971281 C14.1176471,15.2932051 14.0141176,15.12 13.4964706,15.12 Z" id="形状备份" fill="#FFFFFF" fill-rule="nonzero"></path>
6193
+ <path d="M14.1176471,0 L20,6 L15.3176471,6 C14.6549054,6 14.1176471,5.4627417 14.1176471,4.8 L14.1176471,0 L14.1176471,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
6194
+ </g>
6195
+ </g>
6196
+ </svg>`;
6197
+ const php = `<?xml version="1.0" encoding="UTF-8"?>
6198
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6199
+ <title>1.Base基础/1.icon图标/12.文件类型/PHP</title>
6200
+ <g id="1.Base基础/1.icon图标/12.文件类型/PHP" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6201
+ <g id="php" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6202
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#AC8FD7"></path>
6203
+ <path d="M7.16456528,13.4691011 C6.93145216,14.7205056 6.10817921,14.5907303 5.09605513,14.5907303 L5.5003146,12.4092697 C6.62161825,12.4092697 7.38292442,12.2825843 7.16456528,13.4691011 Z M3.6,16.8 L4.68294326,16.8 L4.93966278,15.4157303 C6.1524412,15.4157303 6.90489496,15.508427 7.60128355,14.8255618 C8.37144211,14.0839888 8.57209644,12.7646067 8.02324781,12.1033708 C7.7370203,11.7573034 7.27669565,11.5873596 6.65112624,11.5873596 L4.5649113,11.5873596 L3.6,16.8 Z M9.07963388,10.2 L10.1566755,10.2 L9.89995603,11.5842697 C10.8294577,11.5842697 11.6910911,11.5132022 12.1071537,11.9148876 C12.543872,12.3351124 12.3343653,12.8727528 11.8622374,15.4095506 L10.7704418,15.4095506 C11.2248648,12.9561798 11.310438,12.7522472 11.1451932,12.5668539 C10.9858501,12.3876404 10.6229018,12.4247191 9.74651448,12.4247191 L9.19176425,15.4095506 L8.11472259,15.4095506 L9.07963388,10.2 L9.07963388,10.2 Z M15.627457,13.4691011 C15.3913931,14.7390449 14.5445138,14.5907303 13.5589469,14.5907303 L13.9632064,12.4092697 C15.0904116,12.4092697 15.8458162,12.2825843 15.627457,13.4691011 L15.627457,13.4691011 Z M12.0628917,16.8 L13.1487858,16.8 L13.4055053,15.4157303 C14.6802505,15.4157303 15.3854915,15.4929775 16.0671261,14.8255618 C16.8372847,14.0839888 17.037939,12.7646067 16.4890904,12.1033708 C16.2028629,11.7573034 15.7425382,11.5873596 15.1169688,11.5873596 L13.0307538,11.5873596 L12.0628917,16.8 L12.0628917,16.8 Z" id="形状" fill="#FFFFFF"></path>
6204
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6205
+ </g>
6206
+ </g>
6207
+ </svg>`;
6208
+ const ppt = `<?xml version="1.0" encoding="UTF-8"?>
6209
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6210
+ <title>1.Base基础/1.icon图标/12.文件类型/PPT</title>
6211
+ <g id="1.Base基础/1.icon图标/12.文件类型/PPT" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6212
+ <g id="ppt" transform="translate(2.000000, 0.000000)">
6213
+ <path d="M14.1176471,0 L2.74128887,0 C1.22731689,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.22731689,24 2.74128887,24 L17.2587111,24 C18.7726831,24 20,22.765548 20,21.2427744 L20,6 C20,6 14.1176471,0 14.1176471,0 Z" id="路径" fill="#F59203"></path>
6214
+ <path d="M14.1176471,0 L20,6 L15.3176471,6 C14.6549054,6 14.1176471,5.4627417 14.1176471,4.8 L14.1176471,0 L14.1176471,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
6215
+ <path d="M8.54689984,18 L8.54689984,14.7764706 L10.7980922,14.7764706 C13.0111288,14.7764706 14.1176471,13.9058824 14.1176471,12.1764706 C14.1176471,10.4588235 13.0111288,9.6 10.8235294,9.6 L7.05882353,9.6 L7.05882353,18 L8.54689984,18 Z M10.709062,13.6 L8.54689984,13.6 L8.54689984,10.7764706 L10.709062,10.7764706 C11.3577107,10.7764706 11.8410175,10.8823529 12.1462639,11.1058824 C12.4515103,11.3176471 12.6168521,11.6705882 12.6168521,12.1764706 C12.6168521,12.6823529 12.4642289,13.0470588 12.1589825,13.2705882 C11.8537361,13.4823529 11.3704293,13.6 10.709062,13.6 Z" id="P" fill="#FFFFFF" fill-rule="nonzero"></path>
6216
+ </g>
6217
+ </g>
6218
+ </svg>`;
6219
+ const rar = `<?xml version="1.0" encoding="UTF-8"?>
6220
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6221
+ <title>1.Base基础/1.icon图标/12.文件类型/RAR</title>
6222
+ <g id="1.Base基础/1.icon图标/12.文件类型/RAR" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6223
+ <g id="rar" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6224
+ <path d="M10.9766879,14.4620385 L10.9766879,15.9938365 L9.42325733,15.9938365 L9.42325733,14.4620385 L10.9766879,14.4620385 Z M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z M11.7533757,16.759749 L8.64656949,16.759749 L8.64656949,12.164355 L11.7533757,12.164355 L11.7533757,16.759749 Z M11.7534031,5.27127736 L10.2,5.27127736 L10.2,6.80307537 L11.7534031,6.80307537 L11.7534031,8.33487339 L10.2,8.33487339 L10.2,9.8666714 L11.7534031,9.8666714 L11.7534031,11.3984694 L10.1999726,11.3984694 L10.1999726,9.8666714 L8.64656949,9.8666714 L8.64656949,8.33487339 L10.1999726,8.33487339 L10.1999726,6.80307537 L8.64656949,6.80307537 L8.64656949,5.27127736 L10.1999726,5.27127736 L10.1999726,3.73947935 L8.64656949,3.73947935 L8.64656949,2.20768134 L10.2,2.20768134 L10.2,3.73947935 L11.7534031,3.73947935 L11.7534031,5.27127736 Z" id="形状" fill="#667580"></path>
6225
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6226
+ </g>
6227
+ </g>
6228
+ </svg>`;
6229
+ const snippet = `<?xml version="1.0" encoding="UTF-8"?>
6230
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6231
+ <title>1.Base基础/1.icon图标/12.文件类型/CODE</title>
6232
+ <g id="1.Base基础/1.icon图标/12.文件类型/CODE" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6233
+ <g id="code" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6234
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#53ADEF"></path>
6235
+ <path d="M4.8,14.1768 L7.8126,16.1139 L7.8126,14.7156 L6.0189,13.608 L7.8126,12.5004 L7.8126,11.0925 L4.8,13.0395 L4.8,14.1768 Z M9.0498,16.8 L10.0866,16.8 L11.6058,9.6 L10.5621,9.6 L9.0498,16.8 Z M12.5877,11.0925 L12.5877,12.5004 L14.3808,13.608 L12.5877,14.7153 L12.5877,16.1136 L15.6,14.1768 L15.6,13.0395 L12.5877,11.0925 Z" id="形状" fill="#FFFFFF"></path>
6236
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6237
+ </g>
6238
+ </g>
6239
+ </svg>`;
6240
+ const swf = `<?xml version="1.0" encoding="UTF-8"?>
6241
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6242
+ <title>1.Base基础/1.icon图标/12.文件类型/SWF</title>
6243
+ <g id="1.Base基础/1.icon图标/12.文件类型/SWF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6244
+ <g id="swf" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6245
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#DD2A42"></path>
6246
+ <path d="M11.313582,13.2692357 L12.922225,13.2692357 L12.922225,14.994972 L10.6066688,14.994972 C9.16864306,18.5966934 6.78000001,18.6216932 6.12221874,18.5966934 L6,18.5966934 L6,16.8709571 C6.95061736,16.8709571 7.94987778,16.7459581 9.04666876,13.7944816 C10.6066688,9.09226891 13.8,9.61751474 13.8,9.61751474 L13.8,11.343251 C11.9962958,11.2682516 11.3140708,13.2692357 11.3140708,13.2692357 L11.313582,13.2692357 Z" id="路径" fill="#FFFFFF"></path>
6247
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6248
+ </g>
6249
+ </g>
6250
+ </svg>`;
6251
+ const ttf = `<?xml version="1.0" encoding="UTF-8"?>
6252
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6253
+ <title>1.Base基础/1.icon图标/12.文件类型/TTF</title>
6254
+ <g id="1.Base基础/1.icon图标/12.文件类型/TTF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6255
+ <g id="ttf" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6256
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#9466CD"></path>
6257
+ <path d="M7.3704,16.2138 L7.3704,15.9546 C7.986,15.9546 8.2992,15.6846 8.2992,15.1554 L8.2992,11.1702 C8.2992,10.9542 8.1588,10.8462 7.878,10.8462 C7.5,10.8462 7.1868,10.965 6.9492,11.2134 C6.7116,11.4618 6.528,11.8398 6.42,12.3258 L6.15,12.261 L6.3876,10.425 C6.5172,10.4466 6.6468,10.4574 6.7656,10.4682 C6.8844,10.479 6.9924,10.4898 7.1112,10.4898 L10.4376,10.4898 C10.5564,10.4898 10.686,10.479 10.8048,10.4682 C10.9344,10.4574 11.064,10.4466 11.1936,10.425 L11.1936,12.2286 L10.956,12.261 C10.8912,11.343 10.4268,10.8786 9.5844,10.8786 C9.2928,10.8786 9.1524,10.9758 9.1524,11.1702 L9.1524,15.1554 C9.1524,15.6846 9.4656,15.9546 10.0812,15.9546 L10.0812,16.2138 L7.3704,16.2138 Z" id="路径" fill="#FFFFFF" opacity="0.5"></path>
6258
+ <path d="M10.7724,17.7798 L10.7724,17.5206 C11.388,17.5206 11.7012,17.2506 11.7012,16.7214 L11.7012,12.747 C11.7012,12.531 11.5608,12.423 11.28,12.423 C10.902,12.423 10.5888,12.5418 10.3512,12.7902 C10.1136,13.0386 9.9408,13.4058 9.822,13.9026 L9.552,13.8378 L9.7896,12.0018 C9.9192,12.0234 10.0488,12.0342 10.1676,12.045 C10.2864,12.0558 10.3944,12.0666 10.5132,12.0666 L13.8396,12.0666 C13.9584,12.0666 14.088,12.0558 14.2068,12.045 C14.3364,12.0342 14.466,12.0234 14.5956,12.0018 L14.5956,13.8054 L14.358,13.8378 C14.2932,12.9198 13.8288,12.4554 12.9864,12.4554 C12.6948,12.4554 12.5544,12.5526 12.5544,12.747 L12.5544,16.7322 C12.5544,17.2614 12.8676,17.5314 13.4832,17.5314 L13.4832,17.7906 L10.7724,17.7906 L10.7724,17.7798 Z" id="路径" fill="#FFFFFF"></path>
6259
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6260
+ </g>
6261
+ </g>
6262
+ </svg>`;
6263
+ const txt = `<?xml version="1.0" encoding="UTF-8"?>
6264
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6265
+ <title>1.Base基础/1.icon图标/12.文件类型/TXT</title>
6266
+ <g id="1.Base基础/1.icon图标/12.文件类型/TXT" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6267
+ <g id="txt" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6268
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#378FE8"></path>
6269
+ <path d="M6.06390533,16.8 L6.06390533,12.1033613 L7.75384615,12.1033613 L7.75384615,11.4 L3.6,11.4 L3.6,12.1033613 L5.29704142,12.1033613 L5.29704142,16.8 L6.06390533,16.8 Z M8.84733728,16.8 L10.2035503,14.6596639 L11.5597633,16.8 L12.504142,16.8 L10.6650888,14.0092437 L12.383432,11.4 L11.4390533,11.4 L10.2035503,13.3512605 L8.96804734,11.4 L8.02366864,11.4 L9.72781065,14.0092437 L7.90295858,16.8 L8.84733728,16.8 Z M15.1100592,16.8 L15.1100592,12.1033613 L16.8,12.1033613 L16.8,11.4 L12.6461538,11.4 L12.6461538,12.1033613 L14.3431953,12.1033613 L14.3431953,16.8 L15.1100592,16.8 Z" id="TXT" fill="#FFFFFF"></path>
6270
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6271
+ </g>
6272
+ </g>
6273
+ </svg>`;
6274
+ const video = `<?xml version="1.0" encoding="UTF-8"?>
6275
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6276
+ <title>1.Base基础/1.icon图标/12.文件类型/MP4</title>
6277
+ <g id="1.Base基础/1.icon图标/12.文件类型/MP4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6278
+ <g id="MP4" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6279
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#F59203"></path>
6280
+ <path d="M12.6365884,15.4065782 L12.6365884,13.4525858 C12.634444,13.341072 12.6681817,13.2319401 12.7325839,13.1420676 L14.0617532,11.7939643 C14.4974254,11.3546946 14.999556,11.2259432 14.999556,11.7030809 L14.999556,17.1560831 C14.999556,17.6332208 14.4974254,17.5044694 14.0617532,17.0651998 L12.7325839,15.7170964 C12.6681817,15.6272239 12.634444,15.518092 12.6365884,15.4065782 Z M12.0458465,16.7016663 C12.0458465,17.1199454 11.7152413,17.4590277 11.3074191,17.4590277 L6.13842738,17.4590277 C5.7306052,17.4590277 5.4,17.1199454 5.4,16.7016663 L5.4,12.1574977 C5.4,11.7392186 5.7306052,11.4001363 6.13842738,11.4001363 L11.3074191,11.4001363 C11.7152413,11.4001363 12.0458465,11.7392186 12.0458465,12.1574977 L12.0458465,16.7016663 Z" id="形状" fill="#FFFFFF"></path>
6281
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6282
+ </g>
6283
+ </g>
6284
+ </svg>`;
6285
+ const vss = `<?xml version="1.0" encoding="UTF-8"?>
6286
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6287
+ <title>1.Base基础/1.icon图标/12.文件类型/VSS</title>
6288
+ <g id="1.Base基础/1.icon图标/12.文件类型/VSS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6289
+ <g id="vss" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6290
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#FECD4D"></path>
6291
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6292
+ <path d="M6.27866109,16.6981132 L8.0460251,11.5018868 L7.23138075,11.5018868 L5.83682008,15.8102426 L5.81610879,15.8102426 L4.41464435,11.5018868 L3.6,11.5018868 L5.36736402,16.6981132 L6.27866109,16.6981132 Z M10.3656904,16.8 C10.9870293,16.8 11.4702929,16.6690027 11.8154812,16.4070081 C12.1606695,16.1377358 12.3332636,15.7738544 12.3332636,15.3080863 C12.3332636,14.8277628 12.1192469,14.4566038 11.6981172,14.1873315 C11.5048117,14.0636119 11.0698745,13.8962264 10.407113,13.6778976 C9.94456067,13.532345 9.66150628,13.4231806 9.55104603,13.3576819 C9.30251046,13.219407 9.18514644,13.0374663 9.18514644,12.8045822 C9.18514644,12.5425876 9.28870293,12.3533693 9.50271967,12.2369272 C9.67531381,12.1350404 9.92384937,12.084097 10.2483264,12.084097 C10.6211297,12.084097 10.8972803,12.1568733 11.0905858,12.3097035 C11.2838912,12.4552561 11.408159,12.7026954 11.4771967,13.0374663 L12.2228033,13.0374663 C12.174477,12.4698113 11.9811715,12.0549865 11.6359833,11.7857143 C11.3115063,11.5237197 10.8627615,11.4 10.289749,11.4 C9.76506276,11.4 9.33012552,11.5237197 8.98493724,11.771159 C8.61903766,12.0331536 8.43953975,12.3897574 8.43953975,12.848248 C8.43953975,13.2994609 8.62594142,13.6487871 9.00564854,13.8889488 C9.15753138,13.9762803 9.53033473,14.1145553 10.1378661,14.3183288 C10.6832636,14.4929919 11.0077406,14.609434 11.1182008,14.667655 C11.4288703,14.8350404 11.5876569,15.0606469 11.5876569,15.351752 C11.5876569,15.5846361 11.4771967,15.7665768 11.2562762,15.8975741 C11.0353556,16.0285714 10.7384937,16.1013477 10.3656904,16.1013477 C9.95146444,16.1013477 9.64769874,16.0212938 9.44748954,15.861186 C9.22656904,15.6865229 9.08849372,15.3881402 9.0332636,14.980593 L8.2876569,14.980593 C8.3290795,15.6355795 8.55,16.115903 8.95732218,16.4215633 C9.29560669,16.6690027 9.76506276,16.8 10.3656904,16.8 Z M14.8324268,16.8 C15.4537657,16.8 15.9370293,16.6690027 16.2822176,16.4070081 C16.6274059,16.1377358 16.8,15.7738544 16.8,15.3080863 C16.8,14.8277628 16.5859833,14.4566038 16.1648536,14.1873315 C15.9715481,14.0636119 15.5366109,13.8962264 14.8738494,13.6778976 C14.4112971,13.532345 14.1282427,13.4231806 14.0177824,13.3576819 C13.7692469,13.219407 13.6518828,13.0374663 13.6518828,12.8045822 C13.6518828,12.5425876 13.7554393,12.3533693 13.9694561,12.2369272 C14.1420502,12.1350404 14.3905858,12.084097 14.7150628,12.084097 C15.0878661,12.084097 15.3640167,12.1568733 15.5573222,12.3097035 C15.7506276,12.4552561 15.8748954,12.7026954 15.9439331,13.0374663 L16.6895397,13.0374663 C16.6412134,12.4698113 16.4479079,12.0549865 16.1027197,11.7857143 C15.7782427,11.5237197 15.3294979,11.4 14.7564854,11.4 C14.2317992,11.4 13.7968619,11.5237197 13.4516736,11.771159 C13.0857741,12.0331536 12.9062762,12.3897574 12.9062762,12.848248 C12.9062762,13.2994609 13.0926778,13.6487871 13.4723849,13.8889488 C13.6242678,13.9762803 13.9970711,14.1145553 14.6046025,14.3183288 C15.15,14.4929919 15.474477,14.609434 15.5849372,14.667655 C15.8956067,14.8350404 16.0543933,15.0606469 16.0543933,15.351752 C16.0543933,15.5846361 15.9439331,15.7665768 15.7230126,15.8975741 C15.5020921,16.0285714 15.2052301,16.1013477 14.8324268,16.1013477 C14.4182008,16.1013477 14.1144351,16.0212938 13.9142259,15.861186 C13.6933054,15.6865229 13.5552301,15.3881402 13.5,14.980593 L12.7543933,14.980593 C12.7958159,15.6355795 13.0167364,16.115903 13.4240586,16.4215633 C13.7623431,16.6690027 14.2317992,16.8 14.8324268,16.8 Z" id="VSS" fill="#FFFFFF"></path>
6293
+ </g>
6294
+ </g>
6295
+ </svg>`;
6296
+ const xls = `<?xml version="1.0" encoding="UTF-8"?>
6297
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6298
+ <title>1.Base基础/1.icon图标/12.文件类型/XLS</title>
6299
+ <g id="1.Base基础/1.icon图标/12.文件类型/XLS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6300
+ <g id="excel" transform="translate(1.800000, 0.000000)">
6301
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#14BC64"></path>
6302
+ <polygon id="x" stroke="#10B981" stroke-width="0.5" fill="#FFFFFF" fill-rule="nonzero" points="8.01923077 18 10.2161538 14.7992263 12.3969231 18 14.4 18 11.1530769 13.5319149 14.0446154 9.6 12.0415385 9.6 10.2161538 12.2646035 8.37461538 9.6 6.37153846 9.6 9.26307692 13.5319149 6 18"></polygon>
6303
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" fill-rule="nonzero" opacity="0.400000006"></path>
6304
+ </g>
6305
+ </g>
6306
+ </svg>`;
6307
+ const xsd = `<?xml version="1.0" encoding="UTF-8"?>
6308
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6309
+ <title>1.Base基础/1.icon图标/12.文件类型/XSD</title>
6310
+ <g id="1.Base基础/1.icon图标/12.文件类型/XSD" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6311
+ <g id="xsd" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6312
+ <path d="M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z" id="路径" fill="#53ADEF"></path>
6313
+ <path d="M4.48846154,16.6981132 L5.76437247,14.6385445 L7.0402834,16.6981132 L7.92874494,16.6981132 L6.198583,14.0126685 L7.81518219,11.5018868 L6.92672065,11.5018868 L5.76437247,13.3795148 L4.60202429,11.5018868 L3.71356275,11.5018868 L5.31680162,14.0126685 L3.6,16.6981132 L4.48846154,16.6981132 Z M10.1732794,16.8 C10.7744939,16.8 11.2421053,16.6690027 11.5761134,16.4070081 C11.9101215,16.1377358 12.0771255,15.7738544 12.0771255,15.3080863 C12.0771255,14.8277628 11.8700405,14.4566038 11.4625506,14.1873315 C11.2755061,14.0636119 10.8546559,13.8962264 10.2133603,13.6778976 C9.76578947,13.532345 9.49190283,13.4231806 9.38502024,13.3576819 C9.14453441,13.219407 9.03097166,13.0374663 9.03097166,12.8045822 C9.03097166,12.5425876 9.13117409,12.3533693 9.33825911,12.2369272 C9.50526316,12.1350404 9.74574899,12.084097 10.0597166,12.084097 C10.4204453,12.084097 10.6876518,12.1568733 10.8746964,12.3097035 C11.0617409,12.4552561 11.1819838,12.7026954 11.2487854,13.0374663 L11.9702429,13.0374663 C11.9234818,12.4698113 11.7364372,12.0549865 11.4024291,11.7857143 C11.0884615,11.5237197 10.654251,11.4 10.0997976,11.4 C9.59210526,11.4 9.17125506,11.5237197 8.83724696,11.771159 C8.48319838,12.0331536 8.30951417,12.3897574 8.30951417,12.848248 C8.30951417,13.2994609 8.48987854,13.6487871 8.85728745,13.8889488 C9.00425101,13.9762803 9.36497976,14.1145553 9.95283401,14.3183288 C10.4805668,14.4929919 10.7945344,14.609434 10.901417,14.667655 C11.2020243,14.8350404 11.355668,15.0606469 11.355668,15.351752 C11.355668,15.5846361 11.2487854,15.7665768 11.0350202,15.8975741 C10.8212551,16.0285714 10.5340081,16.1013477 10.1732794,16.1013477 C9.77246964,16.1013477 9.47854251,16.0212938 9.28481781,15.861186 C9.07105263,15.6865229 8.93744939,15.3881402 8.8840081,14.980593 L8.16255061,14.980593 C8.20263158,15.6355795 8.41639676,16.115903 8.81052632,16.4215633 C9.13785425,16.6690027 9.59210526,16.8 10.1732794,16.8 Z M14.4753036,16.6981132 C15.2435223,16.6981132 15.8246964,16.4652291 16.2255061,15.9994609 C16.6062753,15.548248 16.8,14.9150943 16.8,14.1 C16.8,13.277628 16.6129555,12.6444744 16.2388664,12.2078167 C15.8380567,11.7347709 15.2568826,11.5018868 14.488664,11.5018868 L12.7518219,11.5018868 L12.7518219,16.6981132 L14.4753036,16.6981132 Z M14.3417004,16.0212938 L13.4799595,16.0212938 L13.4799595,12.1787062 L14.3550607,12.1787062 C14.9562753,12.1787062 15.397166,12.3315364 15.6777328,12.6444744 C15.9449393,12.9501348 16.0852227,13.4304582 16.0852227,14.1 C16.0852227,14.7549865 15.9449393,15.23531 15.6710526,15.548248 C15.3904858,15.861186 14.942915,16.0212938 14.3417004,16.0212938 Z" id="XSD" fill="#FFFFFF"></path>
6314
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6315
+ </g>
6316
+ </g>
6317
+ </svg>`;
6318
+ const zip = `<?xml version="1.0" encoding="UTF-8"?>
6319
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6320
+ <title>1.Base基础/1.icon图标/12.文件类型/ZIP</title>
6321
+ <g id="1.Base基础/1.icon图标/12.文件类型/ZIP" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6322
+ <g id="rar" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
6323
+ <path d="M10.9766879,14.4620385 L10.9766879,15.9938365 L9.42325733,15.9938365 L9.42325733,14.4620385 L10.9766879,14.4620385 Z M14.4,0 L2.79611465,0 C1.25186323,0 0,1.23445202 0,2.75725265 L0,21.2427743 C0,22.765548 1.25186323,24 2.79611465,24 L17.6038853,24 C19.1481368,24 20.4,22.765548 20.4,21.2427744 L20.4,6 C20.4,6 14.4,0 14.4,0 Z M11.7533757,16.759749 L8.64656949,16.759749 L8.64656949,12.164355 L11.7533757,12.164355 L11.7533757,16.759749 Z M11.7534031,5.27127736 L10.2,5.27127736 L10.2,6.80307537 L11.7534031,6.80307537 L11.7534031,8.33487339 L10.2,8.33487339 L10.2,9.8666714 L11.7534031,9.8666714 L11.7534031,11.3984694 L10.1999726,11.3984694 L10.1999726,9.8666714 L8.64656949,9.8666714 L8.64656949,8.33487339 L10.1999726,8.33487339 L10.1999726,6.80307537 L8.64656949,6.80307537 L8.64656949,5.27127736 L10.1999726,5.27127736 L10.1999726,3.73947935 L8.64656949,3.73947935 L8.64656949,2.20768134 L10.2,2.20768134 L10.2,3.73947935 L11.7534031,3.73947935 L11.7534031,5.27127736 Z" id="形状" fill="#667580"></path>
6324
+ <path d="M14.4,0 L20.4,6 L15.6,6 C14.9372583,6 14.4,5.4627417 14.4,4.8 L14.4,0 L14.4,0 Z" id="矩形" fill="#FFFFFF" opacity="0.400000006"></path>
6325
+ </g>
6326
+ </g>
6327
+ </svg>`;
6328
+
6329
+ var fileIcons = /*#__PURE__*/Object.freeze({
6330
+ __proto__: null,
6331
+ apk: apk,
6332
+ bak: bak,
6333
+ bat: bat,
6334
+ cs: cs,
6335
+ css: css,
6336
+ csv: csv,
6337
+ defaultFile: defaultFile,
6338
+ doc: doc,
6339
+ exe: exe,
6340
+ fla: fla,
6341
+ html: html,
6342
+ img: img,
6343
+ ipa: ipa,
6344
+ java: java,
6345
+ js: js,
6346
+ key: key,
6347
+ mp3: mp3,
6348
+ page: page,
6349
+ pdf: pdf,
6350
+ php: php,
6351
+ ppt: ppt,
6352
+ rar: rar,
6353
+ snippet: snippet,
6354
+ swf: swf,
6355
+ ttf: ttf,
6356
+ txt: txt,
6357
+ video: video,
6358
+ vss: vss,
6359
+ xls: xls,
6360
+ xsd: xsd,
6361
+ zip: zip
6362
+ });
6363
+
6364
+ function parseSVGToCanvasObjects(svgString) {
6365
+ const parser = new DOMParser();
6366
+ const svgDoc = parser.parseFromString(svgString, 'image/svg+xml');
6367
+ const elements = svgDoc.querySelectorAll('path, polyline, polygon');
6368
+ const canvasObjects = [];
6369
+ elements.forEach((element) => {
6370
+ let d;
6371
+ if (element.tagName === 'path') {
6372
+ d = element.getAttribute('d');
6373
+ }
6374
+ else if (element.tagName === 'polyline' || element.tagName === 'polygon') {
6375
+ const points = element.getAttribute('points') || '';
6376
+ const pointArray = points.split(/\s+|,/).filter(Boolean);
6377
+ d = 'M' + pointArray[0] + ' ' + pointArray[1];
6378
+ for (let i = 2; i < pointArray.length; i += 2) {
6379
+ d += ' L' + pointArray[i] + ' ' + pointArray[i + 1];
6380
+ }
6381
+ if (element.tagName === 'polygon') {
6382
+ d += ' Z';
6383
+ }
6384
+ }
6385
+ const fill = element.getAttribute('fill') || 'black';
6386
+ const stroke = 'none';
6387
+ const strokeWidth = element.getAttribute('stroke-width') || 0;
6388
+ const opacity = parseFloat(element?.getAttribute('opacity') || '1');
6389
+ const fillRule = element.getAttribute('fill-rule') || 'nonzero';
6390
+ if (d) {
6391
+ canvasObjects.push({
6392
+ d,
6393
+ fill,
6394
+ stroke,
6395
+ strokeWidth,
6396
+ opacity,
6397
+ fillRule: fillRule
6398
+ });
6399
+ }
6400
+ });
6401
+ return canvasObjects;
6402
+ }
6403
+ const FileIcons = (() => {
6404
+ const result = {};
6405
+ Object.entries(fileIcons).forEach((fileIcon) => {
6406
+ result[fileIcon[0]] = parseSVGToCanvasObjects(fileIcon[1]);
6407
+ });
6408
+ return result;
6409
+ })();
6410
+
6411
+ function getFileThumbnailName(ext) {
6412
+ let result = 'defaultFile';
6413
+ switch (ext) {
6414
+ case 'doc':
6415
+ case 'docx':
6416
+ result = 'doc';
6417
+ break;
6418
+ case 'ppt':
6419
+ case 'pptx':
6420
+ result = 'ppt';
6421
+ break;
6422
+ case 'xls':
6423
+ case 'xlsx':
6424
+ result = 'xls';
6425
+ break;
6426
+ case 'css':
6427
+ case 'scss':
6428
+ case 'sass':
6429
+ case 'less':
6430
+ result = 'css';
6431
+ break;
6432
+ case 'png':
6433
+ case 'jpeg':
6434
+ case 'jpg':
6435
+ case 'gif':
6436
+ case 'bmp':
6437
+ case 'svg':
6438
+ result = 'img';
6439
+ break;
6440
+ case 'mp4':
6441
+ case 'mkv':
6442
+ case 'webm':
6443
+ case 'mov':
6444
+ case 'flv':
6445
+ case '3gp':
6446
+ case 'mpv':
6447
+ case 'avi':
6448
+ case 'mpeg':
6449
+ case 'wmv':
6450
+ result = 'video';
6451
+ break;
6452
+ case 'mp3':
6453
+ case 'wma':
6454
+ case 'wav':
6455
+ case 'ape':
6456
+ case 'flac':
6457
+ case 'ogg':
6458
+ case 'm4r':
6459
+ case 'm4a':
6460
+ result = 'mp3';
6461
+ break;
6462
+ case 'pdf':
6463
+ case 'txt':
6464
+ case 'apk':
6465
+ case 'bak':
6466
+ case 'cs':
6467
+ case 'csv':
6468
+ case 'exe':
6469
+ case 'fla':
6470
+ case 'html':
6471
+ case 'ipa':
6472
+ case 'java':
6473
+ case 'js':
6474
+ case 'php':
6475
+ case 'rar':
6476
+ case 'swf':
6477
+ case 'ttf':
6478
+ case 'vss':
6479
+ case 'xsd':
6480
+ case 'zip':
6481
+ case 'youdaonote':
6482
+ case 'evernote':
6483
+ case 'yinxiang':
6484
+ case 'quip':
6485
+ case 'onenote':
6486
+ case 'onedrive':
6487
+ case 'box':
6488
+ case 'shimo':
6489
+ case 'processon':
6490
+ result = ext;
6491
+ break;
6492
+ default:
6493
+ result = 'defaultFile';
6494
+ break;
6495
+ }
6496
+ return result;
6497
+ }
6498
+ function getFileThumbnailSvgString(ext) {
6499
+ let result = 'defaultFile';
6500
+ switch (ext) {
6501
+ case 'doc':
6502
+ case 'docx':
6503
+ result = doc;
6504
+ break;
6505
+ case 'ppt':
6506
+ case 'pptx':
6507
+ result = ppt;
6508
+ break;
6509
+ case 'xls':
6510
+ case 'xlsx':
6511
+ result = xls;
6512
+ break;
6513
+ case 'css':
6514
+ case 'scss':
6515
+ case 'sass':
6516
+ case 'less':
6517
+ result = css;
6518
+ break;
6519
+ case 'png':
6520
+ case 'jpeg':
6521
+ case 'jpg':
6522
+ case 'gif':
6523
+ case 'bmp':
6524
+ case 'svg':
6525
+ result = img;
6526
+ break;
6527
+ case 'mp4':
6528
+ case 'mkv':
6529
+ case 'webm':
6530
+ case 'mov':
6531
+ case 'flv':
6532
+ case '3gp':
6533
+ case 'mpv':
6534
+ case 'avi':
6535
+ case 'mpeg':
6536
+ case 'wmv':
6537
+ result = video;
6538
+ break;
6539
+ case 'mp3':
6540
+ case 'wma':
6541
+ case 'wav':
6542
+ case 'ape':
6543
+ case 'flac':
6544
+ case 'ogg':
6545
+ case 'm4r':
6546
+ case 'm4a':
6547
+ result = mp3;
6548
+ break;
6549
+ case 'pdf':
6550
+ result = pdf;
6551
+ break;
6552
+ case 'txt':
6553
+ result = txt;
6554
+ break;
6555
+ case 'apk':
6556
+ result = apk;
6557
+ break;
6558
+ case 'bak':
6559
+ result = apk;
6560
+ break;
6561
+ case 'cs':
6562
+ result = cs;
6563
+ break;
6564
+ case 'csv':
6565
+ result = csv;
6566
+ break;
6567
+ case 'exe':
6568
+ result = exe;
6569
+ break;
6570
+ case 'fla':
6571
+ result = fla;
6572
+ break;
6573
+ case 'html':
6574
+ result = html;
6575
+ break;
6576
+ case 'ipa':
6577
+ result = ipa;
6578
+ break;
6579
+ case 'java':
6580
+ result = java;
6581
+ break;
6582
+ case 'js':
6583
+ result = js;
6584
+ break;
6585
+ case 'php':
6586
+ result = php;
6587
+ break;
6588
+ case 'rar':
6589
+ result = rar;
6590
+ break;
6591
+ case 'swf':
6592
+ result = swf;
6593
+ break;
6594
+ case 'ttf':
6595
+ result = ttf;
6596
+ break;
6597
+ case 'vss':
6598
+ result = vss;
6599
+ break;
6600
+ case 'xsd':
6601
+ result = xsd;
6602
+ break;
6603
+ case 'zip':
6604
+ result = zip;
6605
+ break;
6606
+ default:
6607
+ result = defaultFile;
6608
+ break;
6609
+ }
6610
+ return result;
6611
+ }
6612
+ function getFileCanvasPaths(ext) {
6613
+ const fileThumbnailName = getFileThumbnailName(ext);
6614
+ return FileIcons[fileThumbnailName];
6615
+ }
6616
+
5207
6617
  /**
5208
6618
  * 处理和渲染表格单元格的内容
5209
6619
  */
@@ -5250,6 +6660,8 @@ class CellDrawer extends Drawer {
5250
6660
  case AITableFieldType.createdBy:
5251
6661
  case AITableFieldType.updatedBy:
5252
6662
  return this.renderCellMember(render, ctx);
6663
+ case AITableFieldType.attachment:
6664
+ return this.renderCellAttachment(render, ctx);
5253
6665
  default:
5254
6666
  return null;
5255
6667
  }
@@ -5810,6 +7222,75 @@ class CellDrawer extends Drawer {
5810
7222
  }
5811
7223
  }
5812
7224
  }
7225
+ renderCellAttachment(render, ctx) {
7226
+ const { references, x, y, field, transformValue: _cellValue, rowHeight, columnWidth, isActive } = render;
7227
+ const cellValue = _cellValue;
7228
+ if (!cellValue?.length || !references) {
7229
+ return;
7230
+ }
7231
+ const fileIconSize = AI_TABLE_FILE_ICON_SIZE;
7232
+ const itemHeight = AI_TABLE_FILE_ICON_ITEM_HEIGHT;
7233
+ const isOperating = isActive;
7234
+ let currentX = AI_TABLE_CELL_PADDING;
7235
+ let currentY = (AI_TABLE_ROW_BLANK_HEIGHT - fileIconSize) / 2;
7236
+ const itemOtherWidth = fileIconSize + AI_TABLE_FIELD_ITEM_MARGIN_RIGHT;
7237
+ const maxHeight = isActive ? 130 - AI_TABLE_CELL_MULTI_PADDING_TOP : rowHeight - AI_TABLE_CELL_MULTI_PADDING_TOP;
7238
+ const maxTextWidth = isOperating
7239
+ ? columnWidth - 2 * AI_TABLE_CELL_PADDING - itemOtherWidth - AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE - 12
7240
+ : columnWidth - 2 * AI_TABLE_CELL_PADDING - itemOtherWidth;
7241
+ const listCount = cellValue.length;
7242
+ let isOverflow = false;
7243
+ for (let index = 0; index < listCount; index++) {
7244
+ const attachmentInfo = references.attachments[cellValue[index]];
7245
+ if (!attachmentInfo)
7246
+ continue;
7247
+ const { title, addition } = attachmentInfo;
7248
+ const itemWidth = AI_TABLE_FILE_ICON_SIZE + AI_TABLE_FIELD_ITEM_MARGIN_RIGHT;
7249
+ currentX = AI_TABLE_CELL_PADDING + index * itemWidth;
7250
+ let realMaxTextWidth = maxTextWidth < 0 ? 0 : maxTextWidth;
7251
+ if (index === 0 && isOperating) {
7252
+ const operatingMaxWidth = maxTextWidth - (AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE + 4);
7253
+ // item No space to display, then perform a line feed
7254
+ if (operatingMaxWidth <= 20) {
7255
+ currentX = AI_TABLE_CELL_PADDING;
7256
+ currentY += AI_TABLE_OPTION_ITEM_HEIGHT + AI_TABLE_CELL_MULTI_ITEM_MARGIN_TOP;
7257
+ }
7258
+ else {
7259
+ realMaxTextWidth = operatingMaxWidth;
7260
+ }
7261
+ }
7262
+ if (columnWidth != null) {
7263
+ // 在非活动状态下,当超出列宽时,不会渲染后续内容
7264
+ if (currentX >= columnWidth - 2 * AI_TABLE_CELL_PADDING) {
7265
+ break;
7266
+ }
7267
+ // 如果不是非活动状态的最后一行,则换行渲染溢出内容
7268
+ if (currentX > columnWidth - 2 * AI_TABLE_CELL_PADDING) {
7269
+ currentX = AI_TABLE_CELL_PADDING;
7270
+ }
7271
+ if (currentX + itemWidth > columnWidth - AI_TABLE_CELL_PADDING) {
7272
+ currentX = AI_TABLE_CELL_PADDING;
7273
+ currentY += itemHeight;
7274
+ }
7275
+ if (currentY >= maxHeight) {
7276
+ isOverflow = true;
7277
+ }
7278
+ }
7279
+ const svgString = getFileThumbnailSvgString(addition?.ext);
7280
+ const img = new Image();
7281
+ img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}`;
7282
+ if (ctx) {
7283
+ this.image({
7284
+ name: img.src,
7285
+ x: x + currentX,
7286
+ y: y + currentY,
7287
+ url: img.src,
7288
+ width: AI_TABLE_FILE_ICON_SIZE,
7289
+ height: AI_TABLE_FILE_ICON_SIZE
7290
+ });
7291
+ }
7292
+ }
7293
+ }
5813
7294
  }
5814
7295
  const cellDrawer = new CellDrawer();
5815
7296
 
@@ -6168,6 +7649,9 @@ class AITableFieldIcon {
6168
7649
  case AITableFieldType.progress:
6169
7650
  data = ColumnProgressFilledPath;
6170
7651
  break;
7652
+ case AITableFieldType.attachment:
7653
+ data = AttachmentPath;
7654
+ break;
6171
7655
  }
6172
7656
  return {
6173
7657
  x,
@@ -6353,10 +7837,10 @@ const createColumnHeads = (config) => {
6353
7837
  const colors = Colors;
6354
7838
  const { columnCount, rowInitSize: fieldHeadHeight } = coordinate;
6355
7839
  const { columnIndex: pointColumnIndex, targetName: pointTargetName } = pointPosition;
6356
- const { fields } = aiTable;
7840
+ const fields = aiTable.gridData().fields;
6357
7841
  const getFieldHeadStatus = (fieldId) => {
6358
- const iconVisible = [AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_MORE].includes(pointTargetName) && fields()[pointColumnIndex]?._id === fieldId;
6359
- const isHoverIcon = pointTargetName === AI_TABLE_FIELD_HEAD_MORE && fields()[pointColumnIndex]?._id === fieldId;
7842
+ const iconVisible = [AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_MORE].includes(pointTargetName) && fields[pointColumnIndex]?._id === fieldId;
7843
+ const isHoverIcon = pointTargetName === AI_TABLE_FIELD_HEAD_MORE && fields[pointColumnIndex]?._id === fieldId;
6360
7844
  const isSelected = aiTable.selection().selectedFields.has(fieldId);
6361
7845
  return {
6362
7846
  iconVisible,
@@ -6375,7 +7859,7 @@ const createColumnHeads = (config) => {
6375
7859
  break;
6376
7860
  if (columnIndex < 0)
6377
7861
  continue;
6378
- const field = fields()[columnIndex];
7862
+ const field = fields[columnIndex];
6379
7863
  if (field == null)
6380
7864
  continue;
6381
7865
  const x = coordinate.getColumnOffset(columnIndex);
@@ -7103,12 +8587,159 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7103
8587
  ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koMouseup)=\"stageMouseup($event)\"\n (koContextmenu)=\"stageContextmenu($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n <ai-table-hover-cell [config]=\"cellsConfig()\"></ai-table-hover-cell>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
7104
8588
  }] });
7105
8589
 
8590
+ class AITableDragComponent {
8591
+ constructor() {
8592
+ this.dragEnd = output();
8593
+ this.aiTableGridSelectionService = inject(AITableGridSelectionService);
8594
+ this.render2 = inject(Renderer2);
8595
+ this.elementRef = inject((ElementRef));
8596
+ this.draggedData = null;
8597
+ this.mouseStartPosition = null;
8598
+ this.aiTableDrag = null;
8599
+ effect(() => {
8600
+ const drag = this.aiTableGridSelectionService.aiTable.dragState?.();
8601
+ if (drag && drag.sourceIds.size > 0) {
8602
+ if (!this.rect || !this.line) {
8603
+ return;
8604
+ }
8605
+ this.aiTableDrag = drag;
8606
+ }
8607
+ else {
8608
+ this.aiTableDrag = null;
8609
+ }
8610
+ });
8611
+ }
8612
+ ngOnInit() {
8613
+ this.rect = this.elementRef.nativeElement.querySelector('.rect');
8614
+ this.line = this.elementRef.nativeElement.querySelector('.line');
8615
+ this.mousedownListener = this.render2.listen('window', 'mousedown', (e) => {
8616
+ this.mouseStartPosition = { x: e.x, y: e.y };
8617
+ });
8618
+ this.mousemoveListener = this.render2.listen('window', 'mousemove', (e) => {
8619
+ if (this.timer) {
8620
+ cancelAnimationFrame(this.timer);
8621
+ }
8622
+ this.timer = requestAnimationFrame(() => {
8623
+ if (this.mouseStartPosition && this.aiTableDrag) {
8624
+ this.handleDrag(e, this.aiTableDrag);
8625
+ }
8626
+ });
8627
+ });
8628
+ this.mouseupListener = this.render2.listen('window', 'mouseup', () => {
8629
+ this.mouseStartPosition = null;
8630
+ this.aiTableDrag = null;
8631
+ this.handleDragEnd();
8632
+ });
8633
+ }
8634
+ handleDrag(e, drag) {
8635
+ if (drag.type !== DragType.none) {
8636
+ this.render2.setStyle(this.elementRef.nativeElement, 'display', 'block');
8637
+ }
8638
+ else {
8639
+ return;
8640
+ }
8641
+ const moveX = e.x - this.mouseStartPosition.x;
8642
+ const aiTable = this.aiTableGridSelectionService.aiTable;
8643
+ const scroll = drag.scroll || { x: 0, y: 0 };
8644
+ const coordinate = drag.coordinate;
8645
+ switch (drag.type) {
8646
+ case DragType.field:
8647
+ const fields = aiTable.gridData().fields;
8648
+ let width = 0;
8649
+ fields.forEach((field, index) => {
8650
+ if (drag.sourceIds.has(field._id)) {
8651
+ width += coordinate.columnIndicesSizeMap[index] || 0;
8652
+ }
8653
+ });
8654
+ const visibleColumnIndexMap = aiTable.context.visibleColumnsIndexMap();
8655
+ const sourceColumnIndex = visibleColumnIndexMap.get(drag.sourceIds.values().next().value) || 0;
8656
+ const sourceColumnStartX = coordinate.getColumnOffset(sourceColumnIndex);
8657
+ const sourceColumnWidth = coordinate.getColumnWidth(sourceColumnIndex);
8658
+ // TODO: 目前默认第一列为冻结列,后期支持设置冻结列需要处理
8659
+ const isSourceColumnFrozen = sourceColumnIndex === 0;
8660
+ const pointerX = moveX + sourceColumnStartX;
8661
+ // 拖拽中心点
8662
+ const dragCenter = sourceColumnWidth / 2;
8663
+ let targetColumnIndex = coordinate.getColumnStartIndex(pointerX + (isSourceColumnFrozen ? scroll.x : 0) + dragCenter);
8664
+ let targetColumnStartX = coordinate.getColumnOffset(targetColumnIndex);
8665
+ this.render2.setStyle(this.rect, 'cursor', 'move');
8666
+ this.render2.setStyle(this.rect, 'width', `${width}px`);
8667
+ this.render2.setStyle(this.rect, 'height', `100%`);
8668
+ this.render2.setStyle(this.rect, 'top', 0);
8669
+ this.render2.setStyle(this.rect, 'left', `${pointerX - (isSourceColumnFrozen ? 0 : scroll.x)}px`);
8670
+ const lastColumnOffset = coordinate.getColumnOffset(coordinate.columnCount - 1);
8671
+ const lastColumnWidth = coordinate.getColumnWidth(coordinate.columnCount - 1);
8672
+ let isLastColumn = false;
8673
+ // 处理最后一列
8674
+ if (pointerX + dragCenter > lastColumnOffset + lastColumnWidth) {
8675
+ targetColumnIndex = coordinate.columnCount;
8676
+ targetColumnStartX = lastColumnOffset + lastColumnWidth;
8677
+ isLastColumn = true;
8678
+ }
8679
+ if ((targetColumnIndex >= 0 && (targetColumnIndex - sourceColumnIndex > 1 || targetColumnIndex - sourceColumnIndex < 0)) ||
8680
+ isLastColumn) {
8681
+ this.render2.setStyle(this.line, 'width', `2px`);
8682
+ this.render2.setStyle(this.line, 'height', `100%`);
8683
+ this.render2.setStyle(this.line, 'top', 0);
8684
+ this.render2.setStyle(this.line, 'left', `${targetColumnStartX - scroll.x}px`);
8685
+ const fieldsIndex = [];
8686
+ drag.sourceIds.forEach((id) => {
8687
+ const index = visibleColumnIndexMap.get(id) || 0;
8688
+ fieldsIndex.push(index);
8689
+ });
8690
+ // 向右移动目标在目标列的前一列
8691
+ if (targetColumnIndex > sourceColumnIndex) {
8692
+ targetColumnIndex -= 1;
8693
+ }
8694
+ this.draggedData = { type: DragType.field, targetIndex: targetColumnIndex, fieldIds: drag.sourceIds, fieldsIndex };
8695
+ }
8696
+ else {
8697
+ this.render2.setStyle(this.line, 'width', 0);
8698
+ this.draggedData = null;
8699
+ }
8700
+ break;
8701
+ case DragType.record:
8702
+ break;
8703
+ case DragType.columnWidth:
8704
+ break;
8705
+ }
8706
+ }
8707
+ handleDragEnd() {
8708
+ this.render2.setStyle(this.elementRef.nativeElement, 'display', 'none');
8709
+ if (this.draggedData) {
8710
+ this.dragEnd.emit({ ...this.draggedData });
8711
+ this.draggedData = null;
8712
+ }
8713
+ }
8714
+ ngOnDestroy() {
8715
+ if (this.mousedownListener)
8716
+ this.mousedownListener();
8717
+ if (this.mousemoveListener)
8718
+ this.mousemoveListener();
8719
+ if (this.mouseupListener)
8720
+ this.mouseupListener();
8721
+ if (this.timer) {
8722
+ cancelAnimationFrame(this.timer);
8723
+ this.timer = null;
8724
+ }
8725
+ }
8726
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDragComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8727
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AITableDragComponent, isStandalone: true, selector: "ai-table-drag", outputs: { dragEnd: "dragEnd" }, host: { classAttribute: "drag-container" }, ngImport: i0, template: "<div class=\"rect\"></div>\n<div class=\"line\"></div>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8728
+ }
8729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDragComponent, decorators: [{
8730
+ type: Component,
8731
+ args: [{ selector: 'ai-table-drag', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
8732
+ class: 'drag-container'
8733
+ }, template: "<div class=\"rect\"></div>\n<div class=\"line\"></div>" }]
8734
+ }], ctorParameters: () => [] });
8735
+
7106
8736
  class AITableGrid extends AITableGridBase {
7107
8737
  constructor() {
7108
8738
  super();
7109
8739
  this.viewContainerRef = inject(ViewContainerRef);
7110
8740
  this.isDragSelecting = false;
7111
8741
  this.dragSelectionStart = null;
8742
+ this.notifyService = inject(ThyNotifyService);
7112
8743
  this.fieldHeadHeight = AI_TABLE_FIELD_HEAD_HEIGHT;
7113
8744
  this.containerRect = signal({ width: 0, height: 0 });
7114
8745
  this.frozenColumnCount = signal(1);
@@ -7146,6 +8777,7 @@ class AITableGrid extends AITableGridBase {
7146
8777
  });
7147
8778
  return {
7148
8779
  aiTable: this.aiTable,
8780
+ gridData: this.gridData(),
7149
8781
  container: this.containerElement(),
7150
8782
  coordinate: coordinate,
7151
8783
  containerWidth: this.containerRect().width,
@@ -7201,6 +8833,7 @@ class AITableGrid extends AITableGridBase {
7201
8833
  this.bindGlobalMousedown();
7202
8834
  this.containerResizeListener();
7203
8835
  this.bindWheel();
8836
+ this.bindClipboardShortcuts();
7204
8837
  });
7205
8838
  effect(() => {
7206
8839
  if (this.hasContainerRect() && this.horizontalBarRef() && this.verticalBarRef()) {
@@ -7313,6 +8946,7 @@ class AITableGrid extends AITableGridBase {
7313
8946
  if (!fieldId)
7314
8947
  return;
7315
8948
  this.aiTableGridSelectionService.selectField(fieldId);
8949
+ this.handleFieldDragStart();
7316
8950
  return;
7317
8951
  case AI_TABLE_CELL:
7318
8952
  if (!recordId || !fieldId)
@@ -7439,6 +9073,7 @@ class AITableGrid extends AITableGridBase {
7439
9073
  }
7440
9074
  setTimeout(() => {
7441
9075
  this.aiTableGridEventService.openCellEditor(this.aiTable, {
9076
+ viewContainerRef: this.viewContainerRef,
7442
9077
  container: this.containerElement(),
7443
9078
  coordinate: this.coordinate(),
7444
9079
  fieldId: fieldId,
@@ -7536,6 +9171,7 @@ class AITableGrid extends AITableGridBase {
7536
9171
  }
7537
9172
  setTimeout(() => {
7538
9173
  this.aiTableGridEventService.openCellEditor(this.aiTable, {
9174
+ viewContainerRef: this.viewContainerRef,
7539
9175
  container: this.containerElement(),
7540
9176
  coordinate: this.coordinate(),
7541
9177
  fieldId: fieldId,
@@ -7555,19 +9191,96 @@ class AITableGrid extends AITableGridBase {
7555
9191
  }
7556
9192
  }
7557
9193
  }
9194
+ bindClipboardShortcuts() {
9195
+ fromEvent(document, 'keydown')
9196
+ .pipe(filter((event) => (event.ctrlKey || event.metaKey) && (event.key === 'c' || event.key === 'v')), takeUntilDestroyed(this.destroyRef))
9197
+ .subscribe(async (event) => {
9198
+ if (event.key === 'c') {
9199
+ const clipboardData = buildClipboardData(this.aiTable);
9200
+ if (clipboardData) {
9201
+ writeToClipboard(clipboardData).then(() => {
9202
+ const copiedCellsCount = this.aiTable.selection().selectedCells.size;
9203
+ this.notifyService.success(`已复制 ${copiedCellsCount} 个单元格`, undefined, {
9204
+ placement: 'bottomLeft'
9205
+ });
9206
+ });
9207
+ }
9208
+ }
9209
+ else if (event.key === 'v') {
9210
+ event.preventDefault();
9211
+ const actions = {
9212
+ updateFieldValue: (data) => {
9213
+ this.aiUpdateFieldValue.emit(data);
9214
+ },
9215
+ setField: (field) => {
9216
+ this.aiSetField.emit(field);
9217
+ },
9218
+ addField: (data) => {
9219
+ this.aiAddField.emit(data);
9220
+ },
9221
+ addRecord: (data) => {
9222
+ this.addRecord();
9223
+ }
9224
+ };
9225
+ writeToAITable(this.aiTable, actions).then((isPasteSuccess) => {
9226
+ if (!isPasteSuccess) {
9227
+ this.notifyService.error('粘贴内容不符合当前类型', undefined, {
9228
+ placement: 'bottomLeft'
9229
+ });
9230
+ }
9231
+ });
9232
+ }
9233
+ });
9234
+ }
9235
+ handleFieldDragStart() {
9236
+ if (this.aiTableGridSelectionService.selectedFields.size > 0) {
9237
+ this.aiTableGridSelectionService.drag({
9238
+ type: DragType.field,
9239
+ sourceIds: this.aiTableGridSelectionService.selectedFields,
9240
+ scroll: this.getScrollPosition(),
9241
+ coordinate: this.coordinate()
9242
+ });
9243
+ }
9244
+ }
9245
+ getScrollPosition() {
9246
+ const horizontalBar = this.horizontalBarRef()?.nativeElement;
9247
+ const verticalBar = this.verticalBarRef()?.nativeElement;
9248
+ let scrollLeft = horizontalBar?.scrollLeft || 0;
9249
+ let scrollTop = verticalBar?.scrollTop || 0;
9250
+ return { x: scrollLeft, y: scrollTop };
9251
+ }
9252
+ dragEnd(data) {
9253
+ switch (data.type) {
9254
+ case DragType.field:
9255
+ if (data.fieldsIndex && isNumber(data.targetIndex)) {
9256
+ for (let i = 0; i < data.fieldsIndex.length; i++) {
9257
+ this.aiMoveField.emit({
9258
+ path: [data.fieldsIndex[i]],
9259
+ newPath: [data.targetIndex + i]
9260
+ });
9261
+ }
9262
+ }
9263
+ break;
9264
+ case DragType.columnWidth:
9265
+ break;
9266
+ case DragType.record:
9267
+ return;
9268
+ }
9269
+ this.aiTableGridSelectionService.clearDrag();
9270
+ }
7558
9271
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7559
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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 >\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</div>\n", dependencies: [{ kind: "component", type: AITableRenderer, selector: "ai-table-renderer", inputs: ["config"], outputs: ["koMousemove", "koMousedown", "koMouseup", "koContextmenu", "koWheel", "koClick", "koDblclick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9272
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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 >\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"] }, { kind: "component", type: AITableDragComponent, selector: "ai-table-drag", outputs: ["dragEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7560
9273
  }
7561
9274
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGrid, decorators: [{
7562
9275
  type: Component,
7563
9276
  args: [{ selector: 'ai-table-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
7564
9277
  class: 'ai-table-grid'
7565
- }, imports: [AITableRenderer], 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 >\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</div>\n" }]
9278
+ }, 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 >\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" }]
7566
9279
  }], ctorParameters: () => [] });
7567
9280
 
7568
9281
  /**
7569
9282
  * Generated bundle index. Do not edit.
7570
9283
  */
7571
9284
 
7572
- export { AITable, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableCheckType, AITableContextMenu, AITableDomGrid, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFieldType, AITableFilterOperation, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridSelectionService, AITableMemberType, AITableMouseDownType, AITableQueries, AITableRenderer, AITableRowColumnType, AITableRowType, AITableSelectAllState, AITableSelectOptionStyle, AITableStatType, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, AI_TABLE_CELL_MAX_ROW_COUNT, AI_TABLE_CELL_MEMBER_ITEM_HEIGHT, AI_TABLE_CELL_MEMBER_ITEM_PADDING, AI_TABLE_CELL_MEMBER_MAX_HEIGHT, AI_TABLE_CELL_MULTI_DOT_RADIUS, AI_TABLE_CELL_MULTI_ITEM_MARGIN_LEFT, AI_TABLE_CELL_MULTI_ITEM_MARGIN_TOP, AI_TABLE_CELL_MULTI_ITEM_MIN_WIDTH, AI_TABLE_CELL_MULTI_PADDING_LEFT, AI_TABLE_CELL_MULTI_PADDING_TOP, AI_TABLE_CELL_PADDING, AI_TABLE_COMMON_FONT_SIZE, AI_TABLE_DEFAULT_COLUMN_WIDTH, AI_TABLE_DOT_RADIUS, AI_TABLE_FIELD_ADD_BUTTON, AI_TABLE_FIELD_ADD_BUTTON_WIDTH, AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_HEIGHT, AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE, AI_TABLE_FIELD_HEAD_MORE, AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX, AI_TABLE_FIELD_HEAD_TEXT_MIN_WIDTH, AI_TABLE_FIELD_MAX_WIDTH, AI_TABLE_FIELD_MIDDLE_WIDTH, AI_TABLE_FIELD_MINI_WIDTH, AI_TABLE_FIELD_MIN_WIDTH, AI_TABLE_GRID_FIELD_SERVICE_MAP, AI_TABLE_ICON_COMMON_SIZE, AI_TABLE_MEMBER_AVATAR_SIZE, AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT, AI_TABLE_MEMBER_ITEM_PADDING_RIGHT, AI_TABLE_MIN_TEXT_WIDTH, AI_TABLE_OFFSET, AI_TABLE_OPTION_ITEM_FONT_SIZE, AI_TABLE_OPTION_ITEM_HEIGHT, AI_TABLE_OPTION_ITEM_PADDING, AI_TABLE_OPTION_ITEM_RADIUS, AI_TABLE_PIECE_RADIUS, AI_TABLE_PIECE_WIDTH, AI_TABLE_POPOVER_LEFT_OFFSET, AI_TABLE_PREVENT_CLEAR_SELECTION_CLASS, AI_TABLE_PROGRESS_BAR_HEIGHT, AI_TABLE_PROGRESS_BAR_RADIUS, AI_TABLE_PROGRESS_TEXT_Width, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AbstractEditCellEditor, AddOutlinedPath, Check, Colors, ColumnCalendarFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DepartmentOutlinedPath, Direction, FONT_SIZE_SM, FieldOptions, GRID_CELL_EDITOR_MAP, IsSelectRecordPipe, LinkCellEditorComponent, MIN_COLUMN_WIDTH, MOUSEOVER_EDIT_TYPE, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, ProgressEditorComponent, RatingCellEditorComponent, RendererContext, RowHeight, SelectCellEditorComponent, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextMeasure, Unchecked, UserPipe, ViewOperationMap, WebOutlinedPath, buildGridData, buildGridLinearRows, castToString, compareNumber, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getDefaultFieldValue, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getHoverCell, getHoverEditorBoxOffset, getHoverEditorSpace, getMousePosition, getPlaceHolderCellsConfigs, getTargetName, getTextWidth, getVisibleRangeInfo, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isArrayField, isCellMatchKeywords, isEmpty, isMac, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, stringInclude, textDataCache, transformCellValue, zhIntlCollator };
9285
+ export { AITable, AITableAreaType, AITableAvatarSize, AITableAvatarType, AITableCheckType, AITableContextMenu, AITableDomGrid, AITableFieldIsSameOptionPipe, AITableFieldSetting, AITableFieldType, AITableFilterOperation, AITableGrid, AITableGridEventService, AITableGridFieldService, AITableGridSelectionService, AITableMemberType, AITableMouseDownType, AITableQueries, AITableRenderer, AITableRowColumnType, AITableRowType, AITableSelectAllState, AITableSelectOptionStyle, AITableStatType, AI_TABLE_ACTION_COMMON_SIZE, AI_TABLE_BLANK, AI_TABLE_CELL, AI_TABLE_CELL_ACTIVE_BORDER_WIDTH, AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE, AI_TABLE_CELL_BORDER, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE, AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE_OFFSET, AI_TABLE_CELL_EMOJI_PADDING, AI_TABLE_CELL_EMOJI_SIZE, AI_TABLE_CELL_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_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_RADIUS, AI_TABLE_PROGRESS_TEXT_Width, AI_TABLE_ROW_ADD_BUTTON, AI_TABLE_ROW_BLANK_HEIGHT, AI_TABLE_ROW_HEAD, AI_TABLE_ROW_HEAD_SIZE, AI_TABLE_ROW_HEAD_WIDTH, AI_TABLE_ROW_HEIGHT, AI_TABLE_ROW_SELECT_CHECKBOX, AI_TABLE_SCROLL_BAR_PADDING, AI_TABLE_TAG_FONT_SIZE, AI_TABLE_TAG_PADDING, AI_TABLE_TEXT_GAP, AbstractEditCellEditor, AddOutlinedPath, AttachmentPath, Check, Colors, ColumnCalendarFilledPath, ColumnLinkOutlinedPath, ColumnMemberFilledPath, ColumnMultipleFillPath, ColumnNumberFilledPath, ColumnProgressFilledPath, ColumnRatingFilledPath, ColumnSelectFilledPath, ColumnTextFilledPath, Coordinate, DBL_CLICK_EDIT_TYPE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, DEFAULT_FONT_WEIGHT, DEFAULT_ICON_SHAPE, DEFAULT_ICON_SIZE, DEFAULT_POINT_POSITION, DEFAULT_SCROLL_STATE, DEFAULT_TEXT_ALIGN_CENTER, DEFAULT_TEXT_ALIGN_LEFT, DEFAULT_TEXT_ALIGN_RIGHT, DEFAULT_TEXT_DECORATION, DEFAULT_TEXT_ELLIPSIS, DEFAULT_TEXT_FILL, DEFAULT_TEXT_LINE_HEIGHT, DEFAULT_TEXT_LISTENING, DEFAULT_TEXT_MAX_CACHE, DEFAULT_TEXT_MAX_HEIGHT, DEFAULT_TEXT_SCALE, DEFAULT_TEXT_TRANSFORMS_ENABLED, DEFAULT_TEXT_VERTICAL_ALIGN_MIDDLE, DEFAULT_TEXT_VERTICAL_ALIGN_TOP, DEFAULT_TEXT_WRAP, DEFAULT_WRAP_TEXT_MAX_ROW, DateCellEditorComponent, DepartmentOutlinedPath, Direction, DragType, FONT_SIZE_SM, FieldModelMap, FieldOptions, GRID_CELL_EDITOR_MAP, IsSelectRecordPipe, LinkCellEditorComponent, MIN_COLUMN_WIDTH, MOUSEOVER_EDIT_TYPE, MemberSettingPipe, MoreStandOutlinedPath, NumberCellEditorComponent, ProgressEditorComponent, RatingCellEditorComponent, RendererContext, RowHeight, SelectCellEditorComponent, SelectOptionComponent, SelectOptionPipe, SelectOptionsPipe, SelectSettingPipe, StarFill, TextCellEditorComponent, TextMeasure, Unchecked, UserPipe, WebOutlinedPath, aiTableFragmentAttribute, buildClipboardData, buildGridData, buildGridLinearRows, castToString, compareNumber, compareString, createAITable, createActiveCellBorder, createCells, createDefaultField, createDefaultFieldName, extractLinkHref, extractText, generateTargetName, getAvatarBgColor, getAvatarShortName, getCellEditorBorderSpace, getCellHorizontalPosition, getColumnIndicesSizeMap, getDefaultFieldValue, getDetailByTargetName, getEditorBoxOffset, getEditorSpace, getFieldOptionByField, getFieldValue, getHoverCell, getHoverEditorBoxOffset, getHoverEditorSpace, getMousePosition, getPlaceHolderCellsConfigs, getSystemFieldValue, getTargetName, getTextWidth, getVisibleRangeInfo, handleMouseStyle, hasIntersect, idCreator, idsCreator, imageCache, isArrayField, isCellMatchKeywords, isClipboardReadSupported, isClipboardReadTextSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isEmpty, isMac, isNumberFiled, isSameFieldOption, isSelectedField, isSystemField, isWindows, isWindowsOS, isWithinFrozenColumnBoundary, readFromClipboard, scrollMax, setMouseStyle, shortIdCreator, shortIdsCreator, stringInclude, textDataCache, transformCellValue, writeToAITable, writeToClipboard, zhIntlCollator };
7573
9286
  //# sourceMappingURL=ai-table-grid.mjs.map