@kissflow/lowcode-client-sdk 1.0.5 → 1.0.6-beta
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 +190 -66
- package/dist/kfsdk.es.js +379 -0
- package/dist/kfsdk.umd.js +1 -0
- package/dist/kfworkersdk.es.js +470 -0
- package/package.json +52 -39
- package/SDK_IN_INTEGRATION.md +0 -78
- package/custom.build.js +0 -99
- package/dist/app.js +0 -48
- package/dist/base.js +0 -170
- package/dist/client.js +0 -44
- package/dist/component.js +0 -45
- package/dist/constants.js +0 -48
- package/dist/form.js +0 -126
- package/dist/formatter.js +0 -54
- package/dist/global.types.d.ts +0 -68
- package/dist/index.d.ts +0 -161
- package/dist/index.html +0 -23
- package/dist/index.js +0 -7
- package/dist/kflowcode.sdk.js +0 -922
- package/dist/kflowcode.sdk.js.map +0 -1
- package/dist/kflowcode.sdk.module.js +0 -922
- package/dist/kflowcode.sdk.module.js.map +0 -1
- package/dist/lowcode.sdk.js +0 -56
- package/dist/page.js +0 -63
- package/id +0 -55
- package/index.html +0 -23
- package/src/app.ts +0 -31
- package/src/base.ts +0 -108
- package/src/client.ts +0 -28
- package/src/component.ts +0 -25
- package/src/constants.ts +0 -53
- package/src/form.ts +0 -131
- package/src/formatter.ts +0 -35
- package/src/index.ts +0 -7
- package/src/lowcode.sdk.ts +0 -44
- package/src/page.ts +0 -43
- package/test/lcnc-handler.js +0 -45
- package/test/mock/api.js +0 -16
- package/test/mock/id.js +0 -55
- package/tsconfig.json +0 -7
- package/tsconfig.types.json +0 -18
- package/webpack.config.js +0 -62
package/dist/global.types.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
declare class Component {
|
|
3
|
-
id: string
|
|
4
|
-
refresh(): any;
|
|
5
|
-
show(): any;
|
|
6
|
-
hide(): any;
|
|
7
|
-
}
|
|
8
|
-
declare class Page {
|
|
9
|
-
_id: string
|
|
10
|
-
getParameter(key: string): any;
|
|
11
|
-
getVariable(key: string): any;
|
|
12
|
-
setVariable(key: string, value: any): any;
|
|
13
|
-
openPopup(popupId: string, popupParams: object): any;
|
|
14
|
-
closePopup(): any;
|
|
15
|
-
getComponent(componentId: string): Component;
|
|
16
|
-
onClose(callback: Function): void;
|
|
17
|
-
}
|
|
18
|
-
declare class Application {
|
|
19
|
-
page: Page
|
|
20
|
-
getVariable(key: string): any;
|
|
21
|
-
setVariable(key: string | object, value: any): any;
|
|
22
|
-
openPage(pageId: string, pageParams: object): any;
|
|
23
|
-
}
|
|
24
|
-
declare class Client {
|
|
25
|
-
showInfo(message: string): any;
|
|
26
|
-
showConfirm(args: {
|
|
27
|
-
title: string;
|
|
28
|
-
content: string;
|
|
29
|
-
okText: string;
|
|
30
|
-
cancelText: string;
|
|
31
|
-
}): any;
|
|
32
|
-
redirect(url: string): any;
|
|
33
|
-
}
|
|
34
|
-
declare class Form {
|
|
35
|
-
toJSON(): any;
|
|
36
|
-
getField(fieldId: string): any;
|
|
37
|
-
updateField(args: object): any;
|
|
38
|
-
getTable(tableId: string): Table;
|
|
39
|
-
}
|
|
40
|
-
declare class Table {
|
|
41
|
-
toJSON(): any;
|
|
42
|
-
getRows(): TableForm[];
|
|
43
|
-
getRow(rowId: string): TableForm;
|
|
44
|
-
addRow(rowObject: object): any;
|
|
45
|
-
deleteRow(rowId: string): any;
|
|
46
|
-
}
|
|
47
|
-
declare class TableForm {
|
|
48
|
-
getParent(): Form;
|
|
49
|
-
toJSON(): any;
|
|
50
|
-
getField(fieldId: string): any;
|
|
51
|
-
updateField(args: object): any;
|
|
52
|
-
}
|
|
53
|
-
declare class Formatter {
|
|
54
|
-
toDate(date: string): any;
|
|
55
|
-
toDateTime(date: string): any;
|
|
56
|
-
toNumber(value: string): any;
|
|
57
|
-
toCurrency(value: string, currencyCode: string): any;
|
|
58
|
-
toBoolean(value: string): any;
|
|
59
|
-
}
|
|
60
|
-
declare class kf {
|
|
61
|
-
static currentForm: Form
|
|
62
|
-
static client: Client
|
|
63
|
-
static formatter: Formatter
|
|
64
|
-
static app: Application
|
|
65
|
-
api(url: string, args?: {}): string | object;
|
|
66
|
-
watchParams(func: (data: any) => any): void;
|
|
67
|
-
getContext(): string | object;
|
|
68
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
declare module "constants" {
|
|
2
|
-
export const LISTENER_CMDS: {
|
|
3
|
-
API: string;
|
|
4
|
-
PARAMS: string;
|
|
5
|
-
GET_CONTEXT: string;
|
|
6
|
-
RETURN: string;
|
|
7
|
-
GET_FORM_FIELD: string;
|
|
8
|
-
UPDATE_FORM: string;
|
|
9
|
-
GET_TABLE: string;
|
|
10
|
-
GET_TABLE_ROW: string;
|
|
11
|
-
ADD_TABLE_ROW: string;
|
|
12
|
-
DELETE_TABLE_ROW: string;
|
|
13
|
-
TO_JSON: string;
|
|
14
|
-
GET_TABLE_ROWS: string;
|
|
15
|
-
MESSAGE: string;
|
|
16
|
-
CONFIRM: string;
|
|
17
|
-
ALERT: string;
|
|
18
|
-
REDIRECT: string;
|
|
19
|
-
OPEN_PAGE: string;
|
|
20
|
-
FORMAT_DATE: string;
|
|
21
|
-
FORMAT_DATE_TIME: string;
|
|
22
|
-
FORMAT_NUMBER: string;
|
|
23
|
-
FORMAT_CURRENCY: string;
|
|
24
|
-
FORMAT_BOOLEAN: string;
|
|
25
|
-
GET_APP_VARIABLE: string;
|
|
26
|
-
SET_APP_VARIABLE: string;
|
|
27
|
-
GET_PAGE_VARIABLE: string;
|
|
28
|
-
SET_PAGE_VARIABLE: string;
|
|
29
|
-
GET_PAGE_PARAMS: string;
|
|
30
|
-
OPEN_POPUP_PAGE: string;
|
|
31
|
-
PAGE_ON_CLOSE: string;
|
|
32
|
-
CLOSE_POPUP: string;
|
|
33
|
-
COMPONENT_REFRESH: string;
|
|
34
|
-
COMPONENT_SHOW: string;
|
|
35
|
-
COMPONENT_HIDE: string;
|
|
36
|
-
};
|
|
37
|
-
export const EVENT_TYPES: {
|
|
38
|
-
ON_CLOSE: string;
|
|
39
|
-
ON_CHANGE: string;
|
|
40
|
-
ON_LOAD: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
declare module "base" {
|
|
44
|
-
export class BaseSDK {
|
|
45
|
-
#private;
|
|
46
|
-
constructor(props: any);
|
|
47
|
-
_postMessageAsync(command: string, args: any, hasCallBack?: boolean, callBack?: (data: any) => {}): object | string | any;
|
|
48
|
-
_postMessage(command: string, func: (data: any) => {}, args?: {}): void;
|
|
49
|
-
_registerEventListener(_id: string, eventType: string, callback: any): void;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
declare module "component" {
|
|
53
|
-
import { BaseSDK } from "base";
|
|
54
|
-
export class Component extends BaseSDK {
|
|
55
|
-
id: string;
|
|
56
|
-
constructor(id: string);
|
|
57
|
-
refresh(): any;
|
|
58
|
-
show(): any;
|
|
59
|
-
hide(): any;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
declare module "page" {
|
|
63
|
-
import { Component } from "component";
|
|
64
|
-
import { BaseSDK } from "base";
|
|
65
|
-
export class Page extends BaseSDK {
|
|
66
|
-
_id: string;
|
|
67
|
-
constructor(pageId: string);
|
|
68
|
-
getParameter(key: string): any;
|
|
69
|
-
getVariable(key: string): any;
|
|
70
|
-
setVariable(key: string, value: any): any;
|
|
71
|
-
openPopup(popupId: string, popupParams: object): any;
|
|
72
|
-
closePopup(): any;
|
|
73
|
-
getComponent(componentId: string): Component;
|
|
74
|
-
onClose(callback: Function): void;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
declare module "app" {
|
|
78
|
-
import { BaseSDK } from "base";
|
|
79
|
-
import { Page } from "page";
|
|
80
|
-
export class Application extends BaseSDK {
|
|
81
|
-
page: Page;
|
|
82
|
-
constructor(props: any);
|
|
83
|
-
getVariable(key: string): any;
|
|
84
|
-
setVariable(key: string | object, value: any): any;
|
|
85
|
-
openPage(pageId: string, pageParams: object): any;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
declare module "client" {
|
|
89
|
-
import { BaseSDK } from "base";
|
|
90
|
-
export class Client extends BaseSDK {
|
|
91
|
-
showInfo(message: string): any;
|
|
92
|
-
showConfirm(args: {
|
|
93
|
-
title: string;
|
|
94
|
-
content: string;
|
|
95
|
-
okText: string;
|
|
96
|
-
cancelText: string;
|
|
97
|
-
}): any;
|
|
98
|
-
redirect(url: string): any;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
declare module "form" {
|
|
102
|
-
import { BaseSDK } from "base";
|
|
103
|
-
export class Form extends BaseSDK {
|
|
104
|
-
private instanceId;
|
|
105
|
-
constructor(instanceId: string);
|
|
106
|
-
toJSON(): any;
|
|
107
|
-
getField(fieldId: string): any;
|
|
108
|
-
updateField(args: object): any;
|
|
109
|
-
getTable(tableId: string): Table;
|
|
110
|
-
}
|
|
111
|
-
class Table extends BaseSDK {
|
|
112
|
-
private tableId;
|
|
113
|
-
private instanceId;
|
|
114
|
-
constructor(instanceId: string, tableId: string);
|
|
115
|
-
toJSON(): any;
|
|
116
|
-
getRows(): TableForm[];
|
|
117
|
-
getRow(rowId: string): TableForm;
|
|
118
|
-
addRow(rowObject: object): any;
|
|
119
|
-
deleteRow(rowId: string): any;
|
|
120
|
-
}
|
|
121
|
-
export class TableForm extends BaseSDK {
|
|
122
|
-
private instanceId;
|
|
123
|
-
private tableId;
|
|
124
|
-
private rowId;
|
|
125
|
-
constructor(instanceId: string, tableId: string, rowId: string);
|
|
126
|
-
getParent(): Form;
|
|
127
|
-
toJSON(): any;
|
|
128
|
-
getField(fieldId: string): any;
|
|
129
|
-
updateField(args: object): any;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
declare module "formatter" {
|
|
133
|
-
import { BaseSDK } from "base";
|
|
134
|
-
export class Formatter extends BaseSDK {
|
|
135
|
-
toDate(date: string): any;
|
|
136
|
-
toDateTime(date: string): any;
|
|
137
|
-
toNumber(value: string): any;
|
|
138
|
-
toCurrency(value: string, currencyCode: string): any;
|
|
139
|
-
toBoolean(value: string): any;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
declare module "lowcode.sdk" {
|
|
143
|
-
import { BaseSDK } from "base";
|
|
144
|
-
import { Form } from "form";
|
|
145
|
-
import { TableForm } from "form";
|
|
146
|
-
import { Client } from "client";
|
|
147
|
-
import { Formatter } from "formatter";
|
|
148
|
-
import { Application } from "app";
|
|
149
|
-
class LowcodeSDK extends BaseSDK {
|
|
150
|
-
currentForm: Form | TableForm;
|
|
151
|
-
client: Client;
|
|
152
|
-
formatter: Formatter;
|
|
153
|
-
app: Application;
|
|
154
|
-
constructor(props: any);
|
|
155
|
-
api(url: string, args?: {}): string | object;
|
|
156
|
-
watchParams(func: (data: any) => any): void;
|
|
157
|
-
getContext(): string | object;
|
|
158
|
-
}
|
|
159
|
-
function initSDK(config?: any): LowcodeSDK;
|
|
160
|
-
export default initSDK;
|
|
161
|
-
}
|
package/dist/index.html
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Kissflow LCNC SDK</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<h1 id="title">Kissflow SDK Check</h1>
|
|
10
|
-
<iframe id="component1" src="http://localhost:8080" width="500px" height="500px">
|
|
11
|
-
<p>Your browser does not support iframes.</p>
|
|
12
|
-
</iframe>
|
|
13
|
-
|
|
14
|
-
<iframe id="component2" src="http://localhost:3000" width="500px" height="500px">
|
|
15
|
-
<p>Your browser does not support iframes.</p>
|
|
16
|
-
</iframe>
|
|
17
|
-
<script defer src="kflowcode.sdk.js"></script></body>
|
|
18
|
-
<script type="module">
|
|
19
|
-
import MockAPI from './test/mock/api.js';
|
|
20
|
-
import LCNCHandler from './test/lcnc-handler.js';
|
|
21
|
-
LCNCHandler();
|
|
22
|
-
</script>
|
|
23
|
-
</html>
|