@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 CHANGED
@@ -1,4 +1,7 @@
1
1
  # Change Log
2
+ ## 2.0.6 (2024/09/12)
3
+ - 「Add」新增 Fullscreen Modal
4
+
2
5
  ## 2.0.5 (2024/08/13)
3
6
  - 「Add」新增 Button Context
4
7
 
package/dist/es/index.js CHANGED
@@ -505,7 +505,7 @@ var SDKClient = _SDKClient;
505
505
  /**
506
506
  * SDK 版本号
507
507
  */
508
- SDKClient.version = "2.0.1-alpha.16";
508
+ SDKClient.version = "2.0.1-alpha.19";
509
509
 
510
510
  // src/types/biz.ts
511
511
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
package/dist/lib/index.js CHANGED
@@ -562,7 +562,7 @@ var SDKClient = _SDKClient;
562
562
  /**
563
563
  * SDK 版本号
564
564
  */
565
- SDKClient.version = "2.0.1-alpha.16";
565
+ SDKClient.version = "2.0.1-alpha.19";
566
566
 
567
567
  // src/types/biz.ts
568
568
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -480,10 +480,10 @@ interface InterceptFeatureContext<T> {
480
480
  changedValue?: {
481
481
  fieldInfo?: Array<{
482
482
  fieldKey: string;
483
- fieldType: string;
484
- alias: string;
485
- beforeFieldValue: unknown;
486
- afterFieldValue: unknown;
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 ModalOptions {
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
- * @param options
1055
- * @param callback
1056
- * confirmed 点击了确认
1057
- * canceled 点击了取消
1058
- */
1059
- abstract show(options: string | ModalOptions, callback: (result: {
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
- content?: RichTextEditorContent;
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 closeModal(): Promise<void>;
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, ModalOptions, 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-project/js-sdk",
3
- "version": "2.0.1-alpha.16",
3
+ "version": "2.0.1-alpha.19",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"