@kissflow/lowcode-client-sdk 1.0.24-beta.2 → 1.0.24-beta.3
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/dist/index.d.ts +13 -14
- package/dist/kf.lowcodeworkersdk.es.js +19 -69
- package/dist/kf.nocodeworkersdk.es.js +3 -2
- package/dist/kfsdk.es.js +21 -71
- package/dist/kfsdk.umd.js +1 -1
- package/dist/lowcode.d.ts +13 -14
- package/dist/lowcode.types.d.ts +1 -2
- package/dist/nocode.d.ts +12 -13
- package/dist/snippets.json +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ declare module "core/constants" {
|
|
|
48
48
|
WINDOW_NDEF_READER_ABORT_SCAN: string;
|
|
49
49
|
DECISION_TABLE_EXECUTE: string;
|
|
50
50
|
DATAFORM_IMPORT_CSV: string;
|
|
51
|
+
BOARD_IMPORT_CSV: string;
|
|
51
52
|
};
|
|
52
53
|
export const EVENT_TYPES: {
|
|
53
54
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -205,8 +206,7 @@ declare module "app/page" {
|
|
|
205
206
|
_id: string;
|
|
206
207
|
popup: Popup;
|
|
207
208
|
type: string;
|
|
208
|
-
|
|
209
|
-
constructor(props: PageContext);
|
|
209
|
+
constructor(props: PageContext, isCustomComponent?: boolean);
|
|
210
210
|
getParameter(key: string): any;
|
|
211
211
|
getAllParameters(): any;
|
|
212
212
|
getVariable(key: string): any;
|
|
@@ -214,11 +214,6 @@ declare module "app/page" {
|
|
|
214
214
|
openPopup(popupId: string, popupParams: object): any;
|
|
215
215
|
getComponent(componentId: string): Component;
|
|
216
216
|
}
|
|
217
|
-
class PageVariable extends BaseSDK {
|
|
218
|
-
constructor();
|
|
219
|
-
get(key: any, path: any): any;
|
|
220
|
-
set(key: any, value: any, path: any): any;
|
|
221
|
-
}
|
|
222
217
|
}
|
|
223
218
|
declare module "app/decisiontable" {
|
|
224
219
|
import { BaseSDK } from "core/index";
|
|
@@ -236,27 +231,31 @@ declare module "app/dataform" {
|
|
|
236
231
|
importCSV(defaultValues: object): any;
|
|
237
232
|
}
|
|
238
233
|
}
|
|
234
|
+
declare module "board/index" {
|
|
235
|
+
import { BaseSDK } from "core/index";
|
|
236
|
+
export class Board extends BaseSDK {
|
|
237
|
+
private _id;
|
|
238
|
+
constructor(flowId: string);
|
|
239
|
+
importCSV(defaultValues: object): any;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
239
242
|
declare module "app/index" {
|
|
240
243
|
import { BaseSDK } from "core/index";
|
|
241
244
|
import { Page } from "app/page";
|
|
242
245
|
import { AppContext } from "types/internal";
|
|
243
246
|
import { DecisionTable } from "app/decisiontable";
|
|
244
247
|
import { Dataform } from "app/dataform";
|
|
248
|
+
import { Board } from "board/index";
|
|
245
249
|
export class Application extends BaseSDK {
|
|
246
250
|
page: Page;
|
|
247
|
-
variable: AppVariable;
|
|
248
251
|
_id: string;
|
|
249
|
-
constructor(props: AppContext);
|
|
252
|
+
constructor(props: AppContext, isCustomComponent?: boolean);
|
|
250
253
|
getVariable(key: string): any;
|
|
251
254
|
setVariable(key: string | object, value?: any): any;
|
|
252
255
|
openPage(pageId: string, pageParams: object): any;
|
|
253
256
|
getDecisionTable(flowId: string): DecisionTable;
|
|
254
257
|
getDataform(flowId: string): Dataform;
|
|
255
|
-
|
|
256
|
-
class AppVariable extends BaseSDK {
|
|
257
|
-
constructor();
|
|
258
|
-
get(key: any, path: any): any;
|
|
259
|
-
set(key: any, value: any, path: any): any;
|
|
258
|
+
getBoard(flowId: string): Board;
|
|
260
259
|
}
|
|
261
260
|
export * from "app/component";
|
|
262
261
|
export { Page };
|
|
@@ -82,7 +82,8 @@ const LISTENER_CMDS = {
|
|
|
82
82
|
WINDOW_NDEF_READER_MAKE_READONLY: "WINDOW_NDEF_READER_MAKE_READONLY",
|
|
83
83
|
WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
|
|
84
84
|
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
|
|
85
|
-
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV"
|
|
85
|
+
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
|
|
86
|
+
BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
|
|
86
87
|
};
|
|
87
88
|
const EVENT_TYPES = {
|
|
88
89
|
COMPONENT_ON_MOUNT: "componentOnMount",
|
|
@@ -182,7 +183,7 @@ class BaseSDK extends EventBase {
|
|
|
182
183
|
postMessage({ _id, command, ...args });
|
|
183
184
|
globalInstances[_id] = this;
|
|
184
185
|
this._addEventListener(_id, async (data) => {
|
|
185
|
-
if (data == null ? void 0 : data.errorMessage) {
|
|
186
|
+
if ((data == null ? void 0 : data.errorMessage) || (data == null ? void 0 : data.isError)) {
|
|
186
187
|
reject(data);
|
|
187
188
|
} else {
|
|
188
189
|
if (hasCallBack && callBack) {
|
|
@@ -417,28 +418,6 @@ class Formatter extends BaseSDK {
|
|
|
417
418
|
});
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
|
-
const isObject = (value) => value !== null && typeof value === "object";
|
|
421
|
-
class CreateProxy {
|
|
422
|
-
constructor(parent, target = {}, path = []) {
|
|
423
|
-
this.parent = parent;
|
|
424
|
-
this.path = path;
|
|
425
|
-
return new Proxy(target, this);
|
|
426
|
-
}
|
|
427
|
-
get(target, property) {
|
|
428
|
-
let value = this.parent.get(property, this.path);
|
|
429
|
-
if (isObject(value)) {
|
|
430
|
-
return new CreateProxy(this.parent, value, [...this.path, property]);
|
|
431
|
-
}
|
|
432
|
-
return value;
|
|
433
|
-
}
|
|
434
|
-
set(target, property, value, reciever) {
|
|
435
|
-
let updatedValue = this.parent.set(property, value, this.path);
|
|
436
|
-
if (isObject(updatedValue)) {
|
|
437
|
-
return new CreateProxy(this.parent, updatedValue, [...this.path, property]);
|
|
438
|
-
}
|
|
439
|
-
return updatedValue;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
421
|
class Component extends BaseSDK {
|
|
443
422
|
constructor(props) {
|
|
444
423
|
super();
|
|
@@ -532,12 +511,11 @@ class Popup extends BaseSDK {
|
|
|
532
511
|
}
|
|
533
512
|
}
|
|
534
513
|
class Page extends BaseSDK {
|
|
535
|
-
constructor(props) {
|
|
514
|
+
constructor(props, isCustomComponent = false) {
|
|
536
515
|
super();
|
|
537
516
|
this.type = "Page";
|
|
538
517
|
this.popup = new Popup({});
|
|
539
518
|
this._id = props.pageId;
|
|
540
|
-
this.variable = new PageVariable();
|
|
541
519
|
}
|
|
542
520
|
getParameter(key) {
|
|
543
521
|
return this._postMessageAsync(LISTENER_CMDS.GET_PAGE_PARAMS, {
|
|
@@ -575,27 +553,6 @@ class Page extends BaseSDK {
|
|
|
575
553
|
);
|
|
576
554
|
}
|
|
577
555
|
}
|
|
578
|
-
class PageVariable extends BaseSDK {
|
|
579
|
-
constructor() {
|
|
580
|
-
super();
|
|
581
|
-
return new CreateProxy(this);
|
|
582
|
-
}
|
|
583
|
-
get(key, path) {
|
|
584
|
-
let args = {
|
|
585
|
-
key,
|
|
586
|
-
path
|
|
587
|
-
};
|
|
588
|
-
return this._postMessageSync(LISTENER_CMDS.GET_PAGE_VARIABLE, args);
|
|
589
|
-
}
|
|
590
|
-
set(key, value, path) {
|
|
591
|
-
let args = {
|
|
592
|
-
key,
|
|
593
|
-
value,
|
|
594
|
-
path
|
|
595
|
-
};
|
|
596
|
-
return this._postMessageSync(LISTENER_CMDS.SET_PAGE_VARIABLE, args);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
556
|
class DecisionTable extends BaseSDK {
|
|
600
557
|
constructor(flowId) {
|
|
601
558
|
super();
|
|
@@ -620,12 +577,23 @@ class Dataform extends BaseSDK {
|
|
|
620
577
|
});
|
|
621
578
|
}
|
|
622
579
|
}
|
|
580
|
+
class Board extends BaseSDK {
|
|
581
|
+
constructor(flowId) {
|
|
582
|
+
super();
|
|
583
|
+
this._id = flowId;
|
|
584
|
+
}
|
|
585
|
+
importCSV(defaultValues) {
|
|
586
|
+
return this._postMessageAsync(LISTENER_CMDS.BOARD_IMPORT_CSV, {
|
|
587
|
+
flowId: this._id,
|
|
588
|
+
defaultValues
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
623
592
|
class Application extends BaseSDK {
|
|
624
|
-
constructor(props) {
|
|
593
|
+
constructor(props, isCustomComponent = false) {
|
|
625
594
|
super();
|
|
626
595
|
this._id = props.appId;
|
|
627
596
|
this.page = new Page(props);
|
|
628
|
-
this.variable = new AppVariable();
|
|
629
597
|
}
|
|
630
598
|
getVariable(key) {
|
|
631
599
|
return this._postMessageAsync(LISTENER_CMDS.GET_APP_VARIABLE, {
|
|
@@ -650,26 +618,8 @@ class Application extends BaseSDK {
|
|
|
650
618
|
getDataform(flowId) {
|
|
651
619
|
return new Dataform(flowId);
|
|
652
620
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
constructor() {
|
|
656
|
-
super();
|
|
657
|
-
return new CreateProxy(this);
|
|
658
|
-
}
|
|
659
|
-
get(key, path) {
|
|
660
|
-
let args = {
|
|
661
|
-
key,
|
|
662
|
-
path
|
|
663
|
-
};
|
|
664
|
-
return this._postMessageSync(LISTENER_CMDS.GET_APP_VARIABLE, args);
|
|
665
|
-
}
|
|
666
|
-
set(key, value, path) {
|
|
667
|
-
let args = {
|
|
668
|
-
key,
|
|
669
|
-
value,
|
|
670
|
-
path
|
|
671
|
-
};
|
|
672
|
-
return this._postMessageSync(LISTENER_CMDS.SET_APP_VARIABLE, args);
|
|
621
|
+
getBoard(flowId) {
|
|
622
|
+
return new Board(flowId);
|
|
673
623
|
}
|
|
674
624
|
}
|
|
675
625
|
class NDEFReader extends BaseSDK {
|
|
@@ -78,7 +78,8 @@ const LISTENER_CMDS = {
|
|
|
78
78
|
WINDOW_NDEF_READER_MAKE_READONLY: "WINDOW_NDEF_READER_MAKE_READONLY",
|
|
79
79
|
WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
|
|
80
80
|
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
|
|
81
|
-
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV"
|
|
81
|
+
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
|
|
82
|
+
BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
|
|
82
83
|
};
|
|
83
84
|
function generateId(prefix = "lcncsdk") {
|
|
84
85
|
return `${prefix}-${nanoid()}`;
|
|
@@ -171,7 +172,7 @@ class BaseSDK extends EventBase {
|
|
|
171
172
|
postMessage({ _id, command, ...args });
|
|
172
173
|
globalInstances[_id] = this;
|
|
173
174
|
this._addEventListener(_id, async (data) => {
|
|
174
|
-
if (data == null ? void 0 : data.errorMessage) {
|
|
175
|
+
if ((data == null ? void 0 : data.errorMessage) || (data == null ? void 0 : data.isError)) {
|
|
175
176
|
reject(data);
|
|
176
177
|
} else {
|
|
177
178
|
if (hasCallBack && callBack) {
|
package/dist/kfsdk.es.js
CHANGED
|
@@ -82,7 +82,8 @@ const LISTENER_CMDS = {
|
|
|
82
82
|
WINDOW_NDEF_READER_MAKE_READONLY: "WINDOW_NDEF_READER_MAKE_READONLY",
|
|
83
83
|
WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
|
|
84
84
|
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
|
|
85
|
-
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV"
|
|
85
|
+
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
|
|
86
|
+
BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
|
|
86
87
|
};
|
|
87
88
|
const EVENT_TYPES = {
|
|
88
89
|
COMPONENT_ON_MOUNT: "componentOnMount",
|
|
@@ -182,7 +183,7 @@ class BaseSDK extends EventBase {
|
|
|
182
183
|
postMessage({ _id, command, ...args });
|
|
183
184
|
globalInstances[_id] = this;
|
|
184
185
|
this._addEventListener(_id, async (data) => {
|
|
185
|
-
if (data == null ? void 0 : data.errorMessage) {
|
|
186
|
+
if ((data == null ? void 0 : data.errorMessage) || (data == null ? void 0 : data.isError)) {
|
|
186
187
|
reject(data);
|
|
187
188
|
} else {
|
|
188
189
|
if (hasCallBack && callBack) {
|
|
@@ -306,28 +307,6 @@ class Formatter extends BaseSDK {
|
|
|
306
307
|
});
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
|
-
const isObject = (value) => value !== null && typeof value === "object";
|
|
310
|
-
class CreateProxy {
|
|
311
|
-
constructor(parent, target = {}, path = []) {
|
|
312
|
-
this.parent = parent;
|
|
313
|
-
this.path = path;
|
|
314
|
-
return new Proxy(target, this);
|
|
315
|
-
}
|
|
316
|
-
get(target, property) {
|
|
317
|
-
let value = this.parent.get(property, this.path);
|
|
318
|
-
if (isObject(value)) {
|
|
319
|
-
return new CreateProxy(this.parent, value, [...this.path, property]);
|
|
320
|
-
}
|
|
321
|
-
return value;
|
|
322
|
-
}
|
|
323
|
-
set(target, property, value, reciever) {
|
|
324
|
-
let updatedValue = this.parent.set(property, value, this.path);
|
|
325
|
-
if (isObject(updatedValue)) {
|
|
326
|
-
return new CreateProxy(this.parent, updatedValue, [...this.path, property]);
|
|
327
|
-
}
|
|
328
|
-
return updatedValue;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
310
|
class Component extends BaseSDK {
|
|
332
311
|
constructor(props) {
|
|
333
312
|
super();
|
|
@@ -442,12 +421,11 @@ class Popup extends BaseSDK {
|
|
|
442
421
|
}
|
|
443
422
|
}
|
|
444
423
|
class Page extends BaseSDK {
|
|
445
|
-
constructor(props) {
|
|
424
|
+
constructor(props, isCustomComponent = false) {
|
|
446
425
|
super();
|
|
447
426
|
this.type = "Page";
|
|
448
427
|
this.popup = new Popup({});
|
|
449
428
|
this._id = props.pageId;
|
|
450
|
-
this.variable = new PageVariable();
|
|
451
429
|
}
|
|
452
430
|
getParameter(key) {
|
|
453
431
|
return this._postMessageAsync(LISTENER_CMDS.GET_PAGE_PARAMS, {
|
|
@@ -485,27 +463,6 @@ class Page extends BaseSDK {
|
|
|
485
463
|
);
|
|
486
464
|
}
|
|
487
465
|
}
|
|
488
|
-
class PageVariable extends BaseSDK {
|
|
489
|
-
constructor() {
|
|
490
|
-
super();
|
|
491
|
-
return new CreateProxy(this);
|
|
492
|
-
}
|
|
493
|
-
get(key, path) {
|
|
494
|
-
let args = {
|
|
495
|
-
key,
|
|
496
|
-
path
|
|
497
|
-
};
|
|
498
|
-
return this._postMessageSync(LISTENER_CMDS.GET_PAGE_VARIABLE, args);
|
|
499
|
-
}
|
|
500
|
-
set(key, value, path) {
|
|
501
|
-
let args = {
|
|
502
|
-
key,
|
|
503
|
-
value,
|
|
504
|
-
path
|
|
505
|
-
};
|
|
506
|
-
return this._postMessageSync(LISTENER_CMDS.SET_PAGE_VARIABLE, args);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
466
|
class DecisionTable extends BaseSDK {
|
|
510
467
|
constructor(flowId) {
|
|
511
468
|
super();
|
|
@@ -530,12 +487,23 @@ class Dataform extends BaseSDK {
|
|
|
530
487
|
});
|
|
531
488
|
}
|
|
532
489
|
}
|
|
490
|
+
class Board extends BaseSDK {
|
|
491
|
+
constructor(flowId) {
|
|
492
|
+
super();
|
|
493
|
+
this._id = flowId;
|
|
494
|
+
}
|
|
495
|
+
importCSV(defaultValues) {
|
|
496
|
+
return this._postMessageAsync(LISTENER_CMDS.BOARD_IMPORT_CSV, {
|
|
497
|
+
flowId: this._id,
|
|
498
|
+
defaultValues
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
533
502
|
class Application extends BaseSDK {
|
|
534
|
-
constructor(props) {
|
|
503
|
+
constructor(props, isCustomComponent = false) {
|
|
535
504
|
super();
|
|
536
505
|
this._id = props.appId;
|
|
537
506
|
this.page = new Page(props);
|
|
538
|
-
this.variable = new AppVariable();
|
|
539
507
|
}
|
|
540
508
|
getVariable(key) {
|
|
541
509
|
return this._postMessageAsync(LISTENER_CMDS.GET_APP_VARIABLE, {
|
|
@@ -560,26 +528,8 @@ class Application extends BaseSDK {
|
|
|
560
528
|
getDataform(flowId) {
|
|
561
529
|
return new Dataform(flowId);
|
|
562
530
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
constructor() {
|
|
566
|
-
super();
|
|
567
|
-
return new CreateProxy(this);
|
|
568
|
-
}
|
|
569
|
-
get(key, path) {
|
|
570
|
-
let args = {
|
|
571
|
-
key,
|
|
572
|
-
path
|
|
573
|
-
};
|
|
574
|
-
return this._postMessageSync(LISTENER_CMDS.GET_APP_VARIABLE, args);
|
|
575
|
-
}
|
|
576
|
-
set(key, value, path) {
|
|
577
|
-
let args = {
|
|
578
|
-
key,
|
|
579
|
-
value,
|
|
580
|
-
path
|
|
581
|
-
};
|
|
582
|
-
return this._postMessageSync(LISTENER_CMDS.SET_APP_VARIABLE, args);
|
|
531
|
+
getBoard(flowId) {
|
|
532
|
+
return new Board(flowId);
|
|
583
533
|
}
|
|
584
534
|
}
|
|
585
535
|
class CustomComponentSDK extends BaseSDK {
|
|
@@ -600,8 +550,8 @@ class CustomComponentSDK extends BaseSDK {
|
|
|
600
550
|
{},
|
|
601
551
|
true,
|
|
602
552
|
(data) => {
|
|
603
|
-
this.app = new Application(data);
|
|
604
|
-
this.page = new Page(data);
|
|
553
|
+
this.app = new Application(data, true);
|
|
554
|
+
this.page = new Page(data, true);
|
|
605
555
|
this.context = new CustomComponent(data.componentId);
|
|
606
556
|
this.client = new Client();
|
|
607
557
|
this.formatter = new Formatter();
|
package/dist/kfsdk.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=(i,s,E)=>{if(!s.has(i))throw TypeError("Cannot "+E)};var a=(i,s,E)=>(S(i,s,"read from private field"),E?E.call(i):s.get(i)),N=(i,s,E)=>{if(s.has(i))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(i):s.set(i,E)},D=(i,s,E,M)=>(S(i,s,"write to private field"),M?M.call(i,E):s.set(i,E),E);var m=(i,s,E)=>(S(i,s,"access private method"),E);(function(i,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis!="undefined"?globalThis:i||self,i.kf=s())})(this,function(){var o,R,l,d,w;"use strict";let i=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");const s={API:"API",GET_CONTEXT:"GET_CONTEXT",RETURN:"RETURN",GET_FORM_FIELD:"GET_FORM_FIELD",UPDATE_FORM:"UPDATE_FORM",GET_TABLE:"GET_TABLE",GET_TABLE_ROW:"GET_TABLE_ROW",ADD_TABLE_ROW:"ADD_TABLE_ROW",ADD_TABLE_ROWS:"ADD_TABLE_ROWS",DELETE_TABLE_ROW:"DELETE_TABLE_ROW",TO_JSON:"TO_JSON",GET_TABLE_ROWS:"GET_TABLE_ROWS",MESSAGE:"MESSAGE",CONFIRM:"CONFIRM",ALERT:"ALERT",REDIRECT:"REDIRECT",OPEN_PAGE:"OPEN_PAGE",FORMAT_DATE:"FORMAT_DATE",FORMAT_DATE_TIME:"FORMAT_DATE_TIME",FORMAT_NUMBER:"FORMAT_NUMBER",FORMAT_CURRENCY:"FORMAT_CURRENCY",FORMAT_BOOLEAN:"FORMAT_BOOLEAN",GET_APP_VARIABLE:"GET_APP_VARIABLE",SET_APP_VARIABLE:"SET_APP_VARIABLE",GET_PAGE_VARIABLE:"GET_PAGE_VARIABLE",SET_PAGE_VARIABLE:"SET_PAGE_VARIABLE",GET_PAGE_PARAMS:"GET_PAGE_PARAMS",GET_ALL_PAGE_PARAMS:"GET_ALL_PAGE_PARAMS",PAGE_ON_CLOSE:"PAGE_ON_CLOSE",OPEN_POPUP:"OPEN_POPUP",GET_POPUP_PARAMS:"GET_POPUP_PARAMS",GET_ALL_POPUP_PARAMS:"GET_ALL_POPUP_PARAMS",CLOSE_POPUP:"CLOSE_POPUP",COMPONENT_GET:"COMPONENT_GET",COMPONENT_REFRESH:"COMPONENT_REFRESH",COMPONENT_SHOW:"COMPONENT_SHOW",COMPONENT_HIDE:"COMPONENT_HIDE",COMPONENT_ADD_EVENT_LISTENER:"COMPONENT_ADD_EVENT_LISTENER",CC_INITIALIZE:"CC_INITIALIZE",CC_WATCH_PARAMS:"CC_WATCH_PARAMS",WINDOW_NDEF_READER_NEW:"WINDOW_NDEF_READER_NEW",WINDOW_NDEF_READER_SCAN:"WINDOW_NDEF_READER_SCAN",WINDOW_NDEF_READER_WRITE:"WINDOW_NDEF_READER_WRITE",WINDOW_NDEF_READER_ADD_EVENT_LISTENER:"WINDOW_NDEF_READER_ADD_EVENT_LISTENER",WINDOW_NDEF_READER_MAKE_READONLY:"WINDOW_NDEF_READER_MAKE_READONLY",WINDOW_NDEF_READER_ABORT_SCAN:"WINDOW_NDEF_READER_ABORT_SCAN",DECISION_TABLE_EXECUTE:"DECISION_TABLE_EXECUTE",DATAFORM_IMPORT_CSV:"DATAFORM_IMPORT_CSV"},E={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},M={POPUP_ID:"ACTIVE_POP_UP"};function g(r="lcncsdk"){return`${r}-${i()}`}const P={};function L(r,e){if(e&&Object.keys(e).length===1&&r.command!==s.API){let t=Object.values(e)[0];return t==="undefined"?void 0:t}else return e}function C(r){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(r,"*"):globalThis.postMessage(r)}function F(r){if(r.origin!==globalThis.location.origin){const e=r.data;if(e!=null&&e.isEvent){const{target:_,eventParams:A,eventName:c,eventConfig:O={}}=e;let h=P[_];h._dispatchEvent(c,A),O.once&&h._removeEventListener(c);return}let{_req:t,resp:n}=e;t!=null&&t._id&&P[t._id]._dispatchMessageEvents(t,n)}}globalThis.addEventListener("message",F);class W{constructor(){N(this,o,void 0);D(this,o,{})}_addEventListener(e,t){var n;a(this,o)[e]=((n=a(this,o))==null?void 0:n[e])||[],a(this,o)[e].push(t)}_removeEventListener(e,t){if(t){let n=a(this,o)[e].findIndex(t);n>-1&&a(this,o)[e].splice(n,1);return}Reflect.deleteProperty(a(this,o),e)}_dispatchEvent(e,t){return Array.isArray(a(this,o)[e])?(a(this,o)[e].forEach(n=>n(t)),!0):!1}_dispatchMessageEvents(e,t){let n=e._id;Array.isArray(a(this,o)[n])&&(a(this,o)[n].forEach(_=>{try{let A=L(e,t);_(A)}catch(A){console.error("Message callback error: ",A)}}),this._removeEventListener(n))}}o=new WeakMap;class T extends W{_postMessageAsync(e,t,n,_){return new Promise((A,c)=>{const O=g(e.toLowerCase());C({_id:O,command:e,...t}),P[O]=this,this._addEventListener(O,async h=>{h!=null&&h.errorMessage?c(h):(n&&_&&(h=await _(h)),A(h))})})}_postMessage(e,t,n){const _=g(e.toLowerCase());C({_id:_,command:e,...t}),n&&this._addEventListener(t.eventName,n)}_postMessageSync(e,t){let n=0,A={_id:g(e.toLowerCase()),command:e,...t},c=new B;c.reset(),c.store(0,n),c.encodeData(1,A),C(c.sab),c.wait(0,n,1e4);let O=c.decodeData(),{_req:h,resp:X}=O,p=L(h,X);if(p!=null&&p.isError)throw new Error(`Error: ${JSON.stringify(p,null,2)}`);return p}}let I;class B{constructor(){N(this,R,void 0);N(this,l,void 0);D(this,R,new TextEncoder),D(this,l,new TextDecoder),I=I||new SharedArrayBuffer(1024*1024),this.sab=I,this.int32Array=new Int32Array(this.sab)}load(e=0){return Atomics.load(this.int32Array,e)}store(e=0,t){return Atomics.store(this.int32Array,e,t)}reset(){return this.int32Array.fill(0)}notify(e=0,t=1){return Atomics.notify(this.int32Array,e,t)}wait(e,t,n){return Atomics.wait(this.int32Array,e,t,n)}encodeData(e=0,t){const n=(c,O)=>O===void 0?"undefined":O;let _=JSON.stringify(t,n),A=a(this,R).encode(_);return this.int32Array.set(A,e),this.int32Array}decodeData(){let e=new Uint8Array(this.int32Array),t=a(this,l).decode(e).replaceAll(/\x00/g,"");return JSON.parse(t)}}R=new WeakMap,l=new WeakMap;class V extends T{showInfo(e){return super._postMessageAsync(s.MESSAGE,{message:e})}showConfirm(e){return super._postMessageAsync(s.CONFIRM,{data:{title:e.title,content:e.content,okText:e.okText||"Ok",cancelText:e.cancelText||"Cancel"}})}redirect(e){return super._postMessageAsync(s.REDIRECT,{url:e})}}class U extends T{toDate(e){return this._postMessageAsync(s.FORMAT_DATE,{date:e})}toDateTime(e){return this._postMessageAsync(s.FORMAT_DATE_TIME,{date:e})}toNumber(e){return this._postMessageAsync(s.FORMAT_NUMBER,{value:e})}toCurrency(e,t){return this._postMessageAsync(s.FORMAT_CURRENCY,{value:e,currencyCode:t})}toBoolean(e){return this._postMessageAsync(s.FORMAT_BOOLEAN,{value:e})}}const f=r=>r!==null&&typeof r=="object";class u{constructor(e,t={},n=[]){return this.parent=e,this.path=n,new Proxy(t,this)}get(e,t){let n=this.parent.get(t,this.path);return f(n)?new u(this.parent,n,[...this.path,t]):n}set(e,t,n,_){let A=this.parent.set(t,n,this.path);return f(A)?new u(this.parent,A,[...this.path,t]):A}}class y extends T{constructor(t){super();N(this,d);this._id=t.componentId,this.type="Component",P[this._id]=this,m(this,d,w).call(this,t.componentMethods)}onMount(t){this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:E.COMPONENT_ON_MOUNT,eventConfig:{once:!0}},t)}refresh(){return this._postMessageAsync(s.COMPONENT_REFRESH,{id:this._id})}show(){return this._postMessageAsync(s.COMPONENT_SHOW,{id:this._id})}hide(){return this._postMessageAsync(s.COMPONENT_HIDE,{id:this._id})}}d=new WeakSet,w=function(t){t==null||t.forEach(n=>{this[n.name]=(..._)=>{if(n.type==="method")return this._postMessageAsync(`COMPONENT_${n.name}`,{id:this._id,parameters:_});n.type==="event"&&this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:n.name,eventConfig:_[1]},_[0])}})};class v extends T{constructor(e){super(),this._id=e,this.type="CustomComponent",P[this._id]=this}watchParams(e){this._postMessage(s.CC_WATCH_PARAMS,{id:this._id,eventName:E.CC_ON_PARAMS_CHANGE,eventConfig:{once:!1}},e)}}class x extends T{constructor(e){super(),this.type="Popup",this._id=e.popupId||M.POPUP_ID}getParameter(e){return this._postMessageAsync(s.GET_POPUP_PARAMS,{key:e,popupId:this._id})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_POPUP_PARAMS,{popupId:this._id})}close(){return this._postMessageAsync(s.CLOSE_POPUP,{})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new y(t))}}class G extends T{constructor(e){super(),this.type="Page",this.popup=new x({}),this._id=e.pageId,this.variable=new b}getParameter(e){return this._postMessageAsync(s.GET_PAGE_PARAMS,{key:e})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_PAGE_PARAMS,{pageId:this._id})}getVariable(e){return this._postMessageAsync(s.GET_PAGE_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_PAGE_VARIABLE,{key:e,value:t})}openPopup(e,t){return this._postMessageAsync(s.OPEN_POPUP,{popupId:e,popupParams:t})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new y(t))}}class b extends T{constructor(){return super(),new u(this)}get(e,t){let n={key:e,path:t};return this._postMessageSync(s.GET_PAGE_VARIABLE,n)}set(e,t,n){let _={key:e,value:t,path:n};return this._postMessageSync(s.SET_PAGE_VARIABLE,_)}}class H extends T{constructor(e){super(),this.flowId=e}evaluate(e){return this._postMessageAsync(s.DECISION_TABLE_EXECUTE,{flowId:this.flowId,payload:e})}}class j extends T{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.DATAFORM_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class K extends T{constructor(e){super(),this._id=e.appId,this.page=new G(e),this.variable=new Y}getVariable(e){return this._postMessageAsync(s.GET_APP_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_APP_VARIABLE,{key:e,value:t})}openPage(e,t){return this._postMessageAsync(s.OPEN_PAGE,{pageId:e,pageParams:t})}getDecisionTable(e){return new H(e)}getDataform(e){return new j(e)}}class Y extends T{constructor(){return super(),new u(this)}get(e,t){let n={key:e,path:t};return this._postMessageSync(s.GET_APP_VARIABLE,n)}set(e,t,n){let _={key:e,value:t,path:n};return this._postMessageSync(s.SET_APP_VARIABLE,_)}}class k extends T{constructor(){super()}api(e,t={}){return this._postMessageAsync(s.API,{url:e,args:t})}initialize(){return globalThis.parent&&globalThis.parent===globalThis?Promise.reject("SDK can be initialized only inside the Kissflow platform."):this._postMessageAsync(s.CC_INITIALIZE,{},!0,e=>(this.app=new K(e),this.page=new G(e),this.context=new v(e.componentId),this.client=new V,this.formatter=new U,this.user=e.user,this.account=e.account,this.env=e.envDetails,this))}initialise(){return this.initialize()}}var J=new k;return J});
|
|
1
|
+
var g=(_,s,E)=>{if(!s.has(_))throw TypeError("Cannot "+E)};var a=(_,s,E)=>(g(_,s,"read from private field"),E?E.call(_):s.get(_)),M=(_,s,E)=>{if(s.has(_))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(_):s.set(_,E)},C=(_,s,E,l)=>(g(_,s,"write to private field"),l?l.call(_,E):s.set(_,E),E);var y=(_,s,E)=>(g(_,s,"access private method"),E);(function(_,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(_=typeof globalThis!="undefined"?globalThis:_||self,_.kf=s())})(this,function(){var A,h,u,p,G;"use strict";let _=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");const s={API:"API",GET_CONTEXT:"GET_CONTEXT",RETURN:"RETURN",GET_FORM_FIELD:"GET_FORM_FIELD",UPDATE_FORM:"UPDATE_FORM",GET_TABLE:"GET_TABLE",GET_TABLE_ROW:"GET_TABLE_ROW",ADD_TABLE_ROW:"ADD_TABLE_ROW",ADD_TABLE_ROWS:"ADD_TABLE_ROWS",DELETE_TABLE_ROW:"DELETE_TABLE_ROW",TO_JSON:"TO_JSON",GET_TABLE_ROWS:"GET_TABLE_ROWS",MESSAGE:"MESSAGE",CONFIRM:"CONFIRM",ALERT:"ALERT",REDIRECT:"REDIRECT",OPEN_PAGE:"OPEN_PAGE",FORMAT_DATE:"FORMAT_DATE",FORMAT_DATE_TIME:"FORMAT_DATE_TIME",FORMAT_NUMBER:"FORMAT_NUMBER",FORMAT_CURRENCY:"FORMAT_CURRENCY",FORMAT_BOOLEAN:"FORMAT_BOOLEAN",GET_APP_VARIABLE:"GET_APP_VARIABLE",SET_APP_VARIABLE:"SET_APP_VARIABLE",GET_PAGE_VARIABLE:"GET_PAGE_VARIABLE",SET_PAGE_VARIABLE:"SET_PAGE_VARIABLE",GET_PAGE_PARAMS:"GET_PAGE_PARAMS",GET_ALL_PAGE_PARAMS:"GET_ALL_PAGE_PARAMS",PAGE_ON_CLOSE:"PAGE_ON_CLOSE",OPEN_POPUP:"OPEN_POPUP",GET_POPUP_PARAMS:"GET_POPUP_PARAMS",GET_ALL_POPUP_PARAMS:"GET_ALL_POPUP_PARAMS",CLOSE_POPUP:"CLOSE_POPUP",COMPONENT_GET:"COMPONENT_GET",COMPONENT_REFRESH:"COMPONENT_REFRESH",COMPONENT_SHOW:"COMPONENT_SHOW",COMPONENT_HIDE:"COMPONENT_HIDE",COMPONENT_ADD_EVENT_LISTENER:"COMPONENT_ADD_EVENT_LISTENER",CC_INITIALIZE:"CC_INITIALIZE",CC_WATCH_PARAMS:"CC_WATCH_PARAMS",WINDOW_NDEF_READER_NEW:"WINDOW_NDEF_READER_NEW",WINDOW_NDEF_READER_SCAN:"WINDOW_NDEF_READER_SCAN",WINDOW_NDEF_READER_WRITE:"WINDOW_NDEF_READER_WRITE",WINDOW_NDEF_READER_ADD_EVENT_LISTENER:"WINDOW_NDEF_READER_ADD_EVENT_LISTENER",WINDOW_NDEF_READER_MAKE_READONLY:"WINDOW_NDEF_READER_MAKE_READONLY",WINDOW_NDEF_READER_ABORT_SCAN:"WINDOW_NDEF_READER_ABORT_SCAN",DECISION_TABLE_EXECUTE:"DECISION_TABLE_EXECUTE",DATAFORM_IMPORT_CSV:"DATAFORM_IMPORT_CSV",BOARD_IMPORT_CSV:"BOARD_IMPORT_CSV"},E={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},l={POPUP_ID:"ACTIVE_POP_UP"};function d(r="lcncsdk"){return`${r}-${_()}`}const R={};function S(r,e){if(e&&Object.keys(e).length===1&&r.command!==s.API){let t=Object.values(e)[0];return t==="undefined"?void 0:t}else return e}function D(r){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(r,"*"):globalThis.postMessage(r)}function m(r){if(r.origin!==globalThis.location.origin){const e=r.data;if(e!=null&&e.isEvent){const{target:i,eventParams:c,eventName:T,eventConfig:P={}}=e;let o=R[i];o._dispatchEvent(T,c),P.once&&o._removeEventListener(T);return}let{_req:t,resp:n}=e;t!=null&&t._id&&R[t._id]._dispatchMessageEvents(t,n)}}globalThis.addEventListener("message",m);class F{constructor(){M(this,A,void 0);C(this,A,{})}_addEventListener(e,t){var n;a(this,A)[e]=((n=a(this,A))==null?void 0:n[e])||[],a(this,A)[e].push(t)}_removeEventListener(e,t){if(t){let n=a(this,A)[e].findIndex(t);n>-1&&a(this,A)[e].splice(n,1);return}Reflect.deleteProperty(a(this,A),e)}_dispatchEvent(e,t){return Array.isArray(a(this,A)[e])?(a(this,A)[e].forEach(n=>n(t)),!0):!1}_dispatchMessageEvents(e,t){let n=e._id;Array.isArray(a(this,A)[n])&&(a(this,A)[n].forEach(i=>{try{let c=S(e,t);i(c)}catch(c){console.error("Message callback error: ",c)}}),this._removeEventListener(n))}}A=new WeakMap;class O extends F{_postMessageAsync(e,t,n,i){return new Promise((c,T)=>{const P=d(e.toLowerCase());D({_id:P,command:e,...t}),R[P]=this,this._addEventListener(P,async o=>{(o==null?void 0:o.errorMessage)||(o==null?void 0:o.isError)?T(o):(n&&i&&(o=await i(o)),c(o))})})}_postMessage(e,t,n){const i=d(e.toLowerCase());D({_id:i,command:e,...t}),n&&this._addEventListener(t.eventName,n)}_postMessageSync(e,t){let n=0,c={_id:d(e.toLowerCase()),command:e,...t},T=new W;T.reset(),T.store(0,n),T.encodeData(1,c),D(T.sab),T.wait(0,n,1e4);let P=T.decodeData(),{_req:o,resp:k}=P,N=S(o,k);if(N!=null&&N.isError)throw new Error(`Error: ${JSON.stringify(N,null,2)}`);return N}}let I;class W{constructor(){M(this,h,void 0);M(this,u,void 0);C(this,h,new TextEncoder),C(this,u,new TextDecoder),I=I||new SharedArrayBuffer(1024*1024),this.sab=I,this.int32Array=new Int32Array(this.sab)}load(e=0){return Atomics.load(this.int32Array,e)}store(e=0,t){return Atomics.store(this.int32Array,e,t)}reset(){return this.int32Array.fill(0)}notify(e=0,t=1){return Atomics.notify(this.int32Array,e,t)}wait(e,t,n){return Atomics.wait(this.int32Array,e,t,n)}encodeData(e=0,t){const n=(T,P)=>P===void 0?"undefined":P;let i=JSON.stringify(t,n),c=a(this,h).encode(i);return this.int32Array.set(c,e),this.int32Array}decodeData(){let e=new Uint8Array(this.int32Array),t=a(this,u).decode(e).replaceAll(/\x00/g,"");return JSON.parse(t)}}h=new WeakMap,u=new WeakMap;class B extends O{showInfo(e){return super._postMessageAsync(s.MESSAGE,{message:e})}showConfirm(e){return super._postMessageAsync(s.CONFIRM,{data:{title:e.title,content:e.content,okText:e.okText||"Ok",cancelText:e.cancelText||"Cancel"}})}redirect(e){return super._postMessageAsync(s.REDIRECT,{url:e})}}class w extends O{toDate(e){return this._postMessageAsync(s.FORMAT_DATE,{date:e})}toDateTime(e){return this._postMessageAsync(s.FORMAT_DATE_TIME,{date:e})}toNumber(e){return this._postMessageAsync(s.FORMAT_NUMBER,{value:e})}toCurrency(e,t){return this._postMessageAsync(s.FORMAT_CURRENCY,{value:e,currencyCode:t})}toBoolean(e){return this._postMessageAsync(s.FORMAT_BOOLEAN,{value:e})}}class L extends O{constructor(t){super();M(this,p);this._id=t.componentId,this.type="Component",R[this._id]=this,y(this,p,G).call(this,t.componentMethods)}onMount(t){this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:E.COMPONENT_ON_MOUNT,eventConfig:{once:!0}},t)}refresh(){return this._postMessageAsync(s.COMPONENT_REFRESH,{id:this._id})}show(){return this._postMessageAsync(s.COMPONENT_SHOW,{id:this._id})}hide(){return this._postMessageAsync(s.COMPONENT_HIDE,{id:this._id})}}p=new WeakSet,G=function(t){t==null||t.forEach(n=>{this[n.name]=(...i)=>{if(n.type==="method")return this._postMessageAsync(`COMPONENT_${n.name}`,{id:this._id,parameters:i});n.type==="event"&&this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:n.name,eventConfig:i[1]},i[0])}})};class U extends O{constructor(e){super(),this._id=e,this.type="CustomComponent",R[this._id]=this}watchParams(e){this._postMessage(s.CC_WATCH_PARAMS,{id:this._id,eventName:E.CC_ON_PARAMS_CHANGE,eventConfig:{once:!1}},e)}}class V extends O{constructor(e){super(),this.type="Popup",this._id=e.popupId||l.POPUP_ID}getParameter(e){return this._postMessageAsync(s.GET_POPUP_PARAMS,{key:e,popupId:this._id})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_POPUP_PARAMS,{popupId:this._id})}close(){return this._postMessageAsync(s.CLOSE_POPUP,{})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new L(t))}}class f extends O{constructor(e,t=!1){super(),this.type="Page",this.popup=new V({}),this._id=e.pageId}getParameter(e){return this._postMessageAsync(s.GET_PAGE_PARAMS,{key:e})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_PAGE_PARAMS,{pageId:this._id})}getVariable(e){return this._postMessageAsync(s.GET_PAGE_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_PAGE_VARIABLE,{key:e,value:t})}openPopup(e,t){return this._postMessageAsync(s.OPEN_POPUP,{popupId:e,popupParams:t})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new L(t))}}class v extends O{constructor(e){super(),this.flowId=e}evaluate(e){return this._postMessageAsync(s.DECISION_TABLE_EXECUTE,{flowId:this.flowId,payload:e})}}class x extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.DATAFORM_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class b extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.BOARD_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class H extends O{constructor(e,t=!1){super(),this._id=e.appId,this.page=new f(e)}getVariable(e){return this._postMessageAsync(s.GET_APP_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_APP_VARIABLE,{key:e,value:t})}openPage(e,t){return this._postMessageAsync(s.OPEN_PAGE,{pageId:e,pageParams:t})}getDecisionTable(e){return new v(e)}getDataform(e){return new x(e)}getBoard(e){return new b(e)}}class K extends O{constructor(){super()}api(e,t={}){return this._postMessageAsync(s.API,{url:e,args:t})}initialize(){return globalThis.parent&&globalThis.parent===globalThis?Promise.reject("SDK can be initialized only inside the Kissflow platform."):this._postMessageAsync(s.CC_INITIALIZE,{},!0,e=>(this.app=new H(e,!0),this.page=new f(e,!0),this.context=new U(e.componentId),this.client=new B,this.formatter=new w,this.user=e.user,this.account=e.account,this.env=e.envDetails,this))}initialise(){return this.initialize()}}var Y=new K;return Y});
|
package/dist/lowcode.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ declare module "core/constants" {
|
|
|
48
48
|
WINDOW_NDEF_READER_ABORT_SCAN: string;
|
|
49
49
|
DECISION_TABLE_EXECUTE: string;
|
|
50
50
|
DATAFORM_IMPORT_CSV: string;
|
|
51
|
+
BOARD_IMPORT_CSV: string;
|
|
51
52
|
};
|
|
52
53
|
export const EVENT_TYPES: {
|
|
53
54
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -240,8 +241,7 @@ declare module "app/page" {
|
|
|
240
241
|
_id: string;
|
|
241
242
|
popup: Popup;
|
|
242
243
|
type: string;
|
|
243
|
-
|
|
244
|
-
constructor(props: PageContext);
|
|
244
|
+
constructor(props: PageContext, isCustomComponent?: boolean);
|
|
245
245
|
getParameter(key: string): any;
|
|
246
246
|
getAllParameters(): any;
|
|
247
247
|
getVariable(key: string): any;
|
|
@@ -249,11 +249,6 @@ declare module "app/page" {
|
|
|
249
249
|
openPopup(popupId: string, popupParams: object): any;
|
|
250
250
|
getComponent(componentId: string): Component;
|
|
251
251
|
}
|
|
252
|
-
class PageVariable extends BaseSDK {
|
|
253
|
-
constructor();
|
|
254
|
-
get(key: any, path: any): any;
|
|
255
|
-
set(key: any, value: any, path: any): any;
|
|
256
|
-
}
|
|
257
252
|
}
|
|
258
253
|
declare module "app/decisiontable" {
|
|
259
254
|
import { BaseSDK } from "core/index";
|
|
@@ -271,27 +266,31 @@ declare module "app/dataform" {
|
|
|
271
266
|
importCSV(defaultValues: object): any;
|
|
272
267
|
}
|
|
273
268
|
}
|
|
269
|
+
declare module "board/index" {
|
|
270
|
+
import { BaseSDK } from "core/index";
|
|
271
|
+
export class Board extends BaseSDK {
|
|
272
|
+
private _id;
|
|
273
|
+
constructor(flowId: string);
|
|
274
|
+
importCSV(defaultValues: object): any;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
274
277
|
declare module "app/index" {
|
|
275
278
|
import { BaseSDK } from "core/index";
|
|
276
279
|
import { Page } from "app/page";
|
|
277
280
|
import { AppContext } from "types/internal";
|
|
278
281
|
import { DecisionTable } from "app/decisiontable";
|
|
279
282
|
import { Dataform } from "app/dataform";
|
|
283
|
+
import { Board } from "board/index";
|
|
280
284
|
export class Application extends BaseSDK {
|
|
281
285
|
page: Page;
|
|
282
|
-
variable: AppVariable;
|
|
283
286
|
_id: string;
|
|
284
|
-
constructor(props: AppContext);
|
|
287
|
+
constructor(props: AppContext, isCustomComponent?: boolean);
|
|
285
288
|
getVariable(key: string): any;
|
|
286
289
|
setVariable(key: string | object, value?: any): any;
|
|
287
290
|
openPage(pageId: string, pageParams: object): any;
|
|
288
291
|
getDecisionTable(flowId: string): DecisionTable;
|
|
289
292
|
getDataform(flowId: string): Dataform;
|
|
290
|
-
|
|
291
|
-
class AppVariable extends BaseSDK {
|
|
292
|
-
constructor();
|
|
293
|
-
get(key: any, path: any): any;
|
|
294
|
-
set(key: any, value: any, path: any): any;
|
|
293
|
+
getBoard(flowId: string): Board;
|
|
295
294
|
}
|
|
296
295
|
export * from "app/component";
|
|
297
296
|
export { Page };
|
package/dist/lowcode.types.d.ts
CHANGED
|
@@ -59,7 +59,6 @@ declare class Page {
|
|
|
59
59
|
_id: string
|
|
60
60
|
popup: Popup
|
|
61
61
|
type: string
|
|
62
|
-
variable: PageVariable
|
|
63
62
|
getParameter(key: string): any;
|
|
64
63
|
getAllParameters(): any;
|
|
65
64
|
getVariable(key: string): any;
|
|
@@ -75,13 +74,13 @@ declare class Dataform {
|
|
|
75
74
|
}
|
|
76
75
|
declare class Application {
|
|
77
76
|
page: Page
|
|
78
|
-
variable: AppVariable
|
|
79
77
|
_id: string
|
|
80
78
|
getVariable(key: string): any;
|
|
81
79
|
setVariable(key: string | object, value?: any): any;
|
|
82
80
|
openPage(pageId: string, pageParams: object): any;
|
|
83
81
|
getDecisionTable(flowId: string): DecisionTable;
|
|
84
82
|
getDataform(flowId: string): Dataform;
|
|
83
|
+
getBoard(flowId: string): Board;
|
|
85
84
|
}
|
|
86
85
|
declare class kf {
|
|
87
86
|
static context: Component
|
package/dist/nocode.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ declare module "core/constants" {
|
|
|
48
48
|
WINDOW_NDEF_READER_ABORT_SCAN: string;
|
|
49
49
|
DECISION_TABLE_EXECUTE: string;
|
|
50
50
|
DATAFORM_IMPORT_CSV: string;
|
|
51
|
+
BOARD_IMPORT_CSV: string;
|
|
51
52
|
};
|
|
52
53
|
export const EVENT_TYPES: {
|
|
53
54
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -296,8 +297,7 @@ declare module "app/page" {
|
|
|
296
297
|
_id: string;
|
|
297
298
|
popup: Popup;
|
|
298
299
|
type: string;
|
|
299
|
-
|
|
300
|
-
constructor(props: PageContext);
|
|
300
|
+
constructor(props: PageContext, isCustomComponent?: boolean);
|
|
301
301
|
getParameter(key: string): any;
|
|
302
302
|
getAllParameters(): any;
|
|
303
303
|
getVariable(key: string): any;
|
|
@@ -305,10 +305,13 @@ declare module "app/page" {
|
|
|
305
305
|
openPopup(popupId: string, popupParams: object): any;
|
|
306
306
|
getComponent(componentId: string): Component;
|
|
307
307
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
308
|
+
}
|
|
309
|
+
declare module "board/index" {
|
|
310
|
+
import { BaseSDK } from "core/index";
|
|
311
|
+
export class Board extends BaseSDK {
|
|
312
|
+
private _id;
|
|
313
|
+
constructor(flowId: string);
|
|
314
|
+
importCSV(defaultValues: object): any;
|
|
312
315
|
}
|
|
313
316
|
}
|
|
314
317
|
declare module "app/index" {
|
|
@@ -317,21 +320,17 @@ declare module "app/index" {
|
|
|
317
320
|
import { AppContext } from "types/internal";
|
|
318
321
|
import { DecisionTable } from "app/decisiontable";
|
|
319
322
|
import { Dataform } from "app/dataform";
|
|
323
|
+
import { Board } from "board/index";
|
|
320
324
|
export class Application extends BaseSDK {
|
|
321
325
|
page: Page;
|
|
322
|
-
variable: AppVariable;
|
|
323
326
|
_id: string;
|
|
324
|
-
constructor(props: AppContext);
|
|
327
|
+
constructor(props: AppContext, isCustomComponent?: boolean);
|
|
325
328
|
getVariable(key: string): any;
|
|
326
329
|
setVariable(key: string | object, value?: any): any;
|
|
327
330
|
openPage(pageId: string, pageParams: object): any;
|
|
328
331
|
getDecisionTable(flowId: string): DecisionTable;
|
|
329
332
|
getDataform(flowId: string): Dataform;
|
|
330
|
-
|
|
331
|
-
class AppVariable extends BaseSDK {
|
|
332
|
-
constructor();
|
|
333
|
-
get(key: any, path: any): any;
|
|
334
|
-
set(key: any, value: any, path: any): any;
|
|
333
|
+
getBoard(flowId: string): Board;
|
|
335
334
|
}
|
|
336
335
|
export * from "app/component";
|
|
337
336
|
export { Page };
|
package/dist/snippets.json
CHANGED