@polyv/vue-components 1.0.2 → 1.1.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.
Files changed (145) hide show
  1. package/index.es.js +4453 -2279
  2. package/package.json +4 -3
  3. package/src/components/basic-countdown/use-basic-countdown.d.ts +27 -7
  4. package/src/components/{normal-button/normal-button.vue.d.ts → button/button.vue.d.ts} +6 -14
  5. package/src/components/button/index.d.ts +3 -0
  6. package/src/components/button/type.d.ts +50 -0
  7. package/src/components/{normal-button/use-normal-button.d.ts → button/use-button.d.ts} +33 -11
  8. package/src/components/carousel/index.d.ts +3 -0
  9. package/src/components/category-select/category-select-item.vue.d.ts +22 -0
  10. package/src/components/category-select/category-select.vue.d.ts +21 -0
  11. package/src/components/category-select/index.d.ts +3 -0
  12. package/src/components/category-select/use-category-select.d.ts +25 -0
  13. package/src/components/dropdown/dropdown-item.vue.d.ts +31 -0
  14. package/src/components/dropdown/dropdown-menu.vue.d.ts +17 -0
  15. package/src/components/dropdown/dropdown.vue.d.ts +61 -0
  16. package/src/components/dropdown/index.d.ts +4 -0
  17. package/src/components/dropdown/use-dropdown.d.ts +70 -0
  18. package/src/components/empty/empty.vue.d.ts +14 -0
  19. package/src/components/empty/index.d.ts +2 -0
  20. package/src/components/empty/use-empty.d.ts +14 -0
  21. package/src/components/exports.d.ts +8 -1
  22. package/src/components/form/{form-area-picker/form-area-picker.vue.d.ts → area-picker/area-picker.vue.d.ts} +7 -7
  23. package/src/components/form/area-picker/index.d.ts +2 -0
  24. package/src/components/form/{form-area-picker/use-form-area-picker.d.ts → area-picker/use-area-picker.d.ts} +26 -13
  25. package/src/components/form/checkbox/index.d.ts +4 -0
  26. package/src/components/form/{form-checkbox/use-form-checkbox.d.ts → checkbox/use-checkbox.d.ts} +47 -12
  27. package/src/components/form/form-item/use-form-item.d.ts +30 -9
  28. package/src/components/form/form-submit-button/form-submit-button.vue.d.ts +13 -13
  29. package/src/components/form/form-submit-button/use-form-submit-button.d.ts +12 -5
  30. package/src/components/form/form-wrap/form-wrap.vue.d.ts +2 -0
  31. package/src/components/form/form-wrap/use-form-wrap.d.ts +48 -9
  32. package/src/components/form/hooks/use-form-common.d.ts +13 -2
  33. package/src/components/form/index.d.ts +5 -5
  34. package/src/components/form/input/index.d.ts +2 -0
  35. package/src/components/form/{form-input/form-input.vue.d.ts → input/input.vue.d.ts} +19 -22
  36. package/src/components/form/{form-input/use-form-input.d.ts → input/use-input.d.ts} +89 -21
  37. package/src/components/form/protocol/index.d.ts +2 -0
  38. package/src/components/form/{form-protocol/use-form-protocol.d.ts → protocol/use-protocol.d.ts} +9 -5
  39. package/src/components/form/radio/index.d.ts +4 -0
  40. package/src/components/form/{form-radio/form-radio.vue.d.ts → radio/radio.vue.d.ts} +0 -6
  41. package/src/components/form/radio/use-radio.d.ts +41 -0
  42. package/src/components/form/types/index.d.ts +12 -3
  43. package/src/components/icons/icons/{info-round-filled → check-round-fill}/index.d.ts +1 -1
  44. package/src/components/icons/icons/close-round/index.d.ts +6 -0
  45. package/src/components/icons/icons/copy/index.d.ts +6 -0
  46. package/src/components/icons/icons/down-file/index.d.ts +6 -0
  47. package/src/components/icons/icons/down-load/index.d.ts +6 -0
  48. package/src/components/icons/icons/info-round-fill/index.d.ts +6 -0
  49. package/src/components/icons/icons/loading/index.d.ts +6 -0
  50. package/src/components/icons/icons/search/index.d.ts +6 -0
  51. package/src/components/icons/icons/triangle-down/index.d.ts +6 -0
  52. package/src/components/icons/icons/triangle-up/index.d.ts +6 -0
  53. package/src/components/icons/icons/warning-round-fill/index.d.ts +6 -0
  54. package/src/components/icons/icons/zoom-in/index.d.ts +6 -0
  55. package/src/components/icons/icons/zoom-out/index.d.ts +6 -0
  56. package/src/components/icons/map.d.ts +13 -1
  57. package/src/components/loading/directive.d.ts +16 -0
  58. package/src/components/loading/hook.d.ts +9 -0
  59. package/src/components/loading/index.d.ts +6 -0
  60. package/src/components/loading/loading-circle.vue.d.ts +2 -0
  61. package/src/components/loading/loading.vue.d.ts +30 -0
  62. package/src/components/loading/service.d.ts +11 -0
  63. package/src/components/loading/types.d.ts +24 -0
  64. package/src/components/loading/use-loading-component.d.ts +29 -0
  65. package/src/components/normal-pendant/index.d.ts +1 -0
  66. package/src/components/normal-pendant/normal-pendant.vue.d.ts +1 -8
  67. package/src/components/normal-pendant/use-normal-pendant.d.ts +36 -0
  68. package/src/components/popup/hooks/popup-props.d.ts +129 -37
  69. package/src/components/popup/hooks/use-popup-back.d.ts +1 -1
  70. package/src/components/popup/hooks/use-popup-config.d.ts +3 -0
  71. package/src/components/popup/hooks/use-popup-height.d.ts +1 -1
  72. package/src/components/popup/hooks/use-popup-scroll.d.ts +1 -0
  73. package/src/components/popup/hooks/use-popup-visible.d.ts +1 -0
  74. package/src/components/popup/popup.vue.d.ts +20 -15
  75. package/src/components/resize-box/index.d.ts +3 -0
  76. package/src/components/resize-box/resize-box.vue.d.ts +97 -0
  77. package/src/components/resize-box/type.d.ts +34 -0
  78. package/src/components/resize-box/use-resize-box.d.ts +105 -0
  79. package/src/components/reward-receive/entrance/reward-receive.vue.d.ts +4 -7
  80. package/src/components/reward-receive/hooks/use-reward-receive.d.ts +8 -3
  81. package/src/components/reward-receive/index.d.ts +1 -0
  82. package/src/components/switch/index.d.ts +2 -0
  83. package/src/components/switch/switch.vue.d.ts +51 -0
  84. package/src/components/switch/use-switch.d.ts +66 -0
  85. package/src/hooks/business/use-config-provider/index.d.ts +18 -5
  86. package/src/hooks/business/use-request/index.d.ts +56 -0
  87. package/src/hooks/business/use-resize-oss-image/index.d.ts +5 -0
  88. package/src/hooks/business/use-skin-color/index.d.ts +44 -0
  89. package/src/hooks/components/use-action-sheet/types.d.ts +27 -5
  90. package/src/hooks/components/use-image-preview/index.d.ts +12 -0
  91. package/src/hooks/components/use-message-box/_component/message-box-element.vue.d.ts +46 -11
  92. package/src/hooks/components/use-message-box/_component/use-message-box-element.d.ts +135 -3
  93. package/src/hooks/components/use-message-box/index.d.ts +3 -0
  94. package/src/hooks/components/use-message-box/types.d.ts +50 -8
  95. package/src/hooks/components/use-popper/_popper-type.d.ts +8 -4
  96. package/src/hooks/components/use-popper/index.d.ts +2 -2
  97. package/src/hooks/components/use-toast/_component/toast-element.vue.d.ts +32 -5
  98. package/src/hooks/components/use-toast/_component/use-toast-element.d.ts +37 -6
  99. package/src/hooks/components/use-toast/hook.d.ts +11 -0
  100. package/src/hooks/components/use-toast/index.d.ts +3 -10
  101. package/src/hooks/components/use-toast/types.d.ts +8 -2
  102. package/src/hooks/exports.d.ts +10 -1
  103. package/src/hooks/interactive/use-hover/index.d.ts +8 -0
  104. package/src/hooks/interactive/use-outside/index.d.ts +24 -0
  105. package/src/hooks/interactive/use-screen-orientation/index.d.ts +2 -2
  106. package/src/hooks/pagination/use-scroll-pagintaion/index.d.ts +1 -0
  107. package/src/hooks/platform/weixin/load-wx-sdk.d.ts +9 -0
  108. package/src/hooks/platform/weixin/use-weixin-mini-program.d.ts +6 -0
  109. package/src/hooks/platform/weixin/use-weixin-sdk.d.ts +14 -0
  110. package/src/hooks/plugin/use-resize-observer/index.d.ts +1 -1
  111. package/src/hooks/tools/use-browser/index.d.ts +8 -0
  112. package/src/hooks/tools/use-download/index.d.ts +6 -0
  113. package/src/hooks/tools/use-event-listener/index.d.ts +1 -1
  114. package/src/hooks/tools/use-set-interval/index.d.ts +1 -0
  115. package/src/hooks/tools/use-set-timeout/index.d.ts +1 -0
  116. package/src/hooks/tools/use-simple-visible/index.d.ts +28 -7
  117. package/src/hooks/vue/use-storage-ref/index.d.ts +3 -0
  118. package/src/hooks/vue/use-vue/index.d.ts +15 -0
  119. package/src/lang/common/en.json.d.ts +5 -1
  120. package/src/lang/common/ja.json.d.ts +5 -1
  121. package/src/lang/common/ko.json.d.ts +5 -1
  122. package/src/lang/common/ru.json.d.ts +5 -1
  123. package/src/lang/common/zh-CN.json.d.ts +5 -1
  124. package/src/lang/common/zh-TW.json.d.ts +5 -1
  125. package/src/lang/internal/index.d.ts +4 -0
  126. package/src/plugins/polyv-ui/mobile-import.d.ts +1 -0
  127. package/src/vue-utils/emit-utils.d.ts +3 -1
  128. package/src/vue-utils/props-utils.d.ts +1 -3
  129. package/styles/animation.scss +0 -9
  130. package/styles/mixins.scss +8 -6
  131. package/styles/skin-color.scss +64 -0
  132. package/src/components/form/form-area-picker/index.d.ts +0 -2
  133. package/src/components/form/form-checkbox/index.d.ts +0 -4
  134. package/src/components/form/form-input/index.d.ts +0 -2
  135. package/src/components/form/form-protocol/index.d.ts +0 -2
  136. package/src/components/form/form-radio/index.d.ts +0 -3
  137. package/src/components/normal-button/index.d.ts +0 -3
  138. package/src/components/normal-button/type.d.ts +0 -28
  139. package/src/hooks/interactive/use-click-outside/index.d.ts +0 -14
  140. package/src/components/form/{form-checkbox/form-checkbox-group.vue.d.ts → checkbox/checkbox-group.vue.d.ts} +0 -0
  141. package/src/components/form/{form-checkbox/form-checkbox.vue.d.ts → checkbox/checkbox.vue.d.ts} +4 -4
  142. /package/src/components/form/{form-checkbox → checkbox}/type.d.ts +0 -0
  143. /package/src/components/form/{form-protocol/form-protocol.vue.d.ts → protocol/protocol.vue.d.ts} +0 -0
  144. /package/src/components/form/{form-radio/form-radio-group.vue.d.ts → radio/radio-group.vue.d.ts} +0 -0
  145. /package/src/components/form/{form-radio → radio}/type.d.ts +0 -0
@@ -0,0 +1,105 @@
1
+ import { VueEmit, VueProps } from '../../vue-utils';
2
+ import { ResizeDirection, ResizeEventData } from './type';
3
+ export declare const resizeBoxProps: () => {
4
+ /**
5
+ * 初始宽度
6
+ * @default 0
7
+ */
8
+ width: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
9
+ default: number;
10
+ };
11
+ /**
12
+ * 初始高度
13
+ * @default 0
14
+ */
15
+ height: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
16
+ default: number;
17
+ };
18
+ /**
19
+ * 最小宽度
20
+ * @default 50
21
+ */
22
+ minWidth: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
23
+ default: number;
24
+ };
25
+ /**
26
+ * 最小高度
27
+ * @default 50
28
+ */
29
+ minHeight: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
30
+ default: number;
31
+ };
32
+ /**
33
+ * 最大宽度
34
+ * @default Infinity
35
+ */
36
+ maxWidth: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
37
+ default: number;
38
+ };
39
+ /**
40
+ * 最大高度
41
+ * @default Infinity
42
+ */
43
+ maxHeight: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
44
+ default: number;
45
+ };
46
+ /**
47
+ * 是否禁用
48
+ * @default false
49
+ */
50
+ disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
51
+ default: boolean;
52
+ };
53
+ /**
54
+ * 拖拽手柄大小
55
+ * @default 8
56
+ */
57
+ handleSize: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
58
+ default: number;
59
+ };
60
+ /**
61
+ * 是否显示拖拽手柄
62
+ * @default true
63
+ */
64
+ showHandles: import('vue-types').VueTypeDef<boolean | ResizeDirection[]> & {
65
+ default: boolean | (() => ResizeDirection[]);
66
+ };
67
+ /**
68
+ * 本地存储的 key
69
+ * @default ''
70
+ */
71
+ storageKey: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
72
+ default: string;
73
+ };
74
+ };
75
+ export declare const resizeBoxEmits: () => {
76
+ /**
77
+ * 开始拖拽
78
+ * @param 拖拽数据
79
+ */
80
+ 'resize-start': import('../../vue-utils').EmitFuncType<ResizeEventData>;
81
+ /**
82
+ * 拖拽中
83
+ * @param 拖拽数据
84
+ */
85
+ resize: import('../../vue-utils').EmitFuncType<ResizeEventData>;
86
+ /**
87
+ * 结束拖拽
88
+ * @param 拖拽数据
89
+ */
90
+ 'resize-end': import('../../vue-utils').EmitFuncType<ResizeEventData>;
91
+ };
92
+ export declare const useResizeBox: (options: {
93
+ props: VueProps<typeof resizeBoxProps>;
94
+ emit: VueEmit<typeof resizeBoxEmits>;
95
+ }) => {
96
+ boxStyle: import('vue').ComputedRef<Record<string, string>>;
97
+ containerRef: import('vue').Ref<HTMLElement | undefined>;
98
+ currentSize: import('vue').Ref<{
99
+ width: number;
100
+ height: number;
101
+ }>;
102
+ isResizing: import('vue').Ref<boolean>;
103
+ showHandleControl: (direction: ResizeDirection) => boolean;
104
+ handleMouseDown: (event: MouseEvent, direction: ResizeDirection) => void;
105
+ };
@@ -1,31 +1,28 @@
1
1
  import { PopupBackActionData } from '../../popup';
2
2
  declare const _default: import('vue').DefineComponent<{
3
+ popupConfig: import('vue-types').VueTypeValidableDef<import('../../popup').PopupConfig, import('vue-types/dist/types').ValidatorFunction<import('../../popup').PopupConfig>>;
3
4
  receiveData: import('vue-types').VueTypeValidableDef<import('..').RewardReceiveData, import('vue-types/dist/types').ValidatorFunction<import('..').RewardReceiveData>>;
4
5
  privacyContent: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
5
6
  default: string;
6
7
  };
7
8
  submitAction: import('vue-types').VueTypeValidableDef<import('../hooks/use-reward-receive').RewardReceiveSubmitAction, import('vue-types/dist/types').ValidatorFunction<import('../hooks/use-reward-receive').RewardReceiveSubmitAction>>;
8
9
  openEvent: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
9
- backable: import('vue-types').VueTypeDef<boolean | undefined> & {
10
- default: boolean | undefined;
11
- };
10
+ backable: import('vue-types').VueTypeValidableDef<boolean | undefined, import('vue-types/dist/types').ValidatorFunction<boolean | undefined>>;
12
11
  }, {
13
12
  setupBackAction: (data: PopupBackActionData) => void;
14
13
  setupReceiveData: (data: import('..').RewardReceiveData) => void;
15
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
15
  "click-back": (arg?: void | undefined) => void;
17
16
  }, string, Readonly<import('vue').ExtractPropTypes<{
17
+ popupConfig: import('vue-types').VueTypeValidableDef<import('../../popup').PopupConfig, import('vue-types/dist/types').ValidatorFunction<import('../../popup').PopupConfig>>;
18
18
  receiveData: import('vue-types').VueTypeValidableDef<import('..').RewardReceiveData, import('vue-types/dist/types').ValidatorFunction<import('..').RewardReceiveData>>;
19
19
  privacyContent: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
20
20
  default: string;
21
21
  };
22
22
  submitAction: import('vue-types').VueTypeValidableDef<import('../hooks/use-reward-receive').RewardReceiveSubmitAction, import('vue-types/dist/types').ValidatorFunction<import('../hooks/use-reward-receive').RewardReceiveSubmitAction>>;
23
23
  openEvent: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
24
- backable: import('vue-types').VueTypeDef<boolean | undefined> & {
25
- default: boolean | undefined;
26
- };
24
+ backable: import('vue-types').VueTypeValidableDef<boolean | undefined, import('vue-types/dist/types').ValidatorFunction<boolean | undefined>>;
27
25
  }>>, {
28
- backable: boolean | undefined;
29
26
  privacyContent: string;
30
27
  }>;
31
28
  export default _default;
@@ -3,8 +3,10 @@ import { VueProps } from '../../../vue-utils';
3
3
  import { RewardReceiveData } from '../types';
4
4
  export type RewardReceiveSubmitAction = (formValue: Record<number, any>) => Promise<void>;
5
5
  export declare const rewardReceiveProps: () => {
6
+ popupConfig: import('vue-types').VueTypeValidableDef<import('../../popup').PopupConfig, import('vue-types/dist/types').ValidatorFunction<import('../../popup').PopupConfig>>;
6
7
  /**
7
8
  * 领取数据
9
+ * @propType RewardReceiveData
8
10
  */
9
11
  receiveData: import('vue-types').VueTypeValidableDef<RewardReceiveData, import('vue-types/dist/types').ValidatorFunction<RewardReceiveData>>;
10
12
  /**
@@ -15,6 +17,7 @@ export declare const rewardReceiveProps: () => {
15
17
  };
16
18
  /**
17
19
  * 提交操作
20
+ * @propType RewardReceiveSubmitAction
18
21
  */
19
22
  submitAction: import('vue-types').VueTypeValidableDef<RewardReceiveSubmitAction, import('vue-types/dist/types').ValidatorFunction<RewardReceiveSubmitAction>>;
20
23
  /**
@@ -24,9 +27,7 @@ export declare const rewardReceiveProps: () => {
24
27
  /**
25
28
  * 是否显示返回
26
29
  */
27
- backable: import('vue-types').VueTypeDef<boolean | undefined> & {
28
- default: boolean | undefined;
29
- };
30
+ backable: import('vue-types').VueTypeValidableDef<boolean | undefined, import('vue-types/dist/types').ValidatorFunction<boolean | undefined>>;
30
31
  };
31
32
  export declare const rewardReceiveEmits: () => {
32
33
  /**
@@ -76,6 +77,10 @@ export declare const useRewardReceive: (options: {
76
77
  submitSuccess: string;
77
78
  known: string;
78
79
  copySuccess: string;
80
+ copyLinkSuccess: string;
81
+ tips: string;
82
+ success: string;
83
+ empty: string;
79
84
  };
80
85
  }>, options?: import('../../..').UniversalParams<string | number>) => string;
81
86
  onPickerTextChange: (text: string[]) => void;
@@ -1,3 +1,4 @@
1
1
  export * from './types';
2
+ export { rewardReceiveProps, rewardReceiveEmits } from './hooks/use-reward-receive';
2
3
  export type { RewardReceiveInstance, RewardReceiveSubmitAction } from './hooks/use-reward-receive';
3
4
  export { default as PwcRewardReceivePopup } from './entrance/reward-receive.vue';
@@ -0,0 +1,2 @@
1
+ export { default as PwcSwitch } from './switch.vue';
2
+ export * from './use-switch';
@@ -0,0 +1,51 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ value: import('vue-types').VueTypeDef<import('./use-switch').SwitchValue>;
3
+ disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
4
+ default: boolean;
5
+ };
6
+ activeValue: import('vue-types').VueTypeDef<import('./use-switch').SwitchValue> & {
7
+ default: import('./use-switch').SwitchValue;
8
+ };
9
+ inactiveValue: import('vue-types').VueTypeDef<import('./use-switch').SwitchValue> & {
10
+ default: import('./use-switch').SwitchValue;
11
+ };
12
+ activeColor: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
13
+ default: string;
14
+ };
15
+ inactiveColor: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
16
+ default: string;
17
+ };
18
+ size: import('vue-types').VueTypeDef<"default" | "mini" | "medium"> & {
19
+ default: "default" | "mini" | "medium";
20
+ };
21
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ change: (arg: import('./use-switch').SwitchValue) => void;
23
+ }, string, Readonly<import('vue').ExtractPropTypes<{
24
+ value: import('vue-types').VueTypeDef<import('./use-switch').SwitchValue>;
25
+ disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
26
+ default: boolean;
27
+ };
28
+ activeValue: import('vue-types').VueTypeDef<import('./use-switch').SwitchValue> & {
29
+ default: import('./use-switch').SwitchValue;
30
+ };
31
+ inactiveValue: import('vue-types').VueTypeDef<import('./use-switch').SwitchValue> & {
32
+ default: import('./use-switch').SwitchValue;
33
+ };
34
+ activeColor: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
35
+ default: string;
36
+ };
37
+ inactiveColor: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
38
+ default: string;
39
+ };
40
+ size: import('vue-types').VueTypeDef<"default" | "mini" | "medium"> & {
41
+ default: "default" | "mini" | "medium";
42
+ };
43
+ }>>, {
44
+ disabled: boolean;
45
+ size: "default" | "mini" | "medium";
46
+ activeValue: import('./use-switch').SwitchValue;
47
+ inactiveValue: import('./use-switch').SwitchValue;
48
+ activeColor: string;
49
+ inactiveColor: string;
50
+ }>;
51
+ export default _default;
@@ -0,0 +1,66 @@
1
+ import { VueEmit, VueProps } from '../../vue-utils';
2
+ export type SwitchValue = boolean | number | string;
3
+ export declare const switchProps: () => {
4
+ /**
5
+ * 是否选中,支持 v-model
6
+ */
7
+ value: import('vue-types').VueTypeDef<SwitchValue>;
8
+ /**
9
+ * 是否禁用
10
+ * @default false
11
+ */
12
+ disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
13
+ default: boolean;
14
+ };
15
+ /**
16
+ * 激活值
17
+ * @default true
18
+ */
19
+ activeValue: import('vue-types').VueTypeDef<SwitchValue> & {
20
+ default: SwitchValue;
21
+ };
22
+ /**
23
+ * 非激活值
24
+ * @default false
25
+ */
26
+ inactiveValue: import('vue-types').VueTypeDef<SwitchValue> & {
27
+ default: SwitchValue;
28
+ };
29
+ /**
30
+ * 激活颜色
31
+ */
32
+ activeColor: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
33
+ default: string;
34
+ };
35
+ /**
36
+ * 非激活颜色
37
+ */
38
+ inactiveColor: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
39
+ default: string;
40
+ };
41
+ /**
42
+ * 大小
43
+ * @default 'default'
44
+ */
45
+ size: import('vue-types').VueTypeDef<"default" | "mini" | "medium"> & {
46
+ default: "default" | "mini" | "medium";
47
+ };
48
+ };
49
+ export declare const switchEmits: () => {
50
+ /**
51
+ * 开关切换
52
+ * @cbName 开关值
53
+ * @cbType SwitchValue
54
+ */
55
+ change: import('../../vue-utils').EmitFuncType<SwitchValue>;
56
+ };
57
+ export declare const useSwitch: (options: {
58
+ props: VueProps<typeof switchProps>;
59
+ emit: VueEmit<typeof switchEmits>;
60
+ }) => {
61
+ isOpened: import('vue').ComputedRef<boolean>;
62
+ switchStyle: import('vue').ComputedRef<{
63
+ backgroundColor: string;
64
+ }>;
65
+ toggleSwitch: () => void;
66
+ };
@@ -1,11 +1,11 @@
1
1
  import { PwcEventEmitter } from '../../tools/use-event-bus';
2
+ import { InjectionKey } from 'vue';
2
3
  import { TrackEventData } from '../use-track-event';
3
4
  import { I18nLangs } from '../../../lang/types';
4
- /** 配置注入 key */
5
- export declare const ConfigProviderInjectKey = "pwcConfigProvider";
5
+ import { SkinColorConfig } from '../use-skin-color';
6
6
  export interface ConfigProviderInjectData {
7
7
  /** 当前语言 */
8
- globalLang?: I18nLangs;
8
+ globalLang?: I18nLangs | (() => I18nLangs);
9
9
  /** 是否网页 css 全屏 */
10
10
  pageFullscreen?: boolean;
11
11
  /** 全屏元素 */
@@ -14,9 +14,22 @@ export interface ConfigProviderInjectData {
14
14
  getEmitter?: () => PwcEventEmitter;
15
15
  /** 埋点回调 */
16
16
  trackEventCallback?: (data: TrackEventData) => unknown;
17
+ /**
18
+ * 皮肤颜色配置
19
+ */
20
+ getSkinColorConfig?: () => SkinColorConfig;
21
+ }
22
+ export interface ConfigProviderOptions {
23
+ /**
24
+ * 自动应用根节点皮肤颜色 class
25
+ * @default true
26
+ */
27
+ autoSkinColorRoot?: boolean;
17
28
  }
18
- export declare const useConfigProvider: (config: ConfigProviderInjectData) => void;
19
- export declare const useConfigProviderInject: () => {
29
+ /** 配置注入 key */
30
+ export declare const ConfigProviderInjectKey: InjectionKey<ConfigProviderInjectData>;
31
+ export declare const useConfigProvider: (config?: ConfigProviderInjectData, options?: ConfigProviderOptions) => void;
32
+ export declare const useConfigProviderInject: (defConfig?: ConfigProviderInjectData) => {
20
33
  configProviderData: ConfigProviderInjectData | undefined;
21
34
  getEmitter: () => PwcEventEmitter;
22
35
  };
@@ -0,0 +1,56 @@
1
+ import { Ref } from 'vue';
2
+ export type UseRequestFunction<R, P extends any[] = any> = (...params: P) => Promise<R>;
3
+ export interface UseRequestOptions<R, P extends any[]> {
4
+ /**
5
+ * 请求中响应式对象
6
+ */
7
+ loading?: Ref<boolean>;
8
+ /**
9
+ * 同步 loading 状态
10
+ */
11
+ syncLoadings?: Ref<boolean>[];
12
+ /**
13
+ * 请求中禁用请求
14
+ * @default true
15
+ */
16
+ loadingDisabledRequest?: boolean;
17
+ /**
18
+ * 提示成功
19
+ * @default false
20
+ */
21
+ toastSuccess?: boolean;
22
+ /**
23
+ * 提示错误信息
24
+ * @default false
25
+ */
26
+ toastError?: boolean;
27
+ /**
28
+ * 成功文案
29
+ */
30
+ successMessage?: string;
31
+ /**
32
+ * 请求前
33
+ */
34
+ beforeRequest?: (...params: P) => unknown;
35
+ /**
36
+ * 成功后回调
37
+ */
38
+ onSuccess?: (res: R, ...params: P) => unknown;
39
+ /**
40
+ * 失败后回调
41
+ */
42
+ onFail?: (error: Error, ...params: P) => unknown;
43
+ /**
44
+ * 完成后回调
45
+ */
46
+ onFinally?: (...params: P) => unknown;
47
+ }
48
+ /**
49
+ * 请求 hook
50
+ * @param fn 请求方法
51
+ */
52
+ export declare const useRequest: <R, P extends any[] = any>(fn: UseRequestFunction<R, P>, options?: UseRequestOptions<R, P>) => {
53
+ loading: Ref<boolean>;
54
+ requestFinished: Ref<boolean>;
55
+ request: (...params: P) => Promise<R | undefined>;
56
+ };
@@ -0,0 +1,5 @@
1
+ export declare const useResizeOssImage: () => {
2
+ appendToOssProcess: (url: string, additionalParams: string) => string;
3
+ resizeOSSImg: (url: string, width?: number, height?: number) => string;
4
+ resizeHtmlContentImg: (htmlContent: string, width?: number) => string;
5
+ };
@@ -0,0 +1,44 @@
1
+ import { ConfigProviderInjectData } from '../use-config-provider';
2
+ import { VueProps } from '../../../vue-utils';
3
+ /**
4
+ * 皮肤颜色模式
5
+ */
6
+ export type SkinColorMode = 'light' | 'dark';
7
+ export interface SkinColorConfig {
8
+ /**
9
+ * 皮肤颜色模式
10
+ * @default dark
11
+ */
12
+ skinColorMode?: SkinColorMode;
13
+ /**
14
+ * 特殊颜色
15
+ * @default #3F76FC
16
+ */
17
+ specialColor?: string;
18
+ }
19
+ /**
20
+ * 生成皮肤颜色 class
21
+ * @param suffix 后缀
22
+ */
23
+ export declare function genSkinColorClass<T extends string>(suffix: T): string;
24
+ export declare const useSkinColorConfig: (_configProviderData?: ConfigProviderInjectData) => {
25
+ skinColorConfig: import('vue').ComputedRef<{
26
+ skinColorMode: SkinColorMode;
27
+ specialColor: string;
28
+ }>;
29
+ currentSkinColorMode: import('vue').ComputedRef<"light" | "dark">;
30
+ genSkinColorClass: typeof genSkinColorClass;
31
+ getSpecialColor: (opacity?: number) => string;
32
+ };
33
+ export declare const useSkinColorRoot: (_configProviderData?: ConfigProviderInjectData) => void;
34
+ export declare const skinColorIgnoreProps: () => {
35
+ /** 是否忽略皮肤颜色 */
36
+ ignoreSkinColor: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
37
+ default: boolean;
38
+ };
39
+ };
40
+ export declare const useSkinColorIgnore: (options?: {
41
+ props?: VueProps<typeof skinColorIgnoreProps>;
42
+ }) => {
43
+ skinColorIgnoreClass: import('vue').ComputedRef<string | undefined>;
44
+ };
@@ -1,15 +1,37 @@
1
1
  /**
2
- * 操作列表项
2
+ * 操作栏列表项
3
3
  */
4
4
  export interface ActionSheetItem {
5
- /** 名称 */
5
+ /**
6
+ * 名称
7
+ */
6
8
  name: string;
7
- /** 值 */
9
+ /**
10
+ * 值
11
+ */
8
12
  value?: string;
9
- /** 是否隐藏 */
13
+ /**
14
+ * 是否隐藏
15
+ * @default false
16
+ */
10
17
  hidden?: boolean;
18
+ /**
19
+ * 是否禁用
20
+ * @default false
21
+ */
22
+ disabled?: boolean;
23
+ /**
24
+ * 禁用时的提示
25
+ */
26
+ disabledTip?: string;
11
27
  }
28
+ /**
29
+ * 操作栏选项
30
+ */
12
31
  export interface ActionSheetOptions {
13
- /** 操作列表 */
32
+ /**
33
+ * 操作列表
34
+ * @propType ActionSheetItem[]
35
+ */
14
36
  actions: ActionSheetItem[];
15
37
  }
@@ -0,0 +1,12 @@
1
+ export interface ImagePreviewOptions {
2
+ /** 模式显示的下标 */
3
+ initialIndex?: number;
4
+ }
5
+ export interface ImagePreviewInstance {
6
+ /** 关闭 */
7
+ close(): void;
8
+ }
9
+ export declare const useImagePreview: () => {
10
+ previewImage: (images?: string | string[], options?: ImagePreviewOptions) => ImagePreviewInstance;
11
+ clickImgToPreview: (event: Event) => void;
12
+ };
@@ -11,8 +11,8 @@ declare const _default: import('vue').DefineComponent<{
11
11
  showConfirmButton: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
12
12
  default: boolean;
13
13
  };
14
- cancelButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/normal-button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/normal-button').ButtonType>> & {
15
- default: import('../../../../components/normal-button').ButtonType;
14
+ cancelButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/button').ButtonType>> & {
15
+ default: import('../../../../components/button').ButtonType;
16
16
  };
17
17
  cancelButtonText: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
18
18
  default: string;
@@ -20,12 +20,27 @@ declare const _default: import('vue').DefineComponent<{
20
20
  confirmButtonText: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
21
21
  default: string;
22
22
  };
23
- confirmButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/normal-button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/normal-button').ButtonType>> & {
24
- default: import('../../../../components/normal-button').ButtonType;
23
+ confirmButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/button').ButtonType>> & {
24
+ default: import('../../../../components/button').ButtonType;
25
+ };
26
+ showInput: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
27
+ default: boolean;
28
+ };
29
+ defaultValue: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
30
+ default: string;
31
+ };
32
+ placeholder: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
33
+ default: string;
34
+ };
35
+ type: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
36
+ default: string;
37
+ };
38
+ requireMessage: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
39
+ default: string;
25
40
  };
26
41
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
42
+ confirm: (arg?: string | void | undefined) => void;
27
43
  cancel: (arg?: void | undefined) => void;
28
- confirm: (arg?: void | undefined) => void;
29
44
  }, string, Readonly<import('vue').ExtractPropTypes<{
30
45
  message: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
31
46
  default: string;
@@ -39,8 +54,8 @@ declare const _default: import('vue').DefineComponent<{
39
54
  showConfirmButton: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
40
55
  default: boolean;
41
56
  };
42
- cancelButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/normal-button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/normal-button').ButtonType>> & {
43
- default: import('../../../../components/normal-button').ButtonType;
57
+ cancelButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/button').ButtonType>> & {
58
+ default: import('../../../../components/button').ButtonType;
44
59
  };
45
60
  cancelButtonText: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
46
61
  default: string;
@@ -48,17 +63,37 @@ declare const _default: import('vue').DefineComponent<{
48
63
  confirmButtonText: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
49
64
  default: string;
50
65
  };
51
- confirmButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/normal-button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/normal-button').ButtonType>> & {
52
- default: import('../../../../components/normal-button').ButtonType;
66
+ confirmButtonType: import('vue-types').VueTypeValidableDef<import('../../../../components/button').ButtonType, import('vue-types/dist/types').ValidatorFunction<import('../../../../components/button').ButtonType>> & {
67
+ default: import('../../../../components/button').ButtonType;
68
+ };
69
+ showInput: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
70
+ default: boolean;
71
+ };
72
+ defaultValue: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
73
+ default: string;
74
+ };
75
+ placeholder: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
76
+ default: string;
77
+ };
78
+ type: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
79
+ default: string;
80
+ };
81
+ requireMessage: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
82
+ default: string;
53
83
  };
54
84
  }>>, {
85
+ type: string;
55
86
  description: string;
56
87
  message: string;
88
+ placeholder: string;
57
89
  showCancelButton: boolean;
58
90
  showConfirmButton: boolean;
59
- cancelButtonType: import('../../../../components/normal-button').ButtonType;
91
+ cancelButtonType: import('../../../../components/button').ButtonType;
60
92
  cancelButtonText: string;
61
93
  confirmButtonText: string;
62
- confirmButtonType: import('../../../../components/normal-button').ButtonType;
94
+ confirmButtonType: import('../../../../components/button').ButtonType;
95
+ showInput: boolean;
96
+ defaultValue: string;
97
+ requireMessage: string;
63
98
  }>;
64
99
  export default _default;