@robot-admin/naive-ui-components 0.20.0 → 0.21.0
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 +12 -0
- package/README.md +5 -5
- package/README_EN.md +5 -5
- package/SECURITY.md +39 -0
- package/dist/C_AntV.css +31 -31
- package/dist/C_AntV2.cjs +1 -1
- package/dist/C_AntV2.js +1 -1
- package/dist/C_Chat.css +90 -90
- package/dist/C_Chat2.cjs +1 -1
- package/dist/C_Chat2.js +1 -1
- package/dist/C_CollapsePanel2.cjs +1 -1
- package/dist/C_CollapsePanel2.js +1 -1
- package/dist/C_Draggable.css +53 -53
- package/dist/C_Draggable2.cjs +1 -1
- package/dist/C_Draggable2.js +1 -1
- package/dist/C_FilePreview.css +98 -98
- package/dist/C_FilePreview.d.cts +2 -2
- package/dist/C_FilePreview.d.ts +2 -2
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_Form.base.css +9 -9
- package/dist/C_Form.css +9 -9
- package/dist/C_FormSearch.css +52 -52
- package/dist/C_FormSearch2.cjs +1 -1
- package/dist/C_FormSearch2.js +1 -1
- package/dist/C_Language.css +2 -2
- package/dist/C_Language2.cjs +1 -1
- package/dist/C_Language2.js +1 -1
- package/dist/C_Login.css +79 -79
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Menu.css +1 -1
- package/dist/C_Menu.d.cts +2 -2
- package/dist/C_Menu.d.ts +2 -2
- package/dist/C_Menu2.cjs +1 -1
- package/dist/C_Menu2.js +1 -1
- package/dist/C_NotificationCenter.css +124 -124
- package/dist/C_NotificationCenter.d.cts +2 -2
- package/dist/C_NotificationCenter.d.ts +2 -2
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_Skeleton.css +2 -2
- package/dist/C_Skeleton2.cjs +1 -1
- package/dist/C_Skeleton2.js +1 -1
- package/dist/C_SplitPane.css +66 -66
- package/dist/C_SplitPane2.cjs +1 -1
- package/dist/C_SplitPane2.js +1 -1
- package/dist/C_Table.base.css +9 -9
- package/dist/C_Table.css +9 -9
- package/dist/C_Table.d.ts +1 -0
- package/dist/C_Theme2.cjs +1 -1
- package/dist/C_Theme2.js +1 -1
- package/dist/C_Timeline.css +46 -46
- package/dist/C_Timeline2.cjs +1 -1
- package/dist/C_Timeline2.js +1 -1
- package/dist/C_Transfer.css +26 -26
- package/dist/C_Transfer2.cjs +1 -1
- package/dist/C_Transfer2.js +1 -1
- package/dist/C_Tree.css +23 -23
- package/dist/C_Tree.d.ts +1 -0
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_VideoPlayer.d.cts +2 -2
- package/dist/C_VideoPlayer.d.ts +2 -2
- package/dist/C_VideoPlayer2.cjs +2 -2
- package/dist/C_VideoPlayer2.js +2 -2
- package/dist/C_WaterFall.css +31 -29
- package/dist/C_WaterFall2.cjs +1 -1
- package/dist/C_WaterFall2.js +1 -1
- package/dist/C_WorkFlow.css +111 -111
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/config.cjs +1 -0
- package/dist/config.d.cts +8 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.js +1 -0
- package/dist/constants3.d.cts +34 -11
- package/dist/constants3.d.ts +34 -11
- package/dist/constants4.d.cts +20 -9
- package/dist/constants4.d.ts +20 -9
- package/dist/constants5.d.cts +22 -18
- package/dist/constants5.d.ts +22 -18
- package/dist/data.d.cts +8 -8
- package/dist/data.d.ts +8 -8
- package/dist/dateRange.d.cts +2 -0
- package/dist/dateRange.d.ts +2 -0
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +6 -6
- package/dist/index.vue.d.ts +6 -6
- package/dist/index10.vue.d.cts +3 -3
- package/dist/index10.vue.d.ts +5 -5
- package/dist/index11.vue.d.cts +5 -5
- package/dist/index11.vue.d.ts +2 -2
- package/dist/index12.vue.d.cts +2 -2
- package/dist/index12.vue.d.ts +5 -5
- package/dist/index13.vue.d.cts +5 -5
- package/dist/index13.vue.d.ts +6 -6
- package/dist/index14.vue.d.cts +6 -6
- package/dist/index14.vue.d.ts +0 -1
- package/dist/index15.vue.d.cts +0 -1
- package/dist/index15.vue.d.ts +1 -1
- package/dist/index16.vue.d.cts +1 -1
- package/dist/index17.vue.d.ts +2 -2
- package/dist/index18.vue.d.cts +2 -2
- package/dist/index18.vue.d.ts +44 -40
- package/dist/index19.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index2.vue.d.cts +3 -3
- package/dist/index2.vue.d.ts +3 -3
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +1 -1
- package/dist/index21.vue.d.cts +1 -1
- package/dist/index21.vue.d.ts +1 -1
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index22.vue.d.ts +2 -2
- package/dist/index25.vue.d.cts +5 -6
- package/dist/index25.vue.d.ts +5 -6
- package/dist/index26.vue.d.cts +3 -3
- package/dist/index26.vue.d.ts +3 -3
- package/dist/index3.vue.d.cts +5 -5
- package/dist/index3.vue.d.ts +5 -5
- package/dist/index4.vue.d.cts +44 -40
- package/dist/index6.vue.d.ts +2 -4
- package/dist/index7.vue.d.cts +2 -4
- package/dist/index9.vue.d.ts +3 -3
- package/dist/mapUtils.d.cts +1 -1
- package/dist/mapUtils.d.ts +1 -1
- package/dist/style.css +846 -844
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +1 -1
- package/dist/useCollapsePanel.d.ts +1 -1
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +8 -8
- package/dist/useCropperCore.d.ts +8 -8
- package/dist/useDraggableLayout.d.cts +1 -0
- package/dist/useDraggableLayout.d.ts +1 -0
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFullscreen.d.cts +41 -23
- package/dist/useFullscreen.d.ts +41 -23
- package/dist/useGlobalSearch.d.cts +1 -1
- package/dist/useGlobalSearch.d.ts +1 -1
- package/dist/useInfiniteScroll.d.cts +7 -5
- package/dist/useInfiniteScroll.d.ts +7 -5
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +5 -5
- package/dist/useSignatureHistory.d.ts +5 -5
- package/dist/useSplitResize.d.cts +10 -11
- package/dist/useSplitResize.d.ts +10 -11
- package/dist/useTableQuery.cjs +1 -1
- package/dist/useTableQuery.d.cts +12 -16
- package/dist/useTableQuery.d.ts +12 -16
- package/dist/useTableQuery.js +1 -1
- package/dist/useWorkflowValidation.d.cts +91 -83
- package/dist/useWorkflowValidation.d.ts +91 -83
- package/dist/verification.d.cts +4 -4
- package/dist/verification.d.ts +4 -4
- package/docs/architecture.en.md +3 -1
- package/docs/architecture.md +3 -1
- package/docs/guides/usage.en.md +16 -0
- package/docs/guides/usage.md +56 -0
- package/package.json +27 -10
- package/dist/context.cjs +0 -1
- package/dist/context.js +0 -1
package/dist/constants3.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from "vue";
|
|
2
|
-
import { Ref } from "vue";
|
|
2
|
+
import { Ref, VNodeChild } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/C_NotificationCenter/types.d.ts
|
|
5
5
|
/** 远程模式缺少接口时明确报错,不回退演示数据。 */
|
|
@@ -135,8 +135,29 @@ interface NotificationCenterController {
|
|
|
135
135
|
disconnectWS: () => void;
|
|
136
136
|
requestDesktopPermission: () => Promise<NotificationPermission | 'unsupported'>;
|
|
137
137
|
}
|
|
138
|
+
/** 仅定制现有类别的显示与顺序,不改变服务端消息协议。 */
|
|
139
|
+
interface NotificationCategoryOption {
|
|
140
|
+
key: NotificationCategory | 'all';
|
|
141
|
+
label?: string;
|
|
142
|
+
}
|
|
143
|
+
interface NotificationItemSlotContext {
|
|
144
|
+
message: NotificationMessage;
|
|
145
|
+
index: number;
|
|
146
|
+
busy: boolean;
|
|
147
|
+
select: () => void;
|
|
148
|
+
read: () => void;
|
|
149
|
+
remove: () => void;
|
|
150
|
+
}
|
|
151
|
+
interface NotificationCenterSlots {
|
|
152
|
+
filters?: (context: {
|
|
153
|
+
controller: NotificationCenterController;
|
|
154
|
+
}) => VNodeChild;
|
|
155
|
+
item?: (context: NotificationItemSlotContext) => VNodeChild;
|
|
156
|
+
'item-actions'?: (context: NotificationItemSlotContext) => VNodeChild;
|
|
157
|
+
}
|
|
138
158
|
/** 组件 Props */
|
|
139
159
|
interface NotificationCenterProps {
|
|
160
|
+
categoryOptions?: readonly NotificationCategoryOption[];
|
|
140
161
|
/** 不传时根据 fetchNotifications 推断,保留无接口演示兼容性。 */
|
|
141
162
|
dataMode?: NotificationDataMode;
|
|
142
163
|
/** 外部共享控制器;传入后不再初始化本地数据、轮询或 WebSocket。 */
|
|
@@ -207,10 +228,11 @@ interface NotificationCenterExpose {
|
|
|
207
228
|
}
|
|
208
229
|
//#endregion
|
|
209
230
|
//#region src/components/C_NotificationCenter/index.vue.d.ts
|
|
210
|
-
|
|
211
|
-
|
|
231
|
+
type __VLS_Slots = NotificationCenterSlots;
|
|
232
|
+
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
212
233
|
delete: (ids: string[]) => any;
|
|
213
234
|
read: (ids: string[]) => any;
|
|
235
|
+
itemClick: (message: NotificationMessage) => any;
|
|
214
236
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
215
237
|
unreadChange: (count: number) => any;
|
|
216
238
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
@@ -218,9 +240,9 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
|
|
|
218
240
|
navigate: (url: string) => any;
|
|
219
241
|
viewAll: () => any;
|
|
220
242
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
221
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
222
243
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
223
244
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
245
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
224
246
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
225
247
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
226
248
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
@@ -235,7 +257,13 @@ declare const __VLS_export: vue.DefineComponent<NotificationCenterProps, Notific
|
|
|
235
257
|
pageSize: number;
|
|
236
258
|
storageKey: string;
|
|
237
259
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
260
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
238
261
|
declare const _default: typeof __VLS_export;
|
|
262
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
263
|
+
new (): {
|
|
264
|
+
$slots: S;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
239
267
|
//#endregion
|
|
240
268
|
//#region src/components/C_NotificationCenter/composables/useNotificationCore.d.ts
|
|
241
269
|
interface NotificationCoreEvents {
|
|
@@ -253,12 +281,7 @@ declare function useNotificationCore(props: NotificationCenterProps, events?: No
|
|
|
253
281
|
};
|
|
254
282
|
//#endregion
|
|
255
283
|
//#region src/components/C_NotificationCenter/composables/useNotificationFormat.d.ts
|
|
256
|
-
/**
|
|
257
|
-
* 通知时间格式化(单例)
|
|
258
|
-
*
|
|
259
|
-
* 将 ISO 时间戳格式化为人类友好的相对时间描述,
|
|
260
|
-
* 如 "刚刚"、"5分钟前"、"昨天 14:30" 等。
|
|
261
|
-
*/
|
|
284
|
+
/** 每次调用绑定当前应用的语言上下文,避免跨实例语言污染。 */
|
|
262
285
|
declare function useNotificationFormat(): {
|
|
263
286
|
formatRelativeTime: (timestamp: string) => string;
|
|
264
287
|
formatFullDate: (date: Date) => string;
|
|
@@ -434,4 +457,4 @@ declare const MOCK_MESSAGES: ({
|
|
|
434
457
|
actionText?: undefined;
|
|
435
458
|
})[];
|
|
436
459
|
//#endregion
|
|
437
|
-
export {
|
|
460
|
+
export { NotificationDataMode as A, NotificationCategory as C, NotificationCenterExpose as D, NotificationCenterEmits as E, NotificationStatus as F, NotificationUnreadByCategory as I, NotificationWSConfig as L, NotificationMessage as M, NotificationPriority as N, NotificationCenterProps as O, NotificationSender as P, WSConnectionStatus as R, MarkAsReadFn as S, NotificationCenterController as T, ClearNotificationsFn as _, DEFAULT_POLLING_INTERVAL as a, FetchNotificationsResult as b, DEFAULT_WS_HEARTBEAT_MESSAGE as c, MOCK_MESSAGES as d, PRIORITY_MAP as f, _default as g, useNotificationCore as h, DEFAULT_PAGE_SIZE as i, NotificationItemSlotContext as j, NotificationCenterSlots as k, DEFAULT_WS_MAX_RECONNECT as l, useNotificationFormat as m, CATEGORY_TABS as n, DEFAULT_STORAGE_KEY as o, useNotificationWS as p, DEFAULT_MAX_BADGE_COUNT as r, DEFAULT_WS_HEARTBEAT_INTERVAL as s, CATEGORY_MAP as t, DEFAULT_WS_RECONNECT_INTERVAL as u, DeleteNotificationFn as v, NotificationCategoryOption as w, MarkAllReadFn as x, FetchNotificationsFn as y, WSNotificationPayload as z };
|
package/dist/constants4.d.cts
CHANGED
|
@@ -196,32 +196,32 @@ type __VLS_Slots = {} & {
|
|
|
196
196
|
area?: (props: typeof __VLS_11) => any;
|
|
197
197
|
};
|
|
198
198
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
199
|
-
error: (file: UploadFileItem, error: Error) => any;
|
|
200
199
|
change: (fileList: UploadFileItem[]) => any;
|
|
201
|
-
|
|
200
|
+
error: (file: UploadFileItem, error: Error) => any;
|
|
202
201
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
202
|
+
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
203
|
remove: (file: UploadFileItem) => any;
|
|
204
204
|
finish: (fileList: UploadFileItem[]) => any;
|
|
205
205
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
206
206
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
207
|
-
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
208
207
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
209
|
-
|
|
208
|
+
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
210
209
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
210
|
+
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
211
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
212
212
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
213
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
214
214
|
}>, {
|
|
215
|
-
data: Record<string, unknown>;
|
|
216
215
|
disabled: boolean;
|
|
217
|
-
|
|
216
|
+
data: Record<string, unknown>;
|
|
218
217
|
action: string;
|
|
219
|
-
multiple: boolean;
|
|
220
|
-
maxSize: number;
|
|
221
218
|
headers: Record<string, string>;
|
|
219
|
+
multiple: boolean;
|
|
222
220
|
directory: boolean;
|
|
223
221
|
accept: string;
|
|
222
|
+
maxSize: number;
|
|
224
223
|
maxCount: number;
|
|
224
|
+
draggable: boolean;
|
|
225
225
|
pasteable: boolean;
|
|
226
226
|
chunked: boolean;
|
|
227
227
|
chunkSize: number;
|
|
@@ -345,11 +345,21 @@ declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled
|
|
|
345
345
|
declare function useFileHash(chunkSize: Ref<number>): {
|
|
346
346
|
hashing: vue.ComputedRef<boolean>;
|
|
347
347
|
hashProgress: Readonly<Ref<number, number>>;
|
|
348
|
-
calculateHash: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
|
|
348
|
+
calculateHash: (file: File, onProgress?: (percent: number) => void, signal?: AbortSignal) => Promise<string>;
|
|
349
|
+
};
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/components/C_Upload/composables/uploadScheduler.d.ts
|
|
352
|
+
/** 普通文件与分片共享同一个组件级请求额度;排队、取消和同步回调均释放一次。 */
|
|
353
|
+
declare function createUploadScheduler(concurrency: Ref<number>): ((request: CustomUploadRequest, options: UploadRequestOptions) => {
|
|
354
|
+
abort: () => void;
|
|
355
|
+
}) & {
|
|
356
|
+
abortAll(): void;
|
|
349
357
|
};
|
|
358
|
+
type UploadScheduler = ReturnType<typeof createUploadScheduler>;
|
|
350
359
|
//#endregion
|
|
351
360
|
//#region src/components/C_Upload/composables/useChunkUpload.d.ts
|
|
352
361
|
interface UseChunkUploadOptions {
|
|
362
|
+
scheduler?: UploadScheduler;
|
|
353
363
|
/** 分片大小 */
|
|
354
364
|
chunkSize: Ref<number>;
|
|
355
365
|
/** 最大并发数 */
|
|
@@ -389,6 +399,7 @@ declare function useChunkUpload(options: UseChunkUploadOptions): {
|
|
|
389
399
|
//#endregion
|
|
390
400
|
//#region src/components/C_Upload/composables/useUploadQueue.d.ts
|
|
391
401
|
interface UseUploadQueueOptions {
|
|
402
|
+
scheduler?: UploadScheduler;
|
|
392
403
|
concurrency: Ref<number>;
|
|
393
404
|
action: Ref<string>;
|
|
394
405
|
headers: Ref<Record<string, string>>;
|
package/dist/constants4.d.ts
CHANGED
|
@@ -196,32 +196,32 @@ type __VLS_Slots = {} & {
|
|
|
196
196
|
area?: (props: typeof __VLS_11) => any;
|
|
197
197
|
};
|
|
198
198
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
199
|
-
error: (file: UploadFileItem, error: Error) => any;
|
|
200
199
|
change: (fileList: UploadFileItem[]) => any;
|
|
201
|
-
|
|
200
|
+
error: (file: UploadFileItem, error: Error) => any;
|
|
202
201
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
202
|
+
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
203
|
remove: (file: UploadFileItem) => any;
|
|
204
204
|
finish: (fileList: UploadFileItem[]) => any;
|
|
205
205
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
206
206
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
207
|
-
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
208
207
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
209
|
-
|
|
208
|
+
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
210
209
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
210
|
+
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
211
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
212
212
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
213
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
214
214
|
}>, {
|
|
215
|
-
data: Record<string, unknown>;
|
|
216
215
|
disabled: boolean;
|
|
217
|
-
|
|
216
|
+
data: Record<string, unknown>;
|
|
218
217
|
action: string;
|
|
219
|
-
multiple: boolean;
|
|
220
|
-
maxSize: number;
|
|
221
218
|
headers: Record<string, string>;
|
|
219
|
+
multiple: boolean;
|
|
222
220
|
directory: boolean;
|
|
223
221
|
accept: string;
|
|
222
|
+
maxSize: number;
|
|
224
223
|
maxCount: number;
|
|
224
|
+
draggable: boolean;
|
|
225
225
|
pasteable: boolean;
|
|
226
226
|
chunked: boolean;
|
|
227
227
|
chunkSize: number;
|
|
@@ -345,11 +345,21 @@ declare function useDragDrop(containerRef: Ref<HTMLElement | undefined>, enabled
|
|
|
345
345
|
declare function useFileHash(chunkSize: Ref<number>): {
|
|
346
346
|
hashing: vue.ComputedRef<boolean>;
|
|
347
347
|
hashProgress: Readonly<Ref<number, number>>;
|
|
348
|
-
calculateHash: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
|
|
348
|
+
calculateHash: (file: File, onProgress?: (percent: number) => void, signal?: AbortSignal) => Promise<string>;
|
|
349
|
+
};
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/components/C_Upload/composables/uploadScheduler.d.ts
|
|
352
|
+
/** 普通文件与分片共享同一个组件级请求额度;排队、取消和同步回调均释放一次。 */
|
|
353
|
+
declare function createUploadScheduler(concurrency: Ref<number>): ((request: CustomUploadRequest, options: UploadRequestOptions) => {
|
|
354
|
+
abort: () => void;
|
|
355
|
+
}) & {
|
|
356
|
+
abortAll(): void;
|
|
349
357
|
};
|
|
358
|
+
type UploadScheduler = ReturnType<typeof createUploadScheduler>;
|
|
350
359
|
//#endregion
|
|
351
360
|
//#region src/components/C_Upload/composables/useChunkUpload.d.ts
|
|
352
361
|
interface UseChunkUploadOptions {
|
|
362
|
+
scheduler?: UploadScheduler;
|
|
353
363
|
/** 分片大小 */
|
|
354
364
|
chunkSize: Ref<number>;
|
|
355
365
|
/** 最大并发数 */
|
|
@@ -389,6 +399,7 @@ declare function useChunkUpload(options: UseChunkUploadOptions): {
|
|
|
389
399
|
//#endregion
|
|
390
400
|
//#region src/components/C_Upload/composables/useUploadQueue.d.ts
|
|
391
401
|
interface UseUploadQueueOptions {
|
|
402
|
+
scheduler?: UploadScheduler;
|
|
392
403
|
concurrency: Ref<number>;
|
|
393
404
|
action: Ref<string>;
|
|
394
405
|
headers: Ref<Record<string, string>>;
|
package/dist/constants5.d.cts
CHANGED
|
@@ -5,13 +5,15 @@ import { IDefinition, IPlayerOptions } from "xgplayer";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/C_VideoPlayer/types.d.ts
|
|
7
7
|
/** 清晰度等级 */
|
|
8
|
-
type QualityLevel =
|
|
8
|
+
type QualityLevel = '360p' | '480p' | '720p' | '1080p' | '1440p' | '4K';
|
|
9
9
|
/** 播放倍速 */
|
|
10
10
|
type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 2.0 | 3.0;
|
|
11
11
|
/** 播放器状态 */
|
|
12
|
-
type PlayerState =
|
|
12
|
+
type PlayerState = 'idle' | 'loading' | 'ready' | 'playing' | 'paused' | 'ended' | 'error';
|
|
13
13
|
/** 视频源类型 */
|
|
14
|
-
type VideoSourceType =
|
|
14
|
+
type VideoSourceType = 'mp4' | 'hls' | 'dash' | 'flv';
|
|
15
|
+
/** 非内置协议按需加载播放器;保持与 xgplayer 实例接口兼容。 */
|
|
16
|
+
type VideoSourceAdapter = () => Promise<typeof xgplayer.default>;
|
|
15
17
|
/** 章节标记 */
|
|
16
18
|
interface Chapter {
|
|
17
19
|
/** 章节ID */
|
|
@@ -46,7 +48,7 @@ interface SubtitleTrack {
|
|
|
46
48
|
default?: boolean;
|
|
47
49
|
}
|
|
48
50
|
/** 测验题类型 */
|
|
49
|
-
type QuizType =
|
|
51
|
+
type QuizType = 'single' | 'multiple' | 'judge';
|
|
50
52
|
/** 测验题选项 */
|
|
51
53
|
interface QuizOption {
|
|
52
54
|
/** 选项标识 */
|
|
@@ -126,7 +128,7 @@ interface ThumbnailConfig {
|
|
|
126
128
|
height?: number;
|
|
127
129
|
}
|
|
128
130
|
/** 播放器事件类型 */
|
|
129
|
-
type AnalyticsEventType =
|
|
131
|
+
type AnalyticsEventType = 'play' | 'pause' | 'ended' | 'seek' | 'quality_change' | 'speed_change' | 'error' | 'buffer' | 'fullscreen';
|
|
130
132
|
/** 分析上报数据 */
|
|
131
133
|
interface AnalyticsEvent {
|
|
132
134
|
/** 事件类型 */
|
|
@@ -146,6 +148,8 @@ interface VideoPlayerProps {
|
|
|
146
148
|
url: string;
|
|
147
149
|
/** 视频源类型,默认自动检测 */
|
|
148
150
|
sourceType?: VideoSourceType;
|
|
151
|
+
/** DASH/FLV 需显式提供适配器,缺失时通过 error 事件报告。 */
|
|
152
|
+
sourceAdapters?: Partial<Record<'dash' | 'flv', VideoSourceAdapter>>;
|
|
149
153
|
/** 播放器宽度 */
|
|
150
154
|
width?: number | string;
|
|
151
155
|
/** 播放器高度 */
|
|
@@ -208,29 +212,29 @@ interface VideoPlayerProps {
|
|
|
208
212
|
/** 视频播放器组件事件 */
|
|
209
213
|
interface VideoPlayerEmits {
|
|
210
214
|
/** 播放器就绪 */
|
|
211
|
-
(e:
|
|
215
|
+
(e: 'ready'): void;
|
|
212
216
|
/** 播放状态变化 */
|
|
213
|
-
(e:
|
|
217
|
+
(e: 'stateChange', state: PlayerState): void;
|
|
214
218
|
/** 播放时间更新 */
|
|
215
|
-
(e:
|
|
219
|
+
(e: 'timeUpdate', currentTime: number, duration: number): void;
|
|
216
220
|
/** 播放结束 */
|
|
217
|
-
(e:
|
|
221
|
+
(e: 'ended'): void;
|
|
218
222
|
/** 播放错误 */
|
|
219
|
-
(e:
|
|
223
|
+
(e: 'error', error: Error): void;
|
|
220
224
|
/** 清晰度切换 */
|
|
221
|
-
(e:
|
|
225
|
+
(e: 'qualityChange', quality: QualityLevel): void;
|
|
222
226
|
/** 倍速切换 */
|
|
223
|
-
(e:
|
|
227
|
+
(e: 'rateChange', rate: number): void;
|
|
224
228
|
/** 全屏状态变化 */
|
|
225
|
-
(e:
|
|
229
|
+
(e: 'fullscreenChange', isFullscreen: boolean): void;
|
|
226
230
|
/** 书签变化 */
|
|
227
|
-
(e:
|
|
231
|
+
(e: 'bookmarkChange', bookmarks: Bookmark[]): void;
|
|
228
232
|
/** 测验作答 */
|
|
229
|
-
(e:
|
|
233
|
+
(e: 'quizAnswer', quizId: string, answer: string | string[], isCorrect: boolean): void;
|
|
230
234
|
/** 章节切换 */
|
|
231
|
-
(e:
|
|
235
|
+
(e: 'chapterChange', chapter: Chapter): void;
|
|
232
236
|
/** 进度更新 */
|
|
233
|
-
(e:
|
|
237
|
+
(e: 'progressUpdate', data: ProgressData): void;
|
|
234
238
|
}
|
|
235
239
|
/** 视频播放器暴露的方法 */
|
|
236
240
|
interface VideoPlayerExpose {
|
|
@@ -485,4 +489,4 @@ declare const WATERMARK_DEFAULT_STYLE: {
|
|
|
485
489
|
readonly gap: 120;
|
|
486
490
|
};
|
|
487
491
|
//#endregion
|
|
488
|
-
export { PlaybackRate as A, ThumbnailConfig as B, AnalyticsEventType as C, Chapter as D, Bookmark as E, QualityDefinition as F,
|
|
492
|
+
export { PlaybackRate as A, ThumbnailConfig as B, AnalyticsEventType as C, Chapter as D, Bookmark as E, QualityDefinition as F, VideoSourceAdapter as G, VideoPlayerExpose as H, QualityLevel as I, VideoSourceType as K, QuizOption as L, PlayerState as M, ProgressData as N, IDefinition as O, ProgressReporter as P, QuizType as R, AnalyticsEvent as S, AntiCheatConfig as T, VideoPlayerProps as U, VideoPlayerEmits as V, VideoQuiz as W, useChapters as _, KEYBOARD_SHORTCUTS as a, usePlayerCore as b, SEEK_STEP as c, STORAGE_PREFIX as d, VOLUME_STEP as f, useSubtitle as g, useProgressTracker as h, DEFAULT_VOLUME as i, PlayerInstance as j, IPlayerOptions as k, SOURCE_TYPE_MAP as l, XGPLAYER_EVENTS as m, DEFAULT_PLAYBACK_RATE as n, PROGRESS_THROTTLE_INTERVAL as o, WATERMARK_DEFAULT_STYLE as p, DEFAULT_PLAYBACK_RATES as r, QUALITY_LABEL_MAP as s, DEFAULT_HEARTBEAT_INTERVAL as t, STORAGE_KEYS as u, useBookmarks as v, AnalyticsReporter as w, _default as x, usePlaybackControl as y, SubtitleTrack as z };
|
package/dist/constants5.d.ts
CHANGED
|
@@ -5,13 +5,15 @@ import { IDefinition, IPlayerOptions } from "xgplayer";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/C_VideoPlayer/types.d.ts
|
|
7
7
|
/** 清晰度等级 */
|
|
8
|
-
type QualityLevel =
|
|
8
|
+
type QualityLevel = '360p' | '480p' | '720p' | '1080p' | '1440p' | '4K';
|
|
9
9
|
/** 播放倍速 */
|
|
10
10
|
type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 2.0 | 3.0;
|
|
11
11
|
/** 播放器状态 */
|
|
12
|
-
type PlayerState =
|
|
12
|
+
type PlayerState = 'idle' | 'loading' | 'ready' | 'playing' | 'paused' | 'ended' | 'error';
|
|
13
13
|
/** 视频源类型 */
|
|
14
|
-
type VideoSourceType =
|
|
14
|
+
type VideoSourceType = 'mp4' | 'hls' | 'dash' | 'flv';
|
|
15
|
+
/** 非内置协议按需加载播放器;保持与 xgplayer 实例接口兼容。 */
|
|
16
|
+
type VideoSourceAdapter = () => Promise<typeof xgplayer.default>;
|
|
15
17
|
/** 章节标记 */
|
|
16
18
|
interface Chapter {
|
|
17
19
|
/** 章节ID */
|
|
@@ -46,7 +48,7 @@ interface SubtitleTrack {
|
|
|
46
48
|
default?: boolean;
|
|
47
49
|
}
|
|
48
50
|
/** 测验题类型 */
|
|
49
|
-
type QuizType =
|
|
51
|
+
type QuizType = 'single' | 'multiple' | 'judge';
|
|
50
52
|
/** 测验题选项 */
|
|
51
53
|
interface QuizOption {
|
|
52
54
|
/** 选项标识 */
|
|
@@ -126,7 +128,7 @@ interface ThumbnailConfig {
|
|
|
126
128
|
height?: number;
|
|
127
129
|
}
|
|
128
130
|
/** 播放器事件类型 */
|
|
129
|
-
type AnalyticsEventType =
|
|
131
|
+
type AnalyticsEventType = 'play' | 'pause' | 'ended' | 'seek' | 'quality_change' | 'speed_change' | 'error' | 'buffer' | 'fullscreen';
|
|
130
132
|
/** 分析上报数据 */
|
|
131
133
|
interface AnalyticsEvent {
|
|
132
134
|
/** 事件类型 */
|
|
@@ -146,6 +148,8 @@ interface VideoPlayerProps {
|
|
|
146
148
|
url: string;
|
|
147
149
|
/** 视频源类型,默认自动检测 */
|
|
148
150
|
sourceType?: VideoSourceType;
|
|
151
|
+
/** DASH/FLV 需显式提供适配器,缺失时通过 error 事件报告。 */
|
|
152
|
+
sourceAdapters?: Partial<Record<'dash' | 'flv', VideoSourceAdapter>>;
|
|
149
153
|
/** 播放器宽度 */
|
|
150
154
|
width?: number | string;
|
|
151
155
|
/** 播放器高度 */
|
|
@@ -208,29 +212,29 @@ interface VideoPlayerProps {
|
|
|
208
212
|
/** 视频播放器组件事件 */
|
|
209
213
|
interface VideoPlayerEmits {
|
|
210
214
|
/** 播放器就绪 */
|
|
211
|
-
(e:
|
|
215
|
+
(e: 'ready'): void;
|
|
212
216
|
/** 播放状态变化 */
|
|
213
|
-
(e:
|
|
217
|
+
(e: 'stateChange', state: PlayerState): void;
|
|
214
218
|
/** 播放时间更新 */
|
|
215
|
-
(e:
|
|
219
|
+
(e: 'timeUpdate', currentTime: number, duration: number): void;
|
|
216
220
|
/** 播放结束 */
|
|
217
|
-
(e:
|
|
221
|
+
(e: 'ended'): void;
|
|
218
222
|
/** 播放错误 */
|
|
219
|
-
(e:
|
|
223
|
+
(e: 'error', error: Error): void;
|
|
220
224
|
/** 清晰度切换 */
|
|
221
|
-
(e:
|
|
225
|
+
(e: 'qualityChange', quality: QualityLevel): void;
|
|
222
226
|
/** 倍速切换 */
|
|
223
|
-
(e:
|
|
227
|
+
(e: 'rateChange', rate: number): void;
|
|
224
228
|
/** 全屏状态变化 */
|
|
225
|
-
(e:
|
|
229
|
+
(e: 'fullscreenChange', isFullscreen: boolean): void;
|
|
226
230
|
/** 书签变化 */
|
|
227
|
-
(e:
|
|
231
|
+
(e: 'bookmarkChange', bookmarks: Bookmark[]): void;
|
|
228
232
|
/** 测验作答 */
|
|
229
|
-
(e:
|
|
233
|
+
(e: 'quizAnswer', quizId: string, answer: string | string[], isCorrect: boolean): void;
|
|
230
234
|
/** 章节切换 */
|
|
231
|
-
(e:
|
|
235
|
+
(e: 'chapterChange', chapter: Chapter): void;
|
|
232
236
|
/** 进度更新 */
|
|
233
|
-
(e:
|
|
237
|
+
(e: 'progressUpdate', data: ProgressData): void;
|
|
234
238
|
}
|
|
235
239
|
/** 视频播放器暴露的方法 */
|
|
236
240
|
interface VideoPlayerExpose {
|
|
@@ -485,4 +489,4 @@ declare const WATERMARK_DEFAULT_STYLE: {
|
|
|
485
489
|
readonly gap: 120;
|
|
486
490
|
};
|
|
487
491
|
//#endregion
|
|
488
|
-
export { PlaybackRate as A, ThumbnailConfig as B, AnalyticsEventType as C, Chapter as D, Bookmark as E, QualityDefinition as F,
|
|
492
|
+
export { PlaybackRate as A, ThumbnailConfig as B, AnalyticsEventType as C, Chapter as D, Bookmark as E, QualityDefinition as F, VideoSourceAdapter as G, VideoPlayerExpose as H, QualityLevel as I, VideoSourceType as K, QuizOption as L, PlayerState as M, ProgressData as N, IDefinition as O, ProgressReporter as P, QuizType as R, AnalyticsEvent as S, AntiCheatConfig as T, VideoPlayerProps as U, VideoPlayerEmits as V, VideoQuiz as W, useChapters as _, KEYBOARD_SHORTCUTS as a, usePlayerCore as b, SEEK_STEP as c, STORAGE_PREFIX as d, VOLUME_STEP as f, useSubtitle as g, useProgressTracker as h, DEFAULT_VOLUME as i, PlayerInstance as j, IPlayerOptions as k, SOURCE_TYPE_MAP as l, XGPLAYER_EVENTS as m, DEFAULT_PLAYBACK_RATE as n, PROGRESS_THROTTLE_INTERVAL as o, WATERMARK_DEFAULT_STYLE as p, DEFAULT_PLAYBACK_RATES as r, QUALITY_LABEL_MAP as s, DEFAULT_HEARTBEAT_INTERVAL as t, STORAGE_KEYS as u, useBookmarks as v, AnalyticsReporter as w, _default as x, usePlaybackControl as y, SubtitleTrack as z };
|
package/dist/data.d.cts
CHANGED
|
@@ -66,27 +66,27 @@ declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
68
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
+
close: (value: TabsValue) => any;
|
|
69
70
|
add: () => any;
|
|
70
71
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
71
|
-
close: (value: TabsValue) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
73
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
+
onClose?: ((value: TabsValue) => any) | undefined;
|
|
74
75
|
onAdd?: (() => any) | undefined;
|
|
75
76
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
76
|
-
onClose?: ((value: TabsValue) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
|
|
78
|
+
modelValue: TabsValue | null;
|
|
79
|
+
defaultValue: TabsValue | null;
|
|
79
80
|
items: readonly TabsItem[];
|
|
81
|
+
type: TabsType;
|
|
80
82
|
size: TabsSize;
|
|
81
|
-
|
|
83
|
+
placement: TabsPlacement;
|
|
82
84
|
justifyContent: TabsJustifyContent;
|
|
83
|
-
defaultValue: TabsValue | null;
|
|
84
|
-
closable: boolean;
|
|
85
|
-
displayDirective: TabsDisplayDirective;
|
|
86
85
|
animated: boolean;
|
|
86
|
+
closable: boolean;
|
|
87
87
|
addable: boolean;
|
|
88
|
-
placement: TabsPlacement;
|
|
89
88
|
tabsOnly: boolean;
|
|
89
|
+
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/data.d.ts
CHANGED
|
@@ -66,27 +66,27 @@ declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
68
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
+
close: (value: TabsValue) => any;
|
|
69
70
|
add: () => any;
|
|
70
71
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
71
|
-
close: (value: TabsValue) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
73
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
+
onClose?: ((value: TabsValue) => any) | undefined;
|
|
74
75
|
onAdd?: (() => any) | undefined;
|
|
75
76
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
76
|
-
onClose?: ((value: TabsValue) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
|
|
78
|
+
modelValue: TabsValue | null;
|
|
79
|
+
defaultValue: TabsValue | null;
|
|
79
80
|
items: readonly TabsItem[];
|
|
81
|
+
type: TabsType;
|
|
80
82
|
size: TabsSize;
|
|
81
|
-
|
|
83
|
+
placement: TabsPlacement;
|
|
82
84
|
justifyContent: TabsJustifyContent;
|
|
83
|
-
defaultValue: TabsValue | null;
|
|
84
|
-
closable: boolean;
|
|
85
|
-
displayDirective: TabsDisplayDirective;
|
|
86
85
|
animated: boolean;
|
|
86
|
+
closable: boolean;
|
|
87
87
|
addable: boolean;
|
|
88
|
-
placement: TabsPlacement;
|
|
89
88
|
tabsOnly: boolean;
|
|
89
|
+
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/dateRange.d.cts
CHANGED
|
@@ -166,6 +166,8 @@ declare function useSearchState<T extends object = SearchFormParams>(emits: {
|
|
|
166
166
|
expanded: Ref<boolean, boolean>;
|
|
167
167
|
searching: vue.ComputedRef<boolean>;
|
|
168
168
|
visibleFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
169
|
+
availableFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
170
|
+
foldThreshold: vue.ComputedRef<number>;
|
|
169
171
|
hasExpandButton: vue.ComputedRef<boolean>;
|
|
170
172
|
history: {
|
|
171
173
|
enabled: vue.ComputedRef<boolean>;
|
package/dist/dateRange.d.ts
CHANGED
|
@@ -166,6 +166,8 @@ declare function useSearchState<T extends object = SearchFormParams>(emits: {
|
|
|
166
166
|
expanded: Ref<boolean, boolean>;
|
|
167
167
|
searching: vue.ComputedRef<boolean>;
|
|
168
168
|
visibleFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
169
|
+
availableFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
170
|
+
foldThreshold: vue.ComputedRef<number>;
|
|
169
171
|
hasExpandButton: vue.ComputedRef<boolean>;
|
|
170
172
|
history: {
|
|
171
173
|
enabled: vue.ComputedRef<boolean>;
|
package/dist/feedback.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./config.cjs`);let t=require(`vue`),n=require(`naive-ui`);function r(r){let i=(0,t.getCurrentInstance)(),a=i?(0,t.inject)(e.COMPONENT_FEEDBACK_KEY,{}):{},o=null,s=null;if(i){try{o=(0,n.useMessage)()}catch{o=null}try{s=(0,n.useDialog)()}catch{s=null}}let c=()=>(0,t.toValue)(r)??a,l=(e,t,n)=>{let r=c()[e];r?r(t,n):o?.[e](t)};return{success:e=>l(`success`,e),error:(e,t)=>l(`error`,e,t),warning:e=>l(`warning`,e),info:e=>l(`info`,e),confirm:async e=>{let t=c().confirm;return t?await t(e)!==!1:s?new Promise(t=>{let n=!1,r=e=>{n||(n=!0,t(e))},i=e.type??`warning`;s[i]({title:e.title,content:e.content,positiveText:e.positiveText,negativeText:e.negativeText,onPositiveClick:()=>r(!0),onNegativeClick:()=>r(!1),onClose:()=>r(!1)})}):typeof window<`u`&&typeof window.confirm==`function`?window.confirm(`${e.title}\n${e.content}`):!1}}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
package/dist/feedback.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{COMPONENT_FEEDBACK_KEY as e}from"./config.js";import{getCurrentInstance as t,inject as n,toValue as r}from"vue";import{useDialog as i,useMessage as a}from"naive-ui";function o(o){let s=t(),c=s?n(e,{}):{},l=null,u=null;if(s){try{l=a()}catch{l=null}try{u=i()}catch{u=null}}let d=()=>r(o)??c,f=(e,t,n)=>{let r=d()[e];r?r(t,n):l?.[e](t)};return{success:e=>f(`success`,e),error:(e,t)=>f(`error`,e,t),warning:e=>f(`warning`,e),info:e=>f(`info`,e),confirm:async e=>{let t=d().confirm;return t?await t(e)!==!1:u?new Promise(t=>{let n=!1,r=e=>{n||(n=!0,t(e))},i=e.type??`warning`;u[i]({title:e.title,content:e.content,positiveText:e.positiveText,negativeText:e.negativeText,onPositiveClick:()=>r(!0),onNegativeClick:()=>r(!1),onClose:()=>r(!1)})}):typeof window<`u`&&typeof window.confirm==`function`?window.confirm(`${e.title}\n${e.content}`):!1}}}export{o as t};
|