@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,61 @@
1
+ import { UniversalParams } from '../interface';
2
+ import { IconComponentOption } from '@polyv/icons-vue/icon-builder';
3
+ import { ComputedRef, CSSProperties, ExtractPropTypes } from 'vue';
4
+ import { oneOf as _oneOf, oneOfType as _oneOfType, VueTypeValidableDef } from 'vue-types';
5
+ /** prop 配置工具 */
6
+ export declare const PropUtils: {
7
+ /** String 类型,默认:'' */
8
+ readonly string: VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>> & {
9
+ default: string;
10
+ };
11
+ /** String 类型,默认:undefined */
12
+ readonly looseString: VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
13
+ /** Number 类型,默认:0 */
14
+ readonly number: VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
15
+ default: number;
16
+ };
17
+ /** Number 类型,默认:undefined */
18
+ readonly looseNumber: VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
19
+ /** Boolean 类型,默认:true */
20
+ readonly bool: VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
21
+ default: boolean;
22
+ };
23
+ readonly looseBool: import('vue-types').VueTypeDef<boolean | undefined> & {
24
+ default: boolean | undefined;
25
+ };
26
+ readonly looseElement: import('vue-types').VueTypeDef<HTMLElement | undefined> & {
27
+ default: (() => HTMLElement) | undefined;
28
+ };
29
+ /** Array 类型,默认:[] */
30
+ array: <T = unknown>() => VueTypeValidableDef<T[], import('vue-types/dist/types').ValidatorFunction<T[]>> & {
31
+ default: () => T[];
32
+ };
33
+ /** Object 类型 */
34
+ object: <T extends {
35
+ [key: string]: any;
36
+ }>() => import('vue-types/dist/types').VueTypeValidableDef<T, import('vue-types/dist/types').ValidatorFunction<T>>;
37
+ /** Function 类型 */
38
+ func: <T extends (...args: any[]) => any>() => import('vue-types/dist/types').VueTypeValidableDef<T, import('vue-types/dist/types').ValidatorFunction<T>>;
39
+ /** 指定为数组中的值 */
40
+ oneOf: typeof _oneOf;
41
+ /** 自定义类型 */
42
+ oneOfType: typeof _oneOfType;
43
+ /** 枚举类型 */
44
+ enum: <T extends string = string>() => import('vue-types/dist/types').VueTypeValidableDef<T, import('vue-types/dist/types').ValidatorFunction<T>>;
45
+ /** 样式 */
46
+ style: () => VueTypeValidableDef<CSSProperties, import('vue-types/dist/types').ValidatorFunction<CSSProperties>> & {
47
+ default: () => CSSProperties;
48
+ };
49
+ /** 图标组件类型 */
50
+ icon: () => VueTypeValidableDef<IconComponentOption>;
51
+ modelValueKey: "value";
52
+ };
53
+ /** 将 props 定义函数转成类型 */
54
+ export type VueProps<FN extends () => UniversalParams> = Readonly<ExtractPropTypes<ReturnType<FN>>>;
55
+ /** 将 props 定义函数转成类型 */
56
+ export type FormatProps<FN extends () => UniversalParams> = Partial<ExtractPropTypes<ReturnType<FN>>>;
57
+ export type PropComputedRefs<P extends object> = {
58
+ [K in keyof P]: ComputedRef<P[K]>;
59
+ };
60
+ /** 结构 props,将 props 转成 computed */
61
+ export declare const useProps: <P extends object>(props: P) => PropComputedRefs<P>;
@@ -0,0 +1,24 @@
1
+ // 渐变动画
2
+ .pwc-fade-enter-active {
3
+ animation: pwc-fade-in .3s;
4
+ }
5
+ .pwc-fade-leave-active {
6
+ animation: pwc-fade-in .35s reverse;
7
+ }
8
+ @keyframes pwc-fade-in {
9
+ 0% {
10
+ opacity: 0;
11
+ }
12
+ 100% {
13
+ opacity: 1;
14
+ }
15
+ }
16
+
17
+ @keyframes pwc-loading-animation {
18
+ 0% {
19
+ transform: rotateZ(0);
20
+ }
21
+ 100% {
22
+ transform: rotateZ(360deg);
23
+ }
24
+ }
@@ -0,0 +1,123 @@
1
+ /**
2
+ * 清除输入框样式
3
+ */
4
+ @mixin clear-input-style {
5
+ background: none;
6
+ border: none;
7
+ border-radius: 0;
8
+ outline: none;
9
+ &::-webkit-input-placeholder {
10
+ color: #9E9E9E;
11
+ }
12
+ &::placeholder {
13
+ color: #9E9E9E;
14
+ }
15
+ &::-webkit-outer-spin-button,
16
+ &::-webkit-inner-spin-button {
17
+ -webkit-appearance: none !important;
18
+ margin: 0;
19
+ }
20
+ &[type=number] {
21
+ appearance: textfield;
22
+ -moz-appearance: textfield;
23
+ }
24
+ &[disabled] {
25
+ opacity: 1;
26
+ }
27
+ &[type=button],
28
+ &[type=submit],
29
+ &[type=reset] {
30
+ appearance: none;
31
+ -webkit-appearance: none;
32
+ background: #fff;
33
+ }
34
+ }
35
+
36
+ /**
37
+ * 滚动条样式
38
+ * @param {string} $trackColor - 轨道颜色
39
+ * @param {string} $trackBorder - 轨道边框颜色
40
+ * @param {string} $thumbColor - 滑块颜色
41
+ * @param {string} $thumbColor-hover - 滑块悬停颜色
42
+ * @param {string} $thumbColor-active - 滑块激活颜色
43
+ */
44
+ @mixin scrollbar($trackColor: #f5f5f5, $trackBorder: transparent, $thumbColor: rgba(189, 189, 189, 0.5), $thumbColor-hover: rgba(158, 158, 158, 0.8), $thumbColor-active: rgba(158, 158, 158, 0.9)) {
45
+ &::-webkit-scrollbar {
46
+ width: 6px;
47
+ height: 6px;
48
+ }
49
+ &::-webkit-scrollbar-thumb {
50
+ background-color: $thumbColor;
51
+ border-radius: 3px;
52
+ transition: background-color 0.2s ease;
53
+ &:hover {
54
+ background-color: $thumbColor-hover;
55
+ }
56
+ &:active {
57
+ background-color: $thumbColor-active;
58
+ }
59
+ }
60
+ &::-webkit-scrollbar-track {
61
+ background-color: $trackColor;
62
+ border-left: 1px solid $trackBorder;
63
+ }
64
+ }
65
+
66
+ /**
67
+ * 通用滚动条样式
68
+ */
69
+ @mixin common-scrollbar {
70
+ @include scrollbar(transparent, transparent, rgba(#000000, 0.16));
71
+ }
72
+
73
+ /**
74
+ * 对于 iphone x 系列采用安全距离作为底部 padding
75
+ * @param {number} $normalBottom - 若非 iphone x 系列,底部距离
76
+ */
77
+ @mixin iphone-x-pb($normalBottom, $isReplace: true) {
78
+ @if $normalBottom == 0 {
79
+ $normalBottom: unquote('0px');
80
+ }
81
+
82
+ // 用安全距离替换原底部padding值。若原底部padding值大于底部安全距离,则不会被替换。
83
+ @if $isReplace {
84
+ padding-bottom: $normalBottom;
85
+ .g-page--ios & {
86
+ @supports (padding-bottom: env(safe-area-inset-bottom)) or (padding-bottom: constant(safe-area-inset-bottom, $normalBottom)) {
87
+ padding-bottom: unquote('max(constant(safe-area-inset-bottom, #{$normalBottom}), #{$normalBottom})');
88
+ padding-bottom: unquote('max(env(safe-area-inset-bottom, #{$normalBottom}), #{$normalBottom})');
89
+ }
90
+ }
91
+ } @else {
92
+ // 安全距离与原底部padding值叠加
93
+ // ios < 11.2
94
+ padding-bottom: calc(constant(safe-area-inset-bottom) + #{$normalBottom});
95
+ // ios >= 11.2
96
+ padding-bottom: calc(env(safe-area-inset-bottom) + #{$normalBottom});
97
+ // 兼容不支持calc(env(safe-area-inset-bottom)和calc(constant(safe-area-inset-bottom)这两种写法的浏览器,假设安全距离为0,设置padding-bottom为传出的值
98
+ @supports not(padding-bottom: calc(env(safe-area-inset-bottom) + #{$normalBottom}) or (padding-bottom: calc(constant(safe-area-inset-bottom, $normalBottom) + #{$normalBottom}))) {
99
+ padding-bottom: $normalBottom;
100
+ }
101
+ }
102
+ }
103
+
104
+ /**
105
+ * 单行文本截断省略
106
+ */
107
+ @mixin singleline-text {
108
+ overflow: hidden;
109
+ text-overflow: ellipsis;
110
+ white-space: nowrap;
111
+ }
112
+
113
+ /**
114
+ * 多行文本截断省略
115
+ * @param {number} $number - 行数
116
+ */
117
+ @mixin multiline-text($number: 2) {
118
+ display: -webkit-box;
119
+ -webkit-box-orient: vertical;
120
+ -webkit-line-clamp: $number;
121
+ text-overflow: ellipsis;
122
+ overflow: hidden;
123
+ }