hy-app 0.5.13 → 0.5.15

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 (34) 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 +25 -21
  4. package/components/hy-cell-item/hy-cell-item.vue +161 -161
  5. package/components/hy-cell-item/props.ts +59 -66
  6. package/components/hy-code-input/hy-code-input.vue +231 -231
  7. package/components/hy-code-input/props.ts +90 -88
  8. package/components/hy-config-provider/index.scss +4 -7
  9. package/components/hy-datetime-picker/hy-datetime-picker.vue +519 -521
  10. package/components/hy-folding-panel/hy-folding-panel-group.vue +163 -0
  11. package/components/hy-icon/index.scss +1 -2
  12. package/components/hy-index-bar/hy-index-bar.vue +185 -0
  13. package/components/hy-index-bar/index.scss +65 -0
  14. package/components/hy-index-bar/props.ts +94 -0
  15. package/components/hy-index-bar/typing.d.ts +36 -0
  16. package/components/hy-notify/hy-notify.vue +174 -174
  17. package/components/hy-number-step/hy-number-step.vue +367 -367
  18. package/components/hy-number-step/index.scss +14 -5
  19. package/components/hy-picker/hy-picker.vue +0 -1
  20. package/components/hy-picker/index.scss +1 -1
  21. package/components/hy-qrcode/qrcode.js.bak +1434 -0
  22. package/components/hy-table/hy-table.vue +30 -13
  23. package/components/hy-table/index.scss +6 -1
  24. package/components/hy-table/props.ts +1 -1
  25. package/components/hy-tabs/index.scss +1 -0
  26. package/components/hy-tag/index.scss +4 -13
  27. package/components/hy-text/hy-text.vue +1 -1
  28. package/components/hy-textarea/hy-textarea.vue +1 -1
  29. package/components/hy-textarea/index.scss +1 -4
  30. package/global.d.ts +92 -91
  31. package/libs/css/iconfont.css +117 -119
  32. package/libs/utils/utils.ts +502 -521
  33. package/package.json +2 -2
  34. package/web-types.json +1 -1
@@ -6,7 +6,6 @@
6
6
  <template v-else>
7
7
  <hy-input
8
8
  v-model="inputValue"
9
- :readonly="true"
10
9
  :disabled="input?.disabled"
11
10
  :disabledColor="input?.disabledColor"
12
11
  :shape="input?.shape"
@@ -25,7 +25,13 @@
25
25
  :hover-class="!disabled && !loading ? 'hy-button--active' : ''"
26
26
  :style="[baseColor, customStyle]"
27
27
  @click="clickHandler"
28
- :class="['hy-button', border ? '' : 'hy-button__no-border', bemClass, customClass]"
28
+ :class="[
29
+ 'hy-button',
30
+ border && 'hy-button__no-border',
31
+ !disabled && 'hy-button__no-disabled',
32
+ bemClass,
33
+ customClass
34
+ ]"
29
35
  >
30
36
  <template v-if="loading">
31
37
  <HyLoading :mode="loadingMode" :size="loadingSize" :color="loadingColor"></HyLoading>
@@ -14,27 +14,31 @@
14
14
  box-sizing: border-box;
15
15
  /* #endif */
16
16
  flex-direction: row;
17
-
18
- /* 亮光效果 */
19
- &::before {
20
- content: '';
21
- position: absolute;
22
- top: 0;
23
- left: -100%;
24
- width: 100%;
25
- height: 100%;
26
- background: linear-gradient(
27
- 90deg,
28
- transparent,
29
- rgba(255, 255, 255, 0.4),
30
- transparent
31
- );
32
- transition: left 0.7s;
33
- z-index: 1;
34
- }
35
- &:active::before {
36
- left: 100%;
37
- transition: left 0.2s;
17
+ /* 防止文字内容被压缩换行 */
18
+ flex-shrink: 0;
19
+
20
+ @include e(no-disabled) {
21
+ /* 亮光效果 */
22
+ &::before {
23
+ content: '';
24
+ position: absolute;
25
+ top: 0;
26
+ left: -100%;
27
+ width: 100%;
28
+ height: 100%;
29
+ background: linear-gradient(
30
+ 90deg,
31
+ transparent,
32
+ rgba(255, 255, 255, 0.4),
33
+ transparent
34
+ );
35
+ transition: left 0.7s;
36
+ z-index: 1;
37
+ }
38
+ &:active::before {
39
+ left: 100%;
40
+ transition: left 0.2s;
41
+ }
38
42
  }
39
43
 
40
44
 
@@ -1,161 +1,161 @@
1
- <template>
2
- <view
3
- :class="cellClass"
4
- :hover-class="hoverClass"
5
- :style="customStyle"
6
- :hover-stay-time="250"
7
- @tap="clickHandler"
8
- >
9
- <view class="hy-cell-item__left">
10
- <view v-if="icon || $slots.icon" class="hy-cell-item__left--icon">
11
- <!-- @slot 图标插槽 -->
12
- <slot v-if="$slots.icon" name="icon" :icon="item?.icon"></slot>
13
- <hy-icon
14
- v-else
15
- :size="iconSize"
16
- :name="icon?.name"
17
- :color="!!(disabled || cellConfig?.disabled.value) ? '#FFFFFF3F' : icon?.color"
18
- :bold="icon?.bold"
19
- :customPrefix="icon?.customPrefix"
20
- :imgMode="icon?.imgMode"
21
- :width="icon?.width"
22
- :height="icon?.height"
23
- :top="icon?.top"
24
- :stop="icon?.stop"
25
- :round="icon?.round"
26
- :customStyle="icon?.customStyle"
27
- :customClass="icon?.customClass"
28
- ></hy-icon>
29
- </view>
30
- <view class="hy-cell-item__left--title">
31
- <!-- @slot 列表标题插槽 -->
32
- <slot v-if="$slots.title" name="title" :title="title"></slot>
33
- <text v-else class="hy-cell-item__left--title__text">
34
- {{ title }}
35
- </text>
36
- <!-- @slot 列表小标题插槽 -->
37
- <slot v-if="$slots.sub" name="sub" :sub="sub"></slot>
38
- <text v-else-if="sub" class="hy-cell-item__left--title__sub">
39
- {{ sub }}
40
- </text>
41
- </view>
42
- </view>
43
- <view
44
- class="hy-cell-item__center"
45
- :style="{
46
- justifyContent:
47
- cellConfig?.arrange.value === 'left'
48
- ? 'flex-start'
49
- : cellConfig?.arrange.value === 'right'
50
- ? 'flex-end'
51
- : 'center'
52
- }"
53
- >
54
- <!-- @slot 值内容插槽 -->
55
- <slot v-if="$slots.value" name="value" :record="item"></slot>
56
- <text v-else-if="value" class="hy-cell-item__center--value">
57
- {{ value }}
58
- </text>
59
- </view>
60
- <view
61
- :class="[
62
- 'hy-cell-item__right',
63
- `hy-cell-item__right--${cellConfig?.arrowDirection.value}`
64
- ]"
65
- v-if="cellConfig?.isRightIcon.value"
66
- >
67
- <!-- @slot 右边按钮插槽 -->
68
- <slot v-if="$slots['right-icon']" name="right-icon" :icon="rightIcon"></slot>
69
- <hy-icon
70
- v-else
71
- :name="rightIcon?.name || IconConfig.RIGHT"
72
- :color="!!(disabled || cellConfig?.disabled.value) ? '#FFFFFF3F' : rightIcon?.color"
73
- :bold="rightIcon?.bold"
74
- :customPrefix="rightIcon?.customPrefix"
75
- :imgMode="rightIcon?.imgMode"
76
- :width="rightIcon?.width"
77
- :height="rightIcon?.height"
78
- :stop="rightIcon?.stop"
79
- :round="rightIcon?.round"
80
- :customStyle="rightIcon?.customStyle"
81
- :customClass="rightIcon?.customClass"
82
- ></hy-icon>
83
- </view>
84
- </view>
85
- </template>
86
-
87
- <script lang="ts">
88
- export default {
89
- name: 'hy-cell-item',
90
- options: {
91
- virtualHost: true,
92
- styleIsolation: 'shared'
93
- }
94
- }
95
- </script>
96
-
97
- <script setup lang="ts">
98
- import { computed, inject } from 'vue'
99
- import cellItemProps from './props'
100
- import type { ICellContext } from './typing'
101
- import { IconConfig } from '../../libs'
102
- import type { ICellEmits } from '../hy-cell/typing'
103
- // 组件
104
- import HyIcon from '../hy-icon/hy-icon.vue'
105
-
106
- const props = defineProps(cellItemProps)
107
- const emit = defineEmits<ICellEmits>()
108
- const cellConfig = inject<ICellContext>('hy-cell')
109
-
110
- // 单元格类名
111
- const cellClass = computed(() => {
112
- return [
113
- 'hy-cell-item',
114
- `hy-cell-item--${cellConfig?.size.value}`,
115
- cellConfig?.border.value && 'hy-border__bottom',
116
- (props.disabled || cellConfig?.disabled.value) && 'hy-cell-item__disabled',
117
- props.customClass
118
- ]
119
- })
120
-
121
- // 计算什么时候出现点击状态
122
- const hoverClass = computed(() => {
123
- if (!(props.disabled || cellConfig?.disabled.value) && cellConfig?.clickable.value) {
124
- return 'hy-cell-item__clickable'
125
- } else {
126
- return ''
127
- }
128
- })
129
-
130
- // 图标大小
131
- const iconSize = computed(() => {
132
- switch (cellConfig?.size.value) {
133
- case 'large':
134
- return 25
135
- case 'medium':
136
- return 20
137
- case 'small':
138
- return 15
139
- }
140
- })
141
-
142
- /**
143
- * 点击cell
144
- * */
145
- const clickHandler = (e: Event) => {
146
- if (cellConfig?.disabled.value || props.disabled) return
147
- if (props.stop) e.stopPropagation()
148
-
149
- emit('click', props.name)
150
- cellConfig?.onClick(props.name)
151
- if (props.url) {
152
- ;(uni as any)[props.linkType]({
153
- url: props.url
154
- })
155
- }
156
- }
157
- </script>
158
-
159
- <style lang="scss" scoped>
160
- @import './index.scss';
161
- </style>
1
+ <template>
2
+ <view
3
+ :class="cellClass"
4
+ :hover-class="hoverClass"
5
+ :style="customStyle"
6
+ :hover-stay-time="250"
7
+ @tap="clickHandler"
8
+ >
9
+ <view class="hy-cell-item__left">
10
+ <view v-if="icon || $slots.icon" class="hy-cell-item__left--icon">
11
+ <!-- @slot 图标插槽 -->
12
+ <slot v-if="$slots.icon" name="icon" :icon="item?.icon"></slot>
13
+ <hy-icon
14
+ v-else
15
+ :size="iconSize"
16
+ :name="icon?.name"
17
+ :color="!!(disabled || cellConfig?.disabled.value) ? '#FFFFFF3F' : icon?.color"
18
+ :bold="icon?.bold"
19
+ :customPrefix="icon?.customPrefix"
20
+ :imgMode="icon?.imgMode"
21
+ :width="icon?.width"
22
+ :height="icon?.height"
23
+ :top="icon?.top"
24
+ :stop="icon?.stop"
25
+ :round="icon?.round"
26
+ :customStyle="icon?.customStyle"
27
+ :customClass="icon?.customClass"
28
+ ></hy-icon>
29
+ </view>
30
+ <view class="hy-cell-item__left--title">
31
+ <!-- @slot 列表标题插槽 -->
32
+ <slot v-if="$slots.title" name="title" :title="title"></slot>
33
+ <text v-else class="hy-cell-item__left--title__text">
34
+ {{ title }}
35
+ </text>
36
+ <!-- @slot 列表小标题插槽 -->
37
+ <slot v-if="$slots.sub" name="sub" :sub="sub"></slot>
38
+ <text v-else-if="sub" class="hy-cell-item__left--title__sub">
39
+ {{ sub }}
40
+ </text>
41
+ </view>
42
+ </view>
43
+ <view
44
+ class="hy-cell-item__center"
45
+ :style="{
46
+ justifyContent:
47
+ cellConfig?.arrange.value === 'left'
48
+ ? 'flex-start'
49
+ : cellConfig?.arrange.value === 'right'
50
+ ? 'flex-end'
51
+ : 'center'
52
+ }"
53
+ >
54
+ <!-- @slot 值内容插槽 -->
55
+ <slot v-if="$slots.value" name="value" :record="item"></slot>
56
+ <text v-else-if="value" class="hy-cell-item__center--value">
57
+ {{ value }}
58
+ </text>
59
+ </view>
60
+ <view
61
+ :class="[
62
+ 'hy-cell-item__right',
63
+ `hy-cell-item__right--${cellConfig?.arrowDirection.value}`
64
+ ]"
65
+ v-if="cellConfig?.isRightIcon.value"
66
+ >
67
+ <!-- @slot 右边按钮插槽 -->
68
+ <slot v-if="$slots['right-icon']" name="right-icon" :icon="rightIcon"></slot>
69
+ <hy-icon
70
+ v-else
71
+ :name="rightIcon?.name || IconConfig.RIGHT"
72
+ :color="!!(disabled || cellConfig?.disabled.value) ? '#FFFFFF3F' : rightIcon?.color"
73
+ :bold="rightIcon?.bold"
74
+ :customPrefix="rightIcon?.customPrefix"
75
+ :imgMode="rightIcon?.imgMode"
76
+ :width="rightIcon?.width"
77
+ :height="rightIcon?.height"
78
+ :stop="rightIcon?.stop"
79
+ :round="rightIcon?.round"
80
+ :customStyle="rightIcon?.customStyle"
81
+ :customClass="rightIcon?.customClass"
82
+ ></hy-icon>
83
+ </view>
84
+ </view>
85
+ </template>
86
+
87
+ <script lang="ts">
88
+ export default {
89
+ name: 'hy-cell-item',
90
+ options: {
91
+ virtualHost: true,
92
+ styleIsolation: 'shared'
93
+ }
94
+ }
95
+ </script>
96
+
97
+ <script setup lang="ts">
98
+ import { computed, inject } from 'vue'
99
+ import cellItemProps from './props'
100
+ import type { ICellContext } from './typing'
101
+ import { IconConfig } from '../../libs'
102
+ import type { ICellEmits } from '../hy-cell/typing'
103
+ // 组件
104
+ import HyIcon from '../hy-icon/hy-icon.vue'
105
+
106
+ const props = defineProps(cellItemProps)
107
+ const emit = defineEmits<ICellEmits>()
108
+ const cellConfig = inject<ICellContext>('hy-cell')
109
+
110
+ // 单元格类名
111
+ const cellClass = computed(() => {
112
+ return [
113
+ 'hy-cell-item',
114
+ `hy-cell-item--${cellConfig?.size.value}`,
115
+ cellConfig?.border.value && 'hy-border__bottom',
116
+ (props.disabled || cellConfig?.disabled.value) && 'hy-cell-item__disabled',
117
+ props.customClass
118
+ ]
119
+ })
120
+
121
+ // 计算什么时候出现点击状态
122
+ const hoverClass = computed(() => {
123
+ if (!(props.disabled || cellConfig?.disabled.value) && cellConfig?.clickable.value) {
124
+ return 'hy-cell-item__clickable'
125
+ } else {
126
+ return ''
127
+ }
128
+ })
129
+
130
+ // 图标大小
131
+ const iconSize = computed(() => {
132
+ switch (cellConfig?.size.value) {
133
+ case 'large':
134
+ return 25
135
+ case 'medium':
136
+ return 20
137
+ case 'small':
138
+ return 15
139
+ }
140
+ })
141
+
142
+ /**
143
+ * 点击cell
144
+ * */
145
+ const clickHandler = (e: Event) => {
146
+ if (cellConfig?.disabled.value || props.disabled) return
147
+ if (props.stop) e.stopPropagation()
148
+
149
+ emit('click', props.name)
150
+ cellConfig?.onClick(props.name)
151
+ if (props.url) {
152
+ uni.navigateTo({
153
+ url: props.url
154
+ })
155
+ }
156
+ }
157
+ </script>
158
+
159
+ <style lang="scss" scoped>
160
+ @import './index.scss';
161
+ </style>
@@ -1,66 +1,59 @@
1
- import type { CSSProperties, PropType } from 'vue'
2
- import type { HyIconProps } from '../hy-icon/typing'
3
-
4
- const cellItemProps = {
5
- /** 头部标题 */
6
- title: String,
7
- /** 标题下面小提示 */
8
- sub: String,
9
- /** 是否禁用cell */
10
- disabled: {
11
- type: Boolean,
12
- default: false
13
- },
14
- /** 右侧的内容 */
15
- value: String,
16
- /** 图标,接收icon对象 */
17
- icon: {
18
- type: Object as PropType<HyIconProps>
19
- },
20
- /** 右边图标,默认是向左图标 */
21
- rightIcon: {
22
- type: Object as PropType<HyIconProps>
23
- },
24
- /**
25
- * 右侧箭头的方向
26
- * @values left,up,down
27
- * */
28
- arrowDirection: {
29
- type: String,
30
- default: 'right'
31
- },
32
- /**
33
- * 点击后跳转的URL地址
34
- * */
35
- url: {
36
- type: String,
37
- default: ''
38
- },
39
- /**
40
- * 链接跳转的方式,内部使用的是uview-plus封装的route方法,可能会进行拦截操作
41
- * */
42
- linkType: {
43
- type: String,
44
- default: 'navigateTo'
45
- },
46
- /**
47
- * 点击cell是否阻止事件传播
48
- * */
49
- stop: {
50
- type: Boolean,
51
- default: true
52
- },
53
- /**
54
- * 标识符,用于在click事件中进行返回
55
- * */
56
- name: {
57
- type: [String, Number],
58
- default: ''
59
- },
60
- /** 定义需要用到的外部样式 */
61
- customStyle: Object as PropType<CSSProperties>,
62
- /** 自定义外部类名 */
63
- customClass: String
64
- }
65
-
66
- export default cellItemProps
1
+ import type { CSSProperties, PropType } from 'vue'
2
+ import type { HyIconProps } from '../hy-icon/typing'
3
+
4
+ const cellItemProps = {
5
+ /** 头部标题 */
6
+ title: String,
7
+ /** 标题下面小提示 */
8
+ sub: String,
9
+ /** 是否禁用cell */
10
+ disabled: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ /** 右侧的内容 */
15
+ value: String,
16
+ /** 图标,接收icon对象 */
17
+ icon: {
18
+ type: Object as PropType<HyIconProps>
19
+ },
20
+ /** 右边图标,默认是向左图标 */
21
+ rightIcon: {
22
+ type: Object as PropType<HyIconProps>
23
+ },
24
+ /**
25
+ * 右侧箭头的方向
26
+ * @values left,up,down
27
+ * */
28
+ arrowDirection: {
29
+ type: String,
30
+ default: 'right'
31
+ },
32
+ /**
33
+ * 点击后跳转的URL地址
34
+ * */
35
+ url: {
36
+ type: String,
37
+ default: ''
38
+ },
39
+ /**
40
+ * 点击cell是否阻止事件传播
41
+ * */
42
+ stop: {
43
+ type: Boolean,
44
+ default: true
45
+ },
46
+ /**
47
+ * 标识符,用于在click事件中进行返回
48
+ * */
49
+ name: {
50
+ type: [String, Number],
51
+ default: ''
52
+ },
53
+ /** 定义需要用到的外部样式 */
54
+ customStyle: Object as PropType<CSSProperties>,
55
+ /** 自定义外部类名 */
56
+ customClass: String
57
+ }
58
+
59
+ export default cellItemProps