hy-app 0.6.9 → 0.7.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 (82) hide show
  1. package/attributes.json +1 -1
  2. package/components/hy-avatar/hy-avatar.vue +12 -5
  3. package/components/hy-avatar/props.ts +4 -2
  4. package/components/hy-avatar/typing.d.ts +8 -1
  5. package/components/hy-calendar/hy-calendar.vue +1 -0
  6. package/components/hy-calendar/month.vue +25 -5
  7. package/components/hy-calendar/props.ts +1 -1
  8. package/components/hy-cascader/hy-cascader.vue +503 -0
  9. package/components/hy-cascader/index.scss +84 -0
  10. package/components/hy-cascader/props.ts +88 -0
  11. package/components/hy-cascader/typing.d.ts +34 -0
  12. package/components/hy-check-button/typing.d.ts +12 -7
  13. package/components/hy-code-input/hy-code-input.vue +33 -11
  14. package/components/hy-code-input/typing.d.ts +4 -0
  15. package/components/hy-config-provider/hy-config-provider.vue +58 -53
  16. package/components/hy-datetime-picker/props.ts +1 -1
  17. package/components/hy-datetime-picker/typing.d.ts +1 -1
  18. package/components/hy-dropdown/typing.d.ts +5 -0
  19. package/components/hy-form/typing.d.ts +6 -0
  20. package/components/hy-form-item/typing.d.ts +1 -1
  21. package/components/hy-grid/hy-grid.vue +12 -12
  22. package/components/hy-grid/index.scss +1 -2
  23. package/components/hy-grid/props.ts +7 -2
  24. package/components/hy-grid/typing.d.ts +1 -1
  25. package/components/hy-icon/typing.d.ts +52 -9
  26. package/components/hy-keyboard/constants.ts +83 -0
  27. package/components/hy-keyboard/hy-keyboard.vue +375 -0
  28. package/components/hy-keyboard/index.scss +73 -0
  29. package/components/hy-keyboard/key/index.scss +79 -0
  30. package/components/hy-keyboard/key/index.vue +91 -0
  31. package/components/hy-keyboard/key/types.ts +1 -0
  32. package/components/hy-keyboard/props.ts +108 -0
  33. package/components/hy-keyboard/typing.d.ts +18 -0
  34. package/components/hy-modal/typing.d.ts +2 -2
  35. package/components/hy-notice-bar/hy-column-notice.vue +54 -94
  36. package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
  37. package/components/hy-notice-bar/hy-row-notice.vue +89 -121
  38. package/components/hy-notice-bar/props.ts +86 -85
  39. package/components/hy-notify/hy-notify.vue +9 -9
  40. package/components/hy-notify/typing.d.ts +22 -0
  41. package/components/hy-picker/hy-picker.vue +126 -149
  42. package/components/hy-picker/props.ts +4 -1
  43. package/components/hy-picker/typing.d.ts +22 -0
  44. package/components/hy-popup/index.scss +1 -0
  45. package/components/hy-price/hy-price.vue +52 -23
  46. package/components/hy-price/props.ts +54 -54
  47. package/components/hy-radio/props.ts +1 -1
  48. package/components/hy-radio/typing.d.ts +5 -1
  49. package/components/hy-rolling-num/typing.d.ts +1 -0
  50. package/components/hy-skeleton/index.scss +17 -0
  51. package/components/hy-steps/hy-steps.vue +1 -1
  52. package/components/hy-submit-bar/typing.d.ts +3 -3
  53. package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
  54. package/components/hy-swipe-action/index.scss +0 -1
  55. package/components/hy-switch/typing.d.ts +4 -0
  56. package/components/hy-tabbar/props.ts +2 -1
  57. package/components/hy-tabbar/typing.d.ts +5 -4
  58. package/components/hy-tabs/hy-tabs.vue +338 -336
  59. package/components/hy-tabs/index.scss +6 -6
  60. package/components/hy-tabs/typing.d.ts +41 -33
  61. package/components/hy-textarea/hy-textarea.vue +2 -2
  62. package/components/hy-textarea/typing.d.ts +4 -0
  63. package/components/hy-toast/hy-toast.vue +14 -6
  64. package/components/hy-toast/typing.d.ts +42 -36
  65. package/components/hy-tooltip/hy-tooltip.vue +1 -1
  66. package/components/hy-tooltip/index.scss +1 -0
  67. package/components/hy-tooltip/props.ts +1 -1
  68. package/components/hy-upload/hy-upload.vue +16 -1
  69. package/components/hy-upload/index.scss +149 -144
  70. package/components/index.ts +6 -0
  71. package/global.d.ts +2 -0
  72. package/libs/config/icon.ts +442 -430
  73. package/libs/css/_function.scss +7 -13
  74. package/libs/css/iconfont.css +445 -441
  75. package/libs/css/theme.scss +1 -1
  76. package/libs/locale/lang/en-US.ts +4 -0
  77. package/libs/locale/lang/zh-CN.ts +4 -0
  78. package/libs/typing/index.ts +80 -0
  79. package/package.json +5 -2
  80. package/tags.json +1 -1
  81. package/web-types.json +1 -1
  82. package/components/hy-qrcode/qrcode.js.bak +0 -1434
@@ -0,0 +1,108 @@
1
+ import type { PropType, ExtractPropTypes } from 'vue'
2
+ import type { KeyboardMode, CarKeyboardLang } from './typing'
3
+
4
+ export const keyboardProps = {
5
+ /** 是否可见 */
6
+ show: {
7
+ type: Boolean,
8
+ default: false
9
+ },
10
+ /** 绑定的值 */
11
+ modelValue: {
12
+ type: String,
13
+ default: ''
14
+ },
15
+ /** 标题 */
16
+ title: String,
17
+ /**
18
+ * 键盘模式
19
+ * @values default,custom,car,idcard
20
+ * */
21
+ mode: {
22
+ type: String as PropType<KeyboardMode>,
23
+ default: 'default'
24
+ },
25
+ /** 层级 */
26
+ zIndex: {
27
+ type: Number,
28
+ default: 10086
29
+ },
30
+ /** 最大长度 */
31
+ maxlength: {
32
+ type: Number,
33
+ default: Infinity
34
+ },
35
+ /** 是否显示删除键 */
36
+ showDeleteKey: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ /** 是否显示小数点键 */
41
+ showDotKey: {
42
+ type: Boolean,
43
+ default: true
44
+ },
45
+ /** 是否随机键盘按键顺序 */
46
+ randomKeyOrder: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ /** 确认按钮文本 */
51
+ closeText: String,
52
+ /** 删除按钮文本 */
53
+ deleteText: String,
54
+ /** 关闭按钮是否显示加载状态 */
55
+ closeButtonLoading: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ /** 是否显示蒙层 */
60
+ overlay: {
61
+ type: Boolean,
62
+ default: true
63
+ },
64
+ /** 蒙层透明度 */
65
+ overlayOpacity: {
66
+ type: Number,
67
+ default: 0
68
+ },
69
+ /** 是否在点击外部时收起键盘 */
70
+ hideOnClickOutside: {
71
+ type: Boolean,
72
+ default: true
73
+ },
74
+ /** 是否锁定滚动 */
75
+ lockScroll: {
76
+ type: Boolean,
77
+ default: true
78
+ },
79
+ /** 是否在底部安全区域内 */
80
+ safeAreaInsetBottom: {
81
+ type: Boolean,
82
+ default: true
83
+ },
84
+ /** 额外按键 */
85
+ extraKey: {
86
+ type: [String, Array] as PropType<string | string[]>,
87
+ default: ''
88
+ },
89
+ /** 车牌键盘语言模式 当mode=car时生效 */
90
+ carLang: {
91
+ type: String as PropType<CarKeyboardLang>,
92
+ default: ''
93
+ },
94
+ /** 是否自动切换车牌键盘语言 当mode=car且carLang是非受控状态时生效 */
95
+ autoSwitchLang: {
96
+ type: Boolean,
97
+ default: false
98
+ },
99
+ /** 定义需要用到的外部样式 */
100
+ customStyle: {
101
+ type: Object as PropType<Record<string, string | number>>,
102
+ default: () => ({})
103
+ },
104
+ /** 自定义外部类名 */
105
+ customClass: String
106
+ }
107
+
108
+ export type KeyboardProps = ExtractPropTypes<typeof keyboardProps>
@@ -0,0 +1,18 @@
1
+ export type KeyboardMode = 'default' | 'custom' | 'car' | 'idcard'
2
+ export type KeyType = '' | 'delete' | 'extra' | 'close'
3
+ export type CarKeyboardLang = 'zh' | 'en'
4
+
5
+ export interface Key {
6
+ text?: number | string
7
+ type?: KeyType
8
+ wider?: boolean
9
+ }
10
+
11
+ export interface IKeyboardEmits {
12
+ (e: 'update:show', value: boolean): void
13
+ (e: 'input', value: string): void
14
+ (e: 'close'): void
15
+ (e: 'delete'): void
16
+ (e: 'update:modelValue', value: string): void
17
+ (e: 'update:carLang', value: CarKeyboardLang): void
18
+ }
@@ -1,7 +1,7 @@
1
1
  import type { ExtractPropTypes } from 'vue'
2
- import modalProps from '@/package/components/hy-modal/props'
2
+ // import modalProps from './props'
3
3
 
4
- export interface HyModalProps extends ExtractPropTypes<typeof modalProps> {}
4
+ // export interface HyModalProps extends ExtractPropTypes<typeof modalProps> {}
5
5
 
6
6
  export interface IModalEmits {
7
7
  /** 点击确认按钮时触发 */
@@ -1,94 +1,54 @@
1
- <template>
2
- <view class="hy-notice" @tap="clickHandler">
3
- <slot name="icon">
4
- <view class="hy-notice__left-icon" v-if="icon">
5
- <hy-icon :name="icon" :color="color" size="19"></hy-icon>
6
- </view>
7
- </slot>
8
- <swiper
9
- :disable-touch="disableTouch"
10
- :vertical="!step"
11
- :circular="true"
12
- :interval="duration"
13
- :autoplay="true"
14
- class="hy-notice__swiper"
15
- @change="noticeChange"
16
- >
17
- <swiper-item
18
- v-for="(item, index) in text"
19
- :key="index"
20
- class="hy-notice__swiper--item"
21
- :style="{ justifyContent: justifyContent }"
22
- >
23
- <text class="hy-notice__swiper--item__text" :style="[textStyle]">{{ item }}</text>
24
- </swiper-item>
25
- </swiper>
26
- <view class="hy-notice__right-icon" v-if="['link', 'closable'].includes(mode)">
27
- <hy-icon
28
- v-if="mode === 'link'"
29
- :name="IconConfig.RIGHT"
30
- :size="17"
31
- :color="color"
32
- ></hy-icon>
33
- <hy-icon
34
- v-if="mode === 'closable'"
35
- :name="IconConfig.CLOSE"
36
- :size="16"
37
- :color="color"
38
- @click="close"
39
- ></hy-icon>
40
- </view>
41
- </view>
42
- </template>
43
-
44
- <script setup lang="ts">
45
- import { type CSSProperties, toRefs, computed, ref, watch } from 'vue'
46
- import noticeBarProps from './props'
47
- import { addUnit, error, IconConfig } from '../../libs'
48
-
49
- // 组件
50
- import HyIcon from '../hy-icon/hy-icon.vue'
51
-
52
- const props = defineProps(noticeBarProps)
53
- const { text, fontSize, color } = toRefs(props)
54
- const emit = defineEmits(['click', 'close'])
55
-
56
- const index = ref(0)
57
-
58
- watch(
59
- () => text.value,
60
- (newVal) => !Array.isArray(newVal) && error('传入值必须是数组'),
61
- { immediate: true }
62
- )
63
-
64
- /**
65
- * @description 文字内容的样式
66
- * */
67
- const textStyle = computed<CSSProperties>(() => {
68
- let style: CSSProperties = {}
69
- style.color = color.value
70
- style.fontSize = addUnit(fontSize.value)
71
- return style
72
- })
73
-
74
- const noticeChange = (e: any) => {
75
- index.value = e.detail.current
76
- }
77
-
78
- /**
79
- * @description 点击通告栏
80
- * */
81
- const clickHandler = (index: number) => {
82
- emit('click', index)
83
- }
84
- /**
85
- * @description 点击关闭按钮
86
- * */
87
- const close = () => {
88
- emit('close')
89
- }
90
- </script>
91
-
92
- <style lang="scss" scoped>
93
- @import './index.scss';
94
- </style>
1
+ <template>
2
+ <swiper
3
+ :disable-touch="disableTouch"
4
+ :vertical="!step"
5
+ :circular="true"
6
+ :interval="duration"
7
+ :autoplay="true"
8
+ class="hy-notice__swiper"
9
+ @change="noticeChange"
10
+ >
11
+ <swiper-item
12
+ v-for="(item, index) in text"
13
+ :key="index"
14
+ class="hy-notice__swiper--item"
15
+ :style="{ justifyContent: justifyContent }"
16
+ >
17
+ <text class="hy-notice__swiper--item__text" :style="[textStyle]">{{ item }}</text>
18
+ </swiper-item>
19
+ </swiper>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import { type CSSProperties, toRefs, computed, watch } from 'vue'
24
+ import noticeBarProps from './props'
25
+ import { addUnit, error } from '../../libs'
26
+
27
+ const props = defineProps(noticeBarProps)
28
+ const { text, fontSize, color } = toRefs(props)
29
+ const emit = defineEmits(['change'])
30
+
31
+ watch(
32
+ () => text.value,
33
+ (newVal) => !Array.isArray(newVal) && error('传入值必须是数组'),
34
+ { immediate: true }
35
+ )
36
+
37
+ /**
38
+ * @description 文字内容的样式
39
+ * */
40
+ const textStyle = computed<CSSProperties>(() => {
41
+ let style: CSSProperties = {}
42
+ style.color = color.value
43
+ style.fontSize = addUnit(fontSize.value)
44
+ return style
45
+ })
46
+
47
+ const noticeChange = (e: any) => {
48
+ emit('change', e.detail.current)
49
+ }
50
+ </script>
51
+
52
+ <style lang="scss" scoped>
53
+ @import './index.scss';
54
+ </style>
@@ -1,96 +1,128 @@
1
- <template>
2
- <view
3
- class="hy-notice-bar"
4
- v-if="show"
5
- :style="[
6
- {
7
- backgroundColor: bgColor
8
- },
9
- customStyle
10
- ]"
11
- >
12
- <template v-if="direction === 'column' || (direction === 'row' && step)">
13
- <HyColumnNotice
14
- :color="color"
15
- :bgColor="bgColor"
16
- :text="text"
17
- :mode="mode"
18
- :step="step"
19
- :icon="icon"
20
- :disable-touch="disableTouch"
21
- :fontSize="fontSize"
22
- :duration="duration"
23
- :justifyContent="justifyContent"
24
- @close="close"
25
- @click="click"
26
- ></HyColumnNotice>
27
- </template>
28
- <template v-else>
29
- <HyRowNotice
30
- :color="color"
31
- :bgColor="bgColor"
32
- :text="text"
33
- :mode="mode"
34
- :fontSize="fontSize"
35
- :speed="speed"
36
- :url="url"
37
- :linkType="linkType"
38
- :icon="icon"
39
- @close="close"
40
- @click="click"
41
- ></HyRowNotice>
42
- </template>
43
- </view>
44
- </template>
45
-
46
- <script lang="ts">
47
- export default {
48
- name: 'hy-notice-bar',
49
- options: {
50
- addGlobalClass: true,
51
- virtualHost: true,
52
- styleIsolation: 'shared'
53
- }
54
- }
55
- </script>
56
-
57
- <script setup lang="ts">
58
- import { ref } from 'vue'
59
- import type { INoticeBarEmits } from './typing'
60
- import noticeBarProps from './props'
61
- // 组件
62
- import HyRowNotice from './hy-row-notice.vue'
63
- import HyColumnNotice from './hy-column-notice.vue'
64
-
65
- /**
66
- * 该组件用于滚动通告场景,有多种模式可供选择
67
- * @displayName hy-notice-bar
68
- */
69
- defineOptions({})
70
-
71
- const show = ref(true)
72
-
73
- const props = defineProps(noticeBarProps)
74
- const emit = defineEmits<INoticeBarEmits>()
75
-
76
- /**
77
- * @description 点击通告栏
78
- * */
79
- const click = (index: number) => {
80
- emit('click', index)
81
- if (props.url && props.linkType && props.mode === 'link') {
82
- ;(uni as any)[props.linkType]({ url: props.url })
83
- }
84
- }
85
- /**
86
- * @description 点击关闭按钮
87
- * */
88
- const close = () => {
89
- show.value = false
90
- emit('close')
91
- }
92
- </script>
93
-
94
- <style lang="scss" scoped>
95
- @import './index.scss';
96
- </style>
1
+ <template>
2
+ <view
3
+ :class="`hy-notice-bar ${customClass}`"
4
+ v-if="show"
5
+ :style="[
6
+ {
7
+ backgroundColor: bgColor
8
+ },
9
+ customStyle
10
+ ]"
11
+ >
12
+ <view class="hy-notice" @tap="clickHandler">
13
+ <!-- 左侧图标 -->
14
+ <slot name="icon">
15
+ <view class="hy-notice__left-icon" v-if="icon">
16
+ <hy-icon
17
+ :name="icon?.name || icon"
18
+ :color="icon?.color || color"
19
+ :size="icon?.size || 19"
20
+ ></hy-icon>
21
+ </view>
22
+ </slot>
23
+
24
+ <!-- 中间内容区域 -->
25
+ <template v-if="direction === 'column' || (direction === 'row' && step)">
26
+ <hy-column-notice
27
+ :color="color"
28
+ :text="text"
29
+ :fontSize="fontSize"
30
+ :duration="duration"
31
+ :justifyContent="justifyContent"
32
+ :disable-touch="disableTouch"
33
+ :step="step"
34
+ @change="noticeChange"
35
+ ></hy-column-notice>
36
+ </template>
37
+ <template v-else>
38
+ <hy-row-notice
39
+ :color="color"
40
+ :text="text"
41
+ :fontSize="fontSize"
42
+ :speed="speed"
43
+ @change="noticeChange"
44
+ ></hy-row-notice>
45
+ </template>
46
+
47
+ <!-- 右侧图标 -->
48
+ <view class="hy-notice__right-icon" v-if="['link', 'closable'].includes(mode)">
49
+ <hy-icon
50
+ v-if="mode === 'link'"
51
+ :name="IconConfig.RIGHT"
52
+ :size="17"
53
+ :color="color"
54
+ ></hy-icon>
55
+ <hy-icon
56
+ v-if="mode === 'closable'"
57
+ @click.stop="close"
58
+ :name="IconConfig.CLOSE"
59
+ :size="16"
60
+ :color="color"
61
+ ></hy-icon>
62
+ </view>
63
+ </view>
64
+ </view>
65
+ </template>
66
+
67
+ <script lang="ts">
68
+ export default {
69
+ name: 'hy-notice-bar',
70
+ options: {
71
+ addGlobalClass: true,
72
+ virtualHost: true,
73
+ styleIsolation: 'shared'
74
+ }
75
+ }
76
+ </script>
77
+
78
+ <script setup lang="ts">
79
+ import { ref } from 'vue'
80
+ import type { INoticeBarEmits } from './typing'
81
+ import noticeBarProps from './props'
82
+ import { IconConfig } from '../../libs'
83
+ // 组件
84
+ import HyRowNotice from './hy-row-notice.vue'
85
+ import HyColumnNotice from './hy-column-notice.vue'
86
+ import HyIcon from '../hy-icon/hy-icon.vue'
87
+
88
+ /**
89
+ * 该组件用于滚动通告场景,有多种模式可供选择
90
+ * @displayName hy-notice-bar
91
+ */
92
+ defineOptions({})
93
+
94
+ const show = ref(true)
95
+ const currentIndex = ref(0)
96
+
97
+ const props = defineProps(noticeBarProps)
98
+ const emit = defineEmits<INoticeBarEmits>()
99
+
100
+ /**
101
+ * @description 通告内容变化
102
+ * */
103
+ const noticeChange = (index: number) => {
104
+ currentIndex.value = index
105
+ }
106
+
107
+ /**
108
+ * @description 点击通告栏
109
+ * */
110
+ const clickHandler = () => {
111
+ emit('click', currentIndex.value)
112
+ if (props.url && props.linkType && props.mode === 'link') {
113
+ ;(uni as any)[props.linkType]({ url: props.url })
114
+ }
115
+ }
116
+
117
+ /**
118
+ * @description 点击关闭按钮
119
+ * */
120
+ const close = () => {
121
+ show.value = false
122
+ emit('close')
123
+ }
124
+ </script>
125
+
126
+ <style lang="scss" scoped>
127
+ @import './index.scss';
128
+ </style>