@lark-project/js-sdk 2.0.6-alpha.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/dist/es/index.js +24 -1
- package/dist/lib/index.js +27 -1
- package/dist/types/index.d.ts +143 -1
- package/package.json +1 -1
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-
|
|
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-
|
|
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,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -522,6 +522,111 @@ interface InterceptFeatureContext<T> {
|
|
|
522
522
|
}>;
|
|
523
523
|
customData: T;
|
|
524
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
|
+
}
|
|
525
630
|
|
|
526
631
|
/**
|
|
527
632
|
* @internal
|
|
@@ -1172,8 +1277,17 @@ declare abstract class Modal extends BaseModel {
|
|
|
1172
1277
|
}
|
|
1173
1278
|
|
|
1174
1279
|
interface IRichTextEditorImageUploadComplete {
|
|
1280
|
+
/**
|
|
1281
|
+
* 错误码,非 0 表示异常
|
|
1282
|
+
*/
|
|
1175
1283
|
code: number;
|
|
1284
|
+
/**
|
|
1285
|
+
* 错误信息
|
|
1286
|
+
*/
|
|
1176
1287
|
errMsg: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* 图片上传接口返回的 response 数据
|
|
1290
|
+
*/
|
|
1177
1291
|
responseData: any;
|
|
1178
1292
|
}
|
|
1179
1293
|
/**
|
|
@@ -1215,6 +1329,7 @@ interface RichTextEditorOptions {
|
|
|
1215
1329
|
token?: string;
|
|
1216
1330
|
/**
|
|
1217
1331
|
* 上传完成回调
|
|
1332
|
+
* @mobile_version >=7.37.0
|
|
1218
1333
|
* @param info
|
|
1219
1334
|
* @returns
|
|
1220
1335
|
*/
|
|
@@ -1550,6 +1665,33 @@ declare abstract class View extends BaseModel {
|
|
|
1550
1665
|
abstract getContext(): Promise<ViewFeatureContext>;
|
|
1551
1666
|
}
|
|
1552
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
|
+
|
|
1553
1695
|
/**
|
|
1554
1696
|
* @public
|
|
1555
1697
|
* SDKClient 的配置项
|
|
@@ -1763,4 +1905,4 @@ declare class NotSupportedError extends CustomError {
|
|
|
1763
1905
|
* @packageDocumentation
|
|
1764
1906
|
*/
|
|
1765
1907
|
|
|
1766
|
-
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, 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, 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 };
|