hy-app 0.4.4 → 0.4.6

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 (151) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +1 -1
  2. package/components/hy-address-picker/hy-address-picker.vue +1 -1
  3. package/components/hy-avatar/hy-avatar.vue +1 -1
  4. package/components/hy-back-top/hy-back-top.vue +1 -2
  5. package/components/hy-badge/hy-badge.vue +1 -1
  6. package/components/hy-button/hy-button.vue +1 -2
  7. package/components/hy-calendar/hy-calendar.vue +3 -11
  8. package/components/hy-calendar/month.vue +3 -3
  9. package/components/hy-card/hy-card.vue +1 -1
  10. package/components/hy-cell/hy-cell.vue +1 -2
  11. package/components/hy-cell/props.ts +1 -1
  12. package/components/hy-check-button/hy-check-button.vue +2 -2
  13. package/components/hy-checkbox/hy-checkbox.vue +2 -3
  14. package/components/hy-checkbox-group/hy-checkbox-group.vue +1 -1
  15. package/components/hy-checkbox-item/hy-checkbox-item.vue +1 -2
  16. package/components/hy-code-input/hy-code-input.vue +1 -1
  17. package/components/hy-config-provider/hy-config-provider.vue +2 -3
  18. package/components/hy-config-provider/props.ts +1 -1
  19. package/components/hy-count-down/index.ts +1 -1
  20. package/components/hy-count-to/hy-count-to.vue +1 -1
  21. package/components/hy-datetime-picker/hy-datetime-picker.vue +2 -3
  22. package/components/hy-datetime-picker/props.ts +1 -1
  23. package/components/hy-divider/hy-divider.vue +1 -2
  24. package/components/hy-divider/props.ts +1 -1
  25. package/components/hy-dropdown/hy-dropdown.vue +2 -3
  26. package/components/hy-dropdown/props.ts +1 -1
  27. package/components/hy-dropdown-item/hy-dropdown-item.vue +1 -2
  28. package/components/hy-empty/hy-empty.vue +1 -1
  29. package/components/hy-flex/hy-flex.vue +1 -1
  30. package/components/hy-float-button/hy-float-button.vue +1 -2
  31. package/components/hy-float-button/props.ts +14 -14
  32. package/components/hy-folding-panel/hy-folding-panel.vue +2 -3
  33. package/components/hy-folding-panel/props.ts +1 -1
  34. package/components/hy-form/hy-form.vue +1 -1
  35. package/components/hy-form-group/hy-form-group.vue +183 -111
  36. package/components/hy-form-group/typing.d.ts +1 -1
  37. package/components/hy-form-item/hy-form-item.vue +1 -1
  38. package/components/hy-grid/hy-grid.vue +1 -1
  39. package/components/hy-icon/hy-icon.vue +1 -1
  40. package/components/hy-icon/index.scss +1 -1
  41. package/components/hy-image/hy-image.vue +1 -2
  42. package/components/hy-image/props.ts +10 -10
  43. package/components/hy-input/hy-input.vue +1 -2
  44. package/components/hy-line/hy-line.vue +1 -1
  45. package/components/hy-line-progress/hy-line-progress.vue +1 -2
  46. package/components/hy-list/hy-list.vue +7 -5
  47. package/components/hy-loading/hy-loading.vue +11 -9
  48. package/components/hy-loading/index.scss +14 -5
  49. package/components/hy-menu/hy-menu.vue +1 -1
  50. package/components/hy-modal/hy-modal.vue +2 -2
  51. package/components/hy-modal/props.ts +13 -13
  52. package/components/hy-navbar/hy-navbar.vue +63 -60
  53. package/components/hy-navbar/props.ts +1 -1
  54. package/components/hy-notice-bar/hy-column-notice.vue +1 -2
  55. package/components/hy-notice-bar/hy-notice-bar.vue +1 -1
  56. package/components/hy-notice-bar/hy-row-notice.vue +1 -2
  57. package/components/hy-notice-bar/props.ts +1 -1
  58. package/components/hy-notify/hy-notify.vue +1 -2
  59. package/components/hy-number-step/hy-number-step.vue +1 -2
  60. package/components/hy-overlay/hy-overlay.vue +1 -1
  61. package/components/hy-pagination/hy-pagination.vue +1 -1
  62. package/components/hy-picker/hy-picker.vue +1 -2
  63. package/components/hy-popover/hy-popover.vue +9 -3
  64. package/components/hy-popup/hy-popup.vue +2 -3
  65. package/components/hy-price/hy-price.vue +3 -2
  66. package/components/hy-qrcode/hy-qrcode.vue +1 -1
  67. package/components/hy-radio/hy-radio.vue +1 -2
  68. package/components/hy-rate/hy-rate.vue +7 -4
  69. package/components/hy-rate/props.ts +6 -6
  70. package/components/hy-read-more/hy-read-more.vue +1 -2
  71. package/components/hy-scroll-list/hy-scroll-list.vue +1 -1
  72. package/components/hy-scroll-list/props.ts +0 -1
  73. package/components/hy-search/hy-search.vue +4 -4
  74. package/components/hy-search/index.scss +1 -0
  75. package/components/hy-signature/hy-signature.vue +1 -1
  76. package/components/hy-slider/hy-slider.vue +3 -13
  77. package/components/hy-slider/props.ts +1 -1
  78. package/components/hy-status-bar/hy-status-bar.vue +1 -1
  79. package/components/hy-status-bar/props.ts +1 -1
  80. package/components/hy-steps/hy-steps.vue +1 -2
  81. package/components/hy-subsection/hy-subsection.vue +1 -1
  82. package/components/hy-subsection/props.ts +0 -1
  83. package/components/hy-subsection/typing.d.ts +0 -1
  84. package/components/hy-swipe-action/hy-swipe-action.vue +1 -2
  85. package/components/hy-swiper/hy-swiper-indicator.vue +1 -1
  86. package/components/hy-swiper/hy-swiper.vue +2 -3
  87. package/components/hy-swiper/typing.d.ts +35 -36
  88. package/components/hy-switch/hy-switch.vue +2 -2
  89. package/components/hy-switch/typing.d.ts +0 -1
  90. package/components/hy-tabs/hy-tabs.vue +2 -3
  91. package/components/hy-tag/hy-tag.vue +1 -2
  92. package/components/hy-text/hy-text.vue +2 -2
  93. package/components/hy-text/typing.d.ts +26 -26
  94. package/components/hy-textarea/hy-textarea.vue +2 -2
  95. package/components/hy-toast/hy-toast.vue +34 -19
  96. package/components/hy-toast/index.scss +3 -2
  97. package/components/hy-toast/typing.d.ts +1 -1
  98. package/components/hy-tooltip/hy-tooltip.vue +8 -2
  99. package/components/hy-transition/hy-transition.vue +1 -1
  100. package/components/hy-upload/hy-upload.vue +7 -2
  101. package/components/hy-upload/props.ts +1 -1
  102. package/components/hy-warn/hy-warn.vue +1 -2
  103. package/components/hy-warn/typing.d.ts +12 -13
  104. package/components/hy-waterfall/hy-waterfall.vue +1 -1
  105. package/components/hy-watermark/hy-watermark.vue +3 -2
  106. package/components/index.ts +117 -118
  107. package/index.ts +1 -7
  108. package/{api → libs/api}/http.ts +3 -3
  109. package/libs/common/index.ts +2 -0
  110. package/libs/common/queue.ts +28 -0
  111. package/{composables → libs/composables}/index.ts +1 -0
  112. package/{composables → libs/composables}/usePopover.ts +7 -2
  113. package/{common/shakeService.ts → libs/composables/useShakeService.ts} +4 -2
  114. package/{composables → libs/composables}/useShare.ts +3 -0
  115. package/libs/composables/useToast.ts +45 -0
  116. package/{composables → libs/composables}/useTouch.ts +3 -0
  117. package/libs/css/theme.scss +1 -1
  118. package/libs/css/vars.scss +2 -2
  119. package/{global → libs/global}/register-properties.ts +1 -1
  120. package/libs/index.ts +7 -0
  121. package/{typing → libs/typing}/index.ts +0 -1
  122. package/{typing → libs/typing}/modules/form.ts +7 -7
  123. package/{utils → libs/utils}/utils.ts +28 -0
  124. package/package.json +2 -2
  125. package/common/index.ts +0 -3
  126. package/common/queue.ts +0 -34
  127. package/components/hy-form/README.md +0 -301
  128. package/components/hy-text/index.ts +0 -0
  129. package/components/yk-dialog/yk-dialog.vue +0 -129
  130. package/composables/useToast.ts +0 -51
  131. package/typing/modules/dialog.ts +0 -17
  132. /package/{api → libs/api}/index.ts +0 -0
  133. /package/{common → libs/common}/versionControl.ts +0 -0
  134. /package/{composables → libs/composables}/useQueue.ts +0 -0
  135. /package/{config → libs/config}/color.ts +0 -0
  136. /package/{config → libs/config}/icon.ts +0 -0
  137. /package/{config → libs/config}/index.ts +0 -0
  138. /package/{static/font → libs/css}/iconfont.css +0 -0
  139. /package/{global → libs/global}/index.ts +0 -0
  140. /package/{typing → libs/typing}/modules/common.d.ts +0 -0
  141. /package/{typing → libs/typing}/modules/enum.ts +0 -0
  142. /package/{typing → libs/typing}/modules/http.ts +0 -0
  143. /package/{typing → libs/typing}/modules/icon.d.ts +0 -0
  144. /package/{typing → libs/typing}/modules/rect.ts +0 -0
  145. /package/{utils → libs/utils}/address.json +0 -0
  146. /package/{utils → libs/utils}/base64.ts +0 -0
  147. /package/{utils → libs/utils}/calendar.js +0 -0
  148. /package/{utils → libs/utils}/colorGradient.ts +0 -0
  149. /package/{utils → libs/utils}/index.ts +0 -0
  150. /package/{utils → libs/utils}/inside.ts +0 -0
  151. /package/{utils → libs/utils}/inspect.ts +0 -0
@@ -25,7 +25,7 @@ export default {
25
25
  <script setup lang="ts">
26
26
  import { computed, ref, watch, nextTick } from "vue";
27
27
  import type { CSSProperties, PropType } from "vue";
28
- import { sleep } from "../../utils";
28
+ import { sleep } from "../../libs";
29
29
  import type { ITransitionEmits } from "./typing";
30
30
 
31
31
  /**
@@ -145,8 +145,13 @@ export default {
145
145
  import { ref, watch } from "vue";
146
146
  import type { PropType, CSSProperties } from "vue";
147
147
  import type { FileVo, IUploadEmits, ReadFunctionVo } from "./typing";
148
- import { addUnit, bytesToSize, chooseFile, isArray } from "../../utils";
149
- import { IconConfig } from "../../config";
148
+ import {
149
+ addUnit,
150
+ bytesToSize,
151
+ chooseFile,
152
+ isArray,
153
+ IconConfig,
154
+ } from "../../libs";
150
155
  // 组件
151
156
  import HyIcon from "../hy-icon/hy-icon.vue";
152
157
 
@@ -1,5 +1,5 @@
1
1
  import type IProps from "./typing";
2
- import { IconConfig } from "../../config";
2
+ import { IconConfig } from "../../libs";
3
3
 
4
4
  const defaultProps: IProps = {
5
5
  accept: "image",
@@ -76,8 +76,7 @@ export default {
76
76
  import { computed, ref } from "vue";
77
77
  import type { CSSProperties, PropType } from "vue";
78
78
  import type { IWarnEmits } from "./typing";
79
- import { addUnit } from "../../utils";
80
- import { IconConfig, iconName } from "../../config";
79
+ import { addUnit, IconConfig, iconName } from "../../libs";
81
80
  // 组件
82
81
  import HyTransition from "../hy-transition/hy-transition.vue";
83
82
  import HyIcon from "../hy-icon/hy-icon.vue";
@@ -1,48 +1,47 @@
1
- import type { CSSProperties } from 'vue'
2
- import { HyApp, type ThemeVo } from '@/package/typing/modules/common'
1
+ import type { CSSProperties } from "vue";
3
2
 
4
3
  export default interface HyWarnProps {
5
4
  /**
6
5
  * @description 显示的文字
7
6
  * */
8
- title: string
7
+ title: string;
9
8
  /**
10
9
  * @description 使用预设的颜色 (默认 'warning' )
11
10
  * */
12
- type?: HyApp.ThemeType
11
+ type?: HyApp.ThemeType;
13
12
  /**
14
13
  * @description 辅助性文字,颜色比title浅一点,字号也小一点,可选
15
14
  * */
16
- description?: string
15
+ description?: string;
17
16
  /**
18
17
  * @description 关闭按钮(默认为叉号icon图标) (默认 false )
19
18
  * */
20
- closable?: boolean
19
+ closable?: boolean;
21
20
  /**
22
21
  * @description 是否显示左边的辅助图标 ( 默认 false )
23
22
  * */
24
- showIcon?: boolean
23
+ showIcon?: boolean;
25
24
  /**
26
25
  * @description 显示的暗色或者亮色 (默认 'light' )
27
26
  * */
28
- theme?: HyApp.ThemeVo
27
+ theme?: HyApp.ThemeVo;
29
28
  /**
30
29
  * @description 文字是否居中 (默认 false )
31
30
  * */
32
- center?: boolean
31
+ center?: boolean;
33
32
  /**
34
33
  * @description 字体大小 (默认 14 )
35
34
  * */
36
- fontSize?: number
35
+ fontSize?: number;
37
36
  /**
38
37
  * @description 定义需要用到的外部样式
39
38
  * */
40
- customStyle?: CSSProperties
39
+ customStyle?: CSSProperties;
41
40
  }
42
41
 
43
42
  export interface IWarnEmits {
44
43
  /** 点击触发 */
45
- (e: 'click'): void
44
+ (e: "click"): void;
46
45
  /** 关闭触发 */
47
- (e: 'close'): void
46
+ (e: "close"): void;
48
47
  }
@@ -31,7 +31,7 @@ export default {
31
31
  <script setup lang="ts">
32
32
  import { computed, getCurrentInstance, ref, watch } from "vue";
33
33
  import type { PropType } from "vue";
34
- import { getRect, isArray } from "../../utils";
34
+ import { getRect, isArray } from "../../libs";
35
35
 
36
36
  /**
37
37
  * 这是一个瀑布流形式的组件,内容分为左右两列,结合uview的懒加载组件效果更佳。
@@ -28,7 +28,7 @@ export default {
28
28
  <script lang="ts" setup>
29
29
  import { computed, onMounted, ref, watch, nextTick } from "vue";
30
30
  import type { CSSProperties } from "vue";
31
- import { addUnit, guid } from "../../utils";
31
+ import { addUnit, guid } from "../../libs";
32
32
 
33
33
  /**
34
34
  * 在页面或组件上添加指定的图片或文字,可用于版权保护、品牌宣传等场景。
@@ -532,11 +532,12 @@ function drawTextOffScreen(
532
532
  color: string,
533
533
  canvas: HTMLCanvasElement,
534
534
  ) {
535
+ console.log(fontSize, "离屏");
535
536
  ctx.textBaseline = "middle";
536
537
  ctx.textAlign = "center";
537
538
  ctx.translate(contentWidth / 2, contentWidth / 2);
538
539
  ctx.rotate((Math.PI / 180) * rotate);
539
- ctx.font = `${fontStyle} normal ${fontWeight} ${fontSize}px ${fontFamily}`;
540
+ ctx.font = `${fontStyle} normal ${fontWeight} ${fontSize}px/${contentHeight}px ${fontFamily}`;
540
541
  ctx.fillStyle = color;
541
542
  ctx.fillText(content, 0, 0);
542
543
  ctx.restore();
@@ -1,127 +1,126 @@
1
- import HyTabBr from './hy-tabBar/hy-tabBar.vue'
2
- import Dialog from './dialog'
1
+ import HyTabBr from "./hy-tabBar/hy-tabBar.vue";
3
2
  // 组件库
4
- import HyAddressPicker from './hy-address-picker/hy-address-picker.vue'
5
- import HyAvatar from './hy-avatar/hy-avatar.vue'
6
- import HyBackTop from './hy-back-top/hy-back-top.vue'
7
- import HyBadge from './hy-badge/hy-badge.vue'
8
- import HyButton from './hy-button/hy-button.vue'
9
- import HyCard from './hy-card/hy-card.vue'
10
- import HyCell from './hy-cell/hy-cell.vue'
11
- import HyCheckButton from './hy-check-button/hy-check-button.vue'
12
- import HyCheckbox from './hy-checkbox/hy-checkbox.vue'
13
- import HyCountDown from './hy-count-down/hy-count-down.vue'
14
- import HyCountTo from './hy-count-to/hy-count-to.vue'
15
- import HyDatetimePicker from './hy-datetime-picker/hy-datetime-picker.vue'
16
- import HyDivider from './hy-divider/hy-divider.vue'
17
- import HyDropdown from './hy-dropdown/hy-dropdown.vue'
18
- import HyDropdownItem from './hy-dropdown-item/hy-dropdown-item.vue'
19
- import YkEmpty from './hy-empty/hy-empty.vue'
20
- import YkFloatButton from './hy-float-button/hy-float-button.vue'
21
- import HyFoldingPanel from '@/package/components/hy-folding-panel/hy-folding-panel.vue'
22
- import HyForm from '@/package/components/hy-form-group/hy-form.vue'
23
- import HyFormSimple from '@/package/components/hy-form/hy-form-simple.vue'
24
- import HyFormItem from './hy-form-item/hy-form-item.vue'
25
- import HyGrid from './hy-grid/hy-grid.vue'
26
- import HyIcon from './hy-icon/hy-icon.vue'
27
- import HyImage from './hy-image/hy-image.vue'
28
- import HyInput from './hy-input/hy-input.vue'
29
- import HyLine from './hy-line/hy-line.vue'
30
- import HyLineProgress from './hy-line-progress/hy-line-progress.vue'
31
- import HyList from './hy-list/hy-list.vue'
32
- import HyLoading from './hy-loading/hy-loading.vue'
33
- import YkLogin from './hy-login/hy-login.vue'
34
- import HyModal from './hy-modal/hy-modal.vue'
35
- import HyNavbar from './hy-navbar/hy-navbar.vue'
36
- import HyNoticeBar from './hy-notice-bar/hy-notice-bar.vue'
37
- import HyNumberStep from './hy-number-step/hy-number-step.vue'
38
- import HyOverlay from './hy-overlay/hy-overlay.vue'
39
- import YkPrice from './hy-price/hy-price.vue'
40
- import HyPicker from './hy-picker/hy-picker.vue'
41
- import HyPopup from './hy-popup/hy-popup.vue'
42
- import HyQrcode from './hy-qrcode/hy-qrcode.vue'
43
- import HyRadio from './hy-radio/hy-radio.vue'
44
- import HyRate from './hy-rate/hy-rate.vue'
45
- import HyReadMore from './hy-read-more/hy-read-more.vue'
3
+ import HyAddressPicker from "./hy-address-picker/hy-address-picker.vue";
4
+ import HyAvatar from "./hy-avatar/hy-avatar.vue";
5
+ import HyBackTop from "./hy-back-top/hy-back-top.vue";
6
+ import HyBadge from "./hy-badge/hy-badge.vue";
7
+ import HyButton from "./hy-button/hy-button.vue";
8
+ import HyCard from "./hy-card/hy-card.vue";
9
+ import HyCell from "./hy-cell/hy-cell.vue";
10
+ import HyCheckButton from "./hy-check-button/hy-check-button.vue";
11
+ import HyCheckbox from "./hy-checkbox/hy-checkbox.vue";
12
+ import HyCountDown from "./hy-count-down/hy-count-down.vue";
13
+ import HyCountTo from "./hy-count-to/hy-count-to.vue";
14
+ import HyDatetimePicker from "./hy-datetime-picker/hy-datetime-picker.vue";
15
+ import HyDivider from "./hy-divider/hy-divider.vue";
16
+ import HyDropdown from "./hy-dropdown/hy-dropdown.vue";
17
+ import HyDropdownItem from "./hy-dropdown-item/hy-dropdown-item.vue";
18
+ import YkEmpty from "./hy-empty/hy-empty.vue";
19
+ import YkFloatButton from "./hy-float-button/hy-float-button.vue";
20
+ import HyFoldingPanel from "@/package/components/hy-folding-panel/hy-folding-panel.vue";
21
+ import HyForm from "@/package/components/hy-form-group/hy-form.vue";
22
+ import HyFormSimple from "@/package/components/hy-form/hy-form-simple.vue";
23
+ import HyFormItem from "./hy-form-item/hy-form-item.vue";
24
+ import HyGrid from "./hy-grid/hy-grid.vue";
25
+ import HyIcon from "./hy-icon/hy-icon.vue";
26
+ import HyImage from "./hy-image/hy-image.vue";
27
+ import HyInput from "./hy-input/hy-input.vue";
28
+ import HyLine from "./hy-line/hy-line.vue";
29
+ import HyLineProgress from "./hy-line-progress/hy-line-progress.vue";
30
+ import HyList from "./hy-list/hy-list.vue";
31
+ import HyLoading from "./hy-loading/hy-loading.vue";
32
+ import YkLogin from "./hy-login/hy-login.vue";
33
+ import HyModal from "./hy-modal/hy-modal.vue";
34
+ import HyNavbar from "./hy-navbar/hy-navbar.vue";
35
+ import HyNoticeBar from "./hy-notice-bar/hy-notice-bar.vue";
36
+ import HyNumberStep from "./hy-number-step/hy-number-step.vue";
37
+ import HyOverlay from "./hy-overlay/hy-overlay.vue";
38
+ import YkPrice from "./hy-price/hy-price.vue";
39
+ import HyPicker from "./hy-picker/hy-picker.vue";
40
+ import HyPopup from "./hy-popup/hy-popup.vue";
41
+ import HyQrcode from "./hy-qrcode/hy-qrcode.vue";
42
+ import HyRadio from "./hy-radio/hy-radio.vue";
43
+ import HyRate from "./hy-rate/hy-rate.vue";
44
+ import HyReadMore from "./hy-read-more/hy-read-more.vue";
46
45
  // import HySafeBottom from "./hy-safe-bottom/hy-safe-bottom.vue";
47
- import HyScrollList from './hy-scroll-list/hy-scroll-list.vue'
48
- import HySearch from './hy-search/hy-search.vue'
49
- import HySlider from './hy-slider/hy-slider.vue'
50
- import HyStatusBar from './hy-status-bar/hy-status-bar.vue'
51
- import HySteps from './hy-steps/hy-steps.vue'
52
- import HySubsection from './hy-subsection/hy-subsection.vue'
53
- import HySwiper from './hy-swiper/hy-swiper.vue'
54
- import HySwitch from './hy-switch/hy-switch.vue'
55
- import HyTabs from './hy-tabs/hy-tabs.vue'
56
- import HyTag from './hy-tag/hy-tag.vue'
57
- import HyTextarea from './hy-textarea/hy-textarea.vue'
58
- import HyTooltip from './hy-tooltip/hy-tooltip.vue'
59
- import HyTransition from './hy-transition/hy-transition.vue'
60
- import HyUpload from './hy-upload/hy-upload.vue'
61
- import HyWarn from './hy-warn/hy-warn.vue'
46
+ import HyScrollList from "./hy-scroll-list/hy-scroll-list.vue";
47
+ import HySearch from "./hy-search/hy-search.vue";
48
+ import HySlider from "./hy-slider/hy-slider.vue";
49
+ import HyStatusBar from "./hy-status-bar/hy-status-bar.vue";
50
+ import HySteps from "./hy-steps/hy-steps.vue";
51
+ import HySubsection from "./hy-subsection/hy-subsection.vue";
52
+ import HySwiper from "./hy-swiper/hy-swiper.vue";
53
+ import HySwitch from "./hy-switch/hy-switch.vue";
54
+ import HyTabs from "./hy-tabs/hy-tabs.vue";
55
+ import HyTag from "./hy-tag/hy-tag.vue";
56
+ import HyTextarea from "./hy-textarea/hy-textarea.vue";
57
+ import HyTooltip from "./hy-tooltip/hy-tooltip.vue";
58
+ import HyTransition from "./hy-transition/hy-transition.vue";
59
+ import HyUpload from "./hy-upload/hy-upload.vue";
60
+ import HyWarn from "./hy-warn/hy-warn.vue";
62
61
 
63
62
  const install = (Vue: any) => {
64
- Vue.component('hy-tabBar', HyTabBr)
63
+ Vue.component("hy-tabBar", HyTabBr);
65
64
 
66
- Vue.component('HyAddressPicker', HyAddressPicker)
67
- Vue.component('HyAvatar', HyAvatar)
68
- Vue.component('HyBackTop', HyBackTop)
69
- Vue.component('HyBadge', HyBadge)
70
- Vue.component('HyButton', HyButton)
71
- Vue.component('HyCard', HyCard)
72
- Vue.component('HyCell', HyCell)
73
- Vue.component('HyCheckButton', HyCheckButton)
74
- Vue.component('HyCheckbox', HyCheckbox)
75
- Vue.component('HyCountDown', HyCountDown)
76
- Vue.component('HyCountTo', HyCountTo)
77
- Vue.component('HyDatetimePicker', HyDatetimePicker)
78
- Vue.component('HyDivider', HyDivider)
79
- Vue.component('HyDropdown', HyDropdown)
80
- Vue.component('HyDropdownItem', HyDropdownItem)
81
- Vue.component('YkEmpty', YkEmpty)
82
- Vue.component('YkFloatButton', YkFloatButton)
83
- Vue.component('HyFoldingPanel', HyFoldingPanel)
84
- Vue.component('HyForm', HyForm)
85
- Vue.component('HyFormSimple', HyFormSimple)
86
- Vue.component('HyFormItem', HyFormItem)
87
- Vue.component('HyGrid', HyGrid)
88
- Vue.component('HyIcon', HyIcon)
89
- Vue.component('HyImage', HyImage)
90
- Vue.component('HyInput', HyInput)
91
- Vue.component('HyLine', HyLine)
92
- Vue.component('HyLineProgress', HyLineProgress)
93
- Vue.component('HyList', HyList)
94
- Vue.component('HyLoading', HyLoading)
65
+ Vue.component("HyAddressPicker", HyAddressPicker);
66
+ Vue.component("HyAvatar", HyAvatar);
67
+ Vue.component("HyBackTop", HyBackTop);
68
+ Vue.component("HyBadge", HyBadge);
69
+ Vue.component("HyButton", HyButton);
70
+ Vue.component("HyCard", HyCard);
71
+ Vue.component("HyCell", HyCell);
72
+ Vue.component("HyCheckButton", HyCheckButton);
73
+ Vue.component("HyCheckbox", HyCheckbox);
74
+ Vue.component("HyCountDown", HyCountDown);
75
+ Vue.component("HyCountTo", HyCountTo);
76
+ Vue.component("HyDatetimePicker", HyDatetimePicker);
77
+ Vue.component("HyDivider", HyDivider);
78
+ Vue.component("HyDropdown", HyDropdown);
79
+ Vue.component("HyDropdownItem", HyDropdownItem);
80
+ Vue.component("YkEmpty", YkEmpty);
81
+ Vue.component("YkFloatButton", YkFloatButton);
82
+ Vue.component("HyFoldingPanel", HyFoldingPanel);
83
+ Vue.component("HyForm", HyForm);
84
+ Vue.component("HyFormSimple", HyFormSimple);
85
+ Vue.component("HyFormItem", HyFormItem);
86
+ Vue.component("HyGrid", HyGrid);
87
+ Vue.component("HyIcon", HyIcon);
88
+ Vue.component("HyImage", HyImage);
89
+ Vue.component("HyInput", HyInput);
90
+ Vue.component("HyLine", HyLine);
91
+ Vue.component("HyLineProgress", HyLineProgress);
92
+ Vue.component("HyList", HyList);
93
+ Vue.component("HyLoading", HyLoading);
95
94
  // Vue.component("YkLogin", YkLogin);
96
- Vue.component('HyModal', HyModal)
97
- Vue.component('HyNavbar', HyNavbar)
98
- Vue.component('HyNoticeBar', HyNoticeBar)
99
- Vue.component('HyNumberStep', HyNumberStep)
100
- Vue.component('HyOverlay', HyOverlay)
101
- Vue.component('YkPrice', YkPrice)
102
- Vue.component('HyPicker', HyPicker)
103
- Vue.component('HyPopup', HyPopup)
104
- Vue.component('HyQrcode', HyQrcode)
105
- Vue.component('HyRadio', HyRadio)
106
- Vue.component('HyRate', HyRate)
107
- Vue.component('HyReadMore', HyReadMore)
108
- Vue.component('HyScrollList', HyScrollList)
109
- Vue.component('HySearch', HySearch)
110
- Vue.component('HySlider', HySlider)
111
- Vue.component('HyStatusBar', HyStatusBar)
112
- Vue.component('HySteps', HySteps)
113
- Vue.component('HySubsection', HySubsection)
114
- Vue.component('HySwiper', HySwiper)
115
- Vue.component('HySwitch', HySwitch)
116
- Vue.component('HyTabs', HyTabs)
117
- Vue.component('HyTag', HyTag)
118
- Vue.component('HyTextarea', HyTextarea)
119
- Vue.component('HyTooltip', HyTooltip)
120
- Vue.component('HyTransition', HyTransition)
121
- Vue.component('HyUpload', HyUpload)
122
- Vue.component('HyWarn', HyWarn)
95
+ Vue.component("HyModal", HyModal);
96
+ Vue.component("HyNavbar", HyNavbar);
97
+ Vue.component("HyNoticeBar", HyNoticeBar);
98
+ Vue.component("HyNumberStep", HyNumberStep);
99
+ Vue.component("HyOverlay", HyOverlay);
100
+ Vue.component("YkPrice", YkPrice);
101
+ Vue.component("HyPicker", HyPicker);
102
+ Vue.component("HyPopup", HyPopup);
103
+ Vue.component("HyQrcode", HyQrcode);
104
+ Vue.component("HyRadio", HyRadio);
105
+ Vue.component("HyRate", HyRate);
106
+ Vue.component("HyReadMore", HyReadMore);
107
+ Vue.component("HyScrollList", HyScrollList);
108
+ Vue.component("HySearch", HySearch);
109
+ Vue.component("HySlider", HySlider);
110
+ Vue.component("HyStatusBar", HyStatusBar);
111
+ Vue.component("HySteps", HySteps);
112
+ Vue.component("HySubsection", HySubsection);
113
+ Vue.component("HySwiper", HySwiper);
114
+ Vue.component("HySwitch", HySwitch);
115
+ Vue.component("HyTabs", HyTabs);
116
+ Vue.component("HyTag", HyTag);
117
+ Vue.component("HyTextarea", HyTextarea);
118
+ Vue.component("HyTooltip", HyTooltip);
119
+ Vue.component("HyTransition", HyTransition);
120
+ Vue.component("HyUpload", HyUpload);
121
+ Vue.component("HyWarn", HyWarn);
123
122
  // Vue.config.globalProperties.$dialog = myDialog;
124
- }
123
+ };
125
124
  export {
126
125
  install,
127
126
  HyAddressPicker,
@@ -181,4 +180,4 @@ export {
181
180
  HyTransition,
182
181
  HyUpload,
183
182
  HyWarn,
184
- }
183
+ };
package/index.ts CHANGED
@@ -1,7 +1 @@
1
- export * from "./common";
2
- export * from "./utils";
3
- export * from "./global";
4
- export * from "./typing";
5
- export * from "./api";
6
- export * from "./config";
7
- export * from "./composables";
1
+ export * from "./libs";
@@ -1,7 +1,7 @@
1
- import type { HttpRequestConfig } from "../typing";
2
- import { objectToUrlParams } from "../utils";
1
+ import type { HttpRequestConfig } from "../../libs/typing";
2
+ import { objectToUrlParams } from "../../libs";
3
3
 
4
- export default class Http {
4
+ export class Http {
5
5
  /**
6
6
  * 默认请求配置
7
7
  */
@@ -0,0 +1,2 @@
1
+ export * from "./versionControl";
2
+ export * from "./queue";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 互相关闭
3
+ * */
4
+ let queue: any[] = [];
5
+
6
+ export function pushToQueue(comp: any) {
7
+ queue.push(comp);
8
+ }
9
+
10
+ export function removeFromQueue(comp: any) {
11
+ queue = queue.filter((item) => {
12
+ return item.$.uid !== comp.$.uid;
13
+ });
14
+ }
15
+
16
+ export function closeOther(comp: any) {
17
+ queue.forEach((item) => {
18
+ if (item.$.uid !== comp.$.uid) {
19
+ item.$.exposed.close();
20
+ }
21
+ });
22
+ }
23
+
24
+ export function closeOutside() {
25
+ queue.forEach((item) => {
26
+ item.$.exposed.close();
27
+ });
28
+ }
@@ -3,3 +3,4 @@ export * from "./useTouch";
3
3
  export * from "./usePopover";
4
4
  export * from "./useQueue";
5
5
  export * from "./useToast";
6
+ export * from "./useShakeService";
@@ -1,7 +1,11 @@
1
+ /**
2
+ * 气泡组件hooks
3
+ * */
4
+
1
5
  import { getCurrentInstance, ref } from "vue";
2
6
  import type { CSSProperties } from "vue";
3
- import { getRect, isObject } from "../utils";
4
- import type { IOffset, IPlacementVo } from "../components/hy-popover/typing";
7
+ import { getRect, isObject } from "../../libs";
8
+ import type { IOffset, IPlacementVo } from "../../components/hy-popover/typing";
5
9
 
6
10
  export function usePopover(visibleArrow = true) {
7
11
  const instance = getCurrentInstance();
@@ -89,6 +93,7 @@ export function usePopover(visibleArrow = true) {
89
93
  (horizontalY - 17 > 0 ? 0 : horizontalY - 25) +
90
94
  (offset[1] ? offset[1] : offset[0]);
91
95
  } else if (isObject(offset)) {
96
+ offset = offset as Record<"x" | "y", number>;
92
97
  offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset.x;
93
98
  offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset.y;
94
99
  } else {
@@ -1,7 +1,9 @@
1
- // src/composables/useShakeService.ts
1
+ /**
2
+ * 摇一摇传感器hooks
3
+ * */
2
4
  import { ref } from "vue";
3
5
  import type { Ref } from "vue";
4
- import { debounce } from "../utils";
6
+ import { debounce } from "../../libs";
5
7
 
6
8
  interface Acceleration {
7
9
  x: number;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 全局分享hooks
3
+ * */
1
4
  interface ShareConfig {
2
5
  title?: string;
3
6
  path?: string;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * 消息提示hooks
3
+ * */
4
+
5
+ import type ToastOptions from "../../components/hy-toast/typing";
6
+ import { error } from "../../libs";
7
+
8
+ // 用于缓存全局唯一实例
9
+ let toastInstance: any = null;
10
+
11
+ /**
12
+ * useToast 适用于任意页面直接调用 toast
13
+ * 兼容 H5 + 微信小程序 + App
14
+ */
15
+ export const useToast = () => {
16
+ const show = (msg: string, opt?: ToastOptions) =>
17
+ openToast({ message: msg, icon: false, type: "", ...opt });
18
+ const info = (msg: string, opt?: ToastOptions) =>
19
+ openToast({ message: msg, type: "info", icon: true, ...opt });
20
+ const success = (msg: string, opt?: ToastOptions) =>
21
+ openToast({ message: msg, type: "success", icon: true, ...opt });
22
+ const error = (msg: string, opt?: ToastOptions) =>
23
+ openToast({ message: msg, type: "error", icon: true, ...opt });
24
+ const warning = (msg: string, opt?: ToastOptions) =>
25
+ openToast({ message: msg, type: "warning", icon: true, ...opt });
26
+ const primary = (msg: string, opt?: ToastOptions) =>
27
+ openToast({ message: msg, type: "primary", icon: true, ...opt });
28
+ const loading = (msg: string = "加载中...", opt?: ToastOptions) =>
29
+ openToast({ message: msg, loading: true, ...opt });
30
+ const close = (all?: boolean) => closeToast();
31
+
32
+ return { show, info, success, error, warning, primary, loading, close };
33
+ };
34
+
35
+ /**
36
+ * ✅ 实现
37
+ * 页面创建总事件,调用方法实现
38
+ */
39
+ const openToast = (opt: ToastOptions) => {
40
+ uni.$emit("__hy_toast_open__", opt);
41
+ };
42
+
43
+ const closeToast = () => {
44
+ uni.$emit("__hy_toast_close__");
45
+ };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 滑动hooks
3
+ * */
1
4
  import { ref } from "vue";
2
5
 
3
6
  export function useTouch() {
@@ -32,7 +32,7 @@ $hy-text-color--3: var(--hy-text-color--3, #929295) !default; // 一般用于浅
32
32
  $hy-text-color--4: var(--hy-text-color--4, rgba(0, 0, 0, 0.1)) !default; // 一般用于浅色
33
33
  $hy-icon-color: var(--hy-icon-color, #606266) !default; // 一般用于icon
34
34
  $hy-text-color--grey: var(--hy-text-color--grey, #999) !default; // 辅助灰色,如加载更多的提示信息
35
- $hy-text-color--placeholder: var(--hy-text-color--placeholder, #808080) !default; // 输入框提示颜色
35
+ $hy-text-color--placeholder: var(--hy-text-color--placeholder, #909399) !default; // 输入框提示颜色
36
36
  $hy-text-color--disabled: var(--hy-text-color--disabled, #c0c0c0) !default; // 禁用文字颜色
37
37
  $hy-border-color: var(--hy-border-color, #c0c0c0) !default; // 边框颜色
38
38
  $hy-text-color--hover: var(--hy-text-color--hover, #58595b)!default; // 点击状态文字颜色
@@ -7,7 +7,7 @@
7
7
  --hy-text-color--4: rgba(0, 0, 0, 0.1);
8
8
  --hy-icon-color: #999;
9
9
  --hy-text-color--grey: #67676c;
10
- --hy-text-color--placeholder: rgba(0, 0, 0, 0.25);
10
+ --hy-text-color--placeholder: #909399;
11
11
  --hy-text-color--disabled: rgba(0, 0, 0, 0.25);
12
12
 
13
13
  --hy-background: #f8f8f8;
@@ -40,7 +40,7 @@
40
40
  --hy-text-color--4: rgba(255, 255, 255, 0.1);
41
41
  --hy-icon-color: #FFFFFF;
42
42
  --hy-text-color--grey: #98989f;
43
- --hy-text-color--placeholder: rgba(255, 255, 255, 0.25);
43
+ --hy-text-color--placeholder: #909399;
44
44
  --hy-text-color--disabled: rgba(255, 255, 255, 0.25);
45
45
 
46
46
  --hy-background: #1b1b1f;
@@ -1,5 +1,5 @@
1
1
  import type { App } from "vue";
2
- import { addUnit, bytesToSize, formatTime, random } from "../utils";
2
+ import { addUnit, bytesToSize, formatTime, random } from "../../libs";
3
3
  export default function registerProperties(app: App) {
4
4
  app.config.globalProperties.$hy = {
5
5
  /**
package/libs/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./common";
2
+ export * from "./utils";
3
+ export * from "./global";
4
+ export * from "./typing";
5
+ export * from "./api";
6
+ export * from "./config";
7
+ export * from "./composables";
@@ -1,5 +1,4 @@
1
1
  export * from "./modules/form";
2
- export * from "./modules/dialog";
3
2
  export * from "./modules/http";
4
3
  export * from "./modules/enum";
5
4
  export * from "./modules/rect";
@@ -1,11 +1,11 @@
1
1
  import type { DateModeEnum } from "./enum";
2
- import type { CheckboxColumnsVo } from "../../components/hy-check-button/typing";
3
- import type HyInputProps from "../../components/hy-input/typing";
4
- import type HyTextareaProps from "../../components/hy-textarea/typing";
5
- import type HySwitchProps from "../../components/hy-switch/typing";
6
- import type HyPickerProps from "../../components/hy-picker/typing";
7
- import type HyRadioProps from "../../components/hy-radio/typing";
8
- import type HyCheckButtonProps from "../../components/hy-check-button/typing";
2
+ import type { CheckboxColumnsVo } from "../../../components/hy-check-button/typing";
3
+ import type HyInputProps from "../../../components/hy-input/typing";
4
+ import type HyTextareaProps from "../../../components/hy-textarea/typing";
5
+ import type HySwitchProps from "../../../components/hy-switch/typing";
6
+ import type HyPickerProps from "../../../components/hy-picker/typing";
7
+ import type HyRadioProps from "../../../components/hy-radio/typing";
8
+ import type HyCheckButtonProps from "../../../components/hy-check-button/typing";
9
9
 
10
10
  /**
11
11
  * 类型