bilitoolkit-ui 0.0.4 → 0.0.5
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/bilitoolkit-ui.css +1 -1
- package/dist/index.d.ts +82 -54
- package/dist/index.js +704 -554
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -35,9 +35,9 @@ ellipsis: "right" | "left";
|
|
|
35
35
|
refContent: HTMLDivElement;
|
|
36
36
|
}, HTMLDivElement>;
|
|
37
37
|
|
|
38
|
-
declare const __VLS_component_4: DefineComponent<
|
|
38
|
+
declare const __VLS_component_4: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
39
39
|
|
|
40
|
-
declare const __VLS_component_5: DefineComponent<
|
|
40
|
+
declare const __VLS_component_5: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
41
41
|
|
|
42
42
|
declare const __VLS_component_6: DefineComponent<BiliUserCardProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BiliUserCardProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
43
43
|
|
|
@@ -71,25 +71,23 @@ declare type __VLS_Props_3 = CountdownDialogProps;
|
|
|
71
71
|
|
|
72
72
|
declare type __VLS_Props_4 = PageRangeDialogProps;
|
|
73
73
|
|
|
74
|
-
declare type __VLS_Props_5 = LoadingDialogProps;
|
|
75
|
-
|
|
76
74
|
/**
|
|
77
75
|
* remix 图标
|
|
78
76
|
* 根据应用主题自动切换图标类型
|
|
79
77
|
*/
|
|
80
|
-
declare type
|
|
78
|
+
declare type __VLS_Props_5 = {
|
|
81
79
|
icon: string;
|
|
82
80
|
};
|
|
83
81
|
|
|
84
|
-
declare type
|
|
82
|
+
declare type __VLS_Props_6 = {
|
|
85
83
|
icon: string;
|
|
86
84
|
};
|
|
87
85
|
|
|
88
|
-
declare type
|
|
86
|
+
declare type __VLS_Props_7 = {
|
|
89
87
|
url: string;
|
|
90
88
|
};
|
|
91
89
|
|
|
92
|
-
declare type
|
|
90
|
+
declare type __VLS_Props_8 = {
|
|
93
91
|
user: Pick<UserInfoWithCookie, 'mid' | 'face' | 'name'>;
|
|
94
92
|
};
|
|
95
93
|
|
|
@@ -101,10 +99,6 @@ declare type __VLS_PublicProps_2 = {
|
|
|
101
99
|
modelValue: boolean;
|
|
102
100
|
} & __VLS_Props_4;
|
|
103
101
|
|
|
104
|
-
declare type __VLS_PublicProps_3 = {
|
|
105
|
-
modelValue: boolean;
|
|
106
|
-
} & __VLS_Props_5;
|
|
107
|
-
|
|
108
102
|
declare function __VLS_template(): {
|
|
109
103
|
attrs: Partial<{}>;
|
|
110
104
|
slots: {
|
|
@@ -249,21 +243,9 @@ declare type __VLS_WithTemplateSlots_8<T, S> = T & {
|
|
|
249
243
|
|
|
250
244
|
declare function addLog(msg: string): void;
|
|
251
245
|
|
|
252
|
-
declare const AppIcon_2: DefineComponent<
|
|
246
|
+
declare const AppIcon_2: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLElement>;
|
|
253
247
|
export { AppIcon_2 as AppIcon }
|
|
254
248
|
|
|
255
|
-
/**
|
|
256
|
-
* APP 全局加载框
|
|
257
|
-
*/
|
|
258
|
-
export declare const AppLoadingDialog: {
|
|
259
|
-
/**
|
|
260
|
-
* 显示,返回一个Promise,解析为是否成功,false为用户取消
|
|
261
|
-
* @param options
|
|
262
|
-
*/
|
|
263
|
-
show(options?: Omit<GlobalLoadingDialogProps, "onCancel">): Promise<boolean>;
|
|
264
|
-
hide(): void;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
249
|
export declare type AppThemeCssVars = Record<string, string>;
|
|
268
250
|
|
|
269
251
|
declare const AppTooltip_2: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
@@ -284,7 +266,7 @@ export declare interface BiliUserCardProps {
|
|
|
284
266
|
user: UserInfo;
|
|
285
267
|
}
|
|
286
268
|
|
|
287
|
-
declare const BiliUserInfo_2: DefineComponent<
|
|
269
|
+
declare const BiliUserInfo_2: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
288
270
|
export { BiliUserInfo_2 as BiliUserInfo }
|
|
289
271
|
|
|
290
272
|
export declare const blackColor = "#000000";
|
|
@@ -324,13 +306,6 @@ export { ExternalLink_2 as ExternalLink }
|
|
|
324
306
|
|
|
325
307
|
export declare type FetchPage<D, Q = undefined> = Q extends undefined ? (pageParams: PageParams) => Promise<PageResult<D>> : (pageParams: PageParams, queryParams: Q) => Promise<PageResult<D>>;
|
|
326
308
|
|
|
327
|
-
/**
|
|
328
|
-
* 全局加载框的参数
|
|
329
|
-
*/
|
|
330
|
-
export declare type GlobalLoadingDialogProps = {
|
|
331
|
-
autoCloseDelay?: number;
|
|
332
|
-
} & LoadingDialogProps;
|
|
333
|
-
|
|
334
309
|
/**
|
|
335
310
|
* 统一处理错误
|
|
336
311
|
*/
|
|
@@ -385,33 +360,30 @@ export declare const initTransparentColors: (primaryColor: string, vars: AppThem
|
|
|
385
360
|
*/
|
|
386
361
|
export declare const isDarkTheme: (themeMode?: AppThemeMode) => Promise<boolean>;
|
|
387
362
|
|
|
388
|
-
declare const LoadingDialog_2: DefineComponent<__VLS_PublicProps_3, {
|
|
389
|
-
show: (options?: LoadingDialogProps) => void;
|
|
390
|
-
hide: () => void;
|
|
391
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
392
|
-
"update:modelValue": (value: boolean) => any;
|
|
393
|
-
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
|
|
394
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
395
|
-
}>, {
|
|
396
|
-
canCancel: boolean;
|
|
397
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
398
|
-
export { LoadingDialog_2 as LoadingDialog }
|
|
399
|
-
|
|
400
363
|
/**
|
|
401
|
-
*
|
|
364
|
+
* 全局加载框
|
|
402
365
|
*/
|
|
403
|
-
export declare
|
|
404
|
-
show
|
|
405
|
-
|
|
366
|
+
export declare const loadingDialog: {
|
|
367
|
+
show(options?: LoadingDialogOptions): void;
|
|
368
|
+
update(message: string): void;
|
|
369
|
+
close(): void;
|
|
406
370
|
};
|
|
407
371
|
|
|
372
|
+
declare const LoadingDialog_2: DefineComponent< {}, {
|
|
373
|
+
show: (options?: LoadingDialogOptions) => void;
|
|
374
|
+
update: (text: string) => void;
|
|
375
|
+
close: () => void;
|
|
376
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
377
|
+
export { LoadingDialog_2 as LoadingDialog }
|
|
378
|
+
|
|
408
379
|
/**
|
|
409
380
|
* 加载框
|
|
410
381
|
*/
|
|
411
|
-
export declare interface
|
|
412
|
-
|
|
413
|
-
onCancel?: () => void
|
|
414
|
-
|
|
382
|
+
export declare interface LoadingDialogOptions {
|
|
383
|
+
showCancel?: boolean;
|
|
384
|
+
onCancel?: () => void | Promise<void>;
|
|
385
|
+
message?: string;
|
|
386
|
+
autoCloseDelay?: number;
|
|
415
387
|
}
|
|
416
388
|
|
|
417
389
|
declare const LogPrint_2: DefineComponent< {}, {
|
|
@@ -564,6 +536,39 @@ onHandleMenuSelect?: ((menu: PluginMenuData) => any) | undefined;
|
|
|
564
536
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
565
537
|
export { PluginPageHeader_2 as PluginPageHeader }
|
|
566
538
|
|
|
539
|
+
/**
|
|
540
|
+
* 任务进度弹窗
|
|
541
|
+
*/
|
|
542
|
+
export declare const processDialog: {
|
|
543
|
+
show(options?: ProcessDialogOptions): void;
|
|
544
|
+
update(currPct?: number, text?: string): void;
|
|
545
|
+
success(message?: string): void;
|
|
546
|
+
error(message?: string): void;
|
|
547
|
+
close(): void;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
declare const ProcessDialog_2: DefineComponent< {}, {
|
|
551
|
+
show: (options?: ProcessDialogOptions) => void;
|
|
552
|
+
update: (currPct?: number, text?: string) => void;
|
|
553
|
+
setSuccess: (text?: string) => void;
|
|
554
|
+
setError: (text?: string) => void;
|
|
555
|
+
close: () => void;
|
|
556
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
557
|
+
export { ProcessDialog_2 as ProcessDialog }
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* 任务进度弹窗
|
|
561
|
+
*/
|
|
562
|
+
export declare interface ProcessDialogOptions {
|
|
563
|
+
showCancel?: boolean;
|
|
564
|
+
onCancel?: () => void | Promise<void>;
|
|
565
|
+
onConfirm?: (status: ProcessDialogStatus) => void | Promise<void>;
|
|
566
|
+
percentage?: number;
|
|
567
|
+
message?: string;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export declare type ProcessDialogStatus = 'loading' | 'success' | 'error';
|
|
571
|
+
|
|
567
572
|
declare const SelectDialog_2: <T = unknown>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
568
573
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
569
574
|
readonly onConfirm?: ((list: T[]) => any) | undefined;
|
|
@@ -722,6 +727,26 @@ export declare function useCountdown(initial: number): {
|
|
|
722
727
|
stop: () => void;
|
|
723
728
|
};
|
|
724
729
|
|
|
730
|
+
/**
|
|
731
|
+
* 监听指定模板元素的高度变化,并同步其当前高度。
|
|
732
|
+
*
|
|
733
|
+
* 基于 ResizeObserver 实现,
|
|
734
|
+
* 内部使用 requestAnimationFrame 合并高频更新,避免连续触发造成重复计算。
|
|
735
|
+
*
|
|
736
|
+
* @template H 元素类型,默认 HTMLElement
|
|
737
|
+
* @param refName 模板 ref 名称
|
|
738
|
+
*
|
|
739
|
+
* @returns
|
|
740
|
+
* - elementRef: 绑定的模板元素引用
|
|
741
|
+
* - height: 当前元素高度(clientHeight)
|
|
742
|
+
* - updateHeight: 手动同步一次高度
|
|
743
|
+
*/
|
|
744
|
+
export declare const useElementHeight: <H extends HTMLElement = HTMLElement>(refName: string) => {
|
|
745
|
+
elementRef: Readonly<ShallowRef<H | null>>;
|
|
746
|
+
height: Ref<number, number>;
|
|
747
|
+
updateHeight: () => void;
|
|
748
|
+
};
|
|
749
|
+
|
|
725
750
|
/**
|
|
726
751
|
* 封装的数据加载函数,方便关联返回的 loading
|
|
727
752
|
*/
|
|
@@ -787,17 +812,20 @@ init: () => Promise<void>;
|
|
|
787
812
|
user: Ref<UserInfoWithCookie | null, UserInfoWithCookie | null>;
|
|
788
813
|
deleteUser: () => void;
|
|
789
814
|
setUser: (user: UserInfoWithCookie) => void;
|
|
815
|
+
assertLoggedIn: () => void;
|
|
790
816
|
}, "user">, Pick<{
|
|
791
817
|
init: () => Promise<void>;
|
|
792
818
|
user: Ref<UserInfoWithCookie | null, UserInfoWithCookie | null>;
|
|
793
819
|
deleteUser: () => void;
|
|
794
820
|
setUser: (user: UserInfoWithCookie) => void;
|
|
821
|
+
assertLoggedIn: () => void;
|
|
795
822
|
}, never>, Pick<{
|
|
796
823
|
init: () => Promise<void>;
|
|
797
824
|
user: Ref<UserInfoWithCookie | null, UserInfoWithCookie | null>;
|
|
798
825
|
deleteUser: () => void;
|
|
799
826
|
setUser: (user: UserInfoWithCookie) => void;
|
|
800
|
-
|
|
827
|
+
assertLoggedIn: () => void;
|
|
828
|
+
}, "init" | "deleteUser" | "setUser" | "assertLoggedIn">>;
|
|
801
829
|
|
|
802
830
|
export declare const whiteColor = "#ffffff";
|
|
803
831
|
|