@kissflow/lowcode-client-sdk 1.0.3 → 1.0.4-beta.1
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 +5 -11
- package/SDK_IN_INTEGRATION.md +78 -0
- package/dist/constants.js +1 -0
- package/dist/global.types.d.ts +2 -4
- package/dist/index.d.ts +3 -4
- package/dist/kflowcode.sdk.js +9 -11
- package/dist/kflowcode.sdk.js.map +1 -1
- package/dist/kflowcode.sdk.module.js +9 -11
- package/dist/kflowcode.sdk.module.js.map +1 -1
- package/dist/page.js +8 -11
- package/package.json +1 -1
- package/src/constants.ts +1 -0
- package/src/page.ts +10 -22
package/README.md
CHANGED
|
@@ -236,24 +236,18 @@ kf.app.openPage(pageId, pageInputParameters);
|
|
|
236
236
|
```js
|
|
237
237
|
let value = await kf.app.page.getParameter();
|
|
238
238
|
```
|
|
239
|
-
##### Open a popup
|
|
239
|
+
##### Open a popup
|
|
240
240
|
```js
|
|
241
|
-
|
|
241
|
+
kf.app.page.openPopup(popupId, { inputParam1: 2 })
|
|
242
242
|
```
|
|
243
|
-
|
|
243
|
+
##### Close popup
|
|
244
|
+
> Closes the active popup in the page.
|
|
244
245
|
```js
|
|
245
|
-
|
|
246
|
-
popupPage.onClose(() => {});
|
|
246
|
+
kf.app.page.closePopup();
|
|
247
247
|
```
|
|
248
248
|
##### Page onClose event
|
|
249
249
|
```js
|
|
250
250
|
kf.app.page.onClose(() => {});
|
|
251
|
-
// or
|
|
252
|
-
let popupPage = await kf.app.page.openPopup(pageId, { inputParam1: 2 }, { w: 50; h: 50 })
|
|
253
|
-
popupPage.onClose(() => {
|
|
254
|
-
console.log("popup onclose");
|
|
255
|
-
// ...
|
|
256
|
-
});
|
|
257
251
|
```
|
|
258
252
|
---
|
|
259
253
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# _Kissflow Low-code JavaScript SDK_
|
|
2
|
+
|
|
3
|
+
The JavaScript Software Development Kit (SDK) for Kissflow Low-code includes all the supported functions and code snippets that you can incorporate into your application while integrating with other services.
|
|
4
|
+
|
|
5
|
+
### 1) Get context
|
|
6
|
+
This function retrieves your account and application's context information, such as the **account ID** and **application ID**.
|
|
7
|
+
```js
|
|
8
|
+
kf.getContext().then((ctx) => {...})
|
|
9
|
+
// or
|
|
10
|
+
let ctx = kf.getContext()
|
|
11
|
+
/*
|
|
12
|
+
fetches contextual information, such as:
|
|
13
|
+
ctx = {
|
|
14
|
+
app: {_id },
|
|
15
|
+
account: { _id }
|
|
16
|
+
}
|
|
17
|
+
*/
|
|
18
|
+
```
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
### 2) Get API via Kissflow Low-code SDK
|
|
22
|
+
|
|
23
|
+
This function lets you retrieve any external or Kissflow APIs. To access an internal Kissflow API, use an absolute URL, **(i.e., https://{your_sub_domain}.kissflow.com/user/2/{account_id})**. The Access key secret must be passed in the header. Refer **[Access keys](https://helpdocs.kissflow.com/user-settings/api-keys#access_keys)** to know how to locate your Kissflow API key and secret. Refer the developer guide to know more about our **[APIs](https://developers.kissflow.com)**.
|
|
24
|
+
> Note: The API call timeout for this method is 10 seconds.
|
|
25
|
+
```js
|
|
26
|
+
kf.api(url, config).then((res) => {...})
|
|
27
|
+
// or
|
|
28
|
+
let resp = await kf.api(url, config)
|
|
29
|
+
```
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### 3) Formatter functions
|
|
33
|
+
##### Convert to Kissflow date format
|
|
34
|
+
This function lets you transform your date into Kissflow's date format. This conversion is based on the date format specified in your Kissflow account format settings.
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
kf.formatter.toDate("08-24-2021").then((res) => {...})
|
|
38
|
+
// or
|
|
39
|
+
let value = kf.formatter.toDate("08-24-2021");
|
|
40
|
+
```
|
|
41
|
+
##### Convert to Kissflow DateTime format
|
|
42
|
+
This function lets you transform your date and time into Kissflow's DateTime format. This conversion is based on the time zone and date format specified in your Kissflow account format settings.
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
kf.formatter.toDateTime("2021-08-26T14:30").then((res) => {...})
|
|
46
|
+
// or
|
|
47
|
+
let value = kf.formatter.toDateTime("2021-08-26T14:30");
|
|
48
|
+
```
|
|
49
|
+
##### Convert to Kissflow number format
|
|
50
|
+
This function lets you transform your number into Kissflow's number format.
|
|
51
|
+
```js
|
|
52
|
+
kf.formatter.toNumber("1,00,000.500000").then((res) => {...})
|
|
53
|
+
// or
|
|
54
|
+
let value = kf.formatter.toNumber("1,00,000.500000");
|
|
55
|
+
```
|
|
56
|
+
##### Convert to Kissflow currency format
|
|
57
|
+
This function lets you transform your current values into Kissflow's currency format.
|
|
58
|
+
```js
|
|
59
|
+
kf.formatter.toCurrency("1,00,000.500000", "USD").then((res) => {...})
|
|
60
|
+
// or
|
|
61
|
+
let value = kf.formatter.toCurrency("1,00,000.500000", "USD");
|
|
62
|
+
```
|
|
63
|
+
##### Convert to boolean
|
|
64
|
+
This function converts your value to a boolean value.
|
|
65
|
+
```js
|
|
66
|
+
kf.formatter.toBoolean("yes").then((res) => {...})
|
|
67
|
+
// or
|
|
68
|
+
let value = kf.formatter.toBoolean("yes");
|
|
69
|
+
```
|
|
70
|
+
##### Other supported boolean values
|
|
71
|
+
```js
|
|
72
|
+
let value = kf.formatter.toBoolean("1");
|
|
73
|
+
let value = kf.formatter.toBoolean("true");
|
|
74
|
+
let value = kf.formatter.toBoolean("no");
|
|
75
|
+
let value = kf.formatter.toBoolean("0");
|
|
76
|
+
let value = kf.formatter.toBoolean("false");
|
|
77
|
+
```
|
|
78
|
+
---
|
package/dist/constants.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.LISTENER_CMDS = {
|
|
|
36
36
|
GET_PAGE_PARAMS: "GET_PAGE_PARAMS",
|
|
37
37
|
OPEN_POPUP_PAGE: "OPEN_POPUP_PAGE",
|
|
38
38
|
PAGE_ON_CLOSE: "PAGE_ON_CLOSE",
|
|
39
|
+
CLOSE_POPUP: "CLOSE_POPUP",
|
|
39
40
|
COMPONENT_REFRESH: "COMPONENT_REFRESH",
|
|
40
41
|
COMPONENT_SHOW: "COMPONENT_SHOW",
|
|
41
42
|
COMPONENT_HIDE: "COMPONENT_HIDE"
|
package/dist/global.types.d.ts
CHANGED
|
@@ -10,10 +10,8 @@ declare class Page {
|
|
|
10
10
|
getParameter(key: string): any;
|
|
11
11
|
getVariable(key: string): any;
|
|
12
12
|
setVariable(key: string, value: any): any;
|
|
13
|
-
openPopup(
|
|
14
|
-
|
|
15
|
-
h: number;
|
|
16
|
-
}): any;
|
|
13
|
+
openPopup(popupId: string, popupParams: object): any;
|
|
14
|
+
closePopup(): any;
|
|
17
15
|
getComponent(componentId: string): Component;
|
|
18
16
|
onClose(callback: Function): void;
|
|
19
17
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ declare module "constants" {
|
|
|
29
29
|
GET_PAGE_PARAMS: string;
|
|
30
30
|
OPEN_POPUP_PAGE: string;
|
|
31
31
|
PAGE_ON_CLOSE: string;
|
|
32
|
+
CLOSE_POPUP: string;
|
|
32
33
|
COMPONENT_REFRESH: string;
|
|
33
34
|
COMPONENT_SHOW: string;
|
|
34
35
|
COMPONENT_HIDE: string;
|
|
@@ -67,10 +68,8 @@ declare module "page" {
|
|
|
67
68
|
getParameter(key: string): any;
|
|
68
69
|
getVariable(key: string): any;
|
|
69
70
|
setVariable(key: string, value: any): any;
|
|
70
|
-
openPopup(
|
|
71
|
-
|
|
72
|
-
h: number;
|
|
73
|
-
}): any;
|
|
71
|
+
openPopup(popupId: string, popupParams: object): any;
|
|
72
|
+
closePopup(): any;
|
|
74
73
|
getComponent(componentId: string): Component;
|
|
75
74
|
onClose(callback: Function): void;
|
|
76
75
|
}
|
package/dist/kflowcode.sdk.js
CHANGED
|
@@ -393,6 +393,7 @@ exports.LISTENER_CMDS = {
|
|
|
393
393
|
GET_PAGE_PARAMS: "GET_PAGE_PARAMS",
|
|
394
394
|
OPEN_POPUP_PAGE: "OPEN_POPUP_PAGE",
|
|
395
395
|
PAGE_ON_CLOSE: "PAGE_ON_CLOSE",
|
|
396
|
+
CLOSE_POPUP: "CLOSE_POPUP",
|
|
396
397
|
COMPONENT_REFRESH: "COMPONENT_REFRESH",
|
|
397
398
|
COMPONENT_SHOW: "COMPONENT_SHOW",
|
|
398
399
|
COMPONENT_HIDE: "COMPONENT_HIDE"
|
|
@@ -722,19 +723,16 @@ var Page = /** @class */ (function (_super) {
|
|
|
722
723
|
value: value
|
|
723
724
|
});
|
|
724
725
|
};
|
|
725
|
-
Page.prototype.openPopup = function (
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
width: popupProperties.w,
|
|
731
|
-
height: popupProperties.h
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {
|
|
735
|
-
return new Page(pageId);
|
|
726
|
+
Page.prototype.openPopup = function (popupId, popupParams) {
|
|
727
|
+
//TODO: add popup class
|
|
728
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, {
|
|
729
|
+
popupId: popupId,
|
|
730
|
+
popupParams: popupParams
|
|
736
731
|
});
|
|
737
732
|
};
|
|
733
|
+
Page.prototype.closePopup = function () {
|
|
734
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.CLOSE_POPUP, {});
|
|
735
|
+
};
|
|
738
736
|
Page.prototype.getComponent = function (componentId) {
|
|
739
737
|
return new component_1.Component(componentId);
|
|
740
738
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kflowcode.sdk.js","mappings":";;;;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;ACzKa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC9Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG;AACA;AACA,6CAA6C,gEAAgE;AAC7G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC7HJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA,CAAC;AACD;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,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,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;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;ACjEyC;AACrD,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACoE;;;;;;;;;;;;;;;AC7DpE;AACA;AACsB;;;;;;;UCFtB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;ACNa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,oBAAoB,mBAAO,CAAC,2CAAe;AAC3C,IAAI,IAAuC;AAC3C;AACA;AACA,kBAAe","sources":["webpack://@kissflow/lowcode-client-sdk/./src/app.ts","webpack://@kissflow/lowcode-client-sdk/./src/base.ts","webpack://@kissflow/lowcode-client-sdk/./src/client.ts","webpack://@kissflow/lowcode-client-sdk/./src/component.ts","webpack://@kissflow/lowcode-client-sdk/./src/constants.ts","webpack://@kissflow/lowcode-client-sdk/./src/form.ts","webpack://@kissflow/lowcode-client-sdk/./src/formatter.ts","webpack://@kissflow/lowcode-client-sdk/./src/lowcode.sdk.ts","webpack://@kissflow/lowcode-client-sdk/./src/page.ts","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/index.dev.js","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/url-alphabet/index.js","webpack://@kissflow/lowcode-client-sdk/webpack/bootstrap","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/define property getters","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/make namespace object","webpack://@kissflow/lowcode-client-sdk/./src/index.ts"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Application = void 0;\nvar base_1 = require(\"./base\");\nvar page_1 = require(\"./page\");\nvar constants_1 = require(\"./constants\");\nvar Application = /** @class */ (function (_super) {\n __extends(Application, _super);\n function Application(props) {\n var _this = _super.call(this, {}) || this;\n _this.page = new page_1.Page({});\n return _this;\n }\n Application.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {\n key: key\n });\n };\n Application.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {\n key: key,\n value: value\n });\n };\n Application.prototype.openPage = function (pageId, pageParams) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {\n pageId: pageId,\n pageParams: pageParams\n });\n };\n return Application;\n}(base_1.BaseSDK));\nexports.Application = Application;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSDK = void 0;\nvar constants_1 = require(\"./constants\");\nvar nanoid = require(\"nanoid\").nanoid;\nfunction generateId(prefix) {\n if (prefix === void 0) { prefix = \"lcncsdk\"; }\n return \"\".concat(prefix, \"-\").concat(nanoid());\n}\nfunction postMessage(args) {\n console.log(\"SDK : @postMessage \", args);\n if (self.parent && self.parent !== self) {\n self.parent.postMessage(args, \"*\");\n }\n else {\n self.postMessage(args);\n }\n}\nvar BaseSDK = /** @class */ (function () {\n function BaseSDK(props) {\n _BaseSDK_instances.add(this);\n _BaseSDK_listeners.set(this, void 0);\n _BaseSDK_eventListeners.set(this, void 0);\n console.log(\"SDK : Initializing \", props);\n __classPrivateFieldSet(this, _BaseSDK_listeners, {}, \"f\");\n __classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, \"f\");\n self.addEventListener(\"message\", __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_onMessage).bind(this), false);\n }\n BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(_this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!data.errorMessage) return [3 /*break*/, 1];\n reject(data);\n return [3 /*break*/, 4];\n case 1:\n if (!(hasCallBack && callBack)) return [3 /*break*/, 3];\n return [4 /*yield*/, callBack(data)];\n case 2:\n data = _a.sent();\n _a.label = 3;\n case 3:\n resolve(data);\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); });\n });\n };\n BaseSDK.prototype._postMessage = function (command, func, args) {\n if (args === void 0) { args = {}; }\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });\n };\n BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);\n };\n return BaseSDK;\n}());\nexports.BaseSDK = BaseSDK;\n_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] || [];\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id].push(callback);\n}, _BaseSDK_appendEventListeners = function _BaseSDK_appendEventListeners(_id, eventType, callback) {\n if (!__classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id]) {\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] = {};\n }\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id][eventType] = callback;\n}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {\n var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;\n if (!_id || !eventType)\n return;\n var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] || {};\n if (eventListener[eventType]) {\n eventListener[eventType](eventParams || {});\n }\n}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {\n if (event.origin !== self.location.origin) {\n console.log(\"SDK : @onMessage \", event);\n var data_1 = event.data;\n if (data_1.isEvent) {\n return __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_checkEvents).call(this, data_1);\n }\n var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};\n var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];\n if (listeners) {\n listeners.forEach(function (listener) {\n try {\n if (data_1.resp &&\n 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 catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n TO_JSON: \"TO_JSON\",\n GET_TABLE_ROWS: \"GET_TABLE_ROWS\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n return _this;\n }\n Form.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n instanceId: this.instanceId\n });\n };\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n return new Table(this.instanceId, tableId);\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n return _this;\n }\n // list of obj of rows\n Table.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId\n });\n };\n Table.prototype.getRows = function () {\n var _this = this;\n // list of TableForm class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack\n function (data) {\n console.log(data);\n return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });\n });\n };\n Table.prototype.getRow = function (rowId) {\n return new TableForm(this.instanceId, this.tableId, rowId);\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n return _this;\n }\n TableForm.prototype.getParent = function () {\n return new Form(this.instanceId);\n };\n TableForm.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId,\n rowId: this.rowId\n });\n };\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar component_1 = require(\"./component\");\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.getComponent = function (componentId) {\n return new component_1.Component(componentId);\n };\n Page.prototype.onClose = function (callback) {\n this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);\n };\n return Page;\n}(base_1.BaseSDK));\nexports.Page = Page;\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (true) {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lowcode_sdk_1 = require(\"./lowcode.sdk\");\nif (typeof _BUILD !== \"undefined\" && _BUILD) {\n self.KF = lowcode_sdk_1.default;\n}\nexports.default = lowcode_sdk_1.default;\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"kflowcode.sdk.js","mappings":";;;;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;ACzKa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC/Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG;AACA;AACA,6CAA6C,gEAAgE;AAC7G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC7HJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA,CAAC;AACD;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,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,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,SAAS;AACT;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;AC9DyC;AACrD,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACoE;;;;;;;;;;;;;;;AC7DpE;AACA;AACsB;;;;;;;UCFtB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;ACNa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,oBAAoB,mBAAO,CAAC,2CAAe;AAC3C,IAAI,IAAuC;AAC3C;AACA;AACA,kBAAe","sources":["webpack://@kissflow/lowcode-client-sdk/./src/app.ts","webpack://@kissflow/lowcode-client-sdk/./src/base.ts","webpack://@kissflow/lowcode-client-sdk/./src/client.ts","webpack://@kissflow/lowcode-client-sdk/./src/component.ts","webpack://@kissflow/lowcode-client-sdk/./src/constants.ts","webpack://@kissflow/lowcode-client-sdk/./src/form.ts","webpack://@kissflow/lowcode-client-sdk/./src/formatter.ts","webpack://@kissflow/lowcode-client-sdk/./src/lowcode.sdk.ts","webpack://@kissflow/lowcode-client-sdk/./src/page.ts","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/index.dev.js","webpack://@kissflow/lowcode-client-sdk/./node_modules/nanoid/url-alphabet/index.js","webpack://@kissflow/lowcode-client-sdk/webpack/bootstrap","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/define property getters","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@kissflow/lowcode-client-sdk/webpack/runtime/make namespace object","webpack://@kissflow/lowcode-client-sdk/./src/index.ts"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Application = void 0;\nvar base_1 = require(\"./base\");\nvar page_1 = require(\"./page\");\nvar constants_1 = require(\"./constants\");\nvar Application = /** @class */ (function (_super) {\n __extends(Application, _super);\n function Application(props) {\n var _this = _super.call(this, {}) || this;\n _this.page = new page_1.Page({});\n return _this;\n }\n Application.prototype.getVariable = function (key) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_APP_VARIABLE, {\n key: key\n });\n };\n Application.prototype.setVariable = function (key, value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.SET_APP_VARIABLE, {\n key: key,\n value: value\n });\n };\n Application.prototype.openPage = function (pageId, pageParams) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.OPEN_PAGE, {\n pageId: pageId,\n pageParams: pageParams\n });\n };\n return Application;\n}(base_1.BaseSDK));\nexports.Application = Application;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _BaseSDK_instances, _BaseSDK_listeners, _BaseSDK_eventListeners, _BaseSDK_addListener, _BaseSDK_appendEventListeners, _BaseSDK_checkEvents, _BaseSDK_onMessage;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseSDK = void 0;\nvar constants_1 = require(\"./constants\");\nvar nanoid = require(\"nanoid\").nanoid;\nfunction generateId(prefix) {\n if (prefix === void 0) { prefix = \"lcncsdk\"; }\n return \"\".concat(prefix, \"-\").concat(nanoid());\n}\nfunction postMessage(args) {\n console.log(\"SDK : @postMessage \", args);\n if (self.parent && self.parent !== self) {\n self.parent.postMessage(args, \"*\");\n }\n else {\n self.postMessage(args);\n }\n}\nvar BaseSDK = /** @class */ (function () {\n function BaseSDK(props) {\n _BaseSDK_instances.add(this);\n _BaseSDK_listeners.set(this, void 0);\n _BaseSDK_eventListeners.set(this, void 0);\n console.log(\"SDK : Initializing \", props);\n __classPrivateFieldSet(this, _BaseSDK_listeners, {}, \"f\");\n __classPrivateFieldSet(this, _BaseSDK_eventListeners, {}, \"f\");\n self.addEventListener(\"message\", __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_onMessage).bind(this), false);\n }\n BaseSDK.prototype._postMessageAsync = function (command, args, hasCallBack, callBack) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(_this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(_this, _id, function (data) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!data.errorMessage) return [3 /*break*/, 1];\n reject(data);\n return [3 /*break*/, 4];\n case 1:\n if (!(hasCallBack && callBack)) return [3 /*break*/, 3];\n return [4 /*yield*/, callBack(data)];\n case 2:\n data = _a.sent();\n _a.label = 3;\n case 3:\n resolve(data);\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); });\n });\n };\n BaseSDK.prototype._postMessage = function (command, func, args) {\n if (args === void 0) { args = {}; }\n var _id = generateId(command.toLowerCase());\n postMessage(__assign({ _id: _id, command: command }, args));\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_addListener).call(this, _id, function (data) { return func(data); });\n };\n BaseSDK.prototype._registerEventListener = function (_id, eventType, callback) {\n __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_appendEventListeners).call(this, _id, eventType, callback);\n };\n return BaseSDK;\n}());\nexports.BaseSDK = BaseSDK;\n_BaseSDK_listeners = new WeakMap(), _BaseSDK_eventListeners = new WeakMap(), _BaseSDK_instances = new WeakSet(), _BaseSDK_addListener = function _BaseSDK_addListener(_id, callback) {\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id] || [];\n __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_id].push(callback);\n}, _BaseSDK_appendEventListeners = function _BaseSDK_appendEventListeners(_id, eventType, callback) {\n if (!__classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id]) {\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] = {};\n }\n __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id][eventType] = callback;\n}, _BaseSDK_checkEvents = function _BaseSDK_checkEvents(data) {\n var _id = data._id, eventType = data.eventType, eventParams = data.eventParams;\n if (!_id || !eventType)\n return;\n var eventListener = __classPrivateFieldGet(this, _BaseSDK_eventListeners, \"f\")[_id] || {};\n if (eventListener[eventType]) {\n eventListener[eventType](eventParams || {});\n }\n}, _BaseSDK_onMessage = function _BaseSDK_onMessage(event) {\n if (event.origin !== self.location.origin) {\n console.log(\"SDK : @onMessage \", event);\n var data_1 = event.data;\n if (data_1.isEvent) {\n return __classPrivateFieldGet(this, _BaseSDK_instances, \"m\", _BaseSDK_checkEvents).call(this, data_1);\n }\n var _req_1 = (data_1 === null || data_1 === void 0 ? void 0 : data_1._req) || {};\n var listeners = __classPrivateFieldGet(this, _BaseSDK_listeners, \"f\")[_req_1 === null || _req_1 === void 0 ? void 0 : _req_1._id] || [];\n if (listeners) {\n listeners.forEach(function (listener) {\n try {\n if (data_1.resp &&\n 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 catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n TO_JSON: \"TO_JSON\",\n GET_TABLE_ROWS: \"GET_TABLE_ROWS\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n CLOSE_POPUP: \"CLOSE_POPUP\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n return _this;\n }\n Form.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n instanceId: this.instanceId\n });\n };\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n return new Table(this.instanceId, tableId);\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n return _this;\n }\n // list of obj of rows\n Table.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId\n });\n };\n Table.prototype.getRows = function () {\n var _this = this;\n // list of TableForm class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack\n function (data) {\n console.log(data);\n return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });\n });\n };\n Table.prototype.getRow = function (rowId) {\n return new TableForm(this.instanceId, this.tableId, rowId);\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n return _this;\n }\n TableForm.prototype.getParent = function () {\n return new Form(this.instanceId);\n };\n TableForm.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId,\n rowId: this.rowId\n });\n };\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar component_1 = require(\"./component\");\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 (popupId, popupParams) {\n //TODO: add popup class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, {\n popupId: popupId,\n popupParams: popupParams\n });\n };\n Page.prototype.closePopup = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.CLOSE_POPUP, {});\n };\n Page.prototype.getComponent = function (componentId) {\n return new component_1.Component(componentId);\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":""}
|
|
@@ -391,6 +391,7 @@ exports.LISTENER_CMDS = {
|
|
|
391
391
|
GET_PAGE_PARAMS: "GET_PAGE_PARAMS",
|
|
392
392
|
OPEN_POPUP_PAGE: "OPEN_POPUP_PAGE",
|
|
393
393
|
PAGE_ON_CLOSE: "PAGE_ON_CLOSE",
|
|
394
|
+
CLOSE_POPUP: "CLOSE_POPUP",
|
|
394
395
|
COMPONENT_REFRESH: "COMPONENT_REFRESH",
|
|
395
396
|
COMPONENT_SHOW: "COMPONENT_SHOW",
|
|
396
397
|
COMPONENT_HIDE: "COMPONENT_HIDE"
|
|
@@ -720,19 +721,16 @@ var Page = /** @class */ (function (_super) {
|
|
|
720
721
|
value: value
|
|
721
722
|
});
|
|
722
723
|
};
|
|
723
|
-
Page.prototype.openPopup = function (
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
width: popupProperties.w,
|
|
729
|
-
height: popupProperties.h
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {
|
|
733
|
-
return new Page(pageId);
|
|
724
|
+
Page.prototype.openPopup = function (popupId, popupParams) {
|
|
725
|
+
//TODO: add popup class
|
|
726
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, {
|
|
727
|
+
popupId: popupId,
|
|
728
|
+
popupParams: popupParams
|
|
734
729
|
});
|
|
735
730
|
};
|
|
731
|
+
Page.prototype.closePopup = function () {
|
|
732
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.CLOSE_POPUP, {});
|
|
733
|
+
};
|
|
736
734
|
Page.prototype.getComponent = function (componentId) {
|
|
737
735
|
return new component_1.Component(componentId);
|
|
738
736
|
};
|
|
@@ -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,aAAa;AACb;AACA;AACA;;;;;;;;;;;ACzKa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC9Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG;AACA;AACA,6CAA6C,gEAAgE;AAC7G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC7HJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA,CAAC;AACD;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,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,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;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;ACjEyC;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 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 catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n TO_JSON: \"TO_JSON\",\n GET_TABLE_ROWS: \"GET_TABLE_ROWS\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n return _this;\n }\n Form.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n instanceId: this.instanceId\n });\n };\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n return new Table(this.instanceId, tableId);\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n return _this;\n }\n // list of obj of rows\n Table.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId\n });\n };\n Table.prototype.getRows = function () {\n var _this = this;\n // list of TableForm class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack\n function (data) {\n console.log(data);\n return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });\n });\n };\n Table.prototype.getRow = function (rowId) {\n return new TableForm(this.instanceId, this.tableId, rowId);\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n return _this;\n }\n TableForm.prototype.getParent = function () {\n return new Form(this.instanceId);\n };\n TableForm.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId,\n rowId: this.rowId\n });\n };\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar component_1 = require(\"./component\");\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.getComponent = function (componentId) {\n return new component_1.Component(componentId);\n };\n Page.prototype.onClose = function (callback) {\n this._registerEventListener(this._id, constants_1.EVENT_TYPES.ON_CLOSE, callback);\n };\n return Page;\n}(base_1.BaseSDK));\nexports.Page = Page;\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (true) {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lowcode_sdk_1 = require(\"./lowcode.sdk\");\nif (typeof _BUILD !== \"undefined\" && _BUILD) {\n self.KF = lowcode_sdk_1.default;\n}\nexports.default = lowcode_sdk_1.default;\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"kflowcode.sdk.module.js","mappings":";;;;;;;;AAAa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,mBAAmB;;;;;;;;;;;AC/CN;AACb;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,gFAAwB;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D,4HAA4H;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B,4BAA4B;AAC3D,sHAAsH,oBAAoB;AAC1I;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe;AACf;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;ACzKa;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc;AACd,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,kBAAkB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA,CAAC;AACD,cAAc;;;;;;;;;;;AC3CD;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC5CJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,qBAAqB;AAC3C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;;;;AC/Ca;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,YAAY;AAChC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;AACZ;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG;AACA;AACA,6CAA6C,gEAAgE;AAC7G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;AC7HJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,iBAAiB;;;;;;;;;;;ACrDJ;AACb;AACA;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,aAAa,mBAAO,CAAC,6BAAQ;AAC7B,eAAe,mBAAO,CAAC,iCAAU;AACjC,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,YAAY,mBAAO,CAAC,2BAAO;AAC3B;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sDAAsD;AACtD,4CAA4C;AAC5C;AACA;AACA;AACA,+BAA+B;AAC/B,uEAAuE,sBAAsB;AAC7F;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA,CAAC;AACD;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,kBAAkB,mBAAO,CAAC,uCAAa;AACvC,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,SAAS;AACT;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,YAAY;;;;;;;;;;;;;;;;;;;;AC9DyC;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 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 catch (err) {\n console.error(\"Message callback error: \", err);\n }\n });\n }\n }\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Client = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Client.prototype.showInfo = function (message) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.MESSAGE, { message: message });\n };\n Client.prototype.showConfirm = function (args) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.CONFIRM, {\n data: {\n title: args.title,\n content: args.content,\n okText: args.okText || \"Ok\",\n cancelText: args.cancelText || \"Cancel\"\n }\n });\n };\n Client.prototype.redirect = function (url) {\n return _super.prototype._postMessageAsync.call(this, constants_1.LISTENER_CMDS.REDIRECT, { url: url });\n };\n return Client;\n}(base_1.BaseSDK));\nexports.Client = Client;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(id) {\n var _this = _super.call(this, {}) || this;\n _this.id = id;\n return _this;\n }\n Component.prototype.refresh = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_REFRESH, {\n id: this.id\n });\n };\n Component.prototype.show = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_SHOW, {\n id: this.id\n });\n };\n Component.prototype.hide = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.COMPONENT_HIDE, {\n id: this.id\n });\n };\n return Component;\n}(base_1.BaseSDK));\nexports.Component = Component;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EVENT_TYPES = exports.LISTENER_CMDS = void 0;\nexports.LISTENER_CMDS = {\n API: \"API\",\n PARAMS: \"PARAMS\",\n GET_CONTEXT: \"GET_CONTEXT\",\n RETURN: \"RETURN\",\n //Forms SDK Functions\n GET_FORM_FIELD: \"GET_FORM_FIELD\",\n UPDATE_FORM: \"UPDATE_FORM\",\n GET_TABLE: \"GET_TABLE\",\n GET_TABLE_ROW: \"GET_TABLE_ROW\",\n ADD_TABLE_ROW: \"ADD_TABLE_ROW\",\n DELETE_TABLE_ROW: \"DELETE_TABLE_ROW\",\n TO_JSON: \"TO_JSON\",\n GET_TABLE_ROWS: \"GET_TABLE_ROWS\",\n //Client SDK functions\n MESSAGE: \"MESSAGE\",\n CONFIRM: \"CONFIRM\",\n ALERT: \"ALERT\",\n REDIRECT: \"REDIRECT\",\n OPEN_PAGE: \"OPEN_PAGE\",\n //Formatter SDK Functions\n FORMAT_DATE: \"FORMAT_DATE\",\n FORMAT_DATE_TIME: \"FORMAT_DATE_TIME\",\n FORMAT_NUMBER: \"FORMAT_NUMBER\",\n FORMAT_CURRENCY: \"FORMAT_CURRENCY\",\n FORMAT_BOOLEAN: \"FORMAT_BOOLEAN\",\n //Application SDK functions\n GET_APP_VARIABLE: \"GET_APP_VARIABLE\",\n SET_APP_VARIABLE: \"SET_APP_VARIABLE\",\n //Application page sdk functions\n GET_PAGE_VARIABLE: \"GET_PAGE_VARIABLE\",\n SET_PAGE_VARIABLE: \"SET_PAGE_VARIABLE\",\n GET_PAGE_PARAMS: \"GET_PAGE_PARAMS\",\n OPEN_POPUP_PAGE: \"OPEN_POPUP_PAGE\",\n PAGE_ON_CLOSE: \"PAGE_ON_CLOSE\",\n CLOSE_POPUP: \"CLOSE_POPUP\",\n COMPONENT_REFRESH: \"COMPONENT_REFRESH\",\n COMPONENT_SHOW: \"COMPONENT_SHOW\",\n COMPONENT_HIDE: \"COMPONENT_HIDE\"\n};\nexports.EVENT_TYPES = {\n ON_CLOSE: \"onClose\",\n ON_CHANGE: \"onChange\",\n ON_LOAD: \"onLoad\",\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TableForm = exports.Form = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Form = /** @class */ (function (_super) {\n __extends(Form, _super);\n function Form(instanceId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n return _this;\n }\n Form.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n instanceId: this.instanceId\n });\n };\n Form.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n fieldId: fieldId\n });\n };\n Form.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n data: args\n });\n };\n Form.prototype.getTable = function (tableId) {\n return new Table(this.instanceId, tableId);\n };\n return Form;\n}(base_1.BaseSDK));\nexports.Form = Form;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table(instanceId, tableId) {\n var _this = _super.call(this, {}) || this;\n _this.tableId = tableId;\n _this.instanceId = instanceId;\n return _this;\n }\n // list of obj of rows\n Table.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId\n });\n };\n Table.prototype.getRows = function () {\n var _this = this;\n // list of TableForm class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_TABLE_ROWS, { tableId: this.tableId }, true, // has callBack\n function (data) {\n console.log(data);\n return data.map(function (row) { return new TableForm(_this.instanceId, _this.tableId, row.id); });\n });\n };\n Table.prototype.getRow = function (rowId) {\n return new TableForm(this.instanceId, this.tableId, rowId);\n };\n Table.prototype.addRow = function (rowObject) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.ADD_TABLE_ROW, {\n tableId: this.tableId,\n rowObject: rowObject\n });\n };\n Table.prototype.deleteRow = function (rowId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.DELETE_TABLE_ROW, {\n tableId: this.tableId,\n rowId: rowId\n });\n };\n return Table;\n}(base_1.BaseSDK));\nvar TableForm = /** @class */ (function (_super) {\n __extends(TableForm, _super);\n function TableForm(instanceId, tableId, rowId) {\n var _this = _super.call(this, {}) || this;\n _this.instanceId = instanceId;\n _this.tableId = tableId;\n _this.rowId = rowId;\n return _this;\n }\n TableForm.prototype.getParent = function () {\n return new Form(this.instanceId);\n };\n TableForm.prototype.toJSON = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.TO_JSON, {\n tableId: this.tableId,\n rowId: this.rowId\n });\n };\n TableForm.prototype.getField = function (fieldId) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_FORM_FIELD, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n fieldId: fieldId\n });\n };\n TableForm.prototype.updateField = function (args) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.UPDATE_FORM, {\n instanceId: this.instanceId,\n tableId: this.tableId,\n rowId: this.rowId,\n data: args\n });\n };\n return TableForm;\n}(base_1.BaseSDK));\nexports.TableForm = TableForm;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Formatter = void 0;\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar Formatter = /** @class */ (function (_super) {\n __extends(Formatter, _super);\n function Formatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Formatter.prototype.toDate = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE, {\n date: date,\n });\n };\n Formatter.prototype.toDateTime = function (date) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_DATE_TIME, {\n date: date,\n });\n };\n Formatter.prototype.toNumber = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_NUMBER, {\n value: value,\n });\n };\n Formatter.prototype.toCurrency = function (value, currencyCode) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_CURRENCY, {\n value: value,\n currencyCode: currencyCode,\n });\n };\n Formatter.prototype.toBoolean = function (value) {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.FORMAT_BOOLEAN, {\n value: value\n });\n };\n return Formatter;\n}(base_1.BaseSDK));\nexports.Formatter = Formatter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar constants_1 = require(\"./constants\");\nvar form_1 = require(\"./form\");\nvar form_2 = require(\"./form\");\nvar client_1 = require(\"./client\");\nvar formatter_1 = require(\"./formatter\");\nvar app_1 = require(\"./app\");\nvar LowcodeSDK = /** @class */ (function (_super) {\n __extends(LowcodeSDK, _super);\n function LowcodeSDK(props) {\n var _this = _super.call(this, {}) || this;\n if (props.tableId && props.rowId) {\n _this.currentForm = new form_2.TableForm(props.instanceId, props.tableId, props.rowId);\n }\n else if (props.instanceId) {\n _this.currentForm = new form_1.Form(props.instanceId);\n }\n _this.client = new client_1.Client({});\n _this.formatter = new formatter_1.Formatter({});\n _this.app = new app_1.Application({});\n return _this;\n }\n LowcodeSDK.prototype.api = function (url, args) {\n if (args === void 0) { args = {}; }\n return this._postMessageAsync(constants_1.LISTENER_CMDS.API, { url: url, args: args });\n };\n LowcodeSDK.prototype.watchParams = function (func) {\n this._postMessage(constants_1.LISTENER_CMDS.PARAMS, func);\n };\n LowcodeSDK.prototype.getContext = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.GET_CONTEXT, {});\n };\n return LowcodeSDK;\n}(base_1.BaseSDK));\nfunction initSDK(config) {\n if (config === void 0) { config = {}; }\n return new LowcodeSDK(config);\n}\nexports.default = initSDK;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Page = void 0;\nvar component_1 = require(\"./component\");\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 (popupId, popupParams) {\n //TODO: add popup class\n return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, {\n popupId: popupId,\n popupParams: popupParams\n });\n };\n Page.prototype.closePopup = function () {\n return this._postMessageAsync(constants_1.LISTENER_CMDS.CLOSE_POPUP, {});\n };\n Page.prototype.getComponent = function (componentId) {\n return new component_1.Component(componentId);\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/dist/page.js
CHANGED
|
@@ -42,19 +42,16 @@ var Page = /** @class */ (function (_super) {
|
|
|
42
42
|
value: value
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
Page.prototype.openPopup = function (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
width: popupProperties.w,
|
|
51
|
-
height: popupProperties.h
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, payload, true, function () {
|
|
55
|
-
return new Page(pageId);
|
|
45
|
+
Page.prototype.openPopup = function (popupId, popupParams) {
|
|
46
|
+
//TODO: add popup class
|
|
47
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.OPEN_POPUP_PAGE, {
|
|
48
|
+
popupId: popupId,
|
|
49
|
+
popupParams: popupParams
|
|
56
50
|
});
|
|
57
51
|
};
|
|
52
|
+
Page.prototype.closePopup = function () {
|
|
53
|
+
return this._postMessageAsync(constants_1.LISTENER_CMDS.CLOSE_POPUP, {});
|
|
54
|
+
};
|
|
58
55
|
Page.prototype.getComponent = function (componentId) {
|
|
59
56
|
return new component_1.Component(componentId);
|
|
60
57
|
};
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/page.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from
|
|
1
|
+
import { Component } from "./component";
|
|
2
2
|
import { BaseSDK } from "./base";
|
|
3
3
|
import { LISTENER_CMDS, EVENT_TYPES } from "./constants";
|
|
4
4
|
|
|
@@ -24,27 +24,15 @@ export class Page extends BaseSDK {
|
|
|
24
24
|
value
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
openPopup(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
width: popupProperties.w,
|
|
37
|
-
height: popupProperties.h
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return this._postMessageAsync(
|
|
41
|
-
LISTENER_CMDS.OPEN_POPUP_PAGE,
|
|
42
|
-
payload,
|
|
43
|
-
true,
|
|
44
|
-
() => {
|
|
45
|
-
return new Page(pageId);
|
|
46
|
-
}
|
|
47
|
-
);
|
|
27
|
+
openPopup(popupId: string, popupParams: object) {
|
|
28
|
+
//TODO: add popup class
|
|
29
|
+
return this._postMessageAsync(LISTENER_CMDS.OPEN_POPUP_PAGE, {
|
|
30
|
+
popupId,
|
|
31
|
+
popupParams
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
closePopup() {
|
|
35
|
+
return this._postMessageAsync(LISTENER_CMDS.CLOSE_POPUP, {});
|
|
48
36
|
}
|
|
49
37
|
getComponent(componentId: string): Component {
|
|
50
38
|
return new Component(componentId);
|