hy-app 0.1.2 → 0.1.3

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 (221) hide show
  1. package/README.md +1 -1
  2. package/api/http.ts +8 -8
  3. package/components/dialog/index.ts +2 -2
  4. package/components/hy-address-picker/hy-address-picker.vue +3 -29
  5. package/components/hy-address-picker/index.scss +27 -0
  6. package/components/hy-avatar/hy-avatar.vue +1 -45
  7. package/components/hy-avatar/index.scss +45 -0
  8. package/components/hy-avatar/typing.d.ts +1 -1
  9. package/components/hy-back-top/hy-back-top.vue +7 -22
  10. package/components/hy-back-top/index.scss +16 -0
  11. package/components/hy-back-top/props.ts +4 -4
  12. package/components/hy-back-top/typing.d.ts +2 -3
  13. package/components/hy-badge/hy-badge.vue +1 -72
  14. package/components/hy-badge/index.scss +72 -0
  15. package/components/hy-button/hy-button.vue +12 -124
  16. package/components/hy-button/index.scss +116 -0
  17. package/components/hy-calendar/header.vue +76 -0
  18. package/components/hy-calendar/hy-calendar.vue +366 -0
  19. package/components/hy-calendar/index.scss +171 -0
  20. package/components/hy-calendar/month.vue +524 -0
  21. package/components/hy-calendar/props.ts +37 -0
  22. package/components/hy-calendar/typing.d.ts +126 -0
  23. package/components/hy-card/hy-card.vue +21 -84
  24. package/components/hy-card/index.scss +57 -0
  25. package/components/hy-card/props.ts +2 -2
  26. package/components/hy-card/typing.d.ts +1 -1
  27. package/components/hy-cell/hy-cell.vue +1 -137
  28. package/components/hy-cell/index.scss +137 -0
  29. package/components/hy-check-button/hy-check-button.vue +1 -0
  30. package/components/hy-check-button/index.scss +5 -0
  31. package/components/hy-checkbox/hy-checkbox.vue +2 -95
  32. package/components/hy-checkbox/index.scss +94 -0
  33. package/components/hy-checkbox/typing.d.ts +1 -2
  34. package/components/hy-count-down/hy-count-down.vue +150 -0
  35. package/components/hy-count-down/index.scss +6 -0
  36. package/components/hy-count-down/index.ts +52 -0
  37. package/components/hy-count-down/props.ts +10 -0
  38. package/components/hy-count-down/typing.d.ts +20 -0
  39. package/components/hy-count-to/hy-count-to.vue +213 -0
  40. package/components/hy-count-to/index.scss +6 -0
  41. package/components/hy-count-to/props.ts +17 -0
  42. package/components/hy-count-to/typing.d.ts +48 -0
  43. package/components/hy-datetime-picker/hy-datetime-picker.vue +2 -28
  44. package/components/hy-datetime-picker/index.scss +28 -0
  45. package/components/hy-divider/hy-divider.vue +24 -49
  46. package/components/hy-divider/index.scss +25 -0
  47. package/components/hy-divider/props.ts +2 -2
  48. package/components/hy-divider/typing.d.ts +1 -1
  49. package/components/hy-dropdown/hy-dropdown.vue +43 -0
  50. package/components/hy-dropdown/index.scss +17 -0
  51. package/components/hy-dropdown/props.ts +17 -0
  52. package/components/hy-dropdown/typing.d.ts +48 -0
  53. package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
  54. package/components/hy-dropdown-item/index.scss +96 -0
  55. package/components/hy-dropdown-item/props.ts +10 -0
  56. package/components/hy-dropdown-item/typing.d.ts +31 -0
  57. package/components/hy-empty/hy-empty.vue +8 -26
  58. package/components/hy-empty/index.scss +19 -0
  59. package/components/hy-empty/props.ts +2 -2
  60. package/components/hy-empty/typing.d.ts +1 -1
  61. package/components/hy-float-button/hy-float-button.vue +201 -0
  62. package/components/hy-float-button/index.scss +69 -0
  63. package/components/hy-float-button/props.ts +25 -0
  64. package/components/hy-float-button/typing.d.ts +93 -0
  65. package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
  66. package/components/hy-folding-panel/index.scss +6 -0
  67. package/components/hy-folding-panel/props.ts +2 -2
  68. package/components/hy-folding-panel/typing.d.ts +2 -2
  69. package/components/hy-form/hy-form.vue +17 -34
  70. package/components/hy-form/index.scss +30 -0
  71. package/components/hy-form/props.ts +2 -0
  72. package/components/hy-form/typing.d.ts +9 -1
  73. package/components/hy-grid/hy-grid.vue +1 -43
  74. package/components/hy-grid/index.scss +40 -0
  75. package/components/hy-icon/hy-icon.vue +1 -93
  76. package/components/hy-icon/index.scss +84 -0
  77. package/components/hy-image/hy-image.vue +212 -0
  78. package/components/hy-image/index.scss +26 -0
  79. package/components/hy-image/props.ts +24 -0
  80. package/components/hy-image/typing.d.ts +76 -0
  81. package/components/hy-input/hy-input.vue +2 -72
  82. package/components/hy-input/index.scss +65 -0
  83. package/components/hy-line/hy-line.vue +4 -8
  84. package/components/hy-line/index.scss +5 -0
  85. package/components/hy-line/props.ts +3 -3
  86. package/components/hy-line/typing.d.ts +2 -2
  87. package/components/hy-line-progress/hy-line-progress.vue +15 -44
  88. package/components/hy-line-progress/index.scss +38 -0
  89. package/components/hy-line-progress/props.ts +2 -2
  90. package/components/hy-line-progress/typing.d.ts +1 -1
  91. package/components/hy-list/hy-list.vue +11 -41
  92. package/components/hy-list/index.scss +32 -0
  93. package/components/hy-list/props.ts +2 -2
  94. package/components/hy-loading/hy-loading.vue +95 -0
  95. package/components/hy-loading/index.scss +103 -0
  96. package/components/hy-loading/props.ts +17 -0
  97. package/components/hy-loading/typing.d.ts +52 -0
  98. package/components/hy-login/TheUserLogin.vue +16 -16
  99. package/components/hy-login/hy-login.vue +9 -9
  100. package/components/hy-login/props.ts +4 -4
  101. package/components/hy-modal/hy-modal.vue +11 -89
  102. package/components/hy-modal/index.scss +77 -0
  103. package/components/hy-modal/props.ts +2 -2
  104. package/components/hy-modal/typing.d.ts +1 -1
  105. package/components/hy-navbar/hy-navbar.vue +20 -92
  106. package/components/hy-navbar/index.scss +67 -0
  107. package/components/hy-navbar/props.ts +2 -2
  108. package/components/hy-navbar/typing.d.ts +1 -1
  109. package/components/hy-notice-bar/hy-column-notice.vue +11 -39
  110. package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
  111. package/components/hy-notice-bar/hy-row-notice.vue +5 -56
  112. package/components/hy-notice-bar/index.scss +93 -0
  113. package/components/hy-notice-bar/props.ts +4 -2
  114. package/components/hy-notice-bar/typing.d.ts +13 -3
  115. package/components/hy-number-step/hy-number-step.vue +1 -70
  116. package/components/hy-number-step/index.scss +71 -0
  117. package/components/hy-overlay/hy-overlay.vue +2 -14
  118. package/components/hy-overlay/index.scss +9 -0
  119. package/components/hy-picker/hy-picker.vue +1 -68
  120. package/components/hy-picker/index.scss +68 -0
  121. package/components/hy-popup/hy-popup.vue +1 -74
  122. package/components/hy-popup/index.scss +60 -0
  123. package/components/hy-price/hy-price.vue +1 -11
  124. package/components/hy-price/index.scss +11 -0
  125. package/components/hy-qrcode/hy-qrcode.vue +15 -37
  126. package/components/hy-qrcode/index.scss +23 -0
  127. package/components/hy-qrcode/props.ts +2 -2
  128. package/components/hy-qrcode/typing.d.ts +2 -2
  129. package/components/hy-radio/hy-radio.vue +2 -101
  130. package/components/hy-radio/index.scss +93 -0
  131. package/components/hy-radio/typing.d.ts +1 -2
  132. package/components/hy-rate/hy-rate.vue +1 -33
  133. package/components/hy-rate/index.scss +33 -0
  134. package/components/hy-read-more/hy-read-more.vue +7 -30
  135. package/components/hy-read-more/index.scss +25 -0
  136. package/components/hy-read-more/props.ts +3 -3
  137. package/components/hy-read-more/typing.d.ts +1 -1
  138. package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
  139. package/components/hy-safe-bottom/index.scss +5 -0
  140. package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
  141. package/components/hy-scroll-list/index.scss +34 -0
  142. package/components/hy-scroll-list/props.ts +2 -2
  143. package/components/hy-scroll-list/typing.d.ts +1 -1
  144. package/components/hy-search/hy-search.vue +1 -83
  145. package/components/hy-search/index.scss +83 -0
  146. package/components/hy-slider/hy-slider.vue +14 -92
  147. package/components/hy-slider/index.scss +77 -0
  148. package/components/hy-status-bar/hy-status-bar.vue +41 -0
  149. package/components/hy-status-bar/index.scss +6 -0
  150. package/components/hy-status-bar/props.ts +8 -0
  151. package/components/hy-status-bar/typing.d.ts +12 -0
  152. package/components/hy-steps/hy-steps.vue +36 -163
  153. package/components/hy-steps/index.scss +131 -0
  154. package/components/hy-steps/props.ts +2 -2
  155. package/components/hy-steps/typing.d.ts +2 -2
  156. package/components/hy-subsection/hy-subsection.vue +40 -132
  157. package/components/hy-subsection/index.scss +82 -0
  158. package/components/hy-subsection/props.ts +1 -0
  159. package/components/hy-subsection/typing.d.ts +13 -4
  160. package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
  161. package/components/hy-swipe-action/index.scss +9 -0
  162. package/components/hy-swipe-action/index.wxs +235 -0
  163. package/components/hy-swipe-action/props.ts +16 -0
  164. package/components/hy-swipe-action/typing.d.ts +55 -0
  165. package/components/hy-swipe-action/wxs.js +15 -0
  166. package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
  167. package/components/hy-swiper/hy-swiper.vue +1 -54
  168. package/components/hy-swiper/index.scss +82 -0
  169. package/components/hy-switch/hy-switch.vue +62 -72
  170. package/components/hy-switch/index.scss +46 -0
  171. package/components/hy-switch/props.ts +4 -1
  172. package/components/hy-switch/typing.d.ts +14 -1
  173. package/components/hy-tabs/hy-tabs.vue +22 -81
  174. package/components/hy-tabs/index.scss +63 -0
  175. package/components/hy-tabs/props.ts +5 -5
  176. package/components/hy-tabs/typing.d.ts +1 -1
  177. package/components/hy-tag/hy-tag.vue +1 -214
  178. package/components/hy-tag/index.scss +204 -0
  179. package/components/hy-text/hy-text.vue +238 -0
  180. package/components/hy-text/index.scss +70 -0
  181. package/components/hy-text/index.ts +0 -0
  182. package/components/hy-text/props.ts +30 -0
  183. package/components/hy-text/typing.d.ts +98 -0
  184. package/components/hy-textarea/hy-textarea.vue +1 -46
  185. package/components/hy-textarea/index.scss +40 -0
  186. package/components/hy-tooltip/hy-tooltip.vue +42 -95
  187. package/components/hy-tooltip/index.scss +64 -0
  188. package/components/hy-tooltip/props.ts +2 -2
  189. package/components/hy-tooltip/typing.d.ts +1 -1
  190. package/components/hy-transition/hy-transition.vue +4 -2
  191. package/components/hy-transition/typing.d.ts +1 -13
  192. package/components/hy-upload/hy-upload.vue +37 -182
  193. package/components/hy-upload/index.scss +147 -0
  194. package/components/hy-upload/props.ts +2 -2
  195. package/components/hy-upload/typing.d.ts +11 -11
  196. package/components/hy-warn/hy-warn.vue +15 -123
  197. package/components/hy-warn/index.scss +109 -0
  198. package/components/hy-warn/props.ts +3 -3
  199. package/components/hy-warn/typing.d.ts +4 -3
  200. package/components/hy-waterfall/index.scss +82 -0
  201. package/components/index.ts +25 -1
  202. package/components/message/index.ts +54 -54
  203. package/config/color.ts +2 -1
  204. package/global/index.ts +6 -6
  205. package/global/register-properties.ts +2 -2
  206. package/index.scss +2 -1
  207. package/libs/css/common.scss +14 -2
  208. package/package.json +2 -2
  209. package/{libs/css → public/font}/iconfont.css +4 -4
  210. package/theme.scss +6 -4
  211. package/typing/modules/common.d.ts +16 -1
  212. package/utils/calendar.js +1021 -0
  213. package/utils/colorGradient.ts +112 -0
  214. package/utils/index.ts +2 -0
  215. package/utils/inside.ts +80 -34
  216. package/utils/inspect.ts +66 -0
  217. package/utils/utils.ts +11 -12
  218. package/libs/css/download.zip +0 -0
  219. /package/{libs/css → public/font}/iconfont.ttf +0 -0
  220. /package/{libs/css → public/font}/iconfont.woff +0 -0
  221. /package/{libs/css → public/font}/iconfont.woff2 +0 -0
@@ -0,0 +1,238 @@
1
+ <template>
2
+ <view class="hy-text" v-if="show" :style="wrapStyle" @tap="clickHandler">
3
+ <text
4
+ :class="['hy-text__price', type && `hy-text__value--${type}`]"
5
+ v-if="mode === 'price'"
6
+ :style="[valueStyle]"
7
+ >¥</text
8
+ >
9
+ <view class="hy-text__prefix-icon" v-if="prefixIcon">
10
+ <HyIcon :name="prefixIcon" :customStyle="iconStyle"></HyIcon>
11
+ </view>
12
+ <template v-if="openType && isMp">
13
+ <button
14
+ class="hy-reset-button hy-text__value"
15
+ :style="[valueStyle]"
16
+ :data-index="index"
17
+ :openType="openType"
18
+ @getuserinfo="onGetUserInfo"
19
+ @contact="onContact"
20
+ @getphonenumber="onGetPhoneNumber"
21
+ @error="onError"
22
+ @launchapp="onLaunchApp"
23
+ @opensetting="onOpenSetting"
24
+ :lang="lang"
25
+ :session-from="sessionFrom"
26
+ :send-message-title="sendMessageTitle"
27
+ :send-message-path="sendMessagePath"
28
+ :send-message-img="sendMessageImg"
29
+ :show-message-card="showMessageCard"
30
+ :app-parameter="appParameter"
31
+ >
32
+ {{ value }}
33
+ </button>
34
+ </template>
35
+ <text
36
+ v-else
37
+ class="hy-text__value"
38
+ :style="[valueStyle]"
39
+ :class="[
40
+ type && `hy-text__value--${type}`,
41
+ lines && `hy-text__value--lines`,
42
+ mode === 'link' && `hy-text__value--link`,
43
+ ]"
44
+ >{{ value }}</text
45
+ >
46
+ <view class="hy-text__suffix-icon" v-if="suffixIcon">
47
+ <HyIcon :name="suffixIcon" :customStyle="iconStyle"></HyIcon>
48
+ </view>
49
+ </view>
50
+ </template>
51
+
52
+ <script setup lang="ts">
53
+ import { computed, type CSSProperties, nextTick, toRefs } from "vue";
54
+ import type IProps from "./typing";
55
+ import defaultProps from "./props";
56
+ import {
57
+ addUnit,
58
+ error,
59
+ formatName,
60
+ formatTime,
61
+ isDate,
62
+ priceFormat,
63
+ } from "../../utils";
64
+
65
+ // 组件
66
+ import HyIcon from "../hy-icon/hy-icon.vue";
67
+
68
+ const props = withDefaults(defineProps<IProps>(), defaultProps);
69
+ const {
70
+ type,
71
+ show,
72
+ text,
73
+ mode,
74
+ call,
75
+ bold,
76
+ block,
77
+ color,
78
+ size,
79
+ decoration,
80
+ margin,
81
+ lines,
82
+ lineHeight,
83
+ align,
84
+ flex,
85
+ href,
86
+ format,
87
+ customStyle,
88
+ } = toRefs(props);
89
+ const emit = defineEmits(["click"]);
90
+
91
+ const wrapStyle = computed(() => {
92
+ const style: CSSProperties = {
93
+ margin: margin.value,
94
+ justifyContent:
95
+ align.value === "left"
96
+ ? "flex-start"
97
+ : align.value === "center"
98
+ ? "center"
99
+ : "flex-end",
100
+ };
101
+ // 占满剩余空间
102
+ if (flex.value) {
103
+ style.flex = 1;
104
+ // #ifndef APP-NVUE
105
+ style.width = "100%";
106
+ // #endif
107
+ }
108
+ return style;
109
+ });
110
+ const valueStyle = computed(() => {
111
+ const style: CSSProperties = {
112
+ textDecoration: decoration.value,
113
+ fontWeight: bold.value ? "bold" : "normal",
114
+ fontSize: addUnit(size.value),
115
+ };
116
+ !type.value && (style.color = color.value);
117
+ lineHeight.value && (style.lineHeight = addUnit(lineHeight.value));
118
+ block.value && (style.display = "block");
119
+ return Object.assign(style, customStyle.value);
120
+ });
121
+
122
+ /**
123
+ * @description 格式化值
124
+ * */
125
+ const value = computed(() => {
126
+ switch (mode.value) {
127
+ case "price":
128
+ // 如果text不为金额进行提示
129
+ if (!/^\d+(\.\d+)?$/.test(text.value.toString())) {
130
+ error("金额模式下,text参数需要为金额格式");
131
+ }
132
+ // 进行格式化,判断用户传入的format参数为正则,或者函数,如果没有传入format,则使用默认的金额格式化处理
133
+ if (typeof format.value === "function") {
134
+ // 如果用户传入的是函数,使用函数格式化
135
+ return format.value(text.value);
136
+ }
137
+ // 如果format非正则,非函数,则使用默认的金额格式化方法进行操作
138
+ return priceFormat(text.value, 2);
139
+ case "date":
140
+ // 判断是否合法的日期或者时间戳
141
+ !isDate(text.value) &&
142
+ error("日期模式下,text参数需要为日期或时间戳格式");
143
+ // 进行格式化,判断用户传入的format参数为正则,或者函数,如果没有传入format,则使用默认的格式化处理
144
+ if (typeof format.value === "function") {
145
+ // 如果用户传入的是函数,使用函数格式化
146
+ return format.value(text);
147
+ }
148
+ if (format.value) {
149
+ // 如果format非正则,非函数,则使用默认的时间格式化方法进行操作
150
+ return formatTime(text.value, format.value);
151
+ }
152
+ console.log(formatTime(text.value, "yyyy-MM-dd"), text.value);
153
+ // 如果没有设置format,则设置为默认的时间格式化形式
154
+ return formatTime(text.value, "yyyy-MM-dd");
155
+ case "phone":
156
+ // 判断是否合法的手机号
157
+ // !test.mobile(text) && error('手机号模式下,text参数需要为手机号码格式')
158
+ if (typeof format.value === "function") {
159
+ // 如果用户传入的是函数,使用函数格式化
160
+ return format.value(text);
161
+ }
162
+ if (format.value === "encrypt") {
163
+ // 如果format为encrypt,则将手机号进行星号加密处理
164
+ return `${text.value.toString().substring(0, 3)}****${text.value.toString().substring(7)}`;
165
+ }
166
+ return text.value;
167
+ case "name":
168
+ // 判断是否合法的字符粗
169
+ if (typeof text.value !== "string") {
170
+ error("姓名模式下,text参数需要为字符串格式");
171
+ } else {
172
+ if (typeof format.value === "function") {
173
+ // 如果用户传入的是函数,使用函数格式化
174
+ return format.value(text);
175
+ }
176
+ if (format.value === "encrypt") {
177
+ // 如果format为encrypt,则将姓名进行星号加密处理
178
+ return formatName(text.value);
179
+ }
180
+ }
181
+ return text.value;
182
+ case "link":
183
+ return text.value;
184
+ default:
185
+ return text.value;
186
+ }
187
+ });
188
+
189
+ const isMp = computed(() => {
190
+ let mp = false;
191
+ // #ifdef MP
192
+ mp = true;
193
+ // #endif
194
+ return mp;
195
+ });
196
+
197
+ const clickHandler = (e) => {
198
+ // 如果为手机号模式,拨打电话
199
+ if (call.value && mode.value === "phone") {
200
+ uni.makePhoneCall({
201
+ phoneNumber: text.value,
202
+ });
203
+ }
204
+ // 如果是有链接跳转
205
+ if (href.value && mode.value === "link") {
206
+ toLink();
207
+ }
208
+ emit("click", e);
209
+ };
210
+
211
+ const toLink = () => {
212
+ // #ifdef APP-PLUS
213
+ plus.runtime.openURL(href.value);
214
+ // #endif
215
+ // #ifdef H5
216
+ window.open(href.value);
217
+ // #endif
218
+ // #ifdef MP
219
+ uni.setClipboardData({
220
+ data: href.value,
221
+ success: () => {
222
+ uni.hideToast();
223
+ nextTick(() => {
224
+ uni.showToast({ title: "链接已复制,请在浏览器打开" });
225
+ });
226
+ },
227
+ });
228
+ // #endif
229
+ };
230
+ </script>
231
+
232
+ <style scoped lang="scss">
233
+ @import "./index.scss";
234
+ @import "../../libs/css/mixin.scss";
235
+ .hy-text__value--lines {
236
+ @include line-feed(v-bind(lines));
237
+ }
238
+ </style>
@@ -0,0 +1,70 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../theme.scss" as *;
3
+
4
+ .hy-text {
5
+ @include flex(row);
6
+ align-items: center;
7
+ flex-wrap: nowrap;
8
+
9
+ &__price {
10
+ font-size: 14px;
11
+ color: $hy-text-color-grey;
12
+ }
13
+
14
+ &__value {
15
+ font-size: 14px;
16
+ @include flex;
17
+ color: $hy-text-color;
18
+ flex-wrap: wrap;
19
+ // flex: 1;
20
+ text-overflow: ellipsis;
21
+ align-items: center;
22
+
23
+ /*链接*/
24
+ &--link {
25
+ text-decoration: underline;
26
+ color: $hy-primary;
27
+ }
28
+
29
+ /*超出出现省略号*/
30
+ &--lines {
31
+ @include line-feed(v-bind(lines));
32
+ }
33
+
34
+ &--primary {
35
+ color: $hy-primary;
36
+ }
37
+
38
+ &--warning {
39
+ color: $hy-warning;
40
+ }
41
+
42
+ &--success {
43
+ color: $hy-success;
44
+ }
45
+
46
+ &--info {
47
+ color: $hy-info;
48
+ }
49
+
50
+ &--error {
51
+ color: $hy-error;
52
+ }
53
+
54
+ &--main {
55
+ color: $hy-text-color;
56
+ }
57
+
58
+ &--content {
59
+ color: $hy-text-color-grey;
60
+ }
61
+
62
+ &--tips {
63
+ color: $hy-tips-color;
64
+ }
65
+
66
+ &--light {
67
+ color: $hy-text-color-light;
68
+ }
69
+ }
70
+ }
File without changes
@@ -0,0 +1,30 @@
1
+ import type IProps from "./typing";
2
+
3
+ const defaultProps: IProps = {
4
+ text: "",
5
+ type: "",
6
+ show: true,
7
+ prefixIcon: "",
8
+ suffixIcon: "",
9
+ mode: "text",
10
+ href: "",
11
+ format: "",
12
+ call: false,
13
+ openType: "",
14
+ bold: false,
15
+ block: false,
16
+ lines: "",
17
+ color: "",
18
+ size: 15,
19
+ iconStyle: {
20
+ fontSize: "15px",
21
+ },
22
+ decoration: "",
23
+ margin: "",
24
+ lineHeight: "",
25
+ align: "left",
26
+ wordWrap: "normal",
27
+ flex: true,
28
+ };
29
+
30
+ export default defaultProps;
@@ -0,0 +1,98 @@
1
+ import type { CSSProperties } from "vue";
2
+
3
+ export type TextMode = "text" | "price" | "phone" | "name" | "date" | "link";
4
+
5
+ export default interface IProps {
6
+ /**
7
+ * @description 显示的值
8
+ * */
9
+ text: string | number;
10
+ /**
11
+ * @description 主题颜色
12
+ * */
13
+ type?: HyApp.ThemeType;
14
+ /**
15
+ * @description 是否显示(默认 true )
16
+ * */
17
+ show?: boolean;
18
+ /**
19
+ * @description 前置图标
20
+ * */
21
+ prefixIcon?: string;
22
+ /**
23
+ * @description 后置图标
24
+ * */
25
+ suffixIcon?: string;
26
+ /**
27
+ * @description 文本处理的匹配模式 text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
28
+ * */
29
+ mode?: TextMode;
30
+ /**
31
+ * @description mode=link下,配置的链接
32
+ * */
33
+ href?: string;
34
+ /**
35
+ * @description 格式化规则
36
+ * */
37
+ format?: Function | string;
38
+ /**
39
+ * @description mode=phone时,点击文本是否拨打电话(默认 false )
40
+ * */
41
+ call?: boolean;
42
+ /**
43
+ * @description 小程序的打开方式
44
+ * */
45
+ openType?: string;
46
+ /**
47
+ * @description 是否粗体,默认normal(默认 false )
48
+ * */
49
+ bold?: boolean;
50
+ /**
51
+ * @description 是否块状(默认 false )
52
+ * */
53
+ block?: boolean;
54
+ /**
55
+ * @description 文本显示的行数,如果设置,超出此行数,将会显示省略号
56
+ * */
57
+ lines?: string | number;
58
+ /**
59
+ * @description 文本颜色(默认 '#303133' )
60
+ * */
61
+ color?: string;
62
+ /**
63
+ * @description 是否显示字体大小(默认 15 )遮罩
64
+ * */
65
+ size?: number | string;
66
+ /**
67
+ * @description 图标的样式 (默认 {fontSize: '15px'} )
68
+ * */
69
+ iconStyle?: CSSProperties;
70
+ /**
71
+ * @description 文字装饰,下划线,中划线等,可选值 none|underline|line-through(默认 'none' )
72
+ * */
73
+ decoration?: "" | "none" | "underline" | "line-through";
74
+ /**
75
+ * @description 外边距,对象、字符串,数值形式均可(默认 0 )
76
+ * */
77
+ margin?: string;
78
+ /**
79
+ * @description 文本行高
80
+ * */
81
+ lineHeight?: string | number;
82
+ /**
83
+ * @description 文本对齐方式,可选值left|center|right(默认 'left' )
84
+ * */
85
+ align?: HyApp.CenterType;
86
+ /**
87
+ * @description 文字换行,可选值break-word|normal|anywhere(默认 'normal' )
88
+ * */
89
+ wordWrap?: "normal" | "break-word" | "anywhere";
90
+ /**
91
+ * @description 是否占满剩余空间(默认:true)
92
+ * */
93
+ flex?: boolean;
94
+ /**
95
+ * @description 定义需要用到的外部样式
96
+ * */
97
+ customStyle?: CSSProperties;
98
+ }
@@ -187,50 +187,5 @@ const onKeyboardheightchange = (e: Event) => {
187
187
  </script>
188
188
 
189
189
  <style lang="scss" scoped>
190
- @import "../../libs/css/mixin.scss";
191
- @import "../../theme.scss";
192
-
193
- .hy-textarea {
194
- border-radius: 4px;
195
- background-color: #fff;
196
- position: relative;
197
- @include flex;
198
- flex: 1;
199
- padding: 9px;
200
-
201
- &--radius {
202
- border-radius: 4px;
203
- }
204
-
205
- &--no-radius {
206
- border-radius: 0;
207
- }
208
-
209
- &--disabled {
210
- background-color: $hy-color-disable-bg;
211
- }
212
-
213
- &__field {
214
- flex: 1;
215
- font-size: 15px;
216
- color: #606266ff;
217
- width: 100%;
218
- }
219
-
220
- &__count {
221
- position: absolute;
222
- right: 5px;
223
- bottom: 2px;
224
- font-size: 12px;
225
- color: $hy-tips-color;
226
- background-color: #ffffff;
227
- padding: 1px 4px;
228
- }
229
- }
230
- .hy-border {
231
- border: $hy-border-line;
232
- &__bottom {
233
- border-bottom: $hy-border-line;
234
- }
235
- }
190
+ @import "./index.scss";
236
191
  </style>
@@ -0,0 +1,40 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ .hy-textarea {
5
+ border-radius: $hy-border-radius-sm;
6
+ background-color: #fff;
7
+ position: relative;
8
+ @include flex;
9
+ flex: 1;
10
+ padding: $hy-border-margin-padding-base;
11
+
12
+ &--radius {
13
+ border-radius: $hy-border-radius-sm;
14
+ }
15
+
16
+ &--no-radius {
17
+ border-radius: $hy-border-radius-no;
18
+ }
19
+
20
+ &--disabled {
21
+ background-color: $hy-color-disable-bg;
22
+ }
23
+
24
+ &__field {
25
+ flex: 1;
26
+ font-size: 15px;
27
+ color: #606266ff;
28
+ width: 100%;
29
+ }
30
+
31
+ &__count {
32
+ position: absolute;
33
+ right: 5px;
34
+ bottom: 2px;
35
+ font-size: 12px;
36
+ color: $hy-tips-color;
37
+ background-color: #ffffff;
38
+ padding: 1px 4px;
39
+ }
40
+ }