@univerjs/sheets-table 1.1.0 → 1.3.0
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/lib/cjs/index.js +118 -135
- package/lib/es/index.js +120 -136
- package/lib/index.js +120 -136
- package/lib/types/index.d.ts +3 -3
- package/lib/types/models/filter-util/record-filter.d.ts +4 -5
- package/lib/types/types/type.d.ts +2 -17
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanNumber, BorderStyleTypes, CellValueType, ColorKit, CommandType, DEFAULT_STYLES, DateSystem, DependentOn, Disposable, ErrorService, FilterSelectionMode, FormulaType, ICommandService, IConfigService, ILogService, IPermissionService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Plugin, RTree, RecordValueType, Rectangle, UniverInstanceType, customNameCharacterCheck, excelSerialToDateTime, generateRandomId, getColorStyle, merge, numfmt, regexp, registerDependencies, sequenceExecute, toDisposable, touchDependencies } from "@univerjs/core";
|
|
1
|
+
import { BooleanNumber, BorderStyleTypes, CellValueType, ColorKit, CommandType, DEFAULT_STYLES, DateSystem, DependentOn, Disposable, ErrorService, FilterSelectionMode, FormulaType, ICommandService, IConfigService, ILogService, IPermissionService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Plugin, RTree, RecordValueType, Rectangle, Tools, UniverInstanceType, customNameCharacterCheck, excelSerialToDateTime, generateRandomId, getColorStyle, getRecordValueKey, merge, numfmt, regexp, registerDependencies, sequenceExecute, toDisposable, touchDependencies } from "@univerjs/core";
|
|
2
2
|
import { IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, RemoveSuperTableMutation, SetSuperTableMutation, extractFormulaError, serializeRange } from "@univerjs/engine-formula";
|
|
3
3
|
import { AddRangeThemeMutation, CopySheetCommand, IExclusiveRangeService, INTERCEPTOR_POINT, InsertColCommand, InsertColMutation, InsertRowCommand, InsertRowMutation, MoveRangeCommand, RangeThemeStyle, RefRangeService, RemoveColCommand, RemoveColMutation, RemoveRangeThemeMutation, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SheetInterceptorService, SheetRangeThemeModel, SheetRangeThemeService, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, ZebraCrossingCacheController, checkRangesEditablePermission, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getSheetCommandTarget } from "@univerjs/sheets";
|
|
4
4
|
import { BehaviorSubject, Subject, filter, switchMap } from "rxjs";
|
|
@@ -130,6 +130,113 @@ let SheetsTableSortStateEnum = /* @__PURE__ */ function(SheetsTableSortStateEnum
|
|
|
130
130
|
return SheetsTableSortStateEnum;
|
|
131
131
|
}({});
|
|
132
132
|
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
135
|
+
function _typeof(o) {
|
|
136
|
+
"@babel/helpers - typeof";
|
|
137
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
138
|
+
return typeof o;
|
|
139
|
+
} : function(o) {
|
|
140
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
141
|
+
}, _typeof(o);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
146
|
+
function toPrimitive(t, r) {
|
|
147
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
148
|
+
var e = t[Symbol.toPrimitive];
|
|
149
|
+
if (void 0 !== e) {
|
|
150
|
+
var i = e.call(t, r || "default");
|
|
151
|
+
if ("object" != _typeof(i)) return i;
|
|
152
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
153
|
+
}
|
|
154
|
+
return ("string" === r ? String : Number)(t);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
159
|
+
function toPropertyKey(t) {
|
|
160
|
+
var i = toPrimitive(t, "string");
|
|
161
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
166
|
+
function _defineProperty(e, r, t) {
|
|
167
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
168
|
+
value: t,
|
|
169
|
+
enumerable: !0,
|
|
170
|
+
configurable: !0,
|
|
171
|
+
writable: !0
|
|
172
|
+
}) : e[r] = t, e;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/models/table-column.ts
|
|
177
|
+
var TableColumn = class {
|
|
178
|
+
constructor(id, name) {
|
|
179
|
+
_defineProperty(this, "dataType", void 0);
|
|
180
|
+
_defineProperty(this, "id", void 0);
|
|
181
|
+
_defineProperty(this, "displayName", void 0);
|
|
182
|
+
_defineProperty(this, "formula", void 0);
|
|
183
|
+
_defineProperty(this, "formulaIsArray", void 0);
|
|
184
|
+
_defineProperty(this, "totalsRowLabel", void 0);
|
|
185
|
+
_defineProperty(this, "totalsRowFunction", void 0);
|
|
186
|
+
_defineProperty(this, "totalsRowFormula", void 0);
|
|
187
|
+
_defineProperty(this, "showFilterButton", void 0);
|
|
188
|
+
_defineProperty(this, "meta", void 0);
|
|
189
|
+
_defineProperty(this, "style", void 0);
|
|
190
|
+
this.id = id;
|
|
191
|
+
this.displayName = name;
|
|
192
|
+
this.dataType = "string";
|
|
193
|
+
this.formula = "";
|
|
194
|
+
this.showFilterButton = true;
|
|
195
|
+
this.meta = {};
|
|
196
|
+
this.style = {};
|
|
197
|
+
}
|
|
198
|
+
getMeta() {
|
|
199
|
+
return this.meta;
|
|
200
|
+
}
|
|
201
|
+
setMeta(meta) {
|
|
202
|
+
this.meta = meta;
|
|
203
|
+
}
|
|
204
|
+
getDisplayName() {
|
|
205
|
+
return this.displayName;
|
|
206
|
+
}
|
|
207
|
+
toJSON() {
|
|
208
|
+
return {
|
|
209
|
+
id: this.id,
|
|
210
|
+
displayName: this.displayName,
|
|
211
|
+
dataType: this.dataType,
|
|
212
|
+
formula: this.formula,
|
|
213
|
+
formulaIsArray: this.formulaIsArray,
|
|
214
|
+
totalsRowLabel: this.totalsRowLabel,
|
|
215
|
+
totalsRowFunction: this.totalsRowFunction,
|
|
216
|
+
totalsRowFormula: this.totalsRowFormula,
|
|
217
|
+
showFilterButton: this.showFilterButton,
|
|
218
|
+
meta: this.meta,
|
|
219
|
+
style: this.style
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
fromJSON(json) {
|
|
223
|
+
this.id = json.id;
|
|
224
|
+
this.displayName = json.displayName;
|
|
225
|
+
this.dataType = json.dataType;
|
|
226
|
+
this.formula = json.formula;
|
|
227
|
+
this.formulaIsArray = json.formulaIsArray;
|
|
228
|
+
this.totalsRowLabel = json.totalsRowLabel;
|
|
229
|
+
this.totalsRowFunction = json.totalsRowFunction;
|
|
230
|
+
this.totalsRowFormula = json.totalsRowFormula;
|
|
231
|
+
this.showFilterButton = json.showFilterButton ?? true;
|
|
232
|
+
this.meta = json.meta;
|
|
233
|
+
this.style = json.style;
|
|
234
|
+
}
|
|
235
|
+
isShowFilterButton() {
|
|
236
|
+
return this.showFilterButton;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
133
240
|
//#endregion
|
|
134
241
|
//#region src/util.ts
|
|
135
242
|
function getColumnName(columnIndex, columnText) {
|
|
@@ -315,113 +422,6 @@ const tableThemeConfig = tableDefaultThemeStyleArr.map((item, index) => {
|
|
|
315
422
|
};
|
|
316
423
|
});
|
|
317
424
|
|
|
318
|
-
//#endregion
|
|
319
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
320
|
-
function _typeof(o) {
|
|
321
|
-
"@babel/helpers - typeof";
|
|
322
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
323
|
-
return typeof o;
|
|
324
|
-
} : function(o) {
|
|
325
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
326
|
-
}, _typeof(o);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
331
|
-
function toPrimitive(t, r) {
|
|
332
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
333
|
-
var e = t[Symbol.toPrimitive];
|
|
334
|
-
if (void 0 !== e) {
|
|
335
|
-
var i = e.call(t, r || "default");
|
|
336
|
-
if ("object" != _typeof(i)) return i;
|
|
337
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
338
|
-
}
|
|
339
|
-
return ("string" === r ? String : Number)(t);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
344
|
-
function toPropertyKey(t) {
|
|
345
|
-
var i = toPrimitive(t, "string");
|
|
346
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
//#endregion
|
|
350
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
351
|
-
function _defineProperty(e, r, t) {
|
|
352
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
353
|
-
value: t,
|
|
354
|
-
enumerable: !0,
|
|
355
|
-
configurable: !0,
|
|
356
|
-
writable: !0
|
|
357
|
-
}) : e[r] = t, e;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
//#endregion
|
|
361
|
-
//#region src/models/table-column.ts
|
|
362
|
-
var TableColumn = class {
|
|
363
|
-
constructor(id, name) {
|
|
364
|
-
_defineProperty(this, "dataType", void 0);
|
|
365
|
-
_defineProperty(this, "id", void 0);
|
|
366
|
-
_defineProperty(this, "displayName", void 0);
|
|
367
|
-
_defineProperty(this, "formula", void 0);
|
|
368
|
-
_defineProperty(this, "formulaIsArray", void 0);
|
|
369
|
-
_defineProperty(this, "totalsRowLabel", void 0);
|
|
370
|
-
_defineProperty(this, "totalsRowFunction", void 0);
|
|
371
|
-
_defineProperty(this, "totalsRowFormula", void 0);
|
|
372
|
-
_defineProperty(this, "showFilterButton", void 0);
|
|
373
|
-
_defineProperty(this, "meta", void 0);
|
|
374
|
-
_defineProperty(this, "style", void 0);
|
|
375
|
-
this.id = id;
|
|
376
|
-
this.displayName = name;
|
|
377
|
-
this.dataType = "string";
|
|
378
|
-
this.formula = "";
|
|
379
|
-
this.showFilterButton = true;
|
|
380
|
-
this.meta = {};
|
|
381
|
-
this.style = {};
|
|
382
|
-
}
|
|
383
|
-
getMeta() {
|
|
384
|
-
return this.meta;
|
|
385
|
-
}
|
|
386
|
-
setMeta(meta) {
|
|
387
|
-
this.meta = meta;
|
|
388
|
-
}
|
|
389
|
-
getDisplayName() {
|
|
390
|
-
return this.displayName;
|
|
391
|
-
}
|
|
392
|
-
toJSON() {
|
|
393
|
-
return {
|
|
394
|
-
id: this.id,
|
|
395
|
-
displayName: this.displayName,
|
|
396
|
-
dataType: this.dataType,
|
|
397
|
-
formula: this.formula,
|
|
398
|
-
formulaIsArray: this.formulaIsArray,
|
|
399
|
-
totalsRowLabel: this.totalsRowLabel,
|
|
400
|
-
totalsRowFunction: this.totalsRowFunction,
|
|
401
|
-
totalsRowFormula: this.totalsRowFormula,
|
|
402
|
-
showFilterButton: this.showFilterButton,
|
|
403
|
-
meta: this.meta,
|
|
404
|
-
style: this.style
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
fromJSON(json) {
|
|
408
|
-
this.id = json.id;
|
|
409
|
-
this.displayName = json.displayName;
|
|
410
|
-
this.dataType = json.dataType;
|
|
411
|
-
this.formula = json.formula;
|
|
412
|
-
this.formulaIsArray = json.formulaIsArray;
|
|
413
|
-
this.totalsRowLabel = json.totalsRowLabel;
|
|
414
|
-
this.totalsRowFunction = json.totalsRowFunction;
|
|
415
|
-
this.totalsRowFormula = json.totalsRowFormula;
|
|
416
|
-
this.showFilterButton = json.showFilterButton ?? true;
|
|
417
|
-
this.meta = json.meta;
|
|
418
|
-
this.style = json.style;
|
|
419
|
-
}
|
|
420
|
-
isShowFilterButton() {
|
|
421
|
-
return this.showFilterButton;
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region src/const.ts
|
|
427
427
|
/**
|
|
@@ -1338,35 +1338,13 @@ function getTableRecordValue(sheet, row, column) {
|
|
|
1338
1338
|
};
|
|
1339
1339
|
throw new TypeError("Invalid table record cell value.");
|
|
1340
1340
|
}
|
|
1341
|
-
function getTableRecordValueKey(_value) {
|
|
1342
|
-
const value = _value;
|
|
1343
|
-
if (!isRecord(value) || typeof value.type !== "string") throw new TypeError("Invalid table record value.");
|
|
1344
|
-
switch (value.type) {
|
|
1345
|
-
case RecordValueType.Blank:
|
|
1346
|
-
if ("value" in value) throw new TypeError("Blank table record values cannot have a value.");
|
|
1347
|
-
return "[\"blank\"]";
|
|
1348
|
-
case RecordValueType.String:
|
|
1349
|
-
case RecordValueType.Error:
|
|
1350
|
-
if (typeof value.value !== "string") throw new TypeError("Invalid table record value.");
|
|
1351
|
-
return JSON.stringify([value.type, value.value]);
|
|
1352
|
-
case RecordValueType.Boolean:
|
|
1353
|
-
if (typeof value.value !== "boolean") throw new TypeError("Invalid table record value.");
|
|
1354
|
-
return JSON.stringify([value.type, value.value]);
|
|
1355
|
-
case RecordValueType.Number:
|
|
1356
|
-
case RecordValueType.Date:
|
|
1357
|
-
if (typeof value.value !== "number") throw new TypeError("Invalid table record value.");
|
|
1358
|
-
if (!Number.isFinite(value.value)) throw new RangeError("Table record numeric values must be finite.");
|
|
1359
|
-
return JSON.stringify([value.type, value.value === 0 ? 0 : value.value]);
|
|
1360
|
-
default: throw new TypeError("Unknown table record value type.");
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
1341
|
function compileTableRecordFilter(_filter) {
|
|
1364
1342
|
const filter = _filter;
|
|
1365
1343
|
if (!isRecord(filter) || filter.filterType !== "record") throw new TypeError("Invalid table record filter.");
|
|
1366
1344
|
if (filter.mode !== FilterSelectionMode.Include && filter.mode !== FilterSelectionMode.Exclude || !Array.isArray(filter.values)) throw new TypeError("Invalid table record filter.");
|
|
1367
|
-
const keys = new Set(filter.values.map((value) =>
|
|
1368
|
-
if (filter.mode === FilterSelectionMode.Include) return (value) => keys.has(
|
|
1369
|
-
return (value) => !keys.has(
|
|
1345
|
+
const keys = new Set(filter.values.map((value) => getRecordValueKey(value)));
|
|
1346
|
+
if (filter.mode === FilterSelectionMode.Include) return (value) => keys.has(getRecordValueKey(value));
|
|
1347
|
+
return (value) => !keys.has(getRecordValueKey(value));
|
|
1370
1348
|
}
|
|
1371
1349
|
function cloneTableRecordFilter(filter) {
|
|
1372
1350
|
compileTableRecordFilter(filter);
|
|
@@ -2309,13 +2287,19 @@ const AddSheetTableCommand = {
|
|
|
2309
2287
|
const undos = [];
|
|
2310
2288
|
const { unitId, subUnitId, range } = params;
|
|
2311
2289
|
const header = tableManager.getColumnHeader(unitId, subUnitId, range, localeService.t("sheets-table.columnPrefix"));
|
|
2290
|
+
const options = Tools.deepClone(params.options ?? {});
|
|
2291
|
+
options.columns = header.map((name, index) => {
|
|
2292
|
+
var _options$columns;
|
|
2293
|
+
return ((_options$columns = options.columns) === null || _options$columns === void 0 ? void 0 : _options$columns[index]) ?? new TableColumn(generateRandomId(), name).toJSON();
|
|
2294
|
+
});
|
|
2312
2295
|
redos.push({
|
|
2313
2296
|
id: AddSheetTableMutation.id,
|
|
2314
2297
|
params: {
|
|
2315
2298
|
...params,
|
|
2316
2299
|
tableId,
|
|
2317
2300
|
name: tableName,
|
|
2318
|
-
header
|
|
2301
|
+
header,
|
|
2302
|
+
options
|
|
2319
2303
|
}
|
|
2320
2304
|
});
|
|
2321
2305
|
undos.push({
|
|
@@ -3954,7 +3938,7 @@ SheetsTableThemeController = __decorate([
|
|
|
3954
3938
|
//#endregion
|
|
3955
3939
|
//#region package.json
|
|
3956
3940
|
var name = "@univerjs/sheets-table";
|
|
3957
|
-
var version = "1.
|
|
3941
|
+
var version = "1.3.0";
|
|
3958
3942
|
|
|
3959
3943
|
//#endregion
|
|
3960
3944
|
//#region src/commands/mutations/move-sheet-table.mutation.ts
|
|
@@ -4931,4 +4915,4 @@ UniverSheetsTablePlugin = __decorate([
|
|
|
4931
4915
|
], UniverSheetsTablePlugin);
|
|
4932
4916
|
|
|
4933
4917
|
//#endregion
|
|
4934
|
-
export { AddSheetTableCommand, AddSheetTableMutation, AddTableThemeCommand, DeleteSheetTableCommand, DeleteSheetTableMutation, RemoveTableThemeCommand, SHEET_TABLE_CUSTOM_THEME_PREFIX, SetSheetTableCommand, SetSheetTableFilterCommand, SetSheetTableFilterMutation, SetSheetTableMutation, SetSheetTableSortStateCommand, SheetTableInsertColCommand, SheetTableInsertColumnAtCommand, SheetTableInsertRowAtCommand, SheetTableInsertRowCommand, SheetTableRemoveColCommand, SheetTableRemoveColumnAtCommand, SheetTableRemoveRowCommand, SheetTableService, SheetsTableButtonStateEnum, SheetsTableController, SheetsTableSortStateEnum, SheetsTableThemeController, TABLE_FILTER_EMPTY_VALUE, TableColumnDataTypeEnum, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableManager, TableNumberCompareTypeEnum, TableStringCompareTypeEnum, UniverSheetsTablePlugin, compileTableRecordFilter, customEmptyThemeWithBorderStyle, getExistingNamesSet, getTableRecordValue,
|
|
4918
|
+
export { AddSheetTableCommand, AddSheetTableMutation, AddTableThemeCommand, DeleteSheetTableCommand, DeleteSheetTableMutation, RemoveTableThemeCommand, SHEET_TABLE_CUSTOM_THEME_PREFIX, SetSheetTableCommand, SetSheetTableFilterCommand, SetSheetTableFilterMutation, SetSheetTableMutation, SetSheetTableSortStateCommand, SheetTableInsertColCommand, SheetTableInsertColumnAtCommand, SheetTableInsertRowAtCommand, SheetTableInsertRowCommand, SheetTableRemoveColCommand, SheetTableRemoveColumnAtCommand, SheetTableRemoveRowCommand, SheetTableService, SheetsTableButtonStateEnum, SheetsTableController, SheetsTableSortStateEnum, SheetsTableThemeController, TABLE_FILTER_EMPTY_VALUE, TableColumnDataTypeEnum, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableManager, TableNumberCompareTypeEnum, TableStringCompareTypeEnum, UniverSheetsTablePlugin, compileTableRecordFilter, customEmptyThemeWithBorderStyle, getExistingNamesSet, getTableRecordValue, isColorTableFilter, isConditionFilter, isManualTableFilter, isRecordTableFilter, processStyleWithBorderStyle, validateSheetTableName };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -37,13 +37,13 @@ export { SHEET_TABLE_CUSTOM_THEME_PREFIX, TABLE_FILTER_EMPTY_VALUE } from './con
|
|
|
37
37
|
export { SheetsTableThemeController } from './controllers/sheet-table-theme.controller';
|
|
38
38
|
export { SheetsTableController } from './controllers/sheets-table.controller';
|
|
39
39
|
export { customEmptyThemeWithBorderStyle, processStyleWithBorderStyle } from './controllers/table-theme.factory';
|
|
40
|
-
export { compileTableRecordFilter, getTableRecordValue
|
|
40
|
+
export { compileTableRecordFilter, getTableRecordValue } from './models/filter-util/record-filter';
|
|
41
41
|
export { TableManager } from './models/table-manager';
|
|
42
42
|
export { UniverSheetsTablePlugin } from './plugin';
|
|
43
43
|
export { SheetTableService } from './services/table.service';
|
|
44
44
|
export { SheetsTableButtonStateEnum, SheetsTableSortStateEnum, TableColumnDataTypeEnum, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableNumberCompareTypeEnum, TableStringCompareTypeEnum, } from './types/enum';
|
|
45
|
-
export type { ITableCalculatedColumnConfig, ITableColorFilterItem, ITableColumnJson, ITableConditionFilterItem, ITableData, ITableFilterButtonConfig, ITableFilterItem, ITableInfo, ITableInfoWithUnitId, ITableManualFilterItem, ITableOptions, ITableRange, ITableRangeWithState, ITableRecordFilterItem, TableMetaType,
|
|
45
|
+
export type { ITableCalculatedColumnConfig, ITableColorFilterItem, ITableColumnJson, ITableConditionFilterItem, ITableData, ITableFilterButtonConfig, ITableFilterItem, ITableInfo, ITableInfoWithUnitId, ITableManualFilterItem, ITableOptions, ITableRange, ITableRangeWithState, ITableRecordFilterItem, TableMetaType, TableRelationTupleType, } from './types/type';
|
|
46
46
|
export type { ITableJson, ITableSetConfig } from './types/type';
|
|
47
|
-
export { getExistingNamesSet, isColorTableFilter, isConditionFilter, isManualTableFilter, isRecordTableFilter } from './util';
|
|
47
|
+
export { getExistingNamesSet, isColorTableFilter, isConditionFilter, isManualTableFilter, isRecordTableFilter, } from './util';
|
|
48
48
|
export { validateSheetTableName } from './util/table-name';
|
|
49
49
|
export type { ISheetTableNameValidationResult, SheetTableNameValidationReason } from './util/table-name';
|
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { Worksheet } from '@univerjs/core';
|
|
17
|
-
import type { ITableRecordFilterItem
|
|
16
|
+
import type { RecordValue, Worksheet } from '@univerjs/core';
|
|
17
|
+
import type { ITableRecordFilterItem } from '../../types/type';
|
|
18
18
|
/**
|
|
19
19
|
* Formula errors are recognized when the cell retains formula, shared-formula, or intercepted array-formula context.
|
|
20
20
|
*/
|
|
21
|
-
export declare function getTableRecordValue(sheet: Worksheet, row: number, column: number):
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function compileTableRecordFilter(_filter: ITableRecordFilterItem): (value: TableRecordValue) => boolean;
|
|
21
|
+
export declare function getTableRecordValue(sheet: Worksheet, row: number, column: number): RecordValue;
|
|
22
|
+
export declare function compileTableRecordFilter(_filter: ITableRecordFilterItem): (value: RecordValue) => boolean;
|
|
24
23
|
export declare function cloneTableRecordFilter(filter: ITableRecordFilterItem): ITableRecordFilterItem;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { FilterSelectionMode, IRange, IStyleData, Nullable,
|
|
16
|
+
import type { FilterSelectionMode, IRange, IStyleData, Nullable, RecordValue } from '@univerjs/core';
|
|
17
17
|
import type { SheetsTableButtonStateEnum, SheetsTableSortStateEnum, TableColumnDataTypeEnum, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableNumberCompareTypeEnum, TableStringCompareTypeEnum } from './enum';
|
|
18
18
|
export interface ITableRange {
|
|
19
19
|
startRow: number;
|
|
@@ -63,21 +63,6 @@ export interface ITableFilterJSON {
|
|
|
63
63
|
sortState: SheetsTableSortStateEnum;
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
export type TableRecordValue = {
|
|
67
|
-
type: RecordValueType.Blank;
|
|
68
|
-
} | {
|
|
69
|
-
type: RecordValueType.String;
|
|
70
|
-
value: string;
|
|
71
|
-
} | {
|
|
72
|
-
type: RecordValueType.Number | RecordValueType.Date;
|
|
73
|
-
value: number;
|
|
74
|
-
} | {
|
|
75
|
-
type: RecordValueType.Boolean;
|
|
76
|
-
value: boolean;
|
|
77
|
-
} | {
|
|
78
|
-
type: RecordValueType.Error;
|
|
79
|
-
value: string;
|
|
80
|
-
};
|
|
81
66
|
export type ITableFilterItem = ITableManualFilterItem | ITableConditionFilterItem | ITableColorFilterItem | ITableRecordFilterItem;
|
|
82
67
|
export type TableMetaType = Record<string, any>;
|
|
83
68
|
/**
|
|
@@ -109,7 +94,7 @@ export interface ITableColorFilterItem {
|
|
|
109
94
|
export interface ITableRecordFilterItem {
|
|
110
95
|
filterType: TableColumnFilterTypeEnum.record;
|
|
111
96
|
mode: FilterSelectionMode.Include | FilterSelectionMode.Exclude;
|
|
112
|
-
values:
|
|
97
|
+
values: RecordValue[];
|
|
113
98
|
}
|
|
114
99
|
export interface ITableDateFilterInfo {
|
|
115
100
|
conditionType: TableConditionTypeEnum.Date;
|