@lark-project/js-sdk 2.0.1-alpha.16 → 2.0.1-alpha.19
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/CHANGELOG.md +3 -0
- package/dist/es/index.js +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/types/index.d.ts +68 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.js
CHANGED
package/dist/lib/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -480,10 +480,10 @@ interface InterceptFeatureContext<T> {
|
|
|
480
480
|
changedValue?: {
|
|
481
481
|
fieldInfo?: Array<{
|
|
482
482
|
fieldKey: string;
|
|
483
|
-
fieldType
|
|
484
|
-
alias
|
|
485
|
-
beforeFieldValue
|
|
486
|
-
afterFieldValue
|
|
483
|
+
fieldType?: string;
|
|
484
|
+
alias?: string;
|
|
485
|
+
beforeFieldValue?: unknown;
|
|
486
|
+
afterFieldValue?: unknown;
|
|
487
487
|
}>;
|
|
488
488
|
nodeInfo?: any;
|
|
489
489
|
subTaskInfo?: any;
|
|
@@ -570,6 +570,11 @@ declare abstract class Context extends BaseModel {
|
|
|
570
570
|
* @param callback
|
|
571
571
|
*/
|
|
572
572
|
abstract watch(callback: (nextValue: Context) => void): unwatch;
|
|
573
|
+
/**
|
|
574
|
+
* 用于获取插件内自定义传入的上下文数据 context
|
|
575
|
+
* 例如:在 Modal.open 时传入的 context,可以通过 getCustomContext 来获取
|
|
576
|
+
*/
|
|
577
|
+
abstract getCustomContext: <Context>() => Promise<Context>;
|
|
573
578
|
}
|
|
574
579
|
|
|
575
580
|
/**
|
|
@@ -1007,9 +1012,9 @@ declare abstract class ActionSheet extends BaseModel {
|
|
|
1007
1012
|
}
|
|
1008
1013
|
|
|
1009
1014
|
/**
|
|
1010
|
-
* Modal 展示配置
|
|
1015
|
+
* Modal confirm 展示配置
|
|
1011
1016
|
*/
|
|
1012
|
-
interface
|
|
1017
|
+
interface ModalConfirmOptions {
|
|
1013
1018
|
/**
|
|
1014
1019
|
* 标题
|
|
1015
1020
|
* title 和 content 不可同时为空
|
|
@@ -1036,6 +1041,40 @@ interface ModalOptions {
|
|
|
1036
1041
|
*/
|
|
1037
1042
|
cancelText?: string;
|
|
1038
1043
|
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Modal 展示配置
|
|
1046
|
+
*/
|
|
1047
|
+
interface ModalOptions<Context extends any> {
|
|
1048
|
+
/**
|
|
1049
|
+
* 宽度
|
|
1050
|
+
* 默认: 448
|
|
1051
|
+
*/
|
|
1052
|
+
width?: number;
|
|
1053
|
+
/**
|
|
1054
|
+
* 高度
|
|
1055
|
+
*/
|
|
1056
|
+
height?: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* 是否全屏
|
|
1059
|
+
* 对话是否是全屏(会覆盖 width )
|
|
1060
|
+
*/
|
|
1061
|
+
fullScreen?: boolean;
|
|
1062
|
+
/**
|
|
1063
|
+
* 是否允许通过点击遮罩来关闭对话框
|
|
1064
|
+
*/
|
|
1065
|
+
maskClosable?: boolean;
|
|
1066
|
+
/**
|
|
1067
|
+
* 传入 Modal 内的上下文数据
|
|
1068
|
+
* 注:传入的数据在 Modal 内是通过 sdk.containerModal.getContext() 来获取的
|
|
1069
|
+
*/
|
|
1070
|
+
context?: Context;
|
|
1071
|
+
/**
|
|
1072
|
+
* 弹窗内部调用的submit的方法 - 传递外部使用
|
|
1073
|
+
* @param params 弹窗内部调用的 ContainerModal.submit 的方法时传入的参数 - 自定义
|
|
1074
|
+
* @returns 调用 ContainerModal.submit 返回的值 - 自定义
|
|
1075
|
+
*/
|
|
1076
|
+
onSubmit?: <Params, Result>(params: Params) => Promise<Result>;
|
|
1077
|
+
}
|
|
1039
1078
|
/**
|
|
1040
1079
|
* @public
|
|
1041
1080
|
* Modal 用于等待用户响应、告知用户重要信息或在不丢失上下文的情况下展示更多信息
|
|
@@ -1050,16 +1089,24 @@ declare abstract class Modal extends BaseModel {
|
|
|
1050
1089
|
*/
|
|
1051
1090
|
private static load;
|
|
1052
1091
|
/**
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
abstract
|
|
1092
|
+
* 使用模态框 confirm
|
|
1093
|
+
* @param options
|
|
1094
|
+
* @param callback
|
|
1095
|
+
* confirmed 点击了确认
|
|
1096
|
+
* canceled 点击了取消
|
|
1097
|
+
*/
|
|
1098
|
+
abstract confirm(options: string | ModalConfirmOptions, callback: (result: {
|
|
1060
1099
|
confirmed: boolean;
|
|
1061
1100
|
canceled: boolean;
|
|
1062
1101
|
}) => void): Promise<void>;
|
|
1102
|
+
/**
|
|
1103
|
+
* 打开模态框 open
|
|
1104
|
+
* @param options
|
|
1105
|
+
* @returns 当前打开的 Modal 的 close 方法
|
|
1106
|
+
*/
|
|
1107
|
+
abstract open<Context>(options: ModalOptions<Context>): Promise<{
|
|
1108
|
+
close: () => void;
|
|
1109
|
+
}>;
|
|
1063
1110
|
}
|
|
1064
1111
|
|
|
1065
1112
|
/**
|
|
@@ -1131,7 +1178,7 @@ declare abstract class RichTextEditor extends BaseModel {
|
|
|
1131
1178
|
abstract show(options: RichTextEditorOptions, callback: (result: {
|
|
1132
1179
|
confirmed: boolean;
|
|
1133
1180
|
canceled: boolean;
|
|
1134
|
-
|
|
1181
|
+
nextValue?: RichTextEditorContent;
|
|
1135
1182
|
}) => void): Promise<void>;
|
|
1136
1183
|
}
|
|
1137
1184
|
|
|
@@ -1239,7 +1286,12 @@ declare abstract class ContainerModal extends BaseModel {
|
|
|
1239
1286
|
/**
|
|
1240
1287
|
* 关闭插件当前激活的容器模态框
|
|
1241
1288
|
*/
|
|
1242
|
-
abstract
|
|
1289
|
+
abstract close(): Promise<void>;
|
|
1290
|
+
/**
|
|
1291
|
+
* 只存在于 modal.open 打开的容器内
|
|
1292
|
+
* 对 modal 内 submit 对应的是 Modal.open 传入的 onSubmit 方法,以此让打开 modal 的地方 modal 传入的数据
|
|
1293
|
+
*/
|
|
1294
|
+
abstract submit?: <Params, Result>(params: Params) => Promise<Result>;
|
|
1243
1295
|
}
|
|
1244
1296
|
|
|
1245
1297
|
/**
|
|
@@ -1487,4 +1539,4 @@ declare class NotSupportedError extends CustomError {
|
|
|
1487
1539
|
* @packageDocumentation
|
|
1488
1540
|
*/
|
|
1489
1541
|
|
|
1490
|
-
export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal,
|
|
1542
|
+
export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, OutOfLimitError, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, Space, Storage, TabFeatureContext, Toast, ToastOptions, User, Utils, ViewFeatureContext, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
|