im-ui-mobile 0.1.0 → 0.1.2

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 (85) hide show
  1. package/components/im-avatar/im-avatar.vue +7 -7
  2. package/components/im-badge/im-badge.vue +326 -0
  3. package/components/im-button/im-button.vue +71 -34
  4. package/components/im-card/im-card.vue +563 -0
  5. package/components/im-chat-item/im-chat-item.vue +5 -4
  6. package/components/im-col/im-col.vue +191 -0
  7. package/components/im-dialog/im-dialog.vue +543 -0
  8. package/components/im-double-tap-view/im-double-tap-view.vue +93 -0
  9. package/components/im-emoji-picker/im-emoji-picker.vue +1143 -0
  10. package/components/im-friend-item/im-friend-item.vue +1 -1
  11. package/components/im-group-item/im-group-item.vue +1 -1
  12. package/components/im-group-member-selector/im-group-member-selector.vue +5 -5
  13. package/components/im-group-rtc-join/im-group-rtc-join.vue +8 -8
  14. package/components/im-icon/im-icon.vue +593 -0
  15. package/components/im-image-upload/im-image-upload.vue +0 -2
  16. package/components/im-link/im-link.vue +628 -0
  17. package/components/im-loading/im-loading.vue +13 -4
  18. package/components/im-mention-picker/im-mention-picker.vue +8 -7
  19. package/components/im-message-action/im-message-action.vue +678 -0
  20. package/components/im-message-item/im-message-item.vue +28 -26
  21. package/components/im-message-list/im-message-list.vue +1108 -0
  22. package/components/im-modal/im-modal.vue +373 -0
  23. package/components/im-nav-bar/im-nav-bar.vue +689 -75
  24. package/components/im-parse/im-parse.vue +1054 -0
  25. package/components/im-popup/im-popup.vue +467 -0
  26. package/components/im-read-receipt/im-read-receipt.vue +10 -10
  27. package/components/im-row/im-row.vue +189 -0
  28. package/components/im-search/im-search.vue +762 -0
  29. package/components/im-sku/im-sku.vue +720 -0
  30. package/components/im-sku/utils/helper.ts +182 -0
  31. package/components/im-stepper/im-stepper.vue +585 -0
  32. package/components/im-stepper/utils/helper.ts +167 -0
  33. package/components/im-tabs/im-tabs.vue +1022 -0
  34. package/components/im-tabs/tabs-navigation.vue +489 -0
  35. package/components/im-tabs/utils/helper.ts +181 -0
  36. package/components/im-tabs-tab-pane/im-tabs-tab-pane.vue +145 -0
  37. package/components/im-upload/im-upload.vue +1236 -0
  38. package/components/im-voice-input/im-voice-input.vue +1 -1
  39. package/index.js +3 -5
  40. package/index.scss +19 -0
  41. package/libs/emoji-data.ts +229 -0
  42. package/libs/index.ts +16 -16
  43. package/package.json +1 -2
  44. package/styles/button.scss +33 -33
  45. package/theme.scss +2 -2
  46. package/types/components/badge.d.ts +42 -0
  47. package/types/components/button.d.ts +2 -1
  48. package/types/components/card.d.ts +122 -0
  49. package/types/components/col.d.ts +37 -0
  50. package/types/components/dialog.d.ts +125 -0
  51. package/types/components/double-tap-view.d.ts +31 -0
  52. package/types/components/emoji-picker.d.ts +121 -0
  53. package/types/components/group-rtc-join.d.ts +1 -1
  54. package/types/components/icon.d.ts +77 -0
  55. package/types/components/link.d.ts +55 -0
  56. package/types/components/loading.d.ts +1 -0
  57. package/types/components/message-action.d.ts +96 -0
  58. package/types/components/message-item.d.ts +2 -2
  59. package/types/components/message-list.d.ts +136 -0
  60. package/types/components/modal.d.ts +106 -0
  61. package/types/components/nav-bar.d.ts +125 -0
  62. package/types/components/parse.d.ts +90 -0
  63. package/types/components/popup.d.ts +58 -0
  64. package/types/components/row.d.ts +31 -0
  65. package/types/components/search.d.ts +54 -0
  66. package/types/components/sku.d.ts +195 -0
  67. package/types/components/stepper.d.ts +99 -0
  68. package/types/components/tabs-tab-pane.d.ts +27 -0
  69. package/types/components/tabs.d.ts +117 -0
  70. package/types/components/upload.d.ts +137 -0
  71. package/types/components.d.ts +19 -1
  72. package/types/index.d.ts +38 -1
  73. package/types/libs/index.d.ts +10 -10
  74. package/types/utils/base64.d.ts +5 -0
  75. package/types/utils/dom.d.ts +3 -0
  76. package/types/utils/enums.d.ts +4 -5
  77. package/types/utils/validator.d.ts +74 -0
  78. package/utils/base64.js +18 -0
  79. package/utils/dom.js +353 -1
  80. package/utils/enums.js +4 -5
  81. package/utils/validator.js +230 -0
  82. package/components/im-file-upload/im-file-upload.vue +0 -309
  83. package/plugins/uview-plus.js +0 -29
  84. package/types/components/arrow-bar.d.ts +0 -14
  85. package/types/components/file-upload.d.ts +0 -58
@@ -0,0 +1,145 @@
1
+ <!-- components/im-tabs/im-tabs-tab-pane.vue -->
2
+ <template>
3
+ <view v-if="shouldRender" :class="[
4
+ 'im-tabs-tab-pane',
5
+ customClass,
6
+ {
7
+ 'im-tabs-tab-pane-active': active,
8
+ 'im-tabs-tab-pane-inactive': !active
9
+ }
10
+ ]" :style="paneStyle">
11
+ <slot v-if="shouldShowContent" />
12
+ </view>
13
+ </template>
14
+
15
+ <script lang="ts" setup>
16
+ import { computed, inject, ref } from 'vue'
17
+ import type { PropType } from 'vue'
18
+
19
+ const props = defineProps({
20
+ index: {
21
+ type: Number,
22
+ default: 0
23
+ },
24
+ id: {
25
+ type: [String, Number] as PropType<string | number>,
26
+ default: ''
27
+ },
28
+ title: {
29
+ type: String,
30
+ default: ''
31
+ },
32
+ lazy: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ destroyOnInactive: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ customClass: {
41
+ type: String,
42
+ default: ''
43
+ }
44
+ })
45
+
46
+ // 注入父组件数据
47
+ const tabsData = inject<any>('tabs')
48
+ const { currentIndex, keepAlive } = tabsData || {}
49
+
50
+ // 记录是否曾经激活过(用于懒加载)
51
+ const hasBeenActive = ref(false)
52
+
53
+ // 计算属性
54
+ const active = computed(() => {
55
+ const isActive = currentIndex?.value === props.index
56
+ if (isActive) {
57
+ hasBeenActive.value = true
58
+ }
59
+ return isActive
60
+ })
61
+
62
+ const shouldRender = computed(() => {
63
+ if (props.destroyOnInactive && !active.value) {
64
+ return false
65
+ }
66
+
67
+ if (props.lazy && !active.value && !hasBeenActive.value) {
68
+ return false
69
+ }
70
+
71
+ return true
72
+ })
73
+
74
+ const shouldShowContent = computed(() => {
75
+ if (keepAlive?.value === false && !active.value) {
76
+ return false
77
+ }
78
+
79
+ if (props.lazy && !active.value && !hasBeenActive.value) {
80
+ return false
81
+ }
82
+
83
+ return true
84
+ })
85
+
86
+ const paneStyle = computed(() => {
87
+ const style: Record<string, any> = {}
88
+
89
+ if (active.value) {
90
+ style.display = 'block'
91
+ } else {
92
+ style.display = 'none'
93
+ }
94
+
95
+ return style
96
+ })
97
+ </script>
98
+
99
+ <style lang="scss" scoped>
100
+ .im-tabs-tab-pane {
101
+ width: 100%;
102
+ height: 100%;
103
+ flex-shrink: 0;
104
+ overflow: auto;
105
+ box-sizing: border-box;
106
+
107
+ // 水平布局
108
+ .im-tabs-content:not(.im-tabs-content-vertical) & {
109
+ width: 100%;
110
+ }
111
+
112
+ // 垂直布局
113
+ .im-tabs-content-vertical & {
114
+ height: 100%;
115
+ }
116
+
117
+ // 激活状态
118
+ &-active {
119
+ display: block;
120
+ }
121
+
122
+ // 非激活状态
123
+ &-inactive {
124
+ display: none;
125
+ }
126
+ }
127
+
128
+ // 动画效果
129
+ .im-tabs-content {
130
+ &-fade {
131
+ .im-tabs-tab-pane {
132
+ animation-duration: 0.3s;
133
+ animation-fill-mode: both;
134
+
135
+ &-enter-active {
136
+ animation-name: im-tabs-fade-in;
137
+ }
138
+
139
+ &-leave-active {
140
+ animation-name: im-tabs-fade-out;
141
+ }
142
+ }
143
+ }
144
+ }
145
+ </style>