@lark-project/js-sdk 2.0.6-dev.0 → 2.0.6-dev.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/CHANGELOG.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Change Log
2
2
  ## 2.0.6 (2024/09/12)
3
3
  - 「Add」新增 Fullscreen Modal
4
- - 「Add」新增 Context loginUser tenantId
5
4
 
6
5
  ## 2.0.5 (2024/08/13)
7
6
  - 「Add」新增 Button Context
package/dist/es/index.js CHANGED
@@ -430,6 +430,16 @@ _a23 = IMPL_KEY;
430
430
  */
431
431
  View[_a23] = "view";
432
432
 
433
+ // src/features/CustomComponent.ts
434
+ var _a24;
435
+ var CustomComponent = class extends BaseModel {
436
+ };
437
+ _a24 = IMPL_KEY;
438
+ /**
439
+ * @internal
440
+ */
441
+ CustomComponent[_a24] = "customComponent";
442
+
433
443
  // src/client.ts
434
444
  function getImplClass(decl, impls) {
435
445
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -614,7 +624,7 @@ var SDKClient = _SDKClient;
614
624
  /**
615
625
  * SDK 版本号
616
626
  */
617
- SDKClient.version = "2.0.6-dev.0";
627
+ SDKClient.version = "2.0.6-dev.1";
618
628
 
619
629
  // src/types/biz.ts
620
630
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -685,6 +695,16 @@ var InterceptEvent = /* @__PURE__ */ ((InterceptEvent2) => {
685
695
  InterceptEvent2[InterceptEvent2["UpdateState"] = 3001] = "UpdateState";
686
696
  return InterceptEvent2;
687
697
  })(InterceptEvent || {});
698
+ var ComponentScheduleScene = /* @__PURE__ */ ((ComponentScheduleScene2) => {
699
+ ComponentScheduleScene2[ComponentScheduleScene2["ALL"] = 0] = "ALL";
700
+ ComponentScheduleScene2[ComponentScheduleScene2["workItemNode"] = 1] = "workItemNode";
701
+ ComponentScheduleScene2[ComponentScheduleScene2["scheduleTable"] = 2] = "scheduleTable";
702
+ return ComponentScheduleScene2;
703
+ })(ComponentScheduleScene || {});
704
+ var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
705
+ CustomComponentType2["Schedule"] = "schedule";
706
+ return CustomComponentType2;
707
+ })(CustomComponentType || {});
688
708
 
689
709
  // src/errors/CustomError.ts
690
710
  var CustomError = class extends Error {
@@ -768,10 +788,13 @@ export {
768
788
  Button,
769
789
  ButtonScene,
770
790
  Clipboard,
791
+ ComponentScheduleScene,
771
792
  Configuration,
772
793
  ContainerModal,
773
794
  Context,
774
795
  Control,
796
+ CustomComponent,
797
+ CustomComponentType,
775
798
  Field,
776
799
  FieldType,
777
800
  FlowMode,
package/dist/lib/index.js CHANGED
@@ -53,10 +53,13 @@ __export(src_exports, {
53
53
  Button: () => Button,
54
54
  ButtonScene: () => ButtonScene,
55
55
  Clipboard: () => Clipboard,
56
+ ComponentScheduleScene: () => ComponentScheduleScene,
56
57
  Configuration: () => Configuration,
57
58
  ContainerModal: () => ContainerModal,
58
59
  Context: () => Context,
59
60
  Control: () => Control,
61
+ CustomComponent: () => CustomComponent,
62
+ CustomComponentType: () => CustomComponentType,
60
63
  Field: () => Field,
61
64
  FieldType: () => FieldType,
62
65
  FlowMode: () => FlowMode,
@@ -492,6 +495,16 @@ _a23 = IMPL_KEY;
492
495
  */
493
496
  View[_a23] = "view";
494
497
 
498
+ // src/features/CustomComponent.ts
499
+ var _a24;
500
+ var CustomComponent = class extends BaseModel {
501
+ };
502
+ _a24 = IMPL_KEY;
503
+ /**
504
+ * @internal
505
+ */
506
+ CustomComponent[_a24] = "customComponent";
507
+
495
508
  // src/client.ts
496
509
  function getImplClass(decl, impls) {
497
510
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -676,7 +689,7 @@ var SDKClient = _SDKClient;
676
689
  /**
677
690
  * SDK 版本号
678
691
  */
679
- SDKClient.version = "2.0.6-dev.0";
692
+ SDKClient.version = "2.0.6-dev.1";
680
693
 
681
694
  // src/types/biz.ts
682
695
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -747,6 +760,16 @@ var InterceptEvent = /* @__PURE__ */ ((InterceptEvent2) => {
747
760
  InterceptEvent2[InterceptEvent2["UpdateState"] = 3001] = "UpdateState";
748
761
  return InterceptEvent2;
749
762
  })(InterceptEvent || {});
763
+ var ComponentScheduleScene = /* @__PURE__ */ ((ComponentScheduleScene2) => {
764
+ ComponentScheduleScene2[ComponentScheduleScene2["ALL"] = 0] = "ALL";
765
+ ComponentScheduleScene2[ComponentScheduleScene2["workItemNode"] = 1] = "workItemNode";
766
+ ComponentScheduleScene2[ComponentScheduleScene2["scheduleTable"] = 2] = "scheduleTable";
767
+ return ComponentScheduleScene2;
768
+ })(ComponentScheduleScene || {});
769
+ var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
770
+ CustomComponentType2["Schedule"] = "schedule";
771
+ return CustomComponentType2;
772
+ })(CustomComponentType || {});
750
773
 
751
774
  // src/errors/CustomError.ts
752
775
  var CustomError = class extends Error {
@@ -831,10 +854,13 @@ var src_default = SDKClient;
831
854
  Button,
832
855
  ButtonScene,
833
856
  Clipboard,
857
+ ComponentScheduleScene,
834
858
  Configuration,
835
859
  ContainerModal,
836
860
  Context,
837
861
  Control,
862
+ CustomComponent,
863
+ CustomComponentType,
838
864
  Field,
839
865
  FieldType,
840
866
  FlowMode,
@@ -15,11 +15,6 @@ interface User {
15
15
  * 用户头像
16
16
  */
17
17
  avatar: string;
18
- /**
19
- * 所属租户
20
- * only web 2.0
21
- */
22
- tenantId?: string;
23
18
  }
24
19
  /**
25
20
  * @public
@@ -527,6 +522,111 @@ interface InterceptFeatureContext<T> {
527
522
  }>;
528
523
  customData: T;
529
524
  }
525
+ /** ----------------------- 拓展组件-排期组件特化属性 ----------------------- */
526
+ /**
527
+ * 排期组件位置
528
+ */
529
+ declare enum ComponentScheduleScene {
530
+ /**
531
+ * 全部
532
+ */
533
+ ALL = 0,
534
+ /**
535
+ * 工作项节点/子任务
536
+ */
537
+ workItemNode = 1,
538
+ /**
539
+ * 计划表
540
+ */
541
+ scheduleTable = 2
542
+ }
543
+ declare enum WorkItemNodeType {
544
+ Node = "node",
545
+ SubTask = "sub_task",
546
+ SubWorkItem = "sub_workitem",
547
+ SuInstance = "sub_instance"
548
+ }
549
+ interface WorkItemInfo {
550
+ spaceId: string;
551
+ workObjectId: string;
552
+ workItemId: number;
553
+ }
554
+ type ComponentScheduleIdentity = WorkItemInfo & {
555
+ type: WorkItemNodeType;
556
+ nodeId: string;
557
+ taskId: string;
558
+ };
559
+ interface WbsStatus {
560
+ wbsStatus: string;
561
+ }
562
+ interface UserInfo {
563
+ userKey: string;
564
+ }
565
+ type ScheduleCompValueType = string[];
566
+ /**
567
+ * schedule 组件类型校验返回值
568
+ */
569
+ interface ScheduleCompValidateMsg {
570
+ code: 200 | number;
571
+ msg: string;
572
+ }
573
+ /** ----------------------- 拓展点位通用类型 ----------------------- */
574
+ /**
575
+ * 自定义组件构成
576
+ * 支持的定义组件类型
577
+ */
578
+ declare enum CustomComponentType {
579
+ Schedule = "schedule"
580
+ }
581
+ /**
582
+ * 自定义组件构成
583
+ * 允许用户定制指定业务组件类型的UI
584
+ */
585
+ interface CustomComponentFeatureContext<I extends {
586
+ /**
587
+ * 组件节点标识
588
+ * 适用场景:详情页为节点流时,且当前控件位于节点表单/计划表内,该字段才有数据
589
+ */
590
+ nodeId?: string;
591
+ /**
592
+ * 组件子任务标识
593
+ * 适用场景:详情页为节点流时,且当前控件位于节点表单/计划表内,该字段才有数据
594
+ */
595
+ taskId?: string;
596
+ }, S extends ComponentScheduleScene> {
597
+ /**
598
+ * 组件所处场景
599
+ */
600
+ scene: S;
601
+ /**
602
+ * 组件当前所属空间标识
603
+ */
604
+ spaceId: string;
605
+ /**
606
+ * 组件当前所属工作项类型标识
607
+ */
608
+ workObjectId: string;
609
+ /**
610
+ * 组件当前所属工作项实例标识
611
+ * 新建页表单内该值为空
612
+ */
613
+ workItemId?: number;
614
+ /**
615
+ * 组件唯一标识
616
+ * 组件所属节点的所属空间/工作项/工作项实例以及节点任务标识
617
+ */
618
+ identity?: I;
619
+ }
620
+ /**
621
+ * 自定义组件构成
622
+ * 各业务组件类型拥有的 props
623
+ */
624
+ interface CustomComponentProps {
625
+ [CustomComponentType.Schedule]: {
626
+ value: ScheduleCompValueType;
627
+ disabled?: boolean;
628
+ };
629
+ }
530
630
 
531
631
  /**
532
632
  * @internal
@@ -1176,6 +1276,20 @@ declare abstract class Modal extends BaseModel {
1176
1276
  }>;
1177
1277
  }
1178
1278
 
1279
+ interface IRichTextEditorImageUploadComplete {
1280
+ /**
1281
+ * 错误码,非 0 表示异常
1282
+ */
1283
+ code: number;
1284
+ /**
1285
+ * 错误信息
1286
+ */
1287
+ errMsg: string;
1288
+ /**
1289
+ * 图片上传接口返回的 response 数据
1290
+ */
1291
+ responseData: any;
1292
+ }
1179
1293
  /**
1180
1294
  * RichTextEditor 配置
1181
1295
  */
@@ -1213,6 +1327,13 @@ interface RichTextEditorOptions {
1213
1327
  * token 会通过 request header 的 x-plugin-custom-token 提供
1214
1328
  */
1215
1329
  token?: string;
1330
+ /**
1331
+ * 上传完成回调
1332
+ * @mobile_version >=7.37.0
1333
+ * @param info
1334
+ * @returns
1335
+ */
1336
+ onUploadComplete?: (info: IRichTextEditorImageUploadComplete) => void;
1216
1337
  };
1217
1338
  }
1218
1339
  /**
@@ -1544,6 +1665,33 @@ declare abstract class View extends BaseModel {
1544
1665
  abstract getContext(): Promise<ViewFeatureContext>;
1545
1666
  }
1546
1667
 
1668
+ /**
1669
+ * @public
1670
+ * 自定义组件构成
1671
+ */
1672
+ declare abstract class CustomComponent extends BaseModel {
1673
+ /**
1674
+ * @internal
1675
+ */
1676
+ protected static [IMPL_KEY]: string;
1677
+ abstract [CustomComponentType.Schedule]: {
1678
+ getProps: () => Promise<CustomComponentProps[CustomComponentType.Schedule]>;
1679
+ /**
1680
+ * 用于监听 props 变更
1681
+ * @param callback 返回 schedule 组件新的 props
1682
+ * @param watchKeys 监听的 key,只能监听属性的 key(不能监听 api key),不传默认监听所有 key。监听的 key 对应的值变更会触发回调
1683
+ * @returns
1684
+ */
1685
+ watch: (callback: (next: CustomComponentProps[CustomComponentType.Schedule]) => void, watchKeys?: (keyof CustomComponentProps[CustomComponentType.Schedule])[]) => Off;
1686
+ getContext: () => Promise<CustomComponentFeatureContext<ComponentScheduleIdentity, ComponentScheduleScene>>;
1687
+ resizeContainer: (width?: number, height?: number) => Promise<undefined>;
1688
+ getWbsStatus?: () => Promise<WbsStatus>;
1689
+ getOwnersInfo?: () => Promise<UserInfo[]>;
1690
+ handleSubmit: (value: ScheduleCompValueType) => Promise<ScheduleCompValidateMsg>;
1691
+ handleCancel: () => Promise<void>;
1692
+ };
1693
+ }
1694
+
1547
1695
  /**
1548
1696
  * @public
1549
1697
  * SDKClient 的配置项
@@ -1757,4 +1905,4 @@ declare class NotSupportedError extends CustomError {
1757
1905
  * @packageDocumentation
1758
1906
  */
1759
1907
 
1760
- export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, Configuration, ConfigurationFeatureContext, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, ModalOpenOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, Shared, Space, Storage, Tab, TabFeatureContext, Toast, ToastOptions, User, Utils, View, ViewFeatureContext, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
1908
+ export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ComponentScheduleIdentity, ComponentScheduleScene, Configuration, ConfigurationFeatureContext, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentType, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IRichTextEditorImageUploadComplete, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, ModalOpenOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, ScheduleCompValidateMsg, ScheduleCompValueType, Shared, Space, Storage, Tab, TabFeatureContext, Toast, ToastOptions, User, UserInfo, Utils, View, ViewFeatureContext, WbsStatus, 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.6-dev.0",
3
+ "version": "2.0.6-dev.1",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"