@nocobase/plugin-action-import 1.2.13-alpha → 1.3.0-alpha.20240710084543

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/package.json +2 -2
  2. package/dist/client/ImportActionInitializer.d.ts +0 -12
  3. package/dist/client/ImportDesigner.d.ts +0 -10
  4. package/dist/client/ImportModal.d.ts +0 -14
  5. package/dist/client/ImportPluginProvider.d.ts +0 -11
  6. package/dist/client/constants.d.ts +0 -9
  7. package/dist/client/context.d.ts +0 -37
  8. package/dist/client/index.d.ts +0 -17
  9. package/dist/client/index.js +0 -33
  10. package/dist/client/locale/index.d.ts +0 -10
  11. package/dist/client/schemaSettings.d.ts +0 -10
  12. package/dist/client/useFields.d.ts +0 -9
  13. package/dist/client/useImportAction.d.ts +0 -15
  14. package/dist/client/useShared.d.ts +0 -84
  15. package/dist/externalVersion.js +0 -30
  16. package/dist/index.d.ts +0 -11
  17. package/dist/index.js +0 -52
  18. package/dist/locale/en-US.json +0 -28
  19. package/dist/locale/es-ES.json +0 -27
  20. package/dist/locale/ko_KR.json +0 -28
  21. package/dist/locale/pt-BR.json +0 -27
  22. package/dist/locale/zh-CN.json +0 -30
  23. package/dist/node_modules/xlsx/LICENSE +0 -201
  24. package/dist/node_modules/xlsx/bin/xlsx.njs +0 -310
  25. package/dist/node_modules/xlsx/bower.json +0 -22
  26. package/dist/node_modules/xlsx/dist/cpexcel.d.ts +0 -39
  27. package/dist/node_modules/xlsx/dist/cpexcel.js +0 -1506
  28. package/dist/node_modules/xlsx/dist/shim.min.js +0 -2
  29. package/dist/node_modules/xlsx/dist/xlsx.core.min.js +0 -17
  30. package/dist/node_modules/xlsx/dist/xlsx.extendscript.js +0 -27961
  31. package/dist/node_modules/xlsx/dist/xlsx.full.min.js +0 -24
  32. package/dist/node_modules/xlsx/dist/xlsx.mini.min.js +0 -10
  33. package/dist/node_modules/xlsx/dist/xlsx.zahl.js +0 -4
  34. package/dist/node_modules/xlsx/dist/zahl.d.ts +0 -4
  35. package/dist/node_modules/xlsx/package.json +0 -1
  36. package/dist/node_modules/xlsx/types/index.d.ts +0 -1033
  37. package/dist/node_modules/xlsx/xlsx.js +0 -7
  38. package/dist/node_modules/xlsx/xlsxworker.js +0 -14
  39. package/dist/server/actions/download-xlsx-template.d.ts +0 -10
  40. package/dist/server/actions/download-xlsx-template.js +0 -67
  41. package/dist/server/actions/import-xlsx.d.ts +0 -10
  42. package/dist/server/actions/import-xlsx.js +0 -94
  43. package/dist/server/actions/index.d.ts +0 -10
  44. package/dist/server/actions/index.js +0 -32
  45. package/dist/server/index.d.ts +0 -14
  46. package/dist/server/index.js +0 -86
  47. package/dist/server/locale/en-US.d.ts +0 -19
  48. package/dist/server/locale/en-US.js +0 -41
  49. package/dist/server/locale/fr-FR.d.ts +0 -19
  50. package/dist/server/locale/fr-FR.js +0 -41
  51. package/dist/server/locale/index.d.ts +0 -10
  52. package/dist/server/locale/index.js +0 -49
  53. package/dist/server/locale/zh-CN.d.ts +0 -20
  54. package/dist/server/locale/zh-CN.js +0 -42
  55. package/dist/server/middleware/index.d.ts +0 -10
  56. package/dist/server/middleware/index.js +0 -43
  57. package/dist/server/migrations/20240425223956-change-locale-module.d.ts +0 -14
  58. package/dist/server/migrations/20240425223956-change-locale-module.js +0 -51
  59. package/dist/server/services/template-creator.d.ts +0 -24
  60. package/dist/server/services/template-creator.js +0 -70
  61. package/dist/server/services/xlsx-importer.d.ts +0 -39
  62. package/dist/server/services/xlsx-importer.js +0 -197
  63. package/dist/server/utils/index.d.ts +0 -14
  64. package/dist/server/utils/index.js +0 -63
  65. package/dist/server/utils/transform.d.ts +0 -92
  66. package/dist/server/utils/transform.js +0 -235
  67. package/dist/swagger/index.json +0 -33
@@ -1,51 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var change_locale_module_exports = {};
28
- __export(change_locale_module_exports, {
29
- default: () => change_locale_module_default
30
- });
31
- module.exports = __toCommonJS(change_locale_module_exports);
32
- var import_server = require("@nocobase/server");
33
- class change_locale_module_default extends import_server.Migration {
34
- on = "afterLoad";
35
- // 'beforeLoad' or 'afterLoad'
36
- appVersion = "<1.0.0-alpha.1";
37
- async up() {
38
- const repo = this.db.getRepository("localizationTexts");
39
- if (!repo) {
40
- return;
41
- }
42
- await repo.update({
43
- filter: {
44
- module: "resources.import"
45
- },
46
- values: {
47
- module: "resources.action-import"
48
- }
49
- });
50
- }
51
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { ICollection } from '@nocobase/data-source-manager';
10
- import { ImportColumn } from './xlsx-importer';
11
- import { WorkBook } from 'xlsx';
12
- type TemplateCreatorOptions = {
13
- collection?: ICollection;
14
- title?: string;
15
- explain?: string;
16
- columns: Array<ImportColumn>;
17
- };
18
- export declare class TemplateCreator {
19
- private options;
20
- constructor(options: TemplateCreatorOptions);
21
- run(): Promise<WorkBook>;
22
- renderHeaders(): string[];
23
- }
24
- export {};
@@ -1,70 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var template_creator_exports = {};
38
- __export(template_creator_exports, {
39
- TemplateCreator: () => TemplateCreator
40
- });
41
- module.exports = __toCommonJS(template_creator_exports);
42
- var import_xlsx = __toESM(require("xlsx"));
43
- class TemplateCreator {
44
- constructor(options) {
45
- this.options = options;
46
- }
47
- async run() {
48
- var _a;
49
- const workbook = import_xlsx.default.utils.book_new();
50
- const worksheet = import_xlsx.default.utils.sheet_new();
51
- const data = [this.renderHeaders()];
52
- if (this.options.explain && ((_a = this.options.explain) == null ? void 0 : _a.trim()) !== "") {
53
- data.unshift([this.options.explain]);
54
- }
55
- import_xlsx.default.utils.sheet_add_aoa(worksheet, data, {
56
- origin: "A1"
57
- });
58
- import_xlsx.default.utils.book_append_sheet(workbook, worksheet, "Sheet 1");
59
- return workbook;
60
- }
61
- renderHeaders() {
62
- return this.options.columns.map((col) => {
63
- return col.defaultTitle;
64
- });
65
- }
66
- }
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- TemplateCreator
70
- });
@@ -1,39 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- /// <reference types="node" />
10
- import XLSX, { WorkBook } from 'xlsx';
11
- import { ICollection, ICollectionManager } from '@nocobase/data-source-manager';
12
- import { Transaction } from 'sequelize';
13
- import EventEmitter from 'events';
14
- export type ImportColumn = {
15
- dataIndex: Array<string>;
16
- defaultTitle: string;
17
- };
18
- type ImporterOptions = {
19
- collectionManager: ICollectionManager;
20
- collection: ICollection;
21
- columns: Array<ImportColumn>;
22
- workbook: WorkBook;
23
- chunkSize?: number;
24
- explain?: string;
25
- };
26
- type RunOptions = {
27
- transaction?: Transaction;
28
- };
29
- export declare class XlsxImporter extends EventEmitter {
30
- private options;
31
- constructor(options: ImporterOptions);
32
- run(options?: RunOptions): Promise<number>;
33
- resetSeq(options?: RunOptions): Promise<void>;
34
- performImport(options?: RunOptions): Promise<number>;
35
- trimString(str: string): string;
36
- getData(): unknown[];
37
- firstSheet(): XLSX.WorkSheet;
38
- }
39
- export {};
@@ -1,197 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var xlsx_importer_exports = {};
38
- __export(xlsx_importer_exports, {
39
- XlsxImporter: () => XlsxImporter
40
- });
41
- module.exports = __toCommonJS(xlsx_importer_exports);
42
- var import_xlsx = __toESM(require("xlsx"));
43
- var import_lodash = __toESM(require("lodash"));
44
- var import_events = __toESM(require("events"));
45
- class XlsxImporter extends import_events.default {
46
- constructor(options) {
47
- super();
48
- this.options = options;
49
- if (options.columns.length == 0) {
50
- throw new Error(`columns is empty`);
51
- }
52
- }
53
- async run(options = {}) {
54
- let transaction = options.transaction;
55
- if (!transaction && this.options.collectionManager.db) {
56
- transaction = options.transaction = await this.options.collectionManager.db.sequelize.transaction();
57
- }
58
- try {
59
- const imported = await this.performImport(options);
60
- if (this.options.collectionManager.db) {
61
- await this.resetSeq(options);
62
- }
63
- transaction && await transaction.commit();
64
- return imported;
65
- } catch (error) {
66
- transaction && await transaction.rollback();
67
- throw error;
68
- }
69
- }
70
- async resetSeq(options) {
71
- const { transaction } = options;
72
- const db = this.options.collectionManager.db;
73
- const collection = this.options.collection;
74
- const autoIncrementAttribute = collection.model.autoIncrementAttribute;
75
- if (!autoIncrementAttribute) {
76
- return;
77
- }
78
- let hasImportedAutoIncrementPrimary = false;
79
- for (const importedDataIndex of this.options.columns) {
80
- if (importedDataIndex.dataIndex[0] === autoIncrementAttribute) {
81
- hasImportedAutoIncrementPrimary = true;
82
- break;
83
- }
84
- }
85
- if (!hasImportedAutoIncrementPrimary) {
86
- return;
87
- }
88
- let tableInfo = collection.getTableNameWithSchema();
89
- if (typeof tableInfo === "string") {
90
- tableInfo = {
91
- tableName: tableInfo
92
- };
93
- }
94
- const autoIncrInfo = await db.queryInterface.getAutoIncrementInfo({
95
- tableInfo,
96
- fieldName: autoIncrementAttribute,
97
- transaction
98
- });
99
- const maxVal = await collection.model.max(autoIncrementAttribute, { transaction });
100
- const queryInterface = db.queryInterface;
101
- await queryInterface.setAutoIncrementVal({
102
- tableInfo,
103
- columnName: collection.model.rawAttributes[autoIncrementAttribute].field,
104
- currentVal: maxVal,
105
- seqName: autoIncrInfo.seqName,
106
- transaction
107
- });
108
- this.emit("seqReset", { maxVal, seqName: autoIncrInfo.seqName });
109
- }
110
- async performImport(options) {
111
- const transaction = options == null ? void 0 : options.transaction;
112
- const rows = this.getData();
113
- const chunks = import_lodash.default.chunk(rows, this.options.chunkSize || 200);
114
- let handingRowIndex = 1;
115
- if (this.options.explain) {
116
- handingRowIndex += 1;
117
- }
118
- let imported = 0;
119
- for (const chunkRows of chunks) {
120
- for (const row of chunkRows) {
121
- const rowValues = {};
122
- handingRowIndex += 1;
123
- try {
124
- for (let index = 0; index < this.options.columns.length; index++) {
125
- const column = this.options.columns[index];
126
- const field = this.options.collection.getField(column.dataIndex[0]);
127
- if (!field) {
128
- throw new Error(`Field not found: ${column.dataIndex[0]}`);
129
- }
130
- const str = row[index];
131
- const dataKey = column.dataIndex[0];
132
- const fieldOptions = field.options;
133
- const interfaceName = fieldOptions.interface;
134
- const InterfaceClass = this.options.collectionManager.getFieldInterface(interfaceName);
135
- if (!InterfaceClass) {
136
- rowValues[dataKey] = str;
137
- continue;
138
- }
139
- const interfaceInstance = new InterfaceClass(field.options);
140
- const ctx = {
141
- transaction,
142
- field
143
- };
144
- if (column.dataIndex.length > 1) {
145
- ctx.targetCollection = field.targetCollection();
146
- ctx.filterKey = column.dataIndex[1];
147
- }
148
- rowValues[dataKey] = await interfaceInstance.toValue(this.trimString(str), ctx);
149
- }
150
- await this.options.collection.repository.create({
151
- values: rowValues,
152
- transaction
153
- });
154
- imported += 1;
155
- await new Promise((resolve) => setTimeout(resolve, 5));
156
- } catch (error) {
157
- throw new Error(
158
- `failed to import row ${handingRowIndex}, message: ${error.message}, rowData: ${JSON.stringify(rowValues)}`,
159
- { cause: error }
160
- );
161
- }
162
- }
163
- await new Promise((resolve) => setTimeout(resolve, 50));
164
- }
165
- return imported;
166
- }
167
- trimString(str) {
168
- if (typeof str === "string") {
169
- return str.trim();
170
- }
171
- return str;
172
- }
173
- getData() {
174
- const firstSheet = this.firstSheet();
175
- const rows = import_xlsx.default.utils.sheet_to_json(firstSheet, { header: 1, defval: null, raw: false });
176
- if (this.options.explain) {
177
- rows.shift();
178
- }
179
- const headers = rows[0];
180
- const columns = this.options.columns;
181
- for (let i = 0; i < columns.length; i++) {
182
- const column = columns[i];
183
- if (column.defaultTitle !== headers[i]) {
184
- throw new Error(`Invalid header: ${column.defaultTitle} !== ${headers[i]}`);
185
- }
186
- }
187
- rows.shift();
188
- return rows;
189
- }
190
- firstSheet() {
191
- return this.options.workbook.Sheets[this.options.workbook.SheetNames[0]];
192
- }
193
- }
194
- // Annotate the CommonJS export names for ESM import in node:
195
- 0 && (module.exports = {
196
- XlsxImporter
197
- });
@@ -1,14 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export declare function transform({ ctx, record, columns, fields }: {
10
- ctx: any;
11
- record: any;
12
- columns: any;
13
- fields: any;
14
- }): Promise<{}>;
@@ -1,63 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var utils_exports = {};
38
- __export(utils_exports, {
39
- transform: () => transform
40
- });
41
- module.exports = __toCommonJS(utils_exports);
42
- var import_lodash = __toESM(require("lodash"));
43
- var transforms = __toESM(require("./transform"));
44
- function getTransform(name) {
45
- return transforms[name] || transforms._;
46
- }
47
- async function transform({ ctx, record, columns, fields }) {
48
- const newRecord = {};
49
- for (let index = 0, iLen = record.length; index < iLen; index++) {
50
- const cell = record[index];
51
- const column = columns[index] ?? {};
52
- const { dataIndex } = column;
53
- const field = fields.find((f) => f.name === dataIndex[0]);
54
- const t = getTransform(field.options.interface);
55
- const value = await t({ ctx, column, value: cell, field });
56
- import_lodash.default.set(newRecord, dataIndex[0], value);
57
- }
58
- return newRecord;
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- transform
63
- });
@@ -1,92 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export declare function _({ value, field }: {
10
- value: any;
11
- field: any;
12
- }): Promise<any>;
13
- export declare function email({ value, field, ctx }: {
14
- value: any;
15
- field: any;
16
- ctx: any;
17
- }): Promise<any>;
18
- export declare function password({ value, field, ctx }: {
19
- value: any;
20
- field: any;
21
- ctx: any;
22
- }): Promise<string>;
23
- export declare function o2o({ value, column, field, ctx }: {
24
- value: any;
25
- column: any;
26
- field: any;
27
- ctx: any;
28
- }): Promise<any>;
29
- export declare const oho: typeof o2o;
30
- export declare const obo: typeof o2o;
31
- export declare function o2m({ value, column, field, ctx }: {
32
- value: any;
33
- column: any;
34
- field: any;
35
- ctx: any;
36
- }): Promise<any[]>;
37
- export declare function m2o({ value, column, field, ctx }: {
38
- value: any;
39
- column: any;
40
- field: any;
41
- ctx: any;
42
- }): Promise<any>;
43
- export declare function m2m({ value, column, field, ctx }: {
44
- value: any;
45
- column: any;
46
- field: any;
47
- ctx: any;
48
- }): Promise<any[]>;
49
- export declare function datetime({ value, field, ctx }: {
50
- value: any;
51
- field: any;
52
- ctx: any;
53
- }): Promise<any>;
54
- export declare function time({ value, field, ctx }: {
55
- value: any;
56
- field: any;
57
- ctx: any;
58
- }): Promise<any>;
59
- export declare function percent({ value, field, ctx }: {
60
- value: any;
61
- field: any;
62
- ctx: any;
63
- }): Promise<number>;
64
- export declare function checkbox({ value, column, field, ctx }: {
65
- value: any;
66
- column: any;
67
- field: any;
68
- ctx: any;
69
- }): Promise<0 | 1>;
70
- export declare const boolean: typeof checkbox;
71
- export declare function select({ value, column, field, ctx }: {
72
- value: any;
73
- column: any;
74
- field: any;
75
- ctx: any;
76
- }): Promise<any>;
77
- export declare const radio: typeof select;
78
- export declare const radioGroup: typeof select;
79
- export declare function multipleSelect({ value, column, field, ctx }: {
80
- value: any;
81
- column: any;
82
- field: any;
83
- ctx: any;
84
- }): Promise<any>;
85
- export declare const checkboxes: typeof multipleSelect;
86
- export declare const checkboxGroup: typeof multipleSelect;
87
- export declare function chinaRegion({ value, column, field, ctx }: {
88
- value: any;
89
- column: any;
90
- field: any;
91
- ctx: any;
92
- }): Promise<any>;