@kissflow/lowcode-client-sdk 1.0.0-beta.4 → 1.0.2-beta.6
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/custom.build.js +15 -2
- package/dist/component.js +10 -0
- package/dist/constants.js +6 -1
- package/dist/form.js +73 -7
- package/dist/global.types.d.ts +21 -2
- package/dist/index.d.ts +31 -3
- package/dist/index.html +1 -1
- package/dist/index.js +1 -1
- package/dist/kflowcode.sdk.js +97 -12
- package/dist/kflowcode.sdk.js.map +1 -1
- package/dist/kflowcode.sdk.module.js +538 -274
- package/dist/kflowcode.sdk.module.js.map +1 -1
- package/dist/lowcode.sdk.js +7 -3
- package/package.json +1 -2
- package/src/component.ts +10 -0
- package/src/constants.ts +6 -1
- package/src/form.ts +86 -2
- package/src/index.ts +1 -1
- package/src/lowcode.sdk.ts +9 -3
- 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,53 @@ 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
|
+
Component.prototype.show = function () {
|
|
335
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {
|
|
336
|
+
id: this.id
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
Component.prototype.hide = function () {
|
|
340
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {
|
|
341
|
+
id: this.id
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
return Component;
|
|
345
|
+
}(base_1.BaseSDK));
|
|
346
|
+
exports.Component = Component;
|
|
238
347
|
|
|
239
348
|
|
|
240
349
|
/***/ }),
|
|
@@ -243,14 +352,12 @@ class Component extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
243
352
|
/*!**************************!*\
|
|
244
353
|
!*** ./src/constants.ts ***!
|
|
245
354
|
\**************************/
|
|
246
|
-
/***/ ((__unused_webpack_module,
|
|
355
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
247
356
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
/* harmony export */ });
|
|
253
|
-
const LISTENER_CMDS = {
|
|
357
|
+
|
|
358
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
359
|
+
exports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;
|
|
360
|
+
exports.LISTENER_CMDS = {
|
|
254
361
|
API: "API",
|
|
255
362
|
PARAMS: "PARAMS",
|
|
256
363
|
GET_CONTEXT: "GET_CONTEXT",
|
|
@@ -258,7 +365,10 @@ const LISTENER_CMDS = {
|
|
|
258
365
|
//Forms SDK Functions
|
|
259
366
|
GET_FORM_FIELD: "GET_FORM_FIELD",
|
|
260
367
|
UPDATE_FORM: "UPDATE_FORM",
|
|
368
|
+
GET_TABLE: "GET_TABLE",
|
|
369
|
+
GET_TABLE_ROW: "GET_TABLE_ROW",
|
|
261
370
|
ADD_TABLE_ROW: "ADD_TABLE_ROW",
|
|
371
|
+
DELETE_TABLE_ROW: "DELETE_TABLE_ROW",
|
|
262
372
|
//Client SDK functions
|
|
263
373
|
MESSAGE: "MESSAGE",
|
|
264
374
|
CONFIRM: "CONFIRM",
|
|
@@ -280,9 +390,11 @@ const LISTENER_CMDS = {
|
|
|
280
390
|
GET_PAGE_PARAMS: "GET_PAGE_PARAMS",
|
|
281
391
|
OPEN_POPUP_PAGE: "OPEN_POPUP_PAGE",
|
|
282
392
|
PAGE_ON_CLOSE: "PAGE_ON_CLOSE",
|
|
283
|
-
COMPONENT_REFRESH: "COMPONENT_REFRESH"
|
|
393
|
+
COMPONENT_REFRESH: "COMPONENT_REFRESH",
|
|
394
|
+
COMPONENT_SHOW: "COMPONENT_SHOW",
|
|
395
|
+
COMPONENT_HIDE: "COMPONENT_HIDE"
|
|
284
396
|
};
|
|
285
|
-
|
|
397
|
+
exports.EVENT_TYPES = {
|
|
286
398
|
ON_CLOSE: "onClose",
|
|
287
399
|
ON_CHANGE: "onChange",
|
|
288
400
|
ON_LOAD: "onLoad",
|
|
@@ -295,34 +407,118 @@ const EVENT_TYPES = {
|
|
|
295
407
|
/*!*********************!*\
|
|
296
408
|
!*** ./src/form.ts ***!
|
|
297
409
|
\*********************/
|
|
298
|
-
/***/ ((__unused_webpack_module,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
410
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
var __extends = (this && this.__extends) || (function () {
|
|
414
|
+
var extendStatics = function (d, b) {
|
|
415
|
+
extendStatics = Object.setPrototypeOf ||
|
|
416
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
417
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
418
|
+
return extendStatics(d, b);
|
|
419
|
+
};
|
|
420
|
+
return function (d, b) {
|
|
421
|
+
if (typeof b !== "function" && b !== null)
|
|
422
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
423
|
+
extendStatics(d, b);
|
|
424
|
+
function __() { this.constructor = d; }
|
|
425
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
426
|
+
};
|
|
427
|
+
})();
|
|
428
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
429
|
+
exports.TableForm = exports.Form = void 0;
|
|
430
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
431
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
432
|
+
var Form = /** @class */ (function (_super) {
|
|
433
|
+
__extends(Form, _super);
|
|
434
|
+
function Form(instanceId) {
|
|
435
|
+
var _this = _super.call(this, {}) || this;
|
|
436
|
+
_this.instanceId = instanceId;
|
|
437
|
+
return _this;
|
|
438
|
+
}
|
|
439
|
+
Form.prototype.getField = function (fieldId) {
|
|
440
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
441
|
+
instanceId: this.instanceId,
|
|
442
|
+
fieldId: fieldId
|
|
312
443
|
});
|
|
313
|
-
}
|
|
314
|
-
updateField(args) {
|
|
315
|
-
return this._postMessageAsync(
|
|
444
|
+
};
|
|
445
|
+
Form.prototype.updateField = function (args) {
|
|
446
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {
|
|
316
447
|
data: args
|
|
317
448
|
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
449
|
+
};
|
|
450
|
+
Form.prototype.getTable = function (tableId) {
|
|
451
|
+
var _this = this;
|
|
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
|
|
323
455
|
});
|
|
324
|
-
}
|
|
325
|
-
|
|
456
|
+
};
|
|
457
|
+
return Form;
|
|
458
|
+
}(base_1.BaseSDK));
|
|
459
|
+
exports.Form = Form;
|
|
460
|
+
var Table = /** @class */ (function (_super) {
|
|
461
|
+
__extends(Table, _super);
|
|
462
|
+
function Table(instanceId, tableId) {
|
|
463
|
+
var _this = _super.call(this, {}) || this;
|
|
464
|
+
_this.tableId = tableId;
|
|
465
|
+
_this.instanceId = instanceId;
|
|
466
|
+
return _this;
|
|
467
|
+
}
|
|
468
|
+
Table.prototype.getRow = function (rowId) {
|
|
469
|
+
var _this = this;
|
|
470
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROW, {
|
|
471
|
+
tableId: this.tableId,
|
|
472
|
+
rowId: rowId
|
|
473
|
+
}, true, // has callBack
|
|
474
|
+
function (data) {
|
|
475
|
+
return new TableForm(_this.instanceId, _this.tableId, rowId); // callBack function
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
Table.prototype.addRow = function (rowObject) {
|
|
479
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {
|
|
480
|
+
tableId: this.tableId,
|
|
481
|
+
rowObject: rowObject
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
Table.prototype.deleteRow = function (rowId) {
|
|
485
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {
|
|
486
|
+
tableId: this.tableId,
|
|
487
|
+
rowId: rowId
|
|
488
|
+
});
|
|
489
|
+
};
|
|
490
|
+
return Table;
|
|
491
|
+
}(base_1.BaseSDK));
|
|
492
|
+
var TableForm = /** @class */ (function (_super) {
|
|
493
|
+
__extends(TableForm, _super);
|
|
494
|
+
function TableForm(instanceId, tableId, rowId) {
|
|
495
|
+
var _this = _super.call(this, {}) || this;
|
|
496
|
+
_this.instanceId = instanceId;
|
|
497
|
+
_this.tableId = tableId;
|
|
498
|
+
_this.rowId = rowId;
|
|
499
|
+
_this.parent = new Form(instanceId);
|
|
500
|
+
_this.table = new Table(instanceId, tableId);
|
|
501
|
+
return _this;
|
|
502
|
+
}
|
|
503
|
+
TableForm.prototype.getField = function (fieldId) {
|
|
504
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {
|
|
505
|
+
instanceId: this.instanceId,
|
|
506
|
+
tableId: this.tableId,
|
|
507
|
+
rowId: this.rowId,
|
|
508
|
+
fieldId: fieldId
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
TableForm.prototype.updateField = function (args) {
|
|
512
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {
|
|
513
|
+
instanceId: this.instanceId,
|
|
514
|
+
tableId: this.tableId,
|
|
515
|
+
rowId: this.rowId,
|
|
516
|
+
data: args
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
return TableForm;
|
|
520
|
+
}(base_1.BaseSDK));
|
|
521
|
+
exports.TableForm = TableForm;
|
|
326
522
|
|
|
327
523
|
|
|
328
524
|
/***/ }),
|
|
@@ -331,44 +527,132 @@ class Form extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
331
527
|
/*!**************************!*\
|
|
332
528
|
!*** ./src/formatter.ts ***!
|
|
333
529
|
\**************************/
|
|
334
|
-
/***/ ((__unused_webpack_module,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
530
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
var __extends = (this && this.__extends) || (function () {
|
|
534
|
+
var extendStatics = function (d, b) {
|
|
535
|
+
extendStatics = Object.setPrototypeOf ||
|
|
536
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
537
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
538
|
+
return extendStatics(d, b);
|
|
539
|
+
};
|
|
540
|
+
return function (d, b) {
|
|
541
|
+
if (typeof b !== "function" && b !== null)
|
|
542
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
543
|
+
extendStatics(d, b);
|
|
544
|
+
function __() { this.constructor = d; }
|
|
545
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
546
|
+
};
|
|
547
|
+
})();
|
|
548
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
549
|
+
exports.Formatter = void 0;
|
|
550
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
551
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
552
|
+
var Formatter = /** @class */ (function (_super) {
|
|
553
|
+
__extends(Formatter, _super);
|
|
554
|
+
function Formatter() {
|
|
555
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
556
|
+
}
|
|
557
|
+
Formatter.prototype.toKfDate = function (date) {
|
|
558
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {
|
|
559
|
+
date: date,
|
|
348
560
|
});
|
|
349
|
-
}
|
|
350
|
-
toKfDateTime(date) {
|
|
351
|
-
return this._postMessageAsync(
|
|
352
|
-
date,
|
|
561
|
+
};
|
|
562
|
+
Formatter.prototype.toKfDateTime = function (date) {
|
|
563
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {
|
|
564
|
+
date: date,
|
|
353
565
|
});
|
|
354
|
-
}
|
|
355
|
-
toKfNumber(value) {
|
|
356
|
-
return this._postMessageAsync(
|
|
357
|
-
value,
|
|
566
|
+
};
|
|
567
|
+
Formatter.prototype.toKfNumber = function (value) {
|
|
568
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {
|
|
569
|
+
value: value,
|
|
358
570
|
});
|
|
359
|
-
}
|
|
360
|
-
toKfCurrency(value, currencyCode) {
|
|
361
|
-
return this._postMessageAsync(
|
|
362
|
-
value,
|
|
363
|
-
currencyCode,
|
|
571
|
+
};
|
|
572
|
+
Formatter.prototype.toKfCurrency = function (value, currencyCode) {
|
|
573
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {
|
|
574
|
+
value: value,
|
|
575
|
+
currencyCode: currencyCode,
|
|
364
576
|
});
|
|
365
|
-
}
|
|
366
|
-
toBoolean(value) {
|
|
367
|
-
return this._postMessageAsync(
|
|
368
|
-
value
|
|
577
|
+
};
|
|
578
|
+
Formatter.prototype.toBoolean = function (value) {
|
|
579
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {
|
|
580
|
+
value: value
|
|
369
581
|
});
|
|
370
|
-
}
|
|
582
|
+
};
|
|
583
|
+
return Formatter;
|
|
584
|
+
}(base_1.BaseSDK));
|
|
585
|
+
exports.Formatter = Formatter;
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
/***/ }),
|
|
589
|
+
|
|
590
|
+
/***/ "./src/lowcode.sdk.ts":
|
|
591
|
+
/*!****************************!*\
|
|
592
|
+
!*** ./src/lowcode.sdk.ts ***!
|
|
593
|
+
\****************************/
|
|
594
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
var __extends = (this && this.__extends) || (function () {
|
|
598
|
+
var extendStatics = function (d, b) {
|
|
599
|
+
extendStatics = Object.setPrototypeOf ||
|
|
600
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
601
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
602
|
+
return extendStatics(d, b);
|
|
603
|
+
};
|
|
604
|
+
return function (d, b) {
|
|
605
|
+
if (typeof b !== "function" && b !== null)
|
|
606
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
607
|
+
extendStatics(d, b);
|
|
608
|
+
function __() { this.constructor = d; }
|
|
609
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
610
|
+
};
|
|
611
|
+
})();
|
|
612
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
613
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
614
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
615
|
+
var form_1 = __webpack_require__(/*! ./form */ "./src/form.ts");
|
|
616
|
+
var form_2 = __webpack_require__(/*! ./form */ "./src/form.ts");
|
|
617
|
+
var client_1 = __webpack_require__(/*! ./client */ "./src/client.ts");
|
|
618
|
+
var formatter_1 = __webpack_require__(/*! ./formatter */ "./src/formatter.ts");
|
|
619
|
+
var app_1 = __webpack_require__(/*! ./app */ "./src/app.ts");
|
|
620
|
+
var component_1 = __webpack_require__(/*! ./component */ "./src/component.ts");
|
|
621
|
+
var LowcodeSDK = /** @class */ (function (_super) {
|
|
622
|
+
__extends(LowcodeSDK, _super);
|
|
623
|
+
function LowcodeSDK(props) {
|
|
624
|
+
var _this = _super.call(this, {}) || this;
|
|
625
|
+
if (props.tableId && props.rowId) {
|
|
626
|
+
_this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);
|
|
627
|
+
}
|
|
628
|
+
else if (props.instanceId) {
|
|
629
|
+
_this.currentForm = new form_1.Form(props.instanceId);
|
|
630
|
+
}
|
|
631
|
+
_this.client = new client_1.Client({});
|
|
632
|
+
_this.formatter = new formatter_1.Formatter({});
|
|
633
|
+
_this.app = new app_1.Application({});
|
|
634
|
+
return _this;
|
|
635
|
+
}
|
|
636
|
+
LowcodeSDK.prototype.api = function (url, args) {
|
|
637
|
+
if (args === void 0) { args = {}; }
|
|
638
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });
|
|
639
|
+
};
|
|
640
|
+
LowcodeSDK.prototype.watchParams = function (func) {
|
|
641
|
+
this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);
|
|
642
|
+
};
|
|
643
|
+
LowcodeSDK.prototype.getContext = function () {
|
|
644
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});
|
|
645
|
+
};
|
|
646
|
+
LowcodeSDK.prototype.getComponent = function (componentId) {
|
|
647
|
+
return new component_1.Component(componentId);
|
|
648
|
+
};
|
|
649
|
+
return LowcodeSDK;
|
|
650
|
+
}(base_1.BaseSDK));
|
|
651
|
+
function initSDK(config) {
|
|
652
|
+
if (config === void 0) { config = {}; }
|
|
653
|
+
return new LowcodeSDK(config);
|
|
371
654
|
}
|
|
655
|
+
exports["default"] = initSDK;
|
|
372
656
|
|
|
373
657
|
|
|
374
658
|
/***/ }),
|
|
@@ -377,54 +661,70 @@ class Formatter extends _base__WEBPACK_IMPORTED_MODULE_0__.BaseSDK {
|
|
|
377
661
|
/*!*********************!*\
|
|
378
662
|
!*** ./src/page.ts ***!
|
|
379
663
|
\*********************/
|
|
380
|
-
/***/ ((__unused_webpack_module,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
664
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
var __extends = (this && this.__extends) || (function () {
|
|
668
|
+
var extendStatics = function (d, b) {
|
|
669
|
+
extendStatics = Object.setPrototypeOf ||
|
|
670
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
671
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
672
|
+
return extendStatics(d, b);
|
|
673
|
+
};
|
|
674
|
+
return function (d, b) {
|
|
675
|
+
if (typeof b !== "function" && b !== null)
|
|
676
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
677
|
+
extendStatics(d, b);
|
|
678
|
+
function __() { this.constructor = d; }
|
|
679
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
680
|
+
};
|
|
681
|
+
})();
|
|
682
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
683
|
+
exports.Page = void 0;
|
|
684
|
+
var base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
685
|
+
var constants_1 = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
686
|
+
var Page = /** @class */ (function (_super) {
|
|
687
|
+
__extends(Page, _super);
|
|
688
|
+
function Page(pageId) {
|
|
689
|
+
var _this = _super.call(this, {}) || this;
|
|
690
|
+
_this._id = pageId;
|
|
691
|
+
return _this;
|
|
692
|
+
}
|
|
693
|
+
Page.prototype.getParameter = function (key) {
|
|
694
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_PARAMS, {
|
|
695
|
+
key: key
|
|
398
696
|
});
|
|
399
|
-
}
|
|
400
|
-
getVariable(key) {
|
|
401
|
-
return this._postMessageAsync(
|
|
402
|
-
key
|
|
697
|
+
};
|
|
698
|
+
Page.prototype.getVariable = function (key) {
|
|
699
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_PAGE_VARIABLE, {
|
|
700
|
+
key: key
|
|
403
701
|
});
|
|
404
|
-
}
|
|
405
|
-
setVariable(key, value) {
|
|
406
|
-
return this._postMessageAsync(
|
|
407
|
-
key,
|
|
408
|
-
value
|
|
702
|
+
};
|
|
703
|
+
Page.prototype.setVariable = function (key, value) {
|
|
704
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_PAGE_VARIABLE, {
|
|
705
|
+
key: key,
|
|
706
|
+
value: value
|
|
409
707
|
});
|
|
410
|
-
}
|
|
411
|
-
openPopup(pageId, inputParams, popupProperties) {
|
|
412
|
-
|
|
413
|
-
pageId,
|
|
414
|
-
inputParams,
|
|
708
|
+
};
|
|
709
|
+
Page.prototype.openPopup = function (pageId, inputParams, popupProperties) {
|
|
710
|
+
var payload = {
|
|
711
|
+
pageId: pageId,
|
|
712
|
+
inputParams: inputParams,
|
|
415
713
|
popupProperties: {
|
|
416
714
|
width: popupProperties.w,
|
|
417
715
|
height: popupProperties.h
|
|
418
716
|
}
|
|
419
717
|
};
|
|
420
|
-
return this._postMessageAsync(
|
|
718
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {
|
|
421
719
|
return new Page(pageId);
|
|
422
720
|
});
|
|
423
|
-
}
|
|
424
|
-
onClose(callback) {
|
|
425
|
-
this._registerEventListener(this._id,
|
|
426
|
-
}
|
|
427
|
-
|
|
721
|
+
};
|
|
722
|
+
Page.prototype.onClose = function (callback) {
|
|
723
|
+
this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);
|
|
724
|
+
};
|
|
725
|
+
return Page;
|
|
726
|
+
}(base_1.BaseSDK));
|
|
727
|
+
exports.Page = Page;
|
|
428
728
|
|
|
429
729
|
|
|
430
730
|
/***/ }),
|
|
@@ -547,7 +847,7 @@ let urlAlphabet =
|
|
|
547
847
|
/******/ };
|
|
548
848
|
/******/
|
|
549
849
|
/******/ // Execute the module function
|
|
550
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
850
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
551
851
|
/******/
|
|
552
852
|
/******/ // Return the exports of the module
|
|
553
853
|
/******/ return module.exports;
|
|
@@ -586,58 +886,22 @@ let urlAlphabet =
|
|
|
586
886
|
var __webpack_exports__ = {};
|
|
587
887
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
588
888
|
(() => {
|
|
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
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
889
|
+
var exports = __webpack_exports__;
|
|
890
|
+
/*!**********************!*\
|
|
891
|
+
!*** ./src/index.ts ***!
|
|
892
|
+
\**********************/
|
|
610
893
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
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);
|
|
894
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
895
|
+
var lowcode_sdk_1 = __webpack_require__(/*! ./lowcode.sdk */ "./src/lowcode.sdk.ts");
|
|
896
|
+
if (true) {
|
|
897
|
+
self.KF = lowcode_sdk_1.default;
|
|
634
898
|
}
|
|
635
|
-
|
|
899
|
+
exports["default"] = lowcode_sdk_1.default;
|
|
636
900
|
|
|
637
901
|
})();
|
|
638
902
|
|
|
639
|
-
var
|
|
903
|
+
var __webpack_exports___esModule = __webpack_exports__.__esModule;
|
|
640
904
|
var __webpack_exports__default = __webpack_exports__["default"];
|
|
641
|
-
export {
|
|
905
|
+
export { __webpack_exports___esModule as __esModule, __webpack_exports__default as default };
|
|
642
906
|
|
|
643
907
|
//# sourceMappingURL=kflowcode.sdk.module.js.map
|