@polyv/vue-components 1.0.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.
Files changed (159) hide show
  1. package/font/din-pro/index.scss +26 -0
  2. package/font/youshe/index.scss +8 -0
  3. package/index.es.js +5574 -0
  4. package/package.json +22 -0
  5. package/src/components/basic-countdown/basic-countdown.vue.d.ts +71 -0
  6. package/src/components/basic-countdown/index.d.ts +2 -0
  7. package/src/components/basic-countdown/use-basic-countdown.d.ts +44 -0
  8. package/src/components/exports.d.ts +7 -0
  9. package/src/components/form/form-area-picker/form-area-picker.vue.d.ts +39 -0
  10. package/src/components/form/form-area-picker/index.d.ts +2 -0
  11. package/src/components/form/form-area-picker/use-form-area-picker.d.ts +50 -0
  12. package/src/components/form/form-checkbox/form-checkbox-group.vue.d.ts +27 -0
  13. package/src/components/form/form-checkbox/form-checkbox.vue.d.ts +67 -0
  14. package/src/components/form/form-checkbox/index.d.ts +4 -0
  15. package/src/components/form/form-checkbox/type.d.ts +8 -0
  16. package/src/components/form/form-checkbox/use-form-checkbox.d.ts +38 -0
  17. package/src/components/form/form-input/form-input.vue.d.ts +117 -0
  18. package/src/components/form/form-input/index.d.ts +2 -0
  19. package/src/components/form/form-input/use-form-input.d.ts +88 -0
  20. package/src/components/form/form-item/form-item.vue.d.ts +54 -0
  21. package/src/components/form/form-item/index.d.ts +2 -0
  22. package/src/components/form/form-item/use-form-item.d.ts +71 -0
  23. package/src/components/form/form-protocol/form-protocol.vue.d.ts +19 -0
  24. package/src/components/form/form-protocol/index.d.ts +2 -0
  25. package/src/components/form/form-protocol/use-form-protocol.d.ts +19 -0
  26. package/src/components/form/form-radio/form-radio-group.vue.d.ts +21 -0
  27. package/src/components/form/form-radio/form-radio.vue.d.ts +56 -0
  28. package/src/components/form/form-radio/index.d.ts +3 -0
  29. package/src/components/form/form-radio/type.d.ts +7 -0
  30. package/src/components/form/form-submit-button/form-submit-button.vue.d.ts +61 -0
  31. package/src/components/form/form-submit-button/index.d.ts +2 -0
  32. package/src/components/form/form-submit-button/use-form-submit-button.d.ts +35 -0
  33. package/src/components/form/form-wrap/form-wrap.vue.d.ts +74 -0
  34. package/src/components/form/form-wrap/index.d.ts +2 -0
  35. package/src/components/form/form-wrap/use-form-wrap.d.ts +64 -0
  36. package/src/components/form/hooks/use-form-common.d.ts +25 -0
  37. package/src/components/form/index.d.ts +9 -0
  38. package/src/components/form/types/index.d.ts +19 -0
  39. package/src/components/icons/icons/arrow-down/index.d.ts +6 -0
  40. package/src/components/icons/icons/arrow-left/index.d.ts +6 -0
  41. package/src/components/icons/icons/arrow-right/index.d.ts +6 -0
  42. package/src/components/icons/icons/arrow-up/index.d.ts +6 -0
  43. package/src/components/icons/icons/check/index.d.ts +6 -0
  44. package/src/components/icons/icons/close/index.d.ts +6 -0
  45. package/src/components/icons/icons/close-round-fill/index.d.ts +6 -0
  46. package/src/components/icons/icons/empty-prize/index.d.ts +6 -0
  47. package/src/components/icons/icons/error-round/index.d.ts +6 -0
  48. package/src/components/icons/icons/info-round-filled/index.d.ts +6 -0
  49. package/src/components/icons/icons/list/index.d.ts +6 -0
  50. package/src/components/icons/icons/question-round/index.d.ts +6 -0
  51. package/src/components/icons/icons/success-round/index.d.ts +6 -0
  52. package/src/components/icons/map.d.ts +17 -0
  53. package/src/components/normal-button/index.d.ts +3 -0
  54. package/src/components/normal-button/normal-button.vue.d.ts +64 -0
  55. package/src/components/normal-button/type.d.ts +28 -0
  56. package/src/components/normal-button/use-normal-button.d.ts +37 -0
  57. package/src/components/normal-pendant/index.d.ts +1 -0
  58. package/src/components/normal-pendant/normal-pendant.vue.d.ts +43 -0
  59. package/src/components/popup/hooks/popup-props.d.ts +114 -0
  60. package/src/components/popup/hooks/use-popup-append.d.ts +13 -0
  61. package/src/components/popup/hooks/use-popup-back.d.ts +13 -0
  62. package/src/components/popup/hooks/use-popup-config.d.ts +13 -0
  63. package/src/components/popup/hooks/use-popup-draggable.d.ts +15 -0
  64. package/src/components/popup/hooks/use-popup-height.d.ts +25 -0
  65. package/src/components/popup/hooks/use-popup-position.d.ts +11 -0
  66. package/src/components/popup/hooks/use-popup-scroll.d.ts +8 -0
  67. package/src/components/popup/hooks/use-popup-visible.d.ts +14 -0
  68. package/src/components/popup/hooks/use-popup-width.d.ts +10 -0
  69. package/src/components/popup/index.d.ts +4 -0
  70. package/src/components/popup/popup.vue.d.ts +205 -0
  71. package/src/components/popup/types.d.ts +17 -0
  72. package/src/components/reward-receive/entrance/reward-receive.vue.d.ts +31 -0
  73. package/src/components/reward-receive/hooks/use-reward-receive.d.ts +82 -0
  74. package/src/components/reward-receive/index.d.ts +3 -0
  75. package/src/components/reward-receive/types/index.d.ts +66 -0
  76. package/src/hooks/business/use-app-element/index.d.ts +4 -0
  77. package/src/hooks/business/use-config-provider/index.d.ts +22 -0
  78. package/src/hooks/business/use-track-event/index.d.ts +21 -0
  79. package/src/hooks/components/use-action-sheet/_component/action-sheet.vue.d.ts +20 -0
  80. package/src/hooks/components/use-action-sheet/_component/use-action-sheet-comp.d.ts +13 -0
  81. package/src/hooks/components/use-action-sheet/hook.d.ts +4 -0
  82. package/src/hooks/components/use-action-sheet/index.d.ts +3 -0
  83. package/src/hooks/components/use-action-sheet/types.d.ts +15 -0
  84. package/src/hooks/components/use-auto-topmost/index.d.ts +13 -0
  85. package/src/hooks/components/use-message-box/_component/message-box-element.vue.d.ts +64 -0
  86. package/src/hooks/components/use-message-box/_component/use-message-box-element.d.ts +46 -0
  87. package/src/hooks/components/use-message-box/index.d.ts +9 -0
  88. package/src/hooks/components/use-message-box/types.d.ts +24 -0
  89. package/src/hooks/components/use-popper/_hooks/use-popper-arrow.d.ts +2 -0
  90. package/src/hooks/components/use-popper/_hooks/use-popper-core.d.ts +15 -0
  91. package/src/hooks/components/use-popper/_hooks/use-popper-interactive.d.ts +5 -0
  92. package/src/hooks/components/use-popper/_hooks/use-popper-visible.d.ts +6 -0
  93. package/src/hooks/components/use-popper/_popper-type.d.ts +75 -0
  94. package/src/hooks/components/use-popper/index.d.ts +32 -0
  95. package/src/hooks/components/use-toast/_component/toast-element.vue.d.ts +34 -0
  96. package/src/hooks/components/use-toast/_component/use-toast-element.d.ts +32 -0
  97. package/src/hooks/components/use-toast/index.d.ts +11 -0
  98. package/src/hooks/components/use-toast/types.d.ts +21 -0
  99. package/src/hooks/exports.d.ts +34 -0
  100. package/src/hooks/interactive/use-click-outside/index.d.ts +14 -0
  101. package/src/hooks/interactive/use-fullscreen/index.d.ts +29 -0
  102. package/src/hooks/interactive/use-hover-visible/index.d.ts +16 -0
  103. package/src/hooks/interactive/use-page-fullscreen/index.d.ts +6 -0
  104. package/src/hooks/interactive/use-screen-orientation/index.d.ts +25 -0
  105. package/src/hooks/interactive/use-scroll/index.d.ts +20 -0
  106. package/src/hooks/interactive/use-sound-effect/index.d.ts +6 -0
  107. package/src/hooks/pagination/types.d.ts +60 -0
  108. package/src/hooks/pagination/use-scroll-pagintaion/index.d.ts +17 -0
  109. package/src/hooks/pagination/use-static-pagination/index.d.ts +24 -0
  110. package/src/hooks/plugin/use-resize-observer/index.d.ts +13 -0
  111. package/src/hooks/plugin/use-svga-animation/index.d.ts +25 -0
  112. package/src/hooks/plugin/use-svga-player/index.d.ts +24 -0
  113. package/src/hooks/tools/use-append-to/index.d.ts +7 -0
  114. package/src/hooks/tools/use-body-locked/index.d.ts +10 -0
  115. package/src/hooks/tools/use-browser/index.d.ts +14 -0
  116. package/src/hooks/tools/use-copy-text/index.d.ts +9 -0
  117. package/src/hooks/tools/use-count-down/index.d.ts +39 -0
  118. package/src/hooks/tools/use-event-bus/index.d.ts +19 -0
  119. package/src/hooks/tools/use-event-listener/index.d.ts +2 -0
  120. package/src/hooks/tools/use-link-open/index.d.ts +3 -0
  121. package/src/hooks/tools/use-set-interval/index.d.ts +9 -0
  122. package/src/hooks/tools/use-set-timeout/index.d.ts +9 -0
  123. package/src/hooks/tools/use-simple-visible/index.d.ts +41 -0
  124. package/src/hooks/tools/use-target-event-emitter/index.d.ts +10 -0
  125. package/src/hooks/tools/use-window-resize-listener/index.d.ts +34 -0
  126. package/src/hooks/vue/use-model-value/index.d.ts +13 -0
  127. package/src/hooks/vue/use-vue/index.d.ts +15 -0
  128. package/src/index.d.ts +6 -0
  129. package/src/interface/index.d.ts +4 -0
  130. package/src/lang/common/en.json.d.ts +14 -0
  131. package/src/lang/common/index.d.ts +4 -0
  132. package/src/lang/common/ja.json.d.ts +13 -0
  133. package/src/lang/common/ko.json.d.ts +13 -0
  134. package/src/lang/common/ru.json.d.ts +13 -0
  135. package/src/lang/common/zh-CN.json.d.ts +14 -0
  136. package/src/lang/common/zh-TW.json.d.ts +13 -0
  137. package/src/lang/exports.d.ts +2 -0
  138. package/src/lang/hook.d.ts +12 -0
  139. package/src/lang/internal/en.json.d.ts +21 -0
  140. package/src/lang/internal/index.d.ts +34 -0
  141. package/src/lang/internal/ja.json.d.ts +21 -0
  142. package/src/lang/internal/ko.json.d.ts +21 -0
  143. package/src/lang/internal/ru.json.d.ts +21 -0
  144. package/src/lang/internal/zh-CN.json.d.ts +21 -0
  145. package/src/lang/internal/zh-TW.json.d.ts +21 -0
  146. package/src/lang/types.d.ts +12 -0
  147. package/src/lang/utils.d.ts +1 -0
  148. package/src/plugins/async-validator/index.d.ts +3 -0
  149. package/src/plugins/exports.d.ts +2 -0
  150. package/src/plugins/polyv-ui/area-utils.d.ts +13 -0
  151. package/src/plugins/polyv-ui/mobile-import.d.ts +1 -0
  152. package/src/plugins/polyv-ui/types.d.ts +19 -0
  153. package/src/plugins/svgaplayerweb/load-svga-player.d.ts +15 -0
  154. package/src/utils/dom.d.ts +5 -0
  155. package/src/vue-utils/emit-utils.d.ts +12 -0
  156. package/src/vue-utils/index.d.ts +18 -0
  157. package/src/vue-utils/props-utils.d.ts +61 -0
  158. package/styles/animation.scss +24 -0
  159. package/styles/mixins.scss +123 -0
@@ -0,0 +1,9 @@
1
+ import { MessageBoxOptions } from './types';
2
+ export * from './types';
3
+ export declare const useMessageBox: () => {
4
+ messageBox: (options: MessageBoxOptions) => {
5
+ /** 显示确认框 */
6
+ $confirm: () => Promise<void>;
7
+ $alert: () => Promise<void>;
8
+ };
9
+ };
@@ -0,0 +1,24 @@
1
+ export interface MessageBoxOptions {
2
+ /** 消息 */
3
+ message?: string;
4
+ /** 描述 */
5
+ description?: string;
6
+ /** 是否显示取消按钮 */
7
+ showCancelButton?: boolean;
8
+ /** 是否显示确认按钮 */
9
+ showConfirmButton?: boolean;
10
+ /** 取消按钮文本 */
11
+ cancelButtonText?: string;
12
+ /** 确认按钮文本 */
13
+ confirmButtonText?: string;
14
+ /** 二次确认类型,仅 $confirm 有效 */
15
+ confirmType?: ConfirmType;
16
+ }
17
+ export declare enum ConfirmType {
18
+ /** 普通确认 */
19
+ Normal = "normal",
20
+ /** 删除确认 */
21
+ Delete = "delete",
22
+ /** 提交确认 */
23
+ Submit = "submit"
24
+ }
@@ -0,0 +1,2 @@
1
+ import { PopperOptions } from '../_popper-type';
2
+ export declare const usePopperArrow: (popperOptions: PopperOptions) => void;
@@ -0,0 +1,15 @@
1
+ import { Instance as PopperInstance, OptionsGeneric, Modifier } from '@popperjs/core';
2
+ import { PopperOptions } from '../_popper-type';
3
+ /**
4
+ * 构建 popperjs 的配置
5
+ */
6
+ export declare const usePopperCoreOptions: (popperOptions: PopperOptions, getPopperCtx: () => PopperInstance | undefined) => {
7
+ /** 弹层选项 */
8
+ popperCoreOptions: import('vue').ComputedRef<OptionsGeneric<Modifier<unknown, unknown>>>;
9
+ };
10
+ export declare const usePopperCore: (popperOptions: PopperOptions) => {
11
+ getPopperCtx: () => PopperInstance | undefined;
12
+ updatePopper: () => Promise<void>;
13
+ createPopperCore: () => void;
14
+ destroyPopperCore: () => void;
15
+ };
@@ -0,0 +1,5 @@
1
+ import { PopperOptions } from '../_popper-type';
2
+ /**
3
+ * 弹层交互方式 hook
4
+ */
5
+ export declare const usePopperInteractive: (popperOptions: PopperOptions) => void;
@@ -0,0 +1,6 @@
1
+ import { Ref } from 'vue';
2
+ import { PopperVisibleResult } from '../_popper-type';
3
+ export type UsePopperVisibleOptions = {
4
+ popperVisible?: boolean | Ref<boolean>;
5
+ };
6
+ export declare const usePopperVisible: (options?: UsePopperVisibleOptions) => PopperVisibleResult;
@@ -0,0 +1,75 @@
1
+ import { Ref } from 'vue';
2
+ import { Placement } from '@popperjs/core';
3
+ export type PopperOffset = [number, number];
4
+ /** 弹层触发方式 */
5
+ export type PopperTrigger = 'click' | 'hover' | 'focus' | 'long-press' | 'custom';
6
+ export interface PopperArrowOptions {
7
+ /** 颜色,默认:#fff */
8
+ color?: string;
9
+ /** 尺寸,默认:6 */
10
+ size?: number;
11
+ }
12
+ export interface UsePopperOptions {
13
+ popperVisible?: boolean | Ref<boolean>;
14
+ /** 触发节点 ref */
15
+ referenceRef?: HTMLElement | Ref<HTMLElement | undefined>;
16
+ /** 弹层节点 ref */
17
+ popperRef?: HTMLElement | Ref<HTMLElement | undefined>;
18
+ /** 输入框节点 ref,用于聚焦显示的交互 */
19
+ inputRef?: HTMLInputElement | Ref<HTMLInputElement | undefined>;
20
+ /** 弹层是否禁用 */
21
+ popperDisabled?: boolean | Ref<boolean>;
22
+ /** 触发方式 */
23
+ trigger?: PopperTrigger | Ref<PopperTrigger>;
24
+ /** 鼠标移入延迟显示时间 */
25
+ mouseEnterDelay?: number | Ref<number>;
26
+ /** 鼠标移出延迟隐藏时间 */
27
+ mouseLeaveDelay?: number | Ref<number>;
28
+ /** 弹层位置 */
29
+ placement?: Placement | Ref<Placement>;
30
+ /** 弹层偏移量 */
31
+ popperOffset?: PopperOffset | Ref<PopperOffset>;
32
+ /** 是否显示箭头,默认:false */
33
+ arrow?: boolean | PopperArrowOptions | Ref<boolean | PopperArrowOptions>;
34
+ /** 强制 outSideClick 关闭,默认:false */
35
+ forceOutSideClickHide?: boolean | Ref<boolean>;
36
+ /** outSideClick 关闭时是否延迟,默认:false */
37
+ outSideClickDelayHide?: boolean | Ref<boolean>;
38
+ /** 弹层宽度跟随触发节点,默认:false */
39
+ followReferenceWidth?: boolean | Ref<boolean>;
40
+ /** 是否插入到 body 中,默认:true */
41
+ appendToBody?: boolean;
42
+ /** 渲染到某个元素中(Dom节点选择器) */
43
+ mountEl?: string;
44
+ /** 强制 zIndex,默认 null */
45
+ forceZIndex?: number | null;
46
+ }
47
+ export interface PopperVisibleResult {
48
+ /** 弹层显示状态 */
49
+ popperVisible: Ref<boolean>;
50
+ /** 显示弹层 */
51
+ showPopper: () => void;
52
+ /** 隐藏弹窗 */
53
+ hidePopper: () => void;
54
+ /** 切换弹层显示状态 */
55
+ togglePopper: () => void;
56
+ /** 延迟显示弹层 */
57
+ delayShowPopper: (delay?: number) => void;
58
+ /** 延迟隐藏弹层 */
59
+ delayHidePopper: (delay?: number) => void;
60
+ }
61
+ export interface PopperElements {
62
+ referenceElem: HTMLElement | undefined;
63
+ popperElem: HTMLElement | undefined;
64
+ inputElem: HTMLElement | undefined;
65
+ }
66
+ export interface OnPopperEventParams {
67
+ /** 触发节点是否已隐藏 */
68
+ isReferenceHidden: boolean;
69
+ }
70
+ export interface PopperOptions extends Required<Omit<UsePopperOptions, 'popperVisible'>>, PopperVisibleResult {
71
+ /** 获取相关 dom 节点 */
72
+ getElement: () => PopperElements;
73
+ /** 处理弹层事件 */
74
+ onPopperEvent: (params: OnPopperEventParams) => void;
75
+ }
@@ -0,0 +1,32 @@
1
+ import { OnPopperEventParams, PopperOffset, UsePopperOptions } from './_popper-type';
2
+ export * from './_popper-type';
3
+ /**
4
+ * 弹出层 hook
5
+ */
6
+ export declare const usePopper: (options?: UsePopperOptions) => {
7
+ updatePopper: () => Promise<void>;
8
+ getElement: () => import('./_popper-type').PopperElements;
9
+ onPopperEvent: (params: OnPopperEventParams) => void;
10
+ referenceRef: HTMLElement | import('vue').Ref<HTMLElement | undefined>;
11
+ popperRef: HTMLElement | import('vue').Ref<HTMLElement | undefined>;
12
+ inputRef: HTMLInputElement | import('vue').Ref<HTMLInputElement | undefined>;
13
+ popperDisabled: boolean | import('vue').Ref<boolean>;
14
+ trigger: import('./_popper-type').PopperTrigger | import('vue').Ref<import('./_popper-type').PopperTrigger>;
15
+ mouseEnterDelay: number | import('vue').Ref<number>;
16
+ mouseLeaveDelay: number | import('vue').Ref<number>;
17
+ placement: import('@popperjs/core').Placement | import('vue').Ref<import('@popperjs/core').Placement>;
18
+ popperOffset: PopperOffset | import('vue').Ref<PopperOffset>;
19
+ arrow: boolean | import('./_popper-type').PopperArrowOptions | import('vue').Ref<boolean | import('./_popper-type').PopperArrowOptions>;
20
+ forceOutSideClickHide: boolean | import('vue').Ref<boolean>;
21
+ outSideClickDelayHide: boolean | import('vue').Ref<boolean>;
22
+ followReferenceWidth: boolean | import('vue').Ref<boolean>;
23
+ appendToBody: boolean;
24
+ mountEl: string;
25
+ forceZIndex: number | null;
26
+ popperVisible: import('vue').Ref<boolean>;
27
+ showPopper: () => void;
28
+ hidePopper: () => void;
29
+ togglePopper: () => void;
30
+ delayShowPopper: (delay?: number) => void;
31
+ delayHidePopper: (delay?: number) => void;
32
+ };
@@ -0,0 +1,34 @@
1
+ import { ToastType } from '../types';
2
+ declare const _default: import('vue').DefineComponent<{
3
+ msg: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
4
+ default: string;
5
+ };
6
+ type: import('vue-types').VueTypeValidableDef<ToastType, import('vue-types/dist/types').ValidatorFunction<ToastType>> & {
7
+ default: ToastType;
8
+ };
9
+ duration: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
10
+ default: number;
11
+ };
12
+ showIcon: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
13
+ default: boolean;
14
+ };
15
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
16
+ msg: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
17
+ default: string;
18
+ };
19
+ type: import('vue-types').VueTypeValidableDef<ToastType, import('vue-types/dist/types').ValidatorFunction<ToastType>> & {
20
+ default: ToastType;
21
+ };
22
+ duration: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
23
+ default: number;
24
+ };
25
+ showIcon: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
26
+ default: boolean;
27
+ };
28
+ }>>, {
29
+ type: ToastType;
30
+ duration: number;
31
+ msg: string;
32
+ showIcon: boolean;
33
+ }>;
34
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { FormatProps, VueProps } from '../../../../vue-utils';
2
+ import { ToastType } from '../types';
3
+ export declare const toastProps: () => {
4
+ /** 提示内容 */
5
+ msg: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
6
+ default: string;
7
+ };
8
+ /** 提示类型,默认:info */
9
+ type: import('vue-types').VueTypeValidableDef<ToastType, import('vue-types/dist/types').ValidatorFunction<ToastType>> & {
10
+ default: ToastType;
11
+ };
12
+ /** 关闭时间,默认:3000 */
13
+ duration: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
14
+ default: number;
15
+ };
16
+ /** 显示图标 */
17
+ showIcon: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
18
+ default: boolean;
19
+ };
20
+ };
21
+ export type ToastPropsType = FormatProps<typeof toastProps>;
22
+ /**
23
+ * Toast 组件 hook
24
+ */
25
+ export declare const useToastElement: (options: {
26
+ props: VueProps<typeof toastProps>;
27
+ }) => {
28
+ toastVisible: import('vue').Ref<boolean>;
29
+ openToast: () => void;
30
+ closeToast: () => void;
31
+ onAfterLeave: () => void;
32
+ };
@@ -0,0 +1,11 @@
1
+ import { ToastOptions } from './types';
2
+ export * from './types';
3
+ export declare const useToast: (options?: ToastOptions) => {
4
+ toast: {
5
+ info: (msg: string, opts?: ToastOptions) => void;
6
+ success: (msg: string, opts?: ToastOptions) => void;
7
+ warning: (msg: string, opts?: ToastOptions) => void;
8
+ error: (msg: string, opts?: ToastOptions) => void;
9
+ loading: (msg: string, opts?: ToastOptions) => void;
10
+ };
11
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 提示类型
3
+ */
4
+ export declare enum ToastType {
5
+ /** 信息类提示 */
6
+ Info = "info",
7
+ /** 成功类提示 */
8
+ Success = "success",
9
+ /** 警告类提示 */
10
+ Warning = "warning",
11
+ /** 异常类提示 */
12
+ Error = "error",
13
+ /** 加载中提示 */
14
+ Loading = "loading"
15
+ }
16
+ export interface ToastOptions {
17
+ /** 关闭时间 */
18
+ duration?: number;
19
+ /** 显示图标 */
20
+ showIcon?: boolean;
21
+ }
@@ -0,0 +1,34 @@
1
+ export * from './business/use-app-element';
2
+ export * from './business/use-config-provider';
3
+ export * from './business/use-track-event';
4
+ export * from './components/use-action-sheet';
5
+ export * from './components/use-auto-topmost';
6
+ export * from './components/use-message-box';
7
+ export * from './components/use-popper';
8
+ export * from './components/use-toast';
9
+ export * from './interactive/use-click-outside';
10
+ export * from './interactive/use-fullscreen';
11
+ export * from './interactive/use-screen-orientation';
12
+ export * from './interactive/use-scroll';
13
+ export * from './interactive/use-sound-effect';
14
+ export * from './pagination/types';
15
+ export * from './pagination/use-scroll-pagintaion';
16
+ export * from './pagination/use-static-pagination';
17
+ export * from './plugin/use-resize-observer';
18
+ export * from './plugin/use-svga-animation';
19
+ export * from './plugin/use-svga-player';
20
+ export * from './tools/use-append-to';
21
+ export * from './tools/use-body-locked';
22
+ export * from './tools/use-browser';
23
+ export * from './tools/use-copy-text';
24
+ export * from './tools/use-count-down';
25
+ export * from './tools/use-event-bus';
26
+ export * from './tools/use-event-listener';
27
+ export * from './tools/use-link-open';
28
+ export * from './tools/use-set-interval';
29
+ export * from './tools/use-set-timeout';
30
+ export * from './tools/use-simple-visible';
31
+ export * from './tools/use-target-event-emitter';
32
+ export * from './tools/use-window-resize-listener';
33
+ export * from './vue/use-model-value';
34
+ export * from './vue/use-vue';
@@ -0,0 +1,14 @@
1
+ import { Ref } from 'vue';
2
+ export type ClickOutsideTargetType = Ref | HTMLElement | string;
3
+ export type ClickOutsideTargets = ClickOutsideTargetType | ClickOutsideTargetType[];
4
+ export type ClickOutsideTargetsFunction = () => ClickOutsideTargets;
5
+ /**
6
+ * 点击节点外部事件 hook
7
+ * @param targets 响应式节点数组或获取方法
8
+ * @param callback 回调方法
9
+ * @param autoListen 自动监听,默认:true
10
+ */
11
+ export declare const useClickOutside: (targets: ClickOutsideTargets | ClickOutsideTargetsFunction, callback: () => unknown, autoListen?: boolean) => {
12
+ listenClickOutSide: () => void;
13
+ removeListenClickOutSide: () => void;
14
+ };
@@ -0,0 +1,29 @@
1
+ import { Ref } from 'vue';
2
+ export interface FullscreenFieldData {
3
+ /** 浏览器是否支持全屏模式的 api 字段 */
4
+ enabledField: 'fullscreenEnabled';
5
+ /** 获取浏览器正在全屏的 dom 节点 api 字段 */
6
+ elementField: 'fullscreenElement';
7
+ /** 浏览器全屏的 api 字段 */
8
+ requestApiField: 'requestFullscreen';
9
+ /** 浏览器退出全屏的 api 字段 */
10
+ exitApiField: 'exitFullscreen';
11
+ /** 浏览器全屏状态改变事件 */
12
+ fullscreenChangeEvent: 'fullscreenchange';
13
+ }
14
+ export type FullscreenElement = Element | Ref<Element>;
15
+ export type GetFullscreenElement = () => FullscreenElement;
16
+ /**
17
+ * 系统全屏
18
+ */
19
+ export declare const useFullscreen: (elementRef?: FullscreenElement | GetFullscreenElement, options?: {
20
+ /** 强制禁用全屏 */
21
+ forceDisabled?: boolean;
22
+ onFullscreenChange?: (isFullscreen: boolean) => void;
23
+ }) => {
24
+ isFullscreen: Ref<boolean>;
25
+ supportFullscreen: import('vue').ComputedRef<boolean>;
26
+ requestFullscreen: () => void;
27
+ exitFullscreen: () => void;
28
+ toggleFullscreen: () => void;
29
+ };
@@ -0,0 +1,16 @@
1
+ export interface UseHoverVisibleOptions {
2
+ /** 自动展示,默认为 true */
3
+ autoHover?: boolean;
4
+ /** 自动关闭时长,默认为 3000ms */
5
+ timeout?: number;
6
+ }
7
+ /**
8
+ * 悬浮可见处理
9
+ */
10
+ export declare const useHoverVisible: (hookOptions?: UseHoverVisibleOptions) => {
11
+ visible: import('vue').Ref<boolean>;
12
+ show: () => void;
13
+ forceShow: () => void;
14
+ hide: () => void;
15
+ startAutoHide: () => void;
16
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 网页 css 全屏
3
+ */
4
+ export declare const usePageFullscreen: () => {
5
+ pageFullscreen: import('vue').ComputedRef<boolean>;
6
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 屏幕旋转模式
3
+ * @desc 不使用 portrait 和 landscape 是不想和业务名称重合
4
+ * */
5
+ export declare enum ScreenOrientationMode {
6
+ /** 屏幕纵向 */
7
+ Vertical = "Vertical",
8
+ /** 屏幕横向 */
9
+ Horizontal = "Horizontal"
10
+ }
11
+ /**
12
+ * 屏幕旋转
13
+ */
14
+ export declare const useScreenOrientation: (params?: {
15
+ /** 自动监听事件,默认:true */
16
+ autoListen?: boolean;
17
+ /** 自动监听回调 */
18
+ autoListenCb?: (screenOrientationMode: ScreenOrientationMode) => void;
19
+ }) => {
20
+ screenOrientationMode: import('vue').Ref<ScreenOrientationMode>;
21
+ isVerticalScreenOrientation: import('vue').ComputedRef<boolean>;
22
+ isHorizontalScreenOrientation: import('vue').ComputedRef<boolean>;
23
+ listenOrientationEvent: () => void;
24
+ updateScreenOrientationModeManually: () => void;
25
+ };
@@ -0,0 +1,20 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * 滚动方向
4
+ */
5
+ export type ScrollDirection = 'horizontal' | 'vertical';
6
+ /**
7
+ * 滚动
8
+ */
9
+ export declare const useScroll: (options?: {
10
+ scrollRef?: Ref<HTMLDivElement | undefined>;
11
+ /** 滚动到下一页回调 */
12
+ nextCallback?: () => unknown;
13
+ /** 滚动方向,默认:vertical */
14
+ direction?: ScrollDirection;
15
+ }) => {
16
+ scrollRef: Ref<HTMLDivElement | undefined>;
17
+ onScroll: import('lodash-es/debounce').DebouncedFunc<(event: Event) => void>;
18
+ getScrollElement: () => HTMLDivElement | undefined;
19
+ hasVerticalScrollbar: () => Promise<boolean | undefined>;
20
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 提示音播放
3
+ */
4
+ export declare const useSoundEffect: () => {
5
+ playSoundEffect: () => Promise<void>;
6
+ };
@@ -0,0 +1,60 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * 分页模式,scroll-滚动分页,page-分页器
4
+ */
5
+ export type PaginationMode = 'scroll' | 'page';
6
+ /**
7
+ * 分页数据
8
+ */
9
+ export interface PageContent<I = unknown> {
10
+ /** 当前页数 */
11
+ pageNumber: number;
12
+ /** 每页数量 */
13
+ pageSize: number;
14
+ /** 总记录数 */
15
+ totalItems: number;
16
+ /** 总页数 */
17
+ totalPages: number;
18
+ /** 内容列表 */
19
+ contents: I[];
20
+ }
21
+ /**
22
+ * 分页请求
23
+ */
24
+ export type PaginationRequest<I = unknown> = (params: {
25
+ pageNumber: number;
26
+ pageSize: number;
27
+ keyword: string;
28
+ }) => Promise<PageContent<I>>;
29
+ /**
30
+ * 分页 hook 选项
31
+ */
32
+ export interface PaginationHookOptions<I = unknown> {
33
+ /** 关键词 */
34
+ keyword?: Ref<string>;
35
+ /** 是否立即执行,默认:true */
36
+ immediate?: boolean;
37
+ /** 页数 */
38
+ pageNumber?: Ref<number>;
39
+ /** 每页数量,默认:10 */
40
+ pageSize?: Ref<number>;
41
+ /** 列表 */
42
+ contents?: Ref<I[]>;
43
+ /** 总记录数 */
44
+ totalItems?: Ref<number>;
45
+ /** 总页数 */
46
+ totalPages?: Ref<number>;
47
+ /** 获取过滤条件 */
48
+ getFilterParams?: () => Record<string, unknown>;
49
+ }
50
+ /**
51
+ * 分页 hook 返回值
52
+ */
53
+ export interface PageinationHookReturn<I = unknown> {
54
+ pageNumber: Ref<number>;
55
+ pageSize: Ref<number>;
56
+ contents: Ref<I[]>;
57
+ keyword: Ref<string>;
58
+ /** 刷新当前数据 */
59
+ refresh: () => Promise<void>;
60
+ }
@@ -0,0 +1,17 @@
1
+ import { Ref } from 'vue';
2
+ import { PageinationHookReturn, PaginationHookOptions, PaginationRequest } from '../types';
3
+ import { ScrollDirection } from '../../interactive/use-scroll';
4
+ export interface ScrollPaginationHookOptions<I = unknown> extends PaginationHookOptions<I> {
5
+ scrollRef?: Ref<HTMLDivElement | undefined>;
6
+ /** 滚动方向 */
7
+ direction?: ScrollDirection;
8
+ }
9
+ export interface ScrollPaginationHookReturn<I = unknown> extends PageinationHookReturn<I> {
10
+ scrollRef: Ref<HTMLDivElement | undefined>;
11
+ isFirstFinish: Ref<boolean>;
12
+ }
13
+ /**
14
+ * 滚动分页器 hook
15
+ * @param request 分页请求
16
+ */
17
+ export declare function useScrollPagination<I = unknown>(request: PaginationRequest<I>, options?: ScrollPaginationHookOptions<I>): ScrollPaginationHookReturn<I>;
@@ -0,0 +1,24 @@
1
+ import { ResponsiveRef } from '../../../vue-utils';
2
+ export interface StaticPaginationHookOptions<RefItem = unknown> {
3
+ /** 当前页,默认:1 */
4
+ pageNumber?: number;
5
+ /** 每页数量,默认:10 */
6
+ pageSize?: number;
7
+ /** 响应式列表对象 */
8
+ listRef: ResponsiveRef<RefItem[]>;
9
+ }
10
+ /**
11
+ * 将一个总列表进行响应式静态分页
12
+ */
13
+ export declare const useStaticPagination: <RefItem = unknown>(options: StaticPaginationHookOptions<RefItem>) => {
14
+ pageNumber: import('vue').Ref<number>;
15
+ pageSize: import('vue').Ref<number>;
16
+ totalPages: import('vue').ComputedRef<number>;
17
+ totalItems: import('vue').ComputedRef<number>;
18
+ currentPageList: import('vue').ComputedRef<RefItem[]>;
19
+ nextIsDisabled: import('vue').ComputedRef<boolean>;
20
+ prevIsDisabled: import('vue').ComputedRef<boolean>;
21
+ toPage: (pageNum: number) => void;
22
+ toNextPage: () => void;
23
+ toPrevPage: () => void;
24
+ };
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'vue';
2
+ import { ResizeObserver } from '@juggle/resize-observer';
3
+ /**
4
+ * 监听元素 resize
5
+ * @param refObj 监听元素
6
+ * @param callback 回调
7
+ * @param options 选项
8
+ */
9
+ export declare const useResizeObserver: (refObj: Ref<Element | undefined>, callback: () => unknown, options?: {
10
+ autoLifeCycle: boolean;
11
+ }) => {
12
+ observer: ResizeObserver;
13
+ };
@@ -0,0 +1,25 @@
1
+ import { Ref } from 'vue';
2
+ export interface UseSvgaAnimationOptions {
3
+ /** 容器节点 */
4
+ containerRef: Ref<HTMLDivElement | undefined>;
5
+ /** svga 动画文件地址 */
6
+ svgaUrl: string;
7
+ /** 是否循环播放,默认:true */
8
+ loop?: boolean;
9
+ /** 时间间隔,默认:0 */
10
+ loopTimeInterval?: number;
11
+ /** 自动播放,默认:true */
12
+ autoPlay?: boolean;
13
+ /** 动画完成回调 */
14
+ onFinished?: () => unknown;
15
+ /** 填充模式,默认:AspectFit */
16
+ contentMode?: 'Fill' | 'AspectFill' | 'AspectFit';
17
+ }
18
+ /**
19
+ * svga 动画
20
+ */
21
+ export declare const useSvgaAnimation: (options: UseSvgaAnimationOptions) => {
22
+ setupSvgaUrl: (url: string) => void;
23
+ startAnimation: () => void;
24
+ clearAnimation: () => void;
25
+ };
@@ -0,0 +1,24 @@
1
+ import { Ref } from 'vue';
2
+ import { SVGAPlayer, SVGAVideoEntity } from '../../../plugins/svgaplayerweb/load-svga-player';
3
+ export interface AnimationQueryItem<T extends object = object> {
4
+ url: string;
5
+ ext: T;
6
+ }
7
+ export interface UseSvgaPlayerOptions<T extends object = object> {
8
+ /** 播放 svga 动画前回调 */
9
+ beforePlaySvgaAnimation?: (svgaPlayer: SVGAPlayer, ext: T) => void;
10
+ }
11
+ /**
12
+ * svga 动画播放器
13
+ */
14
+ export declare const useSvgaPlayer: <T extends object = object>(wrapRef: Ref<HTMLDivElement | undefined>, options?: UseSvgaPlayerOptions<T>) => {
15
+ animationQueue: Ref<{
16
+ url: string;
17
+ ext: T;
18
+ }[]>;
19
+ loadSvgaFile: (url: string) => Promise<SVGAVideoEntity>;
20
+ clearSvgaAnimation: () => void;
21
+ pushAnimationQueue: (url: string, inHeader?: boolean, extParam?: T, filterRepeat?: boolean) => void;
22
+ pauseAnimationQueue: () => void;
23
+ startAnimationQueue: () => void;
24
+ };
@@ -0,0 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * 将节点插入到某个容器中
4
+ * @param elemRef 对应的节点
5
+ * @param parentRef 父节点,默认:document.body
6
+ */
7
+ export declare const useAppendTo: (elemRef: Ref | HTMLElement, parentRef?: Ref | HTMLElement) => void;
@@ -0,0 +1,10 @@
1
+ import { ResponsiveRef } from '../../../vue-utils';
2
+ /**
3
+ * 锁定 body 滚动
4
+ * @param lockedRef 是否锁定
5
+ * @returns 锁定和解锁 body 滚动
6
+ */
7
+ export declare const useBodyLocked: (lockedRef: ResponsiveRef<boolean>) => {
8
+ lockBody: () => void;
9
+ unlockBody: () => void;
10
+ };
@@ -0,0 +1,14 @@
1
+ export interface UseBrowserReturn {
2
+ /** 是否为 MAC */
3
+ isMac: boolean;
4
+ /** 是否为移动端 */
5
+ isMobile: boolean;
6
+ /** 是否微信(非企业微信) */
7
+ isWeixin: boolean;
8
+ /** 是否企业微信 */
9
+ isWorkWeixin: boolean;
10
+ }
11
+ /**
12
+ * 浏览器相关 hook
13
+ */
14
+ export declare const useBrowser: () => UseBrowserReturn;