export-table-plugin-typescript 1.0.17 → 1.0.18
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/dist/ExportTS.d.ts.map +1 -1
- package/dist/ExportTS.js +6 -5
- package/package.json +1 -1
- package/src/ExportTS.ts +6 -5
package/dist/ExportTS.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportTS.d.ts","sourceRoot":"","sources":["../src/ExportTS.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAmF,MAAM,kBAAkB,CAAA;AAGnL,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"ExportTS.d.ts","sourceRoot":"","sources":["../src/ExportTS.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAmF,MAAM,kBAAkB,CAAA;AAGnL,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAyOpE;AAED,qBAAa,cAAe,SAAQ,UAAU;IAC7C,IAAI,SAAe;IACnB,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAQpC"}
|
package/dist/ExportTS.js
CHANGED
|
@@ -33,7 +33,8 @@ const fs = __importStar(require("fs-extra"));
|
|
|
33
33
|
function export_stuff(paras) {
|
|
34
34
|
var _a;
|
|
35
35
|
let { datas, fields, name, objects, tables, table, } = paras;
|
|
36
|
-
let
|
|
36
|
+
let ClassName = (0, export_table_lib_1.makeFirstLetterUpper)(name);
|
|
37
|
+
let RowClass = ClassName + "Row";
|
|
37
38
|
let initFunc = name + "Init";
|
|
38
39
|
let mapfield = fields.find(a => a.type == "key"); //如果是map,则生成对应的map
|
|
39
40
|
let mapName = name + "Map";
|
|
@@ -222,10 +223,10 @@ ${(0, export_table_lib_1.iff)(f.type == "fk[]", () => `
|
|
|
222
223
|
`)}
|
|
223
224
|
}
|
|
224
225
|
|
|
225
|
-
export class ${
|
|
226
|
-
public static readonly I = new ${
|
|
226
|
+
export class ${ClassName} {
|
|
227
|
+
public static readonly I = new ${ClassName}();
|
|
227
228
|
|
|
228
|
-
readonly Configs: ${RowClass}
|
|
229
|
+
readonly Configs: ${RowClass}[] = [];
|
|
229
230
|
|
|
230
231
|
protected LoadDefaultConfigs() {
|
|
231
232
|
|
|
@@ -266,7 +267,7 @@ export class ${RowClass} {
|
|
|
266
267
|
|
|
267
268
|
}
|
|
268
269
|
|
|
269
|
-
${
|
|
270
|
+
${ClassName}.I['LoadDefaultConfigs']()
|
|
270
271
|
|
|
271
272
|
`;
|
|
272
273
|
return temp;
|
package/package.json
CHANGED
package/src/ExportTS.ts
CHANGED
|
@@ -13,7 +13,8 @@ export function export_stuff(paras: HandleSheetParams): string | null {
|
|
|
13
13
|
table,
|
|
14
14
|
} = paras;
|
|
15
15
|
|
|
16
|
-
let
|
|
16
|
+
let ClassName = makeFirstLetterUpper(name)
|
|
17
|
+
let RowClass = ClassName + "Row"
|
|
17
18
|
let initFunc = name + "Init"
|
|
18
19
|
let mapfield = fields.find(a => a.type == "key")//如果是map,则生成对应的map
|
|
19
20
|
let mapName = name + "Map"
|
|
@@ -186,10 +187,10 @@ ${iff(f.type == "fk[]", () => `
|
|
|
186
187
|
`)}
|
|
187
188
|
}
|
|
188
189
|
|
|
189
|
-
export class ${
|
|
190
|
-
public static readonly I = new ${
|
|
190
|
+
export class ${ClassName} {
|
|
191
|
+
public static readonly I = new ${ClassName}();
|
|
191
192
|
|
|
192
|
-
readonly Configs: ${RowClass}
|
|
193
|
+
readonly Configs: ${RowClass}[] = [];
|
|
193
194
|
|
|
194
195
|
protected LoadDefaultConfigs() {
|
|
195
196
|
|
|
@@ -230,7 +231,7 @@ export class ${RowClass} {
|
|
|
230
231
|
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
${
|
|
234
|
+
${ClassName}.I['LoadDefaultConfigs']()
|
|
234
235
|
|
|
235
236
|
`
|
|
236
237
|
return temp
|