@bdlite/domains 1.1.26 → 1.1.27
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/es/layout/channel.js +4 -2
- package/es/layout/constants.js +3 -2
- package/es/layout/menu-item.js +15 -0
- package/es/layout/menu.js +3 -3
- package/package.json +5 -5
package/es/layout/channel.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createSubChannelKit } from '@bdlite/observable/es/create-observable-kit'
|
|
2
|
-
import { CHANNEL_NAME, MENU_CHANNEL_NAME } from './constants'
|
|
2
|
+
import { CHANNEL_NAME, MENU_CHANNEL_NAME, MENU_ITEM_CHANNEL_NAME } from './constants'
|
|
3
3
|
|
|
4
4
|
const obOptions = { relay: 1 }
|
|
5
5
|
const layoutChannel = createSubChannelKit({ channelName: CHANNEL_NAME }, obOptions)
|
|
6
6
|
const menuChannel = createSubChannelKit({ channelName: MENU_CHANNEL_NAME }, obOptions)
|
|
7
|
+
const menuItemChannel = createSubChannelKit({ channelName: MENU_ITEM_CHANNEL_NAME }, obOptions)
|
|
7
8
|
|
|
8
9
|
export const subscribeLayout = layoutChannel.subscribe
|
|
9
|
-
export const subscribeMenu = menuChannel.subscribe
|
|
10
|
+
export const subscribeMenu = menuChannel.subscribe
|
|
11
|
+
export const subscribeMenuItem = menuItemChannel.subscribe
|
package/es/layout/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export const CHANNEL_NAME = '
|
|
2
|
-
export const MENU_CHANNEL_NAME = '
|
|
1
|
+
export const CHANNEL_NAME = 'domainsLayout'
|
|
2
|
+
export const MENU_CHANNEL_NAME = 'domainsMenu'
|
|
3
|
+
export const MENU_ITEM_CHANNEL_NAME = 'domainsMenuItem'
|
|
3
4
|
|
|
4
5
|
// 初始值
|
|
5
6
|
export const LAYOUT_MODE = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isObject } from '@bdlite/strategy'
|
|
2
|
+
import { createObservableKit } from '@bdlite/observable/es/create-observable-kit'
|
|
3
|
+
import { MENU_ITEM_CHANNEL_NAME } from './constants'
|
|
4
|
+
|
|
5
|
+
const { getData, subscribe, publish } = createObservableKit({ selectedItem: {}, iframeUrl: '' }, null, { channelName: MENU_ITEM_CHANNEL_NAME })
|
|
6
|
+
|
|
7
|
+
export const subscribeMenuItem = subscribe
|
|
8
|
+
|
|
9
|
+
export const getMenuData = getData
|
|
10
|
+
|
|
11
|
+
export function publishMenuItem(data = {}) {
|
|
12
|
+
if (isObject(data)) {
|
|
13
|
+
publish({ ...getData(), ...data })
|
|
14
|
+
}
|
|
15
|
+
}
|
package/es/layout/menu.js
CHANGED
|
@@ -2,8 +2,7 @@ import { isObject } from '@bdlite/strategy'
|
|
|
2
2
|
import { createObservableKit } from '@bdlite/observable/es/create-observable-kit'
|
|
3
3
|
import { MENU_CHANNEL_NAME } from './constants'
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const { getData, subscribe, publish } = createObservableKit(defaultData, null, { channelName: MENU_CHANNEL_NAME })
|
|
5
|
+
const { getData, subscribe, publish } = createObservableKit({ menu: [] }, null, { channelName: MENU_CHANNEL_NAME })
|
|
7
6
|
|
|
8
7
|
export const subscribeMenu = subscribe
|
|
9
8
|
|
|
@@ -11,4 +10,5 @@ export function publishMenu(data = {}) {
|
|
|
11
10
|
if (isObject(data)) {
|
|
12
11
|
publish({ ...getData(), ...data })
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
14
|
+
export const getMenuData = getData
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bdlite/domains",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"description": "A domains entity collection library driven by @bdlite/observable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"DDD",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@bdlite/helpers": "^1.1.
|
|
23
|
+
"@bdlite/helpers": "^1.1.24",
|
|
24
24
|
"@bdlite/observable": "^1.1.20",
|
|
25
|
-
"@bdlite/strategy": "^1.1.
|
|
25
|
+
"@bdlite/strategy": "^1.1.25"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@bdlite/helpers": "^1.1.24",
|
|
29
|
-
"@bdlite/observable": "^1.1.
|
|
30
|
-
"@bdlite/strategy": "^1.1.
|
|
29
|
+
"@bdlite/observable": "^1.1.25",
|
|
30
|
+
"@bdlite/strategy": "^1.1.25"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@rollup/plugin-babel": "6.0.4",
|