@kissflow/lowcode-client-sdk 1.0.0-beta.4 → 1.0.2
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/README.md +8 -6
- package/dist/index.html +1 -1
- package/dist/index.js +1 -1
- package/dist/kflowcode.sdk.js +1 -1
- package/dist/kflowcode.sdk.js.map +1 -1
- package/dist/kflowcode.sdk.module.js +452 -273
- package/dist/kflowcode.sdk.module.js.map +1 -1
- package/package.json +1 -2
- package/src/index.ts +1 -1
- package/webpack.config.js +2 -3
- package/dist/kflowcode.sdk.mjs +0 -808
- package/dist/kflowcode.sdk.mjs.map +0 -1
|
@@ -4,41 +4,56 @@
|
|
|
4
4
|
/*!********************!*\
|
|
5
5
|
!*** ./src/app.ts ***!
|
|
6
6
|
\********************/
|
|
7
|
-
/***/ ((__unused_webpack_module,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var __extends = (this && this.__extends) || (function () {
|
|
11
|
+
var extendStatics = function (d, b) {
|
|
12
|
+
extendStatics = Object.setPrototypeOf ||
|
|
13
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
14
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
15
|
+
return extendStatics(d, b);
|
|
16
|
+
};
|
|
17
|
+
return function (d, b) {
|
|
18
|
+
if (typeof b !== "function" && b !== null)
|
|
19
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
20
|
+
extendStatics(d, b);
|
|
21
|
+
function __() { this.constructor = d; }
|
|
22
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
26
|
+
exports.Application = void 0;
|
|
27
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
28
|
+
var page_1 = __webpack_require__(/*! ./page */ "./src/page.ts");
|
|
29
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
30
|
+
var Application = /** @class */ (function (_super) {
|
|
31
|
+
__extends(Application, _super);
|
|
32
|
+
function Application(props) {
|
|
33
|
+
var _this = _super.call(this, {}) || this;
|
|
34
|
+
_this.page = new page_1.Page({});
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
Application.prototype.getVariable = function (key) {
|
|
38
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {
|
|
39
|
+
key: key
|
|
27
40
|
});
|
|
28
|
-
}
|
|
29
|
-
setVariable(key, value) {
|
|
30
|
-
return this._postMessageAsync(
|
|
31
|
-
key,
|
|
32
|
-
value
|
|
41
|
+
};
|
|
42
|
+
Application.prototype.setVariable = function (key, value) {
|
|
43
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {
|
|
44
|
+
key: key,
|
|
45
|
+
value: value
|
|
33
46
|
});
|
|
34
|
-
}
|
|
35
|
-
openPage(pageId, pageParams) {
|
|
36
|
-
return
|
|
37
|
-
pageId,
|
|
38
|
-
pageParams
|
|
47
|
+
};
|
|
48
|
+
Application.prototype.openPage = function (pageId, pageParams) {
|
|
49
|
+
return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {
|
|
50
|
+
pageId: pageId,
|
|
51
|
+
pageParams: pageParams
|
|
39
52
|
});
|
|
40
|
-
}
|
|
41
|
-
|
|
53
|
+
};
|
|
54
|
+
return Application;
|
|
55
|
+
}(base_1.BaseSDK));
|
|
56
|
+
exports.Application = Application;
|
|
42
57
|
|
|
43
58
|
|
|
44
59
|
/***/ }),
|
|
@@ -47,14 +62,21 @@ class Application extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
47
62
|
/*!*********************!*\
|
|
48
63
|
!*** ./src/base.ts ***!
|
|
49
64
|
\*********************/
|
|
50
|
-
/***/ ((__unused_webpack_module,
|
|
65
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
51
66
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var
|
|
67
|
+
|
|
68
|
+
var __assign = (this && this.__assign) || function () {
|
|
69
|
+
__assign = Object.assign || function(t) {
|
|
70
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
71
|
+
s = arguments[i];
|
|
72
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
73
|
+
t[p] = s[p];
|
|
74
|
+
}
|
|
75
|
+
return t;
|
|
76
|
+
};
|
|
77
|
+
return __assign.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
58
80
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
59
81
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
60
82
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -63,22 +85,52 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
63
85
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
64
86
|
});
|
|
65
87
|
};
|
|
66
|
-
var
|
|
88
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
89
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
90
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
91
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
92
|
+
function step(op) {
|
|
93
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
94
|
+
while (_) try {
|
|
95
|
+
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;
|
|
96
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
97
|
+
switch (op[0]) {
|
|
98
|
+
case 0: case 1: t = op; break;
|
|
99
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
100
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
101
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
102
|
+
default:
|
|
103
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
104
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
105
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
106
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
107
|
+
if (t[2]) _.ops.pop();
|
|
108
|
+
_.trys.pop(); continue;
|
|
109
|
+
}
|
|
110
|
+
op = body.call(thisArg, _);
|
|
111
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
112
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
67
116
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
68
117
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
69
118
|
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");
|
|
70
119
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
71
120
|
};
|
|
72
|
-
var __classPrivateFieldGet = (
|
|
121
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
73
122
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
74
123
|
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");
|
|
75
124
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
76
125
|
};
|
|
77
126
|
var _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
127
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
128
|
+
exports.BaseSDK = void 0;
|
|
129
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
130
|
+
var nanoid = (__webpack_require__(/*! nanoid */ "./node_modules/nanoid/index.dev.js").nanoid);
|
|
131
|
+
function generateId(prefix) {
|
|
132
|
+
if (prefix === void 0) { prefix = "lcncsdk"; }
|
|
133
|
+
return "".concat(prefix, "-").concat(nanoid());
|
|
82
134
|
}
|
|
83
135
|
function postMessage(args) {
|
|
84
136
|
console.log("SDK : @postMessage ", args);
|
|
@@ -89,8 +141,8 @@ function postMessage(args) {
|
|
|
89
141
|
self.postMessage(args);
|
|
90
142
|
}
|
|
91
143
|
}
|
|
92
|
-
|
|
93
|
-
|
|
144
|
+
var BaseSDK = /** @class */ (function () {
|
|
145
|
+
function BaseSDK(props) {
|
|
94
146
|
_BaseSDK_instances.add(this);
|
|
95
147
|
_BaseSDK_listeners.set(this, void 0);
|
|
96
148
|
_BaseSDK_eventListeners.set(this, void 0);
|
|
@@ -99,32 +151,45 @@ class BaseSDK {
|
|
|
99
151
|
__classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, "f");
|
|
100
152
|
self.addEventListener("message", __classPrivateFieldGet(this, _BaseSDK_instances, "m", _BaseSDK_onMessage).bind(this), false);
|
|
101
153
|
}
|
|
102
|
-
_postMessageAsync(command, args, hasCallBack, callBack) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
154
|
+
BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {
|
|
155
|
+
var _this = this;
|
|
156
|
+
return new Promise(function (resolve, reject) {
|
|
157
|
+
var _id = generateId(command.toLowerCase());
|
|
158
|
+
postMessage(__assign({ _id: _id, command: command }, args));
|
|
159
|
+
__classPrivateFieldGet(_this, _BaseSDK_instances, "m", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
switch (_a.label) {
|
|
162
|
+
case 0:
|
|
163
|
+
if (!data.errorMessage) return [3 /*break*/, 1];
|
|
164
|
+
reject(data);
|
|
165
|
+
return [3 /*break*/, 4];
|
|
166
|
+
case 1:
|
|
167
|
+
if (!(hasCallBack && callBack)) return [3 /*break*/, 3];
|
|
168
|
+
return [4 /*yield*/, callBack(data)];
|
|
169
|
+
case 2:
|
|
170
|
+
data = _a.sent();
|
|
171
|
+
_a.label = 3;
|
|
172
|
+
case 3:
|
|
173
|
+
resolve(data);
|
|
174
|
+
_a.label = 4;
|
|
175
|
+
case 4: return [2 /*return*/];
|
|
113
176
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}));
|
|
177
|
+
});
|
|
178
|
+
}); });
|
|
117
179
|
});
|
|
118
|
-
}
|
|
119
|
-
_postMessage(command, func, args
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
180
|
+
};
|
|
181
|
+
BaseSDK.prototype._postMessage = function (command, func, args) {
|
|
182
|
+
if (args === void 0) { args = {}; }
|
|
183
|
+
var _id = generateId(command.toLowerCase());
|
|
184
|
+
postMessage(__assign({ _id: _id, command: command }, args));
|
|
185
|
+
__classPrivateFieldGet(this, _BaseSDK_instances, "m", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });
|
|
186
|
+
};
|
|
187
|
+
BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {
|
|
125
188
|
__classPrivateFieldGet(this, _BaseSDK_instances, "m", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);
|
|
126
|
-
}
|
|
127
|
-
|
|
189
|
+
};
|
|
190
|
+
return BaseSDK;
|
|
191
|
+
}());
|
|
192
|
+
exports.BaseSDK = BaseSDK;
|
|
128
193
|
_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {
|
|
129
194
|
__classPrivateFieldGet(this, _BaseSDK_listeners, "f")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, "f")[_id] || [];
|
|
130
195
|
__classPrivateFieldGet(this, _BaseSDK_listeners, "f")[_id].push(callback);
|
|
@@ -134,32 +199,32 @@ _BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _Ba
|
|
|
134
199
|
}
|
|
135
200
|
__classPrivateFieldGet(this, _BaseSDK_eventListeners, "f")[_id][eventType] = callback;
|
|
136
201
|
}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {
|
|
137
|
-
|
|
202
|
+
var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;
|
|
138
203
|
if (!_id || !eventType)
|
|
139
204
|
return;
|
|
140
|
-
|
|
205
|
+
var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, "f")[_id] || {};
|
|
141
206
|
if (eventListener[eventType]) {
|
|
142
207
|
eventListener[eventType](eventParams || {});
|
|
143
208
|
}
|
|
144
209
|
}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {
|
|
145
210
|
if (event.origin !== self.location.origin) {
|
|
146
211
|
console.log("SDK : @onMessage ", event);
|
|
147
|
-
|
|
148
|
-
if (
|
|
149
|
-
return __classPrivateFieldGet(this, _BaseSDK_instances, "m", _BaseSDK_checkEvents).call(this,
|
|
212
|
+
var data_1 = event.data;
|
|
213
|
+
if (data_1.isEvent) {
|
|
214
|
+
return __classPrivateFieldGet(this, _BaseSDK_instances, "m", _BaseSDK_checkEvents).call(this, data_1);
|
|
150
215
|
}
|
|
151
|
-
|
|
152
|
-
|
|
216
|
+
var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};
|
|
217
|
+
var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, "f")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];
|
|
153
218
|
if (listeners) {
|
|
154
|
-
listeners.forEach((listener)
|
|
219
|
+
listeners.forEach(function (listener) {
|
|
155
220
|
try {
|
|
156
|
-
if (
|
|
157
|
-
if (Object.keys(
|
|
158
|
-
|
|
159
|
-
listener(Object.values(
|
|
221
|
+
if (data_1.resp) {
|
|
222
|
+
if (Object.keys(data_1.resp).length === 1 &&
|
|
223
|
+
_req_1.command !== constants_1.LISTENER_CMDS.API) {
|
|
224
|
+
listener(Object.values(data_1.resp)[0]);
|
|
160
225
|
}
|
|
161
226
|
else {
|
|
162
|
-
listener(
|
|
227
|
+
listener(data_1.resp);
|
|
163
228
|
}
|
|
164
229
|
}
|
|
165
230
|
}
|
|
@@ -178,22 +243,38 @@ _BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _Ba
|
|
|
178
243
|
/*!***********************!*\
|
|
179
244
|
!*** ./src/client.ts ***!
|
|
180
245
|
\***********************/
|
|
181
|
-
/***/ ((__unused_webpack_module,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
246
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
var __extends = (this && this.__extends) || (function () {
|
|
250
|
+
var extendStatics = function (d, b) {
|
|
251
|
+
extendStatics = Object.setPrototypeOf ||
|
|
252
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
253
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
254
|
+
return extendStatics(d, b);
|
|
255
|
+
};
|
|
256
|
+
return function (d, b) {
|
|
257
|
+
if (typeof b !== "function" && b !== null)
|
|
258
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
259
|
+
extendStatics(d, b);
|
|
260
|
+
function __() { this.constructor = d; }
|
|
261
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
262
|
+
};
|
|
263
|
+
})();
|
|
264
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
265
|
+
exports.Client = void 0;
|
|
266
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
267
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
268
|
+
var Client = /** @class */ (function (_super) {
|
|
269
|
+
__extends(Client, _super);
|
|
270
|
+
function Client() {
|
|
271
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
272
|
+
}
|
|
273
|
+
Client.prototype.showInfo = function (message) {
|
|
274
|
+
return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });
|
|
275
|
+
};
|
|
276
|
+
Client.prototype.showConfirm = function (args) {
|
|
277
|
+
return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {
|
|
197
278
|
data: {
|
|
198
279
|
title: args.title,
|
|
199
280
|
content: args.content,
|
|
@@ -201,11 +282,13 @@ class Client extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
201
282
|
cancelText: args.cancelText || "Cancel"
|
|
202
283
|
}
|
|
203
284
|
});
|
|
204
|
-
}
|
|
205
|
-
redirect(url) {
|
|
206
|
-
return
|
|
207
|
-
}
|
|
208
|
-
|
|
285
|
+
};
|
|
286
|
+
Client.prototype.redirect = function (url) {
|
|
287
|
+
return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });
|
|
288
|
+
};
|
|
289
|
+
return Client;
|
|
290
|
+
}(base_1.BaseSDK));
|
|
291
|
+
exports.Client = Client;
|
|
209
292
|
|
|
210
293
|
|
|
211
294
|
/***/ }),
|
|
@@ -214,27 +297,43 @@ class Client extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
214
297
|
/*!**************************!*\
|
|
215
298
|
!*** ./src/component.ts ***!
|
|
216
299
|
\**************************/
|
|
217
|
-
/***/ ((__unused_webpack_module,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
300
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
var __extends = (this && this.__extends) || (function () {
|
|
304
|
+
var extendStatics = function (d, b) {
|
|
305
|
+
extendStatics = Object.setPrototypeOf ||
|
|
306
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
307
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
308
|
+
return extendStatics(d, b);
|
|
309
|
+
};
|
|
310
|
+
return function (d, b) {
|
|
311
|
+
if (typeof b !== "function" && b !== null)
|
|
312
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
313
|
+
extendStatics(d, b);
|
|
314
|
+
function __() { this.constructor = d; }
|
|
315
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
316
|
+
};
|
|
317
|
+
})();
|
|
318
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
319
|
+
exports.Component = void 0;
|
|
320
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
321
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
322
|
+
var Component = /** @class */ (function (_super) {
|
|
323
|
+
__extends(Component, _super);
|
|
324
|
+
function Component(id) {
|
|
325
|
+
var _this = _super.call(this, {}) || this;
|
|
326
|
+
_this.id = id;
|
|
327
|
+
return _this;
|
|
328
|
+
}
|
|
329
|
+
Component.prototype.refresh = function () {
|
|
330
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {
|
|
234
331
|
id: this.id
|
|
235
332
|
});
|
|
236
|
-
}
|
|
237
|
-
|
|
333
|
+
};
|
|
334
|
+
return Component;
|
|
335
|
+
}(base_1.BaseSDK));
|
|
336
|
+
exports.Component = Component;
|
|
238
337
|
|
|
239
338
|
|
|
240
339
|
/***/ }),
|
|
@@ -243,14 +342,12 @@ class Component extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
243
342
|
/*!**************************!*\
|
|
244
343
|
!*** ./src/constants.ts ***!
|
|
245
344
|
\**************************/
|
|
246
|
-
/***/ ((__unused_webpack_module,
|
|
345
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
247
346
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
/* harmony export */ });
|
|
253
|
-
const LISTENER_CMDS = {
|
|
347
|
+
|
|
348
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
349
|
+
exports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;
|
|
350
|
+
exports.LISTENER_CMDS = {
|
|
254
351
|
API: "API",
|
|
255
352
|
PARAMS: "PARAMS",
|
|
256
353
|
GET_CONTEXT: "GET_CONTEXT",
|
|
@@ -282,7 +379,7 @@ const LISTENER_CMDS = {
|
|
|
282
379
|
PAGE_ON_CLOSE: "PAGE_ON_CLOSE",
|
|
283
380
|
COMPONENT_REFRESH: "COMPONENT_REFRESH"
|
|
284
381
|
};
|
|
285
|
-
|
|
382
|
+
exports.EVENT_TYPES = {
|
|
286
383
|
ON_CLOSE: "onClose",
|
|
287
384
|
ON_CHANGE: "onChange",
|
|
288
385
|
ON_LOAD: "onLoad",
|
|
@@ -295,34 +392,52 @@ const EVENT_TYPES = {
|
|
|
295
392
|
/*!*********************!*\
|
|
296
393
|
!*** ./src/form.ts ***!
|
|
297
394
|
\*********************/
|
|
298
|
-
/***/ ((__unused_webpack_module,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
395
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
var __extends = (this && this.__extends) || (function () {
|
|
399
|
+
var extendStatics = function (d, b) {
|
|
400
|
+
extendStatics = Object.setPrototypeOf ||
|
|
401
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
402
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
403
|
+
return extendStatics(d, b);
|
|
404
|
+
};
|
|
405
|
+
return function (d, b) {
|
|
406
|
+
if (typeof b !== "function" && b !== null)
|
|
407
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
408
|
+
extendStatics(d, b);
|
|
409
|
+
function __() { this.constructor = d; }
|
|
410
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
411
|
+
};
|
|
412
|
+
})();
|
|
413
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
414
|
+
exports.Form = void 0;
|
|
415
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
416
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
417
|
+
var Form = /** @class */ (function (_super) {
|
|
418
|
+
__extends(Form, _super);
|
|
419
|
+
function Form() {
|
|
420
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
421
|
+
}
|
|
422
|
+
Form.prototype.getField = function (fieldId) {
|
|
423
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
424
|
+
fieldId: fieldId
|
|
312
425
|
});
|
|
313
|
-
}
|
|
314
|
-
updateField(args) {
|
|
315
|
-
return this._postMessageAsync(
|
|
426
|
+
};
|
|
427
|
+
Form.prototype.updateField = function (args) {
|
|
428
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {
|
|
316
429
|
data: args
|
|
317
430
|
});
|
|
318
|
-
}
|
|
319
|
-
addTableRow(tableId, rowObject) {
|
|
320
|
-
return this._postMessageAsync(
|
|
321
|
-
tableId,
|
|
322
|
-
rowObject
|
|
431
|
+
};
|
|
432
|
+
Form.prototype.addTableRow = function (tableId, rowObject) {
|
|
433
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {
|
|
434
|
+
tableId: tableId,
|
|
435
|
+
rowObject: rowObject
|
|
323
436
|
});
|
|
324
|
-
}
|
|
325
|
-
|
|
437
|
+
};
|
|
438
|
+
return Form;
|
|
439
|
+
}(base_1.BaseSDK));
|
|
440
|
+
exports.Form = Form;
|
|
326
441
|
|
|
327
442
|
|
|
328
443
|
/***/ }),
|
|
@@ -331,44 +446,128 @@ class Form extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
331
446
|
/*!**************************!*\
|
|
332
447
|
!*** ./src/formatter.ts ***!
|
|
333
448
|
\**************************/
|
|
334
|
-
/***/ ((__unused_webpack_module,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
449
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
var __extends = (this && this.__extends) || (function () {
|
|
453
|
+
var extendStatics = function (d, b) {
|
|
454
|
+
extendStatics = Object.setPrototypeOf ||
|
|
455
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
456
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
457
|
+
return extendStatics(d, b);
|
|
458
|
+
};
|
|
459
|
+
return function (d, b) {
|
|
460
|
+
if (typeof b !== "function" && b !== null)
|
|
461
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
462
|
+
extendStatics(d, b);
|
|
463
|
+
function __() { this.constructor = d; }
|
|
464
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
465
|
+
};
|
|
466
|
+
})();
|
|
467
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
468
|
+
exports.Formatter = void 0;
|
|
469
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
470
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
471
|
+
var Formatter = /** @class */ (function (_super) {
|
|
472
|
+
__extends(Formatter, _super);
|
|
473
|
+
function Formatter() {
|
|
474
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
475
|
+
}
|
|
476
|
+
Formatter.prototype.toKfDate = function (date) {
|
|
477
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {
|
|
478
|
+
date: date,
|
|
348
479
|
});
|
|
349
|
-
}
|
|
350
|
-
toKfDateTime(date) {
|
|
351
|
-
return this._postMessageAsync(
|
|
352
|
-
date,
|
|
480
|
+
};
|
|
481
|
+
Formatter.prototype.toKfDateTime = function (date) {
|
|
482
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {
|
|
483
|
+
date: date,
|
|
353
484
|
});
|
|
354
|
-
}
|
|
355
|
-
toKfNumber(value) {
|
|
356
|
-
return this._postMessageAsync(
|
|
357
|
-
value,
|
|
485
|
+
};
|
|
486
|
+
Formatter.prototype.toKfNumber = function (value) {
|
|
487
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {
|
|
488
|
+
value: value,
|
|
358
489
|
});
|
|
359
|
-
}
|
|
360
|
-
toKfCurrency(value, currencyCode) {
|
|
361
|
-
return this._postMessageAsync(
|
|
362
|
-
value,
|
|
363
|
-
currencyCode,
|
|
490
|
+
};
|
|
491
|
+
Formatter.prototype.toKfCurrency = function (value, currencyCode) {
|
|
492
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {
|
|
493
|
+
value: value,
|
|
494
|
+
currencyCode: currencyCode,
|
|
364
495
|
});
|
|
365
|
-
}
|
|
366
|
-
toBoolean(value) {
|
|
367
|
-
return this._postMessageAsync(
|
|
368
|
-
value
|
|
496
|
+
};
|
|
497
|
+
Formatter.prototype.toBoolean = function (value) {
|
|
498
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {
|
|
499
|
+
value: value
|
|
369
500
|
});
|
|
370
|
-
}
|
|
501
|
+
};
|
|
502
|
+
return Formatter;
|
|
503
|
+
}(base_1.BaseSDK));
|
|
504
|
+
exports.Formatter = Formatter;
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
/***/ }),
|
|
508
|
+
|
|
509
|
+
/***/ "./src/lowcode.sdk.ts":
|
|
510
|
+
/*!****************************!*\
|
|
511
|
+
!*** ./src/lowcode.sdk.ts ***!
|
|
512
|
+
\****************************/
|
|
513
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
var __extends = (this && this.__extends) || (function () {
|
|
517
|
+
var extendStatics = function (d, b) {
|
|
518
|
+
extendStatics = Object.setPrototypeOf ||
|
|
519
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
520
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
521
|
+
return extendStatics(d, b);
|
|
522
|
+
};
|
|
523
|
+
return function (d, b) {
|
|
524
|
+
if (typeof b !== "function" && b !== null)
|
|
525
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
526
|
+
extendStatics(d, b);
|
|
527
|
+
function __() { this.constructor = d; }
|
|
528
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
529
|
+
};
|
|
530
|
+
})();
|
|
531
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
532
|
+
exports.LowcodeSDK = void 0;
|
|
533
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
534
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
535
|
+
var form_1 = __webpack_require__(/*! ./form */ "./src/form.ts");
|
|
536
|
+
var client_1 = __webpack_require__(/*! ./client */ "./src/client.ts");
|
|
537
|
+
var formatter_1 = __webpack_require__(/*! ./formatter */ "./src/formatter.ts");
|
|
538
|
+
var app_1 = __webpack_require__(/*! ./app */ "./src/app.ts");
|
|
539
|
+
var component_1 = __webpack_require__(/*! ./component */ "./src/component.ts");
|
|
540
|
+
var LowcodeSDK = /** @class */ (function (_super) {
|
|
541
|
+
__extends(LowcodeSDK, _super);
|
|
542
|
+
function LowcodeSDK(props) {
|
|
543
|
+
var _this = _super.call(this, {}) || this;
|
|
544
|
+
_this.currentForm = new form_1.Form({});
|
|
545
|
+
_this.client = new client_1.Client({});
|
|
546
|
+
_this.formatter = new formatter_1.Formatter({});
|
|
547
|
+
_this.app = new app_1.Application({});
|
|
548
|
+
return _this;
|
|
549
|
+
}
|
|
550
|
+
LowcodeSDK.prototype.api = function (url, args) {
|
|
551
|
+
if (args === void 0) { args = {}; }
|
|
552
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });
|
|
553
|
+
};
|
|
554
|
+
LowcodeSDK.prototype.watchParams = function (func) {
|
|
555
|
+
this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);
|
|
556
|
+
};
|
|
557
|
+
LowcodeSDK.prototype.getContext = function () {
|
|
558
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});
|
|
559
|
+
};
|
|
560
|
+
LowcodeSDK.prototype.getComponent = function (componentId) {
|
|
561
|
+
return new component_1.Component(componentId);
|
|
562
|
+
};
|
|
563
|
+
return LowcodeSDK;
|
|
564
|
+
}(base_1.BaseSDK));
|
|
565
|
+
exports.LowcodeSDK = LowcodeSDK;
|
|
566
|
+
function initSDK(config) {
|
|
567
|
+
if (config === void 0) { config = {}; }
|
|
568
|
+
return new LowcodeSDK(config);
|
|
371
569
|
}
|
|
570
|
+
exports["default"] = initSDK;
|
|
372
571
|
|
|
373
572
|
|
|
374
573
|
/***/ }),
|
|
@@ -377,54 +576,70 @@ class Formatter extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
377
576
|
/*!*********************!*\
|
|
378
577
|
!*** ./src/page.ts ***!
|
|
379
578
|
\*********************/
|
|
380
|
-
/***/ ((__unused_webpack_module,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
579
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
var __extends = (this && this.__extends) || (function () {
|
|
583
|
+
var extendStatics = function (d, b) {
|
|
584
|
+
extendStatics = Object.setPrototypeOf ||
|
|
585
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
586
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
587
|
+
return extendStatics(d, b);
|
|
588
|
+
};
|
|
589
|
+
return function (d, b) {
|
|
590
|
+
if (typeof b !== "function" && b !== null)
|
|
591
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
592
|
+
extendStatics(d, b);
|
|
593
|
+
function __() { this.constructor = d; }
|
|
594
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
595
|
+
};
|
|
596
|
+
})();
|
|
597
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
598
|
+
exports.Page = void 0;
|
|
599
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
600
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
601
|
+
var Page = /** @class */ (function (_super) {
|
|
602
|
+
__extends(Page, _super);
|
|
603
|
+
function Page(pageId) {
|
|
604
|
+
var _this = _super.call(this, {}) || this;
|
|
605
|
+
_this._id = pageId;
|
|
606
|
+
return _this;
|
|
607
|
+
}
|
|
608
|
+
Page.prototype.getParameter = function (key) {
|
|
609
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_PARAMS, {
|
|
610
|
+
key: key
|
|
398
611
|
});
|
|
399
|
-
}
|
|
400
|
-
getVariable(key) {
|
|
401
|
-
return this._postMessageAsync(
|
|
402
|
-
key
|
|
612
|
+
};
|
|
613
|
+
Page.prototype.getVariable = function (key) {
|
|
614
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_VARIABLE, {
|
|
615
|
+
key: key
|
|
403
616
|
});
|
|
404
|
-
}
|
|
405
|
-
setVariable(key, value) {
|
|
406
|
-
return this._postMessageAsync(
|
|
407
|
-
key,
|
|
408
|
-
value
|
|
617
|
+
};
|
|
618
|
+
Page.prototype.setVariable = function (key, value) {
|
|
619
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_PAGE_VARIABLE, {
|
|
620
|
+
key: key,
|
|
621
|
+
value: value
|
|
409
622
|
});
|
|
410
|
-
}
|
|
411
|
-
openPopup(pageId, inputParams, popupProperties) {
|
|
412
|
-
|
|
413
|
-
pageId,
|
|
414
|
-
inputParams,
|
|
623
|
+
};
|
|
624
|
+
Page.prototype.openPopup = function (pageId, inputParams, popupProperties) {
|
|
625
|
+
var payload = {
|
|
626
|
+
pageId: pageId,
|
|
627
|
+
inputParams: inputParams,
|
|
415
628
|
popupProperties: {
|
|
416
629
|
width: popupProperties.w,
|
|
417
630
|
height: popupProperties.h
|
|
418
631
|
}
|
|
419
632
|
};
|
|
420
|
-
return this._postMessageAsync(
|
|
633
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {
|
|
421
634
|
return new Page(pageId);
|
|
422
635
|
});
|
|
423
|
-
}
|
|
424
|
-
onClose(callback) {
|
|
425
|
-
this._registerEventListener(this._id,
|
|
426
|
-
}
|
|
427
|
-
|
|
636
|
+
};
|
|
637
|
+
Page.prototype.onClose = function (callback) {
|
|
638
|
+
this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);
|
|
639
|
+
};
|
|
640
|
+
return Page;
|
|
641
|
+
}(base_1.BaseSDK));
|
|
642
|
+
exports.Page = Page;
|
|
428
643
|
|
|
429
644
|
|
|
430
645
|
/***/ }),
|
|
@@ -547,7 +762,7 @@ let urlAlphabet =
|
|
|
547
762
|
/******/ };
|
|
548
763
|
/******/
|
|
549
764
|
/******/ // Execute the module function
|
|
550
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
765
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
551
766
|
/******/
|
|
552
767
|
/******/ // Return the exports of the module
|
|
553
768
|
/******/ return module.exports;
|
|
@@ -586,58 +801,22 @@ let urlAlphabet =
|
|
|
586
801
|
var __webpack_exports__ = {};
|
|
587
802
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
588
803
|
(() => {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
594
|
-
/* harmony export */ "LowcodeSDK": () => (/* binding */ LowcodeSDK),
|
|
595
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
596
|
-
/* harmony export */ });
|
|
597
|
-
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
598
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
599
|
-
/* harmony import */ var _form__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./form */ "./src/form.ts");
|
|
600
|
-
/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./client */ "./src/client.ts");
|
|
601
|
-
/* harmony import */ var _formatter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./formatter */ "./src/formatter.ts");
|
|
602
|
-
/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./app */ "./src/app.ts");
|
|
603
|
-
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./component */ "./src/component.ts");
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
804
|
+
var exports = __webpack_exports__;
|
|
805
|
+
/*!**********************!*\
|
|
806
|
+
!*** ./src/index.ts ***!
|
|
807
|
+
\**********************/
|
|
607
808
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
constructor(props) {
|
|
613
|
-
super({});
|
|
614
|
-
this.currentForm = new _form__WEBPACK_IMPORTED_MODULE_2__.Form({});
|
|
615
|
-
this.client = new _client__WEBPACK_IMPORTED_MODULE_3__.Client({});
|
|
616
|
-
this.formatter = new _formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter({});
|
|
617
|
-
this.app = new _app__WEBPACK_IMPORTED_MODULE_5__.Application({});
|
|
618
|
-
}
|
|
619
|
-
api(url, args = {}) {
|
|
620
|
-
return this._postMessageAsync(_constants__WEBPACK_IMPORTED_MODULE_1__.LISTENER_CMDS.API, { url, args });
|
|
621
|
-
}
|
|
622
|
-
watchParams(func) {
|
|
623
|
-
this._postMessage(_constants__WEBPACK_IMPORTED_MODULE_1__.LISTENER_CMDS.PARAMS, func);
|
|
624
|
-
}
|
|
625
|
-
getContext() {
|
|
626
|
-
return this._postMessageAsync(_constants__WEBPACK_IMPORTED_MODULE_1__.LISTENER_CMDS.GET_CONTEXT, {});
|
|
627
|
-
}
|
|
628
|
-
getComponent(componentId) {
|
|
629
|
-
return new _component__WEBPACK_IMPORTED_MODULE_6__.Component(componentId);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function initSDK(config = {}) {
|
|
633
|
-
return new LowcodeSDK(config);
|
|
809
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
810
|
+
var lowcode_sdk_1 = __webpack_require__(/*! ./lowcode.sdk */ "./src/lowcode.sdk.ts");
|
|
811
|
+
if (true) {
|
|
812
|
+
self.KF = lowcode_sdk_1.default;
|
|
634
813
|
}
|
|
635
|
-
|
|
814
|
+
exports["default"] = lowcode_sdk_1.default;
|
|
636
815
|
|
|
637
816
|
})();
|
|
638
817
|
|
|
639
|
-
var
|
|
818
|
+
var __webpack_exports___esModule = __webpack_exports__.__esModule;
|
|
640
819
|
var __webpack_exports__default = __webpack_exports__["default"];
|
|
641
|
-
export {
|
|
820
|
+
export { __webpack_exports___esModule as __esModule, __webpack_exports__default as default };
|
|
642
821
|
|
|
643
822
|
//# sourceMappingURL=kflowcode.sdk.module.js.map
|