@kissflow/lowcode-client-sdk 1.0.1 → 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 +4 -4
- package/dist/kflowcode.sdk.module.js +20 -6
- package/dist/kflowcode.sdk.module.js.map +1 -1
- package/package.json +1 -1
- package/webpack.config.js +1 -2
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# _Kissflow
|
|
1
|
+
# _Kissflow Lowcode JavaScript SDK_
|
|
2
2
|
|
|
3
|
-
JavaScript SDK for developing over the Kissflow
|
|
3
|
+
JavaScript SDK for developing over the Kissflow lowcode platform
|
|
4
4
|
|
|
5
5
|
### Use as an `npm` module
|
|
6
6
|
|
|
7
|
-
Install the SDK as a module: `npm i @kissflow/
|
|
7
|
+
Install the SDK as a module: `npm i @kissflow/lowcode-client-sdk` Then import into your project:
|
|
8
8
|
|
|
9
9
|
```js
|
|
10
|
-
import KFLowcodeSDK from "@kissflow/
|
|
10
|
+
import KFLowcodeSDK from "@kissflow/lowcode-client-sdk";
|
|
11
11
|
const kf = KFLowcodeSDK();
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -798,11 +798,25 @@ let urlAlphabet =
|
|
|
798
798
|
/******/ })();
|
|
799
799
|
/******/
|
|
800
800
|
/************************************************************************/
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
801
|
+
var __webpack_exports__ = {};
|
|
802
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
803
|
+
(() => {
|
|
804
|
+
var exports = __webpack_exports__;
|
|
805
|
+
/*!**********************!*\
|
|
806
|
+
!*** ./src/index.ts ***!
|
|
807
|
+
\**********************/
|
|
808
|
+
|
|
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;
|
|
813
|
+
}
|
|
814
|
+
exports["default"] = lowcode_sdk_1.default;
|
|
815
|
+
|
|
816
|
+
})();
|
|
817
|
+
|
|
818
|
+
var __webpack_exports___esModule = __webpack_exports__.__esModule;
|
|
819
|
+
var __webpack_exports__default = __webpack_exports__["default"];
|
|
820
|
+
export { __webpack_exports___esModule as __esModule, __webpack_exports__default as default };
|
|
807
821
|
|
|
808
822
|
//# sourceMappingURL=kflowcode.sdk.module.js.map
|
|
@@ -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,CAAC;AACD,iBAAiB;;;;;;;;;;;AClCJ;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,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;ACvCa;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;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;AC3CC;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,kBAAkB;AAClB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,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,8CAA8C;AAC9C,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,kBAAkB;AAClB;AACA,6BAA6B;AAC7B;AACA;AACA,kBAAe;;;;;;;;;;;ACvDF;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;;;;;SENA;SACA;SACA;SACA","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/webpack/before-startup","webpack://@kissflow/lowcode-client-sdk/webpack/startup","webpack://@kissflow/lowcode-client-sdk/webpack/after-startup"],"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 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 ADD_TABLE_ROW: \"ADD_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};\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.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() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\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.addTableRow = function (tableId, rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: tableId,\n rowObject: rowObject\n });\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\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 });\nexports.LowcodeSDK = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = 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 _this.currentForm = new form_1.Form({});\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));\nexports.LowcodeSDK = LowcodeSDK;\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};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/lowcode.sdk.ts\");\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,CAAC;AACD,iBAAiB;;;;;;;;;;;AClCJ;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,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;ACvCa;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;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;AC3CC;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,kBAAkB;AAClB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,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,8CAA8C;AAC9C,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,kBAAkB;AAClB;AACA,6BAA6B;AAC7B;AACA;AACA,kBAAe;;;;;;;;;;;ACvDF;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 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 ADD_TABLE_ROW: \"ADD_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};\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.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() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\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.addTableRow = function (tableId, rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: tableId,\n rowObject: rowObject\n });\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\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 });\nexports.LowcodeSDK = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = 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 _this.currentForm = new form_1.Form({});\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));\nexports.LowcodeSDK = LowcodeSDK;\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/webpack.config.js
CHANGED
|
@@ -5,6 +5,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
5
5
|
let config = {
|
|
6
6
|
devtool: "source-map",
|
|
7
7
|
mode: "development",
|
|
8
|
+
entry: "./src/index.ts",
|
|
8
9
|
devServer: {
|
|
9
10
|
contentBase: path.join(__dirname, "dist"),
|
|
10
11
|
port: 3000,
|
|
@@ -43,7 +44,6 @@ let moduleLib = Object.assign({}, config, {
|
|
|
43
44
|
experiments: {
|
|
44
45
|
outputModule: true
|
|
45
46
|
},
|
|
46
|
-
entry: "./src/lowcode.sdk.ts",
|
|
47
47
|
output: {
|
|
48
48
|
filename: "kflowcode.sdk.module.js",
|
|
49
49
|
path: path.resolve(__dirname, "dist"),
|
|
@@ -54,7 +54,6 @@ let moduleLib = Object.assign({}, config, {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
let commonLib = Object.assign({}, config, {
|
|
57
|
-
entry: "./src/index.ts",
|
|
58
57
|
output: {
|
|
59
58
|
filename: "kflowcode.sdk.js",
|
|
60
59
|
path: path.resolve(__dirname, "dist")
|