im-ui-mobile 0.1.8 → 0.1.10

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.
@@ -103,7 +103,7 @@ interface Props {
103
103
  color?: string
104
104
  bgColor?: string
105
105
  borderColor?: string
106
- border: boolean
106
+ border?: boolean
107
107
  textColor?: string
108
108
  textSize?: TextSize
109
109
  width?: string
@@ -93,8 +93,7 @@
93
93
  <script setup lang="ts">
94
94
  import { computed } from 'vue'
95
95
  import type { CSSProperties } from 'vue'
96
- import ImIcon from '../im-icon/im-icon.vue'
97
- import ImBadge from '../im-badge/im-badge.vue'
96
+ import ImButton from '../im-button/im-button.vue'
98
97
 
99
98
  // 类型定义
100
99
  interface CardAction {
@@ -98,6 +98,7 @@
98
98
  <script setup lang="ts">
99
99
  import { ref, computed, watch, nextTick } from 'vue'
100
100
  import type { Modal as ModalType } from 'im-ui-mobile'
101
+ import ImModal from '../im-modal/im-modal.vue'
101
102
 
102
103
  // 定义对话框类型
103
104
  type DialogType = 'alert' | 'confirm' | 'prompt' | 'success' | 'error' | 'warning' | 'info' | 'html' | 'custom'
@@ -179,6 +179,7 @@
179
179
 
180
180
  <script setup lang="ts">
181
181
  import { ref, computed, watch, onMounted } from 'vue'
182
+ import ImButton from '../im-button/im-button.vue'
182
183
 
183
184
  // 类型定义
184
185
  interface Emoji {
@@ -13,6 +13,8 @@
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
16
+ import ImAvatar from '../im-avatar/im-avatar.vue'
17
+
16
18
  interface Props {
17
19
  friend?: any;
18
20
  detail?: boolean;
@@ -40,6 +40,7 @@
40
40
 
41
41
  <script setup lang="ts">
42
42
  import { ref, computed } from 'vue'
43
+ import ImPopup from '../im-popup/im-popup.vue'
43
44
 
44
45
  interface Props {
45
46
  group?: any;
@@ -23,6 +23,8 @@
23
23
 
24
24
  <script setup lang="ts">
25
25
  import ImAvatar from '../im-avatar/im-avatar.vue'
26
+ import ImPopup from '../im-popup/im-popup.vue'
27
+ import ImModal from '../im-modal/im-modal.vue'
26
28
  import { ref } from 'vue';
27
29
  import { UserInfo } from '../../libs';
28
30
 
@@ -113,6 +113,7 @@
113
113
 
114
114
  <script setup lang="ts">
115
115
  import { computed } from 'vue'
116
+ import ImBadge from '../im-badge/im-badge.vue'
116
117
 
117
118
  // 定义 Props
118
119
  interface Props {
@@ -10,6 +10,7 @@
10
10
 
11
11
  <script setup lang="ts">
12
12
  import { computed } from 'vue'
13
+ import ImIcon from '../im-icon/im-icon.vue'
13
14
 
14
15
  interface Props {
15
16
  size?: number;
@@ -37,6 +37,10 @@
37
37
  <script setup lang="ts">
38
38
  import { ref, computed } from 'vue'
39
39
  import { GroupMember } from '../../libs';
40
+ import ImPopup from '../im-popup/im-popup.vue'
41
+ import ImAvatar from '../im-avatar/im-avatar.vue'
42
+ import ImSearch from '../im-search/im-search.vue'
43
+ import ImVirtualList from '../im-virtual-list/im-virtual-list.vue'
40
44
 
41
45
  interface Props {
42
46
  ownerId?: number;
@@ -63,6 +63,8 @@
63
63
 
64
64
  <script setup lang="ts">
65
65
  import { ref, computed, watch, nextTick } from 'vue'
66
+ import ImIcon from '../im-icon/im-icon.vue'
67
+ import ImBadge from '../im-badge/im-badge.vue'
66
68
 
67
69
  // 类型定义
68
70
  interface MessageAction {
@@ -117,7 +117,7 @@
117
117
  <script setup lang="ts">
118
118
  import { ref, computed, watch, nextTick, onMounted, onUnmounted } from 'vue'
119
119
  import { useDynamicRefs, datetime } from 'im-ui-mobile'
120
- import { MESSAGE_TYPE, MESSAGE_STATUS } from '../..'
120
+ import { MESSAGE_TYPE, MESSAGE_STATUS } from '../../utils/enums'
121
121
  import { Message, GroupMember } from '../../libs'
122
122
 
123
123
  // 使用动态引用
@@ -1,29 +1,11 @@
1
1
  <template>
2
- <im-popup
3
- v-model:show="visible"
4
- ref="popupRef"
5
- :position="position"
6
- :animation="animation"
7
- :duration="duration"
8
- :show-overlay="showOverlay"
9
- :overlay-color="overlayColor"
10
- :overlay-opacity="overlayOpacity"
11
- :close-on-click-overlay="closeOnClickOverlay"
12
- :lock-scroll="lockScroll"
13
- :width="computedWidth"
14
- :border-radius="borderRadius"
15
- :background-color="backgroundColor"
16
- :z-index="zIndex"
17
- :show-close="showClose && showHeader"
18
- :close-position="closePosition"
19
- :safe-area-inset-bottom="safeAreaInsetBottom"
20
- :custom-class="customClass"
21
- @open="handleOpen"
22
- @opened="handleOpened"
23
- @close="handleClose"
24
- @closed="handleClosed"
25
- @click-overlay="handleClickOverlay"
26
- >
2
+ <im-popup v-model:show="visible" ref="popupRef" :position="position" :animation="animation" :duration="duration"
3
+ :show-overlay="showOverlay" :overlay-color="overlayColor" :overlay-opacity="overlayOpacity"
4
+ :close-on-click-overlay="closeOnClickOverlay" :lock-scroll="lockScroll" :width="computedWidth"
5
+ :border-radius="borderRadius" :background-color="backgroundColor" :z-index="zIndex"
6
+ :show-close="showClose && showHeader" :close-position="closePosition" :safe-area-inset-bottom="safeAreaInsetBottom"
7
+ :custom-class="customClass" @open="handleOpen" @opened="handleOpened" @close="handleClose" @closed="handleClosed"
8
+ @click-overlay="handleClickOverlay">
27
9
  <!-- 头部 -->
28
10
  <view v-if="showHeader" class="im-modal__header">
29
11
  <slot name="header">
@@ -48,30 +30,14 @@
48
30
  <slot name="footer">
49
31
  <view class="im-modal__footer-buttons">
50
32
  <!-- 取消按钮 -->
51
- <im-button
52
- v-if="showCancel"
53
- class="im-modal__button"
54
- :type="cancelType"
55
- :size="buttonSize"
56
- :plain="cancelPlain"
57
- :disabled="cancelDisabled"
58
- :loading="cancelLoading"
59
- @click="handleCancel"
60
- >
33
+ <im-button v-if="showCancel" class="im-modal__button" :type="cancelType" :size="buttonSize"
34
+ :plain="cancelPlain" :disabled="cancelDisabled" :loading="cancelLoading" @click="handleCancel">
61
35
  {{ cancelText }}
62
36
  </im-button>
63
37
 
64
38
  <!-- 确认按钮 -->
65
- <im-button
66
- v-if="showConfirm"
67
- class="im-modal__button"
68
- :type="confirmType"
69
- :size="buttonSize"
70
- :plain="confirmPlain"
71
- :disabled="confirmDisabled"
72
- :loading="confirmLoading"
73
- @click="handleConfirm"
74
- >
39
+ <im-button v-if="showConfirm" class="im-modal__button" :type="confirmType" :size="buttonSize"
40
+ :plain="confirmPlain" :disabled="confirmDisabled" :loading="confirmLoading" @click="handleConfirm">
75
41
  {{ confirmText }}
76
42
  </im-button>
77
43
  </view>
@@ -83,25 +49,27 @@
83
49
  <script setup lang="ts">
84
50
  import { ref, computed } from 'vue'
85
51
  import type { Popup as PopupType } from 'im-ui-mobile'
52
+ import ImPopup from '../im-popup/im-popup.vue'
53
+ import ImButton from '../im-button/im-button.vue'
86
54
 
87
55
  // 定义 Props
88
56
  interface Props {
89
57
  // 显示控制
90
58
  show?: boolean
91
59
  modelValue?: boolean
92
-
60
+
93
61
  // 标题和内容
94
62
  title?: string
95
63
  subtitle?: string
96
64
  content?: string
97
-
65
+
98
66
  // 头部配置
99
67
  showHeader?: boolean
100
68
  showSubtitle?: boolean
101
-
69
+
102
70
  // 内容配置
103
71
  bodyStyle?: Record<string, string>
104
-
72
+
105
73
  // 底部按钮配置
106
74
  showFooter?: boolean
107
75
  showCancel?: boolean
@@ -117,7 +85,7 @@ interface Props {
117
85
  cancelLoading?: boolean
118
86
  confirmLoading?: boolean
119
87
  buttonSize?: 'small' | 'medium' | 'large'
120
-
88
+
121
89
  // 弹窗配置(传递给 im-popup)
122
90
  position?: 'center' | 'top' | 'bottom' | 'left' | 'right'
123
91
  animation?: 'fade' | 'slide' | 'zoom' | 'none'
@@ -137,7 +105,7 @@ interface Props {
137
105
  closePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
138
106
  safeAreaInsetBottom?: boolean
139
107
  customClass?: string
140
-
108
+
141
109
  // 行为控制
142
110
  closeOnClickAction?: boolean
143
111
  showCloseAfterConfirm?: boolean
@@ -165,16 +133,16 @@ interface Emits {
165
133
  const props = withDefaults(defineProps<Props>(), {
166
134
  show: false,
167
135
  modelValue: false,
168
-
136
+
169
137
  title: '提示',
170
138
  subtitle: '',
171
139
  content: '',
172
-
140
+
173
141
  showHeader: true,
174
142
  showSubtitle: true,
175
-
143
+
176
144
  bodyStyle: () => ({}),
177
-
145
+
178
146
  showFooter: true,
179
147
  showCancel: true,
180
148
  showConfirm: true,
@@ -189,7 +157,7 @@ const props = withDefaults(defineProps<Props>(), {
189
157
  cancelLoading: false,
190
158
  confirmLoading: false,
191
159
  buttonSize: 'medium',
192
-
160
+
193
161
  position: 'center',
194
162
  animation: 'zoom',
195
163
  duration: 300,
@@ -208,7 +176,7 @@ const props = withDefaults(defineProps<Props>(), {
208
176
  closePosition: 'top-right',
209
177
  safeAreaInsetBottom: true,
210
178
  customClass: '',
211
-
179
+
212
180
  closeOnClickAction: true,
213
181
  showCloseAfterConfirm: true,
214
182
  showCloseAfterCancel: true
@@ -231,17 +199,17 @@ const visible = computed({
231
199
  // 计算宽度
232
200
  const computedWidth = computed(() => {
233
201
  let width = props.width
234
-
202
+
235
203
  // 添加最大宽度限制
236
204
  if (props.maxWidth) {
237
205
  width = `min(${props.width}, ${props.maxWidth})`
238
206
  }
239
-
207
+
240
208
  // 添加最小宽度限制
241
209
  if (props.minWidth) {
242
210
  width = `max(${width}, ${props.minWidth})`
243
211
  }
244
-
212
+
245
213
  return width
246
214
  })
247
215
 
@@ -292,7 +260,7 @@ const handleCancel = () => {
292
260
 
293
261
  // 打开模态框
294
262
  const open = () => {
295
- popupRef.value.open()
263
+ popupRef.value.open()
296
264
  }
297
265
 
298
266
  // 关闭模态框
@@ -318,12 +286,12 @@ defineExpose({
318
286
  &__header {
319
287
  padding: 40rpx 40rpx 20rpx;
320
288
  border-bottom: 2rpx solid #f5f5f5;
321
-
289
+
322
290
  &-content {
323
291
  text-align: center;
324
292
  }
325
293
  }
326
-
294
+
327
295
  &__title {
328
296
  display: block;
329
297
  font-size: 36rpx;
@@ -331,17 +299,17 @@ defineExpose({
331
299
  color: #333;
332
300
  line-height: 1.4;
333
301
  }
334
-
302
+
335
303
  &__subtitle {
336
304
  margin-top: 12rpx;
337
-
305
+
338
306
  text {
339
307
  font-size: 28rpx;
340
308
  color: #999;
341
309
  line-height: 1.4;
342
310
  }
343
311
  }
344
-
312
+
345
313
  &__body {
346
314
  padding: 40rpx;
347
315
  font-size: 30rpx;
@@ -350,22 +318,22 @@ defineExpose({
350
318
  overflow-y: auto;
351
319
  max-height: 60vh;
352
320
  }
353
-
321
+
354
322
  &__content {
355
323
  display: block;
356
324
  text-align: center;
357
325
  }
358
-
326
+
359
327
  &__footer {
360
328
  padding: 20rpx 40rpx 40rpx;
361
-
329
+
362
330
  &-buttons {
363
331
  display: flex;
364
332
  gap: 20rpx;
365
333
  justify-content: center;
366
334
  }
367
335
  }
368
-
336
+
369
337
  &__button {
370
338
  flex: 1;
371
339
  }
@@ -99,6 +99,7 @@
99
99
  import { ref, computed, onMounted, watch } from 'vue'
100
100
  import { onLoad, onShow } from '@dcloudio/uni-app'
101
101
  import type { IconType } from '../../types/components/icon'
102
+ import ImIcon from '../im-icon/im-icon.vue'
102
103
 
103
104
  // 类型定义
104
105
  interface NavBarAction {
@@ -2,7 +2,7 @@
2
2
  <im-popup ref="popup" position="bottom">
3
3
  <view class="read-receipt">
4
4
  <view class="uni-padding-wrap uni-common-mt">
5
- <im-tabs :current="current" :items="items" :show-bar="false" @change="onClickItem" />
5
+ <im-tabs v-model="current" :items="items" @change="onClickItem" />
6
6
  </view>
7
7
  <view class="content">
8
8
  <view v-if="current === 0">
@@ -34,9 +34,11 @@
34
34
 
35
35
  <script setup lang="ts">
36
36
  import { ref } from 'vue'
37
+ import { Chat, Message } from '../../libs';
37
38
  import ImAvatar from '../im-avatar/im-avatar.vue'
38
39
  import ImVirtualList from '../im-virtual-list/im-virtual-list.vue'
39
- import { Chat, Message } from '../../libs';
40
+ import ImTabs from '../im-tabs/im-tabs.vue'
41
+ import ImPopup from '../im-popup/im-popup.vue'
40
42
 
41
43
  interface Props {
42
44
  msgInfo: {
@@ -68,6 +68,7 @@
68
68
 
69
69
  <script setup lang="ts">
70
70
  import { ref, nextTick } from 'vue'
71
+ import ImIcon from '../im-icon/im-icon.vue'
71
72
 
72
73
  // 定义 Props
73
74
  interface Props {
@@ -147,6 +147,8 @@ import type {
147
147
  SkuEmits,
148
148
  SelectedSku
149
149
  } from '../../types/components/sku'
150
+ import ImPopup from '../im-popup/im-popup.vue'
151
+ import ImIcon from '../im-icon/im-icon.vue'
150
152
 
151
153
  const props = withDefaults(defineProps<SkuProps>(), {
152
154
  current: undefined,
@@ -58,6 +58,7 @@
58
58
 
59
59
  <script lang="ts" setup>
60
60
  import type { StepperProps, StepperEmits } from '../../types/components/stepper'
61
+ import ImIcon from '../im-icon/im-icon.vue'
61
62
 
62
63
  const props = withDefaults(defineProps<StepperProps>(), {
63
64
  modelValue: 0,
@@ -428,8 +429,8 @@ defineExpose({
428
429
  }
429
430
 
430
431
  .im-stepper-input {
431
- border-top: 1px solid #ebedf0;
432
- border-bottom: 1px solid #ebedf0;
432
+ // border-top: 1px solid #ebedf0;
433
+ // border-bottom: 1px solid #ebedf0;
433
434
  margin: 0 2px;
434
435
  }
435
436
  }
@@ -211,6 +211,7 @@
211
211
 
212
212
  <script setup lang="ts">
213
213
  import { ref, computed, watch } from 'vue'
214
+ import ImButton from '../im-button/im-button.vue'
214
215
 
215
216
  // 定义文件类型
216
217
  interface UploadFile {
@@ -50,6 +50,7 @@
50
50
 
51
51
  <script setup lang="ts">
52
52
  import { ref, computed, watch, nextTick, onMounted, onUnmounted, getCurrentInstance } from 'vue'
53
+ import ImLoading from '../im-loading/im-loading.vue'
53
54
 
54
55
  // 定义类型
55
56
  export interface VirtualListItem<T = any> {
@@ -28,6 +28,7 @@
28
28
  <script setup lang="ts">
29
29
  import { ref, computed, onUnmounted } from 'vue'
30
30
  import { RecorderApp, RecorderH5 } from '../../index'
31
+ import ImIcon from '../im-icon/im-icon.vue'
31
32
 
32
33
  const recording = ref(false);
33
34
  const moveToCancel = ref(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "im-ui-mobile",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "A Vue3.0 + Typescript instant messaging component library for Uniapp",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -26,7 +26,7 @@ declare interface ButtonProps {
26
26
  color?: string
27
27
  bgColor?: string
28
28
  borderColor?: string
29
- border: boolean
29
+ border?: boolean
30
30
  textColor?: string
31
31
  textSize?: 'small' | 'medium' | 'large'
32
32
  width?: string