mali-applet-ui 1.1.16 → 1.1.18

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.
package/index.js CHANGED
@@ -3,15 +3,22 @@ import MaliToast from './modal/toast'
3
3
  import MaliModal from './modal/modal'
4
4
  import MaliLoading from './modal/loading'
5
5
  import MaliStorage from './storage'
6
+ import MaliI18n from './i18n/i18n'
6
7
  import MaliUtils from './utils'
7
8
 
9
+ export function install (Vue) {
10
+ Vue.prototype.$t = MaliI18n.t
11
+ }
12
+
8
13
  const MaliUI = {
9
14
  config,
15
+ install,
10
16
  MaliUtils,
11
17
  MaliToast,
12
18
  MaliModal,
13
19
  MaliLoading,
14
- MaliStorage
20
+ MaliStorage,
21
+ MaliI18n
15
22
  }
16
23
 
17
24
  export {
@@ -19,7 +26,8 @@ export {
19
26
  MaliToast,
20
27
  MaliModal,
21
28
  MaliLoading,
22
- MaliStorage
29
+ MaliStorage,
30
+ MaliI18n
23
31
  }
24
32
 
25
33
  export default MaliUI
@@ -69,7 +69,8 @@ export default {
69
69
  selectMonth: new Date(),
70
70
  weekList: ['日', '一', '二', '三', '四', '五', '六'],
71
71
  months: [],
72
- selectDay: ''
72
+ selectDay: '',
73
+ dateMaps: {}
73
74
  }
74
75
  },
75
76
  computed: {
@@ -112,6 +113,7 @@ export default {
112
113
  rest.forEach(item => {
113
114
  dateMaps[item.date] = item
114
115
  })
116
+ this.dateMaps = dateMaps
115
117
  this.months.forEach(list => {
116
118
  list.forEach(item => {
117
119
  if (dateMaps[item.date]) {
@@ -158,7 +160,10 @@ export default {
158
160
  this.updateCalendar()
159
161
  }
160
162
  this.$emit('input', value)
161
- this.$emit('click', { value })
163
+ this.$emit('click', {
164
+ value,
165
+ data: this.dateMaps[value]
166
+ })
162
167
  },
163
168
  onLastMonth () {
164
169
  this.selectMonth = XEUtils.getWhatMonth(this.selectMonth, -1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "vue2 码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",
@@ -0,0 +1,8 @@
1
+ export interface MlI18nCore {
2
+ getLanguage(): string
3
+ setLanguage(language: string): void
4
+ setLocaleMessage(language: string, message: Record<string, any>): void
5
+ t(key: string, args: any): any
6
+ }
7
+
8
+ export const MaliI18n: MlI18nCore
package/types/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { MaliStorage, MlStorageCore } from './storage'
5
5
  import { MaliModal } from './modal'
6
6
  import { MaliToast } from './toast'
7
7
  import { MaliLoading } from './loading'
8
+ import { MaliI18n, MlI18nCore } from './i18n'
8
9
 
9
10
  export const MaliUI: {
10
11
  version: string
@@ -14,6 +15,7 @@ export const MaliUI: {
14
15
  MaliToast: typeof MaliToast
15
16
  MaliModal: typeof MaliModal
16
17
  MaliLoading: typeof MaliLoading
18
+ MaliI18n: MlI18nCore
17
19
  MaliStorage: MlStorageCore
18
20
  }
19
21
 
@@ -22,7 +24,8 @@ export {
22
24
  MaliToast,
23
25
  MaliModal,
24
26
  MaliLoading,
25
- MaliStorage
27
+ MaliI18n,
28
+ MaliStorage,
26
29
  }
27
30
 
28
31
  export default MaliUI