@kissflow/lowcode-client-sdk 1.0.2-beta.6 → 1.0.2-beta.7
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/custom.build.js +18 -11
- package/dist/constants.js +2 -0
- package/dist/form.js +29 -11
- package/dist/global.types.d.ts +36 -35
- package/dist/index.d.ts +42 -33
- package/dist/kflowcode.sdk.js +31 -11
- package/dist/kflowcode.sdk.js.map +1 -1
- package/dist/kflowcode.sdk.module.js +31 -11
- package/dist/kflowcode.sdk.module.js.map +1 -1
- package/package.json +1 -1
- package/src/base.ts +1 -1
- package/src/constants.ts +2 -0
- package/src/form.ts +53 -20
package/custom.build.js
CHANGED
|
@@ -5,9 +5,9 @@ let classMappings = {
|
|
|
5
5
|
Application: { name: "Application" },
|
|
6
6
|
Client: { name: "Client" },
|
|
7
7
|
Component: { name: "Component" },
|
|
8
|
-
Form: { name: "Form"
|
|
9
|
-
Table: { name: "Table"
|
|
10
|
-
TableForm: { name: "TableForm"
|
|
8
|
+
Form: { name: "Form" },
|
|
9
|
+
Table: { name: "Table" },
|
|
10
|
+
TableForm: { name: "TableForm" },
|
|
11
11
|
Formatter: { name: "Formatter" },
|
|
12
12
|
LowcodeSDK: { name: "kf", staticDeclarations: true }
|
|
13
13
|
};
|
|
@@ -51,17 +51,24 @@ function transfromTypings() {
|
|
|
51
51
|
for (let i = 0; i < _class.fields.length; i++) {
|
|
52
52
|
// if (_class.fields[i].type.modulePath) {
|
|
53
53
|
let className = "";
|
|
54
|
-
if(_class.fields[i].type
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
if (!_class.fields[i].type) {
|
|
55
|
+
continue
|
|
56
|
+
} else if(_class.fields[i].type.options) {
|
|
57
|
+
// TODO: currently we add only the first typechecking
|
|
58
|
+
className = _class.fields[i].type.options[0].typeName;
|
|
59
|
+
|
|
60
|
+
// TODO: need to handle when there are multiple type
|
|
61
|
+
// let options = _class.fields[i].type.options
|
|
62
|
+
// for (let j = 0; j < options.length; j++) {
|
|
63
|
+
// className += options[j].typeName;
|
|
64
|
+
// if (j < options.length - 1) {
|
|
65
|
+
// className += " | ";
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
62
68
|
} else {
|
|
63
69
|
className = _class.fields[i].type.typeName;
|
|
64
70
|
}
|
|
71
|
+
|
|
65
72
|
let fieldName = _class.fields[i].name;
|
|
66
73
|
// console.log(_class.fields[i]);
|
|
67
74
|
toWrite += `\t${
|
package/dist/constants.js
CHANGED
|
@@ -13,6 +13,8 @@ exports.LISTENER_CMDS = {
|
|
|
13
13
|
GET_TABLE_ROW: "GET_TABLE_ROW",
|
|
14
14
|
ADD_TABLE_ROW: "ADD_TABLE_ROW",
|
|
15
15
|
DELETE_TABLE_ROW: "DELETE_TABLE_ROW",
|
|
16
|
+
TO_JSON: "TO_JSON",
|
|
17
|
+
GET_TABLE_ROWS: "GET_TABLE_ROWS",
|
|
16
18
|
//Client SDK functions
|
|
17
19
|
MESSAGE: "MESSAGE",
|
|
18
20
|
CONFIRM: "CONFIRM",
|
package/dist/form.js
CHANGED
|
@@ -23,8 +23,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
23
23
|
function Form(instanceId) {
|
|
24
24
|
var _this = _super.call(this, {}) || this;
|
|
25
25
|
_this.instanceId = instanceId;
|
|
26
|
+
_this.id = instanceId;
|
|
26
27
|
return _this;
|
|
27
28
|
}
|
|
29
|
+
Form.prototype.toJSON = function () {
|
|
30
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {
|
|
31
|
+
instanceId: this.instanceId
|
|
32
|
+
});
|
|
33
|
+
};
|
|
28
34
|
Form.prototype.getField = function (fieldId) {
|
|
29
35
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
30
36
|
instanceId: this.instanceId,
|
|
@@ -37,11 +43,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
37
43
|
});
|
|
38
44
|
};
|
|
39
45
|
Form.prototype.getTable = function (tableId) {
|
|
40
|
-
|
|
41
|
-
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE, { tableId: tableId }, true, // has callBack
|
|
42
|
-
function (data) {
|
|
43
|
-
return new Table(_this.instanceId, tableId); // callBack function
|
|
44
|
-
});
|
|
46
|
+
return new Table(this.instanceId, tableId);
|
|
45
47
|
};
|
|
46
48
|
return Form;
|
|
47
49
|
}(base_1.BaseSDK));
|
|
@@ -52,18 +54,27 @@ var Table = /** @class */ (function (_super) {
|
|
|
52
54
|
var _this = _super.call(this, {}) || this;
|
|
53
55
|
_this.tableId = tableId;
|
|
54
56
|
_this.instanceId = instanceId;
|
|
57
|
+
_this.id = tableId;
|
|
55
58
|
return _this;
|
|
56
59
|
}
|
|
57
|
-
|
|
60
|
+
// list of obj of rows
|
|
61
|
+
Table.prototype.toJSON = function () {
|
|
62
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {
|
|
63
|
+
tableId: this.tableId
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
Table.prototype.getRows = function () {
|
|
58
67
|
var _this = this;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
rowId: rowId
|
|
62
|
-
}, true, // has callBack
|
|
68
|
+
// list of TableForm class
|
|
69
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack
|
|
63
70
|
function (data) {
|
|
64
|
-
|
|
71
|
+
console.log(data);
|
|
72
|
+
return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });
|
|
65
73
|
});
|
|
66
74
|
};
|
|
75
|
+
Table.prototype.getRow = function (rowId) {
|
|
76
|
+
return new TableForm(this.instanceId, this.tableId, rowId);
|
|
77
|
+
};
|
|
67
78
|
Table.prototype.addRow = function (rowObject) {
|
|
68
79
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {
|
|
69
80
|
tableId: this.tableId,
|
|
@@ -85,10 +96,17 @@ var TableForm = /** @class */ (function (_super) {
|
|
|
85
96
|
_this.instanceId = instanceId;
|
|
86
97
|
_this.tableId = tableId;
|
|
87
98
|
_this.rowId = rowId;
|
|
99
|
+
_this.id = rowId;
|
|
88
100
|
_this.parent = new Form(instanceId);
|
|
89
101
|
_this.table = new Table(instanceId, tableId);
|
|
90
102
|
return _this;
|
|
91
103
|
}
|
|
104
|
+
TableForm.prototype.toJSON = function () {
|
|
105
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {
|
|
106
|
+
tableId: this.tableId,
|
|
107
|
+
rowId: this.rowId
|
|
108
|
+
});
|
|
109
|
+
};
|
|
92
110
|
TableForm.prototype.getField = function (fieldId) {
|
|
93
111
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
94
112
|
instanceId: this.instanceId,
|
package/dist/global.types.d.ts
CHANGED
|
@@ -1,68 +1,69 @@
|
|
|
1
1
|
|
|
2
2
|
declare class Page {
|
|
3
3
|
_id: string
|
|
4
|
-
getParameter(key: string):
|
|
5
|
-
getVariable(key: string):
|
|
6
|
-
setVariable(key: string, value: any):
|
|
4
|
+
getParameter(key: string): any;
|
|
5
|
+
getVariable(key: string): any;
|
|
6
|
+
setVariable(key: string, value: any): any;
|
|
7
7
|
openPopup(pageId: string, inputParams: object, popupProperties: {
|
|
8
8
|
w: number;
|
|
9
9
|
h: number;
|
|
10
|
-
}):
|
|
10
|
+
}): any;
|
|
11
11
|
onClose(callback: Function): void;
|
|
12
12
|
}
|
|
13
13
|
declare class Application {
|
|
14
14
|
page: Page
|
|
15
|
-
getVariable(key: string):
|
|
16
|
-
setVariable(key: string | object, value: any):
|
|
17
|
-
openPage(pageId: string, pageParams: object):
|
|
15
|
+
getVariable(key: string): any;
|
|
16
|
+
setVariable(key: string | object, value: any): any;
|
|
17
|
+
openPage(pageId: string, pageParams: object): any;
|
|
18
18
|
}
|
|
19
19
|
declare class Client {
|
|
20
|
-
showInfo(message: string):
|
|
20
|
+
showInfo(message: string): any;
|
|
21
21
|
showConfirm(args: {
|
|
22
22
|
title: string;
|
|
23
23
|
content: string;
|
|
24
24
|
okText: string;
|
|
25
25
|
cancelText: string;
|
|
26
|
-
}):
|
|
27
|
-
redirect(url: string):
|
|
26
|
+
}): any;
|
|
27
|
+
redirect(url: string): any;
|
|
28
28
|
}
|
|
29
29
|
declare class Component {
|
|
30
30
|
id: string
|
|
31
|
-
refresh():
|
|
32
|
-
show():
|
|
33
|
-
hide():
|
|
31
|
+
refresh(): any;
|
|
32
|
+
show(): any;
|
|
33
|
+
hide(): any;
|
|
34
34
|
}
|
|
35
35
|
declare class Form {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
id: string
|
|
37
|
+
toJSON(): any;
|
|
38
|
+
getField(fieldId: string): any;
|
|
39
|
+
updateField(args: object): any;
|
|
40
|
+
getTable(tableId: string): Table;
|
|
40
41
|
}
|
|
41
42
|
declare class Table {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
id: string
|
|
44
|
+
toJSON(): any;
|
|
45
|
+
getRows(): TableForm[];
|
|
46
|
+
getRow(rowId: string): TableForm;
|
|
47
|
+
addRow(rowObject: object): any;
|
|
48
|
+
deleteRow(rowId: string): any;
|
|
47
49
|
}
|
|
48
50
|
declare class TableForm {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
updateField(args: object): string | object;
|
|
51
|
+
id: string
|
|
52
|
+
table: Table
|
|
53
|
+
parent: Form
|
|
54
|
+
toJSON(): any;
|
|
55
|
+
getField(fieldId: string): any;
|
|
56
|
+
updateField(args: object): any;
|
|
56
57
|
}
|
|
57
58
|
declare class Formatter {
|
|
58
|
-
toKfDate(date: string):
|
|
59
|
-
toKfDateTime(date: string):
|
|
60
|
-
toKfNumber(value: string):
|
|
61
|
-
toKfCurrency(value: string, currencyCode: string):
|
|
62
|
-
toBoolean(value: string):
|
|
59
|
+
toKfDate(date: string): any;
|
|
60
|
+
toKfDateTime(date: string): any;
|
|
61
|
+
toKfNumber(value: string): any;
|
|
62
|
+
toKfCurrency(value: string, currencyCode: string): any;
|
|
63
|
+
toBoolean(value: string): any;
|
|
63
64
|
}
|
|
64
65
|
declare class kf {
|
|
65
|
-
static currentForm: Form
|
|
66
|
+
static currentForm: Form
|
|
66
67
|
static client: Client
|
|
67
68
|
static formatter: Formatter
|
|
68
69
|
static app: Application
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ declare module "constants" {
|
|
|
10
10
|
GET_TABLE_ROW: string;
|
|
11
11
|
ADD_TABLE_ROW: string;
|
|
12
12
|
DELETE_TABLE_ROW: string;
|
|
13
|
+
TO_JSON: string;
|
|
14
|
+
GET_TABLE_ROWS: string;
|
|
13
15
|
MESSAGE: string;
|
|
14
16
|
CONFIRM: string;
|
|
15
17
|
ALERT: string;
|
|
@@ -41,7 +43,7 @@ declare module "base" {
|
|
|
41
43
|
export class BaseSDK {
|
|
42
44
|
#private;
|
|
43
45
|
constructor(props: any);
|
|
44
|
-
_postMessageAsync(command: string, args: any, hasCallBack?: boolean, callBack?: (data: any) => {}): object | string;
|
|
46
|
+
_postMessageAsync(command: string, args: any, hasCallBack?: boolean, callBack?: (data: any) => {}): object | string | any;
|
|
45
47
|
_postMessage(command: string, func: (data: any) => {}, args?: {}): void;
|
|
46
48
|
_registerEventListener(_id: string, eventType: string, callback: any): void;
|
|
47
49
|
}
|
|
@@ -51,13 +53,13 @@ declare module "page" {
|
|
|
51
53
|
export class Page extends BaseSDK {
|
|
52
54
|
_id: string;
|
|
53
55
|
constructor(pageId: string);
|
|
54
|
-
getParameter(key: string):
|
|
55
|
-
getVariable(key: string):
|
|
56
|
-
setVariable(key: string, value: any):
|
|
56
|
+
getParameter(key: string): any;
|
|
57
|
+
getVariable(key: string): any;
|
|
58
|
+
setVariable(key: string, value: any): any;
|
|
57
59
|
openPopup(pageId: string, inputParams: object, popupProperties: {
|
|
58
60
|
w: number;
|
|
59
61
|
h: number;
|
|
60
|
-
}):
|
|
62
|
+
}): any;
|
|
61
63
|
onClose(callback: Function): void;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
@@ -67,22 +69,22 @@ declare module "app" {
|
|
|
67
69
|
export class Application extends BaseSDK {
|
|
68
70
|
page: Page;
|
|
69
71
|
constructor(props: any);
|
|
70
|
-
getVariable(key: string):
|
|
71
|
-
setVariable(key: string | object, value: any):
|
|
72
|
-
openPage(pageId: string, pageParams: object):
|
|
72
|
+
getVariable(key: string): any;
|
|
73
|
+
setVariable(key: string | object, value: any): any;
|
|
74
|
+
openPage(pageId: string, pageParams: object): any;
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
declare module "client" {
|
|
76
78
|
import { BaseSDK } from "base";
|
|
77
79
|
export class Client extends BaseSDK {
|
|
78
|
-
showInfo(message: string):
|
|
80
|
+
showInfo(message: string): any;
|
|
79
81
|
showConfirm(args: {
|
|
80
82
|
title: string;
|
|
81
83
|
content: string;
|
|
82
84
|
okText: string;
|
|
83
85
|
cancelText: string;
|
|
84
|
-
}):
|
|
85
|
-
redirect(url: string):
|
|
86
|
+
}): any;
|
|
87
|
+
redirect(url: string): any;
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
declare module "component" {
|
|
@@ -90,47 +92,54 @@ declare module "component" {
|
|
|
90
92
|
export class Component extends BaseSDK {
|
|
91
93
|
id: string;
|
|
92
94
|
constructor(id: string);
|
|
93
|
-
refresh():
|
|
94
|
-
show():
|
|
95
|
-
hide():
|
|
95
|
+
refresh(): any;
|
|
96
|
+
show(): any;
|
|
97
|
+
hide(): any;
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
declare module "form" {
|
|
99
101
|
import { BaseSDK } from "base";
|
|
100
102
|
export class Form extends BaseSDK {
|
|
101
|
-
instanceId
|
|
103
|
+
private instanceId;
|
|
104
|
+
id: string;
|
|
102
105
|
constructor(instanceId: string);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
toJSON(): any;
|
|
107
|
+
getField(fieldId: string): any;
|
|
108
|
+
updateField(args: object): any;
|
|
109
|
+
getTable(tableId: string): Table;
|
|
106
110
|
}
|
|
107
111
|
class Table extends BaseSDK {
|
|
108
|
-
tableId
|
|
109
|
-
instanceId
|
|
112
|
+
private tableId;
|
|
113
|
+
private instanceId;
|
|
114
|
+
id: string;
|
|
110
115
|
constructor(instanceId: string, tableId: string);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
toJSON(): any;
|
|
117
|
+
getRows(): TableForm[];
|
|
118
|
+
getRow(rowId: string): TableForm;
|
|
119
|
+
addRow(rowObject: object): any;
|
|
120
|
+
deleteRow(rowId: string): any;
|
|
114
121
|
}
|
|
115
122
|
export class TableForm extends BaseSDK {
|
|
116
|
-
instanceId
|
|
117
|
-
tableId
|
|
118
|
-
rowId
|
|
123
|
+
private instanceId;
|
|
124
|
+
private tableId;
|
|
125
|
+
private rowId;
|
|
126
|
+
id: string;
|
|
119
127
|
table: Table;
|
|
120
128
|
parent: Form;
|
|
121
129
|
constructor(instanceId: string, tableId: string, rowId: string);
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
toJSON(): any;
|
|
131
|
+
getField(fieldId: string): any;
|
|
132
|
+
updateField(args: object): any;
|
|
124
133
|
}
|
|
125
134
|
}
|
|
126
135
|
declare module "formatter" {
|
|
127
136
|
import { BaseSDK } from "base";
|
|
128
137
|
export class Formatter extends BaseSDK {
|
|
129
|
-
toKfDate(date: string):
|
|
130
|
-
toKfDateTime(date: string):
|
|
131
|
-
toKfNumber(value: string):
|
|
132
|
-
toKfCurrency(value: string, currencyCode: string):
|
|
133
|
-
toBoolean(value: string):
|
|
138
|
+
toKfDate(date: string): any;
|
|
139
|
+
toKfDateTime(date: string): any;
|
|
140
|
+
toKfNumber(value: string): any;
|
|
141
|
+
toKfCurrency(value: string, currencyCode: string): any;
|
|
142
|
+
toBoolean(value: string): any;
|
|
134
143
|
}
|
|
135
144
|
}
|
|
136
145
|
declare module "lowcode.sdk" {
|
package/dist/kflowcode.sdk.js
CHANGED
|
@@ -371,6 +371,8 @@ exports.LISTENER_CMDS = {
|
|
|
371
371
|
GET_TABLE_ROW: "GET_TABLE_ROW",
|
|
372
372
|
ADD_TABLE_ROW: "ADD_TABLE_ROW",
|
|
373
373
|
DELETE_TABLE_ROW: "DELETE_TABLE_ROW",
|
|
374
|
+
TO_JSON: "TO_JSON",
|
|
375
|
+
GET_TABLE_ROWS: "GET_TABLE_ROWS",
|
|
374
376
|
//Client SDK functions
|
|
375
377
|
MESSAGE: "MESSAGE",
|
|
376
378
|
CONFIRM: "CONFIRM",
|
|
@@ -436,8 +438,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
436
438
|
function Form(instanceId) {
|
|
437
439
|
var _this = _super.call(this, {}) || this;
|
|
438
440
|
_this.instanceId = instanceId;
|
|
441
|
+
_this.id = instanceId;
|
|
439
442
|
return _this;
|
|
440
443
|
}
|
|
444
|
+
Form.prototype.toJSON = function () {
|
|
445
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {
|
|
446
|
+
instanceId: this.instanceId
|
|
447
|
+
});
|
|
448
|
+
};
|
|
441
449
|
Form.prototype.getField = function (fieldId) {
|
|
442
450
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
443
451
|
instanceId: this.instanceId,
|
|
@@ -450,11 +458,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
450
458
|
});
|
|
451
459
|
};
|
|
452
460
|
Form.prototype.getTable = function (tableId) {
|
|
453
|
-
|
|
454
|
-
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE, { tableId: tableId }, true, // has callBack
|
|
455
|
-
function (data) {
|
|
456
|
-
return new Table(_this.instanceId, tableId); // callBack function
|
|
457
|
-
});
|
|
461
|
+
return new Table(this.instanceId, tableId);
|
|
458
462
|
};
|
|
459
463
|
return Form;
|
|
460
464
|
}(base_1.BaseSDK));
|
|
@@ -465,18 +469,27 @@ var Table = /** @class */ (function (_super) {
|
|
|
465
469
|
var _this = _super.call(this, {}) || this;
|
|
466
470
|
_this.tableId = tableId;
|
|
467
471
|
_this.instanceId = instanceId;
|
|
472
|
+
_this.id = tableId;
|
|
468
473
|
return _this;
|
|
469
474
|
}
|
|
470
|
-
|
|
475
|
+
// list of obj of rows
|
|
476
|
+
Table.prototype.toJSON = function () {
|
|
477
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {
|
|
478
|
+
tableId: this.tableId
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
Table.prototype.getRows = function () {
|
|
471
482
|
var _this = this;
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
rowId: rowId
|
|
475
|
-
}, true, // has callBack
|
|
483
|
+
// list of TableForm class
|
|
484
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack
|
|
476
485
|
function (data) {
|
|
477
|
-
|
|
486
|
+
console.log(data);
|
|
487
|
+
return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });
|
|
478
488
|
});
|
|
479
489
|
};
|
|
490
|
+
Table.prototype.getRow = function (rowId) {
|
|
491
|
+
return new TableForm(this.instanceId, this.tableId, rowId);
|
|
492
|
+
};
|
|
480
493
|
Table.prototype.addRow = function (rowObject) {
|
|
481
494
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {
|
|
482
495
|
tableId: this.tableId,
|
|
@@ -498,10 +511,17 @@ var TableForm = /** @class */ (function (_super) {
|
|
|
498
511
|
_this.instanceId = instanceId;
|
|
499
512
|
_this.tableId = tableId;
|
|
500
513
|
_this.rowId = rowId;
|
|
514
|
+
_this.id = rowId;
|
|
501
515
|
_this.parent = new Form(instanceId);
|
|
502
516
|
_this.table = new Table(instanceId, tableId);
|
|
503
517
|
return _this;
|
|
504
518
|
}
|
|
519
|
+
TableForm.prototype.toJSON = function () {
|
|
520
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {
|
|
521
|
+
tableId: this.tableId,
|
|
522
|
+
rowId: this.rowId
|
|
523
|
+
});
|
|
524
|
+
};
|
|
505
525
|
TableForm.prototype.getField = function (fieldId) {
|
|
506
526
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
507
527
|
instanceId: this.instanceId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kflowcode.sdk.js","mappings":";;;;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;AC1Ka;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC5Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6EAA6E,kBAAkB;AAC/F;AACA,yDAAyD;AACzD,SAAS;AACT;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0EAA0E;AAC1E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC7GJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,6BAA6B;AAC7B;AACA;AACA,kBAAe;;;;;;;;;;;AC3DF;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;AC7DyC;AACrD,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACoE;;;;;;;;;;;;;;;AC7DpE;AACA;AACsB;;;;;;;UCFtB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;ACNa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,oBAAoB,mBAAO,CAAC,2CAAe;AAC3C,IAAI,IAAuC;AAC3C;AACA;AACA,kBAAe","sources":["webpack://@kissflow/lowcode-client-sdk/./src/app.ts","webpack://@kissflow/lowcode-client-sdk/./src/base.ts","webpack://@kissflow/lowcode-client-sdk/./src/client.ts","webpack://@kissflow/lowcode-client-sdk/./src/component.ts","webpack://@kissflow/lowcode-client-sdk/./src/constants.ts","webpack://@kissflow/lowcode-client-sdk/./src/form.ts","webpack://@kissflow/lowcode-client-sdk/./src/formatter.ts","webpack://@kissflow/lowcode-client-sdk/./src/lowcode.sdk.ts","webpack://@kissflow/lowcode-client-sdk/./src/page.ts","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/index.dev.js","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/url-alphabet/index.js","webpack://@kissflow/lowcode-client-sdk/webpack/bootstrap","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/define property getters","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/make namespace object","webpack://@kissflow/lowcode-client-sdk/./src/index.ts"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Application = void 0;\nvar base_1 = require(\"./base\");\nvar page_1 = require(\"./page\");\nvar constants_1 = require(\"./constants\");\nvar Application = /** @class */ (function (_super) {\n __extends(Application, _super);\n function Application(props) {\n var _this = _super.call(this, {}) || this;\n _this.page = new page_1.Page({});\n return _this;\n }\n Application.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {\n key: key\n });\n };\n Application.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {\n key: key,\n value: value\n });\n };\n Application.prototype.openPage = function (pageId, pageParams) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {\n pageId: pageId,\n pageParams: pageParams\n });\n };\n return Application;\n}(base_1.BaseSDK));\nexports.Application = Application;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSDK = void 0;\nvar constants_1 = require(\"./constants\");\nvar nanoid = require(\"nanoid\").nanoid;\nfunction generateId(prefix) {\n if (prefix === void 0) { prefix = \"lcncsdk\"; }\n return \"\".concat(prefix, \"-\").concat(nanoid());\n}\nfunction postMessage(args) {\n console.log(\"SDK : @postMessage \", args);\n if (self.parent && self.parent !== self) {\n self.parent.postMessage(args, \"*\");\n }\n else {\n self.postMessage(args);\n }\n}\nvar BaseSDK = /** @class */ (function () {\n function BaseSDK(props) {\n _BaseSDK_instances.add(this);\n _BaseSDK_listeners.set(this, void 0);\n _BaseSDK_eventListeners.set(this, void 0);\n console.log(\"SDK : Initializing \", props);\n __classPrivateFieldSet(this, _BaseSDK_listeners, {}, \"f\");\n __classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, \"f\");\n self.addEventListener(\"message\", __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_onMessage).bind(this), false);\n }\n BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(_this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!data.errorMessage) return [3 /*break*/, 1];\n reject(data);\n return [3 /*break*/, 4];\n case 1:\n if (!(hasCallBack && callBack)) return [3 /*break*/, 3];\n return [4 /*yield*/, callBack(data)];\n case 2:\n data = _a.sent();\n _a.label = 3;\n case 3:\n resolve(data);\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); });\n });\n };\n BaseSDK.prototype._postMessage = function (command, func, args) {\n if (args === void 0) { args = {}; }\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });\n };\n BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);\n };\n return BaseSDK;\n}());\nexports.BaseSDK = BaseSDK;\n_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] || [];\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id].push(callback);\n}, _BaseSDK_appendEventListeners = function _BaseSDK_appendEventListeners(_id, eventType, callback) {\n if (!__classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id]) {\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] = {};\n }\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id][eventType] = callback;\n}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {\n var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;\n if (!_id || !eventType)\n return;\n var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] || {};\n if (eventListener[eventType]) {\n eventListener[eventType](eventParams || {});\n }\n}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {\n if (event.origin !== self.location.origin) {\n console.log(\"SDK : @onMessage \", event);\n var data_1 = event.data;\n if (data_1.isEvent) {\n return __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_checkEvents).call(this, data_1);\n }\n var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};\n var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];\n if (listeners) {\n listeners.forEach(function (listener) {\n try {\n if (data_1.resp) {\n if (Object.keys(data_1.resp).length === 1 &&\n _req_1.command !== constants_1.LISTENER_CMDS.API) {\n listener(Object.values(data_1.resp)[0]);\n }\n else {\n listener(data_1.resp);\n }\n }\n }\n catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n return _this;\n }\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n var _this = this;\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE, { tableId: tableId }, true, // has callBack\n function (data) {\n return new Table(_this.instanceId, tableId); // callBack function\n });\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n return _this;\n }\n Table.prototype.getRow = function (rowId) {\n var _this = this;\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n }, true, // has callBack\n function (data) {\n return new TableForm(_this.instanceId, _this.tableId, rowId); // callBack function\n });\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n _this.parent = new Form(instanceId);\n _this.table = new Table(instanceId, tableId);\n return _this;\n }\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toKfDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toKfDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toKfNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toKfCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar component_1 = require(\"./component\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n LowcodeSDK.prototype.getComponent = function (componentId) {\n return new component_1.Component(componentId);\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Page = /** @class */ (function (_super) {\n __extends(Page, _super);\n function Page(pageId) {\n var _this = _super.call(this, {}) || this;\n _this._id = pageId;\n return _this;\n }\n Page.prototype.getParameter = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_PARAMS, {\n key: key\n });\n };\n Page.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_VARIABLE, {\n key: key\n });\n };\n Page.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_PAGE_VARIABLE, {\n key: key,\n value: value\n });\n };\n Page.prototype.openPopup = function (pageId, inputParams, popupProperties) {\n var payload = {\n pageId: pageId,\n inputParams: inputParams,\n popupProperties: {\n width: popupProperties.w,\n height: popupProperties.h\n }\n };\n return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {\n return new Page(pageId);\n });\n };\n Page.prototype.onClose = function (callback) {\n this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);\n };\n return Page;\n}(base_1.BaseSDK));\nexports.Page = Page;\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (true) {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lowcode_sdk_1 = require(\"./lowcode.sdk\");\nif (typeof _BUILD !== \"undefined\" && _BUILD) {\n self.KF = lowcode_sdk_1.default;\n}\nexports.default = lowcode_sdk_1.default;\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"kflowcode.sdk.js","mappings":";;;;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;AC1Ka;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC9Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG;AACA;AACA,6CAA6C,gEAAgE;AAC7G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC/HJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,6BAA6B;AAC7B;AACA;AACA,kBAAe;;;;;;;;;;;AC3DF;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;AC7DyC;AACrD,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACoE;;;;;;;;;;;;;;;AC7DpE;AACA;AACsB;;;;;;;UCFtB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;ACNa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,oBAAoB,mBAAO,CAAC,2CAAe;AAC3C,IAAI,IAAuC;AAC3C;AACA;AACA,kBAAe","sources":["webpack://@kissflow/lowcode-client-sdk/./src/app.ts","webpack://@kissflow/lowcode-client-sdk/./src/base.ts","webpack://@kissflow/lowcode-client-sdk/./src/client.ts","webpack://@kissflow/lowcode-client-sdk/./src/component.ts","webpack://@kissflow/lowcode-client-sdk/./src/constants.ts","webpack://@kissflow/lowcode-client-sdk/./src/form.ts","webpack://@kissflow/lowcode-client-sdk/./src/formatter.ts","webpack://@kissflow/lowcode-client-sdk/./src/lowcode.sdk.ts","webpack://@kissflow/lowcode-client-sdk/./src/page.ts","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/index.dev.js","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/url-alphabet/index.js","webpack://@kissflow/lowcode-client-sdk/webpack/bootstrap","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/define property getters","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/make namespace object","webpack://@kissflow/lowcode-client-sdk/./src/index.ts"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Application = void 0;\nvar base_1 = require(\"./base\");\nvar page_1 = require(\"./page\");\nvar constants_1 = require(\"./constants\");\nvar Application = /** @class */ (function (_super) {\n __extends(Application, _super);\n function Application(props) {\n var _this = _super.call(this, {}) || this;\n _this.page = new page_1.Page({});\n return _this;\n }\n Application.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {\n key: key\n });\n };\n Application.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {\n key: key,\n value: value\n });\n };\n Application.prototype.openPage = function (pageId, pageParams) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {\n pageId: pageId,\n pageParams: pageParams\n });\n };\n return Application;\n}(base_1.BaseSDK));\nexports.Application = Application;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSDK = void 0;\nvar constants_1 = require(\"./constants\");\nvar nanoid = require(\"nanoid\").nanoid;\nfunction generateId(prefix) {\n if (prefix === void 0) { prefix = \"lcncsdk\"; }\n return \"\".concat(prefix, \"-\").concat(nanoid());\n}\nfunction postMessage(args) {\n console.log(\"SDK : @postMessage \", args);\n if (self.parent && self.parent !== self) {\n self.parent.postMessage(args, \"*\");\n }\n else {\n self.postMessage(args);\n }\n}\nvar BaseSDK = /** @class */ (function () {\n function BaseSDK(props) {\n _BaseSDK_instances.add(this);\n _BaseSDK_listeners.set(this, void 0);\n _BaseSDK_eventListeners.set(this, void 0);\n console.log(\"SDK : Initializing \", props);\n __classPrivateFieldSet(this, _BaseSDK_listeners, {}, \"f\");\n __classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, \"f\");\n self.addEventListener(\"message\", __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_onMessage).bind(this), false);\n }\n BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(_this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!data.errorMessage) return [3 /*break*/, 1];\n reject(data);\n return [3 /*break*/, 4];\n case 1:\n if (!(hasCallBack && callBack)) return [3 /*break*/, 3];\n return [4 /*yield*/, callBack(data)];\n case 2:\n data = _a.sent();\n _a.label = 3;\n case 3:\n resolve(data);\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); });\n });\n };\n BaseSDK.prototype._postMessage = function (command, func, args) {\n if (args === void 0) { args = {}; }\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });\n };\n BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);\n };\n return BaseSDK;\n}());\nexports.BaseSDK = BaseSDK;\n_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] || [];\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id].push(callback);\n}, _BaseSDK_appendEventListeners = function _BaseSDK_appendEventListeners(_id, eventType, callback) {\n if (!__classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id]) {\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] = {};\n }\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id][eventType] = callback;\n}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {\n var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;\n if (!_id || !eventType)\n return;\n var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] || {};\n if (eventListener[eventType]) {\n eventListener[eventType](eventParams || {});\n }\n}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {\n if (event.origin !== self.location.origin) {\n console.log(\"SDK : @onMessage \", event);\n var data_1 = event.data;\n if (data_1.isEvent) {\n return __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_checkEvents).call(this, data_1);\n }\n var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};\n var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];\n if (listeners) {\n listeners.forEach(function (listener) {\n try {\n if (data_1.resp) {\n if (Object.keys(data_1.resp).length === 1 &&\n _req_1.command !== constants_1.LISTENER_CMDS.API) {\n listener(Object.values(data_1.resp)[0]);\n }\n else {\n listener(data_1.resp);\n }\n }\n }\n catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n TO_JSON: \"TO_JSON\",\n GET_TABLE_ROWS: \"GET_TABLE_ROWS\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.id = instanceId;\n return _this;\n }\n Form.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n instanceId: this.instanceId\n });\n };\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n return new Table(this.instanceId, tableId);\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n _this.id = tableId;\n return _this;\n }\n // list of obj of rows\n Table.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId\n });\n };\n Table.prototype.getRows = function () {\n var _this = this;\n // list of TableForm class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack\n function (data) {\n console.log(data);\n return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });\n });\n };\n Table.prototype.getRow = function (rowId) {\n return new TableForm(this.instanceId, this.tableId, rowId);\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n _this.id = rowId;\n _this.parent = new Form(instanceId);\n _this.table = new Table(instanceId, tableId);\n return _this;\n }\n TableForm.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {\n tableId: this.tableId,\n rowId: this.rowId\n });\n };\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toKfDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toKfDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toKfNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toKfCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar component_1 = require(\"./component\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n LowcodeSDK.prototype.getComponent = function (componentId) {\n return new component_1.Component(componentId);\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Page = /** @class */ (function (_super) {\n __extends(Page, _super);\n function Page(pageId) {\n var _this = _super.call(this, {}) || this;\n _this._id = pageId;\n return _this;\n }\n Page.prototype.getParameter = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_PARAMS, {\n key: key\n });\n };\n Page.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_VARIABLE, {\n key: key\n });\n };\n Page.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_PAGE_VARIABLE, {\n key: key,\n value: value\n });\n };\n Page.prototype.openPopup = function (pageId, inputParams, popupProperties) {\n var payload = {\n pageId: pageId,\n inputParams: inputParams,\n popupProperties: {\n width: popupProperties.w,\n height: popupProperties.h\n }\n };\n return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {\n return new Page(pageId);\n });\n };\n Page.prototype.onClose = function (callback) {\n this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);\n };\n return Page;\n}(base_1.BaseSDK));\nexports.Page = Page;\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (true) {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lowcode_sdk_1 = require(\"./lowcode.sdk\");\nif (typeof _BUILD !== \"undefined\" && _BUILD) {\n self.KF = lowcode_sdk_1.default;\n}\nexports.default = lowcode_sdk_1.default;\n"],"names":[],"sourceRoot":""}
|
|
@@ -369,6 +369,8 @@ exports.LISTENER_CMDS = {
|
|
|
369
369
|
GET_TABLE_ROW: "GET_TABLE_ROW",
|
|
370
370
|
ADD_TABLE_ROW: "ADD_TABLE_ROW",
|
|
371
371
|
DELETE_TABLE_ROW: "DELETE_TABLE_ROW",
|
|
372
|
+
TO_JSON: "TO_JSON",
|
|
373
|
+
GET_TABLE_ROWS: "GET_TABLE_ROWS",
|
|
372
374
|
//Client SDK functions
|
|
373
375
|
MESSAGE: "MESSAGE",
|
|
374
376
|
CONFIRM: "CONFIRM",
|
|
@@ -434,8 +436,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
434
436
|
function Form(instanceId) {
|
|
435
437
|
var _this = _super.call(this, {}) || this;
|
|
436
438
|
_this.instanceId = instanceId;
|
|
439
|
+
_this.id = instanceId;
|
|
437
440
|
return _this;
|
|
438
441
|
}
|
|
442
|
+
Form.prototype.toJSON = function () {
|
|
443
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {
|
|
444
|
+
instanceId: this.instanceId
|
|
445
|
+
});
|
|
446
|
+
};
|
|
439
447
|
Form.prototype.getField = function (fieldId) {
|
|
440
448
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
441
449
|
instanceId: this.instanceId,
|
|
@@ -448,11 +456,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
448
456
|
});
|
|
449
457
|
};
|
|
450
458
|
Form.prototype.getTable = function (tableId) {
|
|
451
|
-
|
|
452
|
-
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE, { tableId: tableId }, true, // has callBack
|
|
453
|
-
function (data) {
|
|
454
|
-
return new Table(_this.instanceId, tableId); // callBack function
|
|
455
|
-
});
|
|
459
|
+
return new Table(this.instanceId, tableId);
|
|
456
460
|
};
|
|
457
461
|
return Form;
|
|
458
462
|
}(base_1.BaseSDK));
|
|
@@ -463,18 +467,27 @@ var Table = /** @class */ (function (_super) {
|
|
|
463
467
|
var _this = _super.call(this, {}) || this;
|
|
464
468
|
_this.tableId = tableId;
|
|
465
469
|
_this.instanceId = instanceId;
|
|
470
|
+
_this.id = tableId;
|
|
466
471
|
return _this;
|
|
467
472
|
}
|
|
468
|
-
|
|
473
|
+
// list of obj of rows
|
|
474
|
+
Table.prototype.toJSON = function () {
|
|
475
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {
|
|
476
|
+
tableId: this.tableId
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
Table.prototype.getRows = function () {
|
|
469
480
|
var _this = this;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
rowId: rowId
|
|
473
|
-
}, true, // has callBack
|
|
481
|
+
// list of TableForm class
|
|
482
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack
|
|
474
483
|
function (data) {
|
|
475
|
-
|
|
484
|
+
console.log(data);
|
|
485
|
+
return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });
|
|
476
486
|
});
|
|
477
487
|
};
|
|
488
|
+
Table.prototype.getRow = function (rowId) {
|
|
489
|
+
return new TableForm(this.instanceId, this.tableId, rowId);
|
|
490
|
+
};
|
|
478
491
|
Table.prototype.addRow = function (rowObject) {
|
|
479
492
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {
|
|
480
493
|
tableId: this.tableId,
|
|
@@ -496,10 +509,17 @@ var TableForm = /** @class */ (function (_super) {
|
|
|
496
509
|
_this.instanceId = instanceId;
|
|
497
510
|
_this.tableId = tableId;
|
|
498
511
|
_this.rowId = rowId;
|
|
512
|
+
_this.id = rowId;
|
|
499
513
|
_this.parent = new Form(instanceId);
|
|
500
514
|
_this.table = new Table(instanceId, tableId);
|
|
501
515
|
return _this;
|
|
502
516
|
}
|
|
517
|
+
TableForm.prototype.toJSON = function () {
|
|
518
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {
|
|
519
|
+
tableId: this.tableId,
|
|
520
|
+
rowId: this.rowId
|
|
521
|
+
});
|
|
522
|
+
};
|
|
503
523
|
TableForm.prototype.getField = function (fieldId) {
|
|
504
524
|
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
505
525
|
instanceId: this.instanceId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kflowcode.sdk.module.js","mappings":";;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;AC1Ka;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC5Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6EAA6E,kBAAkB;AAC/F;AACA,yDAAyD;AACzD,SAAS;AACT;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0EAA0E;AAC1E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC7GJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,6BAA6B;AAC7B;AACA;AACA,kBAAe;;;;;;;;;;;AC3DF;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;AC7DyC;AACrD,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACoE;;;;;;;;;;;;;;;AC7DpE;AACA;AACsB;;;;;;;SCFtB;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;;;;;;;ACNa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,oBAAoB,mBAAO,CAAC,2CAAe;AAC3C,IAAI,IAAuC;AAC3C;AACA;AACA,kBAAe","sources":["webpack://@kissflow/lowcode-client-sdk/./src/app.ts","webpack://@kissflow/lowcode-client-sdk/./src/base.ts","webpack://@kissflow/lowcode-client-sdk/./src/client.ts","webpack://@kissflow/lowcode-client-sdk/./src/component.ts","webpack://@kissflow/lowcode-client-sdk/./src/constants.ts","webpack://@kissflow/lowcode-client-sdk/./src/form.ts","webpack://@kissflow/lowcode-client-sdk/./src/formatter.ts","webpack://@kissflow/lowcode-client-sdk/./src/lowcode.sdk.ts","webpack://@kissflow/lowcode-client-sdk/./src/page.ts","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/index.dev.js","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/url-alphabet/index.js","webpack://@kissflow/lowcode-client-sdk/webpack/bootstrap","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/define property getters","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/make namespace object","webpack://@kissflow/lowcode-client-sdk/./src/index.ts"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Application = void 0;\nvar base_1 = require(\"./base\");\nvar page_1 = require(\"./page\");\nvar constants_1 = require(\"./constants\");\nvar Application = /** @class */ (function (_super) {\n __extends(Application, _super);\n function Application(props) {\n var _this = _super.call(this, {}) || this;\n _this.page = new page_1.Page({});\n return _this;\n }\n Application.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {\n key: key\n });\n };\n Application.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {\n key: key,\n value: value\n });\n };\n Application.prototype.openPage = function (pageId, pageParams) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {\n pageId: pageId,\n pageParams: pageParams\n });\n };\n return Application;\n}(base_1.BaseSDK));\nexports.Application = Application;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSDK = void 0;\nvar constants_1 = require(\"./constants\");\nvar nanoid = require(\"nanoid\").nanoid;\nfunction generateId(prefix) {\n if (prefix === void 0) { prefix = \"lcncsdk\"; }\n return \"\".concat(prefix, \"-\").concat(nanoid());\n}\nfunction postMessage(args) {\n console.log(\"SDK : @postMessage \", args);\n if (self.parent && self.parent !== self) {\n self.parent.postMessage(args, \"*\");\n }\n else {\n self.postMessage(args);\n }\n}\nvar BaseSDK = /** @class */ (function () {\n function BaseSDK(props) {\n _BaseSDK_instances.add(this);\n _BaseSDK_listeners.set(this, void 0);\n _BaseSDK_eventListeners.set(this, void 0);\n console.log(\"SDK : Initializing \", props);\n __classPrivateFieldSet(this, _BaseSDK_listeners, {}, \"f\");\n __classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, \"f\");\n self.addEventListener(\"message\", __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_onMessage).bind(this), false);\n }\n BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(_this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!data.errorMessage) return [3 /*break*/, 1];\n reject(data);\n return [3 /*break*/, 4];\n case 1:\n if (!(hasCallBack && callBack)) return [3 /*break*/, 3];\n return [4 /*yield*/, callBack(data)];\n case 2:\n data = _a.sent();\n _a.label = 3;\n case 3:\n resolve(data);\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); });\n });\n };\n BaseSDK.prototype._postMessage = function (command, func, args) {\n if (args === void 0) { args = {}; }\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });\n };\n BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);\n };\n return BaseSDK;\n}());\nexports.BaseSDK = BaseSDK;\n_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] || [];\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id].push(callback);\n}, _BaseSDK_appendEventListeners = function _BaseSDK_appendEventListeners(_id, eventType, callback) {\n if (!__classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id]) {\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] = {};\n }\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id][eventType] = callback;\n}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {\n var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;\n if (!_id || !eventType)\n return;\n var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] || {};\n if (eventListener[eventType]) {\n eventListener[eventType](eventParams || {});\n }\n}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {\n if (event.origin !== self.location.origin) {\n console.log(\"SDK : @onMessage \", event);\n var data_1 = event.data;\n if (data_1.isEvent) {\n return __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_checkEvents).call(this, data_1);\n }\n var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};\n var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];\n if (listeners) {\n listeners.forEach(function (listener) {\n try {\n if (data_1.resp) {\n if (Object.keys(data_1.resp).length === 1 &&\n _req_1.command !== constants_1.LISTENER_CMDS.API) {\n listener(Object.values(data_1.resp)[0]);\n }\n else {\n listener(data_1.resp);\n }\n }\n }\n catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n return _this;\n }\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n var _this = this;\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE, { tableId: tableId }, true, // has callBack\n function (data) {\n return new Table(_this.instanceId, tableId); // callBack function\n });\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n return _this;\n }\n Table.prototype.getRow = function (rowId) {\n var _this = this;\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n }, true, // has callBack\n function (data) {\n return new TableForm(_this.instanceId, _this.tableId, rowId); // callBack function\n });\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n _this.parent = new Form(instanceId);\n _this.table = new Table(instanceId, tableId);\n return _this;\n }\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toKfDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toKfDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toKfNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toKfCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar component_1 = require(\"./component\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n LowcodeSDK.prototype.getComponent = function (componentId) {\n return new component_1.Component(componentId);\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Page = /** @class */ (function (_super) {\n __extends(Page, _super);\n function Page(pageId) {\n var _this = _super.call(this, {}) || this;\n _this._id = pageId;\n return _this;\n }\n Page.prototype.getParameter = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_PARAMS, {\n key: key\n });\n };\n Page.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_VARIABLE, {\n key: key\n });\n };\n Page.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_PAGE_VARIABLE, {\n key: key,\n value: value\n });\n };\n Page.prototype.openPopup = function (pageId, inputParams, popupProperties) {\n var payload = {\n pageId: pageId,\n inputParams: inputParams,\n popupProperties: {\n width: popupProperties.w,\n height: popupProperties.h\n }\n };\n return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {\n return new Page(pageId);\n });\n };\n Page.prototype.onClose = function (callback) {\n this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);\n };\n return Page;\n}(base_1.BaseSDK));\nexports.Page = Page;\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (true) {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lowcode_sdk_1 = require(\"./lowcode.sdk\");\nif (typeof _BUILD !== \"undefined\" && _BUILD) {\n self.KF = lowcode_sdk_1.default;\n}\nexports.default = lowcode_sdk_1.default;\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"kflowcode.sdk.module.js","mappings":";;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;AC1Ka;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC9Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG;AACA;AACA,6CAA6C,gEAAgE;AAC7G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC/HJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,6BAA6B;AAC7B;AACA;AACA,kBAAe;;;;;;;;;;;AC3DF;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;AC7DyC;AACrD,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACoE;;;;;;;;;;;;;;;AC7DpE;AACA;AACsB;;;;;;;SCFtB;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;;;;;;;ACNa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,oBAAoB,mBAAO,CAAC,2CAAe;AAC3C,IAAI,IAAuC;AAC3C;AACA;AACA,kBAAe","sources":["webpack://@kissflow/lowcode-client-sdk/./src/app.ts","webpack://@kissflow/lowcode-client-sdk/./src/base.ts","webpack://@kissflow/lowcode-client-sdk/./src/client.ts","webpack://@kissflow/lowcode-client-sdk/./src/component.ts","webpack://@kissflow/lowcode-client-sdk/./src/constants.ts","webpack://@kissflow/lowcode-client-sdk/./src/form.ts","webpack://@kissflow/lowcode-client-sdk/./src/formatter.ts","webpack://@kissflow/lowcode-client-sdk/./src/lowcode.sdk.ts","webpack://@kissflow/lowcode-client-sdk/./src/page.ts","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/index.dev.js","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/url-alphabet/index.js","webpack://@kissflow/lowcode-client-sdk/webpack/bootstrap","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/define property getters","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/make namespace object","webpack://@kissflow/lowcode-client-sdk/./src/index.ts"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Application = void 0;\nvar base_1 = require(\"./base\");\nvar page_1 = require(\"./page\");\nvar constants_1 = require(\"./constants\");\nvar Application = /** @class */ (function (_super) {\n __extends(Application, _super);\n function Application(props) {\n var _this = _super.call(this, {}) || this;\n _this.page = new page_1.Page({});\n return _this;\n }\n Application.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {\n key: key\n });\n };\n Application.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {\n key: key,\n value: value\n });\n };\n Application.prototype.openPage = function (pageId, pageParams) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {\n pageId: pageId,\n pageParams: pageParams\n });\n };\n return Application;\n}(base_1.BaseSDK));\nexports.Application = Application;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSDK = void 0;\nvar constants_1 = require(\"./constants\");\nvar nanoid = require(\"nanoid\").nanoid;\nfunction generateId(prefix) {\n if (prefix === void 0) { prefix = \"lcncsdk\"; }\n return \"\".concat(prefix, \"-\").concat(nanoid());\n}\nfunction postMessage(args) {\n console.log(\"SDK : @postMessage \", args);\n if (self.parent && self.parent !== self) {\n self.parent.postMessage(args, \"*\");\n }\n else {\n self.postMessage(args);\n }\n}\nvar BaseSDK = /** @class */ (function () {\n function BaseSDK(props) {\n _BaseSDK_instances.add(this);\n _BaseSDK_listeners.set(this, void 0);\n _BaseSDK_eventListeners.set(this, void 0);\n console.log(\"SDK : Initializing \", props);\n __classPrivateFieldSet(this, _BaseSDK_listeners, {}, \"f\");\n __classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, \"f\");\n self.addEventListener(\"message\", __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_onMessage).bind(this), false);\n }\n BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(_this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!data.errorMessage) return [3 /*break*/, 1];\n reject(data);\n return [3 /*break*/, 4];\n case 1:\n if (!(hasCallBack && callBack)) return [3 /*break*/, 3];\n return [4 /*yield*/, callBack(data)];\n case 2:\n data = _a.sent();\n _a.label = 3;\n case 3:\n resolve(data);\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); });\n });\n };\n BaseSDK.prototype._postMessage = function (command, func, args) {\n if (args === void 0) { args = {}; }\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });\n };\n BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);\n };\n return BaseSDK;\n}());\nexports.BaseSDK = BaseSDK;\n_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] || [];\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id].push(callback);\n}, _BaseSDK_appendEventListeners = function _BaseSDK_appendEventListeners(_id, eventType, callback) {\n if (!__classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id]) {\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] = {};\n }\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id][eventType] = callback;\n}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {\n var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;\n if (!_id || !eventType)\n return;\n var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] || {};\n if (eventListener[eventType]) {\n eventListener[eventType](eventParams || {});\n }\n}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {\n if (event.origin !== self.location.origin) {\n console.log(\"SDK : @onMessage \", event);\n var data_1 = event.data;\n if (data_1.isEvent) {\n return __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_checkEvents).call(this, data_1);\n }\n var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};\n var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];\n if (listeners) {\n listeners.forEach(function (listener) {\n try {\n if (data_1.resp) {\n if (Object.keys(data_1.resp).length === 1 &&\n _req_1.command !== constants_1.LISTENER_CMDS.API) {\n listener(Object.values(data_1.resp)[0]);\n }\n else {\n listener(data_1.resp);\n }\n }\n }\n catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n TO_JSON: \"TO_JSON\",\n GET_TABLE_ROWS: \"GET_TABLE_ROWS\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.id = instanceId;\n return _this;\n }\n Form.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n instanceId: this.instanceId\n });\n };\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n return new Table(this.instanceId, tableId);\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n _this.id = tableId;\n return _this;\n }\n // list of obj of rows\n Table.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId\n });\n };\n Table.prototype.getRows = function () {\n var _this = this;\n // list of TableForm class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack\n function (data) {\n console.log(data);\n return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });\n });\n };\n Table.prototype.getRow = function (rowId) {\n return new TableForm(this.instanceId, this.tableId, rowId);\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n _this.id = rowId;\n _this.parent = new Form(instanceId);\n _this.table = new Table(instanceId, tableId);\n return _this;\n }\n TableForm.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {\n tableId: this.tableId,\n rowId: this.rowId\n });\n };\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toKfDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toKfDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toKfNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toKfCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar component_1 = require(\"./component\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n LowcodeSDK.prototype.getComponent = function (componentId) {\n return new component_1.Component(componentId);\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Page = /** @class */ (function (_super) {\n __extends(Page, _super);\n function Page(pageId) {\n var _this = _super.call(this, {}) || this;\n _this._id = pageId;\n return _this;\n }\n Page.prototype.getParameter = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_PARAMS, {\n key: key\n });\n };\n Page.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_VARIABLE, {\n key: key\n });\n };\n Page.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_PAGE_VARIABLE, {\n key: key,\n value: value\n });\n };\n Page.prototype.openPopup = function (pageId, inputParams, popupProperties) {\n var payload = {\n pageId: pageId,\n inputParams: inputParams,\n popupProperties: {\n width: popupProperties.w,\n height: popupProperties.h\n }\n };\n return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {\n return new Page(pageId);\n });\n };\n Page.prototype.onClose = function (callback) {\n this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);\n };\n return Page;\n}(base_1.BaseSDK));\nexports.Page = Page;\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (true) {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lowcode_sdk_1 = require(\"./lowcode.sdk\");\nif (typeof _BUILD !== \"undefined\" && _BUILD) {\n self.KF = lowcode_sdk_1.default;\n}\nexports.default = lowcode_sdk_1.default;\n"],"names":[],"sourceRoot":""}
|
package/package.json
CHANGED
package/src/base.ts
CHANGED
|
@@ -41,7 +41,7 @@ export class BaseSDK {
|
|
|
41
41
|
args: any,
|
|
42
42
|
hasCallBack?: boolean,
|
|
43
43
|
callBack?: (data: any) => {}
|
|
44
|
-
): object | string {
|
|
44
|
+
): object | string | any {
|
|
45
45
|
return new Promise((resolve, reject) => {
|
|
46
46
|
const _id = generateId(command.toLowerCase());
|
|
47
47
|
postMessage({ _id, command, ...args });
|
package/src/constants.ts
CHANGED
package/src/form.ts
CHANGED
|
@@ -2,10 +2,20 @@ import { BaseSDK } from "./base";
|
|
|
2
2
|
import { LISTENER_CMDS } from "./constants";
|
|
3
3
|
|
|
4
4
|
export class Form extends BaseSDK {
|
|
5
|
-
instanceId: string;
|
|
5
|
+
private instanceId: string;
|
|
6
|
+
id: string;
|
|
6
7
|
constructor(instanceId: string) {
|
|
7
8
|
super({});
|
|
8
9
|
this.instanceId = instanceId;
|
|
10
|
+
this.id = instanceId;
|
|
11
|
+
}
|
|
12
|
+
toJSON() {
|
|
13
|
+
return this._postMessageAsync(
|
|
14
|
+
LISTENER_CMDS.TO_JSON,
|
|
15
|
+
{
|
|
16
|
+
instanceId: this.instanceId
|
|
17
|
+
},
|
|
18
|
+
);
|
|
9
19
|
}
|
|
10
20
|
getField(fieldId: string) {
|
|
11
21
|
return this._postMessageAsync(LISTENER_CMDS.GET_FORM_FIELD, {
|
|
@@ -19,41 +29,50 @@ export class Form extends BaseSDK {
|
|
|
19
29
|
});
|
|
20
30
|
}
|
|
21
31
|
getTable(tableId: string) {
|
|
22
|
-
return this.
|
|
23
|
-
LISTENER_CMDS.GET_TABLE,
|
|
24
|
-
{ tableId: tableId },
|
|
25
|
-
true, // has callBack
|
|
26
|
-
(data) => {
|
|
27
|
-
return new Table(this.instanceId, tableId); // callBack function
|
|
28
|
-
}
|
|
29
|
-
);
|
|
32
|
+
return new Table(this.instanceId, tableId);
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
class Table extends BaseSDK {
|
|
34
|
-
tableId: string;
|
|
35
|
-
instanceId: string;
|
|
37
|
+
private tableId: string;
|
|
38
|
+
private instanceId: string;
|
|
39
|
+
id: string;
|
|
40
|
+
|
|
36
41
|
constructor(instanceId: string,tableId: string) {
|
|
37
42
|
super({});
|
|
38
43
|
this.tableId = tableId;
|
|
39
44
|
this.instanceId = instanceId
|
|
45
|
+
this.id = tableId;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
// list of obj of rows
|
|
49
|
+
toJSON() {
|
|
43
50
|
return this._postMessageAsync(
|
|
44
|
-
LISTENER_CMDS.
|
|
51
|
+
LISTENER_CMDS.TO_JSON,
|
|
45
52
|
{
|
|
46
|
-
tableId: this.tableId
|
|
47
|
-
rowId
|
|
53
|
+
tableId: this.tableId
|
|
48
54
|
},
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
getRows():TableForm[] {
|
|
59
|
+
// list of TableForm class
|
|
60
|
+
return this._postMessageAsync(
|
|
61
|
+
LISTENER_CMDS.GET_TABLE_ROWS,
|
|
62
|
+
{ tableId: this.tableId },
|
|
49
63
|
true, // has callBack
|
|
50
64
|
(data) => {
|
|
51
|
-
|
|
65
|
+
console.log(data);
|
|
66
|
+
return data.map((row) => new TableForm(this.instanceId, this.tableId, row.id))
|
|
52
67
|
}
|
|
53
68
|
);
|
|
54
69
|
}
|
|
70
|
+
|
|
71
|
+
getRow(rowId: string) {
|
|
72
|
+
return new TableForm(this.instanceId, this.tableId, rowId);
|
|
73
|
+
}
|
|
55
74
|
|
|
56
|
-
addRow(
|
|
75
|
+
addRow(rowObject: object) {
|
|
57
76
|
return this._postMessageAsync(LISTENER_CMDS.ADD_TABLE_ROW, {
|
|
58
77
|
tableId: this.tableId,
|
|
59
78
|
rowObject
|
|
@@ -69,9 +88,10 @@ class Table extends BaseSDK {
|
|
|
69
88
|
}
|
|
70
89
|
|
|
71
90
|
export class TableForm extends BaseSDK {
|
|
72
|
-
instanceId: string;
|
|
73
|
-
tableId: string;
|
|
74
|
-
rowId: string;
|
|
91
|
+
private instanceId: string;
|
|
92
|
+
private tableId: string;
|
|
93
|
+
private rowId: string;
|
|
94
|
+
id: string
|
|
75
95
|
table: Table;
|
|
76
96
|
parent: Form;
|
|
77
97
|
|
|
@@ -80,9 +100,22 @@ export class TableForm extends BaseSDK {
|
|
|
80
100
|
this.instanceId = instanceId;
|
|
81
101
|
this.tableId = tableId;
|
|
82
102
|
this.rowId = rowId;
|
|
103
|
+
this.id = rowId;
|
|
83
104
|
this.parent = new Form(instanceId);
|
|
84
105
|
this.table = new Table(instanceId, tableId);
|
|
85
106
|
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
toJSON() {
|
|
110
|
+
return this._postMessageAsync(
|
|
111
|
+
LISTENER_CMDS.GET_TABLE_ROW,
|
|
112
|
+
{
|
|
113
|
+
tableId: this.tableId,
|
|
114
|
+
rowId: this.rowId
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
}
|
|
86
119
|
|
|
87
120
|
getField(fieldId: string) {
|
|
88
121
|
return this._postMessageAsync(LISTENER_CMDS.GET_FORM_FIELD, {
|