hy-app 0.5.14 → 0.5.16

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 (35) hide show
  1. package/components/hy-address-picker/hy-address-picker.vue +0 -1
  2. package/components/hy-button/hy-button.vue +7 -1
  3. package/components/hy-button/index.scss +22 -21
  4. package/components/hy-code-input/hy-code-input.vue +231 -231
  5. package/components/hy-code-input/props.ts +90 -88
  6. package/components/hy-config-provider/index.scss +1 -1
  7. package/components/hy-datetime-picker/hy-datetime-picker.vue +519 -521
  8. package/components/hy-icon/index.scss +1 -2
  9. package/components/hy-index-bar/hy-index-bar.vue +0 -12
  10. package/components/hy-index-bar/index.scss +1 -1
  11. package/components/hy-notify/hy-notify.vue +174 -174
  12. package/components/hy-picker/hy-picker.vue +0 -1
  13. package/components/hy-picker/index.scss +1 -1
  14. package/components/hy-skeleton/hy-skeleton.vue +142 -0
  15. package/components/hy-skeleton/index.scss +90 -0
  16. package/components/hy-skeleton/props.ts +46 -0
  17. package/components/hy-skeleton/typing.d.ts +31 -0
  18. package/components/hy-steps/hy-steps.vue +267 -267
  19. package/components/hy-steps/index.scss +7 -2
  20. package/components/hy-steps/typing.d.ts +25 -21
  21. package/components/hy-tabs/index.scss +1 -0
  22. package/components/hy-tag/hy-tag.vue +174 -174
  23. package/components/hy-tag/index.scss +3 -6
  24. package/components/hy-tag/props.ts +89 -89
  25. package/components/hy-text/hy-text.vue +1 -1
  26. package/components/hy-textarea/hy-textarea.vue +1 -1
  27. package/components/hy-textarea/index.scss +1 -4
  28. package/global.d.ts +2 -0
  29. package/index.scss +1 -1
  30. package/libs/css/iconfont.css +117 -119
  31. package/libs/css/theme.scss +1 -0
  32. package/libs/css/vars.scss +2 -0
  33. package/libs/utils/utils.ts +0 -1
  34. package/package.json +62 -3
  35. package/web-types.json +1 -1
@@ -1,21 +1,25 @@
1
- export interface StepListVo {
2
- /**
3
- * @description 标题
4
- * */
5
- title?: string
6
- /**
7
- * @description 描述
8
- * */
9
- desc?: string
10
- /**
11
- * @description 是否错误
12
- * */
13
- error?: boolean
14
- }
15
-
16
- export interface IStepsEmits {
17
- /** 值改成触发 */
18
- (e: 'change', index: number): void
19
- /** 值改成触发 */
20
- (e: 'update:current', index: number): void
21
- }
1
+ export interface StepListVo {
2
+ /**
3
+ * 标题
4
+ * */
5
+ title?: string
6
+ /**
7
+ * 描述
8
+ * */
9
+ docs?: string
10
+ /**
11
+ * 时间日期
12
+ * */
13
+ date?: string
14
+ /**
15
+ * 是否错误
16
+ * */
17
+ error?: boolean
18
+ }
19
+
20
+ export interface IStepsEmits {
21
+ /** 值改成触发 */
22
+ (e: 'change', index: number): void
23
+ /** 值改成触发 */
24
+ (e: 'update:current', index: number): void
25
+ }
@@ -31,6 +31,7 @@
31
31
  /* #ifdef H5 */
32
32
  cursor: pointer;
33
33
  /* #endif */
34
+ flex-shrink: 0;
34
35
 
35
36
  @include m(disabled) {
36
37
  /* #ifdef H5 */
@@ -1,174 +1,174 @@
1
- <template>
2
- <hy-transition mode="fade" :show="show" :custom-style="{ display: 'inline-block' }">
3
- <view class="hy-tag__wrapper cursor-pointer">
4
- <view :class="tagClass" @tap.stop="clickHandler" :style="tagStyle">
5
- <slot name="icon">
6
- <hy-icon
7
- v-if="icon?.name"
8
- :name="icon?.name"
9
- :color="hyIconColor"
10
- :size="hyIconSize"
11
- :bold="icon?.bold"
12
- :customPrefix="icon?.customPrefix"
13
- :imgMode="icon?.imgMode"
14
- :width="icon?.width"
15
- :height="icon?.height"
16
- :top="icon?.top"
17
- :stop="icon?.stop"
18
- :round="icon?.round"
19
- :customStyle="Object.assign({ marginRight: '3px' }, icon?.customStyle)"
20
- ></hy-icon>
21
- </slot>
22
- <text :class="textClass" :style="textStyle">
23
- <slot>
24
- {{ text }}
25
- </slot>
26
- </text>
27
- </view>
28
- <view
29
- :class="['hy-tag__close', `hy-tag__close--${size}`]"
30
- v-if="closable"
31
- @tap.stop="closeHandler"
32
- :style="{ backgroundColor: closeColor }"
33
- >
34
- <hy-icon :name="IconConfig.CLOSE" :size="closeSize" color="#ffffff"></hy-icon>
35
- </view>
36
- </view>
37
- </hy-transition>
38
- </template>
39
-
40
- <script lang="ts">
41
- export default {
42
- name: 'hy-tag',
43
- options: {
44
- addGlobalClass: true,
45
- virtualHost: true,
46
- styleIsolation: 'shared'
47
- }
48
- }
49
- </script>
50
-
51
- <script setup lang="ts">
52
- import { computed } from 'vue'
53
- import type { CSSProperties } from 'vue'
54
- import type { ITagEmits } from './typing'
55
- import { IconConfig, colorGradient } from '../../libs'
56
- import tagProps from './props'
57
-
58
- // 组件
59
- import HyTransition from '../hy-transition/hy-transition.vue'
60
- import HyIcon from '../hy-icon/hy-icon.vue'
61
-
62
- /**
63
- * tag组件一般用于标记和选择,我们提供了更加丰富的表现形式,能够较全面的涵盖您的使用场景
64
- * @displayName hy-tag
65
- */
66
- defineOptions({})
67
-
68
- const props = defineProps(tagProps)
69
- const emit = defineEmits<ITagEmits>()
70
-
71
- /**
72
- * @description tag类名
73
- * */
74
- const tagClass = computed((): string[] => {
75
- let classes = ['hy-tag', `hy-tag--${props.shape}`, `hy-tag--${props.size}`, props.customClass]
76
- if (props.disabled) {
77
- classes.push('hy-tag--disabled')
78
- } else {
79
- const arr = [
80
- props.plain ? `hy-tag--${props.type}--plain` : `hy-tag--${props.type}`,
81
- props.plain && props.plainFill && `hy-tag--${props.type}--plain__fill`
82
- ].filter(Boolean)
83
- classes = classes.concat(arr as string[])
84
- }
85
- return classes
86
- })
87
- /**
88
- * @description tag样式
89
- * */
90
- const tagStyle = computed<CSSProperties>(() => {
91
- const style: CSSProperties = {
92
- marginRight: props.closable ? '10px' : 0,
93
- marginTop: props.closable ? '10px' : 0,
94
- background: props.bgColor,
95
- borderColor: props.borderColor
96
- }
97
-
98
- if (props.color) {
99
- if (props.plain) {
100
- style.borderColor = props.color
101
- if (props.plainFill) {
102
- style.background = colorGradient(props.color, '#FFFFFF', 100)[90]
103
- }
104
- } else {
105
- style.background = props.color
106
- style.borderColor = props.color
107
- }
108
- }
109
-
110
- return Object.assign(style, props.customStyle)
111
- })
112
-
113
- /**
114
- * @description 文本样式
115
- * */
116
- const textStyle = computed(() => {
117
- const style: CSSProperties = {}
118
- if (props.color && props.plain) style.color = props.color
119
- return style
120
- })
121
- /**
122
- * @description 文本类名
123
- * */
124
- const textClass = computed((): string[] => {
125
- return [`hy-tag__text`, `hy-tag__text--${props.size}`]
126
- })
127
-
128
- /**
129
- * @description 关闭图标icon大小
130
- */
131
- const closeSize = computed(() => {
132
- return props.size === 'large' ? 15 : props.size === 'medium' ? 13 : 11
133
- })
134
- /**
135
- * @description 图标大小
136
- * */
137
- const hyIconSize = computed(() => {
138
- if (props.icon?.size) {
139
- return props.icon.size
140
- } else {
141
- return props.size === 'large' ? 18 : props.size === 'medium' ? 14 : 10
142
- }
143
- })
144
- /**
145
- * @description 图标颜色
146
- * */
147
- const hyIconColor = computed(() => {
148
- return props.icon?.color ? props.icon.color : props.plain ? props.type : '#ffffff'
149
- })
150
-
151
- /**
152
- * @description 点击关闭按钮
153
- * */
154
- const closeHandler = () => {
155
- if (!props.disabled) {
156
- emit('close', props.text)
157
- }
158
- }
159
- /**
160
- * @description 点击标签
161
- * */
162
- const clickHandler = () => {
163
- if (!props.disabled) {
164
- emit('click', {
165
- value: props.text,
166
- name: props.name
167
- })
168
- }
169
- }
170
- </script>
171
-
172
- <style lang="scss" scoped>
173
- @import './index.scss';
174
- </style>
1
+ <template>
2
+ <hy-transition mode="fade" :show="show" :custom-style="{ display: 'inline-block' }">
3
+ <view class="hy-tag__wrapper cursor-pointer">
4
+ <view :class="tagClass" @tap.stop="clickHandler" :style="tagStyle">
5
+ <slot v-if="$slots.icon" name="icon"></slot>
6
+ <hy-icon
7
+ v-else-if="icon?.name"
8
+ :name="icon?.name"
9
+ :color="hyIconColor"
10
+ :size="hyIconSize"
11
+ :bold="icon?.bold"
12
+ :customPrefix="icon?.customPrefix"
13
+ :imgMode="icon?.imgMode"
14
+ :width="icon?.width"
15
+ :height="icon?.height"
16
+ :top="icon?.top"
17
+ :stop="icon?.stop"
18
+ :round="icon?.round"
19
+ :customStyle="Object.assign({ marginRight: '3px' }, icon?.customStyle)"
20
+ ></hy-icon>
21
+ <text :class="textClass" :style="textStyle">
22
+ <slot>
23
+ {{ text }}
24
+ </slot>
25
+ </text>
26
+ <!-- 关闭按钮 -->
27
+ <view
28
+ :class="['hy-tag__close', `hy-tag__close--${size}`]"
29
+ v-if="closable"
30
+ @tap.stop="closeHandler"
31
+ :style="{ backgroundColor: closeColor }"
32
+ >
33
+ <hy-icon :name="IconConfig.CLOSE" :size="closeSize" color="#ffffff"></hy-icon>
34
+ </view>
35
+ </view>
36
+ </view>
37
+ </hy-transition>
38
+ </template>
39
+
40
+ <script lang="ts">
41
+ export default {
42
+ name: 'hy-tag',
43
+ options: {
44
+ addGlobalClass: true,
45
+ virtualHost: true,
46
+ styleIsolation: 'shared'
47
+ }
48
+ }
49
+ </script>
50
+
51
+ <script setup lang="ts">
52
+ import { computed } from 'vue'
53
+ import type { CSSProperties } from 'vue'
54
+ import type { ITagEmits } from './typing'
55
+ import { IconConfig, colorGradient } from '../../libs'
56
+ import tagProps from './props'
57
+
58
+ // 组件
59
+ import HyTransition from '../hy-transition/hy-transition.vue'
60
+ import HyIcon from '../hy-icon/hy-icon.vue'
61
+
62
+ /**
63
+ * tag组件一般用于标记和选择,我们提供了更加丰富的表现形式,能够较全面的涵盖您的使用场景
64
+ * @displayName hy-tag
65
+ */
66
+ defineOptions({})
67
+
68
+ const props = defineProps(tagProps)
69
+ const emit = defineEmits<ITagEmits>()
70
+
71
+ /**
72
+ * @description tag类名
73
+ * */
74
+ const tagClass = computed((): string[] => {
75
+ let classes = ['hy-tag', `hy-tag--${props.shape}`, `hy-tag--${props.size}`, props.customClass]
76
+ if (props.disabled) {
77
+ classes.push('hy-tag--disabled')
78
+ } else {
79
+ const arr = [
80
+ props.plain ? `hy-tag--${props.type}--plain` : `hy-tag--${props.type}`,
81
+ props.plain && props.plainFill && `hy-tag--${props.type}--plain__fill`
82
+ ].filter(Boolean)
83
+ classes = classes.concat(arr as string[])
84
+ }
85
+ return classes
86
+ })
87
+ /**
88
+ * @description tag样式
89
+ * */
90
+ const tagStyle = computed<CSSProperties>(() => {
91
+ const style: CSSProperties = {
92
+ marginRight: props.closable ? '10px' : 0,
93
+ marginTop: props.closable ? '10px' : 0,
94
+ background: props.bgColor,
95
+ borderColor: props.borderColor
96
+ }
97
+
98
+ if (props.color) {
99
+ if (props.plain) {
100
+ style.borderColor = props.color
101
+ if (props.plainFill) {
102
+ style.background = colorGradient(props.color, '#FFFFFF', 100)[90]
103
+ }
104
+ } else {
105
+ style.background = props.color
106
+ style.borderColor = props.color
107
+ }
108
+ }
109
+
110
+ return Object.assign(style, props.customStyle)
111
+ })
112
+
113
+ /**
114
+ * @description 文本样式
115
+ * */
116
+ const textStyle = computed(() => {
117
+ const style: CSSProperties = {}
118
+ if (props.color && props.plain) style.color = props.color
119
+ return style
120
+ })
121
+ /**
122
+ * @description 文本类名
123
+ * */
124
+ const textClass = computed((): string[] => {
125
+ return [`hy-tag__text`, `hy-tag__text--${props.size}`]
126
+ })
127
+
128
+ /**
129
+ * @description 关闭图标icon大小
130
+ */
131
+ const closeSize = computed(() => {
132
+ return props.size === 'large' ? 15 : props.size === 'medium' ? 13 : 11
133
+ })
134
+ /**
135
+ * @description 图标大小
136
+ * */
137
+ const hyIconSize = computed(() => {
138
+ if (props.icon?.size) {
139
+ return props.icon.size
140
+ } else {
141
+ return props.size === 'large' ? 18 : props.size === 'medium' ? 14 : 10
142
+ }
143
+ })
144
+ /**
145
+ * @description 图标颜色
146
+ * */
147
+ const hyIconColor = computed(() => {
148
+ return props.icon?.color ? props.icon.color : props.plain ? props.type : '#ffffff'
149
+ })
150
+
151
+ /**
152
+ * @description 点击关闭按钮
153
+ * */
154
+ const closeHandler = () => {
155
+ if (!props.disabled) {
156
+ emit('close', props.text)
157
+ }
158
+ }
159
+ /**
160
+ * @description 点击标签
161
+ * */
162
+ const clickHandler = () => {
163
+ if (!props.disabled) {
164
+ emit('click', {
165
+ value: props.text,
166
+ name: props.name
167
+ })
168
+ }
169
+ }
170
+ </script>
171
+
172
+ <style lang="scss" scoped>
173
+ @import './index.scss';
174
+ </style>
@@ -88,17 +88,14 @@ $hy-background--disabled);
88
88
 
89
89
  /* 关闭按钮 */
90
90
  @include e(close) {
91
- position: absolute;
92
- z-index: 999;
93
- top: 10px;
94
- right: 10px;
95
91
  border-radius: $hy-border-radius-semicircle;
96
- background-color: #c6c7cb;
92
+ background-color: #C6C7CB;
93
+ margin-left: $hy-border-margin-padding-sm;
97
94
  @include flex(row);
98
95
  align-items: center;
99
96
  justify-content: center;
100
97
  /* #ifndef APP-NVUE */
101
- transform: scale(0.6) translate(80%, -80%);
98
+ transform: scale(0.8) translate(40%, 0%);
102
99
  /* #endif */
103
100
  /* #ifdef APP-NVUE */
104
101
  transform: scale(0.6) translate(50%, -50%);
@@ -1,89 +1,89 @@
1
- import type { CSSProperties, PropType } from 'vue'
2
- import type { HyIconProps } from '../hy-icon/typing'
3
-
4
- const tagProps = {
5
- /** 标签的文字内容 */
6
- text: {
7
- type: String,
8
- default: ''
9
- },
10
- /** 点击需要传得值 */
11
- name: {
12
- type: [String, Number],
13
- default: ''
14
- },
15
- /**
16
- * 标签类型
17
- * @values info,primary,success,error,warning
18
- * */
19
- type: {
20
- type: String,
21
- default: 'primary'
22
- },
23
- /** 禁用点击标签 */
24
- disabled: {
25
- type: Boolean,
26
- default: false
27
- },
28
- /**
29
- * 标签的大小
30
- * @values large,medium,small,mini
31
- * */
32
- size: {
33
- type: String,
34
- default: 'medium'
35
- },
36
- /**
37
- * tag的形状
38
- * @values circle,square,opposite
39
- * */
40
- shape: {
41
- type: String,
42
- default: 'square'
43
- },
44
- /** 背景颜色,默认为空字符串,即不处理 */
45
- bgColor: String,
46
- /** 标签字体颜色,默认为空字符串,即不处理 */
47
- color: String,
48
- /** 镂空形式标签的边框颜色 */
49
- borderColor: String,
50
- /** 关闭按钮图标的颜色 */
51
- closeColor: {
52
- type: String,
53
- default: '#C6C7CB'
54
- },
55
- /** 镂空时是否填充背景色 */
56
- plainFill: {
57
- type: Boolean,
58
- default: false
59
- },
60
- /** 是否镂空 */
61
- plain: {
62
- type: Boolean,
63
- default: false
64
- },
65
- /** 是否可关闭,设置为true,文字右边会出现一个关闭图标 */
66
- closable: {
67
- type: Boolean,
68
- default: false
69
- },
70
- /** 标签显示与否 */
71
- show: {
72
- type: Boolean,
73
- default: true
74
- },
75
- /** 组件内置图标,或绝对路径的图片 */
76
- icon: Object as PropType<HyIconProps>,
77
- /** 定义需要用到的外部样式 */
78
- customStyle: {
79
- type: Object as PropType<CSSProperties>,
80
- default: () => {}
81
- },
82
- /** 自定义外部类名 */
83
- customClass: {
84
- type: String,
85
- default: ''
86
- }
87
- }
88
-
89
- export default tagProps
1
+ import type { CSSProperties, PropType } from 'vue'
2
+ import type { HyIconProps } from '../hy-icon/typing'
3
+
4
+ const tagProps = {
5
+ /** 标签的文字内容 */
6
+ text: {
7
+ type: String,
8
+ default: ''
9
+ },
10
+ /** 点击需要传得值 */
11
+ name: {
12
+ type: [String, Number],
13
+ default: ''
14
+ },
15
+ /**
16
+ * 标签类型
17
+ * @values info,primary,success,error,warning
18
+ * */
19
+ type: {
20
+ type: String,
21
+ default: 'primary'
22
+ },
23
+ /** 禁用点击标签 */
24
+ disabled: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ /**
29
+ * 标签的大小
30
+ * @values large,medium,small,mini
31
+ * */
32
+ size: {
33
+ type: String,
34
+ default: 'medium'
35
+ },
36
+ /**
37
+ * tag的形状
38
+ * @values circle,square,opposite
39
+ * */
40
+ shape: {
41
+ type: String,
42
+ default: 'square'
43
+ },
44
+ /** 背景颜色,默认为空字符串,即不处理 */
45
+ bgColor: String,
46
+ /** 标签字体颜色,默认为空字符串,即不处理 */
47
+ color: String,
48
+ /** 镂空形式标签的边框颜色 */
49
+ borderColor: String,
50
+ /** 关闭按钮图标的颜色 */
51
+ closeColor: {
52
+ type: String,
53
+ default: ''
54
+ },
55
+ /** 镂空时是否填充背景色 */
56
+ plainFill: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ /** 是否镂空 */
61
+ plain: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ /** 是否可关闭,设置为true,文字右边会出现一个关闭图标 */
66
+ closable: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+ /** 标签显示与否 */
71
+ show: {
72
+ type: Boolean,
73
+ default: true
74
+ },
75
+ /** 组件内置图标,或绝对路径的图片 */
76
+ icon: Object as PropType<HyIconProps>,
77
+ /** 定义需要用到的外部样式 */
78
+ customStyle: {
79
+ type: Object as PropType<CSSProperties>,
80
+ default: () => {}
81
+ },
82
+ /** 自定义外部类名 */
83
+ customClass: {
84
+ type: String,
85
+ default: ''
86
+ }
87
+ }
88
+
89
+ export default tagProps
@@ -120,7 +120,7 @@ const valueStyle = computed(() => {
120
120
  })
121
121
 
122
122
  /**
123
- * @description 格式化值
123
+ * 格式化值
124
124
  * */
125
125
  const value = computed(() => {
126
126
  switch (props.mode) {
@@ -78,7 +78,7 @@ defineOptions({})
78
78
 
79
79
  const props = defineProps(textareaProps)
80
80
  const emit = defineEmits<ITextareaEmits>()
81
- const formItem = inject<FormItemContext>('formItem')
81
+ const formItem = inject<FormItemContext | null>('formItem', null)
82
82
 
83
83
  // 输入框的值
84
84
  const innerValue = ref<string>('')
@@ -33,6 +33,7 @@
33
33
  min-height: 50rpx;
34
34
  max-height: 200rpx;
35
35
  color: $hy-text-color;
36
+ caret-color: $hy-text-color;
36
37
  flex: 1;
37
38
  font-size: 15px;
38
39
  width: 100%;
@@ -50,7 +51,3 @@
50
51
  border-radius: $hy-border-radius-sm;
51
52
  }
52
53
  }
53
- //textarea {
54
- // background-color: transparent;
55
- // border: none;
56
- //}
package/global.d.ts CHANGED
@@ -36,6 +36,7 @@ declare module 'vue' {
36
36
  HyGrid: (typeof import('./components/hy-grid/hy-grid.vue'))['default']
37
37
  HyIcon: (typeof import('./components/hy-icon/hy-icon.vue'))['default']
38
38
  HyImage: (typeof import('./components/hy-image/hy-image.vue'))['default']
39
+ HyIndexBar: (typeof import('./components/hy-index-bar/hy-index-bar.vue'))['default']
39
40
  HyInput: (typeof import('./components/hy-input/hy-input.vue'))['default']
40
41
  HyLine: (typeof import('./components/hy-line/hy-line.vue'))['default']
41
42
  HyLineProgress: (typeof import('./components/hy-line-progress/hy-line-progress.vue'))['default']
@@ -62,6 +63,7 @@ declare module 'vue' {
62
63
  HyScrollList: (typeof import('./components/hy-scroll-list/hy-scroll-list.vue'))['default']
63
64
  HySearch: (typeof import('./components/hy-search/hy-search.vue'))['default']
64
65
  HySignature: (typeof import('./components/hy-signature/hy-signature.vue'))['default']
66
+ HySkeleton: (typeof import('./components/hy-skeleton/hy-skeleton.vue'))['default']
65
67
  HySlider: (typeof import('./components/hy-slider/hy-slider.vue'))['default']
66
68
  HyStatusBar: (typeof import('./components/hy-status-bar/hy-status-bar.vue'))['default']
67
69
  HySteps: (typeof import('./components/hy-steps/hy-steps.vue'))['default']
package/index.scss CHANGED
@@ -1,4 +1,4 @@
1
1
  @use "./libs/css/common.scss";
2
2
  @use "./libs/css/vars.scss";
3
- @use "libs/css/mixin";
3
+ @use "./libs/css/mixin.scss";
4
4
  @use "./libs/css/theme.scss";