mali-applet-ui 1.1.71 → 1.1.73

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,6 +3,7 @@ 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 MaliWebview from './webview'
6
7
  import MaliI18n from './i18n/i18n'
7
8
  import MaliUtils from './utils'
8
9
 
@@ -18,6 +19,7 @@ const MaliUI = {
18
19
  MaliModal,
19
20
  MaliLoading,
20
21
  MaliStorage,
22
+ MaliWebview,
21
23
  MaliI18n
22
24
  }
23
25
 
@@ -27,6 +29,7 @@ export {
27
29
  MaliModal,
28
30
  MaliLoading,
29
31
  MaliStorage,
32
+ MaliWebview,
30
33
  MaliI18n
31
34
  }
32
35
 
@@ -33,7 +33,7 @@ export default {
33
33
  type: [Boolean, Number, String],
34
34
  default: null
35
35
  },
36
- content: String,
36
+ content: [Number, String],
37
37
  vertical: Boolean,
38
38
  disabled: Boolean,
39
39
  prefixIcon: String,
@@ -25,7 +25,7 @@ export default {
25
25
  type: Boolean,
26
26
  default: true
27
27
  },
28
- content: String
28
+ content: [Number, String]
29
29
  },
30
30
  computed: {
31
31
  leftStyle () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.1.71",
3
+ "version": "1.1.73",
4
4
  "description": "码里UI-小程序组件库(vue2)",
5
5
  "files": [
6
6
  "lib",
@@ -13,6 +13,7 @@
13
13
  "modal",
14
14
  "store",
15
15
  "storage",
16
+ "webview",
16
17
  "index.js",
17
18
  "theme.scss"
18
19
  ],
package/types/index.d.ts CHANGED
@@ -5,9 +5,21 @@ 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 { MaliWebview, MlWebviewCore } from './webview'
8
9
  import { MaliI18n, MlI18nCore } from './i18n'
9
10
 
10
11
  export interface ConfigOptions {
12
+ webview?: {
13
+ setStorage(params: {
14
+ data: any
15
+ }): void
16
+ }
17
+ loading?: any
18
+ upload?: any
19
+ loadMore?: any
20
+ pager?: any
21
+ notData?: any
22
+ listSelectUserPage?: any
11
23
  [key: string]: any
12
24
  }
13
25
 
@@ -19,8 +31,9 @@ export const MaliUI: {
19
31
  MaliToast: typeof MaliToast
20
32
  MaliModal: typeof MaliModal
21
33
  MaliLoading: typeof MaliLoading
22
- MaliI18n: MlI18nCore
23
34
  MaliStorage: MlStorageCore
35
+ MaliI18n: MlI18nCore
36
+ MaliWebview: MlWebviewCore
24
37
  }
25
38
 
26
39
  export {
@@ -30,6 +43,7 @@ export {
30
43
  MaliLoading,
31
44
  MaliI18n,
32
45
  MaliStorage,
46
+ MaliWebview
33
47
  }
34
48
 
35
49
  export default MaliUI
@@ -0,0 +1,7 @@
1
+ import { ComponentOptions } from 'vue'
2
+
3
+ export interface MlWebviewCore {
4
+ defineH5Transfer(compOptions: ComponentOptions): ComponentOptions
5
+ }
6
+
7
+ export const MaliWebview: MlWebviewCore
@@ -0,0 +1,35 @@
1
+ import XEUtils from 'xe-utils'
2
+ import globalStore from '../config/store'
3
+
4
+ export function defineH5Transfer (vueOpts = {}) {
5
+ return {
6
+ ...vueOpts,
7
+ onLoad (options) {
8
+ if (options) {
9
+ const { _url, _fnName, _syncStorage } = options
10
+ let data = {}
11
+ if (options && _syncStorage) {
12
+ data = XEUtils.toStringJSON(decodeURIComponent(_syncStorage))
13
+ }
14
+ if (globalStore.webview && globalStore.webview.setStorage) {
15
+ globalStore.webview.setStorage({ data })
16
+ }
17
+ if (vueOpts.onStorage) {
18
+ vueOpts.onStorage.call(this, { data })
19
+ }
20
+ if (vueOpts.onLoad) {
21
+ vueOpts.onLoad.call(this, data)
22
+ }
23
+ if (_url && ['navigateTo', 'redirectTo'].includes(_fnName)) {
24
+ uni[_fnName]({ url: decodeURIComponent(_url) })
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ const MaliWebview = {
32
+ defineH5Transfer
33
+ }
34
+
35
+ export default MaliWebview