@bdlite/domains 1.1.23 → 1.1.26

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.
@@ -1,6 +1,9 @@
1
1
  import { createSubChannelKit } from '@bdlite/observable/es/create-observable-kit'
2
- import { CHANNEL_NAME } from './constants'
2
+ import { CHANNEL_NAME, MENU_CHANNEL_NAME } from './constants'
3
3
 
4
- const { subscribe } = createSubChannelKit({ channelName: CHANNEL_NAME }, { relay: 1 })
4
+ const obOptions = { relay: 1 }
5
+ const layoutChannel = createSubChannelKit({ channelName: CHANNEL_NAME }, obOptions)
6
+ const menuChannel = createSubChannelKit({ channelName: MENU_CHANNEL_NAME }, obOptions)
5
7
 
6
- export const subscribeLayout = subscribe
8
+ export const subscribeLayout = layoutChannel.subscribe
9
+ export const subscribeMenu = menuChannel.subscribe
@@ -1,3 +1,11 @@
1
1
  export const CHANNEL_NAME = 'layout'
2
+ export const MENU_CHANNEL_NAME = 'layout-menu'
2
3
 
3
- export const DEFAULT_LAYOUT_DATA = { systemName: '' }
4
+ // 初始值
5
+ export const LAYOUT_MODE = {
6
+ HEADER: 'header',
7
+ SIDER: 'sider',
8
+ BOTH: 'both',
9
+ }
10
+ export const DEFAULT_LAYOUT_MODE = LAYOUT_MODE.HEADER
11
+ export const DEFAULT_LAYOUT_DATA = { systemName: '', showFooter: false, layoutMode: DEFAULT_LAYOUT_MODE }
@@ -0,0 +1,14 @@
1
+ import { isObject } from '@bdlite/strategy'
2
+ import { createObservableKit } from '@bdlite/observable/es/create-observable-kit'
3
+ import { MENU_CHANNEL_NAME } from './constants'
4
+
5
+ const defaultData = { menu: [], selectedItem: {}, iframeKey: '', iframeUrl: '' }
6
+ const { getData, subscribe, publish } = createObservableKit(defaultData, null, { channelName: MENU_CHANNEL_NAME })
7
+
8
+ export const subscribeMenu = subscribe
9
+
10
+ export function publishMenu(data = {}) {
11
+ if (isObject(data)) {
12
+ publish({ ...getData(), ...data })
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ export const PLUGIN_CHANNEL_NAME = 'sider-plugin';
2
+
3
+ export const DEFAULT_TOP_SHOW = true;
@@ -0,0 +1,13 @@
1
+ import { isObject } from '@bdlite/strategy'
2
+ import { createObservableKit } from '@bdlite/observable/es/create-observable-kit'
3
+
4
+ import { DEFAULT_TOP_SHOW } from './constants'
5
+
6
+ const { getData, subscribe, publish } = createObservableKit({ topShow: DEFAULT_TOP_SHOW })
7
+
8
+ export const subscribeSiderPluginStatus = subscribe
9
+ export function publishSiderPluginStatus(data) {
10
+ if (isObject(data)) {
11
+ publish({ ...getData(), ...data })
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bdlite/domains",
3
- "version": "1.1.23",
3
+ "version": "1.1.26",
4
4
  "description": "A domains entity collection library driven by @bdlite/observable",
5
5
  "keywords": [
6
6
  "DDD",
@@ -25,7 +25,7 @@
25
25
  "@bdlite/strategy": "^1.1.0"
26
26
  },
27
27
  "dependencies": {
28
- "@bdlite/helpers": "^1.1.22",
28
+ "@bdlite/helpers": "^1.1.24",
29
29
  "@bdlite/observable": "^1.1.20",
30
30
  "@bdlite/strategy": "^1.1.22"
31
31
  },
@@ -40,5 +40,5 @@
40
40
  "rollup-plugin-typescript2": "^0.29.0",
41
41
  "typescript": "^4.4.3"
42
42
  },
43
- "gitHead": "e737ed039e465ede352a425de20ed7c56f41b95c"
43
+ "gitHead": "bed20dd584017cfa425c66edd505bc74c5d7ab13"
44
44
  }