@ai-table/grid 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cell-editors/select/select-editor.component.d.ts +3 -1
- package/components/cell-editors/select/select-editor.component.d.ts.map +1 -1
- package/components/context-menu/context-menu.component.d.ts +4 -1
- package/components/context-menu/context-menu.component.d.ts.map +1 -1
- package/components/drag/drag.component.d.ts +26 -0
- package/components/drag/drag.component.d.ts.map +1 -0
- package/components/drag/drag.component.scss +19 -0
- package/constants/file-icon.d.ts +32 -0
- package/constants/file-icon.d.ts.map +1 -0
- package/constants/grid.d.ts.map +1 -1
- package/constants/icon.d.ts +1 -0
- package/constants/icon.d.ts.map +1 -1
- package/constants/table.d.ts +4 -0
- package/constants/table.d.ts.map +1 -1
- package/core/constants/field.d.ts.map +1 -1
- package/core/types/ai-table.d.ts +3 -1
- package/core/types/ai-table.d.ts.map +1 -1
- package/core/types/core.d.ts +33 -2
- package/core/types/core.d.ts.map +1 -1
- package/core/utils/common.d.ts +3 -3
- package/core/utils/common.d.ts.map +1 -1
- package/core/utils/field.d.ts.map +1 -1
- package/core/utils/queries.d.ts +3 -1
- package/core/utils/queries.d.ts.map +1 -1
- package/esm2022/components/cell-editors/select/select-editor.component.mjs +22 -21
- package/esm2022/components/context-menu/context-menu.component.mjs +17 -5
- package/esm2022/components/drag/drag.component.mjs +150 -0
- package/esm2022/constants/file-icon.mjs +342 -0
- package/esm2022/constants/grid.mjs +2 -1
- package/esm2022/constants/icon.mjs +2 -1
- package/esm2022/constants/table.mjs +6 -2
- package/esm2022/core/constants/field.mjs +7 -1
- package/esm2022/core/types/ai-table.mjs +2 -2
- package/esm2022/core/types/core.mjs +9 -1
- package/esm2022/core/utils/common.mjs +3 -2
- package/esm2022/core/utils/field.mjs +8 -3
- package/esm2022/core/utils/queries.mjs +19 -13
- package/esm2022/grid-base.component.mjs +5 -3
- package/esm2022/grid.component.mjs +90 -4
- package/esm2022/renderer/components/field-icon.component.mjs +5 -2
- package/esm2022/renderer/creations/create-heads.mjs +5 -5
- package/esm2022/renderer/drawers/cell-drawer.mjs +74 -2
- package/esm2022/renderer/drawers/drawer.mjs +11 -2
- package/esm2022/services/event.service.mjs +12 -5
- package/esm2022/services/selection.service.mjs +22 -3
- package/esm2022/types/clipboard.mjs +2 -0
- package/esm2022/types/grid.mjs +1 -1
- package/esm2022/types/index.mjs +2 -1
- package/esm2022/types/row.mjs +1 -1
- package/esm2022/utils/clipboard/clipboard.mjs +77 -0
- package/esm2022/utils/clipboard/copy.mjs +92 -0
- package/esm2022/utils/clipboard/extract.mjs +19 -0
- package/esm2022/utils/clipboard/index.mjs +5 -0
- package/esm2022/utils/clipboard/paste.mjs +180 -0
- package/esm2022/utils/field/model/attachment.mjs +63 -0
- package/esm2022/utils/field/model/date.mjs +45 -2
- package/esm2022/utils/field/model/field.mjs +1 -1
- package/esm2022/utils/field/model/index.mjs +5 -3
- package/esm2022/utils/field/model/link.mjs +25 -1
- package/esm2022/utils/field/model/member.mjs +40 -1
- package/esm2022/utils/field/model/number.mjs +31 -1
- package/esm2022/utils/field/model/progress.mjs +34 -1
- package/esm2022/utils/field/model/rate.mjs +35 -1
- package/esm2022/utils/field/model/select.mjs +64 -1
- package/esm2022/utils/field/model/text.mjs +7 -1
- package/esm2022/utils/file.mjs +208 -0
- package/esm2022/utils/icon.mjs +48 -0
- package/esm2022/utils/index.mjs +2 -1
- package/esm2022/utils/match-keywords.mjs +3 -3
- package/fesm2022/ai-table-grid.mjs +2131 -433
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid-base.component.d.ts +4 -2
- package/grid-base.component.d.ts.map +1 -1
- package/grid.component.d.ts +6 -1
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/renderer/components/field-icon.component.d.ts.map +1 -1
- package/renderer/drawers/cell-drawer.d.ts +1 -0
- package/renderer/drawers/cell-drawer.d.ts.map +1 -1
- package/renderer/drawers/drawer.d.ts.map +1 -1
- package/services/event.service.d.ts.map +1 -1
- package/services/selection.service.d.ts +5 -1
- package/services/selection.service.d.ts.map +1 -1
- package/styles/styles.scss +2 -0
- package/types/clipboard.d.ts +5 -0
- package/types/clipboard.d.ts.map +1 -0
- package/types/grid.d.ts +22 -5
- package/types/grid.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/row.d.ts +3 -1
- package/types/row.d.ts.map +1 -1
- package/utils/clipboard/clipboard.d.ts +8 -0
- package/utils/clipboard/clipboard.d.ts.map +1 -0
- package/utils/clipboard/copy.d.ts +5 -0
- package/utils/clipboard/copy.d.ts.map +1 -0
- package/utils/clipboard/extract.d.ts +3 -0
- package/utils/clipboard/extract.d.ts.map +1 -0
- package/utils/clipboard/index.d.ts +5 -0
- package/utils/clipboard/index.d.ts.map +1 -0
- package/utils/clipboard/paste.d.ts +10 -0
- package/utils/clipboard/paste.d.ts.map +1 -0
- package/utils/field/model/attachment.d.ts +17 -0
- package/utils/field/model/attachment.d.ts.map +1 -0
- package/utils/field/model/date.d.ts +9 -1
- package/utils/field/model/date.d.ts.map +1 -1
- package/utils/field/model/field.d.ts +4 -0
- package/utils/field/model/field.d.ts.map +1 -1
- package/utils/field/model/index.d.ts +1 -1
- package/utils/field/model/index.d.ts.map +1 -1
- package/utils/field/model/link.d.ts +9 -1
- package/utils/field/model/link.d.ts.map +1 -1
- package/utils/field/model/member.d.ts +8 -0
- package/utils/field/model/member.d.ts.map +1 -1
- package/utils/field/model/number.d.ts +9 -1
- package/utils/field/model/number.d.ts.map +1 -1
- package/utils/field/model/progress.d.ts +9 -1
- package/utils/field/model/progress.d.ts.map +1 -1
- package/utils/field/model/rate.d.ts +9 -1
- package/utils/field/model/rate.d.ts.map +1 -1
- package/utils/field/model/select.d.ts +16 -1
- package/utils/field/model/select.d.ts.map +1 -1
- package/utils/field/model/text.d.ts +2 -0
- package/utils/field/model/text.d.ts.map +1 -1
- package/utils/file.d.ts +11 -0
- package/utils/file.d.ts.map +1 -0
- package/utils/icon.d.ts +19 -0
- package/utils/icon.d.ts.map +1 -0
- package/utils/index.d.ts +1 -0
- 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,
|
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 {
|
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.
|
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
|
665
|
-
AITableFieldType.
|
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
|
-
|
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
|
-
|
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
|
-
|
1309
|
+
onOpenChange(value) {
|
1391
1310
|
if (!value) {
|
1392
|
-
|
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)=\"
|
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
|
-
|
1420
|
-
|
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 &&
|
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
|
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: [
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
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,100 @@ const isMac = () => {
|
|
2307
2373
|
return /macintosh/i.test(agent);
|
2308
2374
|
};
|
2309
2375
|
|
2310
|
-
const
|
2311
|
-
|
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
|
2386
|
-
|
2387
|
-
return borderSpace / 2;
|
2379
|
+
const isClipboardWriteTextSupported = () => {
|
2380
|
+
return 'clipboard' in navigator && 'writeText' in navigator.clipboard;
|
2388
2381
|
};
|
2389
|
-
|
2390
|
-
|
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
|
2409
|
-
|
2385
|
+
const isClipboardReadTextSupported = () => {
|
2386
|
+
return 'clipboard' in navigator && 'readText' in navigator.clipboard;
|
2410
2387
|
};
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
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
|
-
|
2461
|
-
|
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
|
-
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
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
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2485
|
-
|
2486
|
-
const
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
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
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2523
|
-
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
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 textarea = document.createElement('textarea');
|
2438
|
+
document.body.appendChild(textarea);
|
2439
|
+
textarea.focus();
|
2440
|
+
document.execCommand('paste');
|
2441
|
+
const text = textarea.value;
|
2442
|
+
document.body.removeChild(textarea);
|
2443
|
+
clipboardData.text = text;
|
2444
|
+
}
|
2445
|
+
return clipboardData;
|
2446
|
+
}
|
2447
|
+
catch (error) {
|
2448
|
+
console.warn('Failed to read clipboard:', error);
|
2449
|
+
return null;
|
2450
|
+
}
|
2530
2451
|
};
|
2531
2452
|
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
return this.isEmptyOrNot(condition.operation, cellValue);
|
2539
|
-
}
|
2540
|
-
default: {
|
2541
|
-
return true;
|
2542
|
-
}
|
2453
|
+
function extractText(text) {
|
2454
|
+
let plainText = text;
|
2455
|
+
if (text.includes('<a')) {
|
2456
|
+
const aTagMatch = text.match(/<a[^>]*>(.*?)<\/a>/i);
|
2457
|
+
if (aTagMatch && aTagMatch[1] && aTagMatch[1].trim()) {
|
2458
|
+
plainText = aTagMatch[1];
|
2543
2459
|
}
|
2544
2460
|
}
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
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
|
-
}
|
2461
|
+
return plainText;
|
2462
|
+
}
|
2463
|
+
function extractLinkHref(text) {
|
2464
|
+
let href = null;
|
2465
|
+
const hrefMatch = text.match(/href="([^"]+)"/);
|
2466
|
+
if (hrefMatch && hrefMatch[1] && hrefMatch[1].trim()) {
|
2467
|
+
href = hrefMatch[1];
|
2565
2468
|
}
|
2469
|
+
return href;
|
2566
2470
|
}
|
2567
2471
|
|
2568
2472
|
const zhIntlCollator = typeof Intl !== 'undefined' ? new Intl.Collator('zh-CN') : undefined;
|
@@ -2611,14 +2515,109 @@ function hasIntersect(array1, array2) {
|
|
2611
2515
|
return false;
|
2612
2516
|
}
|
2613
2517
|
|
2518
|
+
class Field {
|
2519
|
+
// 筛选
|
2520
|
+
isMeetFilter(condition, cellValue) {
|
2521
|
+
switch (condition.operation) {
|
2522
|
+
case AITableFilterOperation.empty:
|
2523
|
+
case AITableFilterOperation.exists: {
|
2524
|
+
return this.isEmptyOrNot(condition.operation, cellValue);
|
2525
|
+
}
|
2526
|
+
default: {
|
2527
|
+
return true;
|
2528
|
+
}
|
2529
|
+
}
|
2530
|
+
}
|
2531
|
+
// 查找
|
2532
|
+
cellFullText(transformValue, field, references) {
|
2533
|
+
let fullText = [];
|
2534
|
+
if (!isEmpty(transformValue)) {
|
2535
|
+
fullText.push(String(transformValue));
|
2536
|
+
}
|
2537
|
+
return fullText;
|
2538
|
+
}
|
2539
|
+
isEmptyOrNot(operation, cellValue) {
|
2540
|
+
switch (operation) {
|
2541
|
+
case AITableFilterOperation.empty: {
|
2542
|
+
return isEmpty(cellValue);
|
2543
|
+
}
|
2544
|
+
case AITableFilterOperation.exists: {
|
2545
|
+
return !isEmpty(cellValue);
|
2546
|
+
}
|
2547
|
+
default: {
|
2548
|
+
throw new Error('compare operator type error');
|
2549
|
+
}
|
2550
|
+
}
|
2551
|
+
}
|
2552
|
+
}
|
2553
|
+
|
2554
|
+
class AttachmentField extends Field {
|
2555
|
+
isMeetFilter(condition, cellValue) {
|
2556
|
+
switch (condition.operation) {
|
2557
|
+
case AITableFilterOperation.empty:
|
2558
|
+
return isEmpty(cellValue);
|
2559
|
+
case AITableFilterOperation.exists:
|
2560
|
+
return !isEmpty(cellValue);
|
2561
|
+
case AITableFilterOperation.in:
|
2562
|
+
return Array.isArray(condition.value) && hasIntersect(cellValue, condition.value);
|
2563
|
+
case AITableFilterOperation.nin:
|
2564
|
+
return Array.isArray(condition.value) && !hasIntersect(cellValue, condition.value);
|
2565
|
+
default:
|
2566
|
+
return super.isMeetFilter(condition, cellValue);
|
2567
|
+
}
|
2568
|
+
}
|
2569
|
+
compare(cellValue1, cellValue2, field, references, sortKey) {
|
2570
|
+
const value1 = cellValueToSortValue$5(cellValue1, field, references, sortKey);
|
2571
|
+
const value2 = cellValueToSortValue$5(cellValue2, field, references, sortKey);
|
2572
|
+
return compareString(value1, value2);
|
2573
|
+
}
|
2574
|
+
cellFullText(transformValue, field, references) {
|
2575
|
+
let fullText = [];
|
2576
|
+
if (transformValue?.length && references) {
|
2577
|
+
for (let index = 0; index < transformValue.length; index++) {
|
2578
|
+
const attachmentInfo = references?.attachments[transformValue[index]];
|
2579
|
+
if (!attachmentInfo) {
|
2580
|
+
continue;
|
2581
|
+
}
|
2582
|
+
if (attachmentInfo.title) {
|
2583
|
+
fullText.push(attachmentInfo.title);
|
2584
|
+
}
|
2585
|
+
}
|
2586
|
+
}
|
2587
|
+
return fullText;
|
2588
|
+
}
|
2589
|
+
toFieldValue(plainText, targetField, originData, references) {
|
2590
|
+
return toAttachmentFieldValue(plainText, targetField, originData, references);
|
2591
|
+
}
|
2592
|
+
}
|
2593
|
+
function toAttachmentFieldValue(plainText, targetField, originData, references) {
|
2594
|
+
return null;
|
2595
|
+
}
|
2596
|
+
function cellValueToSortValue$5(cellValue, field, references, sortKey = 'title') {
|
2597
|
+
let values = [];
|
2598
|
+
if (cellValue?.length && references) {
|
2599
|
+
for (let index = 0; index < cellValue.length; index++) {
|
2600
|
+
const attachmentInfo = references?.attachments[cellValue[index]];
|
2601
|
+
if (!attachmentInfo) {
|
2602
|
+
continue;
|
2603
|
+
}
|
2604
|
+
const value = attachmentInfo[sortKey];
|
2605
|
+
if (value) {
|
2606
|
+
values.push(value);
|
2607
|
+
}
|
2608
|
+
}
|
2609
|
+
}
|
2610
|
+
return values && values.length ? values.join(', ') : null;
|
2611
|
+
}
|
2612
|
+
|
2614
2613
|
class DateField extends Field {
|
2615
2614
|
isMeetFilter(condition, cellValue) {
|
2616
2615
|
const [left, right] = this.getTimeRange(condition.value);
|
2617
2616
|
switch (condition.operation) {
|
2618
2617
|
case AITableFilterOperation.empty:
|
2619
|
-
return isEmpty
|
2618
|
+
return isEmpty(cellValue.timestamp) || cellValue.timestamp === 0;
|
2620
2619
|
case AITableFilterOperation.exists:
|
2621
|
-
return !isEmpty
|
2620
|
+
return !isEmpty(cellValue.timestamp) && cellValue.timestamp !== 0;
|
2622
2621
|
case AITableFilterOperation.eq:
|
2623
2622
|
return left <= cellValue.timestamp && cellValue.timestamp < right;
|
2624
2623
|
case AITableFilterOperation.gt:
|
@@ -2636,6 +2635,9 @@ class DateField extends Field {
|
|
2636
2635
|
const value2 = cellValueToSortValue$4(cellValue2);
|
2637
2636
|
return compareNumber(value1, value2);
|
2638
2637
|
}
|
2638
|
+
toFieldValue(plainText, targetField, originData) {
|
2639
|
+
return toDateFieldValue(plainText, targetField, originData);
|
2640
|
+
}
|
2639
2641
|
getTimeRange(value) {
|
2640
2642
|
switch (value) {
|
2641
2643
|
case 'today':
|
@@ -2666,9 +2668,47 @@ class DateField extends Field {
|
|
2666
2668
|
}
|
2667
2669
|
}
|
2668
2670
|
}
|
2671
|
+
function toDateFieldValue(plainText, targetField, originData) {
|
2672
|
+
if (targetField.type === AITableFieldType.createdAt || targetField.type === AITableFieldType.updatedAt) {
|
2673
|
+
return null;
|
2674
|
+
}
|
2675
|
+
if (originData) {
|
2676
|
+
const { field, cellValue } = originData;
|
2677
|
+
switch (field.type) {
|
2678
|
+
case AITableFieldType.date:
|
2679
|
+
return cellValue;
|
2680
|
+
case AITableFieldType.text:
|
2681
|
+
const dateValue = transformDateValue(cellValue);
|
2682
|
+
if (dateValue) {
|
2683
|
+
return dateValue;
|
2684
|
+
}
|
2685
|
+
break;
|
2686
|
+
default:
|
2687
|
+
break;
|
2688
|
+
}
|
2689
|
+
}
|
2690
|
+
else {
|
2691
|
+
const dateValue = transformDateValue(plainText);
|
2692
|
+
if (dateValue) {
|
2693
|
+
return dateValue;
|
2694
|
+
}
|
2695
|
+
}
|
2696
|
+
return null;
|
2697
|
+
}
|
2669
2698
|
function cellValueToSortValue$4(cellValue) {
|
2670
2699
|
return cellValue?.timestamp;
|
2671
2700
|
}
|
2701
|
+
function transformDateValue(text) {
|
2702
|
+
const value = text.trim();
|
2703
|
+
const pattern = /^\d{4}-\d{1,2}-\d{1,2}$/;
|
2704
|
+
if (value && !isEmpty(value) && pattern.test(value)) {
|
2705
|
+
const dateValue = {
|
2706
|
+
timestamp: new TinyDate(value).getUnixTime()
|
2707
|
+
};
|
2708
|
+
return dateValue;
|
2709
|
+
}
|
2710
|
+
return null;
|
2711
|
+
}
|
2672
2712
|
|
2673
2713
|
class LinkField extends Field {
|
2674
2714
|
isMeetFilter(condition, cellValue) {
|
@@ -2694,6 +2734,28 @@ class LinkField extends Field {
|
|
2694
2734
|
}
|
2695
2735
|
return texts;
|
2696
2736
|
}
|
2737
|
+
toFieldValue(plainText, targetField, originData) {
|
2738
|
+
return toLinkFieldValue(plainText, targetField, originData);
|
2739
|
+
}
|
2740
|
+
}
|
2741
|
+
function toLinkFieldValue(plainText, targetField, originData) {
|
2742
|
+
if (originData) {
|
2743
|
+
const { field, cellValue } = originData;
|
2744
|
+
if (field.type === AITableFieldType.link) {
|
2745
|
+
return cellValue;
|
2746
|
+
}
|
2747
|
+
}
|
2748
|
+
else {
|
2749
|
+
const url = extractLinkHref(plainText);
|
2750
|
+
const text = extractText(plainText);
|
2751
|
+
if (url && text) {
|
2752
|
+
return {
|
2753
|
+
url,
|
2754
|
+
text
|
2755
|
+
};
|
2756
|
+
}
|
2757
|
+
}
|
2758
|
+
return null;
|
2697
2759
|
}
|
2698
2760
|
function cellValueToSortValue$3(cellValue) {
|
2699
2761
|
return (cellValue && cellValue.text && cellValue.text.trim()) || null;
|
@@ -2734,6 +2796,44 @@ class MemberField extends Field {
|
|
2734
2796
|
}
|
2735
2797
|
return fullText;
|
2736
2798
|
}
|
2799
|
+
toFieldValue(plainText, targetField, originData, references) {
|
2800
|
+
return toMemberFieldValue(plainText, targetField, originData, references);
|
2801
|
+
}
|
2802
|
+
}
|
2803
|
+
function toMemberFieldValue(plainText, targetField, originData, references) {
|
2804
|
+
if (targetField.type == AITableFieldType.createdBy || targetField.type == AITableFieldType.updatedBy) {
|
2805
|
+
return null;
|
2806
|
+
}
|
2807
|
+
const isMultiple = targetField.settings?.is_multiple;
|
2808
|
+
if (originData) {
|
2809
|
+
const { field, cellValue } = originData;
|
2810
|
+
switch (field.type) {
|
2811
|
+
case AITableFieldType.member:
|
2812
|
+
if (Array.isArray(cellValue) && cellValue.length) {
|
2813
|
+
return isMultiple ? cellValue : [cellValue[0]];
|
2814
|
+
}
|
2815
|
+
break;
|
2816
|
+
default:
|
2817
|
+
break;
|
2818
|
+
}
|
2819
|
+
}
|
2820
|
+
plainText = plainText.trim();
|
2821
|
+
const hasMemberInfo = references && references.members && Object.keys(references.members).length;
|
2822
|
+
if (plainText && hasMemberInfo) {
|
2823
|
+
const memberNames = plainText.split(',').map((id) => id.trim());
|
2824
|
+
const memberInfos = Object.values(references.members);
|
2825
|
+
let validMemberIds = [];
|
2826
|
+
memberNames.forEach((memberName) => {
|
2827
|
+
const memberInfo = memberInfos.find((member) => member.display_name === memberName);
|
2828
|
+
if (memberInfo) {
|
2829
|
+
validMemberIds.push(memberInfo.uid);
|
2830
|
+
}
|
2831
|
+
});
|
2832
|
+
if (validMemberIds.length) {
|
2833
|
+
return isMultiple ? validMemberIds : [validMemberIds[0]];
|
2834
|
+
}
|
2835
|
+
}
|
2836
|
+
return null;
|
2737
2837
|
}
|
2738
2838
|
function cellValueToSortValue$2(cellValue, field, references, sortKey = 'display_name') {
|
2739
2839
|
let values = [];
|
@@ -2778,6 +2878,34 @@ class NumberField extends Field {
|
|
2778
2878
|
compare(cellValue1, cellValue2) {
|
2779
2879
|
return compareNumber(cellValue1, cellValue2);
|
2780
2880
|
}
|
2881
|
+
toFieldValue(plainText, targetField, originData) {
|
2882
|
+
return toNumberFieldValue(plainText, targetField, originData);
|
2883
|
+
}
|
2884
|
+
}
|
2885
|
+
function toNumberFieldValue(plainText, targetField, originData) {
|
2886
|
+
let text = plainText.trim();
|
2887
|
+
if (originData) {
|
2888
|
+
const { field, cellValue } = originData;
|
2889
|
+
const fieldType = field.type;
|
2890
|
+
switch (fieldType) {
|
2891
|
+
case AITableFieldType.number:
|
2892
|
+
case AITableFieldType.rate:
|
2893
|
+
case AITableFieldType.progress:
|
2894
|
+
return cellValue;
|
2895
|
+
case AITableFieldType.select:
|
2896
|
+
if (cellValue && Array.isArray(cellValue) && cellValue.length) {
|
2897
|
+
const optionsMap = helpers.keyBy(field.settings.options || [], '_id');
|
2898
|
+
text = optionsMap[cellValue[0]]?.text;
|
2899
|
+
}
|
2900
|
+
break;
|
2901
|
+
default:
|
2902
|
+
break;
|
2903
|
+
}
|
2904
|
+
}
|
2905
|
+
if (text && !isEmpty(text) && !Number.isNaN(Number(text))) {
|
2906
|
+
return Number(text);
|
2907
|
+
}
|
2908
|
+
return null;
|
2781
2909
|
}
|
2782
2910
|
|
2783
2911
|
class ProgressField extends Field {
|
@@ -2813,6 +2941,37 @@ class ProgressField extends Field {
|
|
2813
2941
|
}
|
2814
2942
|
return fullText;
|
2815
2943
|
}
|
2944
|
+
toFieldValue(plainText, targetField, originData) {
|
2945
|
+
return toProgressFieldValue(plainText, targetField, originData);
|
2946
|
+
}
|
2947
|
+
}
|
2948
|
+
function toProgressFieldValue(plainText, targetField, originData) {
|
2949
|
+
let value = plainText.trim();
|
2950
|
+
if (originData) {
|
2951
|
+
const { field, cellValue } = originData;
|
2952
|
+
switch (field.type) {
|
2953
|
+
case AITableFieldType.progress:
|
2954
|
+
case AITableFieldType.rate:
|
2955
|
+
case AITableFieldType.number:
|
2956
|
+
value = cellValue;
|
2957
|
+
break;
|
2958
|
+
case AITableFieldType.select:
|
2959
|
+
if (cellValue && Array.isArray(cellValue) && cellValue.length) {
|
2960
|
+
const optionsMap = helpers.keyBy(field.settings.options || [], '_id');
|
2961
|
+
value = optionsMap[cellValue[0]]?.text;
|
2962
|
+
}
|
2963
|
+
break;
|
2964
|
+
default:
|
2965
|
+
break;
|
2966
|
+
}
|
2967
|
+
}
|
2968
|
+
if (!isEmpty(value)) {
|
2969
|
+
const progressValue = Number(value);
|
2970
|
+
if (!Number.isNaN(progressValue) && progressValue >= 0 && progressValue <= 100) {
|
2971
|
+
return progressValue;
|
2972
|
+
}
|
2973
|
+
}
|
2974
|
+
return null;
|
2816
2975
|
}
|
2817
2976
|
|
2818
2977
|
class RateField extends Field {
|
@@ -2835,6 +2994,38 @@ class RateField extends Field {
|
|
2835
2994
|
compare(cellValue1, cellValue2) {
|
2836
2995
|
return compareNumber(cellValue1, cellValue2);
|
2837
2996
|
}
|
2997
|
+
toFieldValue(plainText, targetField, originData) {
|
2998
|
+
return toRateFieldValue(plainText, targetField, originData);
|
2999
|
+
}
|
3000
|
+
}
|
3001
|
+
function toRateFieldValue(plainText, targetField, originData) {
|
3002
|
+
let value = plainText.trim();
|
3003
|
+
if (originData) {
|
3004
|
+
const { field, cellValue } = originData;
|
3005
|
+
switch (field.type) {
|
3006
|
+
case AITableFieldType.rate:
|
3007
|
+
case AITableFieldType.number:
|
3008
|
+
case AITableFieldType.progress:
|
3009
|
+
value = cellValue;
|
3010
|
+
break;
|
3011
|
+
case AITableFieldType.select:
|
3012
|
+
if (cellValue && Array.isArray(cellValue) && cellValue.length) {
|
3013
|
+
const optionsMap = helpers.keyBy(field.settings.options || [], '_id');
|
3014
|
+
value = optionsMap[cellValue[0]]?.text;
|
3015
|
+
}
|
3016
|
+
break;
|
3017
|
+
default:
|
3018
|
+
break;
|
3019
|
+
}
|
3020
|
+
}
|
3021
|
+
if (!isEmpty(value)) {
|
3022
|
+
const rateValue = Number(value);
|
3023
|
+
if (!Number.isNaN(rateValue) && rateValue > 0 && rateValue < 5) {
|
3024
|
+
return Math.round(rateValue);
|
3025
|
+
}
|
3026
|
+
return 5;
|
3027
|
+
}
|
3028
|
+
return null;
|
2838
3029
|
}
|
2839
3030
|
|
2840
3031
|
class SelectField extends Field {
|
@@ -2870,6 +3061,68 @@ class SelectField extends Field {
|
|
2870
3061
|
}
|
2871
3062
|
return fullText;
|
2872
3063
|
}
|
3064
|
+
toFieldValue(plainText, targetField, originData) {
|
3065
|
+
return toSelectFieldValue(plainText, targetField, originData);
|
3066
|
+
}
|
3067
|
+
}
|
3068
|
+
function toSelectFieldValue(plainText, targetField, originData) {
|
3069
|
+
return null;
|
3070
|
+
}
|
3071
|
+
function processPastedValueForSelect(plainText, targetField, originData) {
|
3072
|
+
const targetFieldOptions = targetField.settings?.options || [];
|
3073
|
+
let existOptionIds = [];
|
3074
|
+
let newOptions = [];
|
3075
|
+
let cellFullTexts = plainText.split(',').map((text) => text.trim());
|
3076
|
+
const { field, cellValue } = originData || {};
|
3077
|
+
if (field && field.type === AITableFieldType.select) {
|
3078
|
+
if (cellValue && Array.isArray(cellValue) && cellValue.length) {
|
3079
|
+
const targetOptionIds = targetFieldOptions.map((option) => option._id);
|
3080
|
+
const originOptionsMap = helpers.keyBy(field.settings?.options || [], '_id');
|
3081
|
+
cellValue.forEach((id) => {
|
3082
|
+
if (targetOptionIds.includes(id)) {
|
3083
|
+
existOptionIds.push(id);
|
3084
|
+
}
|
3085
|
+
else if (targetFieldOptions.some((option) => option.text === originOptionsMap[id].text)) {
|
3086
|
+
const option = targetFieldOptions.find((option) => option.text === originOptionsMap[id].text);
|
3087
|
+
existOptionIds.push(option._id);
|
3088
|
+
}
|
3089
|
+
else {
|
3090
|
+
const originOption = originOptionsMap[id];
|
3091
|
+
if (originOption) {
|
3092
|
+
newOptions.push({
|
3093
|
+
text: originOption.text,
|
3094
|
+
icon: originOption.icon,
|
3095
|
+
color: originOption.color,
|
3096
|
+
bg_color: originOption.bg_color
|
3097
|
+
});
|
3098
|
+
}
|
3099
|
+
}
|
3100
|
+
});
|
3101
|
+
}
|
3102
|
+
}
|
3103
|
+
else {
|
3104
|
+
cellFullTexts.forEach((text) => {
|
3105
|
+
const option = targetFieldOptions.find((option) => option.text === text);
|
3106
|
+
option ? existOptionIds.push(option._id) : newOptions.push({ text });
|
3107
|
+
});
|
3108
|
+
}
|
3109
|
+
const isMultiple = targetField.settings?.is_multiple;
|
3110
|
+
if (isMultiple) {
|
3111
|
+
return { existOptionIds, newOptions };
|
3112
|
+
}
|
3113
|
+
else {
|
3114
|
+
if (existOptionIds.length) {
|
3115
|
+
return { existOptionIds: [existOptionIds[0]], newOptions: [] };
|
3116
|
+
}
|
3117
|
+
else {
|
3118
|
+
if (newOptions.length) {
|
3119
|
+
return { existOptionIds: [], newOptions: [newOptions[0]] };
|
3120
|
+
}
|
3121
|
+
else {
|
3122
|
+
return { existOptionIds: [], newOptions: [] };
|
3123
|
+
}
|
3124
|
+
}
|
3125
|
+
}
|
2873
3126
|
}
|
2874
3127
|
function cellValueToSortValue$1(cellValue, field) {
|
2875
3128
|
if (!cellValue) {
|
@@ -2900,37 +3153,531 @@ class TextField extends Field {
|
|
2900
3153
|
default:
|
2901
3154
|
return super.isMeetFilter(condition, cellValue);
|
2902
3155
|
}
|
2903
|
-
}
|
2904
|
-
compare(cellValue1, cellValue2) {
|
2905
|
-
const value1 = cellValueToSortValue(cellValue1);
|
2906
|
-
const value2 = cellValueToSortValue(cellValue2);
|
2907
|
-
return compareString(value1, value2);
|
2908
|
-
}
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
2912
|
-
}
|
2913
|
-
|
2914
|
-
|
2915
|
-
|
2916
|
-
|
2917
|
-
|
2918
|
-
|
2919
|
-
|
2920
|
-
|
2921
|
-
[AITableFieldType.
|
2922
|
-
[AITableFieldType.
|
2923
|
-
[AITableFieldType.
|
2924
|
-
[AITableFieldType.
|
2925
|
-
[AITableFieldType.
|
2926
|
-
[AITableFieldType.
|
2927
|
-
[AITableFieldType.
|
3156
|
+
}
|
3157
|
+
compare(cellValue1, cellValue2) {
|
3158
|
+
const value1 = cellValueToSortValue(cellValue1);
|
3159
|
+
const value2 = cellValueToSortValue(cellValue2);
|
3160
|
+
return compareString(value1, value2);
|
3161
|
+
}
|
3162
|
+
toFieldValue(plainText) {
|
3163
|
+
return toTextFieldValue(plainText);
|
3164
|
+
}
|
3165
|
+
}
|
3166
|
+
function toTextFieldValue(plainText) {
|
3167
|
+
return plainText.trim();
|
3168
|
+
}
|
3169
|
+
function cellValueToSortValue(cellValue) {
|
3170
|
+
return (cellValue && cellValue.trim()) || null;
|
3171
|
+
}
|
3172
|
+
|
3173
|
+
const FieldModelMap = {
|
3174
|
+
[AITableFieldType.text]: new TextField(),
|
3175
|
+
[AITableFieldType.richText]: new TextField(),
|
3176
|
+
[AITableFieldType.select]: new SelectField(),
|
3177
|
+
[AITableFieldType.date]: new DateField(),
|
3178
|
+
[AITableFieldType.createdAt]: new DateField(),
|
3179
|
+
[AITableFieldType.updatedAt]: new DateField(),
|
3180
|
+
[AITableFieldType.number]: new NumberField(),
|
3181
|
+
[AITableFieldType.rate]: new RateField(),
|
3182
|
+
[AITableFieldType.link]: new LinkField(),
|
3183
|
+
[AITableFieldType.member]: new MemberField(),
|
3184
|
+
[AITableFieldType.progress]: new ProgressField(),
|
3185
|
+
[AITableFieldType.createdBy]: new MemberField(),
|
3186
|
+
[AITableFieldType.updatedBy]: new MemberField(),
|
3187
|
+
[AITableFieldType.attachment]: new AttachmentField()
|
3188
|
+
};
|
3189
|
+
|
3190
|
+
const aiTableFragmentAttribute = 'ai-table-fragment';
|
3191
|
+
const buildClipboardData = (aiTable) => {
|
3192
|
+
const copiedCells = Array.from(aiTable.selection().selectedCells);
|
3193
|
+
if (!copiedCells.length) {
|
3194
|
+
return null;
|
3195
|
+
}
|
3196
|
+
let copiedFieldIds = new Set();
|
3197
|
+
let copiedRecordIds = new Set();
|
3198
|
+
copiedCells.forEach((cellPath) => {
|
3199
|
+
const [recordId, fieldId] = cellPath.split(':');
|
3200
|
+
copiedFieldIds.add(fieldId);
|
3201
|
+
copiedRecordIds.add(recordId);
|
3202
|
+
});
|
3203
|
+
const fieldIds = Array.from(copiedFieldIds);
|
3204
|
+
const recordIds = Array.from(copiedRecordIds);
|
3205
|
+
const aiTableContent = buildAITableContent(aiTable, fieldIds, recordIds);
|
3206
|
+
const clipboardContent = buildClipboardContent(aiTable, fieldIds, recordIds);
|
3207
|
+
return mergeClipboardContent(clipboardContent, aiTableContent);
|
3208
|
+
};
|
3209
|
+
const encodeAITableContent = (aiTableContent) => {
|
3210
|
+
const stringifiedData = JSON.stringify(aiTableContent);
|
3211
|
+
return window.btoa(encodeURIComponent(stringifiedData));
|
3212
|
+
};
|
3213
|
+
function mergeClipboardContent(clipboardContent, aiTableContent) {
|
3214
|
+
const encodedAITableContent = encodeAITableContent(aiTableContent);
|
3215
|
+
const formattedContent = {
|
3216
|
+
text: clipboardContent.map((row) => row.map((column) => column.text).join('\t')).join('\n'),
|
3217
|
+
html: `<table ${aiTableFragmentAttribute}="${encodedAITableContent}">${clipboardContent.map((row) => `<tr>${row.map((column) => `<td>${column.html}</td>`).join('')}</tr>`).join('')}</table>`
|
3218
|
+
};
|
3219
|
+
return formattedContent;
|
3220
|
+
}
|
3221
|
+
function buildAITableContent(aiTable, fieldIds, recordIds) {
|
3222
|
+
const fields = fieldIds.map((fieldId) => {
|
3223
|
+
return aiTable.fieldsMap()[fieldId];
|
3224
|
+
});
|
3225
|
+
const records = recordIds.map((recordId) => {
|
3226
|
+
const record = aiTable.recordsMap()[recordId];
|
3227
|
+
let newRecord = {
|
3228
|
+
_id: record._id,
|
3229
|
+
values: {}
|
3230
|
+
};
|
3231
|
+
fieldIds.forEach((fieldId) => {
|
3232
|
+
const field = aiTable.fieldsMap()[fieldId];
|
3233
|
+
if (isSystemField(field)) {
|
3234
|
+
const fieldType = field.type;
|
3235
|
+
newRecord = {
|
3236
|
+
...newRecord,
|
3237
|
+
[fieldType]: getSystemFieldValue(record, fieldType)
|
3238
|
+
};
|
3239
|
+
}
|
3240
|
+
else {
|
3241
|
+
newRecord.values = {
|
3242
|
+
...newRecord.values,
|
3243
|
+
[fieldId]: getFieldValue(record, field)
|
3244
|
+
};
|
3245
|
+
}
|
3246
|
+
});
|
3247
|
+
return newRecord;
|
3248
|
+
});
|
3249
|
+
return {
|
3250
|
+
fields,
|
3251
|
+
records
|
3252
|
+
};
|
3253
|
+
}
|
3254
|
+
function buildClipboardContent(aiTable, fieldIds, recordIds) {
|
3255
|
+
const clipboardContent = [];
|
3256
|
+
const references = aiTable.context.references();
|
3257
|
+
recordIds.forEach((recordId) => {
|
3258
|
+
const record = aiTable.recordsMap()[recordId];
|
3259
|
+
const row = [];
|
3260
|
+
fieldIds.forEach((fieldId) => {
|
3261
|
+
const field = aiTable.fieldsMap()[fieldId];
|
3262
|
+
const cellValue = getFieldValue(record, field);
|
3263
|
+
const transformValue = transformCellValue(aiTable, field, cellValue);
|
3264
|
+
const cellTexts = FieldModelMap[field.type].cellFullText(transformValue, field, references);
|
3265
|
+
let cellContent = {
|
3266
|
+
text: cellTexts.join(','),
|
3267
|
+
html: cellTexts.join(',')
|
3268
|
+
};
|
3269
|
+
if (field.type === AITableFieldType.link && cellValue && cellValue.url) {
|
3270
|
+
cellContent.html = `<a href="${cellValue.url}" target="_blank">${cellValue.text}</a>`;
|
3271
|
+
}
|
3272
|
+
row.push(cellContent);
|
3273
|
+
});
|
3274
|
+
clipboardContent.push(row);
|
3275
|
+
});
|
3276
|
+
return clipboardContent;
|
3277
|
+
}
|
3278
|
+
|
3279
|
+
const aiTableAttributePattern = new RegExp(`${aiTableFragmentAttribute}="(.+?)"`, 'm');
|
3280
|
+
const decodeClipboardJsonData = (encoded) => {
|
3281
|
+
const decoded = decodeURIComponent(window.atob(encoded));
|
3282
|
+
return JSON.parse(decoded);
|
3283
|
+
};
|
3284
|
+
function extractContentFromClipboardText(clipboardText) {
|
3285
|
+
const contents = clipboardText
|
3286
|
+
.split('\n')
|
3287
|
+
.map((row) => row.split('\t'))
|
3288
|
+
.filter((row) => row.length > 0 && row.some((cell) => cell.trim().length > 0));
|
3289
|
+
return contents;
|
3290
|
+
}
|
3291
|
+
function extractContentFromClipboardHtml(clipboardHtml) {
|
3292
|
+
const tablePattern = /<table[^>]*>([\s\S]*?)<\/table>/i;
|
3293
|
+
const trPattern = /<tr[^>]*>([\s\S]*?)<\/tr>/gi;
|
3294
|
+
const cellPattern = /<td[^>]*>([\s\S]*?)<\/td>/gi;
|
3295
|
+
const contents = [];
|
3296
|
+
try {
|
3297
|
+
const tableMatch = clipboardHtml.match(tablePattern);
|
3298
|
+
const tableContent = tableMatch ? tableMatch[1] : clipboardHtml;
|
3299
|
+
const rows = tableContent.match(trPattern) || [];
|
3300
|
+
rows.forEach((row) => {
|
3301
|
+
const rowContent = [];
|
3302
|
+
const cells = row.match(cellPattern) || [];
|
3303
|
+
cells.forEach((cell) => {
|
3304
|
+
const content = cell.replace(/<td>|<\/td>/g, '').trim();
|
3305
|
+
rowContent.push(content);
|
3306
|
+
});
|
3307
|
+
contents.push(rowContent);
|
3308
|
+
});
|
3309
|
+
return contents;
|
3310
|
+
}
|
3311
|
+
catch (error) {
|
3312
|
+
return [];
|
3313
|
+
}
|
3314
|
+
}
|
3315
|
+
function extractAITableContentFromClipboardHtml(clipboardHtml) {
|
3316
|
+
const aiTableFragment = clipboardHtml.match(aiTableAttributePattern);
|
3317
|
+
if (aiTableFragment && !!aiTableFragment.length) {
|
3318
|
+
return decodeClipboardJsonData(aiTableFragment[1]);
|
3319
|
+
}
|
3320
|
+
return null;
|
3321
|
+
}
|
3322
|
+
const readClipboardData = async () => {
|
3323
|
+
const clipboardData = await readFromClipboard();
|
3324
|
+
let clipboardContent = [];
|
3325
|
+
let aiTableContent = null;
|
3326
|
+
if (clipboardData) {
|
3327
|
+
const clipboardHtml = clipboardData.html;
|
3328
|
+
const clipboardText = clipboardData.text;
|
3329
|
+
if (clipboardHtml) {
|
3330
|
+
aiTableContent = extractAITableContentFromClipboardHtml(clipboardHtml);
|
3331
|
+
clipboardContent = extractContentFromClipboardHtml(clipboardHtml);
|
3332
|
+
}
|
3333
|
+
if (!clipboardContent.length && clipboardText) {
|
3334
|
+
clipboardContent = extractContentFromClipboardText(clipboardText);
|
3335
|
+
}
|
3336
|
+
}
|
3337
|
+
return {
|
3338
|
+
clipboardContent,
|
3339
|
+
aiTableContent
|
3340
|
+
};
|
3341
|
+
};
|
3342
|
+
function getPasteValue(plainText, aiTableContent, recordIndex, fieldIndex, targetField, references) {
|
3343
|
+
let field = null;
|
3344
|
+
let record = null;
|
3345
|
+
if (aiTableContent) {
|
3346
|
+
const { fields, records } = aiTableContent;
|
3347
|
+
field = fields[fieldIndex];
|
3348
|
+
record = records[recordIndex];
|
3349
|
+
}
|
3350
|
+
if (targetField.type === AITableFieldType.attachment || (field && field.type === AITableFieldType.attachment)) {
|
3351
|
+
return { value: null, newField: null };
|
3352
|
+
}
|
3353
|
+
if (targetField.type !== AITableFieldType.link) {
|
3354
|
+
plainText = extractText(plainText);
|
3355
|
+
}
|
3356
|
+
let originData = field && record ? { field, cellValue: getFieldValue(record, field) } : null;
|
3357
|
+
if (targetField.type === AITableFieldType.select) {
|
3358
|
+
let { existOptionIds, newOptions } = processPastedValueForSelect(plainText, targetField, originData);
|
3359
|
+
newOptions = newOptions.map((option) => {
|
3360
|
+
return {
|
3361
|
+
...option,
|
3362
|
+
_id: idCreator()
|
3363
|
+
};
|
3364
|
+
});
|
3365
|
+
const newField = {
|
3366
|
+
...targetField,
|
3367
|
+
settings: {
|
3368
|
+
...targetField.settings,
|
3369
|
+
options: [...(targetField.settings?.options || []), ...newOptions]
|
3370
|
+
}
|
3371
|
+
};
|
3372
|
+
const newOptionIds = newOptions.map((option) => option._id).filter((id) => !!id);
|
3373
|
+
const selectFieldValue = [...existOptionIds, ...newOptionIds];
|
3374
|
+
return {
|
3375
|
+
value: selectFieldValue,
|
3376
|
+
newField
|
3377
|
+
};
|
3378
|
+
}
|
3379
|
+
return { value: FieldModelMap[targetField.type].toFieldValue(plainText, targetField, originData, references), newField: null };
|
3380
|
+
}
|
3381
|
+
function appendRecord(aiTable, actions) {
|
3382
|
+
const allRecords = aiTable.records();
|
3383
|
+
const lastRecordId = allRecords.length > 0 ? allRecords[allRecords.length - 1]._id : '';
|
3384
|
+
actions.addRecord({
|
3385
|
+
originId: lastRecordId
|
3386
|
+
});
|
3387
|
+
}
|
3388
|
+
function appendField(aiTable, originField, actions) {
|
3389
|
+
const lastFieldId = aiTable.fields().length > 0 ? aiTable.fields()[aiTable.fields().length - 1]._id : '';
|
3390
|
+
let defaultFieldValue;
|
3391
|
+
if (originField) {
|
3392
|
+
defaultFieldValue = {
|
3393
|
+
...originField,
|
3394
|
+
name: createDefaultFieldName(aiTable, FieldOptions.find((item) => item.type === originField.type)),
|
3395
|
+
_id: idCreator()
|
3396
|
+
};
|
3397
|
+
}
|
3398
|
+
else {
|
3399
|
+
defaultFieldValue = createDefaultField(aiTable, AITableFieldType.text);
|
3400
|
+
}
|
3401
|
+
actions.addField({
|
3402
|
+
originId: lastFieldId,
|
3403
|
+
defaultValue: defaultFieldValue
|
3404
|
+
});
|
3405
|
+
}
|
3406
|
+
const writeToAITable = async (aiTable, actions) => {
|
3407
|
+
const selectedCells = Array.from(aiTable.selection().selectedCells);
|
3408
|
+
if (!selectedCells.length) {
|
3409
|
+
return;
|
3410
|
+
}
|
3411
|
+
const { clipboardContent, aiTableContent } = await readClipboardData();
|
3412
|
+
if (!clipboardContent.length) {
|
3413
|
+
return;
|
3414
|
+
}
|
3415
|
+
const [firstCell] = selectedCells;
|
3416
|
+
const [startRecordId, startFieldId] = firstCell.split(':');
|
3417
|
+
const startRowIndex = aiTable.context.visibleRowsIndexMap().get(startRecordId) ?? 0;
|
3418
|
+
const startColIndex = aiTable.context.visibleColumnsIndexMap().get(startFieldId) ?? 0;
|
3419
|
+
const references = aiTable.context.references();
|
3420
|
+
let isPasteSuccess = false;
|
3421
|
+
clipboardContent.forEach((row, i) => {
|
3422
|
+
const targetRowIndex = startRowIndex + i;
|
3423
|
+
if (targetRowIndex >= aiTable.context.linearRows().length - 1) {
|
3424
|
+
appendRecord(aiTable, actions);
|
3425
|
+
}
|
3426
|
+
row.forEach((plainText, j) => {
|
3427
|
+
const targetColIndex = startColIndex + j;
|
3428
|
+
if (targetColIndex >= AITable.getVisibleFields(aiTable).length) {
|
3429
|
+
const originField = aiTableContent?.fields[j] || null;
|
3430
|
+
appendField(aiTable, originField, actions);
|
3431
|
+
}
|
3432
|
+
const targetRecord = aiTable.context.linearRows()[targetRowIndex];
|
3433
|
+
const targetField = AITable.getVisibleFields(aiTable)[targetColIndex];
|
3434
|
+
const recordIndex = i;
|
3435
|
+
const fieldIndex = j;
|
3436
|
+
const { value, newField } = getPasteValue(plainText, aiTableContent, recordIndex, fieldIndex, targetField, references);
|
3437
|
+
if (newField) {
|
3438
|
+
actions.setField(newField);
|
3439
|
+
}
|
3440
|
+
if (value !== null) {
|
3441
|
+
try {
|
3442
|
+
actions.updateFieldValue({
|
3443
|
+
value,
|
3444
|
+
path: [targetRecord._id, targetField._id]
|
3445
|
+
});
|
3446
|
+
isPasteSuccess = true;
|
3447
|
+
}
|
3448
|
+
catch (error) { }
|
3449
|
+
}
|
3450
|
+
});
|
3451
|
+
});
|
3452
|
+
return isPasteSuccess;
|
3453
|
+
};
|
3454
|
+
|
3455
|
+
const getVisibleRangeInfo = (coordinate, scrollState) => {
|
3456
|
+
const { scrollTop, scrollLeft } = scrollState;
|
3457
|
+
const { rowCount, columnCount, frozenColumnCount } = coordinate;
|
3458
|
+
// 获取要渲染的垂直可见区域
|
3459
|
+
const getVerticalRangeInfo = () => {
|
3460
|
+
const startIndex = coordinate.getRowStartIndex(scrollTop);
|
3461
|
+
const stopIndex = coordinate.getRowStopIndex(startIndex, scrollTop);
|
3462
|
+
return {
|
3463
|
+
rowStartIndex: Math.max(0, startIndex - 1),
|
3464
|
+
rowStopIndex: Math.max(0, Math.min(rowCount - 1, stopIndex + 1))
|
3465
|
+
};
|
3466
|
+
};
|
3467
|
+
// 获取要渲染的水平可见区域
|
3468
|
+
const getHorizontalRangeInfo = () => {
|
3469
|
+
const startIndex = coordinate.getColumnStartIndex(scrollLeft);
|
3470
|
+
const stopIndex = coordinate.getColumnStopIndex(startIndex, scrollLeft);
|
3471
|
+
return {
|
3472
|
+
columnStartIndex: Math.max(frozenColumnCount - 1, startIndex),
|
3473
|
+
columnStopIndex: Math.max(frozenColumnCount - 1, Math.min(columnCount - 1, stopIndex))
|
3474
|
+
};
|
3475
|
+
};
|
3476
|
+
const { rowStartIndex, rowStopIndex } = getVerticalRangeInfo();
|
3477
|
+
const { columnStartIndex, columnStopIndex } = getHorizontalRangeInfo();
|
3478
|
+
return {
|
3479
|
+
rowStartIndex,
|
3480
|
+
rowStopIndex,
|
3481
|
+
columnStartIndex,
|
3482
|
+
columnStopIndex
|
3483
|
+
};
|
3484
|
+
};
|
3485
|
+
const scrollMax = (coordinate, visibleColumns) => {
|
3486
|
+
const scrollMaxWidth = visibleColumns.reduce((pre, cur) => pre + getFieldOptionByField(cur)?.width, AI_TABLE_ROW_HEAD_WIDTH);
|
3487
|
+
const scrollMaxHeight = coordinate.getRowOffset(coordinate.rowCount - 1) + 32;
|
3488
|
+
return { scrollMaxWidth, scrollMaxHeight };
|
3489
|
+
};
|
3490
|
+
|
3491
|
+
const getMousePosition = (x, y, coordinate, fields, context, _targetName) => {
|
3492
|
+
const { scrollTop, scrollLeft } = context.scrollState();
|
3493
|
+
const { scrollMaxWidth, scrollMaxHeight } = scrollMax(coordinate, fields);
|
3494
|
+
const offsetTop = scrollTop + y;
|
3495
|
+
const rowIndex = coordinate.getRowStartIndex(offsetTop);
|
3496
|
+
const offsetLeft = isWithinFrozenColumnBoundary(x, coordinate.frozenColumnWidth) ? x : scrollLeft + x;
|
3497
|
+
const columnIndex = coordinate.getColumnStartIndex(offsetLeft);
|
3498
|
+
const areaType = offsetLeft <= scrollMaxWidth && offsetTop <= scrollMaxHeight ? AITableAreaType.grid : AITableAreaType.none;
|
3499
|
+
const targetName = getTargetName(_targetName);
|
3500
|
+
return {
|
3501
|
+
areaType,
|
3502
|
+
targetName, // As a simple operational identifier, with prefix name only
|
3503
|
+
realTargetName: _targetName || AI_TABLE_BLANK, // Real name
|
3504
|
+
rowIndex,
|
3505
|
+
columnIndex,
|
3506
|
+
offsetTop,
|
3507
|
+
offsetLeft,
|
3508
|
+
x,
|
3509
|
+
y
|
3510
|
+
};
|
3511
|
+
};
|
3512
|
+
const isWithinFrozenColumnBoundary = (x, frozenColumnWidth) => {
|
3513
|
+
const max = AI_TABLE_ROW_HEAD_WIDTH + frozenColumnWidth;
|
3514
|
+
const min = AI_TABLE_ROW_HEAD_WIDTH;
|
3515
|
+
return x > min && x < max;
|
3516
|
+
};
|
3517
|
+
const getEditorSpace = (widthOrHeight) => {
|
3518
|
+
return widthOrHeight + AI_TABLE_OFFSET * 2;
|
3519
|
+
};
|
3520
|
+
const getEditorBoxOffset = () => {
|
3521
|
+
return -AI_TABLE_OFFSET;
|
3522
|
+
};
|
3523
|
+
const getCellEditorBorderSpace = () => {
|
3524
|
+
return AI_TABLE_CELL_ACTIVE_BORDER_WIDTH * 2 - AI_TABLE_OFFSET * 2;
|
3525
|
+
};
|
3526
|
+
const getHoverEditorSpace = (widthOrHeight) => {
|
3527
|
+
const borderSpace = getCellEditorBorderSpace();
|
3528
|
+
return widthOrHeight - borderSpace;
|
3529
|
+
};
|
3530
|
+
const getHoverEditorBoxOffset = () => {
|
3531
|
+
const borderSpace = getCellEditorBorderSpace();
|
3532
|
+
return borderSpace / 2;
|
3533
|
+
};
|
3534
|
+
|
3535
|
+
const handleMouseStyle = (realTargetName, areaType = AITableAreaType.grid, container) => {
|
3536
|
+
const { targetName, mouseStyle } = getDetailByTargetName(realTargetName);
|
3537
|
+
if (mouseStyle)
|
3538
|
+
return setMouseStyle(mouseStyle, container);
|
3539
|
+
if (areaType === AITableAreaType.none)
|
3540
|
+
return setMouseStyle('default', container);
|
3541
|
+
switch (targetName) {
|
3542
|
+
case AI_TABLE_FIELD_HEAD_SELECT_CHECKBOX:
|
3543
|
+
case AI_TABLE_FIELD_HEAD_MORE:
|
3544
|
+
case AI_TABLE_ROW_SELECT_CHECKBOX:
|
3545
|
+
case AI_TABLE_ROW_ADD_BUTTON:
|
3546
|
+
case AI_TABLE_FIELD_ADD_BUTTON: {
|
3547
|
+
return setMouseStyle('pointer', container);
|
3548
|
+
}
|
3549
|
+
default:
|
3550
|
+
return setMouseStyle('default', container);
|
3551
|
+
}
|
3552
|
+
};
|
3553
|
+
const setMouseStyle = (mouseStyle, container) => {
|
3554
|
+
container.style.cursor = mouseStyle;
|
3555
|
+
};
|
3556
|
+
|
3557
|
+
/**
|
3558
|
+
* 在 Canvas 上测量文本的宽度和高度,以便在显示文本时能够动态调整布局或限制文本的显示区域
|
3559
|
+
* @param defaults
|
3560
|
+
* @returns
|
3561
|
+
*/
|
3562
|
+
const TextMeasure = (defaults = {}) => {
|
3563
|
+
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;
|
3564
|
+
const o = {
|
3565
|
+
fontFamily,
|
3566
|
+
fontSize,
|
3567
|
+
fontWeight,
|
3568
|
+
fontStyle,
|
3569
|
+
lineHeight,
|
3570
|
+
scale
|
3571
|
+
};
|
3572
|
+
const canvas = document.createElement('canvas');
|
3573
|
+
const context = canvas ? canvas.getContext('2d') : null;
|
3574
|
+
const normalizeFontFamily = (fontFamily) => {
|
3575
|
+
return fontFamily
|
3576
|
+
.split(',')
|
3577
|
+
.map((family) => {
|
3578
|
+
family = family.trim();
|
3579
|
+
const hasSpace = family.indexOf(' ') >= 0;
|
3580
|
+
const hasQuotes = family.indexOf('"') >= 0 || family.indexOf("'") >= 0;
|
3581
|
+
if (hasSpace && !hasQuotes) {
|
3582
|
+
family = `"${family}"`;
|
3583
|
+
}
|
3584
|
+
return family;
|
3585
|
+
})
|
3586
|
+
.join(', ');
|
3587
|
+
};
|
3588
|
+
// 可以在运行时动态调整字体样式,从而影响后续的文本测量
|
3589
|
+
const setFont = (options = {}) => {
|
3590
|
+
for (const key in options) {
|
3591
|
+
o[key] = options[key] ?? o[key];
|
3592
|
+
}
|
3593
|
+
if (context) {
|
3594
|
+
context.font = `${o.fontWeight} ${o.fontSize * o.scale}px ${normalizeFontFamily(o.fontFamily)}`;
|
3595
|
+
}
|
3596
|
+
};
|
3597
|
+
// 根据指定的最大宽度和行数来计算文本的显示方式。如果文本太长,它会自动换行或截断,并返回是否发生溢出的信息
|
3598
|
+
const getWidthOfLongestText = (text, maxWidth, maxLineCount) => {
|
3599
|
+
let width = 0;
|
3600
|
+
let height = 0;
|
3601
|
+
let lineCount = 0;
|
3602
|
+
if (text == null) {
|
3603
|
+
return { width, height, lastLineWidth: 0 };
|
3604
|
+
}
|
3605
|
+
const lines = text.split('\n');
|
3606
|
+
for (let i = 0; i < lines.length; i++) {
|
3607
|
+
const line = lines[i];
|
3608
|
+
const lineWidth = context?.measureText(line).width ?? 0;
|
3609
|
+
width = Math.max(width, lineWidth);
|
3610
|
+
lineCount = maxWidth != null ? Math.ceil(lineWidth / maxWidth) || 1 : 1;
|
3611
|
+
height += o.lineHeight * lineCount;
|
3612
|
+
}
|
3613
|
+
if (maxWidth == null || maxLineCount === 1 || (maxLineCount && lineCount <= maxLineCount)) {
|
3614
|
+
return {
|
3615
|
+
width: Math.ceil(width),
|
3616
|
+
height: Math.ceil(height),
|
3617
|
+
text,
|
3618
|
+
isOverflow: Boolean(maxLineCount && lineCount > maxLineCount),
|
3619
|
+
lastLineWidth: Math.ceil(width)
|
3620
|
+
};
|
3621
|
+
}
|
3622
|
+
const arrText = text.split('');
|
3623
|
+
let rowCount = 0; // 总行数
|
3624
|
+
let textHeight = 0; // 文本最终占用的高度
|
3625
|
+
let showText = ''; // 每行展示的文本
|
3626
|
+
let totalText = '';
|
3627
|
+
let isLimitRow = false;
|
3628
|
+
const textLength = arrText.length;
|
3629
|
+
for (let n = 0; n < textLength; n++) {
|
3630
|
+
const singleText = arrText[n];
|
3631
|
+
const composeText = showText + singleText;
|
3632
|
+
// 如果没有超过 maxLineCount,就会继续换行
|
3633
|
+
isLimitRow = maxLineCount ? rowCount === maxLineCount - 1 : false;
|
3634
|
+
const measureText = isLimitRow ? composeText + '…' : composeText;
|
3635
|
+
totalText += singleText;
|
3636
|
+
const textWidth = context?.measureText(measureText).width ?? 0;
|
3637
|
+
const isLineBreak = ['\n', '\r'].includes(singleText);
|
3638
|
+
if (((maxWidth && textWidth > maxWidth) || isLineBreak) && (maxLineCount == null || rowCount < maxLineCount)) {
|
3639
|
+
showText = isLineBreak ? '' : singleText;
|
3640
|
+
textHeight += lineHeight;
|
3641
|
+
rowCount++;
|
3642
|
+
if (isLimitRow) {
|
3643
|
+
if (n < textLength - 1) {
|
3644
|
+
totalText = totalText.substring(0, totalText.length - 1) + '…';
|
3645
|
+
}
|
3646
|
+
break;
|
3647
|
+
}
|
3648
|
+
}
|
3649
|
+
else {
|
3650
|
+
showText = composeText;
|
3651
|
+
}
|
3652
|
+
}
|
3653
|
+
return {
|
3654
|
+
width: Math.ceil(width),
|
3655
|
+
height: Math.ceil(maxLineCount == null || rowCount < maxLineCount ? textHeight + lineHeight : textHeight),
|
3656
|
+
text: totalText,
|
3657
|
+
isOverflow: isLimitRow,
|
3658
|
+
lastLineWidth: context?.measureText(showText).width ?? 0
|
3659
|
+
};
|
3660
|
+
};
|
3661
|
+
// 测量给定文本的宽度和高度。
|
3662
|
+
// 支持指定最大宽度 (maxWidth) 和最大行数 (maxLineCount),从而能够处理多行文本的自动换行和截断(例如在文本超过行数限制时添加省略号 "…")
|
3663
|
+
const measureText = (text, maxWidth, maxLineCount) => {
|
3664
|
+
return getWidthOfLongestText(castToString(text), maxWidth, maxLineCount);
|
3665
|
+
};
|
3666
|
+
// 可以将字体样式重置为初始默认配置
|
3667
|
+
const reset = () => setFont(defaults);
|
3668
|
+
setFont(o);
|
3669
|
+
return {
|
3670
|
+
context,
|
3671
|
+
measureText,
|
3672
|
+
setFont,
|
3673
|
+
reset
|
3674
|
+
};
|
2928
3675
|
};
|
2929
3676
|
|
2930
3677
|
const isCellMatchKeywords = (aiTable, field, recordId, keywords, references) => {
|
2931
3678
|
const cellValue = AITableQueries.getFieldValue(aiTable, [recordId, field._id]);
|
2932
3679
|
const transformValue = transformCellValue(aiTable, field, cellValue);
|
2933
|
-
const fieldMethod =
|
3680
|
+
const fieldMethod = FieldModelMap[field.type];
|
2934
3681
|
let cellFullText = fieldMethod.cellFullText(transformValue, field, references);
|
2935
3682
|
return keywords && cellFullText.length && cellFullText.some((text) => text.toLowerCase().includes(keywords.toLowerCase()));
|
2936
3683
|
};
|
@@ -3629,11 +4376,20 @@ class Drawer {
|
|
3629
4376
|
fill: colors.gray600
|
3630
4377
|
});
|
3631
4378
|
}
|
4379
|
+
else {
|
4380
|
+
imageCache.imageMapOnload(() => {
|
4381
|
+
this.image(options, crossOrigin, allowDefault);
|
4382
|
+
});
|
4383
|
+
}
|
3632
4384
|
return;
|
3633
4385
|
}
|
3634
4386
|
// Unloaded
|
3635
4387
|
if (image == null) {
|
3636
|
-
|
4388
|
+
imageCache.loadImage(url, url, { crossOrigin });
|
4389
|
+
imageCache.imageMapOnload(() => {
|
4390
|
+
this.image(options, crossOrigin, allowDefault);
|
4391
|
+
});
|
4392
|
+
return;
|
3637
4393
|
}
|
3638
4394
|
const isOrigin = opacity === 1;
|
3639
4395
|
if (!clipFunc && isOrigin) {
|
@@ -4374,15 +5130,21 @@ class AITableGridEventService {
|
|
4374
5130
|
getEditorComponent(type) {
|
4375
5131
|
const filedRenderSchema = this.aiFieldRenderers && this.aiFieldRenderers[type];
|
4376
5132
|
if (filedRenderSchema && filedRenderSchema.editor) {
|
4377
|
-
return
|
5133
|
+
return {
|
5134
|
+
component: filedRenderSchema.editor,
|
5135
|
+
isInternalComponent: false
|
5136
|
+
};
|
4378
5137
|
}
|
4379
|
-
return
|
5138
|
+
return {
|
5139
|
+
component: GRID_CELL_EDITOR_MAP[type],
|
5140
|
+
isInternalComponent: true
|
5141
|
+
};
|
4380
5142
|
}
|
4381
5143
|
openEdit(cellDom) {
|
4382
5144
|
const { x, y, width, height } = cellDom.getBoundingClientRect();
|
4383
5145
|
const fieldId = cellDom.getAttribute('fieldId');
|
4384
5146
|
const recordId = cellDom.getAttribute('recordId');
|
4385
|
-
const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
|
5147
|
+
const { component } = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
|
4386
5148
|
const ref = this.thyPopover.open(component, {
|
4387
5149
|
origin: cellDom,
|
4388
5150
|
originPosition: {
|
@@ -4455,9 +5217,10 @@ class AITableGridEventService {
|
|
4455
5217
|
}
|
4456
5218
|
openCellEditor(aiTable, options) {
|
4457
5219
|
const { container, recordId, fieldId, isHoverEdit, references } = options;
|
4458
|
-
const component = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
|
5220
|
+
const { component, isInternalComponent } = this.getEditorComponent(this.aiTable.fieldsMap()[fieldId].type);
|
4459
5221
|
const offsetOriginPosition = this.getOriginPosition(aiTable, options);
|
4460
5222
|
this.cellEditorPopoverRef = this.thyPopover.open(component, {
|
5223
|
+
viewContainerRef: isInternalComponent ? undefined : options?.viewContainerRef,
|
4461
5224
|
origin: container,
|
4462
5225
|
originPosition: offsetOriginPosition,
|
4463
5226
|
width: offsetOriginPosition.width + 'px',
|
@@ -4572,7 +5335,9 @@ class AITableGridBase {
|
|
4572
5335
|
this.aiTableInitialized = output();
|
4573
5336
|
this.aiAddRecord = output();
|
4574
5337
|
this.aiAddField = output();
|
5338
|
+
this.aiMoveField = output();
|
4575
5339
|
this.aiUpdateFieldValue = output();
|
5340
|
+
this.aiSetField = output();
|
4576
5341
|
this.fieldMenus = computed(() => {
|
4577
5342
|
return this.aiFieldConfig()?.fieldMenus || [];
|
4578
5343
|
});
|
@@ -4597,7 +5362,7 @@ class AITableGridBase {
|
|
4597
5362
|
this.initService();
|
4598
5363
|
}
|
4599
5364
|
initAITable() {
|
4600
|
-
this.aiTable = createAITable(this.aiRecords, this.aiFields);
|
5365
|
+
this.aiTable = createAITable(this.aiRecords, this.aiFields, this.gridData);
|
4601
5366
|
this.aiPlugins()?.forEach((plugin) => {
|
4602
5367
|
this.aiTable = plugin(this.aiTable);
|
4603
5368
|
});
|
@@ -4687,7 +5452,7 @@ class AITableGridBase {
|
|
4687
5452
|
}
|
4688
5453
|
}
|
4689
5454
|
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 }); }
|
5455
|
+
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
5456
|
}
|
4692
5457
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGridBase, decorators: [{
|
4693
5458
|
type: Component,
|
@@ -5204,6 +5969,636 @@ class AddRowLayout extends Layout {
|
|
5204
5969
|
}
|
5205
5970
|
const addRowLayout = new AddRowLayout();
|
5206
5971
|
|
5972
|
+
// 自动生成的图标常量文件
|
5973
|
+
const apk = `<?xml version="1.0" encoding="UTF-8"?>
|
5974
|
+
<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">
|
5975
|
+
<title>1.Base基础/1.icon图标/12.文件类型/APK</title>
|
5976
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/APK" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5977
|
+
<g id="APK" transform="translate(2.000000, 0.000000)">
|
5978
|
+
<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>
|
5979
|
+
<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>
|
5980
|
+
<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>
|
5981
|
+
</g>
|
5982
|
+
</g>
|
5983
|
+
</svg>`;
|
5984
|
+
const bak = `<?xml version="1.0" encoding="UTF-8"?>
|
5985
|
+
<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">
|
5986
|
+
<title>1.Base基础/1.icon图标/12.文件类型/BAK </title>
|
5987
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/BAK-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5988
|
+
<g id="BAK" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
5989
|
+
<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>
|
5990
|
+
<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>
|
5991
|
+
<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>
|
5992
|
+
</g>
|
5993
|
+
</g>
|
5994
|
+
</svg>`;
|
5995
|
+
const bat = `<?xml version="1.0" encoding="UTF-8"?>
|
5996
|
+
<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">
|
5997
|
+
<title>1.Base基础/1.icon图标/12.文件类型/BAT</title>
|
5998
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/BAT" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5999
|
+
<g id="bat" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6000
|
+
<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>
|
6001
|
+
<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>
|
6002
|
+
<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>
|
6003
|
+
</g>
|
6004
|
+
</g>
|
6005
|
+
</svg>`;
|
6006
|
+
const cs = `<?xml version="1.0" encoding="UTF-8"?>
|
6007
|
+
<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">
|
6008
|
+
<title>1.Base基础/1.icon图标/12.文件类型/C#</title>
|
6009
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/C#" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6010
|
+
<g id="c#" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6011
|
+
<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>
|
6012
|
+
<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>
|
6013
|
+
<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>
|
6014
|
+
</g>
|
6015
|
+
</g>
|
6016
|
+
</svg>`;
|
6017
|
+
const css = `<?xml version="1.0" encoding="UTF-8"?>
|
6018
|
+
<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">
|
6019
|
+
<title>1.Base基础/1.icon图标/12.文件类型/CSS</title>
|
6020
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/CSS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6021
|
+
<g id="css" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6022
|
+
<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>
|
6023
|
+
<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>
|
6024
|
+
<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>
|
6025
|
+
</g>
|
6026
|
+
</g>
|
6027
|
+
</svg>`;
|
6028
|
+
const csv = `<?xml version="1.0" encoding="UTF-8"?>
|
6029
|
+
<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">
|
6030
|
+
<title>1.Base基础/1.icon图标/12.文件类型/CSV</title>
|
6031
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/CSV" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6032
|
+
<g id="csv" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6033
|
+
<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>
|
6034
|
+
<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>
|
6035
|
+
<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>
|
6036
|
+
</g>
|
6037
|
+
</g>
|
6038
|
+
</svg>`;
|
6039
|
+
const defaultFile = `<?xml version="1.0" encoding="UTF-8"?>
|
6040
|
+
<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">
|
6041
|
+
<title>1.Base基础/1.icon图标/12.文件类型/文件</title>
|
6042
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/文件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6043
|
+
<g id="pdf" transform="translate(2.000000, 0.000000)">
|
6044
|
+
<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>
|
6045
|
+
<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>
|
6046
|
+
<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>
|
6047
|
+
</g>
|
6048
|
+
</g>
|
6049
|
+
</svg>`;
|
6050
|
+
const doc = `<?xml version="1.0" encoding="UTF-8"?>
|
6051
|
+
<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">
|
6052
|
+
<title>1.Base基础/1.icon图标/12.文件类型/DOC</title>
|
6053
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/DOC" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6054
|
+
<g id="word" transform="translate(1.800000, 0.000000)">
|
6055
|
+
<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>
|
6056
|
+
<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>
|
6057
|
+
<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>
|
6058
|
+
</g>
|
6059
|
+
</g>
|
6060
|
+
</svg>`;
|
6061
|
+
const exe = `<?xml version="1.0" encoding="UTF-8"?>
|
6062
|
+
<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">
|
6063
|
+
<title>1.Base基础/1.icon图标/12.文件类型/EXE</title>
|
6064
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/EXE" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6065
|
+
<g id="EXE" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6066
|
+
<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>
|
6067
|
+
<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>
|
6068
|
+
<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>
|
6069
|
+
</g>
|
6070
|
+
</g>
|
6071
|
+
</svg>`;
|
6072
|
+
const fla = `<?xml version="1.0" encoding="UTF-8"?>
|
6073
|
+
<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">
|
6074
|
+
<title>1.Base基础/1.icon图标/12.文件类型/FLA</title>
|
6075
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/FLA" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6076
|
+
<g id="FLA" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6077
|
+
<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>
|
6078
|
+
<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>
|
6079
|
+
<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>
|
6080
|
+
</g>
|
6081
|
+
</g>
|
6082
|
+
</svg>`;
|
6083
|
+
const html = `<?xml version="1.0" encoding="UTF-8"?>
|
6084
|
+
<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">
|
6085
|
+
<title>1.Base基础/1.icon图标/12.文件类型/HTML</title>
|
6086
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/HTML" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6087
|
+
<g id="HTML" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6088
|
+
<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>
|
6089
|
+
<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>
|
6090
|
+
<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>
|
6091
|
+
</g>
|
6092
|
+
</g>
|
6093
|
+
</svg>`;
|
6094
|
+
const img = `<?xml version="1.0" encoding="UTF-8"?>
|
6095
|
+
<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">
|
6096
|
+
<title>1.Base基础/1.icon图标/12.文件类型/图片</title>
|
6097
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/图片" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6098
|
+
<g id="excel" transform="translate(1.800000, 0.000000)">
|
6099
|
+
<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>
|
6100
|
+
<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>
|
6101
|
+
<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>
|
6102
|
+
</g>
|
6103
|
+
</g>
|
6104
|
+
</svg>`;
|
6105
|
+
const ipa = `<?xml version="1.0" encoding="UTF-8"?>
|
6106
|
+
<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">
|
6107
|
+
<title>1.Base基础/1.icon图标/12.文件类型/IPA</title>
|
6108
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/IPA" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6109
|
+
<g id="IPA" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6110
|
+
<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>
|
6111
|
+
<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>
|
6112
|
+
<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>
|
6113
|
+
</g>
|
6114
|
+
</g>
|
6115
|
+
</svg>`;
|
6116
|
+
const java = `<?xml version="1.0" encoding="UTF-8"?>
|
6117
|
+
<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">
|
6118
|
+
<title>1.Base基础/1.icon图标/12.文件类型/JAVA</title>
|
6119
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/JAVA" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6120
|
+
<g id="java" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6121
|
+
<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>
|
6122
|
+
<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>
|
6123
|
+
<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>
|
6124
|
+
</g>
|
6125
|
+
</g>
|
6126
|
+
</svg>`;
|
6127
|
+
const js = `<?xml version="1.0" encoding="UTF-8"?>
|
6128
|
+
<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">
|
6129
|
+
<title>1.Base基础/1.icon图标/12.文件类型/JS</title>
|
6130
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/JS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6131
|
+
<g id="js" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6132
|
+
<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>
|
6133
|
+
<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>
|
6134
|
+
<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>
|
6135
|
+
</g>
|
6136
|
+
</g>
|
6137
|
+
</svg>`;
|
6138
|
+
const key = `<?xml version="1.0" encoding="UTF-8"?>
|
6139
|
+
<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">
|
6140
|
+
<title>1.Base基础/1.icon图标/12.文件类型/KEY</title>
|
6141
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/KEY" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6142
|
+
<g id="keynote" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6143
|
+
<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>
|
6144
|
+
<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>
|
6145
|
+
<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>
|
6146
|
+
</g>
|
6147
|
+
</g>
|
6148
|
+
</svg>`;
|
6149
|
+
const mp3 = `<?xml version="1.0" encoding="UTF-8"?>
|
6150
|
+
<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">
|
6151
|
+
<title>1.Base基础/1.icon图标/12.文件类型/MP3</title>
|
6152
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/MP3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6153
|
+
<g id="MP3" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6154
|
+
<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>
|
6155
|
+
<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>
|
6156
|
+
<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>
|
6157
|
+
</g>
|
6158
|
+
</g>
|
6159
|
+
</svg>`;
|
6160
|
+
const page = `<?xml version="1.0" encoding="UTF-8"?>
|
6161
|
+
<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">
|
6162
|
+
<title>1.Base基础/1.icon图标/12.文件类型/文档</title>
|
6163
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/文档" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6164
|
+
<g id="pages" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6165
|
+
<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>
|
6166
|
+
<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>
|
6167
|
+
<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>
|
6168
|
+
</g>
|
6169
|
+
</g>
|
6170
|
+
</svg>`;
|
6171
|
+
const pdf = `<?xml version="1.0" encoding="UTF-8"?>
|
6172
|
+
<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">
|
6173
|
+
<title>1.Base基础/1.icon图标/12.文件类型/PDF</title>
|
6174
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/PDF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6175
|
+
<g id="pdf" transform="translate(2.000000, 0.000000)">
|
6176
|
+
<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>
|
6177
|
+
<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>
|
6178
|
+
<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>
|
6179
|
+
</g>
|
6180
|
+
</g>
|
6181
|
+
</svg>`;
|
6182
|
+
const php = `<?xml version="1.0" encoding="UTF-8"?>
|
6183
|
+
<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">
|
6184
|
+
<title>1.Base基础/1.icon图标/12.文件类型/PHP</title>
|
6185
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/PHP" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6186
|
+
<g id="php" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6187
|
+
<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>
|
6188
|
+
<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>
|
6189
|
+
<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>
|
6190
|
+
</g>
|
6191
|
+
</g>
|
6192
|
+
</svg>`;
|
6193
|
+
const ppt = `<?xml version="1.0" encoding="UTF-8"?>
|
6194
|
+
<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">
|
6195
|
+
<title>1.Base基础/1.icon图标/12.文件类型/PPT</title>
|
6196
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/PPT" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6197
|
+
<g id="ppt" transform="translate(2.000000, 0.000000)">
|
6198
|
+
<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>
|
6199
|
+
<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>
|
6200
|
+
<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>
|
6201
|
+
</g>
|
6202
|
+
</g>
|
6203
|
+
</svg>`;
|
6204
|
+
const rar = `<?xml version="1.0" encoding="UTF-8"?>
|
6205
|
+
<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">
|
6206
|
+
<title>1.Base基础/1.icon图标/12.文件类型/RAR</title>
|
6207
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/RAR" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6208
|
+
<g id="rar" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6209
|
+
<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>
|
6210
|
+
<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>
|
6211
|
+
</g>
|
6212
|
+
</g>
|
6213
|
+
</svg>`;
|
6214
|
+
const snippet = `<?xml version="1.0" encoding="UTF-8"?>
|
6215
|
+
<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">
|
6216
|
+
<title>1.Base基础/1.icon图标/12.文件类型/CODE</title>
|
6217
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/CODE" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6218
|
+
<g id="code" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6219
|
+
<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>
|
6220
|
+
<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>
|
6221
|
+
<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>
|
6222
|
+
</g>
|
6223
|
+
</g>
|
6224
|
+
</svg>`;
|
6225
|
+
const swf = `<?xml version="1.0" encoding="UTF-8"?>
|
6226
|
+
<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">
|
6227
|
+
<title>1.Base基础/1.icon图标/12.文件类型/SWF</title>
|
6228
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/SWF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6229
|
+
<g id="swf" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6230
|
+
<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>
|
6231
|
+
<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>
|
6232
|
+
<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>
|
6233
|
+
</g>
|
6234
|
+
</g>
|
6235
|
+
</svg>`;
|
6236
|
+
const ttf = `<?xml version="1.0" encoding="UTF-8"?>
|
6237
|
+
<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">
|
6238
|
+
<title>1.Base基础/1.icon图标/12.文件类型/TTF</title>
|
6239
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/TTF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6240
|
+
<g id="ttf" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6241
|
+
<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>
|
6242
|
+
<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>
|
6243
|
+
<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>
|
6244
|
+
<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>
|
6245
|
+
</g>
|
6246
|
+
</g>
|
6247
|
+
</svg>`;
|
6248
|
+
const txt = `<?xml version="1.0" encoding="UTF-8"?>
|
6249
|
+
<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">
|
6250
|
+
<title>1.Base基础/1.icon图标/12.文件类型/TXT</title>
|
6251
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/TXT" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6252
|
+
<g id="txt" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6253
|
+
<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>
|
6254
|
+
<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>
|
6255
|
+
<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>
|
6256
|
+
</g>
|
6257
|
+
</g>
|
6258
|
+
</svg>`;
|
6259
|
+
const video = `<?xml version="1.0" encoding="UTF-8"?>
|
6260
|
+
<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">
|
6261
|
+
<title>1.Base基础/1.icon图标/12.文件类型/MP4</title>
|
6262
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/MP4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6263
|
+
<g id="MP4" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6264
|
+
<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>
|
6265
|
+
<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>
|
6266
|
+
<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>
|
6267
|
+
</g>
|
6268
|
+
</g>
|
6269
|
+
</svg>`;
|
6270
|
+
const vss = `<?xml version="1.0" encoding="UTF-8"?>
|
6271
|
+
<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">
|
6272
|
+
<title>1.Base基础/1.icon图标/12.文件类型/VSS</title>
|
6273
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/VSS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6274
|
+
<g id="vss" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6275
|
+
<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>
|
6276
|
+
<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>
|
6277
|
+
<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>
|
6278
|
+
</g>
|
6279
|
+
</g>
|
6280
|
+
</svg>`;
|
6281
|
+
const xls = `<?xml version="1.0" encoding="UTF-8"?>
|
6282
|
+
<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">
|
6283
|
+
<title>1.Base基础/1.icon图标/12.文件类型/XLS</title>
|
6284
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/XLS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6285
|
+
<g id="excel" transform="translate(1.800000, 0.000000)">
|
6286
|
+
<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>
|
6287
|
+
<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>
|
6288
|
+
<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>
|
6289
|
+
</g>
|
6290
|
+
</g>
|
6291
|
+
</svg>`;
|
6292
|
+
const xsd = `<?xml version="1.0" encoding="UTF-8"?>
|
6293
|
+
<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">
|
6294
|
+
<title>1.Base基础/1.icon图标/12.文件类型/XSD</title>
|
6295
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/XSD" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6296
|
+
<g id="xsd" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6297
|
+
<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>
|
6298
|
+
<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>
|
6299
|
+
<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>
|
6300
|
+
</g>
|
6301
|
+
</g>
|
6302
|
+
</svg>`;
|
6303
|
+
const zip = `<?xml version="1.0" encoding="UTF-8"?>
|
6304
|
+
<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">
|
6305
|
+
<title>1.Base基础/1.icon图标/12.文件类型/ZIP</title>
|
6306
|
+
<g id="1.Base基础/1.icon图标/12.文件类型/ZIP" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
6307
|
+
<g id="rar" transform="translate(1.800000, 0.000000)" fill-rule="nonzero">
|
6308
|
+
<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>
|
6309
|
+
<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>
|
6310
|
+
</g>
|
6311
|
+
</g>
|
6312
|
+
</svg>`;
|
6313
|
+
|
6314
|
+
var fileIcons = /*#__PURE__*/Object.freeze({
|
6315
|
+
__proto__: null,
|
6316
|
+
apk: apk,
|
6317
|
+
bak: bak,
|
6318
|
+
bat: bat,
|
6319
|
+
cs: cs,
|
6320
|
+
css: css,
|
6321
|
+
csv: csv,
|
6322
|
+
defaultFile: defaultFile,
|
6323
|
+
doc: doc,
|
6324
|
+
exe: exe,
|
6325
|
+
fla: fla,
|
6326
|
+
html: html,
|
6327
|
+
img: img,
|
6328
|
+
ipa: ipa,
|
6329
|
+
java: java,
|
6330
|
+
js: js,
|
6331
|
+
key: key,
|
6332
|
+
mp3: mp3,
|
6333
|
+
page: page,
|
6334
|
+
pdf: pdf,
|
6335
|
+
php: php,
|
6336
|
+
ppt: ppt,
|
6337
|
+
rar: rar,
|
6338
|
+
snippet: snippet,
|
6339
|
+
swf: swf,
|
6340
|
+
ttf: ttf,
|
6341
|
+
txt: txt,
|
6342
|
+
video: video,
|
6343
|
+
vss: vss,
|
6344
|
+
xls: xls,
|
6345
|
+
xsd: xsd,
|
6346
|
+
zip: zip
|
6347
|
+
});
|
6348
|
+
|
6349
|
+
function parseSVGToCanvasObjects(svgString) {
|
6350
|
+
const parser = new DOMParser();
|
6351
|
+
const svgDoc = parser.parseFromString(svgString, 'image/svg+xml');
|
6352
|
+
const elements = svgDoc.querySelectorAll('path, polyline, polygon');
|
6353
|
+
const canvasObjects = [];
|
6354
|
+
elements.forEach((element) => {
|
6355
|
+
let d;
|
6356
|
+
if (element.tagName === 'path') {
|
6357
|
+
d = element.getAttribute('d');
|
6358
|
+
}
|
6359
|
+
else if (element.tagName === 'polyline' || element.tagName === 'polygon') {
|
6360
|
+
const points = element.getAttribute('points') || '';
|
6361
|
+
const pointArray = points.split(/\s+|,/).filter(Boolean);
|
6362
|
+
d = 'M' + pointArray[0] + ' ' + pointArray[1];
|
6363
|
+
for (let i = 2; i < pointArray.length; i += 2) {
|
6364
|
+
d += ' L' + pointArray[i] + ' ' + pointArray[i + 1];
|
6365
|
+
}
|
6366
|
+
if (element.tagName === 'polygon') {
|
6367
|
+
d += ' Z';
|
6368
|
+
}
|
6369
|
+
}
|
6370
|
+
const fill = element.getAttribute('fill') || 'black';
|
6371
|
+
const stroke = 'none';
|
6372
|
+
const strokeWidth = element.getAttribute('stroke-width') || 0;
|
6373
|
+
const opacity = parseFloat(element?.getAttribute('opacity') || '1');
|
6374
|
+
const fillRule = element.getAttribute('fill-rule') || 'nonzero';
|
6375
|
+
if (d) {
|
6376
|
+
canvasObjects.push({
|
6377
|
+
d,
|
6378
|
+
fill,
|
6379
|
+
stroke,
|
6380
|
+
strokeWidth,
|
6381
|
+
opacity,
|
6382
|
+
fillRule: fillRule
|
6383
|
+
});
|
6384
|
+
}
|
6385
|
+
});
|
6386
|
+
return canvasObjects;
|
6387
|
+
}
|
6388
|
+
const FileIcons = (() => {
|
6389
|
+
const result = {};
|
6390
|
+
Object.entries(fileIcons).forEach((fileIcon) => {
|
6391
|
+
result[fileIcon[0]] = parseSVGToCanvasObjects(fileIcon[1]);
|
6392
|
+
});
|
6393
|
+
return result;
|
6394
|
+
})();
|
6395
|
+
|
6396
|
+
function getFileThumbnailName(ext) {
|
6397
|
+
let result = 'defaultFile';
|
6398
|
+
switch (ext) {
|
6399
|
+
case 'doc':
|
6400
|
+
case 'docx':
|
6401
|
+
result = 'doc';
|
6402
|
+
break;
|
6403
|
+
case 'ppt':
|
6404
|
+
case 'pptx':
|
6405
|
+
result = 'ppt';
|
6406
|
+
break;
|
6407
|
+
case 'xls':
|
6408
|
+
case 'xlsx':
|
6409
|
+
result = 'xls';
|
6410
|
+
break;
|
6411
|
+
case 'css':
|
6412
|
+
case 'scss':
|
6413
|
+
case 'sass':
|
6414
|
+
case 'less':
|
6415
|
+
result = 'css';
|
6416
|
+
break;
|
6417
|
+
case 'png':
|
6418
|
+
case 'jpeg':
|
6419
|
+
case 'jpg':
|
6420
|
+
case 'gif':
|
6421
|
+
case 'bmp':
|
6422
|
+
case 'svg':
|
6423
|
+
result = 'img';
|
6424
|
+
break;
|
6425
|
+
case 'mp4':
|
6426
|
+
case 'mkv':
|
6427
|
+
case 'webm':
|
6428
|
+
case 'mov':
|
6429
|
+
case 'flv':
|
6430
|
+
case '3gp':
|
6431
|
+
case 'mpv':
|
6432
|
+
case 'avi':
|
6433
|
+
case 'mpeg':
|
6434
|
+
case 'wmv':
|
6435
|
+
result = 'video';
|
6436
|
+
break;
|
6437
|
+
case 'mp3':
|
6438
|
+
case 'wma':
|
6439
|
+
case 'wav':
|
6440
|
+
case 'ape':
|
6441
|
+
case 'flac':
|
6442
|
+
case 'ogg':
|
6443
|
+
case 'm4r':
|
6444
|
+
case 'm4a':
|
6445
|
+
result = 'mp3';
|
6446
|
+
break;
|
6447
|
+
case 'pdf':
|
6448
|
+
case 'txt':
|
6449
|
+
case 'apk':
|
6450
|
+
case 'bak':
|
6451
|
+
case 'cs':
|
6452
|
+
case 'csv':
|
6453
|
+
case 'exe':
|
6454
|
+
case 'fla':
|
6455
|
+
case 'html':
|
6456
|
+
case 'ipa':
|
6457
|
+
case 'java':
|
6458
|
+
case 'js':
|
6459
|
+
case 'php':
|
6460
|
+
case 'rar':
|
6461
|
+
case 'swf':
|
6462
|
+
case 'ttf':
|
6463
|
+
case 'vss':
|
6464
|
+
case 'xsd':
|
6465
|
+
case 'zip':
|
6466
|
+
case 'youdaonote':
|
6467
|
+
case 'evernote':
|
6468
|
+
case 'yinxiang':
|
6469
|
+
case 'quip':
|
6470
|
+
case 'onenote':
|
6471
|
+
case 'onedrive':
|
6472
|
+
case 'box':
|
6473
|
+
case 'shimo':
|
6474
|
+
case 'processon':
|
6475
|
+
result = ext;
|
6476
|
+
break;
|
6477
|
+
default:
|
6478
|
+
result = 'defaultFile';
|
6479
|
+
break;
|
6480
|
+
}
|
6481
|
+
return result;
|
6482
|
+
}
|
6483
|
+
function getFileThumbnailSvgString(ext) {
|
6484
|
+
let result = 'defaultFile';
|
6485
|
+
switch (ext) {
|
6486
|
+
case 'doc':
|
6487
|
+
case 'docx':
|
6488
|
+
result = doc;
|
6489
|
+
break;
|
6490
|
+
case 'ppt':
|
6491
|
+
case 'pptx':
|
6492
|
+
result = ppt;
|
6493
|
+
break;
|
6494
|
+
case 'xls':
|
6495
|
+
case 'xlsx':
|
6496
|
+
result = xls;
|
6497
|
+
break;
|
6498
|
+
case 'css':
|
6499
|
+
case 'scss':
|
6500
|
+
case 'sass':
|
6501
|
+
case 'less':
|
6502
|
+
result = css;
|
6503
|
+
break;
|
6504
|
+
case 'png':
|
6505
|
+
case 'jpeg':
|
6506
|
+
case 'jpg':
|
6507
|
+
case 'gif':
|
6508
|
+
case 'bmp':
|
6509
|
+
case 'svg':
|
6510
|
+
result = img;
|
6511
|
+
break;
|
6512
|
+
case 'mp4':
|
6513
|
+
case 'mkv':
|
6514
|
+
case 'webm':
|
6515
|
+
case 'mov':
|
6516
|
+
case 'flv':
|
6517
|
+
case '3gp':
|
6518
|
+
case 'mpv':
|
6519
|
+
case 'avi':
|
6520
|
+
case 'mpeg':
|
6521
|
+
case 'wmv':
|
6522
|
+
result = video;
|
6523
|
+
break;
|
6524
|
+
case 'mp3':
|
6525
|
+
case 'wma':
|
6526
|
+
case 'wav':
|
6527
|
+
case 'ape':
|
6528
|
+
case 'flac':
|
6529
|
+
case 'ogg':
|
6530
|
+
case 'm4r':
|
6531
|
+
case 'm4a':
|
6532
|
+
result = mp3;
|
6533
|
+
break;
|
6534
|
+
case 'pdf':
|
6535
|
+
result = pdf;
|
6536
|
+
break;
|
6537
|
+
case 'txt':
|
6538
|
+
result = txt;
|
6539
|
+
break;
|
6540
|
+
case 'apk':
|
6541
|
+
result = apk;
|
6542
|
+
break;
|
6543
|
+
case 'bak':
|
6544
|
+
result = apk;
|
6545
|
+
break;
|
6546
|
+
case 'cs':
|
6547
|
+
result = cs;
|
6548
|
+
break;
|
6549
|
+
case 'csv':
|
6550
|
+
result = csv;
|
6551
|
+
break;
|
6552
|
+
case 'exe':
|
6553
|
+
result = exe;
|
6554
|
+
break;
|
6555
|
+
case 'fla':
|
6556
|
+
result = fla;
|
6557
|
+
break;
|
6558
|
+
case 'html':
|
6559
|
+
result = html;
|
6560
|
+
break;
|
6561
|
+
case 'ipa':
|
6562
|
+
result = ipa;
|
6563
|
+
break;
|
6564
|
+
case 'java':
|
6565
|
+
result = java;
|
6566
|
+
break;
|
6567
|
+
case 'js':
|
6568
|
+
result = js;
|
6569
|
+
break;
|
6570
|
+
case 'php':
|
6571
|
+
result = php;
|
6572
|
+
break;
|
6573
|
+
case 'rar':
|
6574
|
+
result = rar;
|
6575
|
+
break;
|
6576
|
+
case 'swf':
|
6577
|
+
result = swf;
|
6578
|
+
break;
|
6579
|
+
case 'ttf':
|
6580
|
+
result = ttf;
|
6581
|
+
break;
|
6582
|
+
case 'vss':
|
6583
|
+
result = vss;
|
6584
|
+
break;
|
6585
|
+
case 'xsd':
|
6586
|
+
result = xsd;
|
6587
|
+
break;
|
6588
|
+
case 'zip':
|
6589
|
+
result = zip;
|
6590
|
+
break;
|
6591
|
+
default:
|
6592
|
+
result = defaultFile;
|
6593
|
+
break;
|
6594
|
+
}
|
6595
|
+
return result;
|
6596
|
+
}
|
6597
|
+
function getFileCanvasPaths(ext) {
|
6598
|
+
const fileThumbnailName = getFileThumbnailName(ext);
|
6599
|
+
return FileIcons[fileThumbnailName];
|
6600
|
+
}
|
6601
|
+
|
5207
6602
|
/**
|
5208
6603
|
* 处理和渲染表格单元格的内容
|
5209
6604
|
*/
|
@@ -5250,6 +6645,8 @@ class CellDrawer extends Drawer {
|
|
5250
6645
|
case AITableFieldType.createdBy:
|
5251
6646
|
case AITableFieldType.updatedBy:
|
5252
6647
|
return this.renderCellMember(render, ctx);
|
6648
|
+
case AITableFieldType.attachment:
|
6649
|
+
return this.renderCellAttachment(render, ctx);
|
5253
6650
|
default:
|
5254
6651
|
return null;
|
5255
6652
|
}
|
@@ -5810,6 +7207,75 @@ class CellDrawer extends Drawer {
|
|
5810
7207
|
}
|
5811
7208
|
}
|
5812
7209
|
}
|
7210
|
+
renderCellAttachment(render, ctx) {
|
7211
|
+
const { references, x, y, field, transformValue: _cellValue, rowHeight, columnWidth, isActive } = render;
|
7212
|
+
const cellValue = _cellValue;
|
7213
|
+
if (!cellValue?.length || !references) {
|
7214
|
+
return;
|
7215
|
+
}
|
7216
|
+
const fileIconSize = AI_TABLE_FILE_ICON_SIZE;
|
7217
|
+
const itemHeight = AI_TABLE_FILE_ICON_ITEM_HEIGHT;
|
7218
|
+
const isOperating = isActive;
|
7219
|
+
let currentX = AI_TABLE_CELL_PADDING;
|
7220
|
+
let currentY = (AI_TABLE_ROW_BLANK_HEIGHT - fileIconSize) / 2;
|
7221
|
+
const itemOtherWidth = fileIconSize + AI_TABLE_FIELD_ITEM_MARGIN_RIGHT;
|
7222
|
+
const maxHeight = isActive ? 130 - AI_TABLE_CELL_MULTI_PADDING_TOP : rowHeight - AI_TABLE_CELL_MULTI_PADDING_TOP;
|
7223
|
+
const maxTextWidth = isOperating
|
7224
|
+
? columnWidth - 2 * AI_TABLE_CELL_PADDING - itemOtherWidth - AI_TABLE_CELL_DELETE_ITEM_BUTTON_SIZE - 12
|
7225
|
+
: columnWidth - 2 * AI_TABLE_CELL_PADDING - itemOtherWidth;
|
7226
|
+
const listCount = cellValue.length;
|
7227
|
+
let isOverflow = false;
|
7228
|
+
for (let index = 0; index < listCount; index++) {
|
7229
|
+
const attachmentInfo = references.attachments[cellValue[index]];
|
7230
|
+
if (!attachmentInfo)
|
7231
|
+
continue;
|
7232
|
+
const { title, addition } = attachmentInfo;
|
7233
|
+
const itemWidth = AI_TABLE_FILE_ICON_SIZE + AI_TABLE_FIELD_ITEM_MARGIN_RIGHT;
|
7234
|
+
currentX = AI_TABLE_CELL_PADDING + index * itemWidth;
|
7235
|
+
let realMaxTextWidth = maxTextWidth < 0 ? 0 : maxTextWidth;
|
7236
|
+
if (index === 0 && isOperating) {
|
7237
|
+
const operatingMaxWidth = maxTextWidth - (AI_TABLE_CELL_ADD_ITEM_BUTTON_SIZE + 4);
|
7238
|
+
// item No space to display, then perform a line feed
|
7239
|
+
if (operatingMaxWidth <= 20) {
|
7240
|
+
currentX = AI_TABLE_CELL_PADDING;
|
7241
|
+
currentY += AI_TABLE_OPTION_ITEM_HEIGHT + AI_TABLE_CELL_MULTI_ITEM_MARGIN_TOP;
|
7242
|
+
}
|
7243
|
+
else {
|
7244
|
+
realMaxTextWidth = operatingMaxWidth;
|
7245
|
+
}
|
7246
|
+
}
|
7247
|
+
if (columnWidth != null) {
|
7248
|
+
// 在非活动状态下,当超出列宽时,不会渲染后续内容
|
7249
|
+
if (currentX >= columnWidth - 2 * AI_TABLE_CELL_PADDING) {
|
7250
|
+
break;
|
7251
|
+
}
|
7252
|
+
// 如果不是非活动状态的最后一行,则换行渲染溢出内容
|
7253
|
+
if (currentX > columnWidth - 2 * AI_TABLE_CELL_PADDING) {
|
7254
|
+
currentX = AI_TABLE_CELL_PADDING;
|
7255
|
+
}
|
7256
|
+
if (currentX + itemWidth > columnWidth - AI_TABLE_CELL_PADDING) {
|
7257
|
+
currentX = AI_TABLE_CELL_PADDING;
|
7258
|
+
currentY += itemHeight;
|
7259
|
+
}
|
7260
|
+
if (currentY >= maxHeight) {
|
7261
|
+
isOverflow = true;
|
7262
|
+
}
|
7263
|
+
}
|
7264
|
+
const svgString = getFileThumbnailSvgString(addition?.ext);
|
7265
|
+
const img = new Image();
|
7266
|
+
img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}`;
|
7267
|
+
if (ctx) {
|
7268
|
+
this.image({
|
7269
|
+
name: img.src,
|
7270
|
+
x: x + currentX,
|
7271
|
+
y: y + currentY,
|
7272
|
+
url: img.src,
|
7273
|
+
width: AI_TABLE_FILE_ICON_SIZE,
|
7274
|
+
height: AI_TABLE_FILE_ICON_SIZE
|
7275
|
+
});
|
7276
|
+
}
|
7277
|
+
}
|
7278
|
+
}
|
5813
7279
|
}
|
5814
7280
|
const cellDrawer = new CellDrawer();
|
5815
7281
|
|
@@ -6168,6 +7634,9 @@ class AITableFieldIcon {
|
|
6168
7634
|
case AITableFieldType.progress:
|
6169
7635
|
data = ColumnProgressFilledPath;
|
6170
7636
|
break;
|
7637
|
+
case AITableFieldType.attachment:
|
7638
|
+
data = AttachmentPath;
|
7639
|
+
break;
|
6171
7640
|
}
|
6172
7641
|
return {
|
6173
7642
|
x,
|
@@ -6353,10 +7822,10 @@ const createColumnHeads = (config) => {
|
|
6353
7822
|
const colors = Colors;
|
6354
7823
|
const { columnCount, rowInitSize: fieldHeadHeight } = coordinate;
|
6355
7824
|
const { columnIndex: pointColumnIndex, targetName: pointTargetName } = pointPosition;
|
6356
|
-
const
|
7825
|
+
const fields = aiTable.gridData().fields;
|
6357
7826
|
const getFieldHeadStatus = (fieldId) => {
|
6358
|
-
const iconVisible = [AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_MORE].includes(pointTargetName) && fields
|
6359
|
-
const isHoverIcon = pointTargetName === AI_TABLE_FIELD_HEAD_MORE && fields
|
7827
|
+
const iconVisible = [AI_TABLE_FIELD_HEAD, AI_TABLE_FIELD_HEAD_MORE].includes(pointTargetName) && fields[pointColumnIndex]?._id === fieldId;
|
7828
|
+
const isHoverIcon = pointTargetName === AI_TABLE_FIELD_HEAD_MORE && fields[pointColumnIndex]?._id === fieldId;
|
6360
7829
|
const isSelected = aiTable.selection().selectedFields.has(fieldId);
|
6361
7830
|
return {
|
6362
7831
|
iconVisible,
|
@@ -6375,7 +7844,7 @@ const createColumnHeads = (config) => {
|
|
6375
7844
|
break;
|
6376
7845
|
if (columnIndex < 0)
|
6377
7846
|
continue;
|
6378
|
-
const field = fields
|
7847
|
+
const field = fields[columnIndex];
|
6379
7848
|
if (field == null)
|
6380
7849
|
continue;
|
6381
7850
|
const x = coordinate.getColumnOffset(columnIndex);
|
@@ -7103,12 +8572,159 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
7103
8572
|
], 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
8573
|
}] });
|
7105
8574
|
|
8575
|
+
class AITableDragComponent {
|
8576
|
+
constructor() {
|
8577
|
+
this.dragEnd = output();
|
8578
|
+
this.aiTableGridSelectionService = inject(AITableGridSelectionService);
|
8579
|
+
this.render2 = inject(Renderer2);
|
8580
|
+
this.elementRef = inject((ElementRef));
|
8581
|
+
this.draggedData = null;
|
8582
|
+
this.mouseStartPosition = null;
|
8583
|
+
this.aiTableDrag = null;
|
8584
|
+
effect(() => {
|
8585
|
+
const drag = this.aiTableGridSelectionService.aiTable.dragState?.();
|
8586
|
+
if (drag && drag.sourceIds.size > 0) {
|
8587
|
+
if (!this.rect || !this.line) {
|
8588
|
+
return;
|
8589
|
+
}
|
8590
|
+
this.aiTableDrag = drag;
|
8591
|
+
}
|
8592
|
+
else {
|
8593
|
+
this.aiTableDrag = null;
|
8594
|
+
}
|
8595
|
+
});
|
8596
|
+
}
|
8597
|
+
ngOnInit() {
|
8598
|
+
this.rect = this.elementRef.nativeElement.querySelector('.rect');
|
8599
|
+
this.line = this.elementRef.nativeElement.querySelector('.line');
|
8600
|
+
this.mousedownListener = this.render2.listen('window', 'mousedown', (e) => {
|
8601
|
+
this.mouseStartPosition = { x: e.x, y: e.y };
|
8602
|
+
});
|
8603
|
+
this.mousemoveListener = this.render2.listen('window', 'mousemove', (e) => {
|
8604
|
+
if (this.timer) {
|
8605
|
+
cancelAnimationFrame(this.timer);
|
8606
|
+
}
|
8607
|
+
this.timer = requestAnimationFrame(() => {
|
8608
|
+
if (this.mouseStartPosition && this.aiTableDrag) {
|
8609
|
+
this.handleDrag(e, this.aiTableDrag);
|
8610
|
+
}
|
8611
|
+
});
|
8612
|
+
});
|
8613
|
+
this.mouseupListener = this.render2.listen('window', 'mouseup', () => {
|
8614
|
+
this.mouseStartPosition = null;
|
8615
|
+
this.aiTableDrag = null;
|
8616
|
+
this.handleDragEnd();
|
8617
|
+
});
|
8618
|
+
}
|
8619
|
+
handleDrag(e, drag) {
|
8620
|
+
if (drag.type !== DragType.none) {
|
8621
|
+
this.render2.setStyle(this.elementRef.nativeElement, 'display', 'block');
|
8622
|
+
}
|
8623
|
+
else {
|
8624
|
+
return;
|
8625
|
+
}
|
8626
|
+
const moveX = e.x - this.mouseStartPosition.x;
|
8627
|
+
const aiTable = this.aiTableGridSelectionService.aiTable;
|
8628
|
+
const scroll = drag.scroll || { x: 0, y: 0 };
|
8629
|
+
const coordinate = drag.coordinate;
|
8630
|
+
switch (drag.type) {
|
8631
|
+
case DragType.field:
|
8632
|
+
const fields = aiTable.fields();
|
8633
|
+
let width = 0;
|
8634
|
+
fields.forEach((field, index) => {
|
8635
|
+
if (drag.sourceIds.has(field._id)) {
|
8636
|
+
width += coordinate.columnIndicesSizeMap[index] || 0;
|
8637
|
+
}
|
8638
|
+
});
|
8639
|
+
const visibleColumnIndexMap = aiTable.context.visibleColumnsIndexMap();
|
8640
|
+
const sourceColumnIndex = visibleColumnIndexMap.get(drag.sourceIds.values().next().value) || 0;
|
8641
|
+
const sourceColumnStartX = coordinate.getColumnOffset(sourceColumnIndex);
|
8642
|
+
const sourceColumnWidth = coordinate.getColumnWidth(sourceColumnIndex);
|
8643
|
+
// TODO: 目前默认第一列为冻结列,后期支持设置冻结列需要处理
|
8644
|
+
const isSourceColumnFrozen = sourceColumnIndex === 0;
|
8645
|
+
const pointerX = moveX + sourceColumnStartX;
|
8646
|
+
// 拖拽中心点
|
8647
|
+
const dragCenter = sourceColumnWidth / 2;
|
8648
|
+
let targetColumnIndex = coordinate.getColumnStartIndex(pointerX + (isSourceColumnFrozen ? scroll.x : 0) + dragCenter);
|
8649
|
+
let targetColumnStartX = coordinate.getColumnOffset(targetColumnIndex);
|
8650
|
+
this.render2.setStyle(this.rect, 'cursor', 'move');
|
8651
|
+
this.render2.setStyle(this.rect, 'width', `${width}px`);
|
8652
|
+
this.render2.setStyle(this.rect, 'height', `100%`);
|
8653
|
+
this.render2.setStyle(this.rect, 'top', 0);
|
8654
|
+
this.render2.setStyle(this.rect, 'left', `${pointerX - (isSourceColumnFrozen ? 0 : scroll.x)}px`);
|
8655
|
+
const lastColumnOffset = coordinate.getColumnOffset(coordinate.columnCount - 1);
|
8656
|
+
const lastColumnWidth = coordinate.getColumnWidth(coordinate.columnCount - 1);
|
8657
|
+
let isLastColumn = false;
|
8658
|
+
// 处理最后一列
|
8659
|
+
if (pointerX + dragCenter > lastColumnOffset + lastColumnWidth) {
|
8660
|
+
targetColumnIndex = coordinate.columnCount;
|
8661
|
+
targetColumnStartX = lastColumnOffset + lastColumnWidth;
|
8662
|
+
isLastColumn = true;
|
8663
|
+
}
|
8664
|
+
if ((targetColumnIndex >= 0 && (targetColumnIndex - sourceColumnIndex > 1 || targetColumnIndex - sourceColumnIndex < 0)) ||
|
8665
|
+
isLastColumn) {
|
8666
|
+
this.render2.setStyle(this.line, 'width', `2px`);
|
8667
|
+
this.render2.setStyle(this.line, 'height', `100%`);
|
8668
|
+
this.render2.setStyle(this.line, 'top', 0);
|
8669
|
+
this.render2.setStyle(this.line, 'left', `${targetColumnStartX - scroll.x}px`);
|
8670
|
+
const fieldsIndex = [];
|
8671
|
+
drag.sourceIds.forEach((id) => {
|
8672
|
+
const index = visibleColumnIndexMap.get(id) || 0;
|
8673
|
+
fieldsIndex.push(index);
|
8674
|
+
});
|
8675
|
+
// 向右移动目标在目标列的前一列
|
8676
|
+
if (targetColumnIndex > sourceColumnIndex) {
|
8677
|
+
targetColumnIndex -= 1;
|
8678
|
+
}
|
8679
|
+
this.draggedData = { type: DragType.field, targetIndex: targetColumnIndex, fieldIds: drag.sourceIds, fieldsIndex };
|
8680
|
+
}
|
8681
|
+
else {
|
8682
|
+
this.render2.setStyle(this.line, 'width', 0);
|
8683
|
+
this.draggedData = null;
|
8684
|
+
}
|
8685
|
+
break;
|
8686
|
+
case DragType.record:
|
8687
|
+
break;
|
8688
|
+
case DragType.columnWidth:
|
8689
|
+
break;
|
8690
|
+
}
|
8691
|
+
}
|
8692
|
+
handleDragEnd() {
|
8693
|
+
this.render2.setStyle(this.elementRef.nativeElement, 'display', 'none');
|
8694
|
+
if (this.draggedData) {
|
8695
|
+
this.dragEnd.emit({ ...this.draggedData });
|
8696
|
+
this.draggedData = null;
|
8697
|
+
}
|
8698
|
+
}
|
8699
|
+
ngOnDestroy() {
|
8700
|
+
if (this.mousedownListener)
|
8701
|
+
this.mousedownListener();
|
8702
|
+
if (this.mousemoveListener)
|
8703
|
+
this.mousemoveListener();
|
8704
|
+
if (this.mouseupListener)
|
8705
|
+
this.mouseupListener();
|
8706
|
+
if (this.timer) {
|
8707
|
+
cancelAnimationFrame(this.timer);
|
8708
|
+
this.timer = null;
|
8709
|
+
}
|
8710
|
+
}
|
8711
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDragComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
8712
|
+
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 }); }
|
8713
|
+
}
|
8714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableDragComponent, decorators: [{
|
8715
|
+
type: Component,
|
8716
|
+
args: [{ selector: 'ai-table-drag', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
8717
|
+
class: 'drag-container'
|
8718
|
+
}, template: "<div class=\"rect\"></div>\n<div class=\"line\"></div>" }]
|
8719
|
+
}], ctorParameters: () => [] });
|
8720
|
+
|
7106
8721
|
class AITableGrid extends AITableGridBase {
|
7107
8722
|
constructor() {
|
7108
8723
|
super();
|
7109
8724
|
this.viewContainerRef = inject(ViewContainerRef);
|
7110
8725
|
this.isDragSelecting = false;
|
7111
8726
|
this.dragSelectionStart = null;
|
8727
|
+
this.notifyService = inject(ThyNotifyService);
|
7112
8728
|
this.fieldHeadHeight = AI_TABLE_FIELD_HEAD_HEIGHT;
|
7113
8729
|
this.containerRect = signal({ width: 0, height: 0 });
|
7114
8730
|
this.frozenColumnCount = signal(1);
|
@@ -7146,6 +8762,7 @@ class AITableGrid extends AITableGridBase {
|
|
7146
8762
|
});
|
7147
8763
|
return {
|
7148
8764
|
aiTable: this.aiTable,
|
8765
|
+
gridData: this.gridData(),
|
7149
8766
|
container: this.containerElement(),
|
7150
8767
|
coordinate: coordinate,
|
7151
8768
|
containerWidth: this.containerRect().width,
|
@@ -7201,6 +8818,7 @@ class AITableGrid extends AITableGridBase {
|
|
7201
8818
|
this.bindGlobalMousedown();
|
7202
8819
|
this.containerResizeListener();
|
7203
8820
|
this.bindWheel();
|
8821
|
+
this.bindClipboardShortcuts();
|
7204
8822
|
});
|
7205
8823
|
effect(() => {
|
7206
8824
|
if (this.hasContainerRect() && this.horizontalBarRef() && this.verticalBarRef()) {
|
@@ -7313,6 +8931,7 @@ class AITableGrid extends AITableGridBase {
|
|
7313
8931
|
if (!fieldId)
|
7314
8932
|
return;
|
7315
8933
|
this.aiTableGridSelectionService.selectField(fieldId);
|
8934
|
+
this.handleFieldDragStart();
|
7316
8935
|
return;
|
7317
8936
|
case AI_TABLE_CELL:
|
7318
8937
|
if (!recordId || !fieldId)
|
@@ -7439,6 +9058,7 @@ class AITableGrid extends AITableGridBase {
|
|
7439
9058
|
}
|
7440
9059
|
setTimeout(() => {
|
7441
9060
|
this.aiTableGridEventService.openCellEditor(this.aiTable, {
|
9061
|
+
viewContainerRef: this.viewContainerRef,
|
7442
9062
|
container: this.containerElement(),
|
7443
9063
|
coordinate: this.coordinate(),
|
7444
9064
|
fieldId: fieldId,
|
@@ -7536,6 +9156,7 @@ class AITableGrid extends AITableGridBase {
|
|
7536
9156
|
}
|
7537
9157
|
setTimeout(() => {
|
7538
9158
|
this.aiTableGridEventService.openCellEditor(this.aiTable, {
|
9159
|
+
viewContainerRef: this.viewContainerRef,
|
7539
9160
|
container: this.containerElement(),
|
7540
9161
|
coordinate: this.coordinate(),
|
7541
9162
|
fieldId: fieldId,
|
@@ -7555,19 +9176,96 @@ class AITableGrid extends AITableGridBase {
|
|
7555
9176
|
}
|
7556
9177
|
}
|
7557
9178
|
}
|
9179
|
+
bindClipboardShortcuts() {
|
9180
|
+
fromEvent(document, 'keydown')
|
9181
|
+
.pipe(filter((event) => (event.ctrlKey || event.metaKey) && (event.key === 'c' || event.key === 'v')), takeUntilDestroyed(this.destroyRef))
|
9182
|
+
.subscribe(async (event) => {
|
9183
|
+
if (event.key === 'c') {
|
9184
|
+
const clipboardData = buildClipboardData(this.aiTable);
|
9185
|
+
if (clipboardData) {
|
9186
|
+
writeToClipboard(clipboardData).then(() => {
|
9187
|
+
const copiedCellsCount = this.aiTable.selection().selectedCells.size;
|
9188
|
+
this.notifyService.success(`已复制 ${copiedCellsCount} 个单元格`, undefined, {
|
9189
|
+
placement: 'bottomLeft'
|
9190
|
+
});
|
9191
|
+
});
|
9192
|
+
}
|
9193
|
+
}
|
9194
|
+
else if (event.key === 'v') {
|
9195
|
+
event.preventDefault();
|
9196
|
+
const actions = {
|
9197
|
+
updateFieldValue: (data) => {
|
9198
|
+
this.aiUpdateFieldValue.emit(data);
|
9199
|
+
},
|
9200
|
+
setField: (field) => {
|
9201
|
+
this.aiSetField.emit(field);
|
9202
|
+
},
|
9203
|
+
addField: (data) => {
|
9204
|
+
this.aiAddField.emit(data);
|
9205
|
+
},
|
9206
|
+
addRecord: (data) => {
|
9207
|
+
this.addRecord();
|
9208
|
+
}
|
9209
|
+
};
|
9210
|
+
writeToAITable(this.aiTable, actions).then((isPasteSuccess) => {
|
9211
|
+
if (!isPasteSuccess) {
|
9212
|
+
this.notifyService.error('粘贴内容不符合当前类型', undefined, {
|
9213
|
+
placement: 'bottomLeft'
|
9214
|
+
});
|
9215
|
+
}
|
9216
|
+
});
|
9217
|
+
}
|
9218
|
+
});
|
9219
|
+
}
|
9220
|
+
handleFieldDragStart() {
|
9221
|
+
if (this.aiTableGridSelectionService.selectedFields.size > 0) {
|
9222
|
+
this.aiTableGridSelectionService.drag({
|
9223
|
+
type: DragType.field,
|
9224
|
+
sourceIds: this.aiTableGridSelectionService.selectedFields,
|
9225
|
+
scroll: this.getScrollPosition(),
|
9226
|
+
coordinate: this.coordinate()
|
9227
|
+
});
|
9228
|
+
}
|
9229
|
+
}
|
9230
|
+
getScrollPosition() {
|
9231
|
+
const horizontalBar = this.horizontalBarRef()?.nativeElement;
|
9232
|
+
const verticalBar = this.verticalBarRef()?.nativeElement;
|
9233
|
+
let scrollLeft = horizontalBar?.scrollLeft || 0;
|
9234
|
+
let scrollTop = verticalBar?.scrollTop || 0;
|
9235
|
+
return { x: scrollLeft, y: scrollTop };
|
9236
|
+
}
|
9237
|
+
dragEnd(data) {
|
9238
|
+
switch (data.type) {
|
9239
|
+
case DragType.field:
|
9240
|
+
if (data.fieldsIndex && data.targetIndex) {
|
9241
|
+
for (let i = 0; i < data.fieldsIndex.length; i++) {
|
9242
|
+
this.aiMoveField.emit({
|
9243
|
+
path: [data.fieldsIndex[i]],
|
9244
|
+
newPath: [data.targetIndex + i]
|
9245
|
+
});
|
9246
|
+
}
|
9247
|
+
}
|
9248
|
+
break;
|
9249
|
+
case DragType.columnWidth:
|
9250
|
+
break;
|
9251
|
+
case DragType.record:
|
9252
|
+
return;
|
9253
|
+
}
|
9254
|
+
this.aiTableGridSelectionService.clearDrag();
|
9255
|
+
}
|
7558
9256
|
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 }); }
|
9257
|
+
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
9258
|
}
|
7561
9259
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AITableGrid, decorators: [{
|
7562
9260
|
type: Component,
|
7563
9261
|
args: [{ selector: 'ai-table-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
7564
9262
|
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" }]
|
9263
|
+
}, 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
9264
|
}], ctorParameters: () => [] });
|
7567
9265
|
|
7568
9266
|
/**
|
7569
9267
|
* Generated bundle index. Do not edit.
|
7570
9268
|
*/
|
7571
9269
|
|
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,
|
9270
|
+
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
9271
|
//# sourceMappingURL=ai-table-grid.mjs.map
|